]> ncurses.scripts.mit.edu Git - ncurses.git/blob - test/configure
84da60cae6c73807d1052380ff1b5bf1a44f65a9
[ncurses.git] / test / configure
1 #! /bin/sh
2 # Guess values for system-dependent variables and create Makefiles.
3 # Generated by Autoconf 2.52.20150926.
4 #
5 # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
6 # Free Software Foundation, Inc.
7 # This configure script is free software; the Free Software Foundation
8 # gives unlimited permission to copy, distribute and modify it.
9
10 # Avoid depending upon Character Ranges.
11 as_cr_letters='abcdefghijklmnopqrstuvwxyz'
12 as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
13 as_cr_Letters=$as_cr_letters$as_cr_LETTERS
14 as_cr_digits='0123456789'
15 as_cr_alnum=$as_cr_Letters$as_cr_digits
16
17 # Sed expression to map a string onto a valid variable name.
18 as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
19
20 # Sed expression to map a string onto a valid CPP name.
21 as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
22
23 # Be Bourne compatible
24 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
25   emulate sh
26   NULLCMD=:
27 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
28   set -o posix
29 fi
30
31 # Name of the executable.
32 as_me=`echo "$0" |sed 's,.*[\\/],,'`
33
34 if expr a : '\(a\)' >/dev/null 2>&1; then
35   as_expr=expr
36 else
37   as_expr=false
38 fi
39
40 rm -f conf$$ conf$$.exe conf$$.file
41 echo >conf$$.file
42 if ln -s conf$$.file conf$$ 2>/dev/null; then
43   # We could just check for DJGPP; but this test a) works b) is more generic
44   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
45   if test -f conf$$.exe; then
46     # Don't use ln at all; we don't have any links
47     as_ln_s='cp -p'
48   else
49     as_ln_s='ln -s'
50   fi
51 elif ln conf$$.file conf$$ 2>/dev/null; then
52   as_ln_s=ln
53 else
54   as_ln_s='cp -p'
55 fi
56 rm -f conf$$ conf$$.exe conf$$.file
57
58 as_executable_p="test -f"
59
60 # Support unset when possible.
61 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
62   as_unset=unset
63 else
64   as_unset=false
65 fi
66
67 # NLS nuisances.
68 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
69 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
70 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
71 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
72 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
73 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
74 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
75 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
76
77 # IFS
78 # We need space, tab and new line, in precisely that order.
79 as_nl='
80 '
81 IFS="   $as_nl"
82
83 # CDPATH.
84 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
85
86 # Name of the host.
87 # hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
88 # so uname gets run too.
89 ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
90
91 exec 6>&1
92
93 #
94 # Initializations.
95 #
96 ac_default_prefix=/usr/local
97 cross_compiling=no
98 subdirs=
99 MFLAGS= MAKEFLAGS=
100 SHELL=${CONFIG_SHELL-/bin/sh}
101
102 # Maximum number of lines to put in a shell here document.
103 # This variable seems obsolete.  It should probably be removed, and
104 # only ac_max_sed_lines should be used.
105 : ${ac_max_here_lines=38}
106
107 ac_unique_file="ncurses.c"
108
109 # Initialize some variables set by options.
110 ac_init_help=
111 ac_init_version=false
112 # The variables have the same names as the options, with
113 # dashes changed to underlines.
114 cache_file=/dev/null
115 exec_prefix=NONE
116 no_create=
117 no_recursion=
118 prefix=NONE
119 program_prefix=NONE
120 program_suffix=NONE
121 program_transform_name=s,x,x,
122 silent=
123 site=
124 srcdir=
125 verbose=
126 x_includes=NONE
127 x_libraries=NONE
128
129 # Installation directory options.
130 # These are left unexpanded so users can "make install exec_prefix=/foo"
131 # and all the variables that are supposed to be based on exec_prefix
132 # by default will actually change.
133 # Use braces instead of parens because sh, perl, etc. also accept them.
134 bindir='${exec_prefix}/bin'
135 sbindir='${exec_prefix}/sbin'
136 libexecdir='${exec_prefix}/libexec'
137 datarootdir='${prefix}/share'
138 datadir='${datarootdir}'
139 sysconfdir='${prefix}/etc'
140 sharedstatedir='${prefix}/com'
141 localstatedir='${prefix}/var'
142 libdir='${exec_prefix}/lib'
143 includedir='${prefix}/include'
144 oldincludedir='/usr/include'
145 infodir='${datarootdir}/info'
146 mandir='${datarootdir}/man'
147
148 # Identity of this package.
149 PACKAGE_NAME=
150 PACKAGE_TARNAME=
151 PACKAGE_VERSION=
152 PACKAGE_STRING=
153 PACKAGE_BUGREPORT=
154
155 ac_prev=
156 for ac_option
157 do
158   # If the previous option needs an argument, assign it.
159   if test -n "$ac_prev"; then
160     eval "$ac_prev=\$ac_option"
161     ac_prev=
162     continue
163   fi
164
165   ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
166
167   # Accept the important Cygnus configure options, so we can diagnose typos.
168
169   case $ac_option in
170
171   -bindir | --bindir | --bindi | --bind | --bin | --bi)
172     ac_prev=bindir ;;
173   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
174     bindir=$ac_optarg ;;
175
176   -build | --build | --buil | --bui | --bu)
177     ac_prev=build_alias ;;
178   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
179     build_alias=$ac_optarg ;;
180
181   -cache-file | --cache-file | --cache-fil | --cache-fi \
182   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
183     ac_prev=cache_file ;;
184   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
185   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
186     cache_file=$ac_optarg ;;
187
188   --config-cache | -C)
189     cache_file=config.cache ;;
190
191   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
192     ac_prev=datadir ;;
193   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
194   | --da=*)
195     datadir=$ac_optarg ;;
196
197   -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
198   | --dataroo | --dataro | --datar)
199     ac_prev=datarootdir ;;
200   -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
201   | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
202     datarootdir=$ac_optarg ;;
203
204   -disable-* | --disable-*)
205     ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
206     # Reject names that are not valid shell variable names.
207     expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
208       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
209    { (exit 1); exit 1; }; }
210     ac_feature=`echo $ac_feature | sed 's/-/_/g'`
211     eval "enable_$ac_feature=no" ;;
212
213   -enable-* | --enable-*)
214     ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
215     # Reject names that are not valid shell variable names.
216     expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
217       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
218    { (exit 1); exit 1; }; }
219     ac_feature=`echo $ac_feature | sed 's/-/_/g'`
220     case $ac_option in
221       *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
222       *) ac_optarg=yes ;;
223     esac
224     eval "enable_$ac_feature='$ac_optarg'" ;;
225
226   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
227   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
228   | --exec | --exe | --ex)
229     ac_prev=exec_prefix ;;
230   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
231   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
232   | --exec=* | --exe=* | --ex=*)
233     exec_prefix=$ac_optarg ;;
234
235   -gas | --gas | --ga | --g)
236     # Obsolete; use --with-gas.
237     with_gas=yes ;;
238
239   -help | --help | --hel | --he | -h)
240     ac_init_help=long ;;
241   -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
242     ac_init_help=recursive ;;
243   -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
244     ac_init_help=short ;;
245
246   -host | --host | --hos | --ho)
247     ac_prev=host_alias ;;
248   -host=* | --host=* | --hos=* | --ho=*)
249     host_alias=$ac_optarg ;;
250
251   -includedir | --includedir | --includedi | --included | --include \
252   | --includ | --inclu | --incl | --inc)
253     ac_prev=includedir ;;
254   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
255   | --includ=* | --inclu=* | --incl=* | --inc=*)
256     includedir=$ac_optarg ;;
257
258   -infodir | --infodir | --infodi | --infod | --info | --inf)
259     ac_prev=infodir ;;
260   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
261     infodir=$ac_optarg ;;
262
263   -libdir | --libdir | --libdi | --libd)
264     ac_prev=libdir ;;
265   -libdir=* | --libdir=* | --libdi=* | --libd=*)
266     libdir=$ac_optarg ;;
267
268   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
269   | --libexe | --libex | --libe)
270     ac_prev=libexecdir ;;
271   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
272   | --libexe=* | --libex=* | --libe=*)
273     libexecdir=$ac_optarg ;;
274
275   -localstatedir | --localstatedir | --localstatedi | --localstated \
276   | --localstate | --localstat | --localsta | --localst \
277   | --locals | --local | --loca | --loc | --lo)
278     ac_prev=localstatedir ;;
279   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
280   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
281   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
282     localstatedir=$ac_optarg ;;
283
284   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
285     ac_prev=mandir ;;
286   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
287     mandir=$ac_optarg ;;
288
289   -nfp | --nfp | --nf)
290     # Obsolete; use --without-fp.
291     with_fp=no ;;
292
293   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
294   | --no-cr | --no-c)
295     no_create=yes ;;
296
297   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
298   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
299     no_recursion=yes ;;
300
301   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
302   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
303   | --oldin | --oldi | --old | --ol | --o)
304     ac_prev=oldincludedir ;;
305   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
306   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
307   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
308     oldincludedir=$ac_optarg ;;
309
310   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
311     ac_prev=prefix ;;
312   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
313     prefix=$ac_optarg ;;
314
315   -program-prefix | --program-prefix | --program-prefi | --program-pref \
316   | --program-pre | --program-pr | --program-p)
317     ac_prev=program_prefix ;;
318   -program-prefix=* | --program-prefix=* | --program-prefi=* \
319   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
320     program_prefix=$ac_optarg ;;
321
322   -program-suffix | --program-suffix | --program-suffi | --program-suff \
323   | --program-suf | --program-su | --program-s)
324     ac_prev=program_suffix ;;
325   -program-suffix=* | --program-suffix=* | --program-suffi=* \
326   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
327     program_suffix=$ac_optarg ;;
328
329   -program-transform-name | --program-transform-name \
330   | --program-transform-nam | --program-transform-na \
331   | --program-transform-n | --program-transform- \
332   | --program-transform | --program-transfor \
333   | --program-transfo | --program-transf \
334   | --program-trans | --program-tran \
335   | --progr-tra | --program-tr | --program-t)
336     ac_prev=program_transform_name ;;
337   -program-transform-name=* | --program-transform-name=* \
338   | --program-transform-nam=* | --program-transform-na=* \
339   | --program-transform-n=* | --program-transform-=* \
340   | --program-transform=* | --program-transfor=* \
341   | --program-transfo=* | --program-transf=* \
342   | --program-trans=* | --program-tran=* \
343   | --progr-tra=* | --program-tr=* | --program-t=*)
344     program_transform_name=$ac_optarg ;;
345
346   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
347   | -silent | --silent | --silen | --sile | --sil)
348     silent=yes ;;
349
350   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
351     ac_prev=sbindir ;;
352   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
353   | --sbi=* | --sb=*)
354     sbindir=$ac_optarg ;;
355
356   -sharedstatedir | --sharedstatedir | --sharedstatedi \
357   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
358   | --sharedst | --shareds | --shared | --share | --shar \
359   | --sha | --sh)
360     ac_prev=sharedstatedir ;;
361   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
362   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
363   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
364   | --sha=* | --sh=*)
365     sharedstatedir=$ac_optarg ;;
366
367   -site | --site | --sit)
368     ac_prev=site ;;
369   -site=* | --site=* | --sit=*)
370     site=$ac_optarg ;;
371
372   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
373     ac_prev=srcdir ;;
374   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
375     srcdir=$ac_optarg ;;
376
377   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
378   | --syscon | --sysco | --sysc | --sys | --sy)
379     ac_prev=sysconfdir ;;
380   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
381   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
382     sysconfdir=$ac_optarg ;;
383
384   -target | --target | --targe | --targ | --tar | --ta | --t)
385     ac_prev=target_alias ;;
386   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
387     target_alias=$ac_optarg ;;
388
389   -v | -verbose | --verbose | --verbos | --verbo | --verb)
390     verbose=yes ;;
391
392   -version | --version | --versio | --versi | --vers | -V)
393     ac_init_version=: ;;
394
395   -with-* | --with-*)
396     ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
397     # Reject names that are not valid shell variable names.
398     expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
399       { echo "$as_me: error: invalid package name: $ac_package" >&2
400    { (exit 1); exit 1; }; }
401     ac_package=`echo $ac_package| sed 's/-/_/g'`
402     case $ac_option in
403       *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
404       *) ac_optarg=yes ;;
405     esac
406     eval "with_$ac_package='$ac_optarg'" ;;
407
408   -without-* | --without-*)
409     ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
410     # Reject names that are not valid shell variable names.
411     expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
412       { echo "$as_me: error: invalid package name: $ac_package" >&2
413    { (exit 1); exit 1; }; }
414     ac_package=`echo $ac_package | sed 's/-/_/g'`
415     eval "with_$ac_package=no" ;;
416
417   --x)
418     # Obsolete; use --with-x.
419     with_x=yes ;;
420
421   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
422   | --x-incl | --x-inc | --x-in | --x-i)
423     ac_prev=x_includes ;;
424   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
425   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
426     x_includes=$ac_optarg ;;
427
428   -x-libraries | --x-libraries | --x-librarie | --x-librari \
429   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
430     ac_prev=x_libraries ;;
431   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
432   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
433     x_libraries=$ac_optarg ;;
434
435   -*) { echo "$as_me: error: unrecognized option: $ac_option
436 Try \`$0 --help' for more information." >&2
437    { (exit 1); exit 1; }; }
438     ;;
439
440   *=*)
441     ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
442     # Reject names that are not valid shell variable names.
443     expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
444       { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
445    { (exit 1); exit 1; }; }
446     ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
447     eval "$ac_envvar='$ac_optarg'"
448     export $ac_envvar ;;
449
450   *)
451     # FIXME: should be removed in autoconf 3.0.
452     echo "$as_me: WARNING: you should use --build, --host, --target" >&2
453     expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
454       echo "$as_me: WARNING: invalid host type: $ac_option" >&2
455     : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
456     ;;
457
458   esac
459 done
460
461 if test -n "$ac_prev"; then
462   ac_option=--`echo $ac_prev | sed 's/_/-/g'`
463   { echo "$as_me: error: missing argument to $ac_option" >&2
464    { (exit 1); exit 1; }; }
465 fi
466
467 # Be sure to have absolute paths.
468 for ac_var in exec_prefix prefix
469 do
470   eval ac_val=$`echo $ac_var`
471   case $ac_val in
472     [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
473     *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
474    { (exit 1); exit 1; }; };;
475   esac
476 done
477
478 # Be sure to have absolute paths.
479 for ac_var in bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir \
480               localstatedir libdir includedir oldincludedir infodir mandir
481 do
482   eval ac_val=$`echo $ac_var`
483   case $ac_val in
484     [\\/$]* | ?:[\\/]* ) ;;
485     *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
486    { (exit 1); exit 1; }; };;
487   esac
488 done
489
490 # There might be people who depend on the old broken behavior: `$host'
491 # used to hold the argument of --host etc.
492 build=$build_alias
493 host=$host_alias
494 target=$target_alias
495
496 # FIXME: should be removed in autoconf 3.0.
497 if test "x$host_alias" != x; then
498   if test "x$build_alias" = x; then
499     cross_compiling=maybe
500     echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
501     If a cross compiler is detected then cross compile mode will be used." >&2
502   elif test "x$build_alias" != "x$host_alias"; then
503     cross_compiling=yes
504   fi
505 fi
506
507 ac_tool_prefix=
508 test -n "$host_alias" && ac_tool_prefix=$host_alias-
509
510 test "$silent" = yes && exec 6>/dev/null
511
512 # Find the source files, if location was not specified.
513 if test -z "$srcdir"; then
514   ac_srcdir_defaulted=yes
515   # Try the directory containing this script, then its parent.
516   ac_prog=$0
517   ac_confdir=`echo "$ac_prog" | sed 's%[\\/][^\\/][^\\/]*$%%'`
518   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
519   srcdir=$ac_confdir
520   if test ! -r $srcdir/$ac_unique_file; then
521     srcdir=..
522   fi
523 else
524   ac_srcdir_defaulted=no
525 fi
526 if test ! -r $srcdir/$ac_unique_file; then
527   if test "$ac_srcdir_defaulted" = yes; then
528     { echo "$as_me: error: cannot find sources in $ac_confdir or .." >&2
529    { (exit 1); exit 1; }; }
530   else
531     { echo "$as_me: error: cannot find sources in $srcdir" >&2
532    { (exit 1); exit 1; }; }
533   fi
534 fi
535 srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
536 ac_env_build_alias_set=${build_alias+set}
537 ac_env_build_alias_value=$build_alias
538 ac_cv_env_build_alias_set=${build_alias+set}
539 ac_cv_env_build_alias_value=$build_alias
540 ac_env_host_alias_set=${host_alias+set}
541 ac_env_host_alias_value=$host_alias
542 ac_cv_env_host_alias_set=${host_alias+set}
543 ac_cv_env_host_alias_value=$host_alias
544 ac_env_target_alias_set=${target_alias+set}
545 ac_env_target_alias_value=$target_alias
546 ac_cv_env_target_alias_set=${target_alias+set}
547 ac_cv_env_target_alias_value=$target_alias
548 ac_env_CC_set=${CC+set}
549 ac_env_CC_value=$CC
550 ac_cv_env_CC_set=${CC+set}
551 ac_cv_env_CC_value=$CC
552 ac_env_CFLAGS_set=${CFLAGS+set}
553 ac_env_CFLAGS_value=$CFLAGS
554 ac_cv_env_CFLAGS_set=${CFLAGS+set}
555 ac_cv_env_CFLAGS_value=$CFLAGS
556 ac_env_LDFLAGS_set=${LDFLAGS+set}
557 ac_env_LDFLAGS_value=$LDFLAGS
558 ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
559 ac_cv_env_LDFLAGS_value=$LDFLAGS
560 ac_env_CPPFLAGS_set=${CPPFLAGS+set}
561 ac_env_CPPFLAGS_value=$CPPFLAGS
562 ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
563 ac_cv_env_CPPFLAGS_value=$CPPFLAGS
564 ac_env_CPP_set=${CPP+set}
565 ac_env_CPP_value=$CPP
566 ac_cv_env_CPP_set=${CPP+set}
567 ac_cv_env_CPP_value=$CPP
568
569 #
570 # Report the --help message.
571 #
572 if test "$ac_init_help" = "long"; then
573   # Omit some internal or obsolete options to make the list less imposing.
574   # This message is too long to be a string in the A/UX 3.1 sh.
575   cat <<EOF
576 \`configure' configures this package to adapt to many kinds of systems.
577
578 Usage: $0 [OPTION]... [VAR=VALUE]...
579
580 To assign environment variables (e.g., CC, CFLAGS...), specify them as
581 VAR=VALUE.  See below for descriptions of some of the useful variables.
582
583 Defaults for the options are specified in brackets.
584
585 Configuration:
586   -h, --help              display this help and exit
587       --help=short        display options specific to this package
588       --help=recursive    display the short help of all the included packages
589   -V, --version           display version information and exit
590   -q, --quiet, --silent   do not print \`checking...' messages
591       --cache-file=FILE   cache test results in FILE [disabled]
592   -C, --config-cache      alias for \`--cache-file=config.cache'
593   -n, --no-create         do not create output files
594       --srcdir=DIR        find the sources in DIR [configure dir or \`..']
595
596 EOF
597
598   cat <<EOF
599 Installation directories:
600   --prefix=PREFIX         install architecture-independent files in PREFIX
601                           [$ac_default_prefix]
602   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
603                           [PREFIX]
604
605 By default, \`make install' will install all the files in
606 \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
607 an installation prefix other than \`$ac_default_prefix' using \`--prefix',
608 for instance \`--prefix=\$HOME'.
609
610 For better control, use the options below.
611
612 Fine tuning of the installation directories:
613   --bindir=DIR            user executables [EPREFIX/bin]
614   --sbindir=DIR           system admin executables [EPREFIX/sbin]
615   --libexecdir=DIR        program executables [EPREFIX/libexec]
616   --datarootdir=DIR       read-only architecture-independent data [PREFIX/share]
617   --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
618   --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
619   --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
620   --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
621   --libdir=DIR            object code libraries [EPREFIX/lib]
622   --includedir=DIR        C header files [PREFIX/include]
623   --oldincludedir=DIR     C header files for non-gcc [/usr/include]
624   --infodir=DIR           info documentation [DATAROOTDIR/info]
625   --mandir=DIR            man documentation [DATAROOTDIR/man]
626 EOF
627
628   cat <<\EOF
629
630 Program names:
631   --program-prefix=PREFIX            prepend PREFIX to installed program names
632   --program-suffix=SUFFIX            append SUFFIX to installed program names
633   --program-transform-name=PROGRAM   run sed PROGRAM on installed program names
634
635 X features:
636   --x-includes=DIR    X include files are in DIR
637   --x-libraries=DIR   X library files are in DIR
638
639 System types:
640   --build=BUILD           configure for building on BUILD [guessed]
641   --host=HOST       build programs to run on HOST [BUILD]
642 EOF
643 fi
644
645 if test -n "$ac_init_help"; then
646
647   cat <<\EOF
648
649 Optional Features:
650   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
651   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
652
653 Optional Packages:
654   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
655   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
656
657   --enable-string-hacks   work around bogus compiler/loader warnings
658 General Options:
659   --with-pkg-config{=path} enable/disable use of pkg-config
660   --disable-echo          do not display "compiling" commands
661 Curses Version-dependent Options:
662   --with-ncurses-wrap-prefix naming-prefix for ncurses wrapped-variables
663   --disable-widec         disable checks for wide-character functions
664   --with-curses-dir=DIR   directory in which (n)curses is installed
665   --with-screen=XXX       use specified curses-libraries
666   --with-ncursesw         use wide ncurses-libraries
667   --with-ncurses          use ncurses-libraries
668   --with-pdcurses         compile/link with pdcurses X11 library
669   --with-curses-colr      compile/link with HPUX 10.x color-curses
670   --with-curses-5lib      compile/link with SunOS 5lib curses
671   --with-Xaw3d            link with Xaw 3d library
672   --with-Xaw3dxft         link with Xaw 3d xft library
673   --with-neXtaw           link with neXT Athena library
674   --with-XawPlus          link with Athena-Plus library
675   --with-x                use the X Window System
676 Testing/development Options:
677   --enable-warnings       test: turn on gcc compiler warnings
678   --with-dmalloc          test: use Gray Watson's dmalloc library
679   --with-dbmalloc         test: use Conor Cahill's dbmalloc library
680   --with-valgrind         test: use valgrind
681   --disable-leaks         test: free permanent memory, analyze leaks
682   --disable-rpath-hack    don't add rpath options for additional libraries
683
684 Some influential environment variables:
685   CC          C compiler command
686   CFLAGS      C compiler flags
687   LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
688               nonstandard directory <lib dir>
689   CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
690               headers in a nonstandard directory <include dir>
691   CPP         C preprocessor
692
693 Use these variables to override the choices made by `configure' or to help
694 it to find libraries and programs with nonstandard names/locations.
695
696 EOF
697 fi
698
699 if test "$ac_init_help" = "recursive"; then
700   # If there are subdirs, report their specific --help.
701   ac_popdir=`pwd`
702   for ac_subdir in : $ac_subdirs_all; do test "x$ac_subdir" = x: && continue
703     cd $ac_subdir
704     # A "../" for each directory in /$ac_subdir.
705     ac_dots=`echo $ac_subdir |
706              sed 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g'`
707
708     case $srcdir in
709     .) # No --srcdir option.  We are building in place.
710       ac_sub_srcdir=$srcdir ;;
711     [\\/]* | ?:[\\/]* ) # Absolute path.
712       ac_sub_srcdir=$srcdir/$ac_subdir ;;
713     *) # Relative path.
714       ac_sub_srcdir=$ac_dots$srcdir/$ac_subdir ;;
715     esac
716
717     # Check for guested configure; otherwise get Cygnus style configure.
718     if test -f $ac_sub_srcdir/configure.gnu; then
719       echo
720       $SHELL $ac_sub_srcdir/configure.gnu  --help=recursive
721     elif test -f $ac_sub_srcdir/configure; then
722       echo
723       $SHELL $ac_sub_srcdir/configure  --help=recursive
724     elif test -f $ac_sub_srcdir/configure.ac ||
725            test -f $ac_sub_srcdir/configure.in; then
726       echo
727       $ac_configure --help
728     else
729       echo "$as_me: WARNING: no configuration information is in $ac_subdir" >&2
730     fi
731     cd $ac_popdir
732   done
733 fi
734
735 test -n "$ac_init_help" && exit 0
736 if $ac_init_version; then
737   cat <<\EOF
738
739 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
740 Free Software Foundation, Inc.
741 This configure script is free software; the Free Software Foundation
742 gives unlimited permission to copy, distribute and modify it.
743 EOF
744   exit 0
745 fi
746 exec 5>config.log
747 cat >&5 <<EOF
748 This file contains any messages produced by compilers while
749 running configure, to aid debugging if configure makes a mistake.
750
751 It was created by $as_me, which was
752 generated by GNU Autoconf 2.52.20150926.  Invocation command line was
753
754   $ $0 $@
755
756 EOF
757 {
758 cat <<_ASUNAME
759 ## ---------- ##
760 ## Platform.  ##
761 ## ---------- ##
762
763 hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
764 uname -m = `(uname -m) 2>/dev/null || echo unknown`
765 uname -r = `(uname -r) 2>/dev/null || echo unknown`
766 uname -s = `(uname -s) 2>/dev/null || echo unknown`
767 uname -v = `(uname -v) 2>/dev/null || echo unknown`
768
769 /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
770 /bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
771
772 /bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
773 /usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
774 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
775 hostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
776 /bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
777 /usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
778 /bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
779
780 PATH = $PATH
781
782 _ASUNAME
783 } >&5
784
785 cat >&5 <<EOF
786 ## ------------ ##
787 ## Core tests.  ##
788 ## ------------ ##
789
790 EOF
791
792 # Keep a trace of the command line.
793 # Strip out --no-create and --no-recursion so they do not pile up.
794 # Also quote any args containing shell meta-characters.
795 ac_configure_args=
796 ac_sep=
797 for ac_arg
798 do
799   case $ac_arg in
800   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
801   | --no-cr | --no-c) ;;
802   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
803   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
804   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
805     ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"`
806     ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
807     ac_sep=" " ;;
808   *) ac_configure_args="$ac_configure_args$ac_sep$ac_arg"
809      ac_sep=" " ;;
810   esac
811   # Get rid of the leading space.
812 done
813
814 # When interrupted or exit'd, cleanup temporary files, and complete
815 # config.log.  We remove comments because anyway the quotes in there
816 # would cause problems or look ugly.
817 trap 'exit_status=$?
818   # Save into config.log some information that might help in debugging.
819   echo >&5
820   echo "## ----------------- ##" >&5
821   echo "## Cache variables.  ##" >&5
822   echo "## ----------------- ##" >&5
823   echo >&5
824   # The following way of writing the cache mishandles newlines in values,
825 {
826   (set) 2>&1 |
827     case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
828     *ac_space=\ *)
829       sed -n \
830         "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
831           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
832       ;;
833     *)
834       sed -n \
835         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
836       ;;
837     esac;
838 } >&5
839   sed "/^$/d" confdefs.h >conftest.log
840   if test -s conftest.log; then
841     echo >&5
842     echo "## ------------ ##" >&5
843     echo "## confdefs.h.  ##" >&5
844     echo "## ------------ ##" >&5
845     echo >&5
846     cat conftest.log >&5
847   fi
848   (echo; echo) >&5
849   test "$ac_signal" != 0 &&
850     echo "$as_me: caught signal $ac_signal" >&5
851   echo "$as_me: exit $exit_status" >&5
852   rm -rf conftest* confdefs* core core.* *.core conf$$* $ac_clean_files &&
853     exit $exit_status
854      ' 0
855 for ac_signal in 1 2 13 15; do
856   trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
857 done
858 ac_signal=0
859
860 # confdefs.h avoids OS command line length limits that DEFS can exceed.
861 rm -rf conftest* confdefs.h
862 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
863 echo >confdefs.h
864
865 # Let the site file select an alternate cache file if it wants to.
866 # Prefer explicitly selected file to automatically selected ones.
867 if test -z "$CONFIG_SITE"; then
868   if test "x$prefix" != xNONE; then
869     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
870   else
871     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
872   fi
873 fi
874 for ac_site_file in $CONFIG_SITE; do
875   if test -r "$ac_site_file"; then
876     { echo "$as_me:876: loading site script $ac_site_file" >&5
877 echo "$as_me: loading site script $ac_site_file" >&6;}
878     cat "$ac_site_file" >&5
879     . "$ac_site_file"
880   fi
881 done
882
883 if test -r "$cache_file"; then
884   # Some versions of bash will fail to source /dev/null (special
885   # files actually), so we avoid doing that.
886   if test -f "$cache_file"; then
887     { echo "$as_me:887: loading cache $cache_file" >&5
888 echo "$as_me: loading cache $cache_file" >&6;}
889     case $cache_file in
890       [\\/]* | ?:[\\/]* ) . $cache_file;;
891       *)                      . ./$cache_file;;
892     esac
893   fi
894 else
895   { echo "$as_me:895: creating cache $cache_file" >&5
896 echo "$as_me: creating cache $cache_file" >&6;}
897   >$cache_file
898 fi
899
900 # Check that the precious variables saved in the cache have kept the same
901 # value.
902 ac_cache_corrupted=false
903 for ac_var in `(set) 2>&1 |
904                sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
905   eval ac_old_set=\$ac_cv_env_${ac_var}_set
906   eval ac_new_set=\$ac_env_${ac_var}_set
907   eval ac_old_val="\$ac_cv_env_${ac_var}_value"
908   eval ac_new_val="\$ac_env_${ac_var}_value"
909   case $ac_old_set,$ac_new_set in
910     set,)
911       { echo "$as_me:911: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
912 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
913       ac_cache_corrupted=: ;;
914     ,set)
915       { echo "$as_me:915: error: \`$ac_var' was not set in the previous run" >&5
916 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
917       ac_cache_corrupted=: ;;
918     ,);;
919     *)
920       if test "x$ac_old_val" != "x$ac_new_val"; then
921         { echo "$as_me:921: error: \`$ac_var' has changed since the previous run:" >&5
922 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
923         { echo "$as_me:923:   former value:  $ac_old_val" >&5
924 echo "$as_me:   former value:  $ac_old_val" >&2;}
925         { echo "$as_me:925:   current value: $ac_new_val" >&5
926 echo "$as_me:   current value: $ac_new_val" >&2;}
927         ac_cache_corrupted=:
928       fi;;
929   esac
930   # Pass precious variables to config.status.  It doesn't matter if
931   # we pass some twice (in addition to the command line arguments).
932   if test "$ac_new_set" = set; then
933     case $ac_new_val in
934     *" "*|*"    "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
935       ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"`
936       ac_configure_args="$ac_configure_args '$ac_arg'"
937       ;;
938     *) ac_configure_args="$ac_configure_args $ac_var=$ac_new_val"
939        ;;
940     esac
941   fi
942 done
943 if $ac_cache_corrupted; then
944   { echo "$as_me:944: error: changes in the environment can compromise the build" >&5
945 echo "$as_me: error: changes in the environment can compromise the build" >&2;}
946   { { echo "$as_me:946: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
947 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
948    { (exit 1); exit 1; }; }
949 fi
950
951 ac_ext=c
952 ac_cpp='$CPP $CPPFLAGS'
953 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
954 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
955 ac_compiler_gnu=$ac_cv_c_compiler_gnu
956 ac_main_return=return
957
958 case `echo "testing\c" 2>/dev/null; echo 1,2,3`,`echo -n testing 2>/dev/null; echo 1,2,3` in
959   *c*,-n*) ECHO_N= ECHO_C=      # newlines do not sed ;-) only broken shells would use this case anyway
960                    ECHO_T='     ' ;;
961   *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
962   *)      ECHO_N= ECHO_C='\c' ECHO_T= ;;
963 esac
964 echo "#! $SHELL" >conftest.sh
965 echo  "exit 0"   >>conftest.sh
966 chmod +x conftest.sh
967 if { (echo "$as_me:967: PATH=\".;.\"; conftest.sh") >&5
968   (PATH=".;."; conftest.sh) 2>&5
969   ac_status=$?
970   echo "$as_me:970: \$? = $ac_status" >&5
971   (exit $ac_status); }; then
972   ac_path_separator=';'
973 else
974   ac_path_separator=:
975 fi
976 PATH_SEPARATOR="$ac_path_separator"
977 rm -f conftest.sh
978
979 ac_config_headers="$ac_config_headers ncurses_cfg.h:ncurses_tst.hin"
980
981 test -f config.guess || ( test -f ../config.guess && cp ../config.guess ./ )
982
983 test -f config.sub || ( test -f ../config.sub && cp ../config.sub ./ )
984
985 ac_aux_dir=
986 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
987   if test -f $ac_dir/install-sh; then
988     ac_aux_dir=$ac_dir
989     ac_install_sh="$ac_aux_dir/install-sh -c"
990     break
991   elif test -f $ac_dir/install.sh; then
992     ac_aux_dir=$ac_dir
993     ac_install_sh="$ac_aux_dir/install.sh -c"
994     break
995   elif test -f $ac_dir/shtool; then
996     ac_aux_dir=$ac_dir
997     ac_install_sh="$ac_aux_dir/shtool install -c"
998     break
999   fi
1000 done
1001 if test -z "$ac_aux_dir"; then
1002   { { echo "$as_me:1002: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
1003 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
1004    { (exit 1); exit 1; }; }
1005 fi
1006 ac_config_guess="$SHELL $ac_aux_dir/config.guess"
1007 ac_config_sub="$SHELL $ac_aux_dir/config.sub"
1008 ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
1009
1010 # Make sure we can run config.sub.
1011 $ac_config_sub sun4 >/dev/null 2>&1 ||
1012   { { echo "$as_me:1012: error: cannot run $ac_config_sub" >&5
1013 echo "$as_me: error: cannot run $ac_config_sub" >&2;}
1014    { (exit 1); exit 1; }; }
1015
1016 echo "$as_me:1016: checking build system type" >&5
1017 echo $ECHO_N "checking build system type... $ECHO_C" >&6
1018 if test "${ac_cv_build+set}" = set; then
1019   echo $ECHO_N "(cached) $ECHO_C" >&6
1020 else
1021   ac_cv_build_alias=$build_alias
1022 test -z "$ac_cv_build_alias" &&
1023   ac_cv_build_alias=`$ac_config_guess`
1024 test -z "$ac_cv_build_alias" &&
1025   { { echo "$as_me:1025: error: cannot guess build type; you must specify one" >&5
1026 echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
1027    { (exit 1); exit 1; }; }
1028 ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
1029   { { echo "$as_me:1029: error: $ac_config_sub $ac_cv_build_alias failed." >&5
1030 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed." >&2;}
1031    { (exit 1); exit 1; }; }
1032
1033 fi
1034 echo "$as_me:1034: result: $ac_cv_build" >&5
1035 echo "${ECHO_T}$ac_cv_build" >&6
1036 build=$ac_cv_build
1037 build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1038 build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1039 build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1040
1041 if test -f $srcdir/config.guess || test -f $ac_aux_dir/config.guess ; then
1042         echo "$as_me:1042: checking host system type" >&5
1043 echo $ECHO_N "checking host system type... $ECHO_C" >&6
1044 if test "${ac_cv_host+set}" = set; then
1045   echo $ECHO_N "(cached) $ECHO_C" >&6
1046 else
1047   ac_cv_host_alias=$host_alias
1048 test -z "$ac_cv_host_alias" &&
1049   ac_cv_host_alias=$ac_cv_build_alias
1050 ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
1051   { { echo "$as_me:1051: error: $ac_config_sub $ac_cv_host_alias failed" >&5
1052 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
1053    { (exit 1); exit 1; }; }
1054
1055 fi
1056 echo "$as_me:1056: result: $ac_cv_host" >&5
1057 echo "${ECHO_T}$ac_cv_host" >&6
1058 host=$ac_cv_host
1059 host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1060 host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1061 host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1062
1063         system_name="$host_os"
1064 else
1065         system_name="`(uname -s -r) 2>/dev/null`"
1066         if test -z "$system_name" ; then
1067                 system_name="`(hostname) 2>/dev/null`"
1068         fi
1069 fi
1070 test -n "$system_name" &&
1071 cat >>confdefs.h <<EOF
1072 #define SYSTEM_NAME "$system_name"
1073 EOF
1074
1075 if test "${cf_cv_system_name+set}" = set; then
1076   echo $ECHO_N "(cached) $ECHO_C" >&6
1077 else
1078   cf_cv_system_name="$system_name"
1079 fi
1080
1081 test -z "$system_name" && system_name="$cf_cv_system_name"
1082 test -n "$cf_cv_system_name" && echo "$as_me:1082: result: Configuring for $cf_cv_system_name" >&5
1083 echo "${ECHO_T}Configuring for $cf_cv_system_name" >&6
1084
1085 if test ".$system_name" != ".$cf_cv_system_name" ; then
1086         echo "$as_me:1086: result: Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&5
1087 echo "${ECHO_T}Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&6
1088         { { echo "$as_me:1088: error: \"Please remove config.cache and try again.\"" >&5
1089 echo "$as_me: error: \"Please remove config.cache and try again.\"" >&2;}
1090    { (exit 1); exit 1; }; }
1091 fi
1092
1093 test "$program_prefix" != NONE &&
1094   program_transform_name="s,^,$program_prefix,;$program_transform_name"
1095 # Use a double $ so make ignores it.
1096 test "$program_suffix" != NONE &&
1097   program_transform_name="s,\$,$program_suffix,;$program_transform_name"
1098 # Double any \ or $.  echo might interpret backslashes.
1099 # By default was `s,x,x', remove it if useless.
1100 cat <<\_ACEOF >conftest.sed
1101 s/[\\$]/&&/g;s/;s,x,x,$//
1102 _ACEOF
1103 program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
1104 rm conftest.sed
1105
1106 echo "$as_me:1106: checking whether ${MAKE-make} sets \${MAKE}" >&5
1107 echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6
1108 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
1109 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
1110   echo $ECHO_N "(cached) $ECHO_C" >&6
1111 else
1112   cat >conftest.make <<\EOF
1113 all:
1114         @echo 'ac_maketemp="${MAKE}"'
1115 EOF
1116 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
1117 eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
1118 if test -n "$ac_maketemp"; then
1119   eval ac_cv_prog_make_${ac_make}_set=yes
1120 else
1121   eval ac_cv_prog_make_${ac_make}_set=no
1122 fi
1123 rm -f conftest.make
1124 fi
1125 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
1126   echo "$as_me:1126: result: yes" >&5
1127 echo "${ECHO_T}yes" >&6
1128   SET_MAKE=
1129 else
1130   echo "$as_me:1130: result: no" >&5
1131 echo "${ECHO_T}no" >&6
1132   SET_MAKE="MAKE=${MAKE-make}"
1133 fi
1134
1135 ac_ext=c
1136 ac_cpp='$CPP $CPPFLAGS'
1137 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1138 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1139 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1140 ac_main_return=return
1141 if test -n "$ac_tool_prefix"; then
1142   # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
1143 set dummy ${ac_tool_prefix}gcc; ac_word=$2
1144 echo "$as_me:1144: checking for $ac_word" >&5
1145 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1146 if test "${ac_cv_prog_CC+set}" = set; then
1147   echo $ECHO_N "(cached) $ECHO_C" >&6
1148 else
1149   if test -n "$CC"; then
1150   ac_cv_prog_CC="$CC" # Let the user override the test.
1151 else
1152   ac_save_IFS=$IFS; IFS=$ac_path_separator
1153 ac_dummy="$PATH"
1154 for ac_dir in $ac_dummy; do
1155   IFS=$ac_save_IFS
1156   test -z "$ac_dir" && ac_dir=.
1157   $as_executable_p "$ac_dir/$ac_word" || continue
1158 ac_cv_prog_CC="${ac_tool_prefix}gcc"
1159 echo "$as_me:1159: found $ac_dir/$ac_word" >&5
1160 break
1161 done
1162
1163 fi
1164 fi
1165 CC=$ac_cv_prog_CC
1166 if test -n "$CC"; then
1167   echo "$as_me:1167: result: $CC" >&5
1168 echo "${ECHO_T}$CC" >&6
1169 else
1170   echo "$as_me:1170: result: no" >&5
1171 echo "${ECHO_T}no" >&6
1172 fi
1173
1174 fi
1175 if test -z "$ac_cv_prog_CC"; then
1176   ac_ct_CC=$CC
1177   # Extract the first word of "gcc", so it can be a program name with args.
1178 set dummy gcc; ac_word=$2
1179 echo "$as_me:1179: checking for $ac_word" >&5
1180 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1181 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1182   echo $ECHO_N "(cached) $ECHO_C" >&6
1183 else
1184   if test -n "$ac_ct_CC"; then
1185   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1186 else
1187   ac_save_IFS=$IFS; IFS=$ac_path_separator
1188 ac_dummy="$PATH"
1189 for ac_dir in $ac_dummy; do
1190   IFS=$ac_save_IFS
1191   test -z "$ac_dir" && ac_dir=.
1192   $as_executable_p "$ac_dir/$ac_word" || continue
1193 ac_cv_prog_ac_ct_CC="gcc"
1194 echo "$as_me:1194: found $ac_dir/$ac_word" >&5
1195 break
1196 done
1197
1198 fi
1199 fi
1200 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1201 if test -n "$ac_ct_CC"; then
1202   echo "$as_me:1202: result: $ac_ct_CC" >&5
1203 echo "${ECHO_T}$ac_ct_CC" >&6
1204 else
1205   echo "$as_me:1205: result: no" >&5
1206 echo "${ECHO_T}no" >&6
1207 fi
1208
1209   CC=$ac_ct_CC
1210 else
1211   CC="$ac_cv_prog_CC"
1212 fi
1213
1214 if test -z "$CC"; then
1215   if test -n "$ac_tool_prefix"; then
1216   # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
1217 set dummy ${ac_tool_prefix}cc; ac_word=$2
1218 echo "$as_me:1218: checking for $ac_word" >&5
1219 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1220 if test "${ac_cv_prog_CC+set}" = set; then
1221   echo $ECHO_N "(cached) $ECHO_C" >&6
1222 else
1223   if test -n "$CC"; then
1224   ac_cv_prog_CC="$CC" # Let the user override the test.
1225 else
1226   ac_save_IFS=$IFS; IFS=$ac_path_separator
1227 ac_dummy="$PATH"
1228 for ac_dir in $ac_dummy; do
1229   IFS=$ac_save_IFS
1230   test -z "$ac_dir" && ac_dir=.
1231   $as_executable_p "$ac_dir/$ac_word" || continue
1232 ac_cv_prog_CC="${ac_tool_prefix}cc"
1233 echo "$as_me:1233: found $ac_dir/$ac_word" >&5
1234 break
1235 done
1236
1237 fi
1238 fi
1239 CC=$ac_cv_prog_CC
1240 if test -n "$CC"; then
1241   echo "$as_me:1241: result: $CC" >&5
1242 echo "${ECHO_T}$CC" >&6
1243 else
1244   echo "$as_me:1244: result: no" >&5
1245 echo "${ECHO_T}no" >&6
1246 fi
1247
1248 fi
1249 if test -z "$ac_cv_prog_CC"; then
1250   ac_ct_CC=$CC
1251   # Extract the first word of "cc", so it can be a program name with args.
1252 set dummy cc; ac_word=$2
1253 echo "$as_me:1253: checking for $ac_word" >&5
1254 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1255 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1256   echo $ECHO_N "(cached) $ECHO_C" >&6
1257 else
1258   if test -n "$ac_ct_CC"; then
1259   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1260 else
1261   ac_save_IFS=$IFS; IFS=$ac_path_separator
1262 ac_dummy="$PATH"
1263 for ac_dir in $ac_dummy; do
1264   IFS=$ac_save_IFS
1265   test -z "$ac_dir" && ac_dir=.
1266   $as_executable_p "$ac_dir/$ac_word" || continue
1267 ac_cv_prog_ac_ct_CC="cc"
1268 echo "$as_me:1268: found $ac_dir/$ac_word" >&5
1269 break
1270 done
1271
1272 fi
1273 fi
1274 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1275 if test -n "$ac_ct_CC"; then
1276   echo "$as_me:1276: result: $ac_ct_CC" >&5
1277 echo "${ECHO_T}$ac_ct_CC" >&6
1278 else
1279   echo "$as_me:1279: result: no" >&5
1280 echo "${ECHO_T}no" >&6
1281 fi
1282
1283   CC=$ac_ct_CC
1284 else
1285   CC="$ac_cv_prog_CC"
1286 fi
1287
1288 fi
1289 if test -z "$CC"; then
1290   # Extract the first word of "cc", so it can be a program name with args.
1291 set dummy cc; ac_word=$2
1292 echo "$as_me:1292: checking for $ac_word" >&5
1293 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1294 if test "${ac_cv_prog_CC+set}" = set; then
1295   echo $ECHO_N "(cached) $ECHO_C" >&6
1296 else
1297   if test -n "$CC"; then
1298   ac_cv_prog_CC="$CC" # Let the user override the test.
1299 else
1300   ac_prog_rejected=no
1301   ac_save_IFS=$IFS; IFS=$ac_path_separator
1302 ac_dummy="$PATH"
1303 for ac_dir in $ac_dummy; do
1304   IFS=$ac_save_IFS
1305   test -z "$ac_dir" && ac_dir=.
1306   $as_executable_p "$ac_dir/$ac_word" || continue
1307 if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1308   ac_prog_rejected=yes
1309   continue
1310 fi
1311 ac_cv_prog_CC="cc"
1312 echo "$as_me:1312: found $ac_dir/$ac_word" >&5
1313 break
1314 done
1315
1316 if test $ac_prog_rejected = yes; then
1317   # We found a bogon in the path, so make sure we never use it.
1318   set dummy $ac_cv_prog_CC
1319   shift
1320   if test $# != 0; then
1321     # We chose a different compiler from the bogus one.
1322     # However, it has the same basename, so the bogon will be chosen
1323     # first if we set CC to just the basename; use the full file name.
1324     shift
1325     set dummy "$ac_dir/$ac_word" ${1+"$@"}
1326     shift
1327     ac_cv_prog_CC="$@"
1328   fi
1329 fi
1330 fi
1331 fi
1332 CC=$ac_cv_prog_CC
1333 if test -n "$CC"; then
1334   echo "$as_me:1334: result: $CC" >&5
1335 echo "${ECHO_T}$CC" >&6
1336 else
1337   echo "$as_me:1337: result: no" >&5
1338 echo "${ECHO_T}no" >&6
1339 fi
1340
1341 fi
1342 if test -z "$CC"; then
1343   if test -n "$ac_tool_prefix"; then
1344   for ac_prog in cl
1345   do
1346     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
1347 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
1348 echo "$as_me:1348: checking for $ac_word" >&5
1349 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1350 if test "${ac_cv_prog_CC+set}" = set; then
1351   echo $ECHO_N "(cached) $ECHO_C" >&6
1352 else
1353   if test -n "$CC"; then
1354   ac_cv_prog_CC="$CC" # Let the user override the test.
1355 else
1356   ac_save_IFS=$IFS; IFS=$ac_path_separator
1357 ac_dummy="$PATH"
1358 for ac_dir in $ac_dummy; do
1359   IFS=$ac_save_IFS
1360   test -z "$ac_dir" && ac_dir=.
1361   $as_executable_p "$ac_dir/$ac_word" || continue
1362 ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
1363 echo "$as_me:1363: found $ac_dir/$ac_word" >&5
1364 break
1365 done
1366
1367 fi
1368 fi
1369 CC=$ac_cv_prog_CC
1370 if test -n "$CC"; then
1371   echo "$as_me:1371: result: $CC" >&5
1372 echo "${ECHO_T}$CC" >&6
1373 else
1374   echo "$as_me:1374: result: no" >&5
1375 echo "${ECHO_T}no" >&6
1376 fi
1377
1378     test -n "$CC" && break
1379   done
1380 fi
1381 if test -z "$CC"; then
1382   ac_ct_CC=$CC
1383   for ac_prog in cl
1384 do
1385   # Extract the first word of "$ac_prog", so it can be a program name with args.
1386 set dummy $ac_prog; ac_word=$2
1387 echo "$as_me:1387: checking for $ac_word" >&5
1388 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1389 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1390   echo $ECHO_N "(cached) $ECHO_C" >&6
1391 else
1392   if test -n "$ac_ct_CC"; then
1393   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1394 else
1395   ac_save_IFS=$IFS; IFS=$ac_path_separator
1396 ac_dummy="$PATH"
1397 for ac_dir in $ac_dummy; do
1398   IFS=$ac_save_IFS
1399   test -z "$ac_dir" && ac_dir=.
1400   $as_executable_p "$ac_dir/$ac_word" || continue
1401 ac_cv_prog_ac_ct_CC="$ac_prog"
1402 echo "$as_me:1402: found $ac_dir/$ac_word" >&5
1403 break
1404 done
1405
1406 fi
1407 fi
1408 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1409 if test -n "$ac_ct_CC"; then
1410   echo "$as_me:1410: result: $ac_ct_CC" >&5
1411 echo "${ECHO_T}$ac_ct_CC" >&6
1412 else
1413   echo "$as_me:1413: result: no" >&5
1414 echo "${ECHO_T}no" >&6
1415 fi
1416
1417   test -n "$ac_ct_CC" && break
1418 done
1419
1420   CC=$ac_ct_CC
1421 fi
1422
1423 fi
1424
1425 test -z "$CC" && { { echo "$as_me:1425: error: no acceptable cc found in \$PATH" >&5
1426 echo "$as_me: error: no acceptable cc found in \$PATH" >&2;}
1427    { (exit 1); exit 1; }; }
1428
1429 # Provide some information about the compiler.
1430 echo "$as_me:1430:" \
1431      "checking for C compiler version" >&5
1432 ac_compiler=`set X $ac_compile; echo $2`
1433 { (eval echo "$as_me:1433: \"$ac_compiler --version </dev/null >&5\"") >&5
1434   (eval $ac_compiler --version </dev/null >&5) 2>&5
1435   ac_status=$?
1436   echo "$as_me:1436: \$? = $ac_status" >&5
1437   (exit $ac_status); }
1438 { (eval echo "$as_me:1438: \"$ac_compiler -v </dev/null >&5\"") >&5
1439   (eval $ac_compiler -v </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
1449 cat >conftest.$ac_ext <<_ACEOF
1450 #line 1450 "configure"
1451 #include "confdefs.h"
1452
1453 int
1454 main ()
1455 {
1456
1457   ;
1458   return 0;
1459 }
1460 _ACEOF
1461 ac_clean_files_save=$ac_clean_files
1462 ac_clean_files="$ac_clean_files a.out a.exe"
1463 # Try to create an executable without -o first, disregard a.out.
1464 # It will help us diagnose broken compilers, and finding out an intuition
1465 # of exeext.
1466 echo "$as_me:1466: checking for C compiler default output" >&5
1467 echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
1468 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
1469 if { (eval echo "$as_me:1469: \"$ac_link_default\"") >&5
1470   (eval $ac_link_default) 2>&5
1471   ac_status=$?
1472   echo "$as_me:1472: \$? = $ac_status" >&5
1473   (exit $ac_status); }; then
1474   # Find the output, starting from the most likely.  This scheme is
1475 # not robust to junk in `.', hence go to wildcards (a.*) only as a last
1476 # resort.
1477 for ac_file in `ls a.exe conftest.exe 2>/dev/null;
1478                 ls a.out conftest 2>/dev/null;
1479                 ls a.* conftest.* 2>/dev/null`; do
1480   case $ac_file in
1481     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1482     a.out ) # We found the default executable, but exeext='' is most
1483             # certainly right.
1484             break;;
1485     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1486           # FIXME: I believe we export ac_cv_exeext for Libtool --akim.
1487           export ac_cv_exeext
1488           break;;
1489     * ) break;;
1490   esac
1491 done
1492 else
1493   echo "$as_me: failed program was:" >&5
1494 cat conftest.$ac_ext >&5
1495 { { echo "$as_me:1495: error: C compiler cannot create executables" >&5
1496 echo "$as_me: error: C compiler cannot create executables" >&2;}
1497    { (exit 77); exit 77; }; }
1498 fi
1499
1500 ac_exeext=$ac_cv_exeext
1501 echo "$as_me:1501: result: $ac_file" >&5
1502 echo "${ECHO_T}$ac_file" >&6
1503
1504 # Check the compiler produces executables we can run.  If not, either
1505 # the compiler is broken, or we cross compile.
1506 echo "$as_me:1506: checking whether the C compiler works" >&5
1507 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
1508 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0
1509 # If not cross compiling, check that we can run a simple program.
1510 if test "$cross_compiling" != yes; then
1511   if { ac_try='./$ac_file'
1512   { (eval echo "$as_me:1512: \"$ac_try\"") >&5
1513   (eval $ac_try) 2>&5
1514   ac_status=$?
1515   echo "$as_me:1515: \$? = $ac_status" >&5
1516   (exit $ac_status); }; }; then
1517     cross_compiling=no
1518   else
1519     if test "$cross_compiling" = maybe; then
1520         cross_compiling=yes
1521     else
1522         { { echo "$as_me:1522: error: cannot run C compiled programs.
1523 If you meant to cross compile, use \`--host'." >&5
1524 echo "$as_me: error: cannot run C compiled programs.
1525 If you meant to cross compile, use \`--host'." >&2;}
1526    { (exit 1); exit 1; }; }
1527     fi
1528   fi
1529 fi
1530 echo "$as_me:1530: result: yes" >&5
1531 echo "${ECHO_T}yes" >&6
1532
1533 rm -f a.out a.exe conftest$ac_cv_exeext
1534 ac_clean_files=$ac_clean_files_save
1535 # Check the compiler produces executables we can run.  If not, either
1536 # the compiler is broken, or we cross compile.
1537 echo "$as_me:1537: checking whether we are cross compiling" >&5
1538 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
1539 echo "$as_me:1539: result: $cross_compiling" >&5
1540 echo "${ECHO_T}$cross_compiling" >&6
1541
1542 echo "$as_me:1542: checking for executable suffix" >&5
1543 echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6
1544 if { (eval echo "$as_me:1544: \"$ac_link\"") >&5
1545   (eval $ac_link) 2>&5
1546   ac_status=$?
1547   echo "$as_me:1547: \$? = $ac_status" >&5
1548   (exit $ac_status); }; then
1549   # If both `conftest.exe' and `conftest' are `present' (well, observable)
1550 # catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
1551 # work properly (i.e., refer to `conftest.exe'), while it won't with
1552 # `rm'.
1553 for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do
1554   case $ac_file in
1555     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1556     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1557           export ac_cv_exeext
1558           break;;
1559     * ) break;;
1560   esac
1561 done
1562 else
1563   { { echo "$as_me:1563: error: cannot compute EXEEXT: cannot compile and link" >&5
1564 echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;}
1565    { (exit 1); exit 1; }; }
1566 fi
1567
1568 rm -f conftest$ac_cv_exeext
1569 echo "$as_me:1569: result: $ac_cv_exeext" >&5
1570 echo "${ECHO_T}$ac_cv_exeext" >&6
1571
1572 rm -f conftest.$ac_ext
1573 EXEEXT=$ac_cv_exeext
1574 ac_exeext=$EXEEXT
1575 echo "$as_me:1575: checking for object suffix" >&5
1576 echo $ECHO_N "checking for object suffix... $ECHO_C" >&6
1577 if test "${ac_cv_objext+set}" = set; then
1578   echo $ECHO_N "(cached) $ECHO_C" >&6
1579 else
1580   cat >conftest.$ac_ext <<_ACEOF
1581 #line 1581 "configure"
1582 #include "confdefs.h"
1583
1584 int
1585 main ()
1586 {
1587
1588   ;
1589   return 0;
1590 }
1591 _ACEOF
1592 rm -f conftest.o conftest.obj
1593 if { (eval echo "$as_me:1593: \"$ac_compile\"") >&5
1594   (eval $ac_compile) 2>&5
1595   ac_status=$?
1596   echo "$as_me:1596: \$? = $ac_status" >&5
1597   (exit $ac_status); }; then
1598   for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
1599   case $ac_file in
1600     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.map | *.inf ) ;;
1601     *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
1602        break;;
1603   esac
1604 done
1605 else
1606   echo "$as_me: failed program was:" >&5
1607 cat conftest.$ac_ext >&5
1608 { { echo "$as_me:1608: error: cannot compute OBJEXT: cannot compile" >&5
1609 echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;}
1610    { (exit 1); exit 1; }; }
1611 fi
1612
1613 rm -f conftest.$ac_cv_objext conftest.$ac_ext
1614 fi
1615 echo "$as_me:1615: result: $ac_cv_objext" >&5
1616 echo "${ECHO_T}$ac_cv_objext" >&6
1617 OBJEXT=$ac_cv_objext
1618 ac_objext=$OBJEXT
1619 echo "$as_me:1619: checking whether we are using the GNU C compiler" >&5
1620 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
1621 if test "${ac_cv_c_compiler_gnu+set}" = set; then
1622   echo $ECHO_N "(cached) $ECHO_C" >&6
1623 else
1624   cat >conftest.$ac_ext <<_ACEOF
1625 #line 1625 "configure"
1626 #include "confdefs.h"
1627
1628 int
1629 main ()
1630 {
1631 #ifndef __GNUC__
1632        choke me
1633 #endif
1634
1635   ;
1636   return 0;
1637 }
1638 _ACEOF
1639 rm -f conftest.$ac_objext
1640 if { (eval echo "$as_me:1640: \"$ac_compile\"") >&5
1641   (eval $ac_compile) 2>&5
1642   ac_status=$?
1643   echo "$as_me:1643: \$? = $ac_status" >&5
1644   (exit $ac_status); } &&
1645          { ac_try='test -s conftest.$ac_objext'
1646   { (eval echo "$as_me:1646: \"$ac_try\"") >&5
1647   (eval $ac_try) 2>&5
1648   ac_status=$?
1649   echo "$as_me:1649: \$? = $ac_status" >&5
1650   (exit $ac_status); }; }; then
1651   ac_compiler_gnu=yes
1652 else
1653   echo "$as_me: failed program was:" >&5
1654 cat conftest.$ac_ext >&5
1655 ac_compiler_gnu=no
1656 fi
1657 rm -f conftest.$ac_objext conftest.$ac_ext
1658 ac_cv_c_compiler_gnu=$ac_compiler_gnu
1659
1660 fi
1661 echo "$as_me:1661: result: $ac_cv_c_compiler_gnu" >&5
1662 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
1663 GCC=`test $ac_compiler_gnu = yes && echo yes`
1664 ac_test_CFLAGS=${CFLAGS+set}
1665 ac_save_CFLAGS=$CFLAGS
1666 CFLAGS="-g"
1667 echo "$as_me:1667: checking whether $CC accepts -g" >&5
1668 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
1669 if test "${ac_cv_prog_cc_g+set}" = set; then
1670   echo $ECHO_N "(cached) $ECHO_C" >&6
1671 else
1672   cat >conftest.$ac_ext <<_ACEOF
1673 #line 1673 "configure"
1674 #include "confdefs.h"
1675
1676 int
1677 main ()
1678 {
1679
1680   ;
1681   return 0;
1682 }
1683 _ACEOF
1684 rm -f conftest.$ac_objext
1685 if { (eval echo "$as_me:1685: \"$ac_compile\"") >&5
1686   (eval $ac_compile) 2>&5
1687   ac_status=$?
1688   echo "$as_me:1688: \$? = $ac_status" >&5
1689   (exit $ac_status); } &&
1690          { ac_try='test -s conftest.$ac_objext'
1691   { (eval echo "$as_me:1691: \"$ac_try\"") >&5
1692   (eval $ac_try) 2>&5
1693   ac_status=$?
1694   echo "$as_me:1694: \$? = $ac_status" >&5
1695   (exit $ac_status); }; }; then
1696   ac_cv_prog_cc_g=yes
1697 else
1698   echo "$as_me: failed program was:" >&5
1699 cat conftest.$ac_ext >&5
1700 ac_cv_prog_cc_g=no
1701 fi
1702 rm -f conftest.$ac_objext conftest.$ac_ext
1703 fi
1704 echo "$as_me:1704: result: $ac_cv_prog_cc_g" >&5
1705 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
1706 if test "$ac_test_CFLAGS" = set; then
1707   CFLAGS=$ac_save_CFLAGS
1708 elif test $ac_cv_prog_cc_g = yes; then
1709   if test "$GCC" = yes; then
1710     CFLAGS="-g -O2"
1711   else
1712     CFLAGS="-g"
1713   fi
1714 else
1715   if test "$GCC" = yes; then
1716     CFLAGS="-O2"
1717   else
1718     CFLAGS=
1719   fi
1720 fi
1721 # Some people use a C++ compiler to compile C.  Since we use `exit',
1722 # in C++ we need to declare it.  In case someone uses the same compiler
1723 # for both compiling C and C++ we need to have the C++ compiler decide
1724 # the declaration of exit, since it's the most demanding environment.
1725 cat >conftest.$ac_ext <<_ACEOF
1726 #ifndef __cplusplus
1727   choke me
1728 #endif
1729 _ACEOF
1730 rm -f conftest.$ac_objext
1731 if { (eval echo "$as_me:1731: \"$ac_compile\"") >&5
1732   (eval $ac_compile) 2>&5
1733   ac_status=$?
1734   echo "$as_me:1734: \$? = $ac_status" >&5
1735   (exit $ac_status); } &&
1736          { ac_try='test -s conftest.$ac_objext'
1737   { (eval echo "$as_me:1737: \"$ac_try\"") >&5
1738   (eval $ac_try) 2>&5
1739   ac_status=$?
1740   echo "$as_me:1740: \$? = $ac_status" >&5
1741   (exit $ac_status); }; }; then
1742   for ac_declaration in \
1743    ''\
1744    '#include <stdlib.h>' \
1745    'extern "C" void std::exit (int) throw (); using std::exit;' \
1746    'extern "C" void std::exit (int); using std::exit;' \
1747    'extern "C" void exit (int) throw ();' \
1748    'extern "C" void exit (int);' \
1749    'void exit (int);'
1750 do
1751   cat >conftest.$ac_ext <<_ACEOF
1752 #line 1752 "configure"
1753 #include "confdefs.h"
1754 #include <stdlib.h>
1755 $ac_declaration
1756 int
1757 main ()
1758 {
1759 exit (42);
1760   ;
1761   return 0;
1762 }
1763 _ACEOF
1764 rm -f conftest.$ac_objext
1765 if { (eval echo "$as_me:1765: \"$ac_compile\"") >&5
1766   (eval $ac_compile) 2>&5
1767   ac_status=$?
1768   echo "$as_me:1768: \$? = $ac_status" >&5
1769   (exit $ac_status); } &&
1770          { ac_try='test -s conftest.$ac_objext'
1771   { (eval echo "$as_me:1771: \"$ac_try\"") >&5
1772   (eval $ac_try) 2>&5
1773   ac_status=$?
1774   echo "$as_me:1774: \$? = $ac_status" >&5
1775   (exit $ac_status); }; }; then
1776   :
1777 else
1778   echo "$as_me: failed program was:" >&5
1779 cat conftest.$ac_ext >&5
1780 continue
1781 fi
1782 rm -f conftest.$ac_objext conftest.$ac_ext
1783   cat >conftest.$ac_ext <<_ACEOF
1784 #line 1784 "configure"
1785 #include "confdefs.h"
1786 $ac_declaration
1787 int
1788 main ()
1789 {
1790 exit (42);
1791   ;
1792   return 0;
1793 }
1794 _ACEOF
1795 rm -f conftest.$ac_objext
1796 if { (eval echo "$as_me:1796: \"$ac_compile\"") >&5
1797   (eval $ac_compile) 2>&5
1798   ac_status=$?
1799   echo "$as_me:1799: \$? = $ac_status" >&5
1800   (exit $ac_status); } &&
1801          { ac_try='test -s conftest.$ac_objext'
1802   { (eval echo "$as_me:1802: \"$ac_try\"") >&5
1803   (eval $ac_try) 2>&5
1804   ac_status=$?
1805   echo "$as_me:1805: \$? = $ac_status" >&5
1806   (exit $ac_status); }; }; then
1807   break
1808 else
1809   echo "$as_me: failed program was:" >&5
1810 cat conftest.$ac_ext >&5
1811 fi
1812 rm -f conftest.$ac_objext conftest.$ac_ext
1813 done
1814 rm -rf conftest*
1815 if test -n "$ac_declaration"; then
1816   echo '#ifdef __cplusplus' >>confdefs.h
1817   echo $ac_declaration      >>confdefs.h
1818   echo '#endif'             >>confdefs.h
1819 fi
1820
1821 else
1822   echo "$as_me: failed program was:" >&5
1823 cat conftest.$ac_ext >&5
1824 fi
1825 rm -f conftest.$ac_objext conftest.$ac_ext
1826 ac_ext=c
1827 ac_cpp='$CPP $CPPFLAGS'
1828 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1829 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1830 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1831 ac_main_return=return
1832
1833 GCC_VERSION=none
1834 if test "$GCC" = yes ; then
1835         echo "$as_me:1835: checking version of $CC" >&5
1836 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
1837         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.].*//'`"
1838         test -z "$GCC_VERSION" && GCC_VERSION=unknown
1839         echo "$as_me:1839: result: $GCC_VERSION" >&5
1840 echo "${ECHO_T}$GCC_VERSION" >&6
1841 fi
1842
1843 echo "$as_me:1843: checking for $CC option to accept ANSI C" >&5
1844 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
1845 if test "${ac_cv_prog_cc_stdc+set}" = set; then
1846   echo $ECHO_N "(cached) $ECHO_C" >&6
1847 else
1848   ac_cv_prog_cc_stdc=no
1849 ac_save_CC=$CC
1850 cat >conftest.$ac_ext <<_ACEOF
1851 #line 1851 "configure"
1852 #include "confdefs.h"
1853 #include <stdarg.h>
1854 #include <stdio.h>
1855 #include <sys/types.h>
1856 #include <sys/stat.h>
1857 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
1858 struct buf { int x; };
1859 FILE * (*rcsopen) (struct buf *, struct stat *, int);
1860 static char *e (p, i)
1861      char **p;
1862      int i;
1863 {
1864   return p[i];
1865 }
1866 static char *f (char * (*g) (char **, int), char **p, ...)
1867 {
1868   char *s;
1869   va_list v;
1870   va_start (v,p);
1871   s = g (p, va_arg (v,int));
1872   va_end (v);
1873   return s;
1874 }
1875 int test (int i, double x);
1876 struct s1 {int (*f) (int a);};
1877 struct s2 {int (*f) (double a);};
1878 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
1879 int argc;
1880 char **argv;
1881 int
1882 main ()
1883 {
1884 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
1885   ;
1886   return 0;
1887 }
1888 _ACEOF
1889 # Don't try gcc -ansi; that turns off useful extensions and
1890 # breaks some systems' header files.
1891 # AIX                   -qlanglvl=ansi
1892 # Ultrix and OSF/1      -std1
1893 # HP-UX 10.20 and later -Ae
1894 # HP-UX older versions  -Aa -D_HPUX_SOURCE
1895 # SVR4                  -Xc -D__EXTENSIONS__
1896 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
1897 do
1898   CC="$ac_save_CC $ac_arg"
1899   rm -f conftest.$ac_objext
1900 if { (eval echo "$as_me:1900: \"$ac_compile\"") >&5
1901   (eval $ac_compile) 2>&5
1902   ac_status=$?
1903   echo "$as_me:1903: \$? = $ac_status" >&5
1904   (exit $ac_status); } &&
1905          { ac_try='test -s conftest.$ac_objext'
1906   { (eval echo "$as_me:1906: \"$ac_try\"") >&5
1907   (eval $ac_try) 2>&5
1908   ac_status=$?
1909   echo "$as_me:1909: \$? = $ac_status" >&5
1910   (exit $ac_status); }; }; then
1911   ac_cv_prog_cc_stdc=$ac_arg
1912 break
1913 else
1914   echo "$as_me: failed program was:" >&5
1915 cat conftest.$ac_ext >&5
1916 fi
1917 rm -f conftest.$ac_objext
1918 done
1919 rm -f conftest.$ac_ext conftest.$ac_objext
1920 CC=$ac_save_CC
1921
1922 fi
1923
1924 case "x$ac_cv_prog_cc_stdc" in
1925   x|xno)
1926     echo "$as_me:1926: result: none needed" >&5
1927 echo "${ECHO_T}none needed" >&6 ;;
1928   *)
1929     echo "$as_me:1929: result: $ac_cv_prog_cc_stdc" >&5
1930 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
1931     CC="$CC $ac_cv_prog_cc_stdc" ;;
1932 esac
1933
1934 # This should have been defined by AC_PROG_CC
1935 : ${CC:=cc}
1936
1937 echo "$as_me:1937: checking \$CC variable" >&5
1938 echo $ECHO_N "checking \$CC variable... $ECHO_C" >&6
1939 case "$CC" in
1940 (*[\ \  ]-*)
1941         echo "$as_me:1941: result: broken" >&5
1942 echo "${ECHO_T}broken" >&6
1943         { echo "$as_me:1943: WARNING: your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options" >&5
1944 echo "$as_me: WARNING: your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options" >&2;}
1945         # humor him...
1946         cf_flags=`echo "$CC" | sed -e 's/^.*[   ]\(-[^  ]\)/\1/'`
1947         CC=`echo "$CC " | sed -e 's/[   ]-[^    ].*$//' -e 's/[         ]*$//'`
1948         for cf_arg in $cf_flags
1949         do
1950                 case "x$cf_arg" in
1951                 (x-[IUDfgOW]*)
1952
1953 cf_fix_cppflags=no
1954 cf_new_cflags=
1955 cf_new_cppflags=
1956 cf_new_extra_cppflags=
1957
1958 for cf_add_cflags in $cf_flags
1959 do
1960 case $cf_fix_cppflags in
1961 (no)
1962         case $cf_add_cflags in
1963         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
1964                 case $cf_add_cflags in
1965                 (-D*)
1966                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
1967
1968                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
1969                                 && test -z "${cf_tst_cflags}" \
1970                                 && cf_fix_cppflags=yes
1971
1972                         if test $cf_fix_cppflags = yes ; then
1973                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
1974                                 continue
1975                         elif test "${cf_tst_cflags}" = "\"'" ; then
1976                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
1977                                 continue
1978                         fi
1979                         ;;
1980                 esac
1981                 case "$CPPFLAGS" in
1982                 (*$cf_add_cflags)
1983                         ;;
1984                 (*)
1985                         case $cf_add_cflags in
1986                         (-D*)
1987                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
1988
1989 CPPFLAGS=`echo "$CPPFLAGS" | \
1990         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
1991                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
1992
1993                                 ;;
1994                         esac
1995                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
1996                         ;;
1997                 esac
1998                 ;;
1999         (*)
2000                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
2001                 ;;
2002         esac
2003         ;;
2004 (yes)
2005         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
2006
2007         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
2008
2009         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2010                 && test -z "${cf_tst_cflags}" \
2011                 && cf_fix_cppflags=no
2012         ;;
2013 esac
2014 done
2015
2016 if test -n "$cf_new_cflags" ; then
2017
2018         CFLAGS="$CFLAGS $cf_new_cflags"
2019 fi
2020
2021 if test -n "$cf_new_cppflags" ; then
2022
2023         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
2024 fi
2025
2026 if test -n "$cf_new_extra_cppflags" ; then
2027
2028         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
2029 fi
2030
2031                         ;;
2032                 (*)
2033                         CC="$CC $cf_arg"
2034                         ;;
2035                 esac
2036         done
2037         test -n "$verbose" && echo "    resulting CC: '$CC'" 1>&6
2038
2039 echo "${as_me:-configure}:2039: testing resulting CC: '$CC' ..." 1>&5
2040
2041         test -n "$verbose" && echo "    resulting CFLAGS: '$CFLAGS'" 1>&6
2042
2043 echo "${as_me:-configure}:2043: testing resulting CFLAGS: '$CFLAGS' ..." 1>&5
2044
2045         test -n "$verbose" && echo "    resulting CPPFLAGS: '$CPPFLAGS'" 1>&6
2046
2047 echo "${as_me:-configure}:2047: testing resulting CPPFLAGS: '$CPPFLAGS' ..." 1>&5
2048
2049         ;;
2050 (*)
2051         echo "$as_me:2051: result: ok" >&5
2052 echo "${ECHO_T}ok" >&6
2053         ;;
2054 esac
2055
2056 ac_ext=c
2057 ac_cpp='$CPP $CPPFLAGS'
2058 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2059 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2060 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2061 ac_main_return=return
2062 echo "$as_me:2062: checking how to run the C preprocessor" >&5
2063 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
2064 # On Suns, sometimes $CPP names a directory.
2065 if test -n "$CPP" && test -d "$CPP"; then
2066   CPP=
2067 fi
2068 if test -z "$CPP"; then
2069   if test "${ac_cv_prog_CPP+set}" = set; then
2070   echo $ECHO_N "(cached) $ECHO_C" >&6
2071 else
2072       # Double quotes because CPP needs to be expanded
2073     for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
2074     do
2075       ac_preproc_ok=false
2076 for ac_c_preproc_warn_flag in '' yes
2077 do
2078   # Use a header file that comes with gcc, so configuring glibc
2079   # with a fresh cross-compiler works.
2080   # On the NeXT, cc -E runs the code through the compiler's parser,
2081   # not just through cpp. "Syntax error" is here to catch this case.
2082   cat >conftest.$ac_ext <<_ACEOF
2083 #line 2083 "configure"
2084 #include "confdefs.h"
2085 #include <assert.h>
2086                      Syntax error
2087 _ACEOF
2088 if { (eval echo "$as_me:2088: \"$ac_cpp conftest.$ac_ext\"") >&5
2089   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2090   ac_status=$?
2091   egrep -v '^ *\+' conftest.er1 >conftest.err
2092   rm -f conftest.er1
2093   cat conftest.err >&5
2094   echo "$as_me:2094: \$? = $ac_status" >&5
2095   (exit $ac_status); } >/dev/null; then
2096   if test -s conftest.err; then
2097     ac_cpp_err=$ac_c_preproc_warn_flag
2098   else
2099     ac_cpp_err=
2100   fi
2101 else
2102   ac_cpp_err=yes
2103 fi
2104 if test -z "$ac_cpp_err"; then
2105   :
2106 else
2107   echo "$as_me: failed program was:" >&5
2108   cat conftest.$ac_ext >&5
2109   # Broken: fails on valid input.
2110 continue
2111 fi
2112 rm -f conftest.err conftest.$ac_ext
2113
2114   # OK, works on sane cases.  Now check whether non-existent headers
2115   # can be detected and how.
2116   cat >conftest.$ac_ext <<_ACEOF
2117 #line 2117 "configure"
2118 #include "confdefs.h"
2119 #include <ac_nonexistent.h>
2120 _ACEOF
2121 if { (eval echo "$as_me:2121: \"$ac_cpp conftest.$ac_ext\"") >&5
2122   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2123   ac_status=$?
2124   egrep -v '^ *\+' conftest.er1 >conftest.err
2125   rm -f conftest.er1
2126   cat conftest.err >&5
2127   echo "$as_me:2127: \$? = $ac_status" >&5
2128   (exit $ac_status); } >/dev/null; then
2129   if test -s conftest.err; then
2130     ac_cpp_err=$ac_c_preproc_warn_flag
2131   else
2132     ac_cpp_err=
2133   fi
2134 else
2135   ac_cpp_err=yes
2136 fi
2137 if test -z "$ac_cpp_err"; then
2138   # Broken: success on invalid input.
2139 continue
2140 else
2141   echo "$as_me: failed program was:" >&5
2142   cat conftest.$ac_ext >&5
2143   # Passes both tests.
2144 ac_preproc_ok=:
2145 break
2146 fi
2147 rm -f conftest.err conftest.$ac_ext
2148
2149 done
2150 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2151 rm -f conftest.err conftest.$ac_ext
2152 if $ac_preproc_ok; then
2153   break
2154 fi
2155
2156     done
2157     ac_cv_prog_CPP=$CPP
2158
2159 fi
2160   CPP=$ac_cv_prog_CPP
2161 else
2162   ac_cv_prog_CPP=$CPP
2163 fi
2164 echo "$as_me:2164: result: $CPP" >&5
2165 echo "${ECHO_T}$CPP" >&6
2166 ac_preproc_ok=false
2167 for ac_c_preproc_warn_flag in '' yes
2168 do
2169   # Use a header file that comes with gcc, so configuring glibc
2170   # with a fresh cross-compiler works.
2171   # On the NeXT, cc -E runs the code through the compiler's parser,
2172   # not just through cpp. "Syntax error" is here to catch this case.
2173   cat >conftest.$ac_ext <<_ACEOF
2174 #line 2174 "configure"
2175 #include "confdefs.h"
2176 #include <assert.h>
2177                      Syntax error
2178 _ACEOF
2179 if { (eval echo "$as_me:2179: \"$ac_cpp conftest.$ac_ext\"") >&5
2180   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2181   ac_status=$?
2182   egrep -v '^ *\+' conftest.er1 >conftest.err
2183   rm -f conftest.er1
2184   cat conftest.err >&5
2185   echo "$as_me:2185: \$? = $ac_status" >&5
2186   (exit $ac_status); } >/dev/null; then
2187   if test -s conftest.err; then
2188     ac_cpp_err=$ac_c_preproc_warn_flag
2189   else
2190     ac_cpp_err=
2191   fi
2192 else
2193   ac_cpp_err=yes
2194 fi
2195 if test -z "$ac_cpp_err"; then
2196   :
2197 else
2198   echo "$as_me: failed program was:" >&5
2199   cat conftest.$ac_ext >&5
2200   # Broken: fails on valid input.
2201 continue
2202 fi
2203 rm -f conftest.err conftest.$ac_ext
2204
2205   # OK, works on sane cases.  Now check whether non-existent headers
2206   # can be detected and how.
2207   cat >conftest.$ac_ext <<_ACEOF
2208 #line 2208 "configure"
2209 #include "confdefs.h"
2210 #include <ac_nonexistent.h>
2211 _ACEOF
2212 if { (eval echo "$as_me:2212: \"$ac_cpp conftest.$ac_ext\"") >&5
2213   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2214   ac_status=$?
2215   egrep -v '^ *\+' conftest.er1 >conftest.err
2216   rm -f conftest.er1
2217   cat conftest.err >&5
2218   echo "$as_me:2218: \$? = $ac_status" >&5
2219   (exit $ac_status); } >/dev/null; then
2220   if test -s conftest.err; then
2221     ac_cpp_err=$ac_c_preproc_warn_flag
2222   else
2223     ac_cpp_err=
2224   fi
2225 else
2226   ac_cpp_err=yes
2227 fi
2228 if test -z "$ac_cpp_err"; then
2229   # Broken: success on invalid input.
2230 continue
2231 else
2232   echo "$as_me: failed program was:" >&5
2233   cat conftest.$ac_ext >&5
2234   # Passes both tests.
2235 ac_preproc_ok=:
2236 break
2237 fi
2238 rm -f conftest.err conftest.$ac_ext
2239
2240 done
2241 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2242 rm -f conftest.err conftest.$ac_ext
2243 if $ac_preproc_ok; then
2244   :
2245 else
2246   { { echo "$as_me:2246: error: C preprocessor \"$CPP\" fails sanity check" >&5
2247 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;}
2248    { (exit 1); exit 1; }; }
2249 fi
2250
2251 ac_ext=c
2252 ac_cpp='$CPP $CPPFLAGS'
2253 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2254 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2255 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2256 ac_main_return=return
2257
2258 for ac_prog in mawk gawk nawk awk
2259 do
2260   # Extract the first word of "$ac_prog", so it can be a program name with args.
2261 set dummy $ac_prog; ac_word=$2
2262 echo "$as_me:2262: checking for $ac_word" >&5
2263 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2264 if test "${ac_cv_prog_AWK+set}" = set; then
2265   echo $ECHO_N "(cached) $ECHO_C" >&6
2266 else
2267   if test -n "$AWK"; then
2268   ac_cv_prog_AWK="$AWK" # Let the user override the test.
2269 else
2270   ac_save_IFS=$IFS; IFS=$ac_path_separator
2271 ac_dummy="$PATH"
2272 for ac_dir in $ac_dummy; do
2273   IFS=$ac_save_IFS
2274   test -z "$ac_dir" && ac_dir=.
2275   $as_executable_p "$ac_dir/$ac_word" || continue
2276 ac_cv_prog_AWK="$ac_prog"
2277 echo "$as_me:2277: found $ac_dir/$ac_word" >&5
2278 break
2279 done
2280
2281 fi
2282 fi
2283 AWK=$ac_cv_prog_AWK
2284 if test -n "$AWK"; then
2285   echo "$as_me:2285: result: $AWK" >&5
2286 echo "${ECHO_T}$AWK" >&6
2287 else
2288   echo "$as_me:2288: result: no" >&5
2289 echo "${ECHO_T}no" >&6
2290 fi
2291
2292   test -n "$AWK" && break
2293 done
2294
2295 # Find a good install program.  We prefer a C program (faster),
2296 # so one script is as good as another.  But avoid the broken or
2297 # incompatible versions:
2298 # SysV /etc/install, /usr/sbin/install
2299 # SunOS /usr/etc/install
2300 # IRIX /sbin/install
2301 # AIX /bin/install
2302 # AmigaOS /C/install, which installs bootblocks on floppy discs
2303 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2304 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2305 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2306 # ./install, which can be erroneously created by make from ./install.sh.
2307 echo "$as_me:2307: checking for a BSD compatible install" >&5
2308 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
2309 if test -z "$INSTALL"; then
2310 if test "${ac_cv_path_install+set}" = set; then
2311   echo $ECHO_N "(cached) $ECHO_C" >&6
2312 else
2313     ac_save_IFS=$IFS; IFS=$ac_path_separator
2314   for ac_dir in $PATH; do
2315     IFS=$ac_save_IFS
2316     # Account for people who put trailing slashes in PATH elements.
2317     case $ac_dir/ in
2318     / | ./ | .// | /cC/* \
2319     | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
2320     | /usr/ucb/* ) ;;
2321     *)
2322       # OSF1 and SCO ODT 3.0 have their own names for install.
2323       # Don't use installbsd from OSF since it installs stuff as root
2324       # by default.
2325       for ac_prog in ginstall scoinst install; do
2326         if $as_executable_p "$ac_dir/$ac_prog"; then
2327           if test $ac_prog = install &&
2328             grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2329             # AIX install.  It has an incompatible calling convention.
2330             :
2331           elif test $ac_prog = install &&
2332             grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2333             # program-specific install script used by HP pwplus--don't use.
2334             :
2335           else
2336             ac_cv_path_install="$ac_dir/$ac_prog -c"
2337             break 2
2338           fi
2339         fi
2340       done
2341       ;;
2342     esac
2343   done
2344
2345 fi
2346   if test "${ac_cv_path_install+set}" = set; then
2347     INSTALL=$ac_cv_path_install
2348   else
2349     # As a last resort, use the slow shell script.  We don't cache a
2350     # path for INSTALL within a source directory, because that will
2351     # break other packages using the cache if that directory is
2352     # removed, or if the path is relative.
2353     INSTALL=$ac_install_sh
2354   fi
2355 fi
2356 echo "$as_me:2356: result: $INSTALL" >&5
2357 echo "${ECHO_T}$INSTALL" >&6
2358
2359 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2360 # It thinks the first close brace ends the variable substitution.
2361 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2362
2363 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2364
2365 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2366
2367 case $INSTALL in
2368 (/*)
2369         ;;
2370 (*)
2371         cf_dir=`echo $INSTALL | sed -e 's%/[^/]*$%%'`
2372         test -z "$cf_dir" && cf_dir=.
2373         INSTALL=`cd $cf_dir && pwd`/`echo $INSTALL | sed -e 's%^.*/%%'`
2374         ;;
2375 esac
2376
2377 for ac_prog in lint cppcheck splint
2378 do
2379   # Extract the first word of "$ac_prog", so it can be a program name with args.
2380 set dummy $ac_prog; ac_word=$2
2381 echo "$as_me:2381: checking for $ac_word" >&5
2382 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2383 if test "${ac_cv_prog_LINT+set}" = set; then
2384   echo $ECHO_N "(cached) $ECHO_C" >&6
2385 else
2386   if test -n "$LINT"; then
2387   ac_cv_prog_LINT="$LINT" # Let the user override the test.
2388 else
2389   ac_save_IFS=$IFS; IFS=$ac_path_separator
2390 ac_dummy="$PATH"
2391 for ac_dir in $ac_dummy; do
2392   IFS=$ac_save_IFS
2393   test -z "$ac_dir" && ac_dir=.
2394   $as_executable_p "$ac_dir/$ac_word" || continue
2395 ac_cv_prog_LINT="$ac_prog"
2396 echo "$as_me:2396: found $ac_dir/$ac_word" >&5
2397 break
2398 done
2399
2400 fi
2401 fi
2402 LINT=$ac_cv_prog_LINT
2403 if test -n "$LINT"; then
2404   echo "$as_me:2404: result: $LINT" >&5
2405 echo "${ECHO_T}$LINT" >&6
2406 else
2407   echo "$as_me:2407: result: no" >&5
2408 echo "${ECHO_T}no" >&6
2409 fi
2410
2411   test -n "$LINT" && break
2412 done
2413
2414 echo "$as_me:2414: checking if filesystem supports mixed-case filenames" >&5
2415 echo $ECHO_N "checking if filesystem supports mixed-case filenames... $ECHO_C" >&6
2416 if test "${cf_cv_mixedcase+set}" = set; then
2417   echo $ECHO_N "(cached) $ECHO_C" >&6
2418 else
2419
2420 if test "$cross_compiling" = yes ; then
2421         case $target_alias in
2422         (*-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw*|*-uwin*)
2423                 cf_cv_mixedcase=no
2424                 ;;
2425         (*)
2426                 cf_cv_mixedcase=yes
2427                 ;;
2428         esac
2429 else
2430         rm -f conftest CONFTEST
2431         echo test >conftest
2432         if test -f CONFTEST ; then
2433                 cf_cv_mixedcase=no
2434         else
2435                 cf_cv_mixedcase=yes
2436         fi
2437         rm -f conftest CONFTEST
2438 fi
2439
2440 fi
2441 echo "$as_me:2441: result: $cf_cv_mixedcase" >&5
2442 echo "${ECHO_T}$cf_cv_mixedcase" >&6
2443 test "$cf_cv_mixedcase" = yes &&
2444 cat >>confdefs.h <<\EOF
2445 #define MIXEDCASE_FILENAMES 1
2446 EOF
2447
2448 for ac_prog in exctags ctags
2449 do
2450   # Extract the first word of "$ac_prog", so it can be a program name with args.
2451 set dummy $ac_prog; ac_word=$2
2452 echo "$as_me:2452: checking for $ac_word" >&5
2453 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2454 if test "${ac_cv_prog_CTAGS+set}" = set; then
2455   echo $ECHO_N "(cached) $ECHO_C" >&6
2456 else
2457   if test -n "$CTAGS"; then
2458   ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test.
2459 else
2460   ac_save_IFS=$IFS; IFS=$ac_path_separator
2461 ac_dummy="$PATH"
2462 for ac_dir in $ac_dummy; do
2463   IFS=$ac_save_IFS
2464   test -z "$ac_dir" && ac_dir=.
2465   $as_executable_p "$ac_dir/$ac_word" || continue
2466 ac_cv_prog_CTAGS="$ac_prog"
2467 echo "$as_me:2467: found $ac_dir/$ac_word" >&5
2468 break
2469 done
2470
2471 fi
2472 fi
2473 CTAGS=$ac_cv_prog_CTAGS
2474 if test -n "$CTAGS"; then
2475   echo "$as_me:2475: result: $CTAGS" >&5
2476 echo "${ECHO_T}$CTAGS" >&6
2477 else
2478   echo "$as_me:2478: result: no" >&5
2479 echo "${ECHO_T}no" >&6
2480 fi
2481
2482   test -n "$CTAGS" && break
2483 done
2484
2485 for ac_prog in exetags etags
2486 do
2487   # Extract the first word of "$ac_prog", so it can be a program name with args.
2488 set dummy $ac_prog; ac_word=$2
2489 echo "$as_me:2489: checking for $ac_word" >&5
2490 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2491 if test "${ac_cv_prog_ETAGS+set}" = set; then
2492   echo $ECHO_N "(cached) $ECHO_C" >&6
2493 else
2494   if test -n "$ETAGS"; then
2495   ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test.
2496 else
2497   ac_save_IFS=$IFS; IFS=$ac_path_separator
2498 ac_dummy="$PATH"
2499 for ac_dir in $ac_dummy; do
2500   IFS=$ac_save_IFS
2501   test -z "$ac_dir" && ac_dir=.
2502   $as_executable_p "$ac_dir/$ac_word" || continue
2503 ac_cv_prog_ETAGS="$ac_prog"
2504 echo "$as_me:2504: found $ac_dir/$ac_word" >&5
2505 break
2506 done
2507
2508 fi
2509 fi
2510 ETAGS=$ac_cv_prog_ETAGS
2511 if test -n "$ETAGS"; then
2512   echo "$as_me:2512: result: $ETAGS" >&5
2513 echo "${ECHO_T}$ETAGS" >&6
2514 else
2515   echo "$as_me:2515: result: no" >&5
2516 echo "${ECHO_T}no" >&6
2517 fi
2518
2519   test -n "$ETAGS" && break
2520 done
2521
2522 # Extract the first word of "${CTAGS:-ctags}", so it can be a program name with args.
2523 set dummy ${CTAGS:-ctags}; ac_word=$2
2524 echo "$as_me:2524: checking for $ac_word" >&5
2525 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2526 if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" = set; then
2527   echo $ECHO_N "(cached) $ECHO_C" >&6
2528 else
2529   if test -n "$MAKE_LOWER_TAGS"; then
2530   ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test.
2531 else
2532   ac_save_IFS=$IFS; IFS=$ac_path_separator
2533 ac_dummy="$PATH"
2534 for ac_dir in $ac_dummy; do
2535   IFS=$ac_save_IFS
2536   test -z "$ac_dir" && ac_dir=.
2537   $as_executable_p "$ac_dir/$ac_word" || continue
2538 ac_cv_prog_MAKE_LOWER_TAGS="yes"
2539 echo "$as_me:2539: found $ac_dir/$ac_word" >&5
2540 break
2541 done
2542
2543   test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no"
2544 fi
2545 fi
2546 MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS
2547 if test -n "$MAKE_LOWER_TAGS"; then
2548   echo "$as_me:2548: result: $MAKE_LOWER_TAGS" >&5
2549 echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6
2550 else
2551   echo "$as_me:2551: result: no" >&5
2552 echo "${ECHO_T}no" >&6
2553 fi
2554
2555 if test "$cf_cv_mixedcase" = yes ; then
2556         # Extract the first word of "${ETAGS:-etags}", so it can be a program name with args.
2557 set dummy ${ETAGS:-etags}; ac_word=$2
2558 echo "$as_me:2558: checking for $ac_word" >&5
2559 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2560 if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" = set; then
2561   echo $ECHO_N "(cached) $ECHO_C" >&6
2562 else
2563   if test -n "$MAKE_UPPER_TAGS"; then
2564   ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test.
2565 else
2566   ac_save_IFS=$IFS; IFS=$ac_path_separator
2567 ac_dummy="$PATH"
2568 for ac_dir in $ac_dummy; do
2569   IFS=$ac_save_IFS
2570   test -z "$ac_dir" && ac_dir=.
2571   $as_executable_p "$ac_dir/$ac_word" || continue
2572 ac_cv_prog_MAKE_UPPER_TAGS="yes"
2573 echo "$as_me:2573: found $ac_dir/$ac_word" >&5
2574 break
2575 done
2576
2577   test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no"
2578 fi
2579 fi
2580 MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS
2581 if test -n "$MAKE_UPPER_TAGS"; then
2582   echo "$as_me:2582: result: $MAKE_UPPER_TAGS" >&5
2583 echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6
2584 else
2585   echo "$as_me:2585: result: no" >&5
2586 echo "${ECHO_T}no" >&6
2587 fi
2588
2589 else
2590         MAKE_UPPER_TAGS=no
2591 fi
2592
2593 if test "$MAKE_UPPER_TAGS" = yes ; then
2594         MAKE_UPPER_TAGS=
2595 else
2596         MAKE_UPPER_TAGS="#"
2597 fi
2598
2599 if test "$MAKE_LOWER_TAGS" = yes ; then
2600         MAKE_LOWER_TAGS=
2601 else
2602         MAKE_LOWER_TAGS="#"
2603 fi
2604
2605 echo "$as_me:2605: checking if -lm needed for math functions" >&5
2606 echo $ECHO_N "checking if -lm needed for math functions... $ECHO_C" >&6
2607 if test "${cf_cv_need_libm+set}" = set; then
2608   echo $ECHO_N "(cached) $ECHO_C" >&6
2609 else
2610
2611         cat >conftest.$ac_ext <<_ACEOF
2612 #line 2612 "configure"
2613 #include "confdefs.h"
2614
2615         #include <stdio.h>
2616         #include <stdlib.h>
2617         #include <math.h>
2618
2619 int
2620 main ()
2621 {
2622 double x = rand(); printf("result = %g\n", pow(sin(x),x))
2623   ;
2624   return 0;
2625 }
2626 _ACEOF
2627 rm -f conftest.$ac_objext conftest$ac_exeext
2628 if { (eval echo "$as_me:2628: \"$ac_link\"") >&5
2629   (eval $ac_link) 2>&5
2630   ac_status=$?
2631   echo "$as_me:2631: \$? = $ac_status" >&5
2632   (exit $ac_status); } &&
2633          { ac_try='test -s conftest$ac_exeext'
2634   { (eval echo "$as_me:2634: \"$ac_try\"") >&5
2635   (eval $ac_try) 2>&5
2636   ac_status=$?
2637   echo "$as_me:2637: \$? = $ac_status" >&5
2638   (exit $ac_status); }; }; then
2639   cf_cv_need_libm=no
2640 else
2641   echo "$as_me: failed program was:" >&5
2642 cat conftest.$ac_ext >&5
2643 cf_cv_need_libm=yes
2644 fi
2645 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
2646 fi
2647 echo "$as_me:2647: result: $cf_cv_need_libm" >&5
2648 echo "${ECHO_T}$cf_cv_need_libm" >&6
2649 if test "$cf_cv_need_libm" = yes
2650 then
2651 MATH_LIB=-lm
2652 fi
2653
2654 top_builddir=`pwd`
2655
2656 CC_G_OPT="-g"
2657 CC_SHARED_OPTS=unknown
2658 CPPFLAGS="$CPPFLAGS"
2659 DFT_DEP_SUFFIX=""
2660 DFT_OBJ_SUBDIR=`pwd|sed -e's:.*/::'`
2661 DFT_UPR_MODEL="NORMAL"
2662 LD="ld"
2663 LDFLAGS_SHARED=""
2664 LDFLAGS_STATIC=""
2665 LD_MODEL=""
2666 LD_SHARED_OPTS=""
2667 LIBTOOL=""
2668 LIBTOOL_OPTS=""
2669 LIB_CLEAN=""
2670 LIB_COMPILE=""
2671 LIB_LINK='${CC}'
2672 LINK_TESTS=""
2673 LOCAL_LDFLAGS=""
2674 PACKAGE="ncurses-examples"
2675 PTHREAD="-lm"
2676 TEST_ARGS=""
2677 TEST_DEPS=""
2678 TEST_LIBS=""
2679 TINFO_LDFLAGS=''
2680 TINFO_LIBS='$(LIBS_CURSES)'
2681 cf_cv_abi_version=""
2682 cf_cv_rel_version=""
2683 includesubdir=""
2684
2685 cf_cv_screen=curses
2686 cf_cv_libtype=
2687
2688 if test "$GCC" = yes
2689 then
2690 cat > conftest.i <<EOF
2691 #ifndef GCC_PRINTF
2692 #define GCC_PRINTF 0
2693 #endif
2694 #ifndef GCC_SCANF
2695 #define GCC_SCANF 0
2696 #endif
2697 #ifndef GCC_NORETURN
2698 #define GCC_NORETURN /* nothing */
2699 #endif
2700 #ifndef GCC_UNUSED
2701 #define GCC_UNUSED /* nothing */
2702 #endif
2703 EOF
2704 if test "$GCC" = yes
2705 then
2706         { echo "$as_me:2706: checking for $CC __attribute__ directives..." >&5
2707 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
2708 cat > conftest.$ac_ext <<EOF
2709 #line 2709 "${as_me:-configure}"
2710 #include "confdefs.h"
2711 #include "conftest.h"
2712 #include "conftest.i"
2713 #if     GCC_PRINTF
2714 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
2715 #else
2716 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
2717 #endif
2718 #if     GCC_SCANF
2719 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
2720 #else
2721 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
2722 #endif
2723 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
2724 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
2725 extern void foo(void) GCC_NORETURN;
2726 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
2727 EOF
2728         cf_printf_attribute=no
2729         cf_scanf_attribute=no
2730         for cf_attribute in scanf printf unused noreturn
2731         do
2732
2733 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
2734
2735                 cf_directive="__attribute__(($cf_attribute))"
2736                 echo "checking for $CC $cf_directive" 1>&5
2737
2738                 case $cf_attribute in
2739                 (printf)
2740                         cf_printf_attribute=yes
2741                         cat >conftest.h <<EOF
2742 #define GCC_$cf_ATTRIBUTE 1
2743 EOF
2744                         ;;
2745                 (scanf)
2746                         cf_scanf_attribute=yes
2747                         cat >conftest.h <<EOF
2748 #define GCC_$cf_ATTRIBUTE 1
2749 EOF
2750                         ;;
2751                 (*)
2752                         cat >conftest.h <<EOF
2753 #define GCC_$cf_ATTRIBUTE $cf_directive
2754 EOF
2755                         ;;
2756                 esac
2757
2758                 if { (eval echo "$as_me:2758: \"$ac_compile\"") >&5
2759   (eval $ac_compile) 2>&5
2760   ac_status=$?
2761   echo "$as_me:2761: \$? = $ac_status" >&5
2762   (exit $ac_status); }; then
2763                         test -n "$verbose" && echo "$as_me:2763: result: ... $cf_attribute" >&5
2764 echo "${ECHO_T}... $cf_attribute" >&6
2765                         cat conftest.h >>confdefs.h
2766                         case $cf_attribute in
2767                         (noreturn)
2768
2769 cat >>confdefs.h <<EOF
2770 #define GCC_NORETURN $cf_directive
2771 EOF
2772
2773                                 ;;
2774                         (printf)
2775                                 cf_value='/* nothing */'
2776                                 if test "$cf_printf_attribute" != no ; then
2777                                         cf_value='__attribute__((format(printf,fmt,var)))'
2778
2779 cat >>confdefs.h <<\EOF
2780 #define GCC_PRINTF 1
2781 EOF
2782
2783                                 fi
2784
2785 cat >>confdefs.h <<EOF
2786 #define GCC_PRINTFLIKE(fmt,var) $cf_value
2787 EOF
2788
2789                                 ;;
2790                         (scanf)
2791                                 cf_value='/* nothing */'
2792                                 if test "$cf_scanf_attribute" != no ; then
2793                                         cf_value='__attribute__((format(scanf,fmt,var)))'
2794
2795 cat >>confdefs.h <<\EOF
2796 #define GCC_SCANF 1
2797 EOF
2798
2799                                 fi
2800
2801 cat >>confdefs.h <<EOF
2802 #define GCC_SCANFLIKE(fmt,var) $cf_value
2803 EOF
2804
2805                                 ;;
2806                         (unused)
2807
2808 cat >>confdefs.h <<EOF
2809 #define GCC_UNUSED $cf_directive
2810 EOF
2811
2812                                 ;;
2813                         esac
2814                 fi
2815         done
2816 else
2817         fgrep define conftest.i >>confdefs.h
2818 fi
2819 rm -rf conftest*
2820 fi
2821
2822 echo "$as_me:2822: checking if you want to work around bogus compiler/loader warnings" >&5
2823 echo $ECHO_N "checking if you want to work around bogus compiler/loader warnings... $ECHO_C" >&6
2824
2825 # Check whether --enable-string-hacks or --disable-string-hacks was given.
2826 if test "${enable_string_hacks+set}" = set; then
2827   enableval="$enable_string_hacks"
2828   with_string_hacks=$enableval
2829 else
2830   with_string_hacks=no
2831 fi;
2832 echo "$as_me:2832: result: $with_string_hacks" >&5
2833 echo "${ECHO_T}$with_string_hacks" >&6
2834
2835 if test "x$with_string_hacks" = "xyes"; then
2836
2837 cat >>confdefs.h <<\EOF
2838 #define USE_STRING_HACKS 1
2839 EOF
2840
2841         { echo "$as_me:2841: WARNING: enabling string-hacks to work around bogus compiler/loader warnings" >&5
2842 echo "$as_me: WARNING: enabling string-hacks to work around bogus compiler/loader warnings" >&2;}
2843         echo "$as_me:2843: checking for strlcat" >&5
2844 echo $ECHO_N "checking for strlcat... $ECHO_C" >&6
2845 if test "${ac_cv_func_strlcat+set}" = set; then
2846   echo $ECHO_N "(cached) $ECHO_C" >&6
2847 else
2848   cat >conftest.$ac_ext <<_ACEOF
2849 #line 2849 "configure"
2850 #include "confdefs.h"
2851 /* System header to define __stub macros and hopefully few prototypes,
2852     which can conflict with char strlcat (); below.  */
2853 #include <assert.h>
2854 /* Override any gcc2 internal prototype to avoid an error.  */
2855 #ifdef __cplusplus
2856 extern "C"
2857 #endif
2858 /* We use char because int might match the return type of a gcc2
2859    builtin and then its argument prototype would still apply.  */
2860 char strlcat ();
2861 char (*f) ();
2862
2863 int
2864 main ()
2865 {
2866 /* The GNU C library defines this for functions which it implements
2867     to always fail with ENOSYS.  Some functions are actually named
2868     something starting with __ and the normal name is an alias.  */
2869 #if defined (__stub_strlcat) || defined (__stub___strlcat)
2870 choke me
2871 #else
2872 f = strlcat; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
2873 #endif
2874
2875   ;
2876   return 0;
2877 }
2878 _ACEOF
2879 rm -f conftest.$ac_objext conftest$ac_exeext
2880 if { (eval echo "$as_me:2880: \"$ac_link\"") >&5
2881   (eval $ac_link) 2>&5
2882   ac_status=$?
2883   echo "$as_me:2883: \$? = $ac_status" >&5
2884   (exit $ac_status); } &&
2885          { ac_try='test -s conftest$ac_exeext'
2886   { (eval echo "$as_me:2886: \"$ac_try\"") >&5
2887   (eval $ac_try) 2>&5
2888   ac_status=$?
2889   echo "$as_me:2889: \$? = $ac_status" >&5
2890   (exit $ac_status); }; }; then
2891   ac_cv_func_strlcat=yes
2892 else
2893   echo "$as_me: failed program was:" >&5
2894 cat conftest.$ac_ext >&5
2895 ac_cv_func_strlcat=no
2896 fi
2897 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
2898 fi
2899 echo "$as_me:2899: result: $ac_cv_func_strlcat" >&5
2900 echo "${ECHO_T}$ac_cv_func_strlcat" >&6
2901 if test $ac_cv_func_strlcat = yes; then
2902
2903 cat >>confdefs.h <<\EOF
2904 #define HAVE_STRLCAT 1
2905 EOF
2906
2907 else
2908
2909                 echo "$as_me:2909: checking for strlcat in -lbsd" >&5
2910 echo $ECHO_N "checking for strlcat in -lbsd... $ECHO_C" >&6
2911 if test "${ac_cv_lib_bsd_strlcat+set}" = set; then
2912   echo $ECHO_N "(cached) $ECHO_C" >&6
2913 else
2914   ac_check_lib_save_LIBS=$LIBS
2915 LIBS="-lbsd  $LIBS"
2916 cat >conftest.$ac_ext <<_ACEOF
2917 #line 2917 "configure"
2918 #include "confdefs.h"
2919
2920 /* Override any gcc2 internal prototype to avoid an error.  */
2921 #ifdef __cplusplus
2922 extern "C"
2923 #endif
2924 /* We use char because int might match the return type of a gcc2
2925    builtin and then its argument prototype would still apply.  */
2926 char strlcat ();
2927 int
2928 main ()
2929 {
2930 strlcat ();
2931   ;
2932   return 0;
2933 }
2934 _ACEOF
2935 rm -f conftest.$ac_objext conftest$ac_exeext
2936 if { (eval echo "$as_me:2936: \"$ac_link\"") >&5
2937   (eval $ac_link) 2>&5
2938   ac_status=$?
2939   echo "$as_me:2939: \$? = $ac_status" >&5
2940   (exit $ac_status); } &&
2941          { ac_try='test -s conftest$ac_exeext'
2942   { (eval echo "$as_me:2942: \"$ac_try\"") >&5
2943   (eval $ac_try) 2>&5
2944   ac_status=$?
2945   echo "$as_me:2945: \$? = $ac_status" >&5
2946   (exit $ac_status); }; }; then
2947   ac_cv_lib_bsd_strlcat=yes
2948 else
2949   echo "$as_me: failed program was:" >&5
2950 cat conftest.$ac_ext >&5
2951 ac_cv_lib_bsd_strlcat=no
2952 fi
2953 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
2954 LIBS=$ac_check_lib_save_LIBS
2955 fi
2956 echo "$as_me:2956: result: $ac_cv_lib_bsd_strlcat" >&5
2957 echo "${ECHO_T}$ac_cv_lib_bsd_strlcat" >&6
2958 if test $ac_cv_lib_bsd_strlcat = yes; then
2959
2960 cf_add_libs="-lbsd"
2961 # Filter out duplicates - this happens with badly-designed ".pc" files...
2962 for cf_add_1lib in $LIBS
2963 do
2964         for cf_add_2lib in $cf_add_libs
2965         do
2966                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
2967                 then
2968                         cf_add_1lib=
2969                         break
2970                 fi
2971         done
2972         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
2973 done
2974 LIBS="$cf_add_libs"
2975
2976 for ac_header in bsd/string.h
2977 do
2978 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
2979 echo "$as_me:2979: checking for $ac_header" >&5
2980 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
2981 if eval "test \"\${$as_ac_Header+set}\" = set"; then
2982   echo $ECHO_N "(cached) $ECHO_C" >&6
2983 else
2984   cat >conftest.$ac_ext <<_ACEOF
2985 #line 2985 "configure"
2986 #include "confdefs.h"
2987 #include <$ac_header>
2988 _ACEOF
2989 if { (eval echo "$as_me:2989: \"$ac_cpp conftest.$ac_ext\"") >&5
2990   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2991   ac_status=$?
2992   egrep -v '^ *\+' conftest.er1 >conftest.err
2993   rm -f conftest.er1
2994   cat conftest.err >&5
2995   echo "$as_me:2995: \$? = $ac_status" >&5
2996   (exit $ac_status); } >/dev/null; then
2997   if test -s conftest.err; then
2998     ac_cpp_err=$ac_c_preproc_warn_flag
2999   else
3000     ac_cpp_err=
3001   fi
3002 else
3003   ac_cpp_err=yes
3004 fi
3005 if test -z "$ac_cpp_err"; then
3006   eval "$as_ac_Header=yes"
3007 else
3008   echo "$as_me: failed program was:" >&5
3009   cat conftest.$ac_ext >&5
3010   eval "$as_ac_Header=no"
3011 fi
3012 rm -f conftest.err conftest.$ac_ext
3013 fi
3014 echo "$as_me:3014: result: `eval echo '${'$as_ac_Header'}'`" >&5
3015 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
3016 if test `eval echo '${'$as_ac_Header'}'` = yes; then
3017   cat >>confdefs.h <<EOF
3018 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
3019 EOF
3020
3021 fi
3022 done
3023
3024 cat >>confdefs.h <<\EOF
3025 #define HAVE_STRLCAT 1
3026 EOF
3027
3028 fi
3029
3030 fi
3031
3032 for ac_func in strlcpy snprintf
3033 do
3034 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
3035 echo "$as_me:3035: checking for $ac_func" >&5
3036 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
3037 if eval "test \"\${$as_ac_var+set}\" = set"; then
3038   echo $ECHO_N "(cached) $ECHO_C" >&6
3039 else
3040   cat >conftest.$ac_ext <<_ACEOF
3041 #line 3041 "configure"
3042 #include "confdefs.h"
3043 /* System header to define __stub macros and hopefully few prototypes,
3044     which can conflict with char $ac_func (); below.  */
3045 #include <assert.h>
3046 /* Override any gcc2 internal prototype to avoid an error.  */
3047 #ifdef __cplusplus
3048 extern "C"
3049 #endif
3050 /* We use char because int might match the return type of a gcc2
3051    builtin and then its argument prototype would still apply.  */
3052 char $ac_func ();
3053 char (*f) ();
3054
3055 int
3056 main ()
3057 {
3058 /* The GNU C library defines this for functions which it implements
3059     to always fail with ENOSYS.  Some functions are actually named
3060     something starting with __ and the normal name is an alias.  */
3061 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
3062 choke me
3063 #else
3064 f = $ac_func; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
3065 #endif
3066
3067   ;
3068   return 0;
3069 }
3070 _ACEOF
3071 rm -f conftest.$ac_objext conftest$ac_exeext
3072 if { (eval echo "$as_me:3072: \"$ac_link\"") >&5
3073   (eval $ac_link) 2>&5
3074   ac_status=$?
3075   echo "$as_me:3075: \$? = $ac_status" >&5
3076   (exit $ac_status); } &&
3077          { ac_try='test -s conftest$ac_exeext'
3078   { (eval echo "$as_me:3078: \"$ac_try\"") >&5
3079   (eval $ac_try) 2>&5
3080   ac_status=$?
3081   echo "$as_me:3081: \$? = $ac_status" >&5
3082   (exit $ac_status); }; }; then
3083   eval "$as_ac_var=yes"
3084 else
3085   echo "$as_me: failed program was:" >&5
3086 cat conftest.$ac_ext >&5
3087 eval "$as_ac_var=no"
3088 fi
3089 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
3090 fi
3091 echo "$as_me:3091: result: `eval echo '${'$as_ac_var'}'`" >&5
3092 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
3093 if test `eval echo '${'$as_ac_var'}'` = yes; then
3094   cat >>confdefs.h <<EOF
3095 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
3096 EOF
3097
3098 fi
3099 done
3100
3101 fi
3102
3103 cf_XOPEN_SOURCE=500
3104 cf_POSIX_C_SOURCE=199506L
3105 cf_xopen_source=
3106
3107 case $host_os in
3108 (aix[4-7]*)
3109         cf_xopen_source="-D_ALL_SOURCE"
3110         ;;
3111 (msys)
3112         cf_XOPEN_SOURCE=600
3113         ;;
3114 (darwin[0-8].*)
3115         cf_xopen_source="-D_APPLE_C_SOURCE"
3116         ;;
3117 (darwin*)
3118         cf_xopen_source="-D_DARWIN_C_SOURCE"
3119         cf_XOPEN_SOURCE=
3120         ;;
3121 (freebsd*|dragonfly*)
3122         # 5.x headers associate
3123         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
3124         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
3125         cf_POSIX_C_SOURCE=200112L
3126         cf_XOPEN_SOURCE=600
3127         cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
3128         ;;
3129 (hpux11*)
3130         cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
3131         ;;
3132 (hpux*)
3133         cf_xopen_source="-D_HPUX_SOURCE"
3134         ;;
3135 (irix[56].*)
3136         cf_xopen_source="-D_SGI_SOURCE"
3137         cf_XOPEN_SOURCE=
3138         ;;
3139 (linux*|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin)
3140
3141 echo "$as_me:3141: checking if we must define _GNU_SOURCE" >&5
3142 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
3143 if test "${cf_cv_gnu_source+set}" = set; then
3144   echo $ECHO_N "(cached) $ECHO_C" >&6
3145 else
3146
3147 cat >conftest.$ac_ext <<_ACEOF
3148 #line 3148 "configure"
3149 #include "confdefs.h"
3150 #include <sys/types.h>
3151 int
3152 main ()
3153 {
3154
3155 #ifndef _XOPEN_SOURCE
3156 make an error
3157 #endif
3158   ;
3159   return 0;
3160 }
3161 _ACEOF
3162 rm -f conftest.$ac_objext
3163 if { (eval echo "$as_me:3163: \"$ac_compile\"") >&5
3164   (eval $ac_compile) 2>&5
3165   ac_status=$?
3166   echo "$as_me:3166: \$? = $ac_status" >&5
3167   (exit $ac_status); } &&
3168          { ac_try='test -s conftest.$ac_objext'
3169   { (eval echo "$as_me:3169: \"$ac_try\"") >&5
3170   (eval $ac_try) 2>&5
3171   ac_status=$?
3172   echo "$as_me:3172: \$? = $ac_status" >&5
3173   (exit $ac_status); }; }; then
3174   cf_cv_gnu_source=no
3175 else
3176   echo "$as_me: failed program was:" >&5
3177 cat conftest.$ac_ext >&5
3178 cf_save="$CPPFLAGS"
3179          CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
3180          cat >conftest.$ac_ext <<_ACEOF
3181 #line 3181 "configure"
3182 #include "confdefs.h"
3183 #include <sys/types.h>
3184 int
3185 main ()
3186 {
3187
3188 #ifdef _XOPEN_SOURCE
3189 make an error
3190 #endif
3191   ;
3192   return 0;
3193 }
3194 _ACEOF
3195 rm -f conftest.$ac_objext
3196 if { (eval echo "$as_me:3196: \"$ac_compile\"") >&5
3197   (eval $ac_compile) 2>&5
3198   ac_status=$?
3199   echo "$as_me:3199: \$? = $ac_status" >&5
3200   (exit $ac_status); } &&
3201          { ac_try='test -s conftest.$ac_objext'
3202   { (eval echo "$as_me:3202: \"$ac_try\"") >&5
3203   (eval $ac_try) 2>&5
3204   ac_status=$?
3205   echo "$as_me:3205: \$? = $ac_status" >&5
3206   (exit $ac_status); }; }; then
3207   cf_cv_gnu_source=no
3208 else
3209   echo "$as_me: failed program was:" >&5
3210 cat conftest.$ac_ext >&5
3211 cf_cv_gnu_source=yes
3212 fi
3213 rm -f conftest.$ac_objext conftest.$ac_ext
3214         CPPFLAGS="$cf_save"
3215
3216 fi
3217 rm -f conftest.$ac_objext conftest.$ac_ext
3218
3219 fi
3220 echo "$as_me:3220: result: $cf_cv_gnu_source" >&5
3221 echo "${ECHO_T}$cf_cv_gnu_source" >&6
3222
3223 if test "$cf_cv_gnu_source" = yes
3224 then
3225 echo "$as_me:3225: checking if we should also define _DEFAULT_SOURCE" >&5
3226 echo $ECHO_N "checking if we should also define _DEFAULT_SOURCE... $ECHO_C" >&6
3227 if test "${cf_cv_default_source+set}" = set; then
3228   echo $ECHO_N "(cached) $ECHO_C" >&6
3229 else
3230
3231 CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
3232         cat >conftest.$ac_ext <<_ACEOF
3233 #line 3233 "configure"
3234 #include "confdefs.h"
3235 #include <sys/types.h>
3236 int
3237 main ()
3238 {
3239
3240 #ifdef _DEFAULT_SOURCE
3241 make an error
3242 #endif
3243   ;
3244   return 0;
3245 }
3246 _ACEOF
3247 rm -f conftest.$ac_objext
3248 if { (eval echo "$as_me:3248: \"$ac_compile\"") >&5
3249   (eval $ac_compile) 2>&5
3250   ac_status=$?
3251   echo "$as_me:3251: \$? = $ac_status" >&5
3252   (exit $ac_status); } &&
3253          { ac_try='test -s conftest.$ac_objext'
3254   { (eval echo "$as_me:3254: \"$ac_try\"") >&5
3255   (eval $ac_try) 2>&5
3256   ac_status=$?
3257   echo "$as_me:3257: \$? = $ac_status" >&5
3258   (exit $ac_status); }; }; then
3259   cf_cv_default_source=no
3260 else
3261   echo "$as_me: failed program was:" >&5
3262 cat conftest.$ac_ext >&5
3263 cf_cv_default_source=yes
3264 fi
3265 rm -f conftest.$ac_objext conftest.$ac_ext
3266
3267 fi
3268 echo "$as_me:3268: result: $cf_cv_default_source" >&5
3269 echo "${ECHO_T}$cf_cv_default_source" >&6
3270 test "$cf_cv_default_source" = yes && CPPFLAGS="$CPPFLAGS -D_DEFAULT_SOURCE"
3271 fi
3272
3273         ;;
3274 (minix*)
3275         cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this...
3276         ;;
3277 (mirbsd*)
3278         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
3279         cf_XOPEN_SOURCE=
3280
3281 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
3282
3283 cf_save_CFLAGS="$CFLAGS"
3284 cf_save_CPPFLAGS="$CPPFLAGS"
3285
3286 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
3287         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
3288                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
3289
3290 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
3291         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
3292                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
3293
3294 echo "$as_me:3294: checking if we should define _POSIX_C_SOURCE" >&5
3295 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
3296 if test "${cf_cv_posix_c_source+set}" = set; then
3297   echo $ECHO_N "(cached) $ECHO_C" >&6
3298 else
3299
3300 echo "${as_me:-configure}:3300: testing if the symbol is already defined go no further ..." 1>&5
3301
3302         cat >conftest.$ac_ext <<_ACEOF
3303 #line 3303 "configure"
3304 #include "confdefs.h"
3305 #include <sys/types.h>
3306 int
3307 main ()
3308 {
3309
3310 #ifndef _POSIX_C_SOURCE
3311 make an error
3312 #endif
3313   ;
3314   return 0;
3315 }
3316 _ACEOF
3317 rm -f conftest.$ac_objext
3318 if { (eval echo "$as_me:3318: \"$ac_compile\"") >&5
3319   (eval $ac_compile) 2>&5
3320   ac_status=$?
3321   echo "$as_me:3321: \$? = $ac_status" >&5
3322   (exit $ac_status); } &&
3323          { ac_try='test -s conftest.$ac_objext'
3324   { (eval echo "$as_me:3324: \"$ac_try\"") >&5
3325   (eval $ac_try) 2>&5
3326   ac_status=$?
3327   echo "$as_me:3327: \$? = $ac_status" >&5
3328   (exit $ac_status); }; }; then
3329   cf_cv_posix_c_source=no
3330 else
3331   echo "$as_me: failed program was:" >&5
3332 cat conftest.$ac_ext >&5
3333 cf_want_posix_source=no
3334          case .$cf_POSIX_C_SOURCE in
3335          (.[12]??*)
3336                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
3337                 ;;
3338          (.2)
3339                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
3340                 cf_want_posix_source=yes
3341                 ;;
3342          (.*)
3343                 cf_want_posix_source=yes
3344                 ;;
3345          esac
3346          if test "$cf_want_posix_source" = yes ; then
3347                 cat >conftest.$ac_ext <<_ACEOF
3348 #line 3348 "configure"
3349 #include "confdefs.h"
3350 #include <sys/types.h>
3351 int
3352 main ()
3353 {
3354
3355 #ifdef _POSIX_SOURCE
3356 make an error
3357 #endif
3358   ;
3359   return 0;
3360 }
3361 _ACEOF
3362 rm -f conftest.$ac_objext
3363 if { (eval echo "$as_me:3363: \"$ac_compile\"") >&5
3364   (eval $ac_compile) 2>&5
3365   ac_status=$?
3366   echo "$as_me:3366: \$? = $ac_status" >&5
3367   (exit $ac_status); } &&
3368          { ac_try='test -s conftest.$ac_objext'
3369   { (eval echo "$as_me:3369: \"$ac_try\"") >&5
3370   (eval $ac_try) 2>&5
3371   ac_status=$?
3372   echo "$as_me:3372: \$? = $ac_status" >&5
3373   (exit $ac_status); }; }; then
3374   :
3375 else
3376   echo "$as_me: failed program was:" >&5
3377 cat conftest.$ac_ext >&5
3378 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
3379 fi
3380 rm -f conftest.$ac_objext conftest.$ac_ext
3381          fi
3382
3383 echo "${as_me:-configure}:3383: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
3384
3385          CFLAGS="$cf_trim_CFLAGS"
3386          CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
3387
3388 echo "${as_me:-configure}:3388: testing if the second compile does not leave our definition intact error ..." 1>&5
3389
3390          cat >conftest.$ac_ext <<_ACEOF
3391 #line 3391 "configure"
3392 #include "confdefs.h"
3393 #include <sys/types.h>
3394 int
3395 main ()
3396 {
3397
3398 #ifndef _POSIX_C_SOURCE
3399 make an error
3400 #endif
3401   ;
3402   return 0;
3403 }
3404 _ACEOF
3405 rm -f conftest.$ac_objext
3406 if { (eval echo "$as_me:3406: \"$ac_compile\"") >&5
3407   (eval $ac_compile) 2>&5
3408   ac_status=$?
3409   echo "$as_me:3409: \$? = $ac_status" >&5
3410   (exit $ac_status); } &&
3411          { ac_try='test -s conftest.$ac_objext'
3412   { (eval echo "$as_me:3412: \"$ac_try\"") >&5
3413   (eval $ac_try) 2>&5
3414   ac_status=$?
3415   echo "$as_me:3415: \$? = $ac_status" >&5
3416   (exit $ac_status); }; }; then
3417   :
3418 else
3419   echo "$as_me: failed program was:" >&5
3420 cat conftest.$ac_ext >&5
3421 cf_cv_posix_c_source=no
3422 fi
3423 rm -f conftest.$ac_objext conftest.$ac_ext
3424          CFLAGS="$cf_save_CFLAGS"
3425          CPPFLAGS="$cf_save_CPPFLAGS"
3426
3427 fi
3428 rm -f conftest.$ac_objext conftest.$ac_ext
3429
3430 fi
3431 echo "$as_me:3431: result: $cf_cv_posix_c_source" >&5
3432 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
3433
3434 if test "$cf_cv_posix_c_source" != no ; then
3435         CFLAGS="$cf_trim_CFLAGS"
3436         CPPFLAGS="$cf_trim_CPPFLAGS"
3437
3438 cf_fix_cppflags=no
3439 cf_new_cflags=
3440 cf_new_cppflags=
3441 cf_new_extra_cppflags=
3442
3443 for cf_add_cflags in $cf_cv_posix_c_source
3444 do
3445 case $cf_fix_cppflags in
3446 (no)
3447         case $cf_add_cflags in
3448         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
3449                 case $cf_add_cflags in
3450                 (-D*)
3451                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3452
3453                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3454                                 && test -z "${cf_tst_cflags}" \
3455                                 && cf_fix_cppflags=yes
3456
3457                         if test $cf_fix_cppflags = yes ; then
3458                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3459                                 continue
3460                         elif test "${cf_tst_cflags}" = "\"'" ; then
3461                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3462                                 continue
3463                         fi
3464                         ;;
3465                 esac
3466                 case "$CPPFLAGS" in
3467                 (*$cf_add_cflags)
3468                         ;;
3469                 (*)
3470                         case $cf_add_cflags in
3471                         (-D*)
3472                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3473
3474 CPPFLAGS=`echo "$CPPFLAGS" | \
3475         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3476                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3477
3478                                 ;;
3479                         esac
3480                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3481                         ;;
3482                 esac
3483                 ;;
3484         (*)
3485                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
3486                 ;;
3487         esac
3488         ;;
3489 (yes)
3490         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3491
3492         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3493
3494         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3495                 && test -z "${cf_tst_cflags}" \
3496                 && cf_fix_cppflags=no
3497         ;;
3498 esac
3499 done
3500
3501 if test -n "$cf_new_cflags" ; then
3502
3503         CFLAGS="$CFLAGS $cf_new_cflags"
3504 fi
3505
3506 if test -n "$cf_new_cppflags" ; then
3507
3508         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
3509 fi
3510
3511 if test -n "$cf_new_extra_cppflags" ; then
3512
3513         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
3514 fi
3515
3516 fi
3517
3518         ;;
3519 (netbsd*)
3520         cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
3521         ;;
3522 (openbsd[4-9]*)
3523         # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
3524         cf_xopen_source="-D_BSD_SOURCE"
3525         cf_XOPEN_SOURCE=600
3526         ;;
3527 (openbsd*)
3528         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
3529         ;;
3530 (osf[45]*)
3531         cf_xopen_source="-D_OSF_SOURCE"
3532         ;;
3533 (nto-qnx*)
3534         cf_xopen_source="-D_QNX_SOURCE"
3535         ;;
3536 (sco*)
3537         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
3538         ;;
3539 (solaris2.*)
3540         cf_xopen_source="-D__EXTENSIONS__"
3541         cf_cv_xopen_source=broken
3542         ;;
3543 (sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
3544         cf_XOPEN_SOURCE=
3545         cf_POSIX_C_SOURCE=
3546         ;;
3547 (*)
3548
3549 echo "$as_me:3549: checking if we should define _XOPEN_SOURCE" >&5
3550 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
3551 if test "${cf_cv_xopen_source+set}" = set; then
3552   echo $ECHO_N "(cached) $ECHO_C" >&6
3553 else
3554
3555         cat >conftest.$ac_ext <<_ACEOF
3556 #line 3556 "configure"
3557 #include "confdefs.h"
3558
3559 #include <stdlib.h>
3560 #include <string.h>
3561 #include <sys/types.h>
3562
3563 int
3564 main ()
3565 {
3566
3567 #ifndef _XOPEN_SOURCE
3568 make an error
3569 #endif
3570   ;
3571   return 0;
3572 }
3573 _ACEOF
3574 rm -f conftest.$ac_objext
3575 if { (eval echo "$as_me:3575: \"$ac_compile\"") >&5
3576   (eval $ac_compile) 2>&5
3577   ac_status=$?
3578   echo "$as_me:3578: \$? = $ac_status" >&5
3579   (exit $ac_status); } &&
3580          { ac_try='test -s conftest.$ac_objext'
3581   { (eval echo "$as_me:3581: \"$ac_try\"") >&5
3582   (eval $ac_try) 2>&5
3583   ac_status=$?
3584   echo "$as_me:3584: \$? = $ac_status" >&5
3585   (exit $ac_status); }; }; then
3586   cf_cv_xopen_source=no
3587 else
3588   echo "$as_me: failed program was:" >&5
3589 cat conftest.$ac_ext >&5
3590 cf_save="$CPPFLAGS"
3591          CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
3592          cat >conftest.$ac_ext <<_ACEOF
3593 #line 3593 "configure"
3594 #include "confdefs.h"
3595
3596 #include <stdlib.h>
3597 #include <string.h>
3598 #include <sys/types.h>
3599
3600 int
3601 main ()
3602 {
3603
3604 #ifdef _XOPEN_SOURCE
3605 make an error
3606 #endif
3607   ;
3608   return 0;
3609 }
3610 _ACEOF
3611 rm -f conftest.$ac_objext
3612 if { (eval echo "$as_me:3612: \"$ac_compile\"") >&5
3613   (eval $ac_compile) 2>&5
3614   ac_status=$?
3615   echo "$as_me:3615: \$? = $ac_status" >&5
3616   (exit $ac_status); } &&
3617          { ac_try='test -s conftest.$ac_objext'
3618   { (eval echo "$as_me:3618: \"$ac_try\"") >&5
3619   (eval $ac_try) 2>&5
3620   ac_status=$?
3621   echo "$as_me:3621: \$? = $ac_status" >&5
3622   (exit $ac_status); }; }; then
3623   cf_cv_xopen_source=no
3624 else
3625   echo "$as_me: failed program was:" >&5
3626 cat conftest.$ac_ext >&5
3627 cf_cv_xopen_source=$cf_XOPEN_SOURCE
3628 fi
3629 rm -f conftest.$ac_objext conftest.$ac_ext
3630         CPPFLAGS="$cf_save"
3631
3632 fi
3633 rm -f conftest.$ac_objext conftest.$ac_ext
3634
3635 fi
3636 echo "$as_me:3636: result: $cf_cv_xopen_source" >&5
3637 echo "${ECHO_T}$cf_cv_xopen_source" >&6
3638
3639 if test "$cf_cv_xopen_source" != no ; then
3640
3641 CFLAGS=`echo "$CFLAGS" | \
3642         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
3643                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
3644
3645 CPPFLAGS=`echo "$CPPFLAGS" | \
3646         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
3647                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
3648
3649         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
3650
3651 cf_fix_cppflags=no
3652 cf_new_cflags=
3653 cf_new_cppflags=
3654 cf_new_extra_cppflags=
3655
3656 for cf_add_cflags in $cf_temp_xopen_source
3657 do
3658 case $cf_fix_cppflags in
3659 (no)
3660         case $cf_add_cflags in
3661         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
3662                 case $cf_add_cflags in
3663                 (-D*)
3664                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3665
3666                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3667                                 && test -z "${cf_tst_cflags}" \
3668                                 && cf_fix_cppflags=yes
3669
3670                         if test $cf_fix_cppflags = yes ; then
3671                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3672                                 continue
3673                         elif test "${cf_tst_cflags}" = "\"'" ; then
3674                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3675                                 continue
3676                         fi
3677                         ;;
3678                 esac
3679                 case "$CPPFLAGS" in
3680                 (*$cf_add_cflags)
3681                         ;;
3682                 (*)
3683                         case $cf_add_cflags in
3684                         (-D*)
3685                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3686
3687 CPPFLAGS=`echo "$CPPFLAGS" | \
3688         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3689                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3690
3691                                 ;;
3692                         esac
3693                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3694                         ;;
3695                 esac
3696                 ;;
3697         (*)
3698                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
3699                 ;;
3700         esac
3701         ;;
3702 (yes)
3703         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3704
3705         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3706
3707         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3708                 && test -z "${cf_tst_cflags}" \
3709                 && cf_fix_cppflags=no
3710         ;;
3711 esac
3712 done
3713
3714 if test -n "$cf_new_cflags" ; then
3715
3716         CFLAGS="$CFLAGS $cf_new_cflags"
3717 fi
3718
3719 if test -n "$cf_new_cppflags" ; then
3720
3721         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
3722 fi
3723
3724 if test -n "$cf_new_extra_cppflags" ; then
3725
3726         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
3727 fi
3728
3729 fi
3730
3731 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
3732
3733 cf_save_CFLAGS="$CFLAGS"
3734 cf_save_CPPFLAGS="$CPPFLAGS"
3735
3736 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
3737         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
3738                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
3739
3740 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
3741         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
3742                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
3743
3744 echo "$as_me:3744: checking if we should define _POSIX_C_SOURCE" >&5
3745 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
3746 if test "${cf_cv_posix_c_source+set}" = set; then
3747   echo $ECHO_N "(cached) $ECHO_C" >&6
3748 else
3749
3750 echo "${as_me:-configure}:3750: testing if the symbol is already defined go no further ..." 1>&5
3751
3752         cat >conftest.$ac_ext <<_ACEOF
3753 #line 3753 "configure"
3754 #include "confdefs.h"
3755 #include <sys/types.h>
3756 int
3757 main ()
3758 {
3759
3760 #ifndef _POSIX_C_SOURCE
3761 make an error
3762 #endif
3763   ;
3764   return 0;
3765 }
3766 _ACEOF
3767 rm -f conftest.$ac_objext
3768 if { (eval echo "$as_me:3768: \"$ac_compile\"") >&5
3769   (eval $ac_compile) 2>&5
3770   ac_status=$?
3771   echo "$as_me:3771: \$? = $ac_status" >&5
3772   (exit $ac_status); } &&
3773          { ac_try='test -s conftest.$ac_objext'
3774   { (eval echo "$as_me:3774: \"$ac_try\"") >&5
3775   (eval $ac_try) 2>&5
3776   ac_status=$?
3777   echo "$as_me:3777: \$? = $ac_status" >&5
3778   (exit $ac_status); }; }; then
3779   cf_cv_posix_c_source=no
3780 else
3781   echo "$as_me: failed program was:" >&5
3782 cat conftest.$ac_ext >&5
3783 cf_want_posix_source=no
3784          case .$cf_POSIX_C_SOURCE in
3785          (.[12]??*)
3786                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
3787                 ;;
3788          (.2)
3789                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
3790                 cf_want_posix_source=yes
3791                 ;;
3792          (.*)
3793                 cf_want_posix_source=yes
3794                 ;;
3795          esac
3796          if test "$cf_want_posix_source" = yes ; then
3797                 cat >conftest.$ac_ext <<_ACEOF
3798 #line 3798 "configure"
3799 #include "confdefs.h"
3800 #include <sys/types.h>
3801 int
3802 main ()
3803 {
3804
3805 #ifdef _POSIX_SOURCE
3806 make an error
3807 #endif
3808   ;
3809   return 0;
3810 }
3811 _ACEOF
3812 rm -f conftest.$ac_objext
3813 if { (eval echo "$as_me:3813: \"$ac_compile\"") >&5
3814   (eval $ac_compile) 2>&5
3815   ac_status=$?
3816   echo "$as_me:3816: \$? = $ac_status" >&5
3817   (exit $ac_status); } &&
3818          { ac_try='test -s conftest.$ac_objext'
3819   { (eval echo "$as_me:3819: \"$ac_try\"") >&5
3820   (eval $ac_try) 2>&5
3821   ac_status=$?
3822   echo "$as_me:3822: \$? = $ac_status" >&5
3823   (exit $ac_status); }; }; then
3824   :
3825 else
3826   echo "$as_me: failed program was:" >&5
3827 cat conftest.$ac_ext >&5
3828 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
3829 fi
3830 rm -f conftest.$ac_objext conftest.$ac_ext
3831          fi
3832
3833 echo "${as_me:-configure}:3833: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
3834
3835          CFLAGS="$cf_trim_CFLAGS"
3836          CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
3837
3838 echo "${as_me:-configure}:3838: testing if the second compile does not leave our definition intact error ..." 1>&5
3839
3840          cat >conftest.$ac_ext <<_ACEOF
3841 #line 3841 "configure"
3842 #include "confdefs.h"
3843 #include <sys/types.h>
3844 int
3845 main ()
3846 {
3847
3848 #ifndef _POSIX_C_SOURCE
3849 make an error
3850 #endif
3851   ;
3852   return 0;
3853 }
3854 _ACEOF
3855 rm -f conftest.$ac_objext
3856 if { (eval echo "$as_me:3856: \"$ac_compile\"") >&5
3857   (eval $ac_compile) 2>&5
3858   ac_status=$?
3859   echo "$as_me:3859: \$? = $ac_status" >&5
3860   (exit $ac_status); } &&
3861          { ac_try='test -s conftest.$ac_objext'
3862   { (eval echo "$as_me:3862: \"$ac_try\"") >&5
3863   (eval $ac_try) 2>&5
3864   ac_status=$?
3865   echo "$as_me:3865: \$? = $ac_status" >&5
3866   (exit $ac_status); }; }; then
3867   :
3868 else
3869   echo "$as_me: failed program was:" >&5
3870 cat conftest.$ac_ext >&5
3871 cf_cv_posix_c_source=no
3872 fi
3873 rm -f conftest.$ac_objext conftest.$ac_ext
3874          CFLAGS="$cf_save_CFLAGS"
3875          CPPFLAGS="$cf_save_CPPFLAGS"
3876
3877 fi
3878 rm -f conftest.$ac_objext conftest.$ac_ext
3879
3880 fi
3881 echo "$as_me:3881: result: $cf_cv_posix_c_source" >&5
3882 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
3883
3884 if test "$cf_cv_posix_c_source" != no ; then
3885         CFLAGS="$cf_trim_CFLAGS"
3886         CPPFLAGS="$cf_trim_CPPFLAGS"
3887
3888 cf_fix_cppflags=no
3889 cf_new_cflags=
3890 cf_new_cppflags=
3891 cf_new_extra_cppflags=
3892
3893 for cf_add_cflags in $cf_cv_posix_c_source
3894 do
3895 case $cf_fix_cppflags in
3896 (no)
3897         case $cf_add_cflags in
3898         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
3899                 case $cf_add_cflags in
3900                 (-D*)
3901                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3902
3903                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3904                                 && test -z "${cf_tst_cflags}" \
3905                                 && cf_fix_cppflags=yes
3906
3907                         if test $cf_fix_cppflags = yes ; then
3908                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3909                                 continue
3910                         elif test "${cf_tst_cflags}" = "\"'" ; then
3911                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3912                                 continue
3913                         fi
3914                         ;;
3915                 esac
3916                 case "$CPPFLAGS" in
3917                 (*$cf_add_cflags)
3918                         ;;
3919                 (*)
3920                         case $cf_add_cflags in
3921                         (-D*)
3922                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3923
3924 CPPFLAGS=`echo "$CPPFLAGS" | \
3925         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3926                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3927
3928                                 ;;
3929                         esac
3930                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3931                         ;;
3932                 esac
3933                 ;;
3934         (*)
3935                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
3936                 ;;
3937         esac
3938         ;;
3939 (yes)
3940         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3941
3942         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3943
3944         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3945                 && test -z "${cf_tst_cflags}" \
3946                 && cf_fix_cppflags=no
3947         ;;
3948 esac
3949 done
3950
3951 if test -n "$cf_new_cflags" ; then
3952
3953         CFLAGS="$CFLAGS $cf_new_cflags"
3954 fi
3955
3956 if test -n "$cf_new_cppflags" ; then
3957
3958         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
3959 fi
3960
3961 if test -n "$cf_new_extra_cppflags" ; then
3962
3963         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
3964 fi
3965
3966 fi
3967
3968         ;;
3969 esac
3970
3971 if test -n "$cf_xopen_source" ; then
3972
3973 cf_fix_cppflags=no
3974 cf_new_cflags=
3975 cf_new_cppflags=
3976 cf_new_extra_cppflags=
3977
3978 for cf_add_cflags in $cf_xopen_source
3979 do
3980 case $cf_fix_cppflags in
3981 (no)
3982         case $cf_add_cflags in
3983         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
3984                 case $cf_add_cflags in
3985                 (-D*)
3986                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3987
3988                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3989                                 && test -z "${cf_tst_cflags}" \
3990                                 && cf_fix_cppflags=yes
3991
3992                         if test $cf_fix_cppflags = yes ; then
3993                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3994                                 continue
3995                         elif test "${cf_tst_cflags}" = "\"'" ; then
3996                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3997                                 continue
3998                         fi
3999                         ;;
4000                 esac
4001                 case "$CPPFLAGS" in
4002                 (*$cf_add_cflags)
4003                         ;;
4004                 (*)
4005                         case $cf_add_cflags in
4006                         (-D*)
4007                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4008
4009 CPPFLAGS=`echo "$CPPFLAGS" | \
4010         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4011                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4012
4013                                 ;;
4014                         esac
4015                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
4016                         ;;
4017                 esac
4018                 ;;
4019         (*)
4020                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
4021                 ;;
4022         esac
4023         ;;
4024 (yes)
4025         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
4026
4027         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4028
4029         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4030                 && test -z "${cf_tst_cflags}" \
4031                 && cf_fix_cppflags=no
4032         ;;
4033 esac
4034 done
4035
4036 if test -n "$cf_new_cflags" ; then
4037         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
4038
4039 echo "${as_me:-configure}:4039: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
4040
4041         CFLAGS="$CFLAGS $cf_new_cflags"
4042 fi
4043
4044 if test -n "$cf_new_cppflags" ; then
4045         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
4046
4047 echo "${as_me:-configure}:4047: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
4048
4049         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
4050 fi
4051
4052 if test -n "$cf_new_extra_cppflags" ; then
4053         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
4054
4055 echo "${as_me:-configure}:4055: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
4056
4057         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
4058 fi
4059
4060 fi
4061
4062 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
4063         echo "$as_me:4063: checking if _XOPEN_SOURCE really is set" >&5
4064 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
4065         cat >conftest.$ac_ext <<_ACEOF
4066 #line 4066 "configure"
4067 #include "confdefs.h"
4068 #include <stdlib.h>
4069 int
4070 main ()
4071 {
4072
4073 #ifndef _XOPEN_SOURCE
4074 make an error
4075 #endif
4076   ;
4077   return 0;
4078 }
4079 _ACEOF
4080 rm -f conftest.$ac_objext
4081 if { (eval echo "$as_me:4081: \"$ac_compile\"") >&5
4082   (eval $ac_compile) 2>&5
4083   ac_status=$?
4084   echo "$as_me:4084: \$? = $ac_status" >&5
4085   (exit $ac_status); } &&
4086          { ac_try='test -s conftest.$ac_objext'
4087   { (eval echo "$as_me:4087: \"$ac_try\"") >&5
4088   (eval $ac_try) 2>&5
4089   ac_status=$?
4090   echo "$as_me:4090: \$? = $ac_status" >&5
4091   (exit $ac_status); }; }; then
4092   cf_XOPEN_SOURCE_set=yes
4093 else
4094   echo "$as_me: failed program was:" >&5
4095 cat conftest.$ac_ext >&5
4096 cf_XOPEN_SOURCE_set=no
4097 fi
4098 rm -f conftest.$ac_objext conftest.$ac_ext
4099         echo "$as_me:4099: result: $cf_XOPEN_SOURCE_set" >&5
4100 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
4101         if test $cf_XOPEN_SOURCE_set = yes
4102         then
4103                 cat >conftest.$ac_ext <<_ACEOF
4104 #line 4104 "configure"
4105 #include "confdefs.h"
4106 #include <stdlib.h>
4107 int
4108 main ()
4109 {
4110
4111 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
4112 make an error
4113 #endif
4114   ;
4115   return 0;
4116 }
4117 _ACEOF
4118 rm -f conftest.$ac_objext
4119 if { (eval echo "$as_me:4119: \"$ac_compile\"") >&5
4120   (eval $ac_compile) 2>&5
4121   ac_status=$?
4122   echo "$as_me:4122: \$? = $ac_status" >&5
4123   (exit $ac_status); } &&
4124          { ac_try='test -s conftest.$ac_objext'
4125   { (eval echo "$as_me:4125: \"$ac_try\"") >&5
4126   (eval $ac_try) 2>&5
4127   ac_status=$?
4128   echo "$as_me:4128: \$? = $ac_status" >&5
4129   (exit $ac_status); }; }; then
4130   cf_XOPEN_SOURCE_set_ok=yes
4131 else
4132   echo "$as_me: failed program was:" >&5
4133 cat conftest.$ac_ext >&5
4134 cf_XOPEN_SOURCE_set_ok=no
4135 fi
4136 rm -f conftest.$ac_objext conftest.$ac_ext
4137                 if test $cf_XOPEN_SOURCE_set_ok = no
4138                 then
4139                         { echo "$as_me:4139: WARNING: _XOPEN_SOURCE is lower than requested" >&5
4140 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
4141                 fi
4142         else
4143
4144 echo "$as_me:4144: checking if we should define _XOPEN_SOURCE" >&5
4145 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
4146 if test "${cf_cv_xopen_source+set}" = set; then
4147   echo $ECHO_N "(cached) $ECHO_C" >&6
4148 else
4149
4150         cat >conftest.$ac_ext <<_ACEOF
4151 #line 4151 "configure"
4152 #include "confdefs.h"
4153
4154 #include <stdlib.h>
4155 #include <string.h>
4156 #include <sys/types.h>
4157
4158 int
4159 main ()
4160 {
4161
4162 #ifndef _XOPEN_SOURCE
4163 make an error
4164 #endif
4165   ;
4166   return 0;
4167 }
4168 _ACEOF
4169 rm -f conftest.$ac_objext
4170 if { (eval echo "$as_me:4170: \"$ac_compile\"") >&5
4171   (eval $ac_compile) 2>&5
4172   ac_status=$?
4173   echo "$as_me:4173: \$? = $ac_status" >&5
4174   (exit $ac_status); } &&
4175          { ac_try='test -s conftest.$ac_objext'
4176   { (eval echo "$as_me:4176: \"$ac_try\"") >&5
4177   (eval $ac_try) 2>&5
4178   ac_status=$?
4179   echo "$as_me:4179: \$? = $ac_status" >&5
4180   (exit $ac_status); }; }; then
4181   cf_cv_xopen_source=no
4182 else
4183   echo "$as_me: failed program was:" >&5
4184 cat conftest.$ac_ext >&5
4185 cf_save="$CPPFLAGS"
4186          CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
4187          cat >conftest.$ac_ext <<_ACEOF
4188 #line 4188 "configure"
4189 #include "confdefs.h"
4190
4191 #include <stdlib.h>
4192 #include <string.h>
4193 #include <sys/types.h>
4194
4195 int
4196 main ()
4197 {
4198
4199 #ifdef _XOPEN_SOURCE
4200 make an error
4201 #endif
4202   ;
4203   return 0;
4204 }
4205 _ACEOF
4206 rm -f conftest.$ac_objext
4207 if { (eval echo "$as_me:4207: \"$ac_compile\"") >&5
4208   (eval $ac_compile) 2>&5
4209   ac_status=$?
4210   echo "$as_me:4210: \$? = $ac_status" >&5
4211   (exit $ac_status); } &&
4212          { ac_try='test -s conftest.$ac_objext'
4213   { (eval echo "$as_me:4213: \"$ac_try\"") >&5
4214   (eval $ac_try) 2>&5
4215   ac_status=$?
4216   echo "$as_me:4216: \$? = $ac_status" >&5
4217   (exit $ac_status); }; }; then
4218   cf_cv_xopen_source=no
4219 else
4220   echo "$as_me: failed program was:" >&5
4221 cat conftest.$ac_ext >&5
4222 cf_cv_xopen_source=$cf_XOPEN_SOURCE
4223 fi
4224 rm -f conftest.$ac_objext conftest.$ac_ext
4225         CPPFLAGS="$cf_save"
4226
4227 fi
4228 rm -f conftest.$ac_objext conftest.$ac_ext
4229
4230 fi
4231 echo "$as_me:4231: result: $cf_cv_xopen_source" >&5
4232 echo "${ECHO_T}$cf_cv_xopen_source" >&6
4233
4234 if test "$cf_cv_xopen_source" != no ; then
4235
4236 CFLAGS=`echo "$CFLAGS" | \
4237         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
4238                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
4239
4240 CPPFLAGS=`echo "$CPPFLAGS" | \
4241         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
4242                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
4243
4244         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
4245
4246 cf_fix_cppflags=no
4247 cf_new_cflags=
4248 cf_new_cppflags=
4249 cf_new_extra_cppflags=
4250
4251 for cf_add_cflags in $cf_temp_xopen_source
4252 do
4253 case $cf_fix_cppflags in
4254 (no)
4255         case $cf_add_cflags in
4256         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4257                 case $cf_add_cflags in
4258                 (-D*)
4259                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4260
4261                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4262                                 && test -z "${cf_tst_cflags}" \
4263                                 && cf_fix_cppflags=yes
4264
4265                         if test $cf_fix_cppflags = yes ; then
4266                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
4267                                 continue
4268                         elif test "${cf_tst_cflags}" = "\"'" ; then
4269                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
4270                                 continue
4271                         fi
4272                         ;;
4273                 esac
4274                 case "$CPPFLAGS" in
4275                 (*$cf_add_cflags)
4276                         ;;
4277                 (*)
4278                         case $cf_add_cflags in
4279                         (-D*)
4280                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4281
4282 CPPFLAGS=`echo "$CPPFLAGS" | \
4283         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4284                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4285
4286                                 ;;
4287                         esac
4288                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
4289                         ;;
4290                 esac
4291                 ;;
4292         (*)
4293                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
4294                 ;;
4295         esac
4296         ;;
4297 (yes)
4298         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
4299
4300         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4301
4302         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4303                 && test -z "${cf_tst_cflags}" \
4304                 && cf_fix_cppflags=no
4305         ;;
4306 esac
4307 done
4308
4309 if test -n "$cf_new_cflags" ; then
4310
4311         CFLAGS="$CFLAGS $cf_new_cflags"
4312 fi
4313
4314 if test -n "$cf_new_cppflags" ; then
4315
4316         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
4317 fi
4318
4319 if test -n "$cf_new_extra_cppflags" ; then
4320
4321         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
4322 fi
4323
4324 fi
4325
4326         fi
4327 fi
4328
4329 echo "$as_me:4329: checking for signal global datatype" >&5
4330 echo $ECHO_N "checking for signal global datatype... $ECHO_C" >&6
4331 if test "${cf_cv_sig_atomic_t+set}" = set; then
4332   echo $ECHO_N "(cached) $ECHO_C" >&6
4333 else
4334
4335         for cf_type in \
4336                 "volatile sig_atomic_t" \
4337                 "sig_atomic_t" \
4338                 "int"
4339         do
4340         cat >conftest.$ac_ext <<_ACEOF
4341 #line 4341 "configure"
4342 #include "confdefs.h"
4343
4344 #include <sys/types.h>
4345 #include <signal.h>
4346 #include <stdio.h>
4347
4348 extern $cf_type x;
4349 $cf_type x;
4350 static void handler(int sig)
4351 {
4352         x = 5;
4353 }
4354 int
4355 main ()
4356 {
4357 signal(SIGINT, handler);
4358                  x = 1
4359   ;
4360   return 0;
4361 }
4362 _ACEOF
4363 rm -f conftest.$ac_objext
4364 if { (eval echo "$as_me:4364: \"$ac_compile\"") >&5
4365   (eval $ac_compile) 2>&5
4366   ac_status=$?
4367   echo "$as_me:4367: \$? = $ac_status" >&5
4368   (exit $ac_status); } &&
4369          { ac_try='test -s conftest.$ac_objext'
4370   { (eval echo "$as_me:4370: \"$ac_try\"") >&5
4371   (eval $ac_try) 2>&5
4372   ac_status=$?
4373   echo "$as_me:4373: \$? = $ac_status" >&5
4374   (exit $ac_status); }; }; then
4375   cf_cv_sig_atomic_t=$cf_type
4376 else
4377   echo "$as_me: failed program was:" >&5
4378 cat conftest.$ac_ext >&5
4379 cf_cv_sig_atomic_t=no
4380 fi
4381 rm -f conftest.$ac_objext conftest.$ac_ext
4382                 test "$cf_cv_sig_atomic_t" != no && break
4383         done
4384
4385 fi
4386
4387 echo "$as_me:4387: result: $cf_cv_sig_atomic_t" >&5
4388 echo "${ECHO_T}$cf_cv_sig_atomic_t" >&6
4389 test "$cf_cv_sig_atomic_t" != no &&
4390 cat >>confdefs.h <<EOF
4391 #define SIG_ATOMIC_T $cf_cv_sig_atomic_t
4392 EOF
4393
4394 # Work around breakage on OS X
4395
4396 echo "$as_me:4396: checking if SIGWINCH is defined" >&5
4397 echo $ECHO_N "checking if SIGWINCH is defined... $ECHO_C" >&6
4398 if test "${cf_cv_define_sigwinch+set}" = set; then
4399   echo $ECHO_N "(cached) $ECHO_C" >&6
4400 else
4401
4402         cat >conftest.$ac_ext <<_ACEOF
4403 #line 4403 "configure"
4404 #include "confdefs.h"
4405
4406 #include <sys/types.h>
4407 #include <sys/signal.h>
4408
4409 int
4410 main ()
4411 {
4412 int x = SIGWINCH
4413   ;
4414   return 0;
4415 }
4416 _ACEOF
4417 rm -f conftest.$ac_objext
4418 if { (eval echo "$as_me:4418: \"$ac_compile\"") >&5
4419   (eval $ac_compile) 2>&5
4420   ac_status=$?
4421   echo "$as_me:4421: \$? = $ac_status" >&5
4422   (exit $ac_status); } &&
4423          { ac_try='test -s conftest.$ac_objext'
4424   { (eval echo "$as_me:4424: \"$ac_try\"") >&5
4425   (eval $ac_try) 2>&5
4426   ac_status=$?
4427   echo "$as_me:4427: \$? = $ac_status" >&5
4428   (exit $ac_status); }; }; then
4429   cf_cv_define_sigwinch=yes
4430 else
4431   echo "$as_me: failed program was:" >&5
4432 cat conftest.$ac_ext >&5
4433 cat >conftest.$ac_ext <<_ACEOF
4434 #line 4434 "configure"
4435 #include "confdefs.h"
4436
4437 #undef _XOPEN_SOURCE
4438 #undef _POSIX_SOURCE
4439 #undef _POSIX_C_SOURCE
4440 #include <sys/types.h>
4441 #include <sys/signal.h>
4442
4443 int
4444 main ()
4445 {
4446 int x = SIGWINCH
4447   ;
4448   return 0;
4449 }
4450 _ACEOF
4451 rm -f conftest.$ac_objext
4452 if { (eval echo "$as_me:4452: \"$ac_compile\"") >&5
4453   (eval $ac_compile) 2>&5
4454   ac_status=$?
4455   echo "$as_me:4455: \$? = $ac_status" >&5
4456   (exit $ac_status); } &&
4457          { ac_try='test -s conftest.$ac_objext'
4458   { (eval echo "$as_me:4458: \"$ac_try\"") >&5
4459   (eval $ac_try) 2>&5
4460   ac_status=$?
4461   echo "$as_me:4461: \$? = $ac_status" >&5
4462   (exit $ac_status); }; }; then
4463   cf_cv_define_sigwinch=maybe
4464 else
4465   echo "$as_me: failed program was:" >&5
4466 cat conftest.$ac_ext >&5
4467 cf_cv_define_sigwinch=no
4468 fi
4469 rm -f conftest.$ac_objext conftest.$ac_ext
4470
4471 fi
4472 rm -f conftest.$ac_objext conftest.$ac_ext
4473
4474 fi
4475 echo "$as_me:4475: result: $cf_cv_define_sigwinch" >&5
4476 echo "${ECHO_T}$cf_cv_define_sigwinch" >&6
4477
4478 if test "$cf_cv_define_sigwinch" = maybe ; then
4479 echo "$as_me:4479: checking for actual SIGWINCH definition" >&5
4480 echo $ECHO_N "checking for actual SIGWINCH definition... $ECHO_C" >&6
4481 if test "${cf_cv_fixup_sigwinch+set}" = set; then
4482   echo $ECHO_N "(cached) $ECHO_C" >&6
4483 else
4484
4485 cf_cv_fixup_sigwinch=unknown
4486 cf_sigwinch=32
4487 while test $cf_sigwinch != 1
4488 do
4489         cat >conftest.$ac_ext <<_ACEOF
4490 #line 4490 "configure"
4491 #include "confdefs.h"
4492
4493 #undef _XOPEN_SOURCE
4494 #undef _POSIX_SOURCE
4495 #undef _POSIX_C_SOURCE
4496 #include <sys/types.h>
4497 #include <sys/signal.h>
4498
4499 int
4500 main ()
4501 {
4502
4503 #if SIGWINCH != $cf_sigwinch
4504 make an error
4505 #endif
4506 int x = SIGWINCH
4507   ;
4508   return 0;
4509 }
4510 _ACEOF
4511 rm -f conftest.$ac_objext
4512 if { (eval echo "$as_me:4512: \"$ac_compile\"") >&5
4513   (eval $ac_compile) 2>&5
4514   ac_status=$?
4515   echo "$as_me:4515: \$? = $ac_status" >&5
4516   (exit $ac_status); } &&
4517          { ac_try='test -s conftest.$ac_objext'
4518   { (eval echo "$as_me:4518: \"$ac_try\"") >&5
4519   (eval $ac_try) 2>&5
4520   ac_status=$?
4521   echo "$as_me:4521: \$? = $ac_status" >&5
4522   (exit $ac_status); }; }; then
4523   cf_cv_fixup_sigwinch=$cf_sigwinch
4524          break
4525 else
4526   echo "$as_me: failed program was:" >&5
4527 cat conftest.$ac_ext >&5
4528 fi
4529 rm -f conftest.$ac_objext conftest.$ac_ext
4530
4531 cf_sigwinch=`expr $cf_sigwinch - 1`
4532 done
4533
4534 fi
4535 echo "$as_me:4535: result: $cf_cv_fixup_sigwinch" >&5
4536 echo "${ECHO_T}$cf_cv_fixup_sigwinch" >&6
4537
4538         if test "$cf_cv_fixup_sigwinch" != unknown ; then
4539                 CPPFLAGS="$CPPFLAGS -DSIGWINCH=$cf_cv_fixup_sigwinch"
4540         fi
4541 fi
4542
4543 # Checks for CODESET support.
4544
4545 echo "$as_me:4545: checking for nl_langinfo and CODESET" >&5
4546 echo $ECHO_N "checking for nl_langinfo and CODESET... $ECHO_C" >&6
4547 if test "${am_cv_langinfo_codeset+set}" = set; then
4548   echo $ECHO_N "(cached) $ECHO_C" >&6
4549 else
4550   cat >conftest.$ac_ext <<_ACEOF
4551 #line 4551 "configure"
4552 #include "confdefs.h"
4553 #include <langinfo.h>
4554 int
4555 main ()
4556 {
4557 char* cs = nl_langinfo(CODESET);
4558   ;
4559   return 0;
4560 }
4561 _ACEOF
4562 rm -f conftest.$ac_objext conftest$ac_exeext
4563 if { (eval echo "$as_me:4563: \"$ac_link\"") >&5
4564   (eval $ac_link) 2>&5
4565   ac_status=$?
4566   echo "$as_me:4566: \$? = $ac_status" >&5
4567   (exit $ac_status); } &&
4568          { ac_try='test -s conftest$ac_exeext'
4569   { (eval echo "$as_me:4569: \"$ac_try\"") >&5
4570   (eval $ac_try) 2>&5
4571   ac_status=$?
4572   echo "$as_me:4572: \$? = $ac_status" >&5
4573   (exit $ac_status); }; }; then
4574   am_cv_langinfo_codeset=yes
4575 else
4576   echo "$as_me: failed program was:" >&5
4577 cat conftest.$ac_ext >&5
4578 am_cv_langinfo_codeset=no
4579 fi
4580 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4581
4582 fi
4583 echo "$as_me:4583: result: $am_cv_langinfo_codeset" >&5
4584 echo "${ECHO_T}$am_cv_langinfo_codeset" >&6
4585         if test $am_cv_langinfo_codeset = yes; then
4586
4587 cat >>confdefs.h <<\EOF
4588 #define HAVE_LANGINFO_CODESET 1
4589 EOF
4590
4591         fi
4592
4593 echo "$as_me:4593: checking if you want to use pkg-config" >&5
4594 echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6
4595
4596 # Check whether --with-pkg-config or --without-pkg-config was given.
4597 if test "${with_pkg_config+set}" = set; then
4598   withval="$with_pkg_config"
4599   cf_pkg_config=$withval
4600 else
4601   cf_pkg_config=yes
4602 fi;
4603 echo "$as_me:4603: result: $cf_pkg_config" >&5
4604 echo "${ECHO_T}$cf_pkg_config" >&6
4605
4606 case $cf_pkg_config in
4607 (no)
4608         PKG_CONFIG=none
4609         ;;
4610 (yes)
4611
4612 if test -n "$ac_tool_prefix"; then
4613   # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
4614 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
4615 echo "$as_me:4615: checking for $ac_word" >&5
4616 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4617 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
4618   echo $ECHO_N "(cached) $ECHO_C" >&6
4619 else
4620   case $PKG_CONFIG in
4621   [\\/]* | ?:[\\/]*)
4622   ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
4623   ;;
4624   *)
4625   ac_save_IFS=$IFS; IFS=$ac_path_separator
4626 ac_dummy="$PATH"
4627 for ac_dir in $ac_dummy; do
4628   IFS=$ac_save_IFS
4629   test -z "$ac_dir" && ac_dir=.
4630   if $as_executable_p "$ac_dir/$ac_word"; then
4631    ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
4632    echo "$as_me:4632: found $ac_dir/$ac_word" >&5
4633    break
4634 fi
4635 done
4636
4637   ;;
4638 esac
4639 fi
4640 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
4641
4642 if test -n "$PKG_CONFIG"; then
4643   echo "$as_me:4643: result: $PKG_CONFIG" >&5
4644 echo "${ECHO_T}$PKG_CONFIG" >&6
4645 else
4646   echo "$as_me:4646: result: no" >&5
4647 echo "${ECHO_T}no" >&6
4648 fi
4649
4650 fi
4651 if test -z "$ac_cv_path_PKG_CONFIG"; then
4652   ac_pt_PKG_CONFIG=$PKG_CONFIG
4653   # Extract the first word of "pkg-config", so it can be a program name with args.
4654 set dummy pkg-config; ac_word=$2
4655 echo "$as_me:4655: checking for $ac_word" >&5
4656 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4657 if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
4658   echo $ECHO_N "(cached) $ECHO_C" >&6
4659 else
4660   case $ac_pt_PKG_CONFIG in
4661   [\\/]* | ?:[\\/]*)
4662   ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
4663   ;;
4664   *)
4665   ac_save_IFS=$IFS; IFS=$ac_path_separator
4666 ac_dummy="$PATH"
4667 for ac_dir in $ac_dummy; do
4668   IFS=$ac_save_IFS
4669   test -z "$ac_dir" && ac_dir=.
4670   if $as_executable_p "$ac_dir/$ac_word"; then
4671    ac_cv_path_ac_pt_PKG_CONFIG="$ac_dir/$ac_word"
4672    echo "$as_me:4672: found $ac_dir/$ac_word" >&5
4673    break
4674 fi
4675 done
4676
4677   test -z "$ac_cv_path_ac_pt_PKG_CONFIG" && ac_cv_path_ac_pt_PKG_CONFIG="none"
4678   ;;
4679 esac
4680 fi
4681 ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
4682
4683 if test -n "$ac_pt_PKG_CONFIG"; then
4684   echo "$as_me:4684: result: $ac_pt_PKG_CONFIG" >&5
4685 echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
4686 else
4687   echo "$as_me:4687: result: no" >&5
4688 echo "${ECHO_T}no" >&6
4689 fi
4690
4691   PKG_CONFIG=$ac_pt_PKG_CONFIG
4692 else
4693   PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
4694 fi
4695
4696         ;;
4697 (*)
4698         PKG_CONFIG=$withval
4699         ;;
4700 esac
4701
4702 test -z "$PKG_CONFIG" && PKG_CONFIG=none
4703 if test "$PKG_CONFIG" != none ; then
4704
4705 if test "x$prefix" != xNONE; then
4706         cf_path_syntax="$prefix"
4707 else
4708         cf_path_syntax="$ac_default_prefix"
4709 fi
4710
4711 case ".$PKG_CONFIG" in
4712 (.\$\(*\)*|.\'*\'*)
4713         ;;
4714 (..|./*|.\\*)
4715         ;;
4716 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
4717         ;;
4718 (.\${*prefix}*|.\${*dir}*)
4719         eval PKG_CONFIG="$PKG_CONFIG"
4720         case ".$PKG_CONFIG" in
4721         (.NONE/*)
4722                 PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
4723                 ;;
4724         esac
4725         ;;
4726 (.no|.NONE/*)
4727         PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
4728         ;;
4729 (*)
4730         { { echo "$as_me:4730: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
4731 echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
4732    { (exit 1); exit 1; }; }
4733         ;;
4734 esac
4735
4736 elif test "x$cf_pkg_config" != xno ; then
4737         { echo "$as_me:4737: WARNING: pkg-config is not installed" >&5
4738 echo "$as_me: WARNING: pkg-config is not installed" >&2;}
4739 fi
4740
4741 echo "$as_me:4741: checking if you want to see long compiling messages" >&5
4742 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
4743
4744 # Check whether --enable-echo or --disable-echo was given.
4745 if test "${enable_echo+set}" = set; then
4746   enableval="$enable_echo"
4747   test "$enableval" != no && enableval=yes
4748         if test "$enableval" != "yes" ; then
4749
4750         ECHO_LT='--silent'
4751         ECHO_LD='@echo linking $@;'
4752         RULE_CC='@echo compiling $<'
4753         SHOW_CC='@echo compiling $@'
4754         ECHO_CC='@'
4755
4756         else
4757
4758         ECHO_LT=''
4759         ECHO_LD=''
4760         RULE_CC=''
4761         SHOW_CC=''
4762         ECHO_CC=''
4763
4764         fi
4765 else
4766   enableval=yes
4767
4768         ECHO_LT=''
4769         ECHO_LD=''
4770         RULE_CC=''
4771         SHOW_CC=''
4772         ECHO_CC=''
4773
4774 fi;
4775 echo "$as_me:4775: result: $enableval" >&5
4776 echo "${ECHO_T}$enableval" >&6
4777
4778 echo "$as_me:4778: checking for ncurses wrap-prefix" >&5
4779 echo $ECHO_N "checking for ncurses wrap-prefix... $ECHO_C" >&6
4780
4781 # Check whether --with-ncurses-wrap-prefix or --without-ncurses-wrap-prefix was given.
4782 if test "${with_ncurses_wrap_prefix+set}" = set; then
4783   withval="$with_ncurses_wrap_prefix"
4784   NCURSES_WRAP_PREFIX=$withval
4785 else
4786   NCURSES_WRAP_PREFIX=_nc_
4787 fi;
4788 echo "$as_me:4788: result: $NCURSES_WRAP_PREFIX" >&5
4789 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
4790
4791 echo "$as_me:4791: checking if you want to check for wide-character functions" >&5
4792 echo $ECHO_N "checking if you want to check for wide-character functions... $ECHO_C" >&6
4793
4794 # Check whether --enable-widec or --disable-widec was given.
4795 if test "${enable_widec+set}" = set; then
4796   enableval="$enable_widec"
4797   test "$enableval" != no && enableval=yes
4798         if test "$enableval" != "yes" ; then
4799     cf_enable_widec=no
4800         else
4801                 cf_enable_widec=yes
4802         fi
4803 else
4804   enableval=yes
4805         cf_enable_widec=yes
4806
4807 fi;
4808 echo "$as_me:4808: result: $cf_enable_widec" >&5
4809 echo "${ECHO_T}$cf_enable_widec" >&6
4810
4811 echo "$as_me:4811: checking for specific curses-directory" >&5
4812 echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
4813
4814 # Check whether --with-curses-dir or --without-curses-dir was given.
4815 if test "${with_curses_dir+set}" = set; then
4816   withval="$with_curses_dir"
4817   cf_cv_curses_dir=$withval
4818 else
4819   cf_cv_curses_dir=no
4820 fi;
4821 echo "$as_me:4821: result: $cf_cv_curses_dir" >&5
4822 echo "${ECHO_T}$cf_cv_curses_dir" >&6
4823
4824 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
4825 then
4826
4827 if test "x$prefix" != xNONE; then
4828         cf_path_syntax="$prefix"
4829 else
4830         cf_path_syntax="$ac_default_prefix"
4831 fi
4832
4833 case ".$withval" in
4834 (.\$\(*\)*|.\'*\'*)
4835         ;;
4836 (..|./*|.\\*)
4837         ;;
4838 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
4839         ;;
4840 (.\${*prefix}*|.\${*dir}*)
4841         eval withval="$withval"
4842         case ".$withval" in
4843         (.NONE/*)
4844                 withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
4845                 ;;
4846         esac
4847         ;;
4848 (.no|.NONE/*)
4849         withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
4850         ;;
4851 (*)
4852         { { echo "$as_me:4852: error: expected a pathname, not \"$withval\"" >&5
4853 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
4854    { (exit 1); exit 1; }; }
4855         ;;
4856 esac
4857
4858         if test -d "$cf_cv_curses_dir"
4859         then
4860
4861 if test -n "$cf_cv_curses_dir/include" ; then
4862   for cf_add_incdir in $cf_cv_curses_dir/include
4863   do
4864         while test $cf_add_incdir != /usr/include
4865         do
4866           if test -d $cf_add_incdir
4867           then
4868                 cf_have_incdir=no
4869                 if test -n "$CFLAGS$CPPFLAGS" ; then
4870                   # a loop is needed to ensure we can add subdirs of existing dirs
4871                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4872                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4873                           cf_have_incdir=yes; break
4874                         fi
4875                   done
4876                 fi
4877
4878                 if test "$cf_have_incdir" = no ; then
4879                   if test "$cf_add_incdir" = /usr/local/include ; then
4880                         if test "$GCC" = yes
4881                         then
4882                           cf_save_CPPFLAGS=$CPPFLAGS
4883                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4884                           cat >conftest.$ac_ext <<_ACEOF
4885 #line 4885 "configure"
4886 #include "confdefs.h"
4887 #include <stdio.h>
4888 int
4889 main ()
4890 {
4891 printf("Hello")
4892   ;
4893   return 0;
4894 }
4895 _ACEOF
4896 rm -f conftest.$ac_objext
4897 if { (eval echo "$as_me:4897: \"$ac_compile\"") >&5
4898   (eval $ac_compile) 2>&5
4899   ac_status=$?
4900   echo "$as_me:4900: \$? = $ac_status" >&5
4901   (exit $ac_status); } &&
4902          { ac_try='test -s conftest.$ac_objext'
4903   { (eval echo "$as_me:4903: \"$ac_try\"") >&5
4904   (eval $ac_try) 2>&5
4905   ac_status=$?
4906   echo "$as_me:4906: \$? = $ac_status" >&5
4907   (exit $ac_status); }; }; then
4908   :
4909 else
4910   echo "$as_me: failed program was:" >&5
4911 cat conftest.$ac_ext >&5
4912 cf_have_incdir=yes
4913 fi
4914 rm -f conftest.$ac_objext conftest.$ac_ext
4915                           CPPFLAGS=$cf_save_CPPFLAGS
4916                         fi
4917                   fi
4918                 fi
4919
4920                 if test "$cf_have_incdir" = no ; then
4921                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4922
4923 echo "${as_me:-configure}:4923: testing adding $cf_add_incdir to include-path ..." 1>&5
4924
4925                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4926
4927                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
4928                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4929                   cf_add_incdir="$cf_top_incdir"
4930                 else
4931                   break
4932                 fi
4933           else
4934                 break
4935           fi
4936         done
4937   done
4938 fi
4939
4940 if test -n "$cf_cv_curses_dir/lib" ; then
4941         for cf_add_libdir in $cf_cv_curses_dir/lib
4942         do
4943                 if test $cf_add_libdir = /usr/lib ; then
4944                         :
4945                 elif test -d $cf_add_libdir
4946                 then
4947                         cf_have_libdir=no
4948                         if test -n "$LDFLAGS$LIBS" ; then
4949                                 # a loop is needed to ensure we can add subdirs of existing dirs
4950                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
4951                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
4952                                                 cf_have_libdir=yes; break
4953                                         fi
4954                                 done
4955                         fi
4956                         if test "$cf_have_libdir" = no ; then
4957                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
4958
4959 echo "${as_me:-configure}:4959: testing adding $cf_add_libdir to library-path ..." 1>&5
4960
4961                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
4962                         fi
4963                 fi
4964         done
4965 fi
4966
4967         fi
4968 fi
4969
4970 cf_cv_screen=curses
4971
4972 echo "$as_me:4972: checking for specified curses library type" >&5
4973 echo $ECHO_N "checking for specified curses library type... $ECHO_C" >&6
4974
4975 # Check whether --with-screen or --without-screen was given.
4976 if test "${with_screen+set}" = set; then
4977   withval="$with_screen"
4978   cf_cv_screen=$withval
4979 else
4980
4981 # Check whether --with-ncursesw or --without-ncursesw was given.
4982 if test "${with_ncursesw+set}" = set; then
4983   withval="$with_ncursesw"
4984   cf_cv_screen=ncursesw
4985 else
4986
4987 # Check whether --with-ncurses or --without-ncurses was given.
4988 if test "${with_ncurses+set}" = set; then
4989   withval="$with_ncurses"
4990   cf_cv_screen=ncurses
4991 else
4992
4993 # Check whether --with-pdcurses or --without-pdcurses was given.
4994 if test "${with_pdcurses+set}" = set; then
4995   withval="$with_pdcurses"
4996   cf_cv_screen=pdcurses
4997 else
4998
4999 # Check whether --with-curses-colr or --without-curses-colr was given.
5000 if test "${with_curses_colr+set}" = set; then
5001   withval="$with_curses_colr"
5002   cf_cv_screen=curses_colr
5003 else
5004
5005 # Check whether --with-curses-5lib or --without-curses-5lib was given.
5006 if test "${with_curses_5lib+set}" = set; then
5007   withval="$with_curses_5lib"
5008   cf_cv_screen=curses_5lib
5009 fi;
5010 fi;
5011 fi;
5012 fi;
5013 fi;
5014 fi;
5015
5016 echo "$as_me:5016: result: $cf_cv_screen" >&5
5017 echo "${ECHO_T}$cf_cv_screen" >&6
5018
5019 case $cf_cv_screen in
5020 (curses|curses_*)
5021
5022 echo "$as_me:5022: checking for extra include directories" >&5
5023 echo $ECHO_N "checking for extra include directories... $ECHO_C" >&6
5024 if test "${cf_cv_curses_incdir+set}" = set; then
5025   echo $ECHO_N "(cached) $ECHO_C" >&6
5026 else
5027
5028 cf_cv_curses_incdir=no
5029 case $host_os in
5030 (hpux10.*)
5031         if test "x$cf_cv_screen" = "xcurses_colr"
5032         then
5033                 test -d /usr/include/curses_colr && \
5034                 cf_cv_curses_incdir="-I/usr/include/curses_colr"
5035         fi
5036         ;;
5037 (sunos3*|sunos4*)
5038         if test "x$cf_cv_screen" = "xcurses_5lib"
5039         then
5040                 test -d /usr/5lib && \
5041                 test -d /usr/5include && \
5042                 cf_cv_curses_incdir="-I/usr/5include"
5043         fi
5044         ;;
5045 esac
5046
5047 fi
5048 echo "$as_me:5048: result: $cf_cv_curses_incdir" >&5
5049 echo "${ECHO_T}$cf_cv_curses_incdir" >&6
5050 test "$cf_cv_curses_incdir" != no && CPPFLAGS="$CPPFLAGS $cf_cv_curses_incdir"
5051
5052 echo "$as_me:5052: checking if we have identified curses headers" >&5
5053 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
5054 if test "${cf_cv_ncurses_header+set}" = set; then
5055   echo $ECHO_N "(cached) $ECHO_C" >&6
5056 else
5057
5058 cf_cv_ncurses_header=none
5059 for cf_header in \
5060         ncurses.h  \
5061         curses.h  ncurses/ncurses.h ncurses/curses.h
5062 do
5063 cat >conftest.$ac_ext <<_ACEOF
5064 #line 5064 "configure"
5065 #include "confdefs.h"
5066 #include <${cf_header}>
5067 int
5068 main ()
5069 {
5070 initscr(); tgoto("?", 0,0)
5071   ;
5072   return 0;
5073 }
5074 _ACEOF
5075 rm -f conftest.$ac_objext
5076 if { (eval echo "$as_me:5076: \"$ac_compile\"") >&5
5077   (eval $ac_compile) 2>&5
5078   ac_status=$?
5079   echo "$as_me:5079: \$? = $ac_status" >&5
5080   (exit $ac_status); } &&
5081          { ac_try='test -s conftest.$ac_objext'
5082   { (eval echo "$as_me:5082: \"$ac_try\"") >&5
5083   (eval $ac_try) 2>&5
5084   ac_status=$?
5085   echo "$as_me:5085: \$? = $ac_status" >&5
5086   (exit $ac_status); }; }; then
5087   cf_cv_ncurses_header=$cf_header; break
5088 else
5089   echo "$as_me: failed program was:" >&5
5090 cat conftest.$ac_ext >&5
5091 fi
5092 rm -f conftest.$ac_objext conftest.$ac_ext
5093 done
5094
5095 fi
5096 echo "$as_me:5096: result: $cf_cv_ncurses_header" >&5
5097 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
5098
5099 if test "$cf_cv_ncurses_header" = none ; then
5100         { { echo "$as_me:5100: error: No curses header-files found" >&5
5101 echo "$as_me: error: No curses header-files found" >&2;}
5102    { (exit 1); exit 1; }; }
5103 fi
5104
5105 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
5106
5107 for ac_header in $cf_cv_ncurses_header
5108 do
5109 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
5110 echo "$as_me:5110: checking for $ac_header" >&5
5111 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
5112 if eval "test \"\${$as_ac_Header+set}\" = set"; then
5113   echo $ECHO_N "(cached) $ECHO_C" >&6
5114 else
5115   cat >conftest.$ac_ext <<_ACEOF
5116 #line 5116 "configure"
5117 #include "confdefs.h"
5118 #include <$ac_header>
5119 _ACEOF
5120 if { (eval echo "$as_me:5120: \"$ac_cpp conftest.$ac_ext\"") >&5
5121   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
5122   ac_status=$?
5123   egrep -v '^ *\+' conftest.er1 >conftest.err
5124   rm -f conftest.er1
5125   cat conftest.err >&5
5126   echo "$as_me:5126: \$? = $ac_status" >&5
5127   (exit $ac_status); } >/dev/null; then
5128   if test -s conftest.err; then
5129     ac_cpp_err=$ac_c_preproc_warn_flag
5130   else
5131     ac_cpp_err=
5132   fi
5133 else
5134   ac_cpp_err=yes
5135 fi
5136 if test -z "$ac_cpp_err"; then
5137   eval "$as_ac_Header=yes"
5138 else
5139   echo "$as_me: failed program was:" >&5
5140   cat conftest.$ac_ext >&5
5141   eval "$as_ac_Header=no"
5142 fi
5143 rm -f conftest.err conftest.$ac_ext
5144 fi
5145 echo "$as_me:5145: result: `eval echo '${'$as_ac_Header'}'`" >&5
5146 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
5147 if test `eval echo '${'$as_ac_Header'}'` = yes; then
5148   cat >>confdefs.h <<EOF
5149 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
5150 EOF
5151
5152 fi
5153 done
5154
5155 echo "$as_me:5155: checking for terminfo header" >&5
5156 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
5157 if test "${cf_cv_term_header+set}" = set; then
5158   echo $ECHO_N "(cached) $ECHO_C" >&6
5159 else
5160
5161 case ${cf_cv_ncurses_header} in
5162 (*/ncurses.h|*/ncursesw.h)
5163         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
5164         ;;
5165 (*)
5166         cf_term_header=term.h
5167         ;;
5168 esac
5169
5170 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
5171 do
5172 cat >conftest.$ac_ext <<_ACEOF
5173 #line 5173 "configure"
5174 #include "confdefs.h"
5175 #include <stdio.h>
5176 #include <${cf_cv_ncurses_header:-curses.h}>
5177 #include <$cf_test>
5178
5179 int
5180 main ()
5181 {
5182 int x = auto_left_margin
5183   ;
5184   return 0;
5185 }
5186 _ACEOF
5187 rm -f conftest.$ac_objext
5188 if { (eval echo "$as_me:5188: \"$ac_compile\"") >&5
5189   (eval $ac_compile) 2>&5
5190   ac_status=$?
5191   echo "$as_me:5191: \$? = $ac_status" >&5
5192   (exit $ac_status); } &&
5193          { ac_try='test -s conftest.$ac_objext'
5194   { (eval echo "$as_me:5194: \"$ac_try\"") >&5
5195   (eval $ac_try) 2>&5
5196   ac_status=$?
5197   echo "$as_me:5197: \$? = $ac_status" >&5
5198   (exit $ac_status); }; }; then
5199
5200         cf_cv_term_header="$cf_test"
5201 else
5202   echo "$as_me: failed program was:" >&5
5203 cat conftest.$ac_ext >&5
5204
5205         cf_cv_term_header=unknown
5206
5207 fi
5208 rm -f conftest.$ac_objext conftest.$ac_ext
5209         test "$cf_cv_term_header" != unknown && break
5210 done
5211
5212 fi
5213 echo "$as_me:5213: result: $cf_cv_term_header" >&5
5214 echo "${ECHO_T}$cf_cv_term_header" >&6
5215
5216 # Set definitions to allow ifdef'ing to accommodate subdirectories
5217
5218 case $cf_cv_term_header in
5219 (*term.h)
5220
5221 cat >>confdefs.h <<\EOF
5222 #define HAVE_TERM_H 1
5223 EOF
5224
5225         ;;
5226 esac
5227
5228 case $cf_cv_term_header in
5229 (ncurses/term.h)
5230
5231 cat >>confdefs.h <<\EOF
5232 #define HAVE_NCURSES_TERM_H 1
5233 EOF
5234
5235         ;;
5236 (ncursesw/term.h)
5237
5238 cat >>confdefs.h <<\EOF
5239 #define HAVE_NCURSESW_TERM_H 1
5240 EOF
5241
5242         ;;
5243 esac
5244
5245 echo "$as_me:5245: checking for ncurses version" >&5
5246 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
5247 if test "${cf_cv_ncurses_version+set}" = set; then
5248   echo $ECHO_N "(cached) $ECHO_C" >&6
5249 else
5250
5251         cf_cv_ncurses_version=no
5252         cf_tempfile=out$$
5253         rm -f $cf_tempfile
5254         if test "$cross_compiling" = yes; then
5255
5256         # This will not work if the preprocessor splits the line after the
5257         # Autoconf token.  The 'unproto' program does that.
5258         cat > conftest.$ac_ext <<EOF
5259 #include <${cf_cv_ncurses_header:-curses.h}>
5260 #undef Autoconf
5261 #ifdef NCURSES_VERSION
5262 Autoconf NCURSES_VERSION
5263 #else
5264 #ifdef __NCURSES_H
5265 Autoconf "old"
5266 #endif
5267 ;
5268 #endif
5269 EOF
5270         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
5271         { (eval echo "$as_me:5271: \"$cf_try\"") >&5
5272   (eval $cf_try) 2>&5
5273   ac_status=$?
5274   echo "$as_me:5274: \$? = $ac_status" >&5
5275   (exit $ac_status); }
5276         if test -f conftest.out ; then
5277                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
5278                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
5279                 rm -f conftest.out
5280         fi
5281
5282 else
5283   cat >conftest.$ac_ext <<_ACEOF
5284 #line 5284 "configure"
5285 #include "confdefs.h"
5286
5287 #include <${cf_cv_ncurses_header:-curses.h}>
5288 #include <stdio.h>
5289 int main()
5290 {
5291         FILE *fp = fopen("$cf_tempfile", "w");
5292 #ifdef NCURSES_VERSION
5293 # ifdef NCURSES_VERSION_PATCH
5294         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
5295 # else
5296         fprintf(fp, "%s\n", NCURSES_VERSION);
5297 # endif
5298 #else
5299 # ifdef __NCURSES_H
5300         fprintf(fp, "old\n");
5301 # else
5302         make an error
5303 # endif
5304 #endif
5305         ${cf_cv_main_return:-return}(0);
5306 }
5307 _ACEOF
5308 rm -f conftest$ac_exeext
5309 if { (eval echo "$as_me:5309: \"$ac_link\"") >&5
5310   (eval $ac_link) 2>&5
5311   ac_status=$?
5312   echo "$as_me:5312: \$? = $ac_status" >&5
5313   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
5314   { (eval echo "$as_me:5314: \"$ac_try\"") >&5
5315   (eval $ac_try) 2>&5
5316   ac_status=$?
5317   echo "$as_me:5317: \$? = $ac_status" >&5
5318   (exit $ac_status); }; }; then
5319
5320         cf_cv_ncurses_version=`cat $cf_tempfile`
5321 else
5322   echo "$as_me: program exited with status $ac_status" >&5
5323 echo "$as_me: failed program was:" >&5
5324 cat conftest.$ac_ext >&5
5325 fi
5326 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
5327 fi
5328         rm -f $cf_tempfile
5329
5330 fi
5331 echo "$as_me:5331: result: $cf_cv_ncurses_version" >&5
5332 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
5333 test "$cf_cv_ncurses_version" = no ||
5334 cat >>confdefs.h <<\EOF
5335 #define NCURSES 1
5336 EOF
5337
5338 echo "$as_me:5338: checking if we have identified curses libraries" >&5
5339 echo $ECHO_N "checking if we have identified curses libraries... $ECHO_C" >&6
5340 cat >conftest.$ac_ext <<_ACEOF
5341 #line 5341 "configure"
5342 #include "confdefs.h"
5343 #include <${cf_cv_ncurses_header:-curses.h}>
5344 int
5345 main ()
5346 {
5347 initscr(); tgoto("?", 0,0)
5348   ;
5349   return 0;
5350 }
5351 _ACEOF
5352 rm -f conftest.$ac_objext conftest$ac_exeext
5353 if { (eval echo "$as_me:5353: \"$ac_link\"") >&5
5354   (eval $ac_link) 2>&5
5355   ac_status=$?
5356   echo "$as_me:5356: \$? = $ac_status" >&5
5357   (exit $ac_status); } &&
5358          { ac_try='test -s conftest$ac_exeext'
5359   { (eval echo "$as_me:5359: \"$ac_try\"") >&5
5360   (eval $ac_try) 2>&5
5361   ac_status=$?
5362   echo "$as_me:5362: \$? = $ac_status" >&5
5363   (exit $ac_status); }; }; then
5364   cf_result=yes
5365 else
5366   echo "$as_me: failed program was:" >&5
5367 cat conftest.$ac_ext >&5
5368 cf_result=no
5369 fi
5370 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5371 echo "$as_me:5371: result: $cf_result" >&5
5372 echo "${ECHO_T}$cf_result" >&6
5373
5374 if test "$cf_result" = no ; then
5375 case $host_os in
5376 (freebsd*)
5377         echo "$as_me:5377: checking for tgoto in -lmytinfo" >&5
5378 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
5379 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
5380   echo $ECHO_N "(cached) $ECHO_C" >&6
5381 else
5382   ac_check_lib_save_LIBS=$LIBS
5383 LIBS="-lmytinfo  $LIBS"
5384 cat >conftest.$ac_ext <<_ACEOF
5385 #line 5385 "configure"
5386 #include "confdefs.h"
5387
5388 /* Override any gcc2 internal prototype to avoid an error.  */
5389 #ifdef __cplusplus
5390 extern "C"
5391 #endif
5392 /* We use char because int might match the return type of a gcc2
5393    builtin and then its argument prototype would still apply.  */
5394 char tgoto ();
5395 int
5396 main ()
5397 {
5398 tgoto ();
5399   ;
5400   return 0;
5401 }
5402 _ACEOF
5403 rm -f conftest.$ac_objext conftest$ac_exeext
5404 if { (eval echo "$as_me:5404: \"$ac_link\"") >&5
5405   (eval $ac_link) 2>&5
5406   ac_status=$?
5407   echo "$as_me:5407: \$? = $ac_status" >&5
5408   (exit $ac_status); } &&
5409          { ac_try='test -s conftest$ac_exeext'
5410   { (eval echo "$as_me:5410: \"$ac_try\"") >&5
5411   (eval $ac_try) 2>&5
5412   ac_status=$?
5413   echo "$as_me:5413: \$? = $ac_status" >&5
5414   (exit $ac_status); }; }; then
5415   ac_cv_lib_mytinfo_tgoto=yes
5416 else
5417   echo "$as_me: failed program was:" >&5
5418 cat conftest.$ac_ext >&5
5419 ac_cv_lib_mytinfo_tgoto=no
5420 fi
5421 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5422 LIBS=$ac_check_lib_save_LIBS
5423 fi
5424 echo "$as_me:5424: result: $ac_cv_lib_mytinfo_tgoto" >&5
5425 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
5426 if test $ac_cv_lib_mytinfo_tgoto = yes; then
5427
5428 cf_add_libs="-lmytinfo"
5429 # Filter out duplicates - this happens with badly-designed ".pc" files...
5430 for cf_add_1lib in $LIBS
5431 do
5432         for cf_add_2lib in $cf_add_libs
5433         do
5434                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5435                 then
5436                         cf_add_1lib=
5437                         break
5438                 fi
5439         done
5440         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5441 done
5442 LIBS="$cf_add_libs"
5443
5444 fi
5445
5446         ;;
5447 (hpux10.*)
5448         # Looking at HPUX 10.20, the Hcurses library is the oldest (1997), cur_colr
5449         # next (1998), and xcurses "newer" (2000).  There is no header file for
5450         # Hcurses; the subdirectory curses_colr has the headers (curses.h and
5451         # term.h) for cur_colr
5452         if test "x$cf_cv_screen" = "xcurses_colr"
5453         then
5454                 echo "$as_me:5454: checking for initscr in -lcur_colr" >&5
5455 echo $ECHO_N "checking for initscr in -lcur_colr... $ECHO_C" >&6
5456 if test "${ac_cv_lib_cur_colr_initscr+set}" = set; then
5457   echo $ECHO_N "(cached) $ECHO_C" >&6
5458 else
5459   ac_check_lib_save_LIBS=$LIBS
5460 LIBS="-lcur_colr  $LIBS"
5461 cat >conftest.$ac_ext <<_ACEOF
5462 #line 5462 "configure"
5463 #include "confdefs.h"
5464
5465 /* Override any gcc2 internal prototype to avoid an error.  */
5466 #ifdef __cplusplus
5467 extern "C"
5468 #endif
5469 /* We use char because int might match the return type of a gcc2
5470    builtin and then its argument prototype would still apply.  */
5471 char initscr ();
5472 int
5473 main ()
5474 {
5475 initscr ();
5476   ;
5477   return 0;
5478 }
5479 _ACEOF
5480 rm -f conftest.$ac_objext conftest$ac_exeext
5481 if { (eval echo "$as_me:5481: \"$ac_link\"") >&5
5482   (eval $ac_link) 2>&5
5483   ac_status=$?
5484   echo "$as_me:5484: \$? = $ac_status" >&5
5485   (exit $ac_status); } &&
5486          { ac_try='test -s conftest$ac_exeext'
5487   { (eval echo "$as_me:5487: \"$ac_try\"") >&5
5488   (eval $ac_try) 2>&5
5489   ac_status=$?
5490   echo "$as_me:5490: \$? = $ac_status" >&5
5491   (exit $ac_status); }; }; then
5492   ac_cv_lib_cur_colr_initscr=yes
5493 else
5494   echo "$as_me: failed program was:" >&5
5495 cat conftest.$ac_ext >&5
5496 ac_cv_lib_cur_colr_initscr=no
5497 fi
5498 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5499 LIBS=$ac_check_lib_save_LIBS
5500 fi
5501 echo "$as_me:5501: result: $ac_cv_lib_cur_colr_initscr" >&5
5502 echo "${ECHO_T}$ac_cv_lib_cur_colr_initscr" >&6
5503 if test $ac_cv_lib_cur_colr_initscr = yes; then
5504
5505 cf_add_libs="-lcur_colr"
5506 # Filter out duplicates - this happens with badly-designed ".pc" files...
5507 for cf_add_1lib in $LIBS
5508 do
5509         for cf_add_2lib in $cf_add_libs
5510         do
5511                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5512                 then
5513                         cf_add_1lib=
5514                         break
5515                 fi
5516         done
5517         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5518 done
5519 LIBS="$cf_add_libs"
5520
5521                         ac_cv_func_initscr=yes
5522
5523 else
5524
5525                 echo "$as_me:5525: checking for initscr in -lHcurses" >&5
5526 echo $ECHO_N "checking for initscr in -lHcurses... $ECHO_C" >&6
5527 if test "${ac_cv_lib_Hcurses_initscr+set}" = set; then
5528   echo $ECHO_N "(cached) $ECHO_C" >&6
5529 else
5530   ac_check_lib_save_LIBS=$LIBS
5531 LIBS="-lHcurses  $LIBS"
5532 cat >conftest.$ac_ext <<_ACEOF
5533 #line 5533 "configure"
5534 #include "confdefs.h"
5535
5536 /* Override any gcc2 internal prototype to avoid an error.  */
5537 #ifdef __cplusplus
5538 extern "C"
5539 #endif
5540 /* We use char because int might match the return type of a gcc2
5541    builtin and then its argument prototype would still apply.  */
5542 char initscr ();
5543 int
5544 main ()
5545 {
5546 initscr ();
5547   ;
5548   return 0;
5549 }
5550 _ACEOF
5551 rm -f conftest.$ac_objext conftest$ac_exeext
5552 if { (eval echo "$as_me:5552: \"$ac_link\"") >&5
5553   (eval $ac_link) 2>&5
5554   ac_status=$?
5555   echo "$as_me:5555: \$? = $ac_status" >&5
5556   (exit $ac_status); } &&
5557          { ac_try='test -s conftest$ac_exeext'
5558   { (eval echo "$as_me:5558: \"$ac_try\"") >&5
5559   (eval $ac_try) 2>&5
5560   ac_status=$?
5561   echo "$as_me:5561: \$? = $ac_status" >&5
5562   (exit $ac_status); }; }; then
5563   ac_cv_lib_Hcurses_initscr=yes
5564 else
5565   echo "$as_me: failed program was:" >&5
5566 cat conftest.$ac_ext >&5
5567 ac_cv_lib_Hcurses_initscr=no
5568 fi
5569 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5570 LIBS=$ac_check_lib_save_LIBS
5571 fi
5572 echo "$as_me:5572: result: $ac_cv_lib_Hcurses_initscr" >&5
5573 echo "${ECHO_T}$ac_cv_lib_Hcurses_initscr" >&6
5574 if test $ac_cv_lib_Hcurses_initscr = yes; then
5575
5576                         # HP's header uses __HP_CURSES, but user claims _HP_CURSES.
5577
5578 cf_add_libs="-lHcurses"
5579 # Filter out duplicates - this happens with badly-designed ".pc" files...
5580 for cf_add_1lib in $LIBS
5581 do
5582         for cf_add_2lib in $cf_add_libs
5583         do
5584                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5585                 then
5586                         cf_add_1lib=
5587                         break
5588                 fi
5589         done
5590         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5591 done
5592 LIBS="$cf_add_libs"
5593
5594                         CPPFLAGS="$CPPFLAGS -D__HP_CURSES -D_HP_CURSES"
5595                         ac_cv_func_initscr=yes
5596
5597 fi
5598
5599 fi
5600
5601         fi
5602         ;;
5603 (linux*)
5604         case `arch 2>/dev/null` in
5605         (x86_64)
5606                 if test -d /lib64
5607                 then
5608
5609 if test -n "/lib64" ; then
5610         for cf_add_libdir in /lib64
5611         do
5612                 if test $cf_add_libdir = /usr/lib ; then
5613                         :
5614                 elif test -d $cf_add_libdir
5615                 then
5616                         cf_have_libdir=no
5617                         if test -n "$LDFLAGS$LIBS" ; then
5618                                 # a loop is needed to ensure we can add subdirs of existing dirs
5619                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
5620                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5621                                                 cf_have_libdir=yes; break
5622                                         fi
5623                                 done
5624                         fi
5625                         if test "$cf_have_libdir" = no ; then
5626                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5627
5628 echo "${as_me:-configure}:5628: testing adding $cf_add_libdir to library-path ..." 1>&5
5629
5630                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5631                         fi
5632                 fi
5633         done
5634 fi
5635
5636                 else
5637
5638 if test -n "/lib" ; then
5639         for cf_add_libdir in /lib
5640         do
5641                 if test $cf_add_libdir = /usr/lib ; then
5642                         :
5643                 elif test -d $cf_add_libdir
5644                 then
5645                         cf_have_libdir=no
5646                         if test -n "$LDFLAGS$LIBS" ; then
5647                                 # a loop is needed to ensure we can add subdirs of existing dirs
5648                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
5649                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5650                                                 cf_have_libdir=yes; break
5651                                         fi
5652                                 done
5653                         fi
5654                         if test "$cf_have_libdir" = no ; then
5655                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5656
5657 echo "${as_me:-configure}:5657: testing adding $cf_add_libdir to library-path ..." 1>&5
5658
5659                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5660                         fi
5661                 fi
5662         done
5663 fi
5664
5665                 fi
5666                 ;;
5667         (*)
5668
5669 if test -n "/lib" ; then
5670         for cf_add_libdir in /lib
5671         do
5672                 if test $cf_add_libdir = /usr/lib ; then
5673                         :
5674                 elif test -d $cf_add_libdir
5675                 then
5676                         cf_have_libdir=no
5677                         if test -n "$LDFLAGS$LIBS" ; then
5678                                 # a loop is needed to ensure we can add subdirs of existing dirs
5679                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
5680                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5681                                                 cf_have_libdir=yes; break
5682                                         fi
5683                                 done
5684                         fi
5685                         if test "$cf_have_libdir" = no ; then
5686                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5687
5688 echo "${as_me:-configure}:5688: testing adding $cf_add_libdir to library-path ..." 1>&5
5689
5690                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5691                         fi
5692                 fi
5693         done
5694 fi
5695
5696                 ;;
5697         esac
5698         ;;
5699 (sunos3*|sunos4*)
5700         if test "x$cf_cv_screen" = "xcurses_5lib"
5701         then
5702                 if test -d /usr/5lib ; then
5703
5704 if test -n "/usr/5lib" ; then
5705         for cf_add_libdir in /usr/5lib
5706         do
5707                 if test $cf_add_libdir = /usr/lib ; then
5708                         :
5709                 elif test -d $cf_add_libdir
5710                 then
5711                         cf_have_libdir=no
5712                         if test -n "$LDFLAGS$LIBS" ; then
5713                                 # a loop is needed to ensure we can add subdirs of existing dirs
5714                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
5715                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5716                                                 cf_have_libdir=yes; break
5717                                         fi
5718                                 done
5719                         fi
5720                         if test "$cf_have_libdir" = no ; then
5721                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5722
5723 echo "${as_me:-configure}:5723: testing adding $cf_add_libdir to library-path ..." 1>&5
5724
5725                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5726                         fi
5727                 fi
5728         done
5729 fi
5730
5731 cf_add_libs="-lcurses -ltermcap"
5732 # Filter out duplicates - this happens with badly-designed ".pc" files...
5733 for cf_add_1lib in $LIBS
5734 do
5735         for cf_add_2lib in $cf_add_libs
5736         do
5737                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5738                 then
5739                         cf_add_1lib=
5740                         break
5741                 fi
5742         done
5743         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5744 done
5745 LIBS="$cf_add_libs"
5746
5747                 fi
5748         fi
5749         ac_cv_func_initscr=yes
5750         ;;
5751 esac
5752
5753 if test ".$ac_cv_func_initscr" != .yes ; then
5754         cf_save_LIBS="$LIBS"
5755
5756         if test ".${cf_cv_ncurses_version:-no}" != .no
5757         then
5758                 cf_check_list="ncurses curses cursesX"
5759         else
5760                 cf_check_list="cursesX curses ncurses"
5761         fi
5762
5763         # Check for library containing tgoto.  Do this before curses library
5764         # because it may be needed to link the test-case for initscr.
5765         if test "x$cf_term_lib" = x
5766         then
5767                 echo "$as_me:5767: checking for tgoto" >&5
5768 echo $ECHO_N "checking for tgoto... $ECHO_C" >&6
5769 if test "${ac_cv_func_tgoto+set}" = set; then
5770   echo $ECHO_N "(cached) $ECHO_C" >&6
5771 else
5772   cat >conftest.$ac_ext <<_ACEOF
5773 #line 5773 "configure"
5774 #include "confdefs.h"
5775 /* System header to define __stub macros and hopefully few prototypes,
5776     which can conflict with char tgoto (); below.  */
5777 #include <assert.h>
5778 /* Override any gcc2 internal prototype to avoid an error.  */
5779 #ifdef __cplusplus
5780 extern "C"
5781 #endif
5782 /* We use char because int might match the return type of a gcc2
5783    builtin and then its argument prototype would still apply.  */
5784 char tgoto ();
5785 char (*f) ();
5786
5787 int
5788 main ()
5789 {
5790 /* The GNU C library defines this for functions which it implements
5791     to always fail with ENOSYS.  Some functions are actually named
5792     something starting with __ and the normal name is an alias.  */
5793 #if defined (__stub_tgoto) || defined (__stub___tgoto)
5794 choke me
5795 #else
5796 f = tgoto; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
5797 #endif
5798
5799   ;
5800   return 0;
5801 }
5802 _ACEOF
5803 rm -f conftest.$ac_objext conftest$ac_exeext
5804 if { (eval echo "$as_me:5804: \"$ac_link\"") >&5
5805   (eval $ac_link) 2>&5
5806   ac_status=$?
5807   echo "$as_me:5807: \$? = $ac_status" >&5
5808   (exit $ac_status); } &&
5809          { ac_try='test -s conftest$ac_exeext'
5810   { (eval echo "$as_me:5810: \"$ac_try\"") >&5
5811   (eval $ac_try) 2>&5
5812   ac_status=$?
5813   echo "$as_me:5813: \$? = $ac_status" >&5
5814   (exit $ac_status); }; }; then
5815   ac_cv_func_tgoto=yes
5816 else
5817   echo "$as_me: failed program was:" >&5
5818 cat conftest.$ac_ext >&5
5819 ac_cv_func_tgoto=no
5820 fi
5821 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5822 fi
5823 echo "$as_me:5823: result: $ac_cv_func_tgoto" >&5
5824 echo "${ECHO_T}$ac_cv_func_tgoto" >&6
5825 if test $ac_cv_func_tgoto = yes; then
5826   cf_term_lib=predefined
5827 else
5828
5829                         for cf_term_lib in $cf_check_list otermcap termcap tinfo termlib unknown
5830                         do
5831                                 as_ac_Lib=`echo "ac_cv_lib_$cf_term_lib''_tgoto" | $as_tr_sh`
5832 echo "$as_me:5832: checking for tgoto in -l$cf_term_lib" >&5
5833 echo $ECHO_N "checking for tgoto in -l$cf_term_lib... $ECHO_C" >&6
5834 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
5835   echo $ECHO_N "(cached) $ECHO_C" >&6
5836 else
5837   ac_check_lib_save_LIBS=$LIBS
5838 LIBS="-l$cf_term_lib  $LIBS"
5839 cat >conftest.$ac_ext <<_ACEOF
5840 #line 5840 "configure"
5841 #include "confdefs.h"
5842
5843 /* Override any gcc2 internal prototype to avoid an error.  */
5844 #ifdef __cplusplus
5845 extern "C"
5846 #endif
5847 /* We use char because int might match the return type of a gcc2
5848    builtin and then its argument prototype would still apply.  */
5849 char tgoto ();
5850 int
5851 main ()
5852 {
5853 tgoto ();
5854   ;
5855   return 0;
5856 }
5857 _ACEOF
5858 rm -f conftest.$ac_objext conftest$ac_exeext
5859 if { (eval echo "$as_me:5859: \"$ac_link\"") >&5
5860   (eval $ac_link) 2>&5
5861   ac_status=$?
5862   echo "$as_me:5862: \$? = $ac_status" >&5
5863   (exit $ac_status); } &&
5864          { ac_try='test -s conftest$ac_exeext'
5865   { (eval echo "$as_me:5865: \"$ac_try\"") >&5
5866   (eval $ac_try) 2>&5
5867   ac_status=$?
5868   echo "$as_me:5868: \$? = $ac_status" >&5
5869   (exit $ac_status); }; }; then
5870   eval "$as_ac_Lib=yes"
5871 else
5872   echo "$as_me: failed program was:" >&5
5873 cat conftest.$ac_ext >&5
5874 eval "$as_ac_Lib=no"
5875 fi
5876 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5877 LIBS=$ac_check_lib_save_LIBS
5878 fi
5879 echo "$as_me:5879: result: `eval echo '${'$as_ac_Lib'}'`" >&5
5880 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
5881 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
5882   break
5883 fi
5884
5885                         done
5886
5887 fi
5888
5889         fi
5890
5891         # Check for library containing initscr
5892         test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS"
5893         if test "x$cf_curs_lib" = x
5894         then
5895                 for cf_curs_lib in $cf_check_list xcurses jcurses pdcurses unknown
5896                 do
5897                         as_ac_Lib=`echo "ac_cv_lib_$cf_curs_lib''_initscr" | $as_tr_sh`
5898 echo "$as_me:5898: checking for initscr in -l$cf_curs_lib" >&5
5899 echo $ECHO_N "checking for initscr in -l$cf_curs_lib... $ECHO_C" >&6
5900 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
5901   echo $ECHO_N "(cached) $ECHO_C" >&6
5902 else
5903   ac_check_lib_save_LIBS=$LIBS
5904 LIBS="-l$cf_curs_lib  $LIBS"
5905 cat >conftest.$ac_ext <<_ACEOF
5906 #line 5906 "configure"
5907 #include "confdefs.h"
5908
5909 /* Override any gcc2 internal prototype to avoid an error.  */
5910 #ifdef __cplusplus
5911 extern "C"
5912 #endif
5913 /* We use char because int might match the return type of a gcc2
5914    builtin and then its argument prototype would still apply.  */
5915 char initscr ();
5916 int
5917 main ()
5918 {
5919 initscr ();
5920   ;
5921   return 0;
5922 }
5923 _ACEOF
5924 rm -f conftest.$ac_objext conftest$ac_exeext
5925 if { (eval echo "$as_me:5925: \"$ac_link\"") >&5
5926   (eval $ac_link) 2>&5
5927   ac_status=$?
5928   echo "$as_me:5928: \$? = $ac_status" >&5
5929   (exit $ac_status); } &&
5930          { ac_try='test -s conftest$ac_exeext'
5931   { (eval echo "$as_me:5931: \"$ac_try\"") >&5
5932   (eval $ac_try) 2>&5
5933   ac_status=$?
5934   echo "$as_me:5934: \$? = $ac_status" >&5
5935   (exit $ac_status); }; }; then
5936   eval "$as_ac_Lib=yes"
5937 else
5938   echo "$as_me: failed program was:" >&5
5939 cat conftest.$ac_ext >&5
5940 eval "$as_ac_Lib=no"
5941 fi
5942 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5943 LIBS=$ac_check_lib_save_LIBS
5944 fi
5945 echo "$as_me:5945: result: `eval echo '${'$as_ac_Lib'}'`" >&5
5946 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
5947 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
5948   break
5949 fi
5950
5951                 done
5952         fi
5953         test $cf_curs_lib = unknown && { { echo "$as_me:5953: error: no curses library found" >&5
5954 echo "$as_me: error: no curses library found" >&2;}
5955    { (exit 1); exit 1; }; }
5956
5957         LIBS="-l$cf_curs_lib $cf_save_LIBS"
5958         if test "$cf_term_lib" = unknown ; then
5959                 echo "$as_me:5959: checking if we can link with $cf_curs_lib library" >&5
5960 echo $ECHO_N "checking if we can link with $cf_curs_lib library... $ECHO_C" >&6
5961                 cat >conftest.$ac_ext <<_ACEOF
5962 #line 5962 "configure"
5963 #include "confdefs.h"
5964 #include <${cf_cv_ncurses_header:-curses.h}>
5965 int
5966 main ()
5967 {
5968 initscr()
5969   ;
5970   return 0;
5971 }
5972 _ACEOF
5973 rm -f conftest.$ac_objext conftest$ac_exeext
5974 if { (eval echo "$as_me:5974: \"$ac_link\"") >&5
5975   (eval $ac_link) 2>&5
5976   ac_status=$?
5977   echo "$as_me:5977: \$? = $ac_status" >&5
5978   (exit $ac_status); } &&
5979          { ac_try='test -s conftest$ac_exeext'
5980   { (eval echo "$as_me:5980: \"$ac_try\"") >&5
5981   (eval $ac_try) 2>&5
5982   ac_status=$?
5983   echo "$as_me:5983: \$? = $ac_status" >&5
5984   (exit $ac_status); }; }; then
5985   cf_result=yes
5986 else
5987   echo "$as_me: failed program was:" >&5
5988 cat conftest.$ac_ext >&5
5989 cf_result=no
5990 fi
5991 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5992                 echo "$as_me:5992: result: $cf_result" >&5
5993 echo "${ECHO_T}$cf_result" >&6
5994                 test $cf_result = no && { { echo "$as_me:5994: error: Cannot link curses library" >&5
5995 echo "$as_me: error: Cannot link curses library" >&2;}
5996    { (exit 1); exit 1; }; }
5997         elif test "$cf_curs_lib" = "$cf_term_lib" ; then
5998                 :
5999         elif test "$cf_term_lib" != predefined ; then
6000                 echo "$as_me:6000: checking if we need both $cf_curs_lib and $cf_term_lib libraries" >&5
6001 echo $ECHO_N "checking if we need both $cf_curs_lib and $cf_term_lib libraries... $ECHO_C" >&6
6002                 cat >conftest.$ac_ext <<_ACEOF
6003 #line 6003 "configure"
6004 #include "confdefs.h"
6005 #include <${cf_cv_ncurses_header:-curses.h}>
6006 int
6007 main ()
6008 {
6009 initscr(); tgoto((char *)0, 0, 0);
6010   ;
6011   return 0;
6012 }
6013 _ACEOF
6014 rm -f conftest.$ac_objext conftest$ac_exeext
6015 if { (eval echo "$as_me:6015: \"$ac_link\"") >&5
6016   (eval $ac_link) 2>&5
6017   ac_status=$?
6018   echo "$as_me:6018: \$? = $ac_status" >&5
6019   (exit $ac_status); } &&
6020          { ac_try='test -s conftest$ac_exeext'
6021   { (eval echo "$as_me:6021: \"$ac_try\"") >&5
6022   (eval $ac_try) 2>&5
6023   ac_status=$?
6024   echo "$as_me:6024: \$? = $ac_status" >&5
6025   (exit $ac_status); }; }; then
6026   cf_result=no
6027 else
6028   echo "$as_me: failed program was:" >&5
6029 cat conftest.$ac_ext >&5
6030
6031                         LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
6032                         cat >conftest.$ac_ext <<_ACEOF
6033 #line 6033 "configure"
6034 #include "confdefs.h"
6035 #include <${cf_cv_ncurses_header:-curses.h}>
6036 int
6037 main ()
6038 {
6039 initscr()
6040   ;
6041   return 0;
6042 }
6043 _ACEOF
6044 rm -f conftest.$ac_objext conftest$ac_exeext
6045 if { (eval echo "$as_me:6045: \"$ac_link\"") >&5
6046   (eval $ac_link) 2>&5
6047   ac_status=$?
6048   echo "$as_me:6048: \$? = $ac_status" >&5
6049   (exit $ac_status); } &&
6050          { ac_try='test -s conftest$ac_exeext'
6051   { (eval echo "$as_me:6051: \"$ac_try\"") >&5
6052   (eval $ac_try) 2>&5
6053   ac_status=$?
6054   echo "$as_me:6054: \$? = $ac_status" >&5
6055   (exit $ac_status); }; }; then
6056   cf_result=yes
6057 else
6058   echo "$as_me: failed program was:" >&5
6059 cat conftest.$ac_ext >&5
6060 cf_result=error
6061 fi
6062 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6063
6064 fi
6065 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6066                 echo "$as_me:6066: result: $cf_result" >&5
6067 echo "${ECHO_T}$cf_result" >&6
6068         fi
6069 fi
6070 fi
6071
6072         ;;
6073 (ncursesw*)
6074
6075 echo "$as_me:6075: checking for multibyte character support" >&5
6076 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
6077 if test "${cf_cv_utf8_lib+set}" = set; then
6078   echo $ECHO_N "(cached) $ECHO_C" >&6
6079 else
6080
6081         cf_save_LIBS="$LIBS"
6082         cat >conftest.$ac_ext <<_ACEOF
6083 #line 6083 "configure"
6084 #include "confdefs.h"
6085
6086 #include <stdlib.h>
6087 int
6088 main ()
6089 {
6090 putwc(0,0);
6091   ;
6092   return 0;
6093 }
6094 _ACEOF
6095 rm -f conftest.$ac_objext conftest$ac_exeext
6096 if { (eval echo "$as_me:6096: \"$ac_link\"") >&5
6097   (eval $ac_link) 2>&5
6098   ac_status=$?
6099   echo "$as_me:6099: \$? = $ac_status" >&5
6100   (exit $ac_status); } &&
6101          { ac_try='test -s conftest$ac_exeext'
6102   { (eval echo "$as_me:6102: \"$ac_try\"") >&5
6103   (eval $ac_try) 2>&5
6104   ac_status=$?
6105   echo "$as_me:6105: \$? = $ac_status" >&5
6106   (exit $ac_status); }; }; then
6107   cf_cv_utf8_lib=yes
6108 else
6109   echo "$as_me: failed program was:" >&5
6110 cat conftest.$ac_ext >&5
6111
6112 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
6113 # will be set on completion of the AC_TRY_LINK below.
6114 cf_cv_header_path_utf8=
6115 cf_cv_library_path_utf8=
6116
6117 echo "${as_me:-configure}:6117: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
6118
6119 cf_save_LIBS="$LIBS"
6120
6121 cat >conftest.$ac_ext <<_ACEOF
6122 #line 6122 "configure"
6123 #include "confdefs.h"
6124
6125 #include <libutf8.h>
6126 int
6127 main ()
6128 {
6129 putwc(0,0);
6130   ;
6131   return 0;
6132 }
6133 _ACEOF
6134 rm -f conftest.$ac_objext conftest$ac_exeext
6135 if { (eval echo "$as_me:6135: \"$ac_link\"") >&5
6136   (eval $ac_link) 2>&5
6137   ac_status=$?
6138   echo "$as_me:6138: \$? = $ac_status" >&5
6139   (exit $ac_status); } &&
6140          { ac_try='test -s conftest$ac_exeext'
6141   { (eval echo "$as_me:6141: \"$ac_try\"") >&5
6142   (eval $ac_try) 2>&5
6143   ac_status=$?
6144   echo "$as_me:6144: \$? = $ac_status" >&5
6145   (exit $ac_status); }; }; then
6146
6147         cf_cv_find_linkage_utf8=yes
6148         cf_cv_header_path_utf8=/usr/include
6149         cf_cv_library_path_utf8=/usr/lib
6150
6151 else
6152   echo "$as_me: failed program was:" >&5
6153 cat conftest.$ac_ext >&5
6154
6155 LIBS="-lutf8  $cf_save_LIBS"
6156
6157 cat >conftest.$ac_ext <<_ACEOF
6158 #line 6158 "configure"
6159 #include "confdefs.h"
6160
6161 #include <libutf8.h>
6162 int
6163 main ()
6164 {
6165 putwc(0,0);
6166   ;
6167   return 0;
6168 }
6169 _ACEOF
6170 rm -f conftest.$ac_objext conftest$ac_exeext
6171 if { (eval echo "$as_me:6171: \"$ac_link\"") >&5
6172   (eval $ac_link) 2>&5
6173   ac_status=$?
6174   echo "$as_me:6174: \$? = $ac_status" >&5
6175   (exit $ac_status); } &&
6176          { ac_try='test -s conftest$ac_exeext'
6177   { (eval echo "$as_me:6177: \"$ac_try\"") >&5
6178   (eval $ac_try) 2>&5
6179   ac_status=$?
6180   echo "$as_me:6180: \$? = $ac_status" >&5
6181   (exit $ac_status); }; }; then
6182
6183         cf_cv_find_linkage_utf8=yes
6184         cf_cv_header_path_utf8=/usr/include
6185         cf_cv_library_path_utf8=/usr/lib
6186         cf_cv_library_file_utf8="-lutf8"
6187
6188 else
6189   echo "$as_me: failed program was:" >&5
6190 cat conftest.$ac_ext >&5
6191
6192         cf_cv_find_linkage_utf8=no
6193         LIBS="$cf_save_LIBS"
6194
6195         test -n "$verbose" && echo "    find linkage for utf8 library" 1>&6
6196
6197 echo "${as_me:-configure}:6197: testing find linkage for utf8 library ..." 1>&5
6198
6199 echo "${as_me:-configure}:6199: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
6200
6201         cf_save_CPPFLAGS="$CPPFLAGS"
6202         cf_test_CPPFLAGS="$CPPFLAGS"
6203
6204 cf_search=
6205
6206 # collect the current set of include-directories from compiler flags
6207 cf_header_path_list=""
6208 if test -n "${CFLAGS}${CPPFLAGS}" ; then
6209         for cf_header_path in $CPPFLAGS $CFLAGS
6210         do
6211                 case $cf_header_path in
6212                 (-I*)
6213                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
6214
6215 test "x$cf_header_path" != "xNONE" && \
6216 test -d "$cf_header_path" && \
6217  {
6218         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
6219         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
6220         test -d $cf_header_path/include/utf8 &&       cf_search="$cf_search $cf_header_path/include/utf8"
6221         test -d $cf_header_path/include/utf8/include &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
6222         test -d $cf_header_path/utf8/include &&       cf_search="$cf_search $cf_header_path/utf8/include"
6223         test -d $cf_header_path/utf8/include/utf8 &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
6224 }
6225
6226                         cf_header_path_list="$cf_header_path_list $cf_search"
6227                         ;;
6228                 esac
6229         done
6230 fi
6231
6232 # add the variations for the package we are looking for
6233
6234 cf_search=
6235
6236 test "x$prefix" != "xNONE" && \
6237 test -d "$prefix" && \
6238  {
6239         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
6240         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
6241         test -d $prefix/include/utf8 &&       cf_search="$cf_search $prefix/include/utf8"
6242         test -d $prefix/include/utf8/include &&    cf_search="$cf_search $prefix/include/utf8/include"
6243         test -d $prefix/utf8/include &&       cf_search="$cf_search $prefix/utf8/include"
6244         test -d $prefix/utf8/include/utf8 &&    cf_search="$cf_search $prefix/utf8/include/utf8"
6245 }
6246
6247 for cf_subdir_prefix in \
6248         /usr \
6249         /usr/local \
6250         /usr/pkg \
6251         /opt \
6252         /opt/local \
6253         $HOME
6254 do
6255
6256 test "x$cf_subdir_prefix" != "x$prefix" && \
6257 test -d "$cf_subdir_prefix" && \
6258 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
6259         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
6260         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
6261         test -d $cf_subdir_prefix/include/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/include/utf8"
6262         test -d $cf_subdir_prefix/include/utf8/include &&    cf_search="$cf_search $cf_subdir_prefix/include/utf8/include"
6263         test -d $cf_subdir_prefix/utf8/include &&       cf_search="$cf_search $cf_subdir_prefix/utf8/include"
6264         test -d $cf_subdir_prefix/utf8/include/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/include/utf8"
6265 }
6266
6267 done
6268
6269 test "$includedir" != NONE && \
6270 test "$includedir" != "/usr/include" && \
6271 test -d "$includedir" && {
6272         test -d $includedir &&    cf_search="$cf_search $includedir"
6273         test -d $includedir/utf8 && cf_search="$cf_search $includedir/utf8"
6274 }
6275
6276 test "$oldincludedir" != NONE && \
6277 test "$oldincludedir" != "/usr/include" && \
6278 test -d "$oldincludedir" && {
6279         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
6280         test -d $oldincludedir/utf8 && cf_search="$cf_search $oldincludedir/utf8"
6281 }
6282
6283 cf_search="$cf_search $cf_header_path_list"
6284
6285         for cf_cv_header_path_utf8 in $cf_search
6286         do
6287                 if test -d $cf_cv_header_path_utf8 ; then
6288                         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
6289
6290 echo "${as_me:-configure}:6290: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
6291
6292                         CPPFLAGS="$cf_save_CPPFLAGS -I$cf_cv_header_path_utf8"
6293                         cat >conftest.$ac_ext <<_ACEOF
6294 #line 6294 "configure"
6295 #include "confdefs.h"
6296
6297 #include <libutf8.h>
6298 int
6299 main ()
6300 {
6301 putwc(0,0);
6302   ;
6303   return 0;
6304 }
6305 _ACEOF
6306 rm -f conftest.$ac_objext
6307 if { (eval echo "$as_me:6307: \"$ac_compile\"") >&5
6308   (eval $ac_compile) 2>&5
6309   ac_status=$?
6310   echo "$as_me:6310: \$? = $ac_status" >&5
6311   (exit $ac_status); } &&
6312          { ac_try='test -s conftest.$ac_objext'
6313   { (eval echo "$as_me:6313: \"$ac_try\"") >&5
6314   (eval $ac_try) 2>&5
6315   ac_status=$?
6316   echo "$as_me:6316: \$? = $ac_status" >&5
6317   (exit $ac_status); }; }; then
6318
6319                                 test -n "$verbose" && echo "    ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
6320
6321 echo "${as_me:-configure}:6321: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
6322
6323                                 cf_cv_find_linkage_utf8=maybe
6324                                 cf_test_CPPFLAGS="$CPPFLAGS"
6325                                 break
6326 else
6327   echo "$as_me: failed program was:" >&5
6328 cat conftest.$ac_ext >&5
6329
6330                                 CPPFLAGS="$cf_save_CPPFLAGS"
6331
6332 fi
6333 rm -f conftest.$ac_objext conftest.$ac_ext
6334                 fi
6335         done
6336
6337         if test "$cf_cv_find_linkage_utf8" = maybe ; then
6338
6339 echo "${as_me:-configure}:6339: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
6340
6341                 cf_save_LIBS="$LIBS"
6342                 cf_save_LDFLAGS="$LDFLAGS"
6343
6344                 if test "$cf_cv_find_linkage_utf8" != yes ; then
6345
6346 cf_search=
6347 cf_library_path_list=""
6348 if test -n "${LDFLAGS}${LIBS}" ; then
6349         for cf_library_path in $LDFLAGS $LIBS
6350         do
6351                 case $cf_library_path in
6352                 (-L*)
6353                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
6354
6355 test "x$cf_library_path" != "xNONE" && \
6356 test -d "$cf_library_path" && \
6357  {
6358         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
6359         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
6360         test -d $cf_library_path/lib/utf8 &&       cf_search="$cf_search $cf_library_path/lib/utf8"
6361         test -d $cf_library_path/lib/utf8/lib &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
6362         test -d $cf_library_path/utf8/lib &&       cf_search="$cf_search $cf_library_path/utf8/lib"
6363         test -d $cf_library_path/utf8/lib/utf8 &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
6364 }
6365
6366                         cf_library_path_list="$cf_library_path_list $cf_search"
6367                         ;;
6368                 esac
6369         done
6370 fi
6371
6372 cf_search=
6373
6374 test "x$prefix" != "xNONE" && \
6375 test -d "$prefix" && \
6376  {
6377         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
6378         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
6379         test -d $prefix/lib/utf8 &&       cf_search="$cf_search $prefix/lib/utf8"
6380         test -d $prefix/lib/utf8/lib &&    cf_search="$cf_search $prefix/lib/utf8/lib"
6381         test -d $prefix/utf8/lib &&       cf_search="$cf_search $prefix/utf8/lib"
6382         test -d $prefix/utf8/lib/utf8 &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
6383 }
6384
6385 for cf_subdir_prefix in \
6386         /usr \
6387         /usr/local \
6388         /usr/pkg \
6389         /opt \
6390         /opt/local \
6391         $HOME
6392 do
6393
6394 test "x$cf_subdir_prefix" != "x$prefix" && \
6395 test -d "$cf_subdir_prefix" && \
6396 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
6397         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
6398         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
6399         test -d $cf_subdir_prefix/lib/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/lib/utf8"
6400         test -d $cf_subdir_prefix/lib/utf8/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/utf8/lib"
6401         test -d $cf_subdir_prefix/utf8/lib &&       cf_search="$cf_search $cf_subdir_prefix/utf8/lib"
6402         test -d $cf_subdir_prefix/utf8/lib/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/lib/utf8"
6403 }
6404
6405 done
6406
6407 cf_search="$cf_library_path_list $cf_search"
6408
6409                         for cf_cv_library_path_utf8 in $cf_search
6410                         do
6411                                 if test -d $cf_cv_library_path_utf8 ; then
6412                                         test -n "$verbose" && echo "    ... testing $cf_cv_library_path_utf8" 1>&6
6413
6414 echo "${as_me:-configure}:6414: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
6415
6416                                         CPPFLAGS="$cf_test_CPPFLAGS"
6417                                         LIBS="-lutf8  $cf_save_LIBS"
6418                                         LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
6419                                         cat >conftest.$ac_ext <<_ACEOF
6420 #line 6420 "configure"
6421 #include "confdefs.h"
6422
6423 #include <libutf8.h>
6424 int
6425 main ()
6426 {
6427 putwc(0,0);
6428   ;
6429   return 0;
6430 }
6431 _ACEOF
6432 rm -f conftest.$ac_objext conftest$ac_exeext
6433 if { (eval echo "$as_me:6433: \"$ac_link\"") >&5
6434   (eval $ac_link) 2>&5
6435   ac_status=$?
6436   echo "$as_me:6436: \$? = $ac_status" >&5
6437   (exit $ac_status); } &&
6438          { ac_try='test -s conftest$ac_exeext'
6439   { (eval echo "$as_me:6439: \"$ac_try\"") >&5
6440   (eval $ac_try) 2>&5
6441   ac_status=$?
6442   echo "$as_me:6442: \$? = $ac_status" >&5
6443   (exit $ac_status); }; }; then
6444
6445                                         test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
6446
6447 echo "${as_me:-configure}:6447: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
6448
6449                                         cf_cv_find_linkage_utf8=yes
6450                                         cf_cv_library_file_utf8="-lutf8"
6451                                         break
6452 else
6453   echo "$as_me: failed program was:" >&5
6454 cat conftest.$ac_ext >&5
6455
6456                                         CPPFLAGS="$cf_save_CPPFLAGS"
6457                                         LIBS="$cf_save_LIBS"
6458                                         LDFLAGS="$cf_save_LDFLAGS"
6459
6460 fi
6461 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6462                                 fi
6463                         done
6464                         CPPFLAGS="$cf_save_CPPFLAGS"
6465                         LDFLAGS="$cf_save_LDFLAGS"
6466                 fi
6467
6468         else
6469                 cf_cv_find_linkage_utf8=no
6470         fi
6471
6472 fi
6473 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6474
6475 fi
6476 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6477
6478 LIBS="$cf_save_LIBS"
6479
6480 if test "$cf_cv_find_linkage_utf8" = yes ; then
6481 cf_cv_utf8_lib=add-on
6482 else
6483 cf_cv_utf8_lib=no
6484 fi
6485
6486 fi
6487 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6488 fi
6489 echo "$as_me:6489: result: $cf_cv_utf8_lib" >&5
6490 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
6491
6492 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
6493 # ncurses/ncursesw:
6494 if test "$cf_cv_utf8_lib" = "add-on" ; then
6495
6496 cat >>confdefs.h <<\EOF
6497 #define HAVE_LIBUTF8_H 1
6498 EOF
6499
6500 if test -n "$cf_cv_header_path_utf8" ; then
6501   for cf_add_incdir in $cf_cv_header_path_utf8
6502   do
6503         while test $cf_add_incdir != /usr/include
6504         do
6505           if test -d $cf_add_incdir
6506           then
6507                 cf_have_incdir=no
6508                 if test -n "$CFLAGS$CPPFLAGS" ; then
6509                   # a loop is needed to ensure we can add subdirs of existing dirs
6510                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6511                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6512                           cf_have_incdir=yes; break
6513                         fi
6514                   done
6515                 fi
6516
6517                 if test "$cf_have_incdir" = no ; then
6518                   if test "$cf_add_incdir" = /usr/local/include ; then
6519                         if test "$GCC" = yes
6520                         then
6521                           cf_save_CPPFLAGS=$CPPFLAGS
6522                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6523                           cat >conftest.$ac_ext <<_ACEOF
6524 #line 6524 "configure"
6525 #include "confdefs.h"
6526 #include <stdio.h>
6527 int
6528 main ()
6529 {
6530 printf("Hello")
6531   ;
6532   return 0;
6533 }
6534 _ACEOF
6535 rm -f conftest.$ac_objext
6536 if { (eval echo "$as_me:6536: \"$ac_compile\"") >&5
6537   (eval $ac_compile) 2>&5
6538   ac_status=$?
6539   echo "$as_me:6539: \$? = $ac_status" >&5
6540   (exit $ac_status); } &&
6541          { ac_try='test -s conftest.$ac_objext'
6542   { (eval echo "$as_me:6542: \"$ac_try\"") >&5
6543   (eval $ac_try) 2>&5
6544   ac_status=$?
6545   echo "$as_me:6545: \$? = $ac_status" >&5
6546   (exit $ac_status); }; }; then
6547   :
6548 else
6549   echo "$as_me: failed program was:" >&5
6550 cat conftest.$ac_ext >&5
6551 cf_have_incdir=yes
6552 fi
6553 rm -f conftest.$ac_objext conftest.$ac_ext
6554                           CPPFLAGS=$cf_save_CPPFLAGS
6555                         fi
6556                   fi
6557                 fi
6558
6559                 if test "$cf_have_incdir" = no ; then
6560                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6561
6562 echo "${as_me:-configure}:6562: testing adding $cf_add_incdir to include-path ..." 1>&5
6563
6564                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6565
6566                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6567                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6568                   cf_add_incdir="$cf_top_incdir"
6569                 else
6570                   break
6571                 fi
6572           else
6573                 break
6574           fi
6575         done
6576   done
6577 fi
6578
6579 if test -n "$cf_cv_library_path_utf8" ; then
6580         for cf_add_libdir in $cf_cv_library_path_utf8
6581         do
6582                 if test $cf_add_libdir = /usr/lib ; then
6583                         :
6584                 elif test -d $cf_add_libdir
6585                 then
6586                         cf_have_libdir=no
6587                         if test -n "$LDFLAGS$LIBS" ; then
6588                                 # a loop is needed to ensure we can add subdirs of existing dirs
6589                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6590                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6591                                                 cf_have_libdir=yes; break
6592                                         fi
6593                                 done
6594                         fi
6595                         if test "$cf_have_libdir" = no ; then
6596                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6597
6598 echo "${as_me:-configure}:6598: testing adding $cf_add_libdir to library-path ..." 1>&5
6599
6600                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6601                         fi
6602                 fi
6603         done
6604 fi
6605
6606 cf_add_libs="$cf_cv_library_file_utf8"
6607 # Filter out duplicates - this happens with badly-designed ".pc" files...
6608 for cf_add_1lib in $LIBS
6609 do
6610         for cf_add_2lib in $cf_add_libs
6611         do
6612                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6613                 then
6614                         cf_add_1lib=
6615                         break
6616                 fi
6617         done
6618         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6619 done
6620 LIBS="$cf_add_libs"
6621
6622 fi
6623
6624 cf_ncuconfig_root=$cf_cv_screen
6625 cf_have_ncuconfig=no
6626
6627 if test "x${PKG_CONFIG:=none}" != xnone; then
6628         echo "$as_me:6628: checking pkg-config for $cf_ncuconfig_root" >&5
6629 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
6630         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
6631                 echo "$as_me:6631: result: yes" >&5
6632 echo "${ECHO_T}yes" >&6
6633
6634                 echo "$as_me:6634: checking if the $cf_ncuconfig_root package files work" >&5
6635 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
6636                 cf_have_ncuconfig=unknown
6637
6638                 cf_save_CPPFLAGS="$CPPFLAGS"
6639                 cf_save_LIBS="$LIBS"
6640
6641                 CPPFLAGS="$CPPFLAGS `$PKG_CONFIG --cflags $cf_ncuconfig_root`"
6642
6643 cf_add_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
6644 # Filter out duplicates - this happens with badly-designed ".pc" files...
6645 for cf_add_1lib in $LIBS
6646 do
6647         for cf_add_2lib in $cf_add_libs
6648         do
6649                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6650                 then
6651                         cf_add_1lib=
6652                         break
6653                 fi
6654         done
6655         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6656 done
6657 LIBS="$cf_add_libs"
6658
6659                 cat >conftest.$ac_ext <<_ACEOF
6660 #line 6660 "configure"
6661 #include "confdefs.h"
6662 #include <${cf_cv_ncurses_header:-curses.h}>
6663 int
6664 main ()
6665 {
6666 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
6667   ;
6668   return 0;
6669 }
6670 _ACEOF
6671 rm -f conftest.$ac_objext conftest$ac_exeext
6672 if { (eval echo "$as_me:6672: \"$ac_link\"") >&5
6673   (eval $ac_link) 2>&5
6674   ac_status=$?
6675   echo "$as_me:6675: \$? = $ac_status" >&5
6676   (exit $ac_status); } &&
6677          { ac_try='test -s conftest$ac_exeext'
6678   { (eval echo "$as_me:6678: \"$ac_try\"") >&5
6679   (eval $ac_try) 2>&5
6680   ac_status=$?
6681   echo "$as_me:6681: \$? = $ac_status" >&5
6682   (exit $ac_status); }; }; then
6683   if test "$cross_compiling" = yes; then
6684   cf_have_ncuconfig=maybe
6685 else
6686   cat >conftest.$ac_ext <<_ACEOF
6687 #line 6687 "configure"
6688 #include "confdefs.h"
6689 #include <${cf_cv_ncurses_header:-curses.h}>
6690                                 int main(void)
6691                                 { char *xx = curses_version(); return (xx == 0); }
6692 _ACEOF
6693 rm -f conftest$ac_exeext
6694 if { (eval echo "$as_me:6694: \"$ac_link\"") >&5
6695   (eval $ac_link) 2>&5
6696   ac_status=$?
6697   echo "$as_me:6697: \$? = $ac_status" >&5
6698   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
6699   { (eval echo "$as_me:6699: \"$ac_try\"") >&5
6700   (eval $ac_try) 2>&5
6701   ac_status=$?
6702   echo "$as_me:6702: \$? = $ac_status" >&5
6703   (exit $ac_status); }; }; then
6704   cf_have_ncuconfig=yes
6705 else
6706   echo "$as_me: program exited with status $ac_status" >&5
6707 echo "$as_me: failed program was:" >&5
6708 cat conftest.$ac_ext >&5
6709 cf_have_ncuconfig=no
6710 fi
6711 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
6712 fi
6713 else
6714   echo "$as_me: failed program was:" >&5
6715 cat conftest.$ac_ext >&5
6716 cf_have_ncuconfig=no
6717 fi
6718 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6719                 echo "$as_me:6719: result: $cf_have_ncuconfig" >&5
6720 echo "${ECHO_T}$cf_have_ncuconfig" >&6
6721                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
6722                 if test "$cf_have_ncuconfig" != "yes"
6723                 then
6724                         CPPFLAGS="$cf_save_CPPFLAGS"
6725                         LIBS="$cf_save_LIBS"
6726                         NCURSES_CONFIG_PKG=none
6727                 else
6728
6729 cat >>confdefs.h <<\EOF
6730 #define NCURSES 1
6731 EOF
6732
6733                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
6734                 fi
6735
6736         else
6737                 echo "$as_me:6737: result: no" >&5
6738 echo "${ECHO_T}no" >&6
6739                 NCURSES_CONFIG_PKG=none
6740         fi
6741 else
6742         NCURSES_CONFIG_PKG=none
6743 fi
6744
6745 if test "x$cf_have_ncuconfig" = "xno"; then
6746         echo "Looking for ${cf_ncuconfig_root}-config"
6747
6748 if test -n "$ac_tool_prefix"; then
6749   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
6750   do
6751     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
6752 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
6753 echo "$as_me:6753: checking for $ac_word" >&5
6754 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
6755 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
6756   echo $ECHO_N "(cached) $ECHO_C" >&6
6757 else
6758   if test -n "$NCURSES_CONFIG"; then
6759   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
6760 else
6761   ac_save_IFS=$IFS; IFS=$ac_path_separator
6762 ac_dummy="$PATH"
6763 for ac_dir in $ac_dummy; do
6764   IFS=$ac_save_IFS
6765   test -z "$ac_dir" && ac_dir=.
6766   $as_executable_p "$ac_dir/$ac_word" || continue
6767 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
6768 echo "$as_me:6768: found $ac_dir/$ac_word" >&5
6769 break
6770 done
6771
6772 fi
6773 fi
6774 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
6775 if test -n "$NCURSES_CONFIG"; then
6776   echo "$as_me:6776: result: $NCURSES_CONFIG" >&5
6777 echo "${ECHO_T}$NCURSES_CONFIG" >&6
6778 else
6779   echo "$as_me:6779: result: no" >&5
6780 echo "${ECHO_T}no" >&6
6781 fi
6782
6783     test -n "$NCURSES_CONFIG" && break
6784   done
6785 fi
6786 if test -z "$NCURSES_CONFIG"; then
6787   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
6788   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
6789 do
6790   # Extract the first word of "$ac_prog", so it can be a program name with args.
6791 set dummy $ac_prog; ac_word=$2
6792 echo "$as_me:6792: checking for $ac_word" >&5
6793 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
6794 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
6795   echo $ECHO_N "(cached) $ECHO_C" >&6
6796 else
6797   if test -n "$ac_ct_NCURSES_CONFIG"; then
6798   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
6799 else
6800   ac_save_IFS=$IFS; IFS=$ac_path_separator
6801 ac_dummy="$PATH"
6802 for ac_dir in $ac_dummy; do
6803   IFS=$ac_save_IFS
6804   test -z "$ac_dir" && ac_dir=.
6805   $as_executable_p "$ac_dir/$ac_word" || continue
6806 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
6807 echo "$as_me:6807: found $ac_dir/$ac_word" >&5
6808 break
6809 done
6810
6811 fi
6812 fi
6813 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
6814 if test -n "$ac_ct_NCURSES_CONFIG"; then
6815   echo "$as_me:6815: result: $ac_ct_NCURSES_CONFIG" >&5
6816 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
6817 else
6818   echo "$as_me:6818: result: no" >&5
6819 echo "${ECHO_T}no" >&6
6820 fi
6821
6822   test -n "$ac_ct_NCURSES_CONFIG" && break
6823 done
6824 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
6825
6826   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
6827 fi
6828
6829         if test "$NCURSES_CONFIG" != none ; then
6830
6831                 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
6832
6833 cf_add_libs="`$NCURSES_CONFIG --libs`"
6834 # Filter out duplicates - this happens with badly-designed ".pc" files...
6835 for cf_add_1lib in $LIBS
6836 do
6837         for cf_add_2lib in $cf_add_libs
6838         do
6839                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6840                 then
6841                         cf_add_1lib=
6842                         break
6843                 fi
6844         done
6845         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6846 done
6847 LIBS="$cf_add_libs"
6848
6849                 # even with config script, some packages use no-override for curses.h
6850
6851 echo "$as_me:6851: checking if we have identified curses headers" >&5
6852 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
6853 if test "${cf_cv_ncurses_header+set}" = set; then
6854   echo $ECHO_N "(cached) $ECHO_C" >&6
6855 else
6856
6857 cf_cv_ncurses_header=none
6858 for cf_header in \
6859         ncurses.h $cf_cv_screen/ncurses.h \
6860         curses.h $cf_cv_screen/curses.h
6861 do
6862 cat >conftest.$ac_ext <<_ACEOF
6863 #line 6863 "configure"
6864 #include "confdefs.h"
6865 #include <${cf_header}>
6866 int
6867 main ()
6868 {
6869 initscr(); tgoto("?", 0,0)
6870   ;
6871   return 0;
6872 }
6873 _ACEOF
6874 rm -f conftest.$ac_objext
6875 if { (eval echo "$as_me:6875: \"$ac_compile\"") >&5
6876   (eval $ac_compile) 2>&5
6877   ac_status=$?
6878   echo "$as_me:6878: \$? = $ac_status" >&5
6879   (exit $ac_status); } &&
6880          { ac_try='test -s conftest.$ac_objext'
6881   { (eval echo "$as_me:6881: \"$ac_try\"") >&5
6882   (eval $ac_try) 2>&5
6883   ac_status=$?
6884   echo "$as_me:6884: \$? = $ac_status" >&5
6885   (exit $ac_status); }; }; then
6886   cf_cv_ncurses_header=$cf_header; break
6887 else
6888   echo "$as_me: failed program was:" >&5
6889 cat conftest.$ac_ext >&5
6890 fi
6891 rm -f conftest.$ac_objext conftest.$ac_ext
6892 done
6893
6894 fi
6895 echo "$as_me:6895: result: $cf_cv_ncurses_header" >&5
6896 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
6897
6898 if test "$cf_cv_ncurses_header" = none ; then
6899         { { echo "$as_me:6899: error: No curses header-files found" >&5
6900 echo "$as_me: error: No curses header-files found" >&2;}
6901    { (exit 1); exit 1; }; }
6902 fi
6903
6904 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
6905
6906 for ac_header in $cf_cv_ncurses_header
6907 do
6908 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
6909 echo "$as_me:6909: checking for $ac_header" >&5
6910 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
6911 if eval "test \"\${$as_ac_Header+set}\" = set"; then
6912   echo $ECHO_N "(cached) $ECHO_C" >&6
6913 else
6914   cat >conftest.$ac_ext <<_ACEOF
6915 #line 6915 "configure"
6916 #include "confdefs.h"
6917 #include <$ac_header>
6918 _ACEOF
6919 if { (eval echo "$as_me:6919: \"$ac_cpp conftest.$ac_ext\"") >&5
6920   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
6921   ac_status=$?
6922   egrep -v '^ *\+' conftest.er1 >conftest.err
6923   rm -f conftest.er1
6924   cat conftest.err >&5
6925   echo "$as_me:6925: \$? = $ac_status" >&5
6926   (exit $ac_status); } >/dev/null; then
6927   if test -s conftest.err; then
6928     ac_cpp_err=$ac_c_preproc_warn_flag
6929   else
6930     ac_cpp_err=
6931   fi
6932 else
6933   ac_cpp_err=yes
6934 fi
6935 if test -z "$ac_cpp_err"; then
6936   eval "$as_ac_Header=yes"
6937 else
6938   echo "$as_me: failed program was:" >&5
6939   cat conftest.$ac_ext >&5
6940   eval "$as_ac_Header=no"
6941 fi
6942 rm -f conftest.err conftest.$ac_ext
6943 fi
6944 echo "$as_me:6944: result: `eval echo '${'$as_ac_Header'}'`" >&5
6945 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
6946 if test `eval echo '${'$as_ac_Header'}'` = yes; then
6947   cat >>confdefs.h <<EOF
6948 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
6949 EOF
6950
6951 fi
6952 done
6953
6954 cat >>confdefs.h <<\EOF
6955 #define NCURSES 1
6956 EOF
6957
6958 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
6959
6960                 cat >>confdefs.h <<EOF
6961 #define $cf_nculib_ROOT 1
6962 EOF
6963
6964                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
6965
6966         else
6967
6968 cf_ncuhdr_root=$cf_cv_screen
6969
6970 test -n "$cf_cv_curses_dir" && \
6971 test "$cf_cv_curses_dir" != "no" && { \
6972
6973 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
6974   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
6975   do
6976         while test $cf_add_incdir != /usr/include
6977         do
6978           if test -d $cf_add_incdir
6979           then
6980                 cf_have_incdir=no
6981                 if test -n "$CFLAGS$CPPFLAGS" ; then
6982                   # a loop is needed to ensure we can add subdirs of existing dirs
6983                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6984                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6985                           cf_have_incdir=yes; break
6986                         fi
6987                   done
6988                 fi
6989
6990                 if test "$cf_have_incdir" = no ; then
6991                   if test "$cf_add_incdir" = /usr/local/include ; then
6992                         if test "$GCC" = yes
6993                         then
6994                           cf_save_CPPFLAGS=$CPPFLAGS
6995                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6996                           cat >conftest.$ac_ext <<_ACEOF
6997 #line 6997 "configure"
6998 #include "confdefs.h"
6999 #include <stdio.h>
7000 int
7001 main ()
7002 {
7003 printf("Hello")
7004   ;
7005   return 0;
7006 }
7007 _ACEOF
7008 rm -f conftest.$ac_objext
7009 if { (eval echo "$as_me:7009: \"$ac_compile\"") >&5
7010   (eval $ac_compile) 2>&5
7011   ac_status=$?
7012   echo "$as_me:7012: \$? = $ac_status" >&5
7013   (exit $ac_status); } &&
7014          { ac_try='test -s conftest.$ac_objext'
7015   { (eval echo "$as_me:7015: \"$ac_try\"") >&5
7016   (eval $ac_try) 2>&5
7017   ac_status=$?
7018   echo "$as_me:7018: \$? = $ac_status" >&5
7019   (exit $ac_status); }; }; then
7020   :
7021 else
7022   echo "$as_me: failed program was:" >&5
7023 cat conftest.$ac_ext >&5
7024 cf_have_incdir=yes
7025 fi
7026 rm -f conftest.$ac_objext conftest.$ac_ext
7027                           CPPFLAGS=$cf_save_CPPFLAGS
7028                         fi
7029                   fi
7030                 fi
7031
7032                 if test "$cf_have_incdir" = no ; then
7033                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7034
7035 echo "${as_me:-configure}:7035: testing adding $cf_add_incdir to include-path ..." 1>&5
7036
7037                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7038
7039                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7040                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7041                   cf_add_incdir="$cf_top_incdir"
7042                 else
7043                   break
7044                 fi
7045           else
7046                 break
7047           fi
7048         done
7049   done
7050 fi
7051
7052 }
7053
7054 echo "$as_me:7054: checking for $cf_ncuhdr_root header in include-path" >&5
7055 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
7056 if test "${cf_cv_ncurses_h+set}" = set; then
7057   echo $ECHO_N "(cached) $ECHO_C" >&6
7058 else
7059
7060         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
7061         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
7062         for cf_header in $cf_header_list
7063         do
7064
7065         cat >conftest.$ac_ext <<_ACEOF
7066 #line 7066 "configure"
7067 #include "confdefs.h"
7068
7069 #include <$cf_header>
7070 int
7071 main ()
7072 {
7073
7074 #ifdef NCURSES_VERSION
7075
7076 printf("%s\n", NCURSES_VERSION);
7077 #else
7078 #ifdef __NCURSES_H
7079 printf("old\n");
7080 #else
7081         make an error
7082 #endif
7083 #endif
7084
7085   ;
7086   return 0;
7087 }
7088 _ACEOF
7089 rm -f conftest.$ac_objext
7090 if { (eval echo "$as_me:7090: \"$ac_compile\"") >&5
7091   (eval $ac_compile) 2>&5
7092   ac_status=$?
7093   echo "$as_me:7093: \$? = $ac_status" >&5
7094   (exit $ac_status); } &&
7095          { ac_try='test -s conftest.$ac_objext'
7096   { (eval echo "$as_me:7096: \"$ac_try\"") >&5
7097   (eval $ac_try) 2>&5
7098   ac_status=$?
7099   echo "$as_me:7099: \$? = $ac_status" >&5
7100   (exit $ac_status); }; }; then
7101   cf_cv_ncurses_h=$cf_header
7102
7103 else
7104   echo "$as_me: failed program was:" >&5
7105 cat conftest.$ac_ext >&5
7106 cf_cv_ncurses_h=no
7107 fi
7108 rm -f conftest.$ac_objext conftest.$ac_ext
7109
7110                 test "$cf_cv_ncurses_h" != no && break
7111         done
7112
7113 fi
7114 echo "$as_me:7114: result: $cf_cv_ncurses_h" >&5
7115 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
7116
7117 if test "$cf_cv_ncurses_h" != no ; then
7118         cf_cv_ncurses_header=$cf_cv_ncurses_h
7119 else
7120
7121 echo "$as_me:7121: checking for $cf_ncuhdr_root include-path" >&5
7122 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
7123 if test "${cf_cv_ncurses_h2+set}" = set; then
7124   echo $ECHO_N "(cached) $ECHO_C" >&6
7125 else
7126
7127         test -n "$verbose" && echo
7128
7129 cf_search=
7130
7131 # collect the current set of include-directories from compiler flags
7132 cf_header_path_list=""
7133 if test -n "${CFLAGS}${CPPFLAGS}" ; then
7134         for cf_header_path in $CPPFLAGS $CFLAGS
7135         do
7136                 case $cf_header_path in
7137                 (-I*)
7138                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
7139
7140 test "x$cf_header_path" != "xNONE" && \
7141 test -d "$cf_header_path" && \
7142  {
7143         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
7144         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
7145         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
7146         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
7147         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
7148         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"
7149 }
7150
7151                         cf_header_path_list="$cf_header_path_list $cf_search"
7152                         ;;
7153                 esac
7154         done
7155 fi
7156
7157 # add the variations for the package we are looking for
7158
7159 cf_search=
7160
7161 test "x$prefix" != "xNONE" && \
7162 test -d "$prefix" && \
7163  {
7164         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
7165         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
7166         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
7167         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
7168         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
7169         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
7170 }
7171
7172 for cf_subdir_prefix in \
7173         /usr \
7174         /usr/local \
7175         /usr/pkg \
7176         /opt \
7177         /opt/local \
7178         $HOME
7179 do
7180
7181 test "x$cf_subdir_prefix" != "x$prefix" && \
7182 test -d "$cf_subdir_prefix" && \
7183 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
7184         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
7185         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
7186         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
7187         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
7188         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
7189         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"
7190 }
7191
7192 done
7193
7194 test "$includedir" != NONE && \
7195 test "$includedir" != "/usr/include" && \
7196 test -d "$includedir" && {
7197         test -d $includedir &&    cf_search="$cf_search $includedir"
7198         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
7199 }
7200
7201 test "$oldincludedir" != NONE && \
7202 test "$oldincludedir" != "/usr/include" && \
7203 test -d "$oldincludedir" && {
7204         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
7205         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
7206 }
7207
7208 cf_search="$cf_search $cf_header_path_list"
7209
7210         test -n "$verbose" && echo search path $cf_search
7211         cf_save2_CPPFLAGS="$CPPFLAGS"
7212         for cf_incdir in $cf_search
7213         do
7214
7215 if test -n "$cf_incdir" ; then
7216   for cf_add_incdir in $cf_incdir
7217   do
7218         while test $cf_add_incdir != /usr/include
7219         do
7220           if test -d $cf_add_incdir
7221           then
7222                 cf_have_incdir=no
7223                 if test -n "$CFLAGS$CPPFLAGS" ; then
7224                   # a loop is needed to ensure we can add subdirs of existing dirs
7225                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7226                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7227                           cf_have_incdir=yes; break
7228                         fi
7229                   done
7230                 fi
7231
7232                 if test "$cf_have_incdir" = no ; then
7233                   if test "$cf_add_incdir" = /usr/local/include ; then
7234                         if test "$GCC" = yes
7235                         then
7236                           cf_save_CPPFLAGS=$CPPFLAGS
7237                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7238                           cat >conftest.$ac_ext <<_ACEOF
7239 #line 7239 "configure"
7240 #include "confdefs.h"
7241 #include <stdio.h>
7242 int
7243 main ()
7244 {
7245 printf("Hello")
7246   ;
7247   return 0;
7248 }
7249 _ACEOF
7250 rm -f conftest.$ac_objext
7251 if { (eval echo "$as_me:7251: \"$ac_compile\"") >&5
7252   (eval $ac_compile) 2>&5
7253   ac_status=$?
7254   echo "$as_me:7254: \$? = $ac_status" >&5
7255   (exit $ac_status); } &&
7256          { ac_try='test -s conftest.$ac_objext'
7257   { (eval echo "$as_me:7257: \"$ac_try\"") >&5
7258   (eval $ac_try) 2>&5
7259   ac_status=$?
7260   echo "$as_me:7260: \$? = $ac_status" >&5
7261   (exit $ac_status); }; }; then
7262   :
7263 else
7264   echo "$as_me: failed program was:" >&5
7265 cat conftest.$ac_ext >&5
7266 cf_have_incdir=yes
7267 fi
7268 rm -f conftest.$ac_objext conftest.$ac_ext
7269                           CPPFLAGS=$cf_save_CPPFLAGS
7270                         fi
7271                   fi
7272                 fi
7273
7274                 if test "$cf_have_incdir" = no ; then
7275                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7276
7277 echo "${as_me:-configure}:7277: testing adding $cf_add_incdir to include-path ..." 1>&5
7278
7279                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7280
7281                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7282                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7283                   cf_add_incdir="$cf_top_incdir"
7284                 else
7285                   break
7286                 fi
7287           else
7288                 break
7289           fi
7290         done
7291   done
7292 fi
7293
7294                 for cf_header in \
7295                         ncurses.h \
7296                         curses.h
7297                 do
7298
7299         cat >conftest.$ac_ext <<_ACEOF
7300 #line 7300 "configure"
7301 #include "confdefs.h"
7302
7303 #include <$cf_header>
7304 int
7305 main ()
7306 {
7307
7308 #ifdef NCURSES_VERSION
7309
7310 printf("%s\n", NCURSES_VERSION);
7311 #else
7312 #ifdef __NCURSES_H
7313 printf("old\n");
7314 #else
7315         make an error
7316 #endif
7317 #endif
7318
7319   ;
7320   return 0;
7321 }
7322 _ACEOF
7323 rm -f conftest.$ac_objext
7324 if { (eval echo "$as_me:7324: \"$ac_compile\"") >&5
7325   (eval $ac_compile) 2>&5
7326   ac_status=$?
7327   echo "$as_me:7327: \$? = $ac_status" >&5
7328   (exit $ac_status); } &&
7329          { ac_try='test -s conftest.$ac_objext'
7330   { (eval echo "$as_me:7330: \"$ac_try\"") >&5
7331   (eval $ac_try) 2>&5
7332   ac_status=$?
7333   echo "$as_me:7333: \$? = $ac_status" >&5
7334   (exit $ac_status); }; }; then
7335   cf_cv_ncurses_h2=$cf_header
7336
7337 else
7338   echo "$as_me: failed program was:" >&5
7339 cat conftest.$ac_ext >&5
7340 cf_cv_ncurses_h2=no
7341 fi
7342 rm -f conftest.$ac_objext conftest.$ac_ext
7343
7344                         if test "$cf_cv_ncurses_h2" != no ; then
7345                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
7346                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
7347                                 break
7348                         fi
7349                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
7350                 done
7351                 CPPFLAGS="$cf_save2_CPPFLAGS"
7352                 test "$cf_cv_ncurses_h2" != no && break
7353         done
7354         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:7354: error: not found" >&5
7355 echo "$as_me: error: not found" >&2;}
7356    { (exit 1); exit 1; }; }
7357
7358 fi
7359 echo "$as_me:7359: result: $cf_cv_ncurses_h2" >&5
7360 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
7361
7362         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
7363         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
7364         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
7365                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
7366         fi
7367
7368 if test -n "$cf_1st_incdir" ; then
7369   for cf_add_incdir in $cf_1st_incdir
7370   do
7371         while test $cf_add_incdir != /usr/include
7372         do
7373           if test -d $cf_add_incdir
7374           then
7375                 cf_have_incdir=no
7376                 if test -n "$CFLAGS$CPPFLAGS" ; then
7377                   # a loop is needed to ensure we can add subdirs of existing dirs
7378                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7379                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7380                           cf_have_incdir=yes; break
7381                         fi
7382                   done
7383                 fi
7384
7385                 if test "$cf_have_incdir" = no ; then
7386                   if test "$cf_add_incdir" = /usr/local/include ; then
7387                         if test "$GCC" = yes
7388                         then
7389                           cf_save_CPPFLAGS=$CPPFLAGS
7390                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7391                           cat >conftest.$ac_ext <<_ACEOF
7392 #line 7392 "configure"
7393 #include "confdefs.h"
7394 #include <stdio.h>
7395 int
7396 main ()
7397 {
7398 printf("Hello")
7399   ;
7400   return 0;
7401 }
7402 _ACEOF
7403 rm -f conftest.$ac_objext
7404 if { (eval echo "$as_me:7404: \"$ac_compile\"") >&5
7405   (eval $ac_compile) 2>&5
7406   ac_status=$?
7407   echo "$as_me:7407: \$? = $ac_status" >&5
7408   (exit $ac_status); } &&
7409          { ac_try='test -s conftest.$ac_objext'
7410   { (eval echo "$as_me:7410: \"$ac_try\"") >&5
7411   (eval $ac_try) 2>&5
7412   ac_status=$?
7413   echo "$as_me:7413: \$? = $ac_status" >&5
7414   (exit $ac_status); }; }; then
7415   :
7416 else
7417   echo "$as_me: failed program was:" >&5
7418 cat conftest.$ac_ext >&5
7419 cf_have_incdir=yes
7420 fi
7421 rm -f conftest.$ac_objext conftest.$ac_ext
7422                           CPPFLAGS=$cf_save_CPPFLAGS
7423                         fi
7424                   fi
7425                 fi
7426
7427                 if test "$cf_have_incdir" = no ; then
7428                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7429
7430 echo "${as_me:-configure}:7430: testing adding $cf_add_incdir to include-path ..." 1>&5
7431
7432                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7433
7434                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7435                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7436                   cf_add_incdir="$cf_top_incdir"
7437                 else
7438                   break
7439                 fi
7440           else
7441                 break
7442           fi
7443         done
7444   done
7445 fi
7446
7447 fi
7448
7449 # Set definitions to allow ifdef'ing for ncurses.h
7450
7451 case $cf_cv_ncurses_header in
7452 (*ncurses.h)
7453
7454 cat >>confdefs.h <<\EOF
7455 #define HAVE_NCURSES_H 1
7456 EOF
7457
7458         ;;
7459 esac
7460
7461 case $cf_cv_ncurses_header in
7462 (ncurses/curses.h|ncurses/ncurses.h)
7463
7464 cat >>confdefs.h <<\EOF
7465 #define HAVE_NCURSES_NCURSES_H 1
7466 EOF
7467
7468         ;;
7469 (ncursesw/curses.h|ncursesw/ncurses.h)
7470
7471 cat >>confdefs.h <<\EOF
7472 #define HAVE_NCURSESW_NCURSES_H 1
7473 EOF
7474
7475         ;;
7476 esac
7477
7478 echo "$as_me:7478: checking for terminfo header" >&5
7479 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
7480 if test "${cf_cv_term_header+set}" = set; then
7481   echo $ECHO_N "(cached) $ECHO_C" >&6
7482 else
7483
7484 case ${cf_cv_ncurses_header} in
7485 (*/ncurses.h|*/ncursesw.h)
7486         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
7487         ;;
7488 (*)
7489         cf_term_header=term.h
7490         ;;
7491 esac
7492
7493 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
7494 do
7495 cat >conftest.$ac_ext <<_ACEOF
7496 #line 7496 "configure"
7497 #include "confdefs.h"
7498 #include <stdio.h>
7499 #include <${cf_cv_ncurses_header:-curses.h}>
7500 #include <$cf_test>
7501
7502 int
7503 main ()
7504 {
7505 int x = auto_left_margin
7506   ;
7507   return 0;
7508 }
7509 _ACEOF
7510 rm -f conftest.$ac_objext
7511 if { (eval echo "$as_me:7511: \"$ac_compile\"") >&5
7512   (eval $ac_compile) 2>&5
7513   ac_status=$?
7514   echo "$as_me:7514: \$? = $ac_status" >&5
7515   (exit $ac_status); } &&
7516          { ac_try='test -s conftest.$ac_objext'
7517   { (eval echo "$as_me:7517: \"$ac_try\"") >&5
7518   (eval $ac_try) 2>&5
7519   ac_status=$?
7520   echo "$as_me:7520: \$? = $ac_status" >&5
7521   (exit $ac_status); }; }; then
7522
7523         cf_cv_term_header="$cf_test"
7524 else
7525   echo "$as_me: failed program was:" >&5
7526 cat conftest.$ac_ext >&5
7527
7528         cf_cv_term_header=unknown
7529
7530 fi
7531 rm -f conftest.$ac_objext conftest.$ac_ext
7532         test "$cf_cv_term_header" != unknown && break
7533 done
7534
7535 fi
7536 echo "$as_me:7536: result: $cf_cv_term_header" >&5
7537 echo "${ECHO_T}$cf_cv_term_header" >&6
7538
7539 # Set definitions to allow ifdef'ing to accommodate subdirectories
7540
7541 case $cf_cv_term_header in
7542 (*term.h)
7543
7544 cat >>confdefs.h <<\EOF
7545 #define HAVE_TERM_H 1
7546 EOF
7547
7548         ;;
7549 esac
7550
7551 case $cf_cv_term_header in
7552 (ncurses/term.h)
7553
7554 cat >>confdefs.h <<\EOF
7555 #define HAVE_NCURSES_TERM_H 1
7556 EOF
7557
7558         ;;
7559 (ncursesw/term.h)
7560
7561 cat >>confdefs.h <<\EOF
7562 #define HAVE_NCURSESW_TERM_H 1
7563 EOF
7564
7565         ;;
7566 esac
7567
7568 # some applications need this, but should check for NCURSES_VERSION
7569
7570 cat >>confdefs.h <<\EOF
7571 #define NCURSES 1
7572 EOF
7573
7574 echo "$as_me:7574: checking for ncurses version" >&5
7575 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
7576 if test "${cf_cv_ncurses_version+set}" = set; then
7577   echo $ECHO_N "(cached) $ECHO_C" >&6
7578 else
7579
7580         cf_cv_ncurses_version=no
7581         cf_tempfile=out$$
7582         rm -f $cf_tempfile
7583         if test "$cross_compiling" = yes; then
7584
7585         # This will not work if the preprocessor splits the line after the
7586         # Autoconf token.  The 'unproto' program does that.
7587         cat > conftest.$ac_ext <<EOF
7588 #include <${cf_cv_ncurses_header:-curses.h}>
7589 #undef Autoconf
7590 #ifdef NCURSES_VERSION
7591 Autoconf NCURSES_VERSION
7592 #else
7593 #ifdef __NCURSES_H
7594 Autoconf "old"
7595 #endif
7596 ;
7597 #endif
7598 EOF
7599         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
7600         { (eval echo "$as_me:7600: \"$cf_try\"") >&5
7601   (eval $cf_try) 2>&5
7602   ac_status=$?
7603   echo "$as_me:7603: \$? = $ac_status" >&5
7604   (exit $ac_status); }
7605         if test -f conftest.out ; then
7606                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
7607                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
7608                 rm -f conftest.out
7609         fi
7610
7611 else
7612   cat >conftest.$ac_ext <<_ACEOF
7613 #line 7613 "configure"
7614 #include "confdefs.h"
7615
7616 #include <${cf_cv_ncurses_header:-curses.h}>
7617 #include <stdio.h>
7618 int main()
7619 {
7620         FILE *fp = fopen("$cf_tempfile", "w");
7621 #ifdef NCURSES_VERSION
7622 # ifdef NCURSES_VERSION_PATCH
7623         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
7624 # else
7625         fprintf(fp, "%s\n", NCURSES_VERSION);
7626 # endif
7627 #else
7628 # ifdef __NCURSES_H
7629         fprintf(fp, "old\n");
7630 # else
7631         make an error
7632 # endif
7633 #endif
7634         ${cf_cv_main_return:-return}(0);
7635 }
7636 _ACEOF
7637 rm -f conftest$ac_exeext
7638 if { (eval echo "$as_me:7638: \"$ac_link\"") >&5
7639   (eval $ac_link) 2>&5
7640   ac_status=$?
7641   echo "$as_me:7641: \$? = $ac_status" >&5
7642   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
7643   { (eval echo "$as_me:7643: \"$ac_try\"") >&5
7644   (eval $ac_try) 2>&5
7645   ac_status=$?
7646   echo "$as_me:7646: \$? = $ac_status" >&5
7647   (exit $ac_status); }; }; then
7648
7649         cf_cv_ncurses_version=`cat $cf_tempfile`
7650 else
7651   echo "$as_me: program exited with status $ac_status" >&5
7652 echo "$as_me: failed program was:" >&5
7653 cat conftest.$ac_ext >&5
7654 fi
7655 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
7656 fi
7657         rm -f $cf_tempfile
7658
7659 fi
7660 echo "$as_me:7660: result: $cf_cv_ncurses_version" >&5
7661 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
7662 test "$cf_cv_ncurses_version" = no ||
7663 cat >>confdefs.h <<\EOF
7664 #define NCURSES 1
7665 EOF
7666
7667 cf_nculib_root=$cf_cv_screen
7668         # This works, except for the special case where we find gpm, but
7669         # ncurses is in a nonstandard location via $LIBS, and we really want
7670         # to link gpm.
7671 cf_ncurses_LIBS=""
7672 cf_ncurses_SAVE="$LIBS"
7673 echo "$as_me:7673: checking for Gpm_Open in -lgpm" >&5
7674 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
7675 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
7676   echo $ECHO_N "(cached) $ECHO_C" >&6
7677 else
7678   ac_check_lib_save_LIBS=$LIBS
7679 LIBS="-lgpm  $LIBS"
7680 cat >conftest.$ac_ext <<_ACEOF
7681 #line 7681 "configure"
7682 #include "confdefs.h"
7683
7684 /* Override any gcc2 internal prototype to avoid an error.  */
7685 #ifdef __cplusplus
7686 extern "C"
7687 #endif
7688 /* We use char because int might match the return type of a gcc2
7689    builtin and then its argument prototype would still apply.  */
7690 char Gpm_Open ();
7691 int
7692 main ()
7693 {
7694 Gpm_Open ();
7695   ;
7696   return 0;
7697 }
7698 _ACEOF
7699 rm -f conftest.$ac_objext conftest$ac_exeext
7700 if { (eval echo "$as_me:7700: \"$ac_link\"") >&5
7701   (eval $ac_link) 2>&5
7702   ac_status=$?
7703   echo "$as_me:7703: \$? = $ac_status" >&5
7704   (exit $ac_status); } &&
7705          { ac_try='test -s conftest$ac_exeext'
7706   { (eval echo "$as_me:7706: \"$ac_try\"") >&5
7707   (eval $ac_try) 2>&5
7708   ac_status=$?
7709   echo "$as_me:7709: \$? = $ac_status" >&5
7710   (exit $ac_status); }; }; then
7711   ac_cv_lib_gpm_Gpm_Open=yes
7712 else
7713   echo "$as_me: failed program was:" >&5
7714 cat conftest.$ac_ext >&5
7715 ac_cv_lib_gpm_Gpm_Open=no
7716 fi
7717 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7718 LIBS=$ac_check_lib_save_LIBS
7719 fi
7720 echo "$as_me:7720: result: $ac_cv_lib_gpm_Gpm_Open" >&5
7721 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
7722 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
7723   echo "$as_me:7723: checking for initscr in -lgpm" >&5
7724 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
7725 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
7726   echo $ECHO_N "(cached) $ECHO_C" >&6
7727 else
7728   ac_check_lib_save_LIBS=$LIBS
7729 LIBS="-lgpm  $LIBS"
7730 cat >conftest.$ac_ext <<_ACEOF
7731 #line 7731 "configure"
7732 #include "confdefs.h"
7733
7734 /* Override any gcc2 internal prototype to avoid an error.  */
7735 #ifdef __cplusplus
7736 extern "C"
7737 #endif
7738 /* We use char because int might match the return type of a gcc2
7739    builtin and then its argument prototype would still apply.  */
7740 char initscr ();
7741 int
7742 main ()
7743 {
7744 initscr ();
7745   ;
7746   return 0;
7747 }
7748 _ACEOF
7749 rm -f conftest.$ac_objext conftest$ac_exeext
7750 if { (eval echo "$as_me:7750: \"$ac_link\"") >&5
7751   (eval $ac_link) 2>&5
7752   ac_status=$?
7753   echo "$as_me:7753: \$? = $ac_status" >&5
7754   (exit $ac_status); } &&
7755          { ac_try='test -s conftest$ac_exeext'
7756   { (eval echo "$as_me:7756: \"$ac_try\"") >&5
7757   (eval $ac_try) 2>&5
7758   ac_status=$?
7759   echo "$as_me:7759: \$? = $ac_status" >&5
7760   (exit $ac_status); }; }; then
7761   ac_cv_lib_gpm_initscr=yes
7762 else
7763   echo "$as_me: failed program was:" >&5
7764 cat conftest.$ac_ext >&5
7765 ac_cv_lib_gpm_initscr=no
7766 fi
7767 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7768 LIBS=$ac_check_lib_save_LIBS
7769 fi
7770 echo "$as_me:7770: result: $ac_cv_lib_gpm_initscr" >&5
7771 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
7772 if test $ac_cv_lib_gpm_initscr = yes; then
7773   LIBS="$cf_ncurses_SAVE"
7774 else
7775   cf_ncurses_LIBS="-lgpm"
7776 fi
7777
7778 fi
7779
7780 case $host_os in
7781 (freebsd*)
7782         # This is only necessary if you are linking against an obsolete
7783         # version of ncurses (but it should do no harm, since it's static).
7784         if test "$cf_nculib_root" = ncurses ; then
7785                 echo "$as_me:7785: checking for tgoto in -lmytinfo" >&5
7786 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
7787 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
7788   echo $ECHO_N "(cached) $ECHO_C" >&6
7789 else
7790   ac_check_lib_save_LIBS=$LIBS
7791 LIBS="-lmytinfo  $LIBS"
7792 cat >conftest.$ac_ext <<_ACEOF
7793 #line 7793 "configure"
7794 #include "confdefs.h"
7795
7796 /* Override any gcc2 internal prototype to avoid an error.  */
7797 #ifdef __cplusplus
7798 extern "C"
7799 #endif
7800 /* We use char because int might match the return type of a gcc2
7801    builtin and then its argument prototype would still apply.  */
7802 char tgoto ();
7803 int
7804 main ()
7805 {
7806 tgoto ();
7807   ;
7808   return 0;
7809 }
7810 _ACEOF
7811 rm -f conftest.$ac_objext conftest$ac_exeext
7812 if { (eval echo "$as_me:7812: \"$ac_link\"") >&5
7813   (eval $ac_link) 2>&5
7814   ac_status=$?
7815   echo "$as_me:7815: \$? = $ac_status" >&5
7816   (exit $ac_status); } &&
7817          { ac_try='test -s conftest$ac_exeext'
7818   { (eval echo "$as_me:7818: \"$ac_try\"") >&5
7819   (eval $ac_try) 2>&5
7820   ac_status=$?
7821   echo "$as_me:7821: \$? = $ac_status" >&5
7822   (exit $ac_status); }; }; then
7823   ac_cv_lib_mytinfo_tgoto=yes
7824 else
7825   echo "$as_me: failed program was:" >&5
7826 cat conftest.$ac_ext >&5
7827 ac_cv_lib_mytinfo_tgoto=no
7828 fi
7829 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7830 LIBS=$ac_check_lib_save_LIBS
7831 fi
7832 echo "$as_me:7832: result: $ac_cv_lib_mytinfo_tgoto" >&5
7833 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
7834 if test $ac_cv_lib_mytinfo_tgoto = yes; then
7835   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
7836 fi
7837
7838         fi
7839         ;;
7840 esac
7841
7842 cf_add_libs="$cf_ncurses_LIBS"
7843 # Filter out duplicates - this happens with badly-designed ".pc" files...
7844 for cf_add_1lib in $LIBS
7845 do
7846         for cf_add_2lib in $cf_add_libs
7847         do
7848                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7849                 then
7850                         cf_add_1lib=
7851                         break
7852                 fi
7853         done
7854         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7855 done
7856 LIBS="$cf_add_libs"
7857
7858 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
7859 then
7860
7861 cf_add_libs="-l$cf_nculib_root"
7862 # Filter out duplicates - this happens with badly-designed ".pc" files...
7863 for cf_add_1lib in $LIBS
7864 do
7865         for cf_add_2lib in $cf_add_libs
7866         do
7867                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7868                 then
7869                         cf_add_1lib=
7870                         break
7871                 fi
7872         done
7873         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7874 done
7875 LIBS="$cf_add_libs"
7876
7877 else
7878
7879         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
7880         cf_libdir=""
7881         echo "$as_me:7881: checking for initscr" >&5
7882 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
7883 if test "${ac_cv_func_initscr+set}" = set; then
7884   echo $ECHO_N "(cached) $ECHO_C" >&6
7885 else
7886   cat >conftest.$ac_ext <<_ACEOF
7887 #line 7887 "configure"
7888 #include "confdefs.h"
7889 /* System header to define __stub macros and hopefully few prototypes,
7890     which can conflict with char initscr (); below.  */
7891 #include <assert.h>
7892 /* Override any gcc2 internal prototype to avoid an error.  */
7893 #ifdef __cplusplus
7894 extern "C"
7895 #endif
7896 /* We use char because int might match the return type of a gcc2
7897    builtin and then its argument prototype would still apply.  */
7898 char initscr ();
7899 char (*f) ();
7900
7901 int
7902 main ()
7903 {
7904 /* The GNU C library defines this for functions which it implements
7905     to always fail with ENOSYS.  Some functions are actually named
7906     something starting with __ and the normal name is an alias.  */
7907 #if defined (__stub_initscr) || defined (__stub___initscr)
7908 choke me
7909 #else
7910 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
7911 #endif
7912
7913   ;
7914   return 0;
7915 }
7916 _ACEOF
7917 rm -f conftest.$ac_objext conftest$ac_exeext
7918 if { (eval echo "$as_me:7918: \"$ac_link\"") >&5
7919   (eval $ac_link) 2>&5
7920   ac_status=$?
7921   echo "$as_me:7921: \$? = $ac_status" >&5
7922   (exit $ac_status); } &&
7923          { ac_try='test -s conftest$ac_exeext'
7924   { (eval echo "$as_me:7924: \"$ac_try\"") >&5
7925   (eval $ac_try) 2>&5
7926   ac_status=$?
7927   echo "$as_me:7927: \$? = $ac_status" >&5
7928   (exit $ac_status); }; }; then
7929   ac_cv_func_initscr=yes
7930 else
7931   echo "$as_me: failed program was:" >&5
7932 cat conftest.$ac_ext >&5
7933 ac_cv_func_initscr=no
7934 fi
7935 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7936 fi
7937 echo "$as_me:7937: result: $ac_cv_func_initscr" >&5
7938 echo "${ECHO_T}$ac_cv_func_initscr" >&6
7939 if test $ac_cv_func_initscr = yes; then
7940   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
7941 else
7942
7943                 cf_save_LIBS="$LIBS"
7944                 echo "$as_me:7944: checking for initscr in -l$cf_nculib_root" >&5
7945 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
7946                 LIBS="-l$cf_nculib_root $LIBS"
7947                 cat >conftest.$ac_ext <<_ACEOF
7948 #line 7948 "configure"
7949 #include "confdefs.h"
7950 #include <${cf_cv_ncurses_header:-curses.h}>
7951 int
7952 main ()
7953 {
7954 initscr()
7955   ;
7956   return 0;
7957 }
7958 _ACEOF
7959 rm -f conftest.$ac_objext conftest$ac_exeext
7960 if { (eval echo "$as_me:7960: \"$ac_link\"") >&5
7961   (eval $ac_link) 2>&5
7962   ac_status=$?
7963   echo "$as_me:7963: \$? = $ac_status" >&5
7964   (exit $ac_status); } &&
7965          { ac_try='test -s conftest$ac_exeext'
7966   { (eval echo "$as_me:7966: \"$ac_try\"") >&5
7967   (eval $ac_try) 2>&5
7968   ac_status=$?
7969   echo "$as_me:7969: \$? = $ac_status" >&5
7970   (exit $ac_status); }; }; then
7971   echo "$as_me:7971: result: yes" >&5
7972 echo "${ECHO_T}yes" >&6
7973                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
7974
7975 else
7976   echo "$as_me: failed program was:" >&5
7977 cat conftest.$ac_ext >&5
7978 echo "$as_me:7978: result: no" >&5
7979 echo "${ECHO_T}no" >&6
7980
7981 cf_search=
7982 cf_library_path_list=""
7983 if test -n "${LDFLAGS}${LIBS}" ; then
7984         for cf_library_path in $LDFLAGS $LIBS
7985         do
7986                 case $cf_library_path in
7987                 (-L*)
7988                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
7989
7990 test "x$cf_library_path" != "xNONE" && \
7991 test -d "$cf_library_path" && \
7992  {
7993         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
7994         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
7995         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
7996         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
7997         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
7998         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"
7999 }
8000
8001                         cf_library_path_list="$cf_library_path_list $cf_search"
8002                         ;;
8003                 esac
8004         done
8005 fi
8006
8007 cf_search=
8008
8009 test "x$prefix" != "xNONE" && \
8010 test -d "$prefix" && \
8011  {
8012         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
8013         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
8014         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
8015         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
8016         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
8017         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
8018 }
8019
8020 for cf_subdir_prefix in \
8021         /usr \
8022         /usr/local \
8023         /usr/pkg \
8024         /opt \
8025         /opt/local \
8026         $HOME
8027 do
8028
8029 test "x$cf_subdir_prefix" != "x$prefix" && \
8030 test -d "$cf_subdir_prefix" && \
8031 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
8032         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
8033         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
8034         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
8035         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
8036         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
8037         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"
8038 }
8039
8040 done
8041
8042 cf_search="$cf_library_path_list $cf_search"
8043
8044                         for cf_libdir in $cf_search
8045                         do
8046                                 echo "$as_me:8046: checking for -l$cf_nculib_root in $cf_libdir" >&5
8047 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
8048                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
8049                                 cat >conftest.$ac_ext <<_ACEOF
8050 #line 8050 "configure"
8051 #include "confdefs.h"
8052 #include <${cf_cv_ncurses_header:-curses.h}>
8053 int
8054 main ()
8055 {
8056 initscr()
8057   ;
8058   return 0;
8059 }
8060 _ACEOF
8061 rm -f conftest.$ac_objext conftest$ac_exeext
8062 if { (eval echo "$as_me:8062: \"$ac_link\"") >&5
8063   (eval $ac_link) 2>&5
8064   ac_status=$?
8065   echo "$as_me:8065: \$? = $ac_status" >&5
8066   (exit $ac_status); } &&
8067          { ac_try='test -s conftest$ac_exeext'
8068   { (eval echo "$as_me:8068: \"$ac_try\"") >&5
8069   (eval $ac_try) 2>&5
8070   ac_status=$?
8071   echo "$as_me:8071: \$? = $ac_status" >&5
8072   (exit $ac_status); }; }; then
8073   echo "$as_me:8073: result: yes" >&5
8074 echo "${ECHO_T}yes" >&6
8075                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8076                                          break
8077 else
8078   echo "$as_me: failed program was:" >&5
8079 cat conftest.$ac_ext >&5
8080 echo "$as_me:8080: result: no" >&5
8081 echo "${ECHO_T}no" >&6
8082                                          LIBS="$cf_save_LIBS"
8083 fi
8084 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8085                         done
8086
8087 fi
8088 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8089
8090 fi
8091
8092 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
8093
8094 if test $cf_found_library = no ; then
8095         { { echo "$as_me:8095: error: Cannot link $cf_nculib_root library" >&5
8096 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
8097    { (exit 1); exit 1; }; }
8098 fi
8099
8100 fi
8101
8102 if test -n "$cf_ncurses_LIBS" ; then
8103         echo "$as_me:8103: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
8104 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
8105         cf_ncurses_SAVE="$LIBS"
8106         for p in $cf_ncurses_LIBS ; do
8107                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
8108                 if test "$q" != "$LIBS" ; then
8109                         LIBS="$q"
8110                 fi
8111         done
8112         cat >conftest.$ac_ext <<_ACEOF
8113 #line 8113 "configure"
8114 #include "confdefs.h"
8115 #include <${cf_cv_ncurses_header:-curses.h}>
8116 int
8117 main ()
8118 {
8119 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
8120   ;
8121   return 0;
8122 }
8123 _ACEOF
8124 rm -f conftest.$ac_objext conftest$ac_exeext
8125 if { (eval echo "$as_me:8125: \"$ac_link\"") >&5
8126   (eval $ac_link) 2>&5
8127   ac_status=$?
8128   echo "$as_me:8128: \$? = $ac_status" >&5
8129   (exit $ac_status); } &&
8130          { ac_try='test -s conftest$ac_exeext'
8131   { (eval echo "$as_me:8131: \"$ac_try\"") >&5
8132   (eval $ac_try) 2>&5
8133   ac_status=$?
8134   echo "$as_me:8134: \$? = $ac_status" >&5
8135   (exit $ac_status); }; }; then
8136   echo "$as_me:8136: result: yes" >&5
8137 echo "${ECHO_T}yes" >&6
8138 else
8139   echo "$as_me: failed program was:" >&5
8140 cat conftest.$ac_ext >&5
8141 echo "$as_me:8141: result: no" >&5
8142 echo "${ECHO_T}no" >&6
8143                  LIBS="$cf_ncurses_SAVE"
8144 fi
8145 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8146 fi
8147
8148 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
8149
8150 cat >>confdefs.h <<EOF
8151 #define $cf_nculib_ROOT 1
8152 EOF
8153
8154         fi
8155 else
8156         NCURSES_CONFIG=none
8157 fi
8158
8159         ;;
8160 (ncurses*)
8161
8162 cf_ncuconfig_root=$cf_cv_screen
8163 cf_have_ncuconfig=no
8164
8165 if test "x${PKG_CONFIG:=none}" != xnone; then
8166         echo "$as_me:8166: checking pkg-config for $cf_ncuconfig_root" >&5
8167 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
8168         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
8169                 echo "$as_me:8169: result: yes" >&5
8170 echo "${ECHO_T}yes" >&6
8171
8172                 echo "$as_me:8172: checking if the $cf_ncuconfig_root package files work" >&5
8173 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
8174                 cf_have_ncuconfig=unknown
8175
8176                 cf_save_CPPFLAGS="$CPPFLAGS"
8177                 cf_save_LIBS="$LIBS"
8178
8179                 CPPFLAGS="$CPPFLAGS `$PKG_CONFIG --cflags $cf_ncuconfig_root`"
8180
8181 cf_add_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
8182 # Filter out duplicates - this happens with badly-designed ".pc" files...
8183 for cf_add_1lib in $LIBS
8184 do
8185         for cf_add_2lib in $cf_add_libs
8186         do
8187                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
8188                 then
8189                         cf_add_1lib=
8190                         break
8191                 fi
8192         done
8193         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
8194 done
8195 LIBS="$cf_add_libs"
8196
8197                 cat >conftest.$ac_ext <<_ACEOF
8198 #line 8198 "configure"
8199 #include "confdefs.h"
8200 #include <${cf_cv_ncurses_header:-curses.h}>
8201 int
8202 main ()
8203 {
8204 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
8205   ;
8206   return 0;
8207 }
8208 _ACEOF
8209 rm -f conftest.$ac_objext conftest$ac_exeext
8210 if { (eval echo "$as_me:8210: \"$ac_link\"") >&5
8211   (eval $ac_link) 2>&5
8212   ac_status=$?
8213   echo "$as_me:8213: \$? = $ac_status" >&5
8214   (exit $ac_status); } &&
8215          { ac_try='test -s conftest$ac_exeext'
8216   { (eval echo "$as_me:8216: \"$ac_try\"") >&5
8217   (eval $ac_try) 2>&5
8218   ac_status=$?
8219   echo "$as_me:8219: \$? = $ac_status" >&5
8220   (exit $ac_status); }; }; then
8221   if test "$cross_compiling" = yes; then
8222   cf_have_ncuconfig=maybe
8223 else
8224   cat >conftest.$ac_ext <<_ACEOF
8225 #line 8225 "configure"
8226 #include "confdefs.h"
8227 #include <${cf_cv_ncurses_header:-curses.h}>
8228                                 int main(void)
8229                                 { char *xx = curses_version(); return (xx == 0); }
8230 _ACEOF
8231 rm -f conftest$ac_exeext
8232 if { (eval echo "$as_me:8232: \"$ac_link\"") >&5
8233   (eval $ac_link) 2>&5
8234   ac_status=$?
8235   echo "$as_me:8235: \$? = $ac_status" >&5
8236   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
8237   { (eval echo "$as_me:8237: \"$ac_try\"") >&5
8238   (eval $ac_try) 2>&5
8239   ac_status=$?
8240   echo "$as_me:8240: \$? = $ac_status" >&5
8241   (exit $ac_status); }; }; then
8242   cf_have_ncuconfig=yes
8243 else
8244   echo "$as_me: program exited with status $ac_status" >&5
8245 echo "$as_me: failed program was:" >&5
8246 cat conftest.$ac_ext >&5
8247 cf_have_ncuconfig=no
8248 fi
8249 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
8250 fi
8251 else
8252   echo "$as_me: failed program was:" >&5
8253 cat conftest.$ac_ext >&5
8254 cf_have_ncuconfig=no
8255 fi
8256 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8257                 echo "$as_me:8257: result: $cf_have_ncuconfig" >&5
8258 echo "${ECHO_T}$cf_have_ncuconfig" >&6
8259                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
8260                 if test "$cf_have_ncuconfig" != "yes"
8261                 then
8262                         CPPFLAGS="$cf_save_CPPFLAGS"
8263                         LIBS="$cf_save_LIBS"
8264                         NCURSES_CONFIG_PKG=none
8265                 else
8266
8267 cat >>confdefs.h <<\EOF
8268 #define NCURSES 1
8269 EOF
8270
8271                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
8272                 fi
8273
8274         else
8275                 echo "$as_me:8275: result: no" >&5
8276 echo "${ECHO_T}no" >&6
8277                 NCURSES_CONFIG_PKG=none
8278         fi
8279 else
8280         NCURSES_CONFIG_PKG=none
8281 fi
8282
8283 if test "x$cf_have_ncuconfig" = "xno"; then
8284         echo "Looking for ${cf_ncuconfig_root}-config"
8285
8286 if test -n "$ac_tool_prefix"; then
8287   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
8288   do
8289     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
8290 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
8291 echo "$as_me:8291: checking for $ac_word" >&5
8292 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
8293 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
8294   echo $ECHO_N "(cached) $ECHO_C" >&6
8295 else
8296   if test -n "$NCURSES_CONFIG"; then
8297   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
8298 else
8299   ac_save_IFS=$IFS; IFS=$ac_path_separator
8300 ac_dummy="$PATH"
8301 for ac_dir in $ac_dummy; do
8302   IFS=$ac_save_IFS
8303   test -z "$ac_dir" && ac_dir=.
8304   $as_executable_p "$ac_dir/$ac_word" || continue
8305 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
8306 echo "$as_me:8306: found $ac_dir/$ac_word" >&5
8307 break
8308 done
8309
8310 fi
8311 fi
8312 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
8313 if test -n "$NCURSES_CONFIG"; then
8314   echo "$as_me:8314: result: $NCURSES_CONFIG" >&5
8315 echo "${ECHO_T}$NCURSES_CONFIG" >&6
8316 else
8317   echo "$as_me:8317: result: no" >&5
8318 echo "${ECHO_T}no" >&6
8319 fi
8320
8321     test -n "$NCURSES_CONFIG" && break
8322   done
8323 fi
8324 if test -z "$NCURSES_CONFIG"; then
8325   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
8326   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
8327 do
8328   # Extract the first word of "$ac_prog", so it can be a program name with args.
8329 set dummy $ac_prog; ac_word=$2
8330 echo "$as_me:8330: checking for $ac_word" >&5
8331 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
8332 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
8333   echo $ECHO_N "(cached) $ECHO_C" >&6
8334 else
8335   if test -n "$ac_ct_NCURSES_CONFIG"; then
8336   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
8337 else
8338   ac_save_IFS=$IFS; IFS=$ac_path_separator
8339 ac_dummy="$PATH"
8340 for ac_dir in $ac_dummy; do
8341   IFS=$ac_save_IFS
8342   test -z "$ac_dir" && ac_dir=.
8343   $as_executable_p "$ac_dir/$ac_word" || continue
8344 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
8345 echo "$as_me:8345: found $ac_dir/$ac_word" >&5
8346 break
8347 done
8348
8349 fi
8350 fi
8351 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
8352 if test -n "$ac_ct_NCURSES_CONFIG"; then
8353   echo "$as_me:8353: result: $ac_ct_NCURSES_CONFIG" >&5
8354 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
8355 else
8356   echo "$as_me:8356: result: no" >&5
8357 echo "${ECHO_T}no" >&6
8358 fi
8359
8360   test -n "$ac_ct_NCURSES_CONFIG" && break
8361 done
8362 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
8363
8364   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
8365 fi
8366
8367         if test "$NCURSES_CONFIG" != none ; then
8368
8369                 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
8370
8371 cf_add_libs="`$NCURSES_CONFIG --libs`"
8372 # Filter out duplicates - this happens with badly-designed ".pc" files...
8373 for cf_add_1lib in $LIBS
8374 do
8375         for cf_add_2lib in $cf_add_libs
8376         do
8377                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
8378                 then
8379                         cf_add_1lib=
8380                         break
8381                 fi
8382         done
8383         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
8384 done
8385 LIBS="$cf_add_libs"
8386
8387                 # even with config script, some packages use no-override for curses.h
8388
8389 echo "$as_me:8389: checking if we have identified curses headers" >&5
8390 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
8391 if test "${cf_cv_ncurses_header+set}" = set; then
8392   echo $ECHO_N "(cached) $ECHO_C" >&6
8393 else
8394
8395 cf_cv_ncurses_header=none
8396 for cf_header in \
8397         ncurses.h $cf_cv_screen/ncurses.h \
8398         curses.h $cf_cv_screen/curses.h
8399 do
8400 cat >conftest.$ac_ext <<_ACEOF
8401 #line 8401 "configure"
8402 #include "confdefs.h"
8403 #include <${cf_header}>
8404 int
8405 main ()
8406 {
8407 initscr(); tgoto("?", 0,0)
8408   ;
8409   return 0;
8410 }
8411 _ACEOF
8412 rm -f conftest.$ac_objext
8413 if { (eval echo "$as_me:8413: \"$ac_compile\"") >&5
8414   (eval $ac_compile) 2>&5
8415   ac_status=$?
8416   echo "$as_me:8416: \$? = $ac_status" >&5
8417   (exit $ac_status); } &&
8418          { ac_try='test -s conftest.$ac_objext'
8419   { (eval echo "$as_me:8419: \"$ac_try\"") >&5
8420   (eval $ac_try) 2>&5
8421   ac_status=$?
8422   echo "$as_me:8422: \$? = $ac_status" >&5
8423   (exit $ac_status); }; }; then
8424   cf_cv_ncurses_header=$cf_header; break
8425 else
8426   echo "$as_me: failed program was:" >&5
8427 cat conftest.$ac_ext >&5
8428 fi
8429 rm -f conftest.$ac_objext conftest.$ac_ext
8430 done
8431
8432 fi
8433 echo "$as_me:8433: result: $cf_cv_ncurses_header" >&5
8434 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
8435
8436 if test "$cf_cv_ncurses_header" = none ; then
8437         { { echo "$as_me:8437: error: No curses header-files found" >&5
8438 echo "$as_me: error: No curses header-files found" >&2;}
8439    { (exit 1); exit 1; }; }
8440 fi
8441
8442 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
8443
8444 for ac_header in $cf_cv_ncurses_header
8445 do
8446 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
8447 echo "$as_me:8447: checking for $ac_header" >&5
8448 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
8449 if eval "test \"\${$as_ac_Header+set}\" = set"; then
8450   echo $ECHO_N "(cached) $ECHO_C" >&6
8451 else
8452   cat >conftest.$ac_ext <<_ACEOF
8453 #line 8453 "configure"
8454 #include "confdefs.h"
8455 #include <$ac_header>
8456 _ACEOF
8457 if { (eval echo "$as_me:8457: \"$ac_cpp conftest.$ac_ext\"") >&5
8458   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
8459   ac_status=$?
8460   egrep -v '^ *\+' conftest.er1 >conftest.err
8461   rm -f conftest.er1
8462   cat conftest.err >&5
8463   echo "$as_me:8463: \$? = $ac_status" >&5
8464   (exit $ac_status); } >/dev/null; then
8465   if test -s conftest.err; then
8466     ac_cpp_err=$ac_c_preproc_warn_flag
8467   else
8468     ac_cpp_err=
8469   fi
8470 else
8471   ac_cpp_err=yes
8472 fi
8473 if test -z "$ac_cpp_err"; then
8474   eval "$as_ac_Header=yes"
8475 else
8476   echo "$as_me: failed program was:" >&5
8477   cat conftest.$ac_ext >&5
8478   eval "$as_ac_Header=no"
8479 fi
8480 rm -f conftest.err conftest.$ac_ext
8481 fi
8482 echo "$as_me:8482: result: `eval echo '${'$as_ac_Header'}'`" >&5
8483 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
8484 if test `eval echo '${'$as_ac_Header'}'` = yes; then
8485   cat >>confdefs.h <<EOF
8486 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
8487 EOF
8488
8489 fi
8490 done
8491
8492 cat >>confdefs.h <<\EOF
8493 #define NCURSES 1
8494 EOF
8495
8496 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
8497
8498                 cat >>confdefs.h <<EOF
8499 #define $cf_nculib_ROOT 1
8500 EOF
8501
8502                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
8503
8504         else
8505
8506 cf_ncuhdr_root=$cf_cv_screen
8507
8508 test -n "$cf_cv_curses_dir" && \
8509 test "$cf_cv_curses_dir" != "no" && { \
8510
8511 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
8512   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
8513   do
8514         while test $cf_add_incdir != /usr/include
8515         do
8516           if test -d $cf_add_incdir
8517           then
8518                 cf_have_incdir=no
8519                 if test -n "$CFLAGS$CPPFLAGS" ; then
8520                   # a loop is needed to ensure we can add subdirs of existing dirs
8521                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8522                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8523                           cf_have_incdir=yes; break
8524                         fi
8525                   done
8526                 fi
8527
8528                 if test "$cf_have_incdir" = no ; then
8529                   if test "$cf_add_incdir" = /usr/local/include ; then
8530                         if test "$GCC" = yes
8531                         then
8532                           cf_save_CPPFLAGS=$CPPFLAGS
8533                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8534                           cat >conftest.$ac_ext <<_ACEOF
8535 #line 8535 "configure"
8536 #include "confdefs.h"
8537 #include <stdio.h>
8538 int
8539 main ()
8540 {
8541 printf("Hello")
8542   ;
8543   return 0;
8544 }
8545 _ACEOF
8546 rm -f conftest.$ac_objext
8547 if { (eval echo "$as_me:8547: \"$ac_compile\"") >&5
8548   (eval $ac_compile) 2>&5
8549   ac_status=$?
8550   echo "$as_me:8550: \$? = $ac_status" >&5
8551   (exit $ac_status); } &&
8552          { ac_try='test -s conftest.$ac_objext'
8553   { (eval echo "$as_me:8553: \"$ac_try\"") >&5
8554   (eval $ac_try) 2>&5
8555   ac_status=$?
8556   echo "$as_me:8556: \$? = $ac_status" >&5
8557   (exit $ac_status); }; }; then
8558   :
8559 else
8560   echo "$as_me: failed program was:" >&5
8561 cat conftest.$ac_ext >&5
8562 cf_have_incdir=yes
8563 fi
8564 rm -f conftest.$ac_objext conftest.$ac_ext
8565                           CPPFLAGS=$cf_save_CPPFLAGS
8566                         fi
8567                   fi
8568                 fi
8569
8570                 if test "$cf_have_incdir" = no ; then
8571                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8572
8573 echo "${as_me:-configure}:8573: testing adding $cf_add_incdir to include-path ..." 1>&5
8574
8575                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8576
8577                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8578                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8579                   cf_add_incdir="$cf_top_incdir"
8580                 else
8581                   break
8582                 fi
8583           else
8584                 break
8585           fi
8586         done
8587   done
8588 fi
8589
8590 }
8591
8592 echo "$as_me:8592: checking for $cf_ncuhdr_root header in include-path" >&5
8593 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
8594 if test "${cf_cv_ncurses_h+set}" = set; then
8595   echo $ECHO_N "(cached) $ECHO_C" >&6
8596 else
8597
8598         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
8599         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
8600         for cf_header in $cf_header_list
8601         do
8602
8603         cat >conftest.$ac_ext <<_ACEOF
8604 #line 8604 "configure"
8605 #include "confdefs.h"
8606
8607 #include <$cf_header>
8608 int
8609 main ()
8610 {
8611
8612 #ifdef NCURSES_VERSION
8613
8614 printf("%s\n", NCURSES_VERSION);
8615 #else
8616 #ifdef __NCURSES_H
8617 printf("old\n");
8618 #else
8619         make an error
8620 #endif
8621 #endif
8622
8623   ;
8624   return 0;
8625 }
8626 _ACEOF
8627 rm -f conftest.$ac_objext
8628 if { (eval echo "$as_me:8628: \"$ac_compile\"") >&5
8629   (eval $ac_compile) 2>&5
8630   ac_status=$?
8631   echo "$as_me:8631: \$? = $ac_status" >&5
8632   (exit $ac_status); } &&
8633          { ac_try='test -s conftest.$ac_objext'
8634   { (eval echo "$as_me:8634: \"$ac_try\"") >&5
8635   (eval $ac_try) 2>&5
8636   ac_status=$?
8637   echo "$as_me:8637: \$? = $ac_status" >&5
8638   (exit $ac_status); }; }; then
8639   cf_cv_ncurses_h=$cf_header
8640
8641 else
8642   echo "$as_me: failed program was:" >&5
8643 cat conftest.$ac_ext >&5
8644 cf_cv_ncurses_h=no
8645 fi
8646 rm -f conftest.$ac_objext conftest.$ac_ext
8647
8648                 test "$cf_cv_ncurses_h" != no && break
8649         done
8650
8651 fi
8652 echo "$as_me:8652: result: $cf_cv_ncurses_h" >&5
8653 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
8654
8655 if test "$cf_cv_ncurses_h" != no ; then
8656         cf_cv_ncurses_header=$cf_cv_ncurses_h
8657 else
8658
8659 echo "$as_me:8659: checking for $cf_ncuhdr_root include-path" >&5
8660 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
8661 if test "${cf_cv_ncurses_h2+set}" = set; then
8662   echo $ECHO_N "(cached) $ECHO_C" >&6
8663 else
8664
8665         test -n "$verbose" && echo
8666
8667 cf_search=
8668
8669 # collect the current set of include-directories from compiler flags
8670 cf_header_path_list=""
8671 if test -n "${CFLAGS}${CPPFLAGS}" ; then
8672         for cf_header_path in $CPPFLAGS $CFLAGS
8673         do
8674                 case $cf_header_path in
8675                 (-I*)
8676                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
8677
8678 test "x$cf_header_path" != "xNONE" && \
8679 test -d "$cf_header_path" && \
8680  {
8681         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
8682         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
8683         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
8684         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
8685         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
8686         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"
8687 }
8688
8689                         cf_header_path_list="$cf_header_path_list $cf_search"
8690                         ;;
8691                 esac
8692         done
8693 fi
8694
8695 # add the variations for the package we are looking for
8696
8697 cf_search=
8698
8699 test "x$prefix" != "xNONE" && \
8700 test -d "$prefix" && \
8701  {
8702         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
8703         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
8704         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
8705         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
8706         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
8707         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8708 }
8709
8710 for cf_subdir_prefix in \
8711         /usr \
8712         /usr/local \
8713         /usr/pkg \
8714         /opt \
8715         /opt/local \
8716         $HOME
8717 do
8718
8719 test "x$cf_subdir_prefix" != "x$prefix" && \
8720 test -d "$cf_subdir_prefix" && \
8721 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
8722         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
8723         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
8724         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
8725         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
8726         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
8727         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"
8728 }
8729
8730 done
8731
8732 test "$includedir" != NONE && \
8733 test "$includedir" != "/usr/include" && \
8734 test -d "$includedir" && {
8735         test -d $includedir &&    cf_search="$cf_search $includedir"
8736         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
8737 }
8738
8739 test "$oldincludedir" != NONE && \
8740 test "$oldincludedir" != "/usr/include" && \
8741 test -d "$oldincludedir" && {
8742         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
8743         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
8744 }
8745
8746 cf_search="$cf_search $cf_header_path_list"
8747
8748         test -n "$verbose" && echo search path $cf_search
8749         cf_save2_CPPFLAGS="$CPPFLAGS"
8750         for cf_incdir in $cf_search
8751         do
8752
8753 if test -n "$cf_incdir" ; then
8754   for cf_add_incdir in $cf_incdir
8755   do
8756         while test $cf_add_incdir != /usr/include
8757         do
8758           if test -d $cf_add_incdir
8759           then
8760                 cf_have_incdir=no
8761                 if test -n "$CFLAGS$CPPFLAGS" ; then
8762                   # a loop is needed to ensure we can add subdirs of existing dirs
8763                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8764                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8765                           cf_have_incdir=yes; break
8766                         fi
8767                   done
8768                 fi
8769
8770                 if test "$cf_have_incdir" = no ; then
8771                   if test "$cf_add_incdir" = /usr/local/include ; then
8772                         if test "$GCC" = yes
8773                         then
8774                           cf_save_CPPFLAGS=$CPPFLAGS
8775                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8776                           cat >conftest.$ac_ext <<_ACEOF
8777 #line 8777 "configure"
8778 #include "confdefs.h"
8779 #include <stdio.h>
8780 int
8781 main ()
8782 {
8783 printf("Hello")
8784   ;
8785   return 0;
8786 }
8787 _ACEOF
8788 rm -f conftest.$ac_objext
8789 if { (eval echo "$as_me:8789: \"$ac_compile\"") >&5
8790   (eval $ac_compile) 2>&5
8791   ac_status=$?
8792   echo "$as_me:8792: \$? = $ac_status" >&5
8793   (exit $ac_status); } &&
8794          { ac_try='test -s conftest.$ac_objext'
8795   { (eval echo "$as_me:8795: \"$ac_try\"") >&5
8796   (eval $ac_try) 2>&5
8797   ac_status=$?
8798   echo "$as_me:8798: \$? = $ac_status" >&5
8799   (exit $ac_status); }; }; then
8800   :
8801 else
8802   echo "$as_me: failed program was:" >&5
8803 cat conftest.$ac_ext >&5
8804 cf_have_incdir=yes
8805 fi
8806 rm -f conftest.$ac_objext conftest.$ac_ext
8807                           CPPFLAGS=$cf_save_CPPFLAGS
8808                         fi
8809                   fi
8810                 fi
8811
8812                 if test "$cf_have_incdir" = no ; then
8813                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8814
8815 echo "${as_me:-configure}:8815: testing adding $cf_add_incdir to include-path ..." 1>&5
8816
8817                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8818
8819                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8820                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8821                   cf_add_incdir="$cf_top_incdir"
8822                 else
8823                   break
8824                 fi
8825           else
8826                 break
8827           fi
8828         done
8829   done
8830 fi
8831
8832                 for cf_header in \
8833                         ncurses.h \
8834                         curses.h
8835                 do
8836
8837         cat >conftest.$ac_ext <<_ACEOF
8838 #line 8838 "configure"
8839 #include "confdefs.h"
8840
8841 #include <$cf_header>
8842 int
8843 main ()
8844 {
8845
8846 #ifdef NCURSES_VERSION
8847
8848 printf("%s\n", NCURSES_VERSION);
8849 #else
8850 #ifdef __NCURSES_H
8851 printf("old\n");
8852 #else
8853         make an error
8854 #endif
8855 #endif
8856
8857   ;
8858   return 0;
8859 }
8860 _ACEOF
8861 rm -f conftest.$ac_objext
8862 if { (eval echo "$as_me:8862: \"$ac_compile\"") >&5
8863   (eval $ac_compile) 2>&5
8864   ac_status=$?
8865   echo "$as_me:8865: \$? = $ac_status" >&5
8866   (exit $ac_status); } &&
8867          { ac_try='test -s conftest.$ac_objext'
8868   { (eval echo "$as_me:8868: \"$ac_try\"") >&5
8869   (eval $ac_try) 2>&5
8870   ac_status=$?
8871   echo "$as_me:8871: \$? = $ac_status" >&5
8872   (exit $ac_status); }; }; then
8873   cf_cv_ncurses_h2=$cf_header
8874
8875 else
8876   echo "$as_me: failed program was:" >&5
8877 cat conftest.$ac_ext >&5
8878 cf_cv_ncurses_h2=no
8879 fi
8880 rm -f conftest.$ac_objext conftest.$ac_ext
8881
8882                         if test "$cf_cv_ncurses_h2" != no ; then
8883                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
8884                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
8885                                 break
8886                         fi
8887                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
8888                 done
8889                 CPPFLAGS="$cf_save2_CPPFLAGS"
8890                 test "$cf_cv_ncurses_h2" != no && break
8891         done
8892         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:8892: error: not found" >&5
8893 echo "$as_me: error: not found" >&2;}
8894    { (exit 1); exit 1; }; }
8895
8896 fi
8897 echo "$as_me:8897: result: $cf_cv_ncurses_h2" >&5
8898 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
8899
8900         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
8901         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
8902         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
8903                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
8904         fi
8905
8906 if test -n "$cf_1st_incdir" ; then
8907   for cf_add_incdir in $cf_1st_incdir
8908   do
8909         while test $cf_add_incdir != /usr/include
8910         do
8911           if test -d $cf_add_incdir
8912           then
8913                 cf_have_incdir=no
8914                 if test -n "$CFLAGS$CPPFLAGS" ; then
8915                   # a loop is needed to ensure we can add subdirs of existing dirs
8916                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8917                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8918                           cf_have_incdir=yes; break
8919                         fi
8920                   done
8921                 fi
8922
8923                 if test "$cf_have_incdir" = no ; then
8924                   if test "$cf_add_incdir" = /usr/local/include ; then
8925                         if test "$GCC" = yes
8926                         then
8927                           cf_save_CPPFLAGS=$CPPFLAGS
8928                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8929                           cat >conftest.$ac_ext <<_ACEOF
8930 #line 8930 "configure"
8931 #include "confdefs.h"
8932 #include <stdio.h>
8933 int
8934 main ()
8935 {
8936 printf("Hello")
8937   ;
8938   return 0;
8939 }
8940 _ACEOF
8941 rm -f conftest.$ac_objext
8942 if { (eval echo "$as_me:8942: \"$ac_compile\"") >&5
8943   (eval $ac_compile) 2>&5
8944   ac_status=$?
8945   echo "$as_me:8945: \$? = $ac_status" >&5
8946   (exit $ac_status); } &&
8947          { ac_try='test -s conftest.$ac_objext'
8948   { (eval echo "$as_me:8948: \"$ac_try\"") >&5
8949   (eval $ac_try) 2>&5
8950   ac_status=$?
8951   echo "$as_me:8951: \$? = $ac_status" >&5
8952   (exit $ac_status); }; }; then
8953   :
8954 else
8955   echo "$as_me: failed program was:" >&5
8956 cat conftest.$ac_ext >&5
8957 cf_have_incdir=yes
8958 fi
8959 rm -f conftest.$ac_objext conftest.$ac_ext
8960                           CPPFLAGS=$cf_save_CPPFLAGS
8961                         fi
8962                   fi
8963                 fi
8964
8965                 if test "$cf_have_incdir" = no ; then
8966                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8967
8968 echo "${as_me:-configure}:8968: testing adding $cf_add_incdir to include-path ..." 1>&5
8969
8970                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8971
8972                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8973                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8974                   cf_add_incdir="$cf_top_incdir"
8975                 else
8976                   break
8977                 fi
8978           else
8979                 break
8980           fi
8981         done
8982   done
8983 fi
8984
8985 fi
8986
8987 # Set definitions to allow ifdef'ing for ncurses.h
8988
8989 case $cf_cv_ncurses_header in
8990 (*ncurses.h)
8991
8992 cat >>confdefs.h <<\EOF
8993 #define HAVE_NCURSES_H 1
8994 EOF
8995
8996         ;;
8997 esac
8998
8999 case $cf_cv_ncurses_header in
9000 (ncurses/curses.h|ncurses/ncurses.h)
9001
9002 cat >>confdefs.h <<\EOF
9003 #define HAVE_NCURSES_NCURSES_H 1
9004 EOF
9005
9006         ;;
9007 (ncursesw/curses.h|ncursesw/ncurses.h)
9008
9009 cat >>confdefs.h <<\EOF
9010 #define HAVE_NCURSESW_NCURSES_H 1
9011 EOF
9012
9013         ;;
9014 esac
9015
9016 echo "$as_me:9016: checking for terminfo header" >&5
9017 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
9018 if test "${cf_cv_term_header+set}" = set; then
9019   echo $ECHO_N "(cached) $ECHO_C" >&6
9020 else
9021
9022 case ${cf_cv_ncurses_header} in
9023 (*/ncurses.h|*/ncursesw.h)
9024         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
9025         ;;
9026 (*)
9027         cf_term_header=term.h
9028         ;;
9029 esac
9030
9031 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
9032 do
9033 cat >conftest.$ac_ext <<_ACEOF
9034 #line 9034 "configure"
9035 #include "confdefs.h"
9036 #include <stdio.h>
9037 #include <${cf_cv_ncurses_header:-curses.h}>
9038 #include <$cf_test>
9039
9040 int
9041 main ()
9042 {
9043 int x = auto_left_margin
9044   ;
9045   return 0;
9046 }
9047 _ACEOF
9048 rm -f conftest.$ac_objext
9049 if { (eval echo "$as_me:9049: \"$ac_compile\"") >&5
9050   (eval $ac_compile) 2>&5
9051   ac_status=$?
9052   echo "$as_me:9052: \$? = $ac_status" >&5
9053   (exit $ac_status); } &&
9054          { ac_try='test -s conftest.$ac_objext'
9055   { (eval echo "$as_me:9055: \"$ac_try\"") >&5
9056   (eval $ac_try) 2>&5
9057   ac_status=$?
9058   echo "$as_me:9058: \$? = $ac_status" >&5
9059   (exit $ac_status); }; }; then
9060
9061         cf_cv_term_header="$cf_test"
9062 else
9063   echo "$as_me: failed program was:" >&5
9064 cat conftest.$ac_ext >&5
9065
9066         cf_cv_term_header=unknown
9067
9068 fi
9069 rm -f conftest.$ac_objext conftest.$ac_ext
9070         test "$cf_cv_term_header" != unknown && break
9071 done
9072
9073 fi
9074 echo "$as_me:9074: result: $cf_cv_term_header" >&5
9075 echo "${ECHO_T}$cf_cv_term_header" >&6
9076
9077 # Set definitions to allow ifdef'ing to accommodate subdirectories
9078
9079 case $cf_cv_term_header in
9080 (*term.h)
9081
9082 cat >>confdefs.h <<\EOF
9083 #define HAVE_TERM_H 1
9084 EOF
9085
9086         ;;
9087 esac
9088
9089 case $cf_cv_term_header in
9090 (ncurses/term.h)
9091
9092 cat >>confdefs.h <<\EOF
9093 #define HAVE_NCURSES_TERM_H 1
9094 EOF
9095
9096         ;;
9097 (ncursesw/term.h)
9098
9099 cat >>confdefs.h <<\EOF
9100 #define HAVE_NCURSESW_TERM_H 1
9101 EOF
9102
9103         ;;
9104 esac
9105
9106 # some applications need this, but should check for NCURSES_VERSION
9107
9108 cat >>confdefs.h <<\EOF
9109 #define NCURSES 1
9110 EOF
9111
9112 echo "$as_me:9112: checking for ncurses version" >&5
9113 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
9114 if test "${cf_cv_ncurses_version+set}" = set; then
9115   echo $ECHO_N "(cached) $ECHO_C" >&6
9116 else
9117
9118         cf_cv_ncurses_version=no
9119         cf_tempfile=out$$
9120         rm -f $cf_tempfile
9121         if test "$cross_compiling" = yes; then
9122
9123         # This will not work if the preprocessor splits the line after the
9124         # Autoconf token.  The 'unproto' program does that.
9125         cat > conftest.$ac_ext <<EOF
9126 #include <${cf_cv_ncurses_header:-curses.h}>
9127 #undef Autoconf
9128 #ifdef NCURSES_VERSION
9129 Autoconf NCURSES_VERSION
9130 #else
9131 #ifdef __NCURSES_H
9132 Autoconf "old"
9133 #endif
9134 ;
9135 #endif
9136 EOF
9137         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
9138         { (eval echo "$as_me:9138: \"$cf_try\"") >&5
9139   (eval $cf_try) 2>&5
9140   ac_status=$?
9141   echo "$as_me:9141: \$? = $ac_status" >&5
9142   (exit $ac_status); }
9143         if test -f conftest.out ; then
9144                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
9145                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
9146                 rm -f conftest.out
9147         fi
9148
9149 else
9150   cat >conftest.$ac_ext <<_ACEOF
9151 #line 9151 "configure"
9152 #include "confdefs.h"
9153
9154 #include <${cf_cv_ncurses_header:-curses.h}>
9155 #include <stdio.h>
9156 int main()
9157 {
9158         FILE *fp = fopen("$cf_tempfile", "w");
9159 #ifdef NCURSES_VERSION
9160 # ifdef NCURSES_VERSION_PATCH
9161         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
9162 # else
9163         fprintf(fp, "%s\n", NCURSES_VERSION);
9164 # endif
9165 #else
9166 # ifdef __NCURSES_H
9167         fprintf(fp, "old\n");
9168 # else
9169         make an error
9170 # endif
9171 #endif
9172         ${cf_cv_main_return:-return}(0);
9173 }
9174 _ACEOF
9175 rm -f conftest$ac_exeext
9176 if { (eval echo "$as_me:9176: \"$ac_link\"") >&5
9177   (eval $ac_link) 2>&5
9178   ac_status=$?
9179   echo "$as_me:9179: \$? = $ac_status" >&5
9180   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
9181   { (eval echo "$as_me:9181: \"$ac_try\"") >&5
9182   (eval $ac_try) 2>&5
9183   ac_status=$?
9184   echo "$as_me:9184: \$? = $ac_status" >&5
9185   (exit $ac_status); }; }; then
9186
9187         cf_cv_ncurses_version=`cat $cf_tempfile`
9188 else
9189   echo "$as_me: program exited with status $ac_status" >&5
9190 echo "$as_me: failed program was:" >&5
9191 cat conftest.$ac_ext >&5
9192 fi
9193 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
9194 fi
9195         rm -f $cf_tempfile
9196
9197 fi
9198 echo "$as_me:9198: result: $cf_cv_ncurses_version" >&5
9199 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
9200 test "$cf_cv_ncurses_version" = no ||
9201 cat >>confdefs.h <<\EOF
9202 #define NCURSES 1
9203 EOF
9204
9205 cf_nculib_root=$cf_cv_screen
9206         # This works, except for the special case where we find gpm, but
9207         # ncurses is in a nonstandard location via $LIBS, and we really want
9208         # to link gpm.
9209 cf_ncurses_LIBS=""
9210 cf_ncurses_SAVE="$LIBS"
9211 echo "$as_me:9211: checking for Gpm_Open in -lgpm" >&5
9212 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
9213 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
9214   echo $ECHO_N "(cached) $ECHO_C" >&6
9215 else
9216   ac_check_lib_save_LIBS=$LIBS
9217 LIBS="-lgpm  $LIBS"
9218 cat >conftest.$ac_ext <<_ACEOF
9219 #line 9219 "configure"
9220 #include "confdefs.h"
9221
9222 /* Override any gcc2 internal prototype to avoid an error.  */
9223 #ifdef __cplusplus
9224 extern "C"
9225 #endif
9226 /* We use char because int might match the return type of a gcc2
9227    builtin and then its argument prototype would still apply.  */
9228 char Gpm_Open ();
9229 int
9230 main ()
9231 {
9232 Gpm_Open ();
9233   ;
9234   return 0;
9235 }
9236 _ACEOF
9237 rm -f conftest.$ac_objext conftest$ac_exeext
9238 if { (eval echo "$as_me:9238: \"$ac_link\"") >&5
9239   (eval $ac_link) 2>&5
9240   ac_status=$?
9241   echo "$as_me:9241: \$? = $ac_status" >&5
9242   (exit $ac_status); } &&
9243          { ac_try='test -s conftest$ac_exeext'
9244   { (eval echo "$as_me:9244: \"$ac_try\"") >&5
9245   (eval $ac_try) 2>&5
9246   ac_status=$?
9247   echo "$as_me:9247: \$? = $ac_status" >&5
9248   (exit $ac_status); }; }; then
9249   ac_cv_lib_gpm_Gpm_Open=yes
9250 else
9251   echo "$as_me: failed program was:" >&5
9252 cat conftest.$ac_ext >&5
9253 ac_cv_lib_gpm_Gpm_Open=no
9254 fi
9255 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9256 LIBS=$ac_check_lib_save_LIBS
9257 fi
9258 echo "$as_me:9258: result: $ac_cv_lib_gpm_Gpm_Open" >&5
9259 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
9260 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
9261   echo "$as_me:9261: checking for initscr in -lgpm" >&5
9262 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
9263 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
9264   echo $ECHO_N "(cached) $ECHO_C" >&6
9265 else
9266   ac_check_lib_save_LIBS=$LIBS
9267 LIBS="-lgpm  $LIBS"
9268 cat >conftest.$ac_ext <<_ACEOF
9269 #line 9269 "configure"
9270 #include "confdefs.h"
9271
9272 /* Override any gcc2 internal prototype to avoid an error.  */
9273 #ifdef __cplusplus
9274 extern "C"
9275 #endif
9276 /* We use char because int might match the return type of a gcc2
9277    builtin and then its argument prototype would still apply.  */
9278 char initscr ();
9279 int
9280 main ()
9281 {
9282 initscr ();
9283   ;
9284   return 0;
9285 }
9286 _ACEOF
9287 rm -f conftest.$ac_objext conftest$ac_exeext
9288 if { (eval echo "$as_me:9288: \"$ac_link\"") >&5
9289   (eval $ac_link) 2>&5
9290   ac_status=$?
9291   echo "$as_me:9291: \$? = $ac_status" >&5
9292   (exit $ac_status); } &&
9293          { ac_try='test -s conftest$ac_exeext'
9294   { (eval echo "$as_me:9294: \"$ac_try\"") >&5
9295   (eval $ac_try) 2>&5
9296   ac_status=$?
9297   echo "$as_me:9297: \$? = $ac_status" >&5
9298   (exit $ac_status); }; }; then
9299   ac_cv_lib_gpm_initscr=yes
9300 else
9301   echo "$as_me: failed program was:" >&5
9302 cat conftest.$ac_ext >&5
9303 ac_cv_lib_gpm_initscr=no
9304 fi
9305 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9306 LIBS=$ac_check_lib_save_LIBS
9307 fi
9308 echo "$as_me:9308: result: $ac_cv_lib_gpm_initscr" >&5
9309 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
9310 if test $ac_cv_lib_gpm_initscr = yes; then
9311   LIBS="$cf_ncurses_SAVE"
9312 else
9313   cf_ncurses_LIBS="-lgpm"
9314 fi
9315
9316 fi
9317
9318 case $host_os in
9319 (freebsd*)
9320         # This is only necessary if you are linking against an obsolete
9321         # version of ncurses (but it should do no harm, since it's static).
9322         if test "$cf_nculib_root" = ncurses ; then
9323                 echo "$as_me:9323: checking for tgoto in -lmytinfo" >&5
9324 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
9325 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
9326   echo $ECHO_N "(cached) $ECHO_C" >&6
9327 else
9328   ac_check_lib_save_LIBS=$LIBS
9329 LIBS="-lmytinfo  $LIBS"
9330 cat >conftest.$ac_ext <<_ACEOF
9331 #line 9331 "configure"
9332 #include "confdefs.h"
9333
9334 /* Override any gcc2 internal prototype to avoid an error.  */
9335 #ifdef __cplusplus
9336 extern "C"
9337 #endif
9338 /* We use char because int might match the return type of a gcc2
9339    builtin and then its argument prototype would still apply.  */
9340 char tgoto ();
9341 int
9342 main ()
9343 {
9344 tgoto ();
9345   ;
9346   return 0;
9347 }
9348 _ACEOF
9349 rm -f conftest.$ac_objext conftest$ac_exeext
9350 if { (eval echo "$as_me:9350: \"$ac_link\"") >&5
9351   (eval $ac_link) 2>&5
9352   ac_status=$?
9353   echo "$as_me:9353: \$? = $ac_status" >&5
9354   (exit $ac_status); } &&
9355          { ac_try='test -s conftest$ac_exeext'
9356   { (eval echo "$as_me:9356: \"$ac_try\"") >&5
9357   (eval $ac_try) 2>&5
9358   ac_status=$?
9359   echo "$as_me:9359: \$? = $ac_status" >&5
9360   (exit $ac_status); }; }; then
9361   ac_cv_lib_mytinfo_tgoto=yes
9362 else
9363   echo "$as_me: failed program was:" >&5
9364 cat conftest.$ac_ext >&5
9365 ac_cv_lib_mytinfo_tgoto=no
9366 fi
9367 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9368 LIBS=$ac_check_lib_save_LIBS
9369 fi
9370 echo "$as_me:9370: result: $ac_cv_lib_mytinfo_tgoto" >&5
9371 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
9372 if test $ac_cv_lib_mytinfo_tgoto = yes; then
9373   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
9374 fi
9375
9376         fi
9377         ;;
9378 esac
9379
9380 cf_add_libs="$cf_ncurses_LIBS"
9381 # Filter out duplicates - this happens with badly-designed ".pc" files...
9382 for cf_add_1lib in $LIBS
9383 do
9384         for cf_add_2lib in $cf_add_libs
9385         do
9386                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
9387                 then
9388                         cf_add_1lib=
9389                         break
9390                 fi
9391         done
9392         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
9393 done
9394 LIBS="$cf_add_libs"
9395
9396 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
9397 then
9398
9399 cf_add_libs="-l$cf_nculib_root"
9400 # Filter out duplicates - this happens with badly-designed ".pc" files...
9401 for cf_add_1lib in $LIBS
9402 do
9403         for cf_add_2lib in $cf_add_libs
9404         do
9405                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
9406                 then
9407                         cf_add_1lib=
9408                         break
9409                 fi
9410         done
9411         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
9412 done
9413 LIBS="$cf_add_libs"
9414
9415 else
9416
9417         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
9418         cf_libdir=""
9419         echo "$as_me:9419: checking for initscr" >&5
9420 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
9421 if test "${ac_cv_func_initscr+set}" = set; then
9422   echo $ECHO_N "(cached) $ECHO_C" >&6
9423 else
9424   cat >conftest.$ac_ext <<_ACEOF
9425 #line 9425 "configure"
9426 #include "confdefs.h"
9427 /* System header to define __stub macros and hopefully few prototypes,
9428     which can conflict with char initscr (); below.  */
9429 #include <assert.h>
9430 /* Override any gcc2 internal prototype to avoid an error.  */
9431 #ifdef __cplusplus
9432 extern "C"
9433 #endif
9434 /* We use char because int might match the return type of a gcc2
9435    builtin and then its argument prototype would still apply.  */
9436 char initscr ();
9437 char (*f) ();
9438
9439 int
9440 main ()
9441 {
9442 /* The GNU C library defines this for functions which it implements
9443     to always fail with ENOSYS.  Some functions are actually named
9444     something starting with __ and the normal name is an alias.  */
9445 #if defined (__stub_initscr) || defined (__stub___initscr)
9446 choke me
9447 #else
9448 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
9449 #endif
9450
9451   ;
9452   return 0;
9453 }
9454 _ACEOF
9455 rm -f conftest.$ac_objext conftest$ac_exeext
9456 if { (eval echo "$as_me:9456: \"$ac_link\"") >&5
9457   (eval $ac_link) 2>&5
9458   ac_status=$?
9459   echo "$as_me:9459: \$? = $ac_status" >&5
9460   (exit $ac_status); } &&
9461          { ac_try='test -s conftest$ac_exeext'
9462   { (eval echo "$as_me:9462: \"$ac_try\"") >&5
9463   (eval $ac_try) 2>&5
9464   ac_status=$?
9465   echo "$as_me:9465: \$? = $ac_status" >&5
9466   (exit $ac_status); }; }; then
9467   ac_cv_func_initscr=yes
9468 else
9469   echo "$as_me: failed program was:" >&5
9470 cat conftest.$ac_ext >&5
9471 ac_cv_func_initscr=no
9472 fi
9473 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9474 fi
9475 echo "$as_me:9475: result: $ac_cv_func_initscr" >&5
9476 echo "${ECHO_T}$ac_cv_func_initscr" >&6
9477 if test $ac_cv_func_initscr = yes; then
9478   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9479 else
9480
9481                 cf_save_LIBS="$LIBS"
9482                 echo "$as_me:9482: checking for initscr in -l$cf_nculib_root" >&5
9483 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
9484                 LIBS="-l$cf_nculib_root $LIBS"
9485                 cat >conftest.$ac_ext <<_ACEOF
9486 #line 9486 "configure"
9487 #include "confdefs.h"
9488 #include <${cf_cv_ncurses_header:-curses.h}>
9489 int
9490 main ()
9491 {
9492 initscr()
9493   ;
9494   return 0;
9495 }
9496 _ACEOF
9497 rm -f conftest.$ac_objext conftest$ac_exeext
9498 if { (eval echo "$as_me:9498: \"$ac_link\"") >&5
9499   (eval $ac_link) 2>&5
9500   ac_status=$?
9501   echo "$as_me:9501: \$? = $ac_status" >&5
9502   (exit $ac_status); } &&
9503          { ac_try='test -s conftest$ac_exeext'
9504   { (eval echo "$as_me:9504: \"$ac_try\"") >&5
9505   (eval $ac_try) 2>&5
9506   ac_status=$?
9507   echo "$as_me:9507: \$? = $ac_status" >&5
9508   (exit $ac_status); }; }; then
9509   echo "$as_me:9509: result: yes" >&5
9510 echo "${ECHO_T}yes" >&6
9511                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9512
9513 else
9514   echo "$as_me: failed program was:" >&5
9515 cat conftest.$ac_ext >&5
9516 echo "$as_me:9516: result: no" >&5
9517 echo "${ECHO_T}no" >&6
9518
9519 cf_search=
9520 cf_library_path_list=""
9521 if test -n "${LDFLAGS}${LIBS}" ; then
9522         for cf_library_path in $LDFLAGS $LIBS
9523         do
9524                 case $cf_library_path in
9525                 (-L*)
9526                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
9527
9528 test "x$cf_library_path" != "xNONE" && \
9529 test -d "$cf_library_path" && \
9530  {
9531         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
9532         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
9533         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
9534         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
9535         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
9536         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"
9537 }
9538
9539                         cf_library_path_list="$cf_library_path_list $cf_search"
9540                         ;;
9541                 esac
9542         done
9543 fi
9544
9545 cf_search=
9546
9547 test "x$prefix" != "xNONE" && \
9548 test -d "$prefix" && \
9549  {
9550         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
9551         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
9552         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
9553         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
9554         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
9555         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
9556 }
9557
9558 for cf_subdir_prefix in \
9559         /usr \
9560         /usr/local \
9561         /usr/pkg \
9562         /opt \
9563         /opt/local \
9564         $HOME
9565 do
9566
9567 test "x$cf_subdir_prefix" != "x$prefix" && \
9568 test -d "$cf_subdir_prefix" && \
9569 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
9570         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
9571         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
9572         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
9573         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
9574         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
9575         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"
9576 }
9577
9578 done
9579
9580 cf_search="$cf_library_path_list $cf_search"
9581
9582                         for cf_libdir in $cf_search
9583                         do
9584                                 echo "$as_me:9584: checking for -l$cf_nculib_root in $cf_libdir" >&5
9585 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
9586                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
9587                                 cat >conftest.$ac_ext <<_ACEOF
9588 #line 9588 "configure"
9589 #include "confdefs.h"
9590 #include <${cf_cv_ncurses_header:-curses.h}>
9591 int
9592 main ()
9593 {
9594 initscr()
9595   ;
9596   return 0;
9597 }
9598 _ACEOF
9599 rm -f conftest.$ac_objext conftest$ac_exeext
9600 if { (eval echo "$as_me:9600: \"$ac_link\"") >&5
9601   (eval $ac_link) 2>&5
9602   ac_status=$?
9603   echo "$as_me:9603: \$? = $ac_status" >&5
9604   (exit $ac_status); } &&
9605          { ac_try='test -s conftest$ac_exeext'
9606   { (eval echo "$as_me:9606: \"$ac_try\"") >&5
9607   (eval $ac_try) 2>&5
9608   ac_status=$?
9609   echo "$as_me:9609: \$? = $ac_status" >&5
9610   (exit $ac_status); }; }; then
9611   echo "$as_me:9611: result: yes" >&5
9612 echo "${ECHO_T}yes" >&6
9613                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9614                                          break
9615 else
9616   echo "$as_me: failed program was:" >&5
9617 cat conftest.$ac_ext >&5
9618 echo "$as_me:9618: result: no" >&5
9619 echo "${ECHO_T}no" >&6
9620                                          LIBS="$cf_save_LIBS"
9621 fi
9622 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9623                         done
9624
9625 fi
9626 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9627
9628 fi
9629
9630 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
9631
9632 if test $cf_found_library = no ; then
9633         { { echo "$as_me:9633: error: Cannot link $cf_nculib_root library" >&5
9634 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
9635    { (exit 1); exit 1; }; }
9636 fi
9637
9638 fi
9639
9640 if test -n "$cf_ncurses_LIBS" ; then
9641         echo "$as_me:9641: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
9642 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
9643         cf_ncurses_SAVE="$LIBS"
9644         for p in $cf_ncurses_LIBS ; do
9645                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
9646                 if test "$q" != "$LIBS" ; then
9647                         LIBS="$q"
9648                 fi
9649         done
9650         cat >conftest.$ac_ext <<_ACEOF
9651 #line 9651 "configure"
9652 #include "confdefs.h"
9653 #include <${cf_cv_ncurses_header:-curses.h}>
9654 int
9655 main ()
9656 {
9657 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
9658   ;
9659   return 0;
9660 }
9661 _ACEOF
9662 rm -f conftest.$ac_objext conftest$ac_exeext
9663 if { (eval echo "$as_me:9663: \"$ac_link\"") >&5
9664   (eval $ac_link) 2>&5
9665   ac_status=$?
9666   echo "$as_me:9666: \$? = $ac_status" >&5
9667   (exit $ac_status); } &&
9668          { ac_try='test -s conftest$ac_exeext'
9669   { (eval echo "$as_me:9669: \"$ac_try\"") >&5
9670   (eval $ac_try) 2>&5
9671   ac_status=$?
9672   echo "$as_me:9672: \$? = $ac_status" >&5
9673   (exit $ac_status); }; }; then
9674   echo "$as_me:9674: result: yes" >&5
9675 echo "${ECHO_T}yes" >&6
9676 else
9677   echo "$as_me: failed program was:" >&5
9678 cat conftest.$ac_ext >&5
9679 echo "$as_me:9679: result: no" >&5
9680 echo "${ECHO_T}no" >&6
9681                  LIBS="$cf_ncurses_SAVE"
9682 fi
9683 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9684 fi
9685
9686 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9687
9688 cat >>confdefs.h <<EOF
9689 #define $cf_nculib_ROOT 1
9690 EOF
9691
9692         fi
9693 else
9694         NCURSES_CONFIG=none
9695 fi
9696
9697         ;;
9698 (pdcurses)
9699         echo "$as_me:9699: checking for X" >&5
9700 echo $ECHO_N "checking for X... $ECHO_C" >&6
9701
9702 # Check whether --with-x or --without-x was given.
9703 if test "${with_x+set}" = set; then
9704   withval="$with_x"
9705
9706 fi;
9707 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
9708 if test "x$with_x" = xno; then
9709   # The user explicitly disabled X.
9710   have_x=disabled
9711 else
9712   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
9713     # Both variables are already set.
9714     have_x=yes
9715   else
9716     if test "${ac_cv_have_x+set}" = set; then
9717   echo $ECHO_N "(cached) $ECHO_C" >&6
9718 else
9719   # One or both of the vars are not set, and there is no cached value.
9720 ac_x_includes=no ac_x_libraries=no
9721 rm -fr conftest.dir
9722 if mkdir conftest.dir; then
9723   cd conftest.dir
9724   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
9725   cat >Imakefile <<'EOF'
9726 acfindx:
9727         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
9728 EOF
9729   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
9730     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
9731     eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
9732     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
9733     for ac_extension in a so sl dylib dll; do
9734       if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
9735          test -f $ac_im_libdir/libX11.$ac_extension; then
9736         ac_im_usrlibdir=$ac_im_libdir; break
9737       fi
9738     done
9739     # Screen out bogus values from the imake configuration.  They are
9740     # bogus both because they are the default anyway, and because
9741     # using them would break gcc on systems where it needs fixed includes.
9742     case $ac_im_incroot in
9743         /usr/include) ;;
9744         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
9745     esac
9746     case $ac_im_usrlibdir in
9747         /usr/lib | /lib) ;;
9748         *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
9749     esac
9750   fi
9751   cd ..
9752   rm -fr conftest.dir
9753 fi
9754
9755 # Standard set of common directories for X headers.
9756 # Check X11 before X11Rn because it is often a symlink to the current release.
9757 ac_x_header_dirs='
9758 /usr/X11/include
9759 /usr/X11R6/include
9760 /usr/X11R5/include
9761 /usr/X11R4/include
9762
9763 /usr/include/X11
9764 /usr/include/X11R6
9765 /usr/include/X11R5
9766 /usr/include/X11R4
9767
9768 /usr/local/X11/include
9769 /usr/local/X11R6/include
9770 /usr/local/X11R5/include
9771 /usr/local/X11R4/include
9772
9773 /usr/local/include/X11
9774 /usr/local/include/X11R6
9775 /usr/local/include/X11R5
9776 /usr/local/include/X11R4
9777
9778 /usr/X386/include
9779 /usr/x386/include
9780 /usr/XFree86/include/X11
9781
9782 /usr/include
9783 /usr/local/include
9784 /usr/unsupported/include
9785 /usr/athena/include
9786 /usr/local/x11r5/include
9787 /usr/lpp/Xamples/include
9788
9789 /usr/openwin/include
9790 /usr/openwin/share/include'
9791
9792 if test "$ac_x_includes" = no; then
9793   # Guess where to find include files, by looking for Intrinsic.h.
9794   # First, try using that file with no special directory specified.
9795   cat >conftest.$ac_ext <<_ACEOF
9796 #line 9796 "configure"
9797 #include "confdefs.h"
9798 #include <X11/Intrinsic.h>
9799 _ACEOF
9800 if { (eval echo "$as_me:9800: \"$ac_cpp conftest.$ac_ext\"") >&5
9801   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
9802   ac_status=$?
9803   egrep -v '^ *\+' conftest.er1 >conftest.err
9804   rm -f conftest.er1
9805   cat conftest.err >&5
9806   echo "$as_me:9806: \$? = $ac_status" >&5
9807   (exit $ac_status); } >/dev/null; then
9808   if test -s conftest.err; then
9809     ac_cpp_err=$ac_c_preproc_warn_flag
9810   else
9811     ac_cpp_err=
9812   fi
9813 else
9814   ac_cpp_err=yes
9815 fi
9816 if test -z "$ac_cpp_err"; then
9817   # We can compile using X headers with no special include directory.
9818 ac_x_includes=
9819 else
9820   echo "$as_me: failed program was:" >&5
9821   cat conftest.$ac_ext >&5
9822   for ac_dir in $ac_x_header_dirs; do
9823   if test -r "$ac_dir/X11/Intrinsic.h"; then
9824     ac_x_includes=$ac_dir
9825     break
9826   fi
9827 done
9828 fi
9829 rm -f conftest.err conftest.$ac_ext
9830 fi # $ac_x_includes = no
9831
9832 if test "$ac_x_libraries" = no; then
9833   # Check for the libraries.
9834   # See if we find them without any special options.
9835   # Don't add to $LIBS permanently.
9836   ac_save_LIBS=$LIBS
9837   LIBS="-lXt $LIBS"
9838   cat >conftest.$ac_ext <<_ACEOF
9839 #line 9839 "configure"
9840 #include "confdefs.h"
9841 #include <X11/Intrinsic.h>
9842 int
9843 main ()
9844 {
9845 XtMalloc (0)
9846   ;
9847   return 0;
9848 }
9849 _ACEOF
9850 rm -f conftest.$ac_objext conftest$ac_exeext
9851 if { (eval echo "$as_me:9851: \"$ac_link\"") >&5
9852   (eval $ac_link) 2>&5
9853   ac_status=$?
9854   echo "$as_me:9854: \$? = $ac_status" >&5
9855   (exit $ac_status); } &&
9856          { ac_try='test -s conftest$ac_exeext'
9857   { (eval echo "$as_me:9857: \"$ac_try\"") >&5
9858   (eval $ac_try) 2>&5
9859   ac_status=$?
9860   echo "$as_me:9860: \$? = $ac_status" >&5
9861   (exit $ac_status); }; }; then
9862   LIBS=$ac_save_LIBS
9863 # We can link X programs with no special library path.
9864 ac_x_libraries=
9865 else
9866   echo "$as_me: failed program was:" >&5
9867 cat conftest.$ac_ext >&5
9868 LIBS=$ac_save_LIBS
9869 for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
9870 do
9871   # Don't even attempt the hair of trying to link an X program!
9872   for ac_extension in a so sl dylib dll; do
9873     if test -r $ac_dir/libXt.$ac_extension; then
9874       ac_x_libraries=$ac_dir
9875       break 2
9876     fi
9877   done
9878 done
9879 fi
9880 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9881 fi # $ac_x_libraries = no
9882
9883 if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then
9884   # Didn't find X anywhere.  Cache the known absence of X.
9885   ac_cv_have_x="have_x=no"
9886 else
9887   # Record where we found X for the cache.
9888   ac_cv_have_x="have_x=yes \
9889                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
9890 fi
9891 fi
9892
9893   fi
9894   eval "$ac_cv_have_x"
9895 fi # $with_x != no
9896
9897 if test "$have_x" != yes; then
9898   echo "$as_me:9898: result: $have_x" >&5
9899 echo "${ECHO_T}$have_x" >&6
9900   no_x=yes
9901 else
9902   # If each of the values was on the command line, it overrides each guess.
9903   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
9904   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
9905   # Update the cache value to reflect the command line values.
9906   ac_cv_have_x="have_x=yes \
9907                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
9908   echo "$as_me:9908: result: libraries $x_libraries, headers $x_includes" >&5
9909 echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6
9910 fi
9911
9912 if test "$no_x" = yes; then
9913   # Not all programs may use this symbol, but it does not hurt to define it.
9914
9915 cat >>confdefs.h <<\EOF
9916 #define X_DISPLAY_MISSING 1
9917 EOF
9918
9919   X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
9920 else
9921   if test -n "$x_includes"; then
9922     X_CFLAGS="$X_CFLAGS -I$x_includes"
9923   fi
9924
9925   # It would also be nice to do this for all -L options, not just this one.
9926   if test -n "$x_libraries"; then
9927     X_LIBS="$X_LIBS -L$x_libraries"
9928     # For Solaris; some versions of Sun CC require a space after -R and
9929     # others require no space.  Words are not sufficient . . . .
9930     case `(uname -sr) 2>/dev/null` in
9931     "SunOS 5"*)
9932       echo "$as_me:9932: checking whether -R must be followed by a space" >&5
9933 echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6
9934       ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
9935       cat >conftest.$ac_ext <<_ACEOF
9936 #line 9936 "configure"
9937 #include "confdefs.h"
9938
9939 int
9940 main ()
9941 {
9942
9943   ;
9944   return 0;
9945 }
9946 _ACEOF
9947 rm -f conftest.$ac_objext conftest$ac_exeext
9948 if { (eval echo "$as_me:9948: \"$ac_link\"") >&5
9949   (eval $ac_link) 2>&5
9950   ac_status=$?
9951   echo "$as_me:9951: \$? = $ac_status" >&5
9952   (exit $ac_status); } &&
9953          { ac_try='test -s conftest$ac_exeext'
9954   { (eval echo "$as_me:9954: \"$ac_try\"") >&5
9955   (eval $ac_try) 2>&5
9956   ac_status=$?
9957   echo "$as_me:9957: \$? = $ac_status" >&5
9958   (exit $ac_status); }; }; then
9959   ac_R_nospace=yes
9960 else
9961   echo "$as_me: failed program was:" >&5
9962 cat conftest.$ac_ext >&5
9963 ac_R_nospace=no
9964 fi
9965 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9966       if test $ac_R_nospace = yes; then
9967         echo "$as_me:9967: result: no" >&5
9968 echo "${ECHO_T}no" >&6
9969         X_LIBS="$X_LIBS -R$x_libraries"
9970       else
9971         LIBS="$ac_xsave_LIBS -R $x_libraries"
9972         cat >conftest.$ac_ext <<_ACEOF
9973 #line 9973 "configure"
9974 #include "confdefs.h"
9975
9976 int
9977 main ()
9978 {
9979
9980   ;
9981   return 0;
9982 }
9983 _ACEOF
9984 rm -f conftest.$ac_objext conftest$ac_exeext
9985 if { (eval echo "$as_me:9985: \"$ac_link\"") >&5
9986   (eval $ac_link) 2>&5
9987   ac_status=$?
9988   echo "$as_me:9988: \$? = $ac_status" >&5
9989   (exit $ac_status); } &&
9990          { ac_try='test -s conftest$ac_exeext'
9991   { (eval echo "$as_me:9991: \"$ac_try\"") >&5
9992   (eval $ac_try) 2>&5
9993   ac_status=$?
9994   echo "$as_me:9994: \$? = $ac_status" >&5
9995   (exit $ac_status); }; }; then
9996   ac_R_space=yes
9997 else
9998   echo "$as_me: failed program was:" >&5
9999 cat conftest.$ac_ext >&5
10000 ac_R_space=no
10001 fi
10002 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10003         if test $ac_R_space = yes; then
10004           echo "$as_me:10004: result: yes" >&5
10005 echo "${ECHO_T}yes" >&6
10006           X_LIBS="$X_LIBS -R $x_libraries"
10007         else
10008           echo "$as_me:10008: result: neither works" >&5
10009 echo "${ECHO_T}neither works" >&6
10010         fi
10011       fi
10012       LIBS=$ac_xsave_LIBS
10013     esac
10014   fi
10015
10016   # Check for system-dependent libraries X programs must link with.
10017   # Do this before checking for the system-independent R6 libraries
10018   # (-lICE), since we may need -lsocket or whatever for X linking.
10019
10020   if test "$ISC" = yes; then
10021     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
10022   else
10023     # Martyn Johnson says this is needed for Ultrix, if the X
10024     # libraries were built with DECnet support.  And Karl Berry says
10025     # the Alpha needs dnet_stub (dnet does not exist).
10026     ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
10027     cat >conftest.$ac_ext <<_ACEOF
10028 #line 10028 "configure"
10029 #include "confdefs.h"
10030
10031 /* Override any gcc2 internal prototype to avoid an error.  */
10032 #ifdef __cplusplus
10033 extern "C"
10034 #endif
10035 /* We use char because int might match the return type of a gcc2
10036    builtin and then its argument prototype would still apply.  */
10037 char XOpenDisplay ();
10038 int
10039 main ()
10040 {
10041 XOpenDisplay ();
10042   ;
10043   return 0;
10044 }
10045 _ACEOF
10046 rm -f conftest.$ac_objext conftest$ac_exeext
10047 if { (eval echo "$as_me:10047: \"$ac_link\"") >&5
10048   (eval $ac_link) 2>&5
10049   ac_status=$?
10050   echo "$as_me:10050: \$? = $ac_status" >&5
10051   (exit $ac_status); } &&
10052          { ac_try='test -s conftest$ac_exeext'
10053   { (eval echo "$as_me:10053: \"$ac_try\"") >&5
10054   (eval $ac_try) 2>&5
10055   ac_status=$?
10056   echo "$as_me:10056: \$? = $ac_status" >&5
10057   (exit $ac_status); }; }; then
10058   :
10059 else
10060   echo "$as_me: failed program was:" >&5
10061 cat conftest.$ac_ext >&5
10062 echo "$as_me:10062: checking for dnet_ntoa in -ldnet" >&5
10063 echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6
10064 if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then
10065   echo $ECHO_N "(cached) $ECHO_C" >&6
10066 else
10067   ac_check_lib_save_LIBS=$LIBS
10068 LIBS="-ldnet  $LIBS"
10069 cat >conftest.$ac_ext <<_ACEOF
10070 #line 10070 "configure"
10071 #include "confdefs.h"
10072
10073 /* Override any gcc2 internal prototype to avoid an error.  */
10074 #ifdef __cplusplus
10075 extern "C"
10076 #endif
10077 /* We use char because int might match the return type of a gcc2
10078    builtin and then its argument prototype would still apply.  */
10079 char dnet_ntoa ();
10080 int
10081 main ()
10082 {
10083 dnet_ntoa ();
10084   ;
10085   return 0;
10086 }
10087 _ACEOF
10088 rm -f conftest.$ac_objext conftest$ac_exeext
10089 if { (eval echo "$as_me:10089: \"$ac_link\"") >&5
10090   (eval $ac_link) 2>&5
10091   ac_status=$?
10092   echo "$as_me:10092: \$? = $ac_status" >&5
10093   (exit $ac_status); } &&
10094          { ac_try='test -s conftest$ac_exeext'
10095   { (eval echo "$as_me:10095: \"$ac_try\"") >&5
10096   (eval $ac_try) 2>&5
10097   ac_status=$?
10098   echo "$as_me:10098: \$? = $ac_status" >&5
10099   (exit $ac_status); }; }; then
10100   ac_cv_lib_dnet_dnet_ntoa=yes
10101 else
10102   echo "$as_me: failed program was:" >&5
10103 cat conftest.$ac_ext >&5
10104 ac_cv_lib_dnet_dnet_ntoa=no
10105 fi
10106 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10107 LIBS=$ac_check_lib_save_LIBS
10108 fi
10109 echo "$as_me:10109: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
10110 echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6
10111 if test $ac_cv_lib_dnet_dnet_ntoa = yes; then
10112   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
10113 fi
10114
10115     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
10116       echo "$as_me:10116: checking for dnet_ntoa in -ldnet_stub" >&5
10117 echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6
10118 if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then
10119   echo $ECHO_N "(cached) $ECHO_C" >&6
10120 else
10121   ac_check_lib_save_LIBS=$LIBS
10122 LIBS="-ldnet_stub  $LIBS"
10123 cat >conftest.$ac_ext <<_ACEOF
10124 #line 10124 "configure"
10125 #include "confdefs.h"
10126
10127 /* Override any gcc2 internal prototype to avoid an error.  */
10128 #ifdef __cplusplus
10129 extern "C"
10130 #endif
10131 /* We use char because int might match the return type of a gcc2
10132    builtin and then its argument prototype would still apply.  */
10133 char dnet_ntoa ();
10134 int
10135 main ()
10136 {
10137 dnet_ntoa ();
10138   ;
10139   return 0;
10140 }
10141 _ACEOF
10142 rm -f conftest.$ac_objext conftest$ac_exeext
10143 if { (eval echo "$as_me:10143: \"$ac_link\"") >&5
10144   (eval $ac_link) 2>&5
10145   ac_status=$?
10146   echo "$as_me:10146: \$? = $ac_status" >&5
10147   (exit $ac_status); } &&
10148          { ac_try='test -s conftest$ac_exeext'
10149   { (eval echo "$as_me:10149: \"$ac_try\"") >&5
10150   (eval $ac_try) 2>&5
10151   ac_status=$?
10152   echo "$as_me:10152: \$? = $ac_status" >&5
10153   (exit $ac_status); }; }; then
10154   ac_cv_lib_dnet_stub_dnet_ntoa=yes
10155 else
10156   echo "$as_me: failed program was:" >&5
10157 cat conftest.$ac_ext >&5
10158 ac_cv_lib_dnet_stub_dnet_ntoa=no
10159 fi
10160 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10161 LIBS=$ac_check_lib_save_LIBS
10162 fi
10163 echo "$as_me:10163: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
10164 echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6
10165 if test $ac_cv_lib_dnet_stub_dnet_ntoa = yes; then
10166   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
10167 fi
10168
10169     fi
10170 fi
10171 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10172     LIBS="$ac_xsave_LIBS"
10173
10174     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
10175     # to get the SysV transport functions.
10176     # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4)
10177     # needs -lnsl.
10178     # The nsl library prevents programs from opening the X display
10179     # on Irix 5.2, according to T.E. Dickey.
10180     # The functions gethostbyname, getservbyname, and inet_addr are
10181     # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
10182     echo "$as_me:10182: checking for gethostbyname" >&5
10183 echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6
10184 if test "${ac_cv_func_gethostbyname+set}" = set; then
10185   echo $ECHO_N "(cached) $ECHO_C" >&6
10186 else
10187   cat >conftest.$ac_ext <<_ACEOF
10188 #line 10188 "configure"
10189 #include "confdefs.h"
10190 /* System header to define __stub macros and hopefully few prototypes,
10191     which can conflict with char gethostbyname (); below.  */
10192 #include <assert.h>
10193 /* Override any gcc2 internal prototype to avoid an error.  */
10194 #ifdef __cplusplus
10195 extern "C"
10196 #endif
10197 /* We use char because int might match the return type of a gcc2
10198    builtin and then its argument prototype would still apply.  */
10199 char gethostbyname ();
10200 char (*f) ();
10201
10202 int
10203 main ()
10204 {
10205 /* The GNU C library defines this for functions which it implements
10206     to always fail with ENOSYS.  Some functions are actually named
10207     something starting with __ and the normal name is an alias.  */
10208 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
10209 choke me
10210 #else
10211 f = gethostbyname; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
10212 #endif
10213
10214   ;
10215   return 0;
10216 }
10217 _ACEOF
10218 rm -f conftest.$ac_objext conftest$ac_exeext
10219 if { (eval echo "$as_me:10219: \"$ac_link\"") >&5
10220   (eval $ac_link) 2>&5
10221   ac_status=$?
10222   echo "$as_me:10222: \$? = $ac_status" >&5
10223   (exit $ac_status); } &&
10224          { ac_try='test -s conftest$ac_exeext'
10225   { (eval echo "$as_me:10225: \"$ac_try\"") >&5
10226   (eval $ac_try) 2>&5
10227   ac_status=$?
10228   echo "$as_me:10228: \$? = $ac_status" >&5
10229   (exit $ac_status); }; }; then
10230   ac_cv_func_gethostbyname=yes
10231 else
10232   echo "$as_me: failed program was:" >&5
10233 cat conftest.$ac_ext >&5
10234 ac_cv_func_gethostbyname=no
10235 fi
10236 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10237 fi
10238 echo "$as_me:10238: result: $ac_cv_func_gethostbyname" >&5
10239 echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6
10240
10241     if test $ac_cv_func_gethostbyname = no; then
10242       echo "$as_me:10242: checking for gethostbyname in -lnsl" >&5
10243 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6
10244 if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
10245   echo $ECHO_N "(cached) $ECHO_C" >&6
10246 else
10247   ac_check_lib_save_LIBS=$LIBS
10248 LIBS="-lnsl  $LIBS"
10249 cat >conftest.$ac_ext <<_ACEOF
10250 #line 10250 "configure"
10251 #include "confdefs.h"
10252
10253 /* Override any gcc2 internal prototype to avoid an error.  */
10254 #ifdef __cplusplus
10255 extern "C"
10256 #endif
10257 /* We use char because int might match the return type of a gcc2
10258    builtin and then its argument prototype would still apply.  */
10259 char gethostbyname ();
10260 int
10261 main ()
10262 {
10263 gethostbyname ();
10264   ;
10265   return 0;
10266 }
10267 _ACEOF
10268 rm -f conftest.$ac_objext conftest$ac_exeext
10269 if { (eval echo "$as_me:10269: \"$ac_link\"") >&5
10270   (eval $ac_link) 2>&5
10271   ac_status=$?
10272   echo "$as_me:10272: \$? = $ac_status" >&5
10273   (exit $ac_status); } &&
10274          { ac_try='test -s conftest$ac_exeext'
10275   { (eval echo "$as_me:10275: \"$ac_try\"") >&5
10276   (eval $ac_try) 2>&5
10277   ac_status=$?
10278   echo "$as_me:10278: \$? = $ac_status" >&5
10279   (exit $ac_status); }; }; then
10280   ac_cv_lib_nsl_gethostbyname=yes
10281 else
10282   echo "$as_me: failed program was:" >&5
10283 cat conftest.$ac_ext >&5
10284 ac_cv_lib_nsl_gethostbyname=no
10285 fi
10286 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10287 LIBS=$ac_check_lib_save_LIBS
10288 fi
10289 echo "$as_me:10289: result: $ac_cv_lib_nsl_gethostbyname" >&5
10290 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6
10291 if test $ac_cv_lib_nsl_gethostbyname = yes; then
10292   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
10293 fi
10294
10295       if test $ac_cv_lib_nsl_gethostbyname = no; then
10296         echo "$as_me:10296: checking for gethostbyname in -lbsd" >&5
10297 echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6
10298 if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then
10299   echo $ECHO_N "(cached) $ECHO_C" >&6
10300 else
10301   ac_check_lib_save_LIBS=$LIBS
10302 LIBS="-lbsd  $LIBS"
10303 cat >conftest.$ac_ext <<_ACEOF
10304 #line 10304 "configure"
10305 #include "confdefs.h"
10306
10307 /* Override any gcc2 internal prototype to avoid an error.  */
10308 #ifdef __cplusplus
10309 extern "C"
10310 #endif
10311 /* We use char because int might match the return type of a gcc2
10312    builtin and then its argument prototype would still apply.  */
10313 char gethostbyname ();
10314 int
10315 main ()
10316 {
10317 gethostbyname ();
10318   ;
10319   return 0;
10320 }
10321 _ACEOF
10322 rm -f conftest.$ac_objext conftest$ac_exeext
10323 if { (eval echo "$as_me:10323: \"$ac_link\"") >&5
10324   (eval $ac_link) 2>&5
10325   ac_status=$?
10326   echo "$as_me:10326: \$? = $ac_status" >&5
10327   (exit $ac_status); } &&
10328          { ac_try='test -s conftest$ac_exeext'
10329   { (eval echo "$as_me:10329: \"$ac_try\"") >&5
10330   (eval $ac_try) 2>&5
10331   ac_status=$?
10332   echo "$as_me:10332: \$? = $ac_status" >&5
10333   (exit $ac_status); }; }; then
10334   ac_cv_lib_bsd_gethostbyname=yes
10335 else
10336   echo "$as_me: failed program was:" >&5
10337 cat conftest.$ac_ext >&5
10338 ac_cv_lib_bsd_gethostbyname=no
10339 fi
10340 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10341 LIBS=$ac_check_lib_save_LIBS
10342 fi
10343 echo "$as_me:10343: result: $ac_cv_lib_bsd_gethostbyname" >&5
10344 echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6
10345 if test $ac_cv_lib_bsd_gethostbyname = yes; then
10346   X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
10347 fi
10348
10349       fi
10350     fi
10351
10352     # lieder@skyler.mavd.honeywell.com says without -lsocket,
10353     # socket/setsockopt and other routines are undefined under SCO ODT
10354     # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
10355     # on later versions), says Simon Leinen: it contains gethostby*
10356     # variants that don't use the nameserver (or something).  -lsocket
10357     # must be given before -lnsl if both are needed.  We assume that
10358     # if connect needs -lnsl, so does gethostbyname.
10359     echo "$as_me:10359: checking for connect" >&5
10360 echo $ECHO_N "checking for connect... $ECHO_C" >&6
10361 if test "${ac_cv_func_connect+set}" = set; then
10362   echo $ECHO_N "(cached) $ECHO_C" >&6
10363 else
10364   cat >conftest.$ac_ext <<_ACEOF
10365 #line 10365 "configure"
10366 #include "confdefs.h"
10367 /* System header to define __stub macros and hopefully few prototypes,
10368     which can conflict with char connect (); below.  */
10369 #include <assert.h>
10370 /* Override any gcc2 internal prototype to avoid an error.  */
10371 #ifdef __cplusplus
10372 extern "C"
10373 #endif
10374 /* We use char because int might match the return type of a gcc2
10375    builtin and then its argument prototype would still apply.  */
10376 char connect ();
10377 char (*f) ();
10378
10379 int
10380 main ()
10381 {
10382 /* The GNU C library defines this for functions which it implements
10383     to always fail with ENOSYS.  Some functions are actually named
10384     something starting with __ and the normal name is an alias.  */
10385 #if defined (__stub_connect) || defined (__stub___connect)
10386 choke me
10387 #else
10388 f = connect; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
10389 #endif
10390
10391   ;
10392   return 0;
10393 }
10394 _ACEOF
10395 rm -f conftest.$ac_objext conftest$ac_exeext
10396 if { (eval echo "$as_me:10396: \"$ac_link\"") >&5
10397   (eval $ac_link) 2>&5
10398   ac_status=$?
10399   echo "$as_me:10399: \$? = $ac_status" >&5
10400   (exit $ac_status); } &&
10401          { ac_try='test -s conftest$ac_exeext'
10402   { (eval echo "$as_me:10402: \"$ac_try\"") >&5
10403   (eval $ac_try) 2>&5
10404   ac_status=$?
10405   echo "$as_me:10405: \$? = $ac_status" >&5
10406   (exit $ac_status); }; }; then
10407   ac_cv_func_connect=yes
10408 else
10409   echo "$as_me: failed program was:" >&5
10410 cat conftest.$ac_ext >&5
10411 ac_cv_func_connect=no
10412 fi
10413 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10414 fi
10415 echo "$as_me:10415: result: $ac_cv_func_connect" >&5
10416 echo "${ECHO_T}$ac_cv_func_connect" >&6
10417
10418     if test $ac_cv_func_connect = no; then
10419       echo "$as_me:10419: checking for connect in -lsocket" >&5
10420 echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6
10421 if test "${ac_cv_lib_socket_connect+set}" = set; then
10422   echo $ECHO_N "(cached) $ECHO_C" >&6
10423 else
10424   ac_check_lib_save_LIBS=$LIBS
10425 LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
10426 cat >conftest.$ac_ext <<_ACEOF
10427 #line 10427 "configure"
10428 #include "confdefs.h"
10429
10430 /* Override any gcc2 internal prototype to avoid an error.  */
10431 #ifdef __cplusplus
10432 extern "C"
10433 #endif
10434 /* We use char because int might match the return type of a gcc2
10435    builtin and then its argument prototype would still apply.  */
10436 char connect ();
10437 int
10438 main ()
10439 {
10440 connect ();
10441   ;
10442   return 0;
10443 }
10444 _ACEOF
10445 rm -f conftest.$ac_objext conftest$ac_exeext
10446 if { (eval echo "$as_me:10446: \"$ac_link\"") >&5
10447   (eval $ac_link) 2>&5
10448   ac_status=$?
10449   echo "$as_me:10449: \$? = $ac_status" >&5
10450   (exit $ac_status); } &&
10451          { ac_try='test -s conftest$ac_exeext'
10452   { (eval echo "$as_me:10452: \"$ac_try\"") >&5
10453   (eval $ac_try) 2>&5
10454   ac_status=$?
10455   echo "$as_me:10455: \$? = $ac_status" >&5
10456   (exit $ac_status); }; }; then
10457   ac_cv_lib_socket_connect=yes
10458 else
10459   echo "$as_me: failed program was:" >&5
10460 cat conftest.$ac_ext >&5
10461 ac_cv_lib_socket_connect=no
10462 fi
10463 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10464 LIBS=$ac_check_lib_save_LIBS
10465 fi
10466 echo "$as_me:10466: result: $ac_cv_lib_socket_connect" >&5
10467 echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6
10468 if test $ac_cv_lib_socket_connect = yes; then
10469   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
10470 fi
10471
10472     fi
10473
10474     # Guillermo Gomez says -lposix is necessary on A/UX.
10475     echo "$as_me:10475: checking for remove" >&5
10476 echo $ECHO_N "checking for remove... $ECHO_C" >&6
10477 if test "${ac_cv_func_remove+set}" = set; then
10478   echo $ECHO_N "(cached) $ECHO_C" >&6
10479 else
10480   cat >conftest.$ac_ext <<_ACEOF
10481 #line 10481 "configure"
10482 #include "confdefs.h"
10483 /* System header to define __stub macros and hopefully few prototypes,
10484     which can conflict with char remove (); below.  */
10485 #include <assert.h>
10486 /* Override any gcc2 internal prototype to avoid an error.  */
10487 #ifdef __cplusplus
10488 extern "C"
10489 #endif
10490 /* We use char because int might match the return type of a gcc2
10491    builtin and then its argument prototype would still apply.  */
10492 char remove ();
10493 char (*f) ();
10494
10495 int
10496 main ()
10497 {
10498 /* The GNU C library defines this for functions which it implements
10499     to always fail with ENOSYS.  Some functions are actually named
10500     something starting with __ and the normal name is an alias.  */
10501 #if defined (__stub_remove) || defined (__stub___remove)
10502 choke me
10503 #else
10504 f = remove; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
10505 #endif
10506
10507   ;
10508   return 0;
10509 }
10510 _ACEOF
10511 rm -f conftest.$ac_objext conftest$ac_exeext
10512 if { (eval echo "$as_me:10512: \"$ac_link\"") >&5
10513   (eval $ac_link) 2>&5
10514   ac_status=$?
10515   echo "$as_me:10515: \$? = $ac_status" >&5
10516   (exit $ac_status); } &&
10517          { ac_try='test -s conftest$ac_exeext'
10518   { (eval echo "$as_me:10518: \"$ac_try\"") >&5
10519   (eval $ac_try) 2>&5
10520   ac_status=$?
10521   echo "$as_me:10521: \$? = $ac_status" >&5
10522   (exit $ac_status); }; }; then
10523   ac_cv_func_remove=yes
10524 else
10525   echo "$as_me: failed program was:" >&5
10526 cat conftest.$ac_ext >&5
10527 ac_cv_func_remove=no
10528 fi
10529 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10530 fi
10531 echo "$as_me:10531: result: $ac_cv_func_remove" >&5
10532 echo "${ECHO_T}$ac_cv_func_remove" >&6
10533
10534     if test $ac_cv_func_remove = no; then
10535       echo "$as_me:10535: checking for remove in -lposix" >&5
10536 echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6
10537 if test "${ac_cv_lib_posix_remove+set}" = set; then
10538   echo $ECHO_N "(cached) $ECHO_C" >&6
10539 else
10540   ac_check_lib_save_LIBS=$LIBS
10541 LIBS="-lposix  $LIBS"
10542 cat >conftest.$ac_ext <<_ACEOF
10543 #line 10543 "configure"
10544 #include "confdefs.h"
10545
10546 /* Override any gcc2 internal prototype to avoid an error.  */
10547 #ifdef __cplusplus
10548 extern "C"
10549 #endif
10550 /* We use char because int might match the return type of a gcc2
10551    builtin and then its argument prototype would still apply.  */
10552 char remove ();
10553 int
10554 main ()
10555 {
10556 remove ();
10557   ;
10558   return 0;
10559 }
10560 _ACEOF
10561 rm -f conftest.$ac_objext conftest$ac_exeext
10562 if { (eval echo "$as_me:10562: \"$ac_link\"") >&5
10563   (eval $ac_link) 2>&5
10564   ac_status=$?
10565   echo "$as_me:10565: \$? = $ac_status" >&5
10566   (exit $ac_status); } &&
10567          { ac_try='test -s conftest$ac_exeext'
10568   { (eval echo "$as_me:10568: \"$ac_try\"") >&5
10569   (eval $ac_try) 2>&5
10570   ac_status=$?
10571   echo "$as_me:10571: \$? = $ac_status" >&5
10572   (exit $ac_status); }; }; then
10573   ac_cv_lib_posix_remove=yes
10574 else
10575   echo "$as_me: failed program was:" >&5
10576 cat conftest.$ac_ext >&5
10577 ac_cv_lib_posix_remove=no
10578 fi
10579 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10580 LIBS=$ac_check_lib_save_LIBS
10581 fi
10582 echo "$as_me:10582: result: $ac_cv_lib_posix_remove" >&5
10583 echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6
10584 if test $ac_cv_lib_posix_remove = yes; then
10585   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
10586 fi
10587
10588     fi
10589
10590     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
10591     echo "$as_me:10591: checking for shmat" >&5
10592 echo $ECHO_N "checking for shmat... $ECHO_C" >&6
10593 if test "${ac_cv_func_shmat+set}" = set; then
10594   echo $ECHO_N "(cached) $ECHO_C" >&6
10595 else
10596   cat >conftest.$ac_ext <<_ACEOF
10597 #line 10597 "configure"
10598 #include "confdefs.h"
10599 /* System header to define __stub macros and hopefully few prototypes,
10600     which can conflict with char shmat (); below.  */
10601 #include <assert.h>
10602 /* Override any gcc2 internal prototype to avoid an error.  */
10603 #ifdef __cplusplus
10604 extern "C"
10605 #endif
10606 /* We use char because int might match the return type of a gcc2
10607    builtin and then its argument prototype would still apply.  */
10608 char shmat ();
10609 char (*f) ();
10610
10611 int
10612 main ()
10613 {
10614 /* The GNU C library defines this for functions which it implements
10615     to always fail with ENOSYS.  Some functions are actually named
10616     something starting with __ and the normal name is an alias.  */
10617 #if defined (__stub_shmat) || defined (__stub___shmat)
10618 choke me
10619 #else
10620 f = shmat; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
10621 #endif
10622
10623   ;
10624   return 0;
10625 }
10626 _ACEOF
10627 rm -f conftest.$ac_objext conftest$ac_exeext
10628 if { (eval echo "$as_me:10628: \"$ac_link\"") >&5
10629   (eval $ac_link) 2>&5
10630   ac_status=$?
10631   echo "$as_me:10631: \$? = $ac_status" >&5
10632   (exit $ac_status); } &&
10633          { ac_try='test -s conftest$ac_exeext'
10634   { (eval echo "$as_me:10634: \"$ac_try\"") >&5
10635   (eval $ac_try) 2>&5
10636   ac_status=$?
10637   echo "$as_me:10637: \$? = $ac_status" >&5
10638   (exit $ac_status); }; }; then
10639   ac_cv_func_shmat=yes
10640 else
10641   echo "$as_me: failed program was:" >&5
10642 cat conftest.$ac_ext >&5
10643 ac_cv_func_shmat=no
10644 fi
10645 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10646 fi
10647 echo "$as_me:10647: result: $ac_cv_func_shmat" >&5
10648 echo "${ECHO_T}$ac_cv_func_shmat" >&6
10649
10650     if test $ac_cv_func_shmat = no; then
10651       echo "$as_me:10651: checking for shmat in -lipc" >&5
10652 echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6
10653 if test "${ac_cv_lib_ipc_shmat+set}" = set; then
10654   echo $ECHO_N "(cached) $ECHO_C" >&6
10655 else
10656   ac_check_lib_save_LIBS=$LIBS
10657 LIBS="-lipc  $LIBS"
10658 cat >conftest.$ac_ext <<_ACEOF
10659 #line 10659 "configure"
10660 #include "confdefs.h"
10661
10662 /* Override any gcc2 internal prototype to avoid an error.  */
10663 #ifdef __cplusplus
10664 extern "C"
10665 #endif
10666 /* We use char because int might match the return type of a gcc2
10667    builtin and then its argument prototype would still apply.  */
10668 char shmat ();
10669 int
10670 main ()
10671 {
10672 shmat ();
10673   ;
10674   return 0;
10675 }
10676 _ACEOF
10677 rm -f conftest.$ac_objext conftest$ac_exeext
10678 if { (eval echo "$as_me:10678: \"$ac_link\"") >&5
10679   (eval $ac_link) 2>&5
10680   ac_status=$?
10681   echo "$as_me:10681: \$? = $ac_status" >&5
10682   (exit $ac_status); } &&
10683          { ac_try='test -s conftest$ac_exeext'
10684   { (eval echo "$as_me:10684: \"$ac_try\"") >&5
10685   (eval $ac_try) 2>&5
10686   ac_status=$?
10687   echo "$as_me:10687: \$? = $ac_status" >&5
10688   (exit $ac_status); }; }; then
10689   ac_cv_lib_ipc_shmat=yes
10690 else
10691   echo "$as_me: failed program was:" >&5
10692 cat conftest.$ac_ext >&5
10693 ac_cv_lib_ipc_shmat=no
10694 fi
10695 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10696 LIBS=$ac_check_lib_save_LIBS
10697 fi
10698 echo "$as_me:10698: result: $ac_cv_lib_ipc_shmat" >&5
10699 echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6
10700 if test $ac_cv_lib_ipc_shmat = yes; then
10701   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
10702 fi
10703
10704     fi
10705   fi
10706
10707   # Check for libraries that X11R6 Xt/Xaw programs need.
10708   ac_save_LDFLAGS=$LDFLAGS
10709   test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
10710   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
10711   # check for ICE first), but we must link in the order -lSM -lICE or
10712   # we get undefined symbols.  So assume we have SM if we have ICE.
10713   # These have to be linked with before -lX11, unlike the other
10714   # libraries we check for below, so use a different variable.
10715   # John Interrante, Karl Berry
10716   echo "$as_me:10716: checking for IceConnectionNumber in -lICE" >&5
10717 echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6
10718 if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then
10719   echo $ECHO_N "(cached) $ECHO_C" >&6
10720 else
10721   ac_check_lib_save_LIBS=$LIBS
10722 LIBS="-lICE $X_EXTRA_LIBS $LIBS"
10723 cat >conftest.$ac_ext <<_ACEOF
10724 #line 10724 "configure"
10725 #include "confdefs.h"
10726
10727 /* Override any gcc2 internal prototype to avoid an error.  */
10728 #ifdef __cplusplus
10729 extern "C"
10730 #endif
10731 /* We use char because int might match the return type of a gcc2
10732    builtin and then its argument prototype would still apply.  */
10733 char IceConnectionNumber ();
10734 int
10735 main ()
10736 {
10737 IceConnectionNumber ();
10738   ;
10739   return 0;
10740 }
10741 _ACEOF
10742 rm -f conftest.$ac_objext conftest$ac_exeext
10743 if { (eval echo "$as_me:10743: \"$ac_link\"") >&5
10744   (eval $ac_link) 2>&5
10745   ac_status=$?
10746   echo "$as_me:10746: \$? = $ac_status" >&5
10747   (exit $ac_status); } &&
10748          { ac_try='test -s conftest$ac_exeext'
10749   { (eval echo "$as_me:10749: \"$ac_try\"") >&5
10750   (eval $ac_try) 2>&5
10751   ac_status=$?
10752   echo "$as_me:10752: \$? = $ac_status" >&5
10753   (exit $ac_status); }; }; then
10754   ac_cv_lib_ICE_IceConnectionNumber=yes
10755 else
10756   echo "$as_me: failed program was:" >&5
10757 cat conftest.$ac_ext >&5
10758 ac_cv_lib_ICE_IceConnectionNumber=no
10759 fi
10760 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10761 LIBS=$ac_check_lib_save_LIBS
10762 fi
10763 echo "$as_me:10763: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
10764 echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6
10765 if test $ac_cv_lib_ICE_IceConnectionNumber = yes; then
10766   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
10767 fi
10768
10769   LDFLAGS=$ac_save_LDFLAGS
10770
10771 fi
10772
10773 cf_x_athena=${cf_x_athena:-Xaw}
10774
10775 echo "$as_me:10775: checking if you want to link with Xaw 3d library" >&5
10776 echo $ECHO_N "checking if you want to link with Xaw 3d library... $ECHO_C" >&6
10777 withval=
10778
10779 # Check whether --with-Xaw3d or --without-Xaw3d was given.
10780 if test "${with_Xaw3d+set}" = set; then
10781   withval="$with_Xaw3d"
10782
10783 fi;
10784 if test "$withval" = yes ; then
10785         cf_x_athena=Xaw3d
10786         echo "$as_me:10786: result: yes" >&5
10787 echo "${ECHO_T}yes" >&6
10788 else
10789         echo "$as_me:10789: result: no" >&5
10790 echo "${ECHO_T}no" >&6
10791 fi
10792
10793 echo "$as_me:10793: checking if you want to link with Xaw 3d xft library" >&5
10794 echo $ECHO_N "checking if you want to link with Xaw 3d xft library... $ECHO_C" >&6
10795 withval=
10796
10797 # Check whether --with-Xaw3dxft or --without-Xaw3dxft was given.
10798 if test "${with_Xaw3dxft+set}" = set; then
10799   withval="$with_Xaw3dxft"
10800
10801 fi;
10802 if test "$withval" = yes ; then
10803         cf_x_athena=Xaw3dxft
10804         echo "$as_me:10804: result: yes" >&5
10805 echo "${ECHO_T}yes" >&6
10806 else
10807         echo "$as_me:10807: result: no" >&5
10808 echo "${ECHO_T}no" >&6
10809 fi
10810
10811 echo "$as_me:10811: checking if you want to link with neXT Athena library" >&5
10812 echo $ECHO_N "checking if you want to link with neXT Athena library... $ECHO_C" >&6
10813 withval=
10814
10815 # Check whether --with-neXtaw or --without-neXtaw was given.
10816 if test "${with_neXtaw+set}" = set; then
10817   withval="$with_neXtaw"
10818
10819 fi;
10820 if test "$withval" = yes ; then
10821         cf_x_athena=neXtaw
10822         echo "$as_me:10822: result: yes" >&5
10823 echo "${ECHO_T}yes" >&6
10824 else
10825         echo "$as_me:10825: result: no" >&5
10826 echo "${ECHO_T}no" >&6
10827 fi
10828
10829 echo "$as_me:10829: checking if you want to link with Athena-Plus library" >&5
10830 echo $ECHO_N "checking if you want to link with Athena-Plus library... $ECHO_C" >&6
10831 withval=
10832
10833 # Check whether --with-XawPlus or --without-XawPlus was given.
10834 if test "${with_XawPlus+set}" = set; then
10835   withval="$with_XawPlus"
10836
10837 fi;
10838 if test "$withval" = yes ; then
10839         cf_x_athena=XawPlus
10840         echo "$as_me:10840: result: yes" >&5
10841 echo "${ECHO_T}yes" >&6
10842 else
10843         echo "$as_me:10843: result: no" >&5
10844 echo "${ECHO_T}no" >&6
10845 fi
10846
10847 cf_x_athena_lib=""
10848
10849 if test "$PKG_CONFIG" != none ; then
10850         cf_athena_list=
10851         test "$cf_x_athena" = Xaw && cf_athena_list="xaw8 xaw7 xaw6"
10852         for cf_athena_pkg in \
10853                 $cf_athena_list \
10854                 ${cf_x_athena} \
10855                 ${cf_x_athena}-devel \
10856                 lib${cf_x_athena} \
10857                 lib${cf_x_athena}-devel
10858         do
10859
10860 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists $cf_athena_pkg; then
10861         test -n "$verbose" && echo "    found package $cf_athena_pkg" 1>&6
10862
10863 echo "${as_me:-configure}:10863: testing found package $cf_athena_pkg ..." 1>&5
10864
10865         cf_pkgconfig_incs="`$PKG_CONFIG --cflags $cf_athena_pkg 2>/dev/null`"
10866         cf_pkgconfig_libs="`$PKG_CONFIG --libs   $cf_athena_pkg 2>/dev/null`"
10867         test -n "$verbose" && echo "    package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs" 1>&6
10868
10869 echo "${as_me:-configure}:10869: testing package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs ..." 1>&5
10870
10871         test -n "$verbose" && echo "    package $cf_athena_pkg LIBS: $cf_pkgconfig_libs" 1>&6
10872
10873 echo "${as_me:-configure}:10873: testing package $cf_athena_pkg LIBS: $cf_pkgconfig_libs ..." 1>&5
10874
10875 cf_fix_cppflags=no
10876 cf_new_cflags=
10877 cf_new_cppflags=
10878 cf_new_extra_cppflags=
10879
10880 for cf_add_cflags in $cf_pkgconfig_incs
10881 do
10882 case $cf_fix_cppflags in
10883 (no)
10884         case $cf_add_cflags in
10885         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10886                 case $cf_add_cflags in
10887                 (-D*)
10888                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10889
10890                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10891                                 && test -z "${cf_tst_cflags}" \
10892                                 && cf_fix_cppflags=yes
10893
10894                         if test $cf_fix_cppflags = yes ; then
10895                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10896                                 continue
10897                         elif test "${cf_tst_cflags}" = "\"'" ; then
10898                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10899                                 continue
10900                         fi
10901                         ;;
10902                 esac
10903                 case "$CPPFLAGS" in
10904                 (*$cf_add_cflags)
10905                         ;;
10906                 (*)
10907                         case $cf_add_cflags in
10908                         (-D*)
10909                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10910
10911 CPPFLAGS=`echo "$CPPFLAGS" | \
10912         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10913                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10914
10915                                 ;;
10916                         esac
10917                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10918                         ;;
10919                 esac
10920                 ;;
10921         (*)
10922                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10923                 ;;
10924         esac
10925         ;;
10926 (yes)
10927         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10928
10929         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10930
10931         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10932                 && test -z "${cf_tst_cflags}" \
10933                 && cf_fix_cppflags=no
10934         ;;
10935 esac
10936 done
10937
10938 if test -n "$cf_new_cflags" ; then
10939
10940         CFLAGS="$CFLAGS $cf_new_cflags"
10941 fi
10942
10943 if test -n "$cf_new_cppflags" ; then
10944
10945         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10946 fi
10947
10948 if test -n "$cf_new_extra_cppflags" ; then
10949
10950         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10951 fi
10952
10953 cf_add_libs="$cf_pkgconfig_libs"
10954 # Filter out duplicates - this happens with badly-designed ".pc" files...
10955 for cf_add_1lib in $LIBS
10956 do
10957         for cf_add_2lib in $cf_add_libs
10958         do
10959                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
10960                 then
10961                         cf_add_1lib=
10962                         break
10963                 fi
10964         done
10965         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
10966 done
10967 LIBS="$cf_add_libs"
10968
10969                         cf_x_athena_lib="$cf_pkgconfig_libs"
10970
10971 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
10972
10973                         cat >>confdefs.h <<EOF
10974 #define $cf_x_athena_LIBS 1
10975 EOF
10976
10977         for cf_trim_lib in Xmu Xt X11
10978         do
10979                 case "$LIBS" in
10980                 (*-l$cf_trim_lib\ *-l$cf_trim_lib*)
10981                         LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
10982                         test -n "$verbose" && echo "    ..trimmed $LIBS" 1>&6
10983
10984 echo "${as_me:-configure}:10984: testing ..trimmed $LIBS ..." 1>&5
10985
10986                         ;;
10987                 esac
10988         done
10989
10990 echo "$as_me:10990: checking for usable $cf_x_athena/Xmu package" >&5
10991 echo $ECHO_N "checking for usable $cf_x_athena/Xmu package... $ECHO_C" >&6
10992 if test "${cf_cv_xaw_compat+set}" = set; then
10993   echo $ECHO_N "(cached) $ECHO_C" >&6
10994 else
10995
10996 cat >conftest.$ac_ext <<_ACEOF
10997 #line 10997 "configure"
10998 #include "confdefs.h"
10999
11000 #include <X11/Xmu/CharSet.h>
11001
11002 int
11003 main ()
11004 {
11005
11006 int check = XmuCompareISOLatin1("big", "small")
11007
11008   ;
11009   return 0;
11010 }
11011 _ACEOF
11012 rm -f conftest.$ac_objext conftest$ac_exeext
11013 if { (eval echo "$as_me:11013: \"$ac_link\"") >&5
11014   (eval $ac_link) 2>&5
11015   ac_status=$?
11016   echo "$as_me:11016: \$? = $ac_status" >&5
11017   (exit $ac_status); } &&
11018          { ac_try='test -s conftest$ac_exeext'
11019   { (eval echo "$as_me:11019: \"$ac_try\"") >&5
11020   (eval $ac_try) 2>&5
11021   ac_status=$?
11022   echo "$as_me:11022: \$? = $ac_status" >&5
11023   (exit $ac_status); }; }; then
11024   cf_cv_xaw_compat=yes
11025 else
11026   echo "$as_me: failed program was:" >&5
11027 cat conftest.$ac_ext >&5
11028 cf_cv_xaw_compat=no
11029 fi
11030 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11031 fi
11032 echo "$as_me:11032: result: $cf_cv_xaw_compat" >&5
11033 echo "${ECHO_T}$cf_cv_xaw_compat" >&6
11034
11035                         if test "$cf_cv_xaw_compat" = no
11036                         then
11037                                 # workaround for broken ".pc" files...
11038                                 case "$cf_x_athena_lib" in
11039                                 (*-lXmu*)
11040                                         ;;
11041                                 (*)
11042                                         test -n "$verbose" && echo "    work around broken package" 1>&6
11043
11044 echo "${as_me:-configure}:11044: testing work around broken package ..." 1>&5
11045
11046                                         cf_save_xmu="$LIBS"
11047                                         cf_first_lib=`echo "$cf_save_xmu" | sed -e 's/^  *//' -e 's/ .*//'`
11048
11049 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xmu; then
11050         test -n "$verbose" && echo "    found package xmu" 1>&6
11051
11052 echo "${as_me:-configure}:11052: testing found package xmu ..." 1>&5
11053
11054         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xmu 2>/dev/null`"
11055         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xmu 2>/dev/null`"
11056         test -n "$verbose" && echo "    package xmu CFLAGS: $cf_pkgconfig_incs" 1>&6
11057
11058 echo "${as_me:-configure}:11058: testing package xmu CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11059
11060         test -n "$verbose" && echo "    package xmu LIBS: $cf_pkgconfig_libs" 1>&6
11061
11062 echo "${as_me:-configure}:11062: testing package xmu LIBS: $cf_pkgconfig_libs ..." 1>&5
11063
11064 cf_fix_cppflags=no
11065 cf_new_cflags=
11066 cf_new_cppflags=
11067 cf_new_extra_cppflags=
11068
11069 for cf_add_cflags in $cf_pkgconfig_incs
11070 do
11071 case $cf_fix_cppflags in
11072 (no)
11073         case $cf_add_cflags in
11074         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11075                 case $cf_add_cflags in
11076                 (-D*)
11077                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11078
11079                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11080                                 && test -z "${cf_tst_cflags}" \
11081                                 && cf_fix_cppflags=yes
11082
11083                         if test $cf_fix_cppflags = yes ; then
11084                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11085                                 continue
11086                         elif test "${cf_tst_cflags}" = "\"'" ; then
11087                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11088                                 continue
11089                         fi
11090                         ;;
11091                 esac
11092                 case "$CPPFLAGS" in
11093                 (*$cf_add_cflags)
11094                         ;;
11095                 (*)
11096                         case $cf_add_cflags in
11097                         (-D*)
11098                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11099
11100 CPPFLAGS=`echo "$CPPFLAGS" | \
11101         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11102                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11103
11104                                 ;;
11105                         esac
11106                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11107                         ;;
11108                 esac
11109                 ;;
11110         (*)
11111                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11112                 ;;
11113         esac
11114         ;;
11115 (yes)
11116         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11117
11118         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11119
11120         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11121                 && test -z "${cf_tst_cflags}" \
11122                 && cf_fix_cppflags=no
11123         ;;
11124 esac
11125 done
11126
11127 if test -n "$cf_new_cflags" ; then
11128
11129         CFLAGS="$CFLAGS $cf_new_cflags"
11130 fi
11131
11132 if test -n "$cf_new_cppflags" ; then
11133
11134         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11135 fi
11136
11137 if test -n "$cf_new_extra_cppflags" ; then
11138
11139         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11140 fi
11141
11142 cf_add_libs="$cf_pkgconfig_libs"
11143 # Filter out duplicates - this happens with badly-designed ".pc" files...
11144 for cf_add_1lib in $LIBS
11145 do
11146         for cf_add_2lib in $cf_add_libs
11147         do
11148                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11149                 then
11150                         cf_add_1lib=
11151                         break
11152                 fi
11153         done
11154         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11155 done
11156 LIBS="$cf_add_libs"
11157
11158                                                         LIBS="$cf_save_xmu"
11159
11160 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
11161
11162 echo "${as_me:-configure}:11162: testing ...before $LIBS ..." 1>&5
11163
11164 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib $cf_pkgconfig_libs %" -e 's%  % %g'`
11165 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
11166
11167 echo "${as_me:-configure}:11167: testing ...after  $LIBS ..." 1>&5
11168
11169 else
11170         cf_pkgconfig_incs=
11171         cf_pkgconfig_libs=
11172
11173 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
11174
11175 echo "${as_me:-configure}:11175: testing ...before $LIBS ..." 1>&5
11176
11177 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib -lXmu %" -e 's%  % %g'`
11178 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
11179
11180 echo "${as_me:-configure}:11180: testing ...after  $LIBS ..." 1>&5
11181
11182 fi
11183
11184         for cf_trim_lib in Xmu Xt X11
11185         do
11186                 case "$LIBS" in
11187                 (*-l$cf_trim_lib\ *-l$cf_trim_lib*)
11188                         LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
11189                         test -n "$verbose" && echo "    ..trimmed $LIBS" 1>&6
11190
11191 echo "${as_me:-configure}:11191: testing ..trimmed $LIBS ..." 1>&5
11192
11193                         ;;
11194                 esac
11195         done
11196
11197                                         ;;
11198                                 esac
11199                         fi
11200
11201                         break
11202 else
11203         cf_pkgconfig_incs=
11204         cf_pkgconfig_libs=
11205         :
11206 fi
11207
11208         done
11209 fi
11210
11211 if test -z "$cf_x_athena_lib" ; then
11212
11213 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists Xext; then
11214         test -n "$verbose" && echo "    found package Xext" 1>&6
11215
11216 echo "${as_me:-configure}:11216: testing found package Xext ..." 1>&5
11217
11218         cf_pkgconfig_incs="`$PKG_CONFIG --cflags Xext 2>/dev/null`"
11219         cf_pkgconfig_libs="`$PKG_CONFIG --libs   Xext 2>/dev/null`"
11220         test -n "$verbose" && echo "    package Xext CFLAGS: $cf_pkgconfig_incs" 1>&6
11221
11222 echo "${as_me:-configure}:11222: testing package Xext CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11223
11224         test -n "$verbose" && echo "    package Xext LIBS: $cf_pkgconfig_libs" 1>&6
11225
11226 echo "${as_me:-configure}:11226: testing package Xext LIBS: $cf_pkgconfig_libs ..." 1>&5
11227
11228 cf_fix_cppflags=no
11229 cf_new_cflags=
11230 cf_new_cppflags=
11231 cf_new_extra_cppflags=
11232
11233 for cf_add_cflags in $cf_pkgconfig_incs
11234 do
11235 case $cf_fix_cppflags in
11236 (no)
11237         case $cf_add_cflags in
11238         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11239                 case $cf_add_cflags in
11240                 (-D*)
11241                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11242
11243                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11244                                 && test -z "${cf_tst_cflags}" \
11245                                 && cf_fix_cppflags=yes
11246
11247                         if test $cf_fix_cppflags = yes ; then
11248                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11249                                 continue
11250                         elif test "${cf_tst_cflags}" = "\"'" ; then
11251                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11252                                 continue
11253                         fi
11254                         ;;
11255                 esac
11256                 case "$CPPFLAGS" in
11257                 (*$cf_add_cflags)
11258                         ;;
11259                 (*)
11260                         case $cf_add_cflags in
11261                         (-D*)
11262                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11263
11264 CPPFLAGS=`echo "$CPPFLAGS" | \
11265         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11266                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11267
11268                                 ;;
11269                         esac
11270                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11271                         ;;
11272                 esac
11273                 ;;
11274         (*)
11275                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11276                 ;;
11277         esac
11278         ;;
11279 (yes)
11280         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11281
11282         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11283
11284         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11285                 && test -z "${cf_tst_cflags}" \
11286                 && cf_fix_cppflags=no
11287         ;;
11288 esac
11289 done
11290
11291 if test -n "$cf_new_cflags" ; then
11292
11293         CFLAGS="$CFLAGS $cf_new_cflags"
11294 fi
11295
11296 if test -n "$cf_new_cppflags" ; then
11297
11298         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11299 fi
11300
11301 if test -n "$cf_new_extra_cppflags" ; then
11302
11303         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11304 fi
11305
11306 cf_add_libs="$cf_pkgconfig_libs"
11307 # Filter out duplicates - this happens with badly-designed ".pc" files...
11308 for cf_add_1lib in $LIBS
11309 do
11310         for cf_add_2lib in $cf_add_libs
11311         do
11312                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11313                 then
11314                         cf_add_1lib=
11315                         break
11316                 fi
11317         done
11318         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11319 done
11320 LIBS="$cf_add_libs"
11321
11322         :
11323 else
11324         cf_pkgconfig_incs=
11325         cf_pkgconfig_libs=
11326
11327         echo "$as_me:11327: checking for XextCreateExtension in -lXext" >&5
11328 echo $ECHO_N "checking for XextCreateExtension in -lXext... $ECHO_C" >&6
11329 if test "${ac_cv_lib_Xext_XextCreateExtension+set}" = set; then
11330   echo $ECHO_N "(cached) $ECHO_C" >&6
11331 else
11332   ac_check_lib_save_LIBS=$LIBS
11333 LIBS="-lXext  $LIBS"
11334 cat >conftest.$ac_ext <<_ACEOF
11335 #line 11335 "configure"
11336 #include "confdefs.h"
11337
11338 /* Override any gcc2 internal prototype to avoid an error.  */
11339 #ifdef __cplusplus
11340 extern "C"
11341 #endif
11342 /* We use char because int might match the return type of a gcc2
11343    builtin and then its argument prototype would still apply.  */
11344 char XextCreateExtension ();
11345 int
11346 main ()
11347 {
11348 XextCreateExtension ();
11349   ;
11350   return 0;
11351 }
11352 _ACEOF
11353 rm -f conftest.$ac_objext conftest$ac_exeext
11354 if { (eval echo "$as_me:11354: \"$ac_link\"") >&5
11355   (eval $ac_link) 2>&5
11356   ac_status=$?
11357   echo "$as_me:11357: \$? = $ac_status" >&5
11358   (exit $ac_status); } &&
11359          { ac_try='test -s conftest$ac_exeext'
11360   { (eval echo "$as_me:11360: \"$ac_try\"") >&5
11361   (eval $ac_try) 2>&5
11362   ac_status=$?
11363   echo "$as_me:11363: \$? = $ac_status" >&5
11364   (exit $ac_status); }; }; then
11365   ac_cv_lib_Xext_XextCreateExtension=yes
11366 else
11367   echo "$as_me: failed program was:" >&5
11368 cat conftest.$ac_ext >&5
11369 ac_cv_lib_Xext_XextCreateExtension=no
11370 fi
11371 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11372 LIBS=$ac_check_lib_save_LIBS
11373 fi
11374 echo "$as_me:11374: result: $ac_cv_lib_Xext_XextCreateExtension" >&5
11375 echo "${ECHO_T}$ac_cv_lib_Xext_XextCreateExtension" >&6
11376 if test $ac_cv_lib_Xext_XextCreateExtension = yes; then
11377
11378 cf_add_libs="-lXext"
11379 # Filter out duplicates - this happens with badly-designed ".pc" files...
11380 for cf_add_1lib in $LIBS
11381 do
11382         for cf_add_2lib in $cf_add_libs
11383         do
11384                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11385                 then
11386                         cf_add_1lib=
11387                         break
11388                 fi
11389         done
11390         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11391 done
11392 LIBS="$cf_add_libs"
11393
11394 fi
11395
11396 fi
11397
11398 # OSX is schizoid about who owns /usr/X11 (old) versus /opt/X11 (new), and (and
11399 # in some cases has installed dummy files in the former, other cases replaced
11400 # it with a link to the new location).  This complicates the configure script.
11401 # Check for that pitfall, and recover using pkg-config
11402 #
11403 # If none of these are set, the configuration is almost certainly broken.
11404 if test -z "${X_CFLAGS}${X_PRE_LIBS}${X_LIBS}${X_EXTRA_LIBS}"
11405 then
11406
11407 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists x11; then
11408         test -n "$verbose" && echo "    found package x11" 1>&6
11409
11410 echo "${as_me:-configure}:11410: testing found package x11 ..." 1>&5
11411
11412         cf_pkgconfig_incs="`$PKG_CONFIG --cflags x11 2>/dev/null`"
11413         cf_pkgconfig_libs="`$PKG_CONFIG --libs   x11 2>/dev/null`"
11414         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
11415
11416 echo "${as_me:-configure}:11416: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11417
11418         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
11419
11420 echo "${as_me:-configure}:11420: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
11421
11422 cf_fix_cppflags=no
11423 cf_new_cflags=
11424 cf_new_cppflags=
11425 cf_new_extra_cppflags=
11426
11427 for cf_add_cflags in $cf_pkgconfig_incs
11428 do
11429 case $cf_fix_cppflags in
11430 (no)
11431         case $cf_add_cflags in
11432         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11433                 case $cf_add_cflags in
11434                 (-D*)
11435                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11436
11437                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11438                                 && test -z "${cf_tst_cflags}" \
11439                                 && cf_fix_cppflags=yes
11440
11441                         if test $cf_fix_cppflags = yes ; then
11442                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11443                                 continue
11444                         elif test "${cf_tst_cflags}" = "\"'" ; then
11445                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11446                                 continue
11447                         fi
11448                         ;;
11449                 esac
11450                 case "$CPPFLAGS" in
11451                 (*$cf_add_cflags)
11452                         ;;
11453                 (*)
11454                         case $cf_add_cflags in
11455                         (-D*)
11456                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11457
11458 CPPFLAGS=`echo "$CPPFLAGS" | \
11459         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11460                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11461
11462                                 ;;
11463                         esac
11464                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11465                         ;;
11466                 esac
11467                 ;;
11468         (*)
11469                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11470                 ;;
11471         esac
11472         ;;
11473 (yes)
11474         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11475
11476         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11477
11478         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11479                 && test -z "${cf_tst_cflags}" \
11480                 && cf_fix_cppflags=no
11481         ;;
11482 esac
11483 done
11484
11485 if test -n "$cf_new_cflags" ; then
11486
11487         CFLAGS="$CFLAGS $cf_new_cflags"
11488 fi
11489
11490 if test -n "$cf_new_cppflags" ; then
11491
11492         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11493 fi
11494
11495 if test -n "$cf_new_extra_cppflags" ; then
11496
11497         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11498 fi
11499
11500 cf_add_libs="$cf_pkgconfig_libs"
11501 # Filter out duplicates - this happens with badly-designed ".pc" files...
11502 for cf_add_1lib in $LIBS
11503 do
11504         for cf_add_2lib in $cf_add_libs
11505         do
11506                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11507                 then
11508                         cf_add_1lib=
11509                         break
11510                 fi
11511         done
11512         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11513 done
11514 LIBS="$cf_add_libs"
11515
11516         :
11517 else
11518         cf_pkgconfig_incs=
11519         cf_pkgconfig_libs=
11520         { echo "$as_me:11520: WARNING: unable to find X11 library" >&5
11521 echo "$as_me: WARNING: unable to find X11 library" >&2;}
11522 fi
11523
11524 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists ice; then
11525         test -n "$verbose" && echo "    found package ice" 1>&6
11526
11527 echo "${as_me:-configure}:11527: testing found package ice ..." 1>&5
11528
11529         cf_pkgconfig_incs="`$PKG_CONFIG --cflags ice 2>/dev/null`"
11530         cf_pkgconfig_libs="`$PKG_CONFIG --libs   ice 2>/dev/null`"
11531         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
11532
11533 echo "${as_me:-configure}:11533: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11534
11535         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
11536
11537 echo "${as_me:-configure}:11537: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
11538
11539 cf_fix_cppflags=no
11540 cf_new_cflags=
11541 cf_new_cppflags=
11542 cf_new_extra_cppflags=
11543
11544 for cf_add_cflags in $cf_pkgconfig_incs
11545 do
11546 case $cf_fix_cppflags in
11547 (no)
11548         case $cf_add_cflags in
11549         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11550                 case $cf_add_cflags in
11551                 (-D*)
11552                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11553
11554                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11555                                 && test -z "${cf_tst_cflags}" \
11556                                 && cf_fix_cppflags=yes
11557
11558                         if test $cf_fix_cppflags = yes ; then
11559                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11560                                 continue
11561                         elif test "${cf_tst_cflags}" = "\"'" ; then
11562                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11563                                 continue
11564                         fi
11565                         ;;
11566                 esac
11567                 case "$CPPFLAGS" in
11568                 (*$cf_add_cflags)
11569                         ;;
11570                 (*)
11571                         case $cf_add_cflags in
11572                         (-D*)
11573                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11574
11575 CPPFLAGS=`echo "$CPPFLAGS" | \
11576         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11577                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11578
11579                                 ;;
11580                         esac
11581                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11582                         ;;
11583                 esac
11584                 ;;
11585         (*)
11586                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11587                 ;;
11588         esac
11589         ;;
11590 (yes)
11591         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11592
11593         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11594
11595         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11596                 && test -z "${cf_tst_cflags}" \
11597                 && cf_fix_cppflags=no
11598         ;;
11599 esac
11600 done
11601
11602 if test -n "$cf_new_cflags" ; then
11603
11604         CFLAGS="$CFLAGS $cf_new_cflags"
11605 fi
11606
11607 if test -n "$cf_new_cppflags" ; then
11608
11609         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11610 fi
11611
11612 if test -n "$cf_new_extra_cppflags" ; then
11613
11614         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11615 fi
11616
11617 cf_add_libs="$cf_pkgconfig_libs"
11618 # Filter out duplicates - this happens with badly-designed ".pc" files...
11619 for cf_add_1lib in $LIBS
11620 do
11621         for cf_add_2lib in $cf_add_libs
11622         do
11623                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11624                 then
11625                         cf_add_1lib=
11626                         break
11627                 fi
11628         done
11629         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11630 done
11631 LIBS="$cf_add_libs"
11632
11633         :
11634 else
11635         cf_pkgconfig_incs=
11636         cf_pkgconfig_libs=
11637         { echo "$as_me:11637: WARNING: unable to find ICE library" >&5
11638 echo "$as_me: WARNING: unable to find ICE library" >&2;}
11639 fi
11640
11641 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists sm; then
11642         test -n "$verbose" && echo "    found package sm" 1>&6
11643
11644 echo "${as_me:-configure}:11644: testing found package sm ..." 1>&5
11645
11646         cf_pkgconfig_incs="`$PKG_CONFIG --cflags sm 2>/dev/null`"
11647         cf_pkgconfig_libs="`$PKG_CONFIG --libs   sm 2>/dev/null`"
11648         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
11649
11650 echo "${as_me:-configure}:11650: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11651
11652         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
11653
11654 echo "${as_me:-configure}:11654: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
11655
11656 cf_fix_cppflags=no
11657 cf_new_cflags=
11658 cf_new_cppflags=
11659 cf_new_extra_cppflags=
11660
11661 for cf_add_cflags in $cf_pkgconfig_incs
11662 do
11663 case $cf_fix_cppflags in
11664 (no)
11665         case $cf_add_cflags in
11666         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11667                 case $cf_add_cflags in
11668                 (-D*)
11669                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11670
11671                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11672                                 && test -z "${cf_tst_cflags}" \
11673                                 && cf_fix_cppflags=yes
11674
11675                         if test $cf_fix_cppflags = yes ; then
11676                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11677                                 continue
11678                         elif test "${cf_tst_cflags}" = "\"'" ; then
11679                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11680                                 continue
11681                         fi
11682                         ;;
11683                 esac
11684                 case "$CPPFLAGS" in
11685                 (*$cf_add_cflags)
11686                         ;;
11687                 (*)
11688                         case $cf_add_cflags in
11689                         (-D*)
11690                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11691
11692 CPPFLAGS=`echo "$CPPFLAGS" | \
11693         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11694                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11695
11696                                 ;;
11697                         esac
11698                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11699                         ;;
11700                 esac
11701                 ;;
11702         (*)
11703                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11704                 ;;
11705         esac
11706         ;;
11707 (yes)
11708         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11709
11710         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11711
11712         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11713                 && test -z "${cf_tst_cflags}" \
11714                 && cf_fix_cppflags=no
11715         ;;
11716 esac
11717 done
11718
11719 if test -n "$cf_new_cflags" ; then
11720
11721         CFLAGS="$CFLAGS $cf_new_cflags"
11722 fi
11723
11724 if test -n "$cf_new_cppflags" ; then
11725
11726         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11727 fi
11728
11729 if test -n "$cf_new_extra_cppflags" ; then
11730
11731         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11732 fi
11733
11734 cf_add_libs="$cf_pkgconfig_libs"
11735 # Filter out duplicates - this happens with badly-designed ".pc" files...
11736 for cf_add_1lib in $LIBS
11737 do
11738         for cf_add_2lib in $cf_add_libs
11739         do
11740                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11741                 then
11742                         cf_add_1lib=
11743                         break
11744                 fi
11745         done
11746         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11747 done
11748 LIBS="$cf_add_libs"
11749
11750         :
11751 else
11752         cf_pkgconfig_incs=
11753         cf_pkgconfig_libs=
11754         { echo "$as_me:11754: WARNING: unable to find SM library" >&5
11755 echo "$as_me: WARNING: unable to find SM library" >&2;}
11756 fi
11757
11758 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xt; then
11759         test -n "$verbose" && echo "    found package xt" 1>&6
11760
11761 echo "${as_me:-configure}:11761: testing found package xt ..." 1>&5
11762
11763         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xt 2>/dev/null`"
11764         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xt 2>/dev/null`"
11765         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
11766
11767 echo "${as_me:-configure}:11767: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11768
11769         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
11770
11771 echo "${as_me:-configure}:11771: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
11772
11773 cf_fix_cppflags=no
11774 cf_new_cflags=
11775 cf_new_cppflags=
11776 cf_new_extra_cppflags=
11777
11778 for cf_add_cflags in $cf_pkgconfig_incs
11779 do
11780 case $cf_fix_cppflags in
11781 (no)
11782         case $cf_add_cflags in
11783         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11784                 case $cf_add_cflags in
11785                 (-D*)
11786                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11787
11788                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11789                                 && test -z "${cf_tst_cflags}" \
11790                                 && cf_fix_cppflags=yes
11791
11792                         if test $cf_fix_cppflags = yes ; then
11793                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11794                                 continue
11795                         elif test "${cf_tst_cflags}" = "\"'" ; then
11796                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11797                                 continue
11798                         fi
11799                         ;;
11800                 esac
11801                 case "$CPPFLAGS" in
11802                 (*$cf_add_cflags)
11803                         ;;
11804                 (*)
11805                         case $cf_add_cflags in
11806                         (-D*)
11807                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11808
11809 CPPFLAGS=`echo "$CPPFLAGS" | \
11810         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11811                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11812
11813                                 ;;
11814                         esac
11815                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11816                         ;;
11817                 esac
11818                 ;;
11819         (*)
11820                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11821                 ;;
11822         esac
11823         ;;
11824 (yes)
11825         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11826
11827         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11828
11829         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11830                 && test -z "${cf_tst_cflags}" \
11831                 && cf_fix_cppflags=no
11832         ;;
11833 esac
11834 done
11835
11836 if test -n "$cf_new_cflags" ; then
11837
11838         CFLAGS="$CFLAGS $cf_new_cflags"
11839 fi
11840
11841 if test -n "$cf_new_cppflags" ; then
11842
11843         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11844 fi
11845
11846 if test -n "$cf_new_extra_cppflags" ; then
11847
11848         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11849 fi
11850
11851 cf_add_libs="$cf_pkgconfig_libs"
11852 # Filter out duplicates - this happens with badly-designed ".pc" files...
11853 for cf_add_1lib in $LIBS
11854 do
11855         for cf_add_2lib in $cf_add_libs
11856         do
11857                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11858                 then
11859                         cf_add_1lib=
11860                         break
11861                 fi
11862         done
11863         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11864 done
11865 LIBS="$cf_add_libs"
11866
11867         :
11868 else
11869         cf_pkgconfig_incs=
11870         cf_pkgconfig_libs=
11871         { echo "$as_me:11871: WARNING: unable to find Xt library" >&5
11872 echo "$as_me: WARNING: unable to find Xt library" >&2;}
11873 fi
11874
11875 fi
11876
11877 cf_have_X_LIBS=no
11878
11879 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xt; then
11880         test -n "$verbose" && echo "    found package xt" 1>&6
11881
11882 echo "${as_me:-configure}:11882: testing found package xt ..." 1>&5
11883
11884         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xt 2>/dev/null`"
11885         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xt 2>/dev/null`"
11886         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
11887
11888 echo "${as_me:-configure}:11888: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11889
11890         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
11891
11892 echo "${as_me:-configure}:11892: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
11893
11894 cf_fix_cppflags=no
11895 cf_new_cflags=
11896 cf_new_cppflags=
11897 cf_new_extra_cppflags=
11898
11899 for cf_add_cflags in $cf_pkgconfig_incs
11900 do
11901 case $cf_fix_cppflags in
11902 (no)
11903         case $cf_add_cflags in
11904         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11905                 case $cf_add_cflags in
11906                 (-D*)
11907                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11908
11909                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11910                                 && test -z "${cf_tst_cflags}" \
11911                                 && cf_fix_cppflags=yes
11912
11913                         if test $cf_fix_cppflags = yes ; then
11914                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11915                                 continue
11916                         elif test "${cf_tst_cflags}" = "\"'" ; then
11917                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11918                                 continue
11919                         fi
11920                         ;;
11921                 esac
11922                 case "$CPPFLAGS" in
11923                 (*$cf_add_cflags)
11924                         ;;
11925                 (*)
11926                         case $cf_add_cflags in
11927                         (-D*)
11928                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11929
11930 CPPFLAGS=`echo "$CPPFLAGS" | \
11931         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11932                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11933
11934                                 ;;
11935                         esac
11936                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11937                         ;;
11938                 esac
11939                 ;;
11940         (*)
11941                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11942                 ;;
11943         esac
11944         ;;
11945 (yes)
11946         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11947
11948         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11949
11950         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11951                 && test -z "${cf_tst_cflags}" \
11952                 && cf_fix_cppflags=no
11953         ;;
11954 esac
11955 done
11956
11957 if test -n "$cf_new_cflags" ; then
11958
11959         CFLAGS="$CFLAGS $cf_new_cflags"
11960 fi
11961
11962 if test -n "$cf_new_cppflags" ; then
11963
11964         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11965 fi
11966
11967 if test -n "$cf_new_extra_cppflags" ; then
11968
11969         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11970 fi
11971
11972 cf_add_libs="$cf_pkgconfig_libs"
11973 # Filter out duplicates - this happens with badly-designed ".pc" files...
11974 for cf_add_1lib in $LIBS
11975 do
11976         for cf_add_2lib in $cf_add_libs
11977         do
11978                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11979                 then
11980                         cf_add_1lib=
11981                         break
11982                 fi
11983         done
11984         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11985 done
11986 LIBS="$cf_add_libs"
11987
11988         case "x$LIBS" in
11989         (*-lX11*)
11990                 ;;
11991         (*)
11992 # we have an "xt" package, but it may omit Xt's dependency on X11
11993 echo "$as_me:11993: checking for usable X dependency" >&5
11994 echo $ECHO_N "checking for usable X dependency... $ECHO_C" >&6
11995 if test "${cf_cv_xt_x11_compat+set}" = set; then
11996   echo $ECHO_N "(cached) $ECHO_C" >&6
11997 else
11998
11999 cat >conftest.$ac_ext <<_ACEOF
12000 #line 12000 "configure"
12001 #include "confdefs.h"
12002
12003 #include <X11/Xlib.h>
12004
12005 int
12006 main ()
12007 {
12008
12009         int rc1 = XDrawLine((Display*) 0, (Drawable) 0, (GC) 0, 0, 0, 0, 0);
12010         int rc2 = XClearWindow((Display*) 0, (Window) 0);
12011         int rc3 = XMoveWindow((Display*) 0, (Window) 0, 0, 0);
12012         int rc4 = XMoveResizeWindow((Display*)0, (Window)0, 0, 0, 0, 0);
12013
12014   ;
12015   return 0;
12016 }
12017 _ACEOF
12018 rm -f conftest.$ac_objext conftest$ac_exeext
12019 if { (eval echo "$as_me:12019: \"$ac_link\"") >&5
12020   (eval $ac_link) 2>&5
12021   ac_status=$?
12022   echo "$as_me:12022: \$? = $ac_status" >&5
12023   (exit $ac_status); } &&
12024          { ac_try='test -s conftest$ac_exeext'
12025   { (eval echo "$as_me:12025: \"$ac_try\"") >&5
12026   (eval $ac_try) 2>&5
12027   ac_status=$?
12028   echo "$as_me:12028: \$? = $ac_status" >&5
12029   (exit $ac_status); }; }; then
12030   cf_cv_xt_x11_compat=yes
12031 else
12032   echo "$as_me: failed program was:" >&5
12033 cat conftest.$ac_ext >&5
12034 cf_cv_xt_x11_compat=no
12035 fi
12036 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12037 fi
12038 echo "$as_me:12038: result: $cf_cv_xt_x11_compat" >&5
12039 echo "${ECHO_T}$cf_cv_xt_x11_compat" >&6
12040                 if test "$cf_cv_xt_x11_compat" = no
12041                 then
12042                         test -n "$verbose" && echo "    work around broken X11 dependency" 1>&6
12043
12044 echo "${as_me:-configure}:12044: testing work around broken X11 dependency ..." 1>&5
12045
12046                         # 2010/11/19 - good enough until a working Xt on Xcb is delivered.
12047
12048 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists x11; then
12049         test -n "$verbose" && echo "    found package x11" 1>&6
12050
12051 echo "${as_me:-configure}:12051: testing found package x11 ..." 1>&5
12052
12053         cf_pkgconfig_incs="`$PKG_CONFIG --cflags x11 2>/dev/null`"
12054         cf_pkgconfig_libs="`$PKG_CONFIG --libs   x11 2>/dev/null`"
12055         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
12056
12057 echo "${as_me:-configure}:12057: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12058
12059         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
12060
12061 echo "${as_me:-configure}:12061: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
12062
12063 cf_fix_cppflags=no
12064 cf_new_cflags=
12065 cf_new_cppflags=
12066 cf_new_extra_cppflags=
12067
12068 for cf_add_cflags in $cf_pkgconfig_incs
12069 do
12070 case $cf_fix_cppflags in
12071 (no)
12072         case $cf_add_cflags in
12073         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12074                 case $cf_add_cflags in
12075                 (-D*)
12076                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12077
12078                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12079                                 && test -z "${cf_tst_cflags}" \
12080                                 && cf_fix_cppflags=yes
12081
12082                         if test $cf_fix_cppflags = yes ; then
12083                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12084                                 continue
12085                         elif test "${cf_tst_cflags}" = "\"'" ; then
12086                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12087                                 continue
12088                         fi
12089                         ;;
12090                 esac
12091                 case "$CPPFLAGS" in
12092                 (*$cf_add_cflags)
12093                         ;;
12094                 (*)
12095                         case $cf_add_cflags in
12096                         (-D*)
12097                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12098
12099 CPPFLAGS=`echo "$CPPFLAGS" | \
12100         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12101                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12102
12103                                 ;;
12104                         esac
12105                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
12106                         ;;
12107                 esac
12108                 ;;
12109         (*)
12110                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
12111                 ;;
12112         esac
12113         ;;
12114 (yes)
12115         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12116
12117         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12118
12119         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12120                 && test -z "${cf_tst_cflags}" \
12121                 && cf_fix_cppflags=no
12122         ;;
12123 esac
12124 done
12125
12126 if test -n "$cf_new_cflags" ; then
12127
12128         CFLAGS="$CFLAGS $cf_new_cflags"
12129 fi
12130
12131 if test -n "$cf_new_cppflags" ; then
12132
12133         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
12134 fi
12135
12136 if test -n "$cf_new_extra_cppflags" ; then
12137
12138         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
12139 fi
12140
12141 cf_add_libs="$cf_pkgconfig_libs"
12142 # Filter out duplicates - this happens with badly-designed ".pc" files...
12143 for cf_add_1lib in $LIBS
12144 do
12145         for cf_add_2lib in $cf_add_libs
12146         do
12147                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12148                 then
12149                         cf_add_1lib=
12150                         break
12151                 fi
12152         done
12153         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12154 done
12155 LIBS="$cf_add_libs"
12156
12157         :
12158 else
12159         cf_pkgconfig_incs=
12160         cf_pkgconfig_libs=
12161
12162 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
12163
12164 echo "${as_me:-configure}:12164: testing ...before $LIBS ..." 1>&5
12165
12166 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%-lXt %-lXt -lX11 %" -e 's%  % %g'`
12167 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
12168
12169 echo "${as_me:-configure}:12169: testing ...after  $LIBS ..." 1>&5
12170
12171 fi
12172
12173                 fi
12174                 ;;
12175         esac
12176
12177 echo "$as_me:12177: checking for usable X Toolkit package" >&5
12178 echo $ECHO_N "checking for usable X Toolkit package... $ECHO_C" >&6
12179 if test "${cf_cv_xt_ice_compat+set}" = set; then
12180   echo $ECHO_N "(cached) $ECHO_C" >&6
12181 else
12182
12183 cat >conftest.$ac_ext <<_ACEOF
12184 #line 12184 "configure"
12185 #include "confdefs.h"
12186
12187 #include <X11/Shell.h>
12188
12189 int
12190 main ()
12191 {
12192 int num = IceConnectionNumber(0)
12193
12194   ;
12195   return 0;
12196 }
12197 _ACEOF
12198 rm -f conftest.$ac_objext conftest$ac_exeext
12199 if { (eval echo "$as_me:12199: \"$ac_link\"") >&5
12200   (eval $ac_link) 2>&5
12201   ac_status=$?
12202   echo "$as_me:12202: \$? = $ac_status" >&5
12203   (exit $ac_status); } &&
12204          { ac_try='test -s conftest$ac_exeext'
12205   { (eval echo "$as_me:12205: \"$ac_try\"") >&5
12206   (eval $ac_try) 2>&5
12207   ac_status=$?
12208   echo "$as_me:12208: \$? = $ac_status" >&5
12209   (exit $ac_status); }; }; then
12210   cf_cv_xt_ice_compat=yes
12211 else
12212   echo "$as_me: failed program was:" >&5
12213 cat conftest.$ac_ext >&5
12214 cf_cv_xt_ice_compat=no
12215 fi
12216 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12217 fi
12218 echo "$as_me:12218: result: $cf_cv_xt_ice_compat" >&5
12219 echo "${ECHO_T}$cf_cv_xt_ice_compat" >&6
12220
12221         if test "$cf_cv_xt_ice_compat" = no
12222         then
12223                 # workaround for broken ".pc" files used for X Toolkit.
12224                 case "x$X_PRE_LIBS" in
12225                 (*-lICE*)
12226                         case "x$LIBS" in
12227                         (*-lICE*)
12228                                 ;;
12229                         (*)
12230                                 test -n "$verbose" && echo "    work around broken ICE dependency" 1>&6
12231
12232 echo "${as_me:-configure}:12232: testing work around broken ICE dependency ..." 1>&5
12233
12234 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists ice; then
12235         test -n "$verbose" && echo "    found package ice" 1>&6
12236
12237 echo "${as_me:-configure}:12237: testing found package ice ..." 1>&5
12238
12239         cf_pkgconfig_incs="`$PKG_CONFIG --cflags ice 2>/dev/null`"
12240         cf_pkgconfig_libs="`$PKG_CONFIG --libs   ice 2>/dev/null`"
12241         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
12242
12243 echo "${as_me:-configure}:12243: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12244
12245         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
12246
12247 echo "${as_me:-configure}:12247: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
12248
12249 cf_fix_cppflags=no
12250 cf_new_cflags=
12251 cf_new_cppflags=
12252 cf_new_extra_cppflags=
12253
12254 for cf_add_cflags in $cf_pkgconfig_incs
12255 do
12256 case $cf_fix_cppflags in
12257 (no)
12258         case $cf_add_cflags in
12259         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12260                 case $cf_add_cflags in
12261                 (-D*)
12262                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12263
12264                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12265                                 && test -z "${cf_tst_cflags}" \
12266                                 && cf_fix_cppflags=yes
12267
12268                         if test $cf_fix_cppflags = yes ; then
12269                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12270                                 continue
12271                         elif test "${cf_tst_cflags}" = "\"'" ; then
12272                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12273                                 continue
12274                         fi
12275                         ;;
12276                 esac
12277                 case "$CPPFLAGS" in
12278                 (*$cf_add_cflags)
12279                         ;;
12280                 (*)
12281                         case $cf_add_cflags in
12282                         (-D*)
12283                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12284
12285 CPPFLAGS=`echo "$CPPFLAGS" | \
12286         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12287                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12288
12289                                 ;;
12290                         esac
12291                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
12292                         ;;
12293                 esac
12294                 ;;
12295         (*)
12296                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
12297                 ;;
12298         esac
12299         ;;
12300 (yes)
12301         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12302
12303         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12304
12305         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12306                 && test -z "${cf_tst_cflags}" \
12307                 && cf_fix_cppflags=no
12308         ;;
12309 esac
12310 done
12311
12312 if test -n "$cf_new_cflags" ; then
12313
12314         CFLAGS="$CFLAGS $cf_new_cflags"
12315 fi
12316
12317 if test -n "$cf_new_cppflags" ; then
12318
12319         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
12320 fi
12321
12322 if test -n "$cf_new_extra_cppflags" ; then
12323
12324         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
12325 fi
12326
12327 cf_add_libs="$cf_pkgconfig_libs"
12328 # Filter out duplicates - this happens with badly-designed ".pc" files...
12329 for cf_add_1lib in $LIBS
12330 do
12331         for cf_add_2lib in $cf_add_libs
12332         do
12333                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12334                 then
12335                         cf_add_1lib=
12336                         break
12337                 fi
12338         done
12339         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12340 done
12341 LIBS="$cf_add_libs"
12342
12343 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists sm; then
12344         test -n "$verbose" && echo "    found package sm" 1>&6
12345
12346 echo "${as_me:-configure}:12346: testing found package sm ..." 1>&5
12347
12348         cf_pkgconfig_incs="`$PKG_CONFIG --cflags sm 2>/dev/null`"
12349         cf_pkgconfig_libs="`$PKG_CONFIG --libs   sm 2>/dev/null`"
12350         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
12351
12352 echo "${as_me:-configure}:12352: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12353
12354         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
12355
12356 echo "${as_me:-configure}:12356: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
12357
12358 cf_fix_cppflags=no
12359 cf_new_cflags=
12360 cf_new_cppflags=
12361 cf_new_extra_cppflags=
12362
12363 for cf_add_cflags in $cf_pkgconfig_incs
12364 do
12365 case $cf_fix_cppflags in
12366 (no)
12367         case $cf_add_cflags in
12368         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12369                 case $cf_add_cflags in
12370                 (-D*)
12371                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12372
12373                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12374                                 && test -z "${cf_tst_cflags}" \
12375                                 && cf_fix_cppflags=yes
12376
12377                         if test $cf_fix_cppflags = yes ; then
12378                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12379                                 continue
12380                         elif test "${cf_tst_cflags}" = "\"'" ; then
12381                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12382                                 continue
12383                         fi
12384                         ;;
12385                 esac
12386                 case "$CPPFLAGS" in
12387                 (*$cf_add_cflags)
12388                         ;;
12389                 (*)
12390                         case $cf_add_cflags in
12391                         (-D*)
12392                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12393
12394 CPPFLAGS=`echo "$CPPFLAGS" | \
12395         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12396                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12397
12398                                 ;;
12399                         esac
12400                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
12401                         ;;
12402                 esac
12403                 ;;
12404         (*)
12405                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
12406                 ;;
12407         esac
12408         ;;
12409 (yes)
12410         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12411
12412         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12413
12414         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12415                 && test -z "${cf_tst_cflags}" \
12416                 && cf_fix_cppflags=no
12417         ;;
12418 esac
12419 done
12420
12421 if test -n "$cf_new_cflags" ; then
12422
12423         CFLAGS="$CFLAGS $cf_new_cflags"
12424 fi
12425
12426 if test -n "$cf_new_cppflags" ; then
12427
12428         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
12429 fi
12430
12431 if test -n "$cf_new_extra_cppflags" ; then
12432
12433         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
12434 fi
12435
12436 cf_add_libs="$cf_pkgconfig_libs"
12437 # Filter out duplicates - this happens with badly-designed ".pc" files...
12438 for cf_add_1lib in $LIBS
12439 do
12440         for cf_add_2lib in $cf_add_libs
12441         do
12442                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12443                 then
12444                         cf_add_1lib=
12445                         break
12446                 fi
12447         done
12448         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12449 done
12450 LIBS="$cf_add_libs"
12451
12452         :
12453 else
12454         cf_pkgconfig_incs=
12455         cf_pkgconfig_libs=
12456         :
12457 fi
12458
12459 else
12460         cf_pkgconfig_incs=
12461         cf_pkgconfig_libs=
12462
12463 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
12464
12465 echo "${as_me:-configure}:12465: testing ...before $LIBS ..." 1>&5
12466
12467 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%-lXt %-lXt $X_PRE_LIBS %" -e 's%  % %g'`
12468 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
12469
12470 echo "${as_me:-configure}:12470: testing ...after  $LIBS ..." 1>&5
12471
12472 fi
12473
12474                                 ;;
12475                         esac
12476                         ;;
12477                 esac
12478         fi
12479
12480         cf_have_X_LIBS=yes
12481
12482 else
12483         cf_pkgconfig_incs=
12484         cf_pkgconfig_libs=
12485
12486         LDFLAGS="$X_LIBS $LDFLAGS"
12487
12488 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
12489
12490 echo "${as_me:-configure}:12490: testing checking additions to CFLAGS ..." 1>&5
12491
12492 cf_check_cflags="$CFLAGS"
12493 cf_check_cppflags="$CPPFLAGS"
12494
12495 cf_fix_cppflags=no
12496 cf_new_cflags=
12497 cf_new_cppflags=
12498 cf_new_extra_cppflags=
12499
12500 for cf_add_cflags in $X_CFLAGS
12501 do
12502 case $cf_fix_cppflags in
12503 (no)
12504         case $cf_add_cflags in
12505         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12506                 case $cf_add_cflags in
12507                 (-D*)
12508                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12509
12510                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12511                                 && test -z "${cf_tst_cflags}" \
12512                                 && cf_fix_cppflags=yes
12513
12514                         if test $cf_fix_cppflags = yes ; then
12515                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12516                                 continue
12517                         elif test "${cf_tst_cflags}" = "\"'" ; then
12518                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12519                                 continue
12520                         fi
12521                         ;;
12522                 esac
12523                 case "$CPPFLAGS" in
12524                 (*$cf_add_cflags)
12525                         ;;
12526                 (*)
12527                         case $cf_add_cflags in
12528                         (-D*)
12529                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12530
12531 CPPFLAGS=`echo "$CPPFLAGS" | \
12532         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12533                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12534
12535                                 ;;
12536                         esac
12537                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
12538                         ;;
12539                 esac
12540                 ;;
12541         (*)
12542                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
12543                 ;;
12544         esac
12545         ;;
12546 (yes)
12547         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12548
12549         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12550
12551         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12552                 && test -z "${cf_tst_cflags}" \
12553                 && cf_fix_cppflags=no
12554         ;;
12555 esac
12556 done
12557
12558 if test -n "$cf_new_cflags" ; then
12559         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
12560
12561 echo "${as_me:-configure}:12561: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
12562
12563         CFLAGS="$CFLAGS $cf_new_cflags"
12564 fi
12565
12566 if test -n "$cf_new_cppflags" ; then
12567         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
12568
12569 echo "${as_me:-configure}:12569: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
12570
12571         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
12572 fi
12573
12574 if test -n "$cf_new_extra_cppflags" ; then
12575         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
12576
12577 echo "${as_me:-configure}:12577: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
12578
12579         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
12580 fi
12581
12582 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
12583 cat >conftest.$ac_ext <<_ACEOF
12584 #line 12584 "configure"
12585 #include "confdefs.h"
12586 #include <stdio.h>
12587 int
12588 main ()
12589 {
12590 printf("Hello world");
12591   ;
12592   return 0;
12593 }
12594 _ACEOF
12595 rm -f conftest.$ac_objext conftest$ac_exeext
12596 if { (eval echo "$as_me:12596: \"$ac_link\"") >&5
12597   (eval $ac_link) 2>&5
12598   ac_status=$?
12599   echo "$as_me:12599: \$? = $ac_status" >&5
12600   (exit $ac_status); } &&
12601          { ac_try='test -s conftest$ac_exeext'
12602   { (eval echo "$as_me:12602: \"$ac_try\"") >&5
12603   (eval $ac_try) 2>&5
12604   ac_status=$?
12605   echo "$as_me:12605: \$? = $ac_status" >&5
12606   (exit $ac_status); }; }; then
12607   :
12608 else
12609   echo "$as_me: failed program was:" >&5
12610 cat conftest.$ac_ext >&5
12611 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
12612
12613 echo "${as_me:-configure}:12613: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
12614
12615          if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
12616                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
12617
12618 echo "${as_me:-configure}:12618: testing but keeping change to \$CPPFLAGS ..." 1>&5
12619
12620          fi
12621          CFLAGS="$cf_check_flags"
12622 fi
12623 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12624 fi
12625
12626         echo "$as_me:12626: checking for XOpenDisplay" >&5
12627 echo $ECHO_N "checking for XOpenDisplay... $ECHO_C" >&6
12628 if test "${ac_cv_func_XOpenDisplay+set}" = set; then
12629   echo $ECHO_N "(cached) $ECHO_C" >&6
12630 else
12631   cat >conftest.$ac_ext <<_ACEOF
12632 #line 12632 "configure"
12633 #include "confdefs.h"
12634 /* System header to define __stub macros and hopefully few prototypes,
12635     which can conflict with char XOpenDisplay (); below.  */
12636 #include <assert.h>
12637 /* Override any gcc2 internal prototype to avoid an error.  */
12638 #ifdef __cplusplus
12639 extern "C"
12640 #endif
12641 /* We use char because int might match the return type of a gcc2
12642    builtin and then its argument prototype would still apply.  */
12643 char XOpenDisplay ();
12644 char (*f) ();
12645
12646 int
12647 main ()
12648 {
12649 /* The GNU C library defines this for functions which it implements
12650     to always fail with ENOSYS.  Some functions are actually named
12651     something starting with __ and the normal name is an alias.  */
12652 #if defined (__stub_XOpenDisplay) || defined (__stub___XOpenDisplay)
12653 choke me
12654 #else
12655 f = XOpenDisplay; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
12656 #endif
12657
12658   ;
12659   return 0;
12660 }
12661 _ACEOF
12662 rm -f conftest.$ac_objext conftest$ac_exeext
12663 if { (eval echo "$as_me:12663: \"$ac_link\"") >&5
12664   (eval $ac_link) 2>&5
12665   ac_status=$?
12666   echo "$as_me:12666: \$? = $ac_status" >&5
12667   (exit $ac_status); } &&
12668          { ac_try='test -s conftest$ac_exeext'
12669   { (eval echo "$as_me:12669: \"$ac_try\"") >&5
12670   (eval $ac_try) 2>&5
12671   ac_status=$?
12672   echo "$as_me:12672: \$? = $ac_status" >&5
12673   (exit $ac_status); }; }; then
12674   ac_cv_func_XOpenDisplay=yes
12675 else
12676   echo "$as_me: failed program was:" >&5
12677 cat conftest.$ac_ext >&5
12678 ac_cv_func_XOpenDisplay=no
12679 fi
12680 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12681 fi
12682 echo "$as_me:12682: result: $ac_cv_func_XOpenDisplay" >&5
12683 echo "${ECHO_T}$ac_cv_func_XOpenDisplay" >&6
12684 if test $ac_cv_func_XOpenDisplay = yes; then
12685   :
12686 else
12687
12688         echo "$as_me:12688: checking for XOpenDisplay in -lX11" >&5
12689 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
12690 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
12691   echo $ECHO_N "(cached) $ECHO_C" >&6
12692 else
12693   ac_check_lib_save_LIBS=$LIBS
12694 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
12695 cat >conftest.$ac_ext <<_ACEOF
12696 #line 12696 "configure"
12697 #include "confdefs.h"
12698
12699 /* Override any gcc2 internal prototype to avoid an error.  */
12700 #ifdef __cplusplus
12701 extern "C"
12702 #endif
12703 /* We use char because int might match the return type of a gcc2
12704    builtin and then its argument prototype would still apply.  */
12705 char XOpenDisplay ();
12706 int
12707 main ()
12708 {
12709 XOpenDisplay ();
12710   ;
12711   return 0;
12712 }
12713 _ACEOF
12714 rm -f conftest.$ac_objext conftest$ac_exeext
12715 if { (eval echo "$as_me:12715: \"$ac_link\"") >&5
12716   (eval $ac_link) 2>&5
12717   ac_status=$?
12718   echo "$as_me:12718: \$? = $ac_status" >&5
12719   (exit $ac_status); } &&
12720          { ac_try='test -s conftest$ac_exeext'
12721   { (eval echo "$as_me:12721: \"$ac_try\"") >&5
12722   (eval $ac_try) 2>&5
12723   ac_status=$?
12724   echo "$as_me:12724: \$? = $ac_status" >&5
12725   (exit $ac_status); }; }; then
12726   ac_cv_lib_X11_XOpenDisplay=yes
12727 else
12728   echo "$as_me: failed program was:" >&5
12729 cat conftest.$ac_ext >&5
12730 ac_cv_lib_X11_XOpenDisplay=no
12731 fi
12732 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12733 LIBS=$ac_check_lib_save_LIBS
12734 fi
12735 echo "$as_me:12735: result: $ac_cv_lib_X11_XOpenDisplay" >&5
12736 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
12737 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
12738
12739 cf_add_libs="-lX11"
12740 # Filter out duplicates - this happens with badly-designed ".pc" files...
12741 for cf_add_1lib in $LIBS
12742 do
12743         for cf_add_2lib in $cf_add_libs
12744         do
12745                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12746                 then
12747                         cf_add_1lib=
12748                         break
12749                 fi
12750         done
12751         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12752 done
12753 LIBS="$cf_add_libs"
12754
12755 fi
12756
12757 fi
12758
12759         echo "$as_me:12759: checking for XtAppInitialize" >&5
12760 echo $ECHO_N "checking for XtAppInitialize... $ECHO_C" >&6
12761 if test "${ac_cv_func_XtAppInitialize+set}" = set; then
12762   echo $ECHO_N "(cached) $ECHO_C" >&6
12763 else
12764   cat >conftest.$ac_ext <<_ACEOF
12765 #line 12765 "configure"
12766 #include "confdefs.h"
12767 /* System header to define __stub macros and hopefully few prototypes,
12768     which can conflict with char XtAppInitialize (); below.  */
12769 #include <assert.h>
12770 /* Override any gcc2 internal prototype to avoid an error.  */
12771 #ifdef __cplusplus
12772 extern "C"
12773 #endif
12774 /* We use char because int might match the return type of a gcc2
12775    builtin and then its argument prototype would still apply.  */
12776 char XtAppInitialize ();
12777 char (*f) ();
12778
12779 int
12780 main ()
12781 {
12782 /* The GNU C library defines this for functions which it implements
12783     to always fail with ENOSYS.  Some functions are actually named
12784     something starting with __ and the normal name is an alias.  */
12785 #if defined (__stub_XtAppInitialize) || defined (__stub___XtAppInitialize)
12786 choke me
12787 #else
12788 f = XtAppInitialize; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
12789 #endif
12790
12791   ;
12792   return 0;
12793 }
12794 _ACEOF
12795 rm -f conftest.$ac_objext conftest$ac_exeext
12796 if { (eval echo "$as_me:12796: \"$ac_link\"") >&5
12797   (eval $ac_link) 2>&5
12798   ac_status=$?
12799   echo "$as_me:12799: \$? = $ac_status" >&5
12800   (exit $ac_status); } &&
12801          { ac_try='test -s conftest$ac_exeext'
12802   { (eval echo "$as_me:12802: \"$ac_try\"") >&5
12803   (eval $ac_try) 2>&5
12804   ac_status=$?
12805   echo "$as_me:12805: \$? = $ac_status" >&5
12806   (exit $ac_status); }; }; then
12807   ac_cv_func_XtAppInitialize=yes
12808 else
12809   echo "$as_me: failed program was:" >&5
12810 cat conftest.$ac_ext >&5
12811 ac_cv_func_XtAppInitialize=no
12812 fi
12813 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12814 fi
12815 echo "$as_me:12815: result: $ac_cv_func_XtAppInitialize" >&5
12816 echo "${ECHO_T}$ac_cv_func_XtAppInitialize" >&6
12817 if test $ac_cv_func_XtAppInitialize = yes; then
12818   :
12819 else
12820
12821         echo "$as_me:12821: checking for XtAppInitialize in -lXt" >&5
12822 echo $ECHO_N "checking for XtAppInitialize in -lXt... $ECHO_C" >&6
12823 if test "${ac_cv_lib_Xt_XtAppInitialize+set}" = set; then
12824   echo $ECHO_N "(cached) $ECHO_C" >&6
12825 else
12826   ac_check_lib_save_LIBS=$LIBS
12827 LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
12828 cat >conftest.$ac_ext <<_ACEOF
12829 #line 12829 "configure"
12830 #include "confdefs.h"
12831
12832 /* Override any gcc2 internal prototype to avoid an error.  */
12833 #ifdef __cplusplus
12834 extern "C"
12835 #endif
12836 /* We use char because int might match the return type of a gcc2
12837    builtin and then its argument prototype would still apply.  */
12838 char XtAppInitialize ();
12839 int
12840 main ()
12841 {
12842 XtAppInitialize ();
12843   ;
12844   return 0;
12845 }
12846 _ACEOF
12847 rm -f conftest.$ac_objext conftest$ac_exeext
12848 if { (eval echo "$as_me:12848: \"$ac_link\"") >&5
12849   (eval $ac_link) 2>&5
12850   ac_status=$?
12851   echo "$as_me:12851: \$? = $ac_status" >&5
12852   (exit $ac_status); } &&
12853          { ac_try='test -s conftest$ac_exeext'
12854   { (eval echo "$as_me:12854: \"$ac_try\"") >&5
12855   (eval $ac_try) 2>&5
12856   ac_status=$?
12857   echo "$as_me:12857: \$? = $ac_status" >&5
12858   (exit $ac_status); }; }; then
12859   ac_cv_lib_Xt_XtAppInitialize=yes
12860 else
12861   echo "$as_me: failed program was:" >&5
12862 cat conftest.$ac_ext >&5
12863 ac_cv_lib_Xt_XtAppInitialize=no
12864 fi
12865 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12866 LIBS=$ac_check_lib_save_LIBS
12867 fi
12868 echo "$as_me:12868: result: $ac_cv_lib_Xt_XtAppInitialize" >&5
12869 echo "${ECHO_T}$ac_cv_lib_Xt_XtAppInitialize" >&6
12870 if test $ac_cv_lib_Xt_XtAppInitialize = yes; then
12871
12872 cat >>confdefs.h <<\EOF
12873 #define HAVE_LIBXT 1
12874 EOF
12875
12876                  cf_have_X_LIBS=Xt
12877                  LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS"
12878 fi
12879
12880 fi
12881
12882 fi
12883
12884 if test $cf_have_X_LIBS = no ; then
12885         { echo "$as_me:12885: WARNING: Unable to successfully link X Toolkit library (-lXt) with
12886 test program.  You will have to check and add the proper libraries by hand
12887 to makefile." >&5
12888 echo "$as_me: WARNING: Unable to successfully link X Toolkit library (-lXt) with
12889 test program.  You will have to check and add the proper libraries by hand
12890 to makefile." >&2;}
12891 fi
12892
12893 cf_x_athena_root=$cf_x_athena
12894 cf_x_athena_inc=""
12895
12896 for cf_path in default \
12897         /usr/contrib/X11R6 \
12898         /usr/contrib/X11R5 \
12899         /usr/lib/X11R5 \
12900         /usr/local
12901 do
12902         if test -z "$cf_x_athena_inc" ; then
12903                 cf_save="$CPPFLAGS"
12904                 cf_test=X11/$cf_x_athena_root/SimpleMenu.h
12905                 if test $cf_path != default ; then
12906                         CPPFLAGS="$cf_save -I$cf_path/include"
12907                         echo "$as_me:12907: checking for $cf_test in $cf_path" >&5
12908 echo $ECHO_N "checking for $cf_test in $cf_path... $ECHO_C" >&6
12909                 else
12910                         echo "$as_me:12910: checking for $cf_test" >&5
12911 echo $ECHO_N "checking for $cf_test... $ECHO_C" >&6
12912                 fi
12913                 cat >conftest.$ac_ext <<_ACEOF
12914 #line 12914 "configure"
12915 #include "confdefs.h"
12916
12917 #include <X11/Intrinsic.h>
12918 #include <$cf_test>
12919 int
12920 main ()
12921 {
12922
12923   ;
12924   return 0;
12925 }
12926 _ACEOF
12927 rm -f conftest.$ac_objext
12928 if { (eval echo "$as_me:12928: \"$ac_compile\"") >&5
12929   (eval $ac_compile) 2>&5
12930   ac_status=$?
12931   echo "$as_me:12931: \$? = $ac_status" >&5
12932   (exit $ac_status); } &&
12933          { ac_try='test -s conftest.$ac_objext'
12934   { (eval echo "$as_me:12934: \"$ac_try\"") >&5
12935   (eval $ac_try) 2>&5
12936   ac_status=$?
12937   echo "$as_me:12937: \$? = $ac_status" >&5
12938   (exit $ac_status); }; }; then
12939   cf_result=yes
12940 else
12941   echo "$as_me: failed program was:" >&5
12942 cat conftest.$ac_ext >&5
12943 cf_result=no
12944 fi
12945 rm -f conftest.$ac_objext conftest.$ac_ext
12946                 echo "$as_me:12946: result: $cf_result" >&5
12947 echo "${ECHO_T}$cf_result" >&6
12948                 if test "$cf_result" = yes ; then
12949                         cf_x_athena_inc=$cf_path
12950                         break
12951                 else
12952                         CPPFLAGS="$cf_save"
12953                 fi
12954         fi
12955 done
12956
12957 if test -z "$cf_x_athena_inc" ; then
12958         { echo "$as_me:12958: WARNING: Unable to successfully find Athena header files with test program" >&5
12959 echo "$as_me: WARNING: Unable to successfully find Athena header files with test program" >&2;}
12960 elif test "$cf_x_athena_inc" != default ; then
12961         CPPFLAGS="$CPPFLAGS -I$cf_x_athena_inc"
12962 fi
12963
12964 cf_x_athena_root=$cf_x_athena
12965 cf_x_athena_lib=""
12966
12967 for cf_path in default \
12968         /usr/contrib/X11R6 \
12969         /usr/contrib/X11R5 \
12970         /usr/lib/X11R5 \
12971         /usr/local
12972 do
12973         for cf_lib in \
12974                 ${cf_x_athena_root} \
12975                 ${cf_x_athena_root}7 \
12976                 ${cf_x_athena_root}6
12977         do
12978         for cf_libs in \
12979                 "-l$cf_lib -lXmu" \
12980                 "-l$cf_lib -lXpm -lXmu" \
12981                 "-l${cf_lib}_s -lXmu_s"
12982         do
12983                 if test -z "$cf_x_athena_lib" ; then
12984                         cf_save="$LIBS"
12985                         cf_test=XawSimpleMenuAddGlobalActions
12986                         if test $cf_path != default ; then
12987
12988 cf_add_libs="-L$cf_path/lib $cf_libs"
12989 # Filter out duplicates - this happens with badly-designed ".pc" files...
12990 for cf_add_1lib in $LIBS
12991 do
12992         for cf_add_2lib in $cf_add_libs
12993         do
12994                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12995                 then
12996                         cf_add_1lib=
12997                         break
12998                 fi
12999         done
13000         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13001 done
13002 LIBS="$cf_add_libs"
13003
13004                                 echo "$as_me:13004: checking for $cf_libs in $cf_path" >&5
13005 echo $ECHO_N "checking for $cf_libs in $cf_path... $ECHO_C" >&6
13006                         else
13007
13008 cf_add_libs="$cf_libs"
13009 # Filter out duplicates - this happens with badly-designed ".pc" files...
13010 for cf_add_1lib in $LIBS
13011 do
13012         for cf_add_2lib in $cf_add_libs
13013         do
13014                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13015                 then
13016                         cf_add_1lib=
13017                         break
13018                 fi
13019         done
13020         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13021 done
13022 LIBS="$cf_add_libs"
13023
13024                                 echo "$as_me:13024: checking for $cf_test in $cf_libs" >&5
13025 echo $ECHO_N "checking for $cf_test in $cf_libs... $ECHO_C" >&6
13026                         fi
13027                         cat >conftest.$ac_ext <<_ACEOF
13028 #line 13028 "configure"
13029 #include "confdefs.h"
13030
13031 #include <X11/Intrinsic.h>
13032 #include <X11/$cf_x_athena_root/SimpleMenu.h>
13033
13034 int
13035 main ()
13036 {
13037
13038 $cf_test((XtAppContext) 0)
13039   ;
13040   return 0;
13041 }
13042 _ACEOF
13043 rm -f conftest.$ac_objext conftest$ac_exeext
13044 if { (eval echo "$as_me:13044: \"$ac_link\"") >&5
13045   (eval $ac_link) 2>&5
13046   ac_status=$?
13047   echo "$as_me:13047: \$? = $ac_status" >&5
13048   (exit $ac_status); } &&
13049          { ac_try='test -s conftest$ac_exeext'
13050   { (eval echo "$as_me:13050: \"$ac_try\"") >&5
13051   (eval $ac_try) 2>&5
13052   ac_status=$?
13053   echo "$as_me:13053: \$? = $ac_status" >&5
13054   (exit $ac_status); }; }; then
13055   cf_result=yes
13056 else
13057   echo "$as_me: failed program was:" >&5
13058 cat conftest.$ac_ext >&5
13059 cf_result=no
13060 fi
13061 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13062                         echo "$as_me:13062: result: $cf_result" >&5
13063 echo "${ECHO_T}$cf_result" >&6
13064                         if test "$cf_result" = yes ; then
13065                                 cf_x_athena_lib="$cf_libs"
13066                                 break
13067                         fi
13068                         LIBS="$cf_save"
13069                 fi
13070         done # cf_libs
13071                 test -n "$cf_x_athena_lib" && break
13072         done # cf_lib
13073 done
13074
13075 if test -z "$cf_x_athena_lib" ; then
13076         { { echo "$as_me:13076: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&5
13077 echo "$as_me: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&2;}
13078    { (exit 1); exit 1; }; }
13079 fi
13080
13081 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
13082
13083 cat >>confdefs.h <<EOF
13084 #define $cf_x_athena_LIBS 1
13085 EOF
13086
13087 fi
13088
13089 if test -n "$ac_tool_prefix"; then
13090   for ac_prog in xcurses-config
13091   do
13092     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
13093 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
13094 echo "$as_me:13094: checking for $ac_word" >&5
13095 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
13096 if test "${ac_cv_prog_XCURSES_CONFIG+set}" = set; then
13097   echo $ECHO_N "(cached) $ECHO_C" >&6
13098 else
13099   if test -n "$XCURSES_CONFIG"; then
13100   ac_cv_prog_XCURSES_CONFIG="$XCURSES_CONFIG" # Let the user override the test.
13101 else
13102   ac_save_IFS=$IFS; IFS=$ac_path_separator
13103 ac_dummy="$PATH"
13104 for ac_dir in $ac_dummy; do
13105   IFS=$ac_save_IFS
13106   test -z "$ac_dir" && ac_dir=.
13107   $as_executable_p "$ac_dir/$ac_word" || continue
13108 ac_cv_prog_XCURSES_CONFIG="$ac_tool_prefix$ac_prog"
13109 echo "$as_me:13109: found $ac_dir/$ac_word" >&5
13110 break
13111 done
13112
13113 fi
13114 fi
13115 XCURSES_CONFIG=$ac_cv_prog_XCURSES_CONFIG
13116 if test -n "$XCURSES_CONFIG"; then
13117   echo "$as_me:13117: result: $XCURSES_CONFIG" >&5
13118 echo "${ECHO_T}$XCURSES_CONFIG" >&6
13119 else
13120   echo "$as_me:13120: result: no" >&5
13121 echo "${ECHO_T}no" >&6
13122 fi
13123
13124     test -n "$XCURSES_CONFIG" && break
13125   done
13126 fi
13127 if test -z "$XCURSES_CONFIG"; then
13128   ac_ct_XCURSES_CONFIG=$XCURSES_CONFIG
13129   for ac_prog in xcurses-config
13130 do
13131   # Extract the first word of "$ac_prog", so it can be a program name with args.
13132 set dummy $ac_prog; ac_word=$2
13133 echo "$as_me:13133: checking for $ac_word" >&5
13134 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
13135 if test "${ac_cv_prog_ac_ct_XCURSES_CONFIG+set}" = set; then
13136   echo $ECHO_N "(cached) $ECHO_C" >&6
13137 else
13138   if test -n "$ac_ct_XCURSES_CONFIG"; then
13139   ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_ct_XCURSES_CONFIG" # Let the user override the test.
13140 else
13141   ac_save_IFS=$IFS; IFS=$ac_path_separator
13142 ac_dummy="$PATH"
13143 for ac_dir in $ac_dummy; do
13144   IFS=$ac_save_IFS
13145   test -z "$ac_dir" && ac_dir=.
13146   $as_executable_p "$ac_dir/$ac_word" || continue
13147 ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_prog"
13148 echo "$as_me:13148: found $ac_dir/$ac_word" >&5
13149 break
13150 done
13151
13152 fi
13153 fi
13154 ac_ct_XCURSES_CONFIG=$ac_cv_prog_ac_ct_XCURSES_CONFIG
13155 if test -n "$ac_ct_XCURSES_CONFIG"; then
13156   echo "$as_me:13156: result: $ac_ct_XCURSES_CONFIG" >&5
13157 echo "${ECHO_T}$ac_ct_XCURSES_CONFIG" >&6
13158 else
13159   echo "$as_me:13159: result: no" >&5
13160 echo "${ECHO_T}no" >&6
13161 fi
13162
13163   test -n "$ac_ct_XCURSES_CONFIG" && break
13164 done
13165 test -n "$ac_ct_XCURSES_CONFIG" || ac_ct_XCURSES_CONFIG="none"
13166
13167   XCURSES_CONFIG=$ac_ct_XCURSES_CONFIG
13168 fi
13169
13170 if test "$XCURSES_CONFIG" != none ; then
13171
13172 CPPFLAGS="$CPPFLAGS `$XCURSES_CONFIG --cflags`"
13173
13174 cf_add_libs="`$XCURSES_CONFIG --libs`"
13175 # Filter out duplicates - this happens with badly-designed ".pc" files...
13176 for cf_add_1lib in $LIBS
13177 do
13178         for cf_add_2lib in $cf_add_libs
13179         do
13180                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13181                 then
13182                         cf_add_1lib=
13183                         break
13184                 fi
13185         done
13186         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13187 done
13188 LIBS="$cf_add_libs"
13189
13190 cf_cv_lib_XCurses=yes
13191
13192 else
13193
13194 LDFLAGS="$LDFLAGS $X_LIBS"
13195
13196 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
13197
13198 echo "${as_me:-configure}:13198: testing checking additions to CFLAGS ..." 1>&5
13199
13200 cf_check_cflags="$CFLAGS"
13201 cf_check_cppflags="$CPPFLAGS"
13202
13203 cf_fix_cppflags=no
13204 cf_new_cflags=
13205 cf_new_cppflags=
13206 cf_new_extra_cppflags=
13207
13208 for cf_add_cflags in $X_CFLAGS
13209 do
13210 case $cf_fix_cppflags in
13211 (no)
13212         case $cf_add_cflags in
13213         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13214                 case $cf_add_cflags in
13215                 (-D*)
13216                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13217
13218                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13219                                 && test -z "${cf_tst_cflags}" \
13220                                 && cf_fix_cppflags=yes
13221
13222                         if test $cf_fix_cppflags = yes ; then
13223                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
13224                                 continue
13225                         elif test "${cf_tst_cflags}" = "\"'" ; then
13226                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
13227                                 continue
13228                         fi
13229                         ;;
13230                 esac
13231                 case "$CPPFLAGS" in
13232                 (*$cf_add_cflags)
13233                         ;;
13234                 (*)
13235                         case $cf_add_cflags in
13236                         (-D*)
13237                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13238
13239 CPPFLAGS=`echo "$CPPFLAGS" | \
13240         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13241                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13242
13243                                 ;;
13244                         esac
13245                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
13246                         ;;
13247                 esac
13248                 ;;
13249         (*)
13250                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
13251                 ;;
13252         esac
13253         ;;
13254 (yes)
13255         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
13256
13257         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13258
13259         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13260                 && test -z "${cf_tst_cflags}" \
13261                 && cf_fix_cppflags=no
13262         ;;
13263 esac
13264 done
13265
13266 if test -n "$cf_new_cflags" ; then
13267         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
13268
13269 echo "${as_me:-configure}:13269: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
13270
13271         CFLAGS="$CFLAGS $cf_new_cflags"
13272 fi
13273
13274 if test -n "$cf_new_cppflags" ; then
13275         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
13276
13277 echo "${as_me:-configure}:13277: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
13278
13279         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
13280 fi
13281
13282 if test -n "$cf_new_extra_cppflags" ; then
13283         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
13284
13285 echo "${as_me:-configure}:13285: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
13286
13287         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
13288 fi
13289
13290 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
13291 cat >conftest.$ac_ext <<_ACEOF
13292 #line 13292 "configure"
13293 #include "confdefs.h"
13294 #include <stdio.h>
13295 int
13296 main ()
13297 {
13298 printf("Hello world");
13299   ;
13300   return 0;
13301 }
13302 _ACEOF
13303 rm -f conftest.$ac_objext conftest$ac_exeext
13304 if { (eval echo "$as_me:13304: \"$ac_link\"") >&5
13305   (eval $ac_link) 2>&5
13306   ac_status=$?
13307   echo "$as_me:13307: \$? = $ac_status" >&5
13308   (exit $ac_status); } &&
13309          { ac_try='test -s conftest$ac_exeext'
13310   { (eval echo "$as_me:13310: \"$ac_try\"") >&5
13311   (eval $ac_try) 2>&5
13312   ac_status=$?
13313   echo "$as_me:13313: \$? = $ac_status" >&5
13314   (exit $ac_status); }; }; then
13315   :
13316 else
13317   echo "$as_me: failed program was:" >&5
13318 cat conftest.$ac_ext >&5
13319 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
13320
13321 echo "${as_me:-configure}:13321: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
13322
13323          if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
13324                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
13325
13326 echo "${as_me:-configure}:13326: testing but keeping change to \$CPPFLAGS ..." 1>&5
13327
13328          fi
13329          CFLAGS="$cf_check_flags"
13330 fi
13331 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13332 fi
13333
13334 echo "$as_me:13334: checking for XOpenDisplay in -lX11" >&5
13335 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
13336 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
13337   echo $ECHO_N "(cached) $ECHO_C" >&6
13338 else
13339   ac_check_lib_save_LIBS=$LIBS
13340 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
13341 cat >conftest.$ac_ext <<_ACEOF
13342 #line 13342 "configure"
13343 #include "confdefs.h"
13344
13345 /* Override any gcc2 internal prototype to avoid an error.  */
13346 #ifdef __cplusplus
13347 extern "C"
13348 #endif
13349 /* We use char because int might match the return type of a gcc2
13350    builtin and then its argument prototype would still apply.  */
13351 char XOpenDisplay ();
13352 int
13353 main ()
13354 {
13355 XOpenDisplay ();
13356   ;
13357   return 0;
13358 }
13359 _ACEOF
13360 rm -f conftest.$ac_objext conftest$ac_exeext
13361 if { (eval echo "$as_me:13361: \"$ac_link\"") >&5
13362   (eval $ac_link) 2>&5
13363   ac_status=$?
13364   echo "$as_me:13364: \$? = $ac_status" >&5
13365   (exit $ac_status); } &&
13366          { ac_try='test -s conftest$ac_exeext'
13367   { (eval echo "$as_me:13367: \"$ac_try\"") >&5
13368   (eval $ac_try) 2>&5
13369   ac_status=$?
13370   echo "$as_me:13370: \$? = $ac_status" >&5
13371   (exit $ac_status); }; }; then
13372   ac_cv_lib_X11_XOpenDisplay=yes
13373 else
13374   echo "$as_me: failed program was:" >&5
13375 cat conftest.$ac_ext >&5
13376 ac_cv_lib_X11_XOpenDisplay=no
13377 fi
13378 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13379 LIBS=$ac_check_lib_save_LIBS
13380 fi
13381 echo "$as_me:13381: result: $ac_cv_lib_X11_XOpenDisplay" >&5
13382 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
13383 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
13384
13385 cf_add_libs="-lX11"
13386 # Filter out duplicates - this happens with badly-designed ".pc" files...
13387 for cf_add_1lib in $LIBS
13388 do
13389         for cf_add_2lib in $cf_add_libs
13390         do
13391                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13392                 then
13393                         cf_add_1lib=
13394                         break
13395                 fi
13396         done
13397         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13398 done
13399 LIBS="$cf_add_libs"
13400
13401 fi
13402
13403 echo "$as_me:13403: checking for XCurses library" >&5
13404 echo $ECHO_N "checking for XCurses library... $ECHO_C" >&6
13405 if test "${cf_cv_lib_XCurses+set}" = set; then
13406   echo $ECHO_N "(cached) $ECHO_C" >&6
13407 else
13408
13409 cf_add_libs="-lXCurses"
13410 # Filter out duplicates - this happens with badly-designed ".pc" files...
13411 for cf_add_1lib in $LIBS
13412 do
13413         for cf_add_2lib in $cf_add_libs
13414         do
13415                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13416                 then
13417                         cf_add_1lib=
13418                         break
13419                 fi
13420         done
13421         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13422 done
13423 LIBS="$cf_add_libs"
13424
13425 cat >conftest.$ac_ext <<_ACEOF
13426 #line 13426 "configure"
13427 #include "confdefs.h"
13428
13429 #include <xcurses.h>
13430 char *XCursesProgramName = "test";
13431
13432 int
13433 main ()
13434 {
13435 XCursesExit();
13436   ;
13437   return 0;
13438 }
13439 _ACEOF
13440 rm -f conftest.$ac_objext conftest$ac_exeext
13441 if { (eval echo "$as_me:13441: \"$ac_link\"") >&5
13442   (eval $ac_link) 2>&5
13443   ac_status=$?
13444   echo "$as_me:13444: \$? = $ac_status" >&5
13445   (exit $ac_status); } &&
13446          { ac_try='test -s conftest$ac_exeext'
13447   { (eval echo "$as_me:13447: \"$ac_try\"") >&5
13448   (eval $ac_try) 2>&5
13449   ac_status=$?
13450   echo "$as_me:13450: \$? = $ac_status" >&5
13451   (exit $ac_status); }; }; then
13452   cf_cv_lib_XCurses=yes
13453 else
13454   echo "$as_me: failed program was:" >&5
13455 cat conftest.$ac_ext >&5
13456 cf_cv_lib_XCurses=no
13457 fi
13458 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13459
13460 fi
13461 echo "$as_me:13461: result: $cf_cv_lib_XCurses" >&5
13462 echo "${ECHO_T}$cf_cv_lib_XCurses" >&6
13463
13464 fi
13465
13466 if test $cf_cv_lib_XCurses = yes ; then
13467
13468 cat >>confdefs.h <<\EOF
13469 #define UNIX 1
13470 EOF
13471
13472 cat >>confdefs.h <<\EOF
13473 #define XCURSES 1
13474 EOF
13475
13476         echo "$as_me:13476: checking for xcurses.h" >&5
13477 echo $ECHO_N "checking for xcurses.h... $ECHO_C" >&6
13478 if test "${ac_cv_header_xcurses_h+set}" = set; then
13479   echo $ECHO_N "(cached) $ECHO_C" >&6
13480 else
13481   cat >conftest.$ac_ext <<_ACEOF
13482 #line 13482 "configure"
13483 #include "confdefs.h"
13484 #include <xcurses.h>
13485 _ACEOF
13486 if { (eval echo "$as_me:13486: \"$ac_cpp conftest.$ac_ext\"") >&5
13487   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13488   ac_status=$?
13489   egrep -v '^ *\+' conftest.er1 >conftest.err
13490   rm -f conftest.er1
13491   cat conftest.err >&5
13492   echo "$as_me:13492: \$? = $ac_status" >&5
13493   (exit $ac_status); } >/dev/null; then
13494   if test -s conftest.err; then
13495     ac_cpp_err=$ac_c_preproc_warn_flag
13496   else
13497     ac_cpp_err=
13498   fi
13499 else
13500   ac_cpp_err=yes
13501 fi
13502 if test -z "$ac_cpp_err"; then
13503   ac_cv_header_xcurses_h=yes
13504 else
13505   echo "$as_me: failed program was:" >&5
13506   cat conftest.$ac_ext >&5
13507   ac_cv_header_xcurses_h=no
13508 fi
13509 rm -f conftest.err conftest.$ac_ext
13510 fi
13511 echo "$as_me:13511: result: $ac_cv_header_xcurses_h" >&5
13512 echo "${ECHO_T}$ac_cv_header_xcurses_h" >&6
13513 if test $ac_cv_header_xcurses_h = yes; then
13514
13515 cat >>confdefs.h <<\EOF
13516 #define HAVE_XCURSES 1
13517 EOF
13518
13519 fi
13520
13521 else
13522         { { echo "$as_me:13522: error: Cannot link with XCurses" >&5
13523 echo "$as_me: error: Cannot link with XCurses" >&2;}
13524    { (exit 1); exit 1; }; }
13525 fi
13526
13527         ;;
13528 (*)
13529         { { echo "$as_me:13529: error: unexpected screen-value: $cf_cv_screen" >&5
13530 echo "$as_me: error: unexpected screen-value: $cf_cv_screen" >&2;}
13531    { (exit 1); exit 1; }; }
13532         ;;
13533 esac
13534
13535 : ${cf_nculib_root:=$cf_cv_screen}
13536 as_ac_Lib=`echo "ac_cv_lib_$cf_nculib_root''__nc_init_pthreads" | $as_tr_sh`
13537 echo "$as_me:13537: checking for _nc_init_pthreads in -l$cf_nculib_root" >&5
13538 echo $ECHO_N "checking for _nc_init_pthreads in -l$cf_nculib_root... $ECHO_C" >&6
13539 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
13540   echo $ECHO_N "(cached) $ECHO_C" >&6
13541 else
13542   ac_check_lib_save_LIBS=$LIBS
13543 LIBS="-l$cf_nculib_root  $LIBS"
13544 cat >conftest.$ac_ext <<_ACEOF
13545 #line 13545 "configure"
13546 #include "confdefs.h"
13547
13548 /* Override any gcc2 internal prototype to avoid an error.  */
13549 #ifdef __cplusplus
13550 extern "C"
13551 #endif
13552 /* We use char because int might match the return type of a gcc2
13553    builtin and then its argument prototype would still apply.  */
13554 char _nc_init_pthreads ();
13555 int
13556 main ()
13557 {
13558 _nc_init_pthreads ();
13559   ;
13560   return 0;
13561 }
13562 _ACEOF
13563 rm -f conftest.$ac_objext conftest$ac_exeext
13564 if { (eval echo "$as_me:13564: \"$ac_link\"") >&5
13565   (eval $ac_link) 2>&5
13566   ac_status=$?
13567   echo "$as_me:13567: \$? = $ac_status" >&5
13568   (exit $ac_status); } &&
13569          { ac_try='test -s conftest$ac_exeext'
13570   { (eval echo "$as_me:13570: \"$ac_try\"") >&5
13571   (eval $ac_try) 2>&5
13572   ac_status=$?
13573   echo "$as_me:13573: \$? = $ac_status" >&5
13574   (exit $ac_status); }; }; then
13575   eval "$as_ac_Lib=yes"
13576 else
13577   echo "$as_me: failed program was:" >&5
13578 cat conftest.$ac_ext >&5
13579 eval "$as_ac_Lib=no"
13580 fi
13581 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13582 LIBS=$ac_check_lib_save_LIBS
13583 fi
13584 echo "$as_me:13584: result: `eval echo '${'$as_ac_Lib'}'`" >&5
13585 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
13586 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
13587   cf_cv_ncurses_pthreads=yes
13588 else
13589   cf_cv_ncurses_pthreads=no
13590 fi
13591
13592 if test "$cf_cv_ncurses_pthreads" = yes
13593 then
13594
13595 cf_add_libs="-lpthread"
13596 # Filter out duplicates - this happens with badly-designed ".pc" files...
13597 for cf_add_1lib in $LIBS
13598 do
13599         for cf_add_2lib in $cf_add_libs
13600         do
13601                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13602                 then
13603                         cf_add_1lib=
13604                         break
13605                 fi
13606         done
13607         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13608 done
13609 LIBS="$cf_add_libs"
13610
13611 fi
13612
13613 case $cf_cv_screen in
13614 (ncurses*)
13615         cf_cv_libtype=`echo "$cf_cv_screen" | sed -e 's/^ncurses//'`
13616         ;;
13617 (curses|curses_*)
13618
13619 echo "$as_me:13619: checking for NetBSD form.h" >&5
13620 echo $ECHO_N "checking for NetBSD form.h... $ECHO_C" >&6
13621 if test "${cf_cv_netbsd_form_h+set}" = set; then
13622   echo $ECHO_N "(cached) $ECHO_C" >&6
13623 else
13624
13625 cat >conftest.$ac_ext <<_ACEOF
13626 #line 13626 "configure"
13627 #include "confdefs.h"
13628
13629 #include <${cf_cv_ncurses_header:-curses.h}>
13630 #include <form.h>
13631
13632 int
13633 main ()
13634 {
13635
13636         FORM *form;
13637         int y = current_field(form)->cursor_ypos;
13638         int x = current_field(form)->cursor_xpos;
13639
13640   ;
13641   return 0;
13642 }
13643 _ACEOF
13644 rm -f conftest.$ac_objext
13645 if { (eval echo "$as_me:13645: \"$ac_compile\"") >&5
13646   (eval $ac_compile) 2>&5
13647   ac_status=$?
13648   echo "$as_me:13648: \$? = $ac_status" >&5
13649   (exit $ac_status); } &&
13650          { ac_try='test -s conftest.$ac_objext'
13651   { (eval echo "$as_me:13651: \"$ac_try\"") >&5
13652   (eval $ac_try) 2>&5
13653   ac_status=$?
13654   echo "$as_me:13654: \$? = $ac_status" >&5
13655   (exit $ac_status); }; }; then
13656   cf_cv_netbsd_form_h=yes
13657
13658 else
13659   echo "$as_me: failed program was:" >&5
13660 cat conftest.$ac_ext >&5
13661 cf_cv_netbsd_form_h=no
13662 fi
13663 rm -f conftest.$ac_objext conftest.$ac_ext
13664
13665 fi
13666 echo "$as_me:13666: result: $cf_cv_netbsd_form_h" >&5
13667 echo "${ECHO_T}$cf_cv_netbsd_form_h" >&6
13668
13669 test "$cf_cv_netbsd_form_h" = yes &&
13670 cat >>confdefs.h <<\EOF
13671 #define HAVE_NETBSD_FORM_H 1
13672 EOF
13673
13674 echo "$as_me:13674: checking for NetBSD menu.h" >&5
13675 echo $ECHO_N "checking for NetBSD menu.h... $ECHO_C" >&6
13676 if test "${cf_cv_netbsd_menu_h+set}" = set; then
13677   echo $ECHO_N "(cached) $ECHO_C" >&6
13678 else
13679
13680 cat >conftest.$ac_ext <<_ACEOF
13681 #line 13681 "configure"
13682 #include "confdefs.h"
13683
13684 #include <${cf_cv_ncurses_header:-curses.h}>
13685 #include <menu.h>
13686
13687 int
13688 main ()
13689 {
13690
13691         MENU *menu;
13692         int y = menu->max_item_width;
13693
13694   ;
13695   return 0;
13696 }
13697 _ACEOF
13698 rm -f conftest.$ac_objext
13699 if { (eval echo "$as_me:13699: \"$ac_compile\"") >&5
13700   (eval $ac_compile) 2>&5
13701   ac_status=$?
13702   echo "$as_me:13702: \$? = $ac_status" >&5
13703   (exit $ac_status); } &&
13704          { ac_try='test -s conftest.$ac_objext'
13705   { (eval echo "$as_me:13705: \"$ac_try\"") >&5
13706   (eval $ac_try) 2>&5
13707   ac_status=$?
13708   echo "$as_me:13708: \$? = $ac_status" >&5
13709   (exit $ac_status); }; }; then
13710   cf_cv_netbsd_menu_h=yes
13711
13712 else
13713   echo "$as_me: failed program was:" >&5
13714 cat conftest.$ac_ext >&5
13715 cf_cv_netbsd_menu_h=no
13716 fi
13717 rm -f conftest.$ac_objext conftest.$ac_ext
13718
13719 fi
13720 echo "$as_me:13720: result: $cf_cv_netbsd_menu_h" >&5
13721 echo "${ECHO_T}$cf_cv_netbsd_menu_h" >&6
13722
13723 test "$cf_cv_netbsd_menu_h" = yes &&
13724 cat >>confdefs.h <<\EOF
13725 #define HAVE_NETBSD_MENU_H 1
13726 EOF
13727
13728         ;;
13729 esac
13730
13731 case $cf_cv_screen in
13732 (pdcurses)
13733         ;;
13734 (*)
13735         # look for curses-related libraries
13736
13737 as_ac_Lib=`echo "ac_cv_lib_panel$cf_cv_libtype''_new_panel" | $as_tr_sh`
13738 echo "$as_me:13738: checking for new_panel in -lpanel$cf_cv_libtype" >&5
13739 echo $ECHO_N "checking for new_panel in -lpanel$cf_cv_libtype... $ECHO_C" >&6
13740 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
13741   echo $ECHO_N "(cached) $ECHO_C" >&6
13742 else
13743   ac_check_lib_save_LIBS=$LIBS
13744 LIBS="-lpanel$cf_cv_libtype  $LIBS"
13745 cat >conftest.$ac_ext <<_ACEOF
13746 #line 13746 "configure"
13747 #include "confdefs.h"
13748
13749 /* Override any gcc2 internal prototype to avoid an error.  */
13750 #ifdef __cplusplus
13751 extern "C"
13752 #endif
13753 /* We use char because int might match the return type of a gcc2
13754    builtin and then its argument prototype would still apply.  */
13755 char new_panel ();
13756 int
13757 main ()
13758 {
13759 new_panel ();
13760   ;
13761   return 0;
13762 }
13763 _ACEOF
13764 rm -f conftest.$ac_objext conftest$ac_exeext
13765 if { (eval echo "$as_me:13765: \"$ac_link\"") >&5
13766   (eval $ac_link) 2>&5
13767   ac_status=$?
13768   echo "$as_me:13768: \$? = $ac_status" >&5
13769   (exit $ac_status); } &&
13770          { ac_try='test -s conftest$ac_exeext'
13771   { (eval echo "$as_me:13771: \"$ac_try\"") >&5
13772   (eval $ac_try) 2>&5
13773   ac_status=$?
13774   echo "$as_me:13774: \$? = $ac_status" >&5
13775   (exit $ac_status); }; }; then
13776   eval "$as_ac_Lib=yes"
13777 else
13778   echo "$as_me: failed program was:" >&5
13779 cat conftest.$ac_ext >&5
13780 eval "$as_ac_Lib=no"
13781 fi
13782 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13783 LIBS=$ac_check_lib_save_LIBS
13784 fi
13785 echo "$as_me:13785: result: `eval echo '${'$as_ac_Lib'}'`" >&5
13786 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
13787 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
13788
13789 cf_upper=`echo "have_libpanel" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
13790
13791 cf_add_libs="-lpanel$cf_cv_libtype"
13792 # Filter out duplicates - this happens with badly-designed ".pc" files...
13793 for cf_add_1lib in $LIBS
13794 do
13795         for cf_add_2lib in $cf_add_libs
13796         do
13797                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13798                 then
13799                         cf_add_1lib=
13800                         break
13801                 fi
13802         done
13803         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13804 done
13805 LIBS="$cf_add_libs"
13806
13807 cat >>confdefs.h <<EOF
13808 #define $cf_upper 1
13809 EOF
13810
13811 fi
13812
13813 as_ac_Lib=`echo "ac_cv_lib_menu$cf_cv_libtype''_menu_driver" | $as_tr_sh`
13814 echo "$as_me:13814: checking for menu_driver in -lmenu$cf_cv_libtype" >&5
13815 echo $ECHO_N "checking for menu_driver in -lmenu$cf_cv_libtype... $ECHO_C" >&6
13816 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
13817   echo $ECHO_N "(cached) $ECHO_C" >&6
13818 else
13819   ac_check_lib_save_LIBS=$LIBS
13820 LIBS="-lmenu$cf_cv_libtype  $LIBS"
13821 cat >conftest.$ac_ext <<_ACEOF
13822 #line 13822 "configure"
13823 #include "confdefs.h"
13824
13825 /* Override any gcc2 internal prototype to avoid an error.  */
13826 #ifdef __cplusplus
13827 extern "C"
13828 #endif
13829 /* We use char because int might match the return type of a gcc2
13830    builtin and then its argument prototype would still apply.  */
13831 char menu_driver ();
13832 int
13833 main ()
13834 {
13835 menu_driver ();
13836   ;
13837   return 0;
13838 }
13839 _ACEOF
13840 rm -f conftest.$ac_objext conftest$ac_exeext
13841 if { (eval echo "$as_me:13841: \"$ac_link\"") >&5
13842   (eval $ac_link) 2>&5
13843   ac_status=$?
13844   echo "$as_me:13844: \$? = $ac_status" >&5
13845   (exit $ac_status); } &&
13846          { ac_try='test -s conftest$ac_exeext'
13847   { (eval echo "$as_me:13847: \"$ac_try\"") >&5
13848   (eval $ac_try) 2>&5
13849   ac_status=$?
13850   echo "$as_me:13850: \$? = $ac_status" >&5
13851   (exit $ac_status); }; }; then
13852   eval "$as_ac_Lib=yes"
13853 else
13854   echo "$as_me: failed program was:" >&5
13855 cat conftest.$ac_ext >&5
13856 eval "$as_ac_Lib=no"
13857 fi
13858 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13859 LIBS=$ac_check_lib_save_LIBS
13860 fi
13861 echo "$as_me:13861: result: `eval echo '${'$as_ac_Lib'}'`" >&5
13862 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
13863 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
13864
13865 cf_upper=`echo "have_libmenu" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
13866
13867 cf_add_libs="-lmenu$cf_cv_libtype"
13868 # Filter out duplicates - this happens with badly-designed ".pc" files...
13869 for cf_add_1lib in $LIBS
13870 do
13871         for cf_add_2lib in $cf_add_libs
13872         do
13873                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13874                 then
13875                         cf_add_1lib=
13876                         break
13877                 fi
13878         done
13879         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13880 done
13881 LIBS="$cf_add_libs"
13882
13883 cat >>confdefs.h <<EOF
13884 #define $cf_upper 1
13885 EOF
13886
13887 fi
13888
13889 as_ac_Lib=`echo "ac_cv_lib_form$cf_cv_libtype''_form_driver" | $as_tr_sh`
13890 echo "$as_me:13890: checking for form_driver in -lform$cf_cv_libtype" >&5
13891 echo $ECHO_N "checking for form_driver in -lform$cf_cv_libtype... $ECHO_C" >&6
13892 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
13893   echo $ECHO_N "(cached) $ECHO_C" >&6
13894 else
13895   ac_check_lib_save_LIBS=$LIBS
13896 LIBS="-lform$cf_cv_libtype  $LIBS"
13897 cat >conftest.$ac_ext <<_ACEOF
13898 #line 13898 "configure"
13899 #include "confdefs.h"
13900
13901 /* Override any gcc2 internal prototype to avoid an error.  */
13902 #ifdef __cplusplus
13903 extern "C"
13904 #endif
13905 /* We use char because int might match the return type of a gcc2
13906    builtin and then its argument prototype would still apply.  */
13907 char form_driver ();
13908 int
13909 main ()
13910 {
13911 form_driver ();
13912   ;
13913   return 0;
13914 }
13915 _ACEOF
13916 rm -f conftest.$ac_objext conftest$ac_exeext
13917 if { (eval echo "$as_me:13917: \"$ac_link\"") >&5
13918   (eval $ac_link) 2>&5
13919   ac_status=$?
13920   echo "$as_me:13920: \$? = $ac_status" >&5
13921   (exit $ac_status); } &&
13922          { ac_try='test -s conftest$ac_exeext'
13923   { (eval echo "$as_me:13923: \"$ac_try\"") >&5
13924   (eval $ac_try) 2>&5
13925   ac_status=$?
13926   echo "$as_me:13926: \$? = $ac_status" >&5
13927   (exit $ac_status); }; }; then
13928   eval "$as_ac_Lib=yes"
13929 else
13930   echo "$as_me: failed program was:" >&5
13931 cat conftest.$ac_ext >&5
13932 eval "$as_ac_Lib=no"
13933 fi
13934 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13935 LIBS=$ac_check_lib_save_LIBS
13936 fi
13937 echo "$as_me:13937: result: `eval echo '${'$as_ac_Lib'}'`" >&5
13938 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
13939 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
13940
13941 cf_upper=`echo "have_libform" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
13942
13943 cf_add_libs="-lform$cf_cv_libtype"
13944 # Filter out duplicates - this happens with badly-designed ".pc" files...
13945 for cf_add_1lib in $LIBS
13946 do
13947         for cf_add_2lib in $cf_add_libs
13948         do
13949                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13950                 then
13951                         cf_add_1lib=
13952                         break
13953                 fi
13954         done
13955         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13956 done
13957 LIBS="$cf_add_libs"
13958
13959 cat >>confdefs.h <<EOF
13960 #define $cf_upper 1
13961 EOF
13962
13963 fi
13964
13965         # look for curses-related headers
13966
13967 for ac_header in \
13968                 nc_alloc.h \
13969                 nomacros.h \
13970                 form.h \
13971                 menu.h \
13972                 panel.h \
13973                 term_entry.h \
13974
13975 do
13976 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
13977 echo "$as_me:13977: checking for $ac_header" >&5
13978 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
13979 if eval "test \"\${$as_ac_Header+set}\" = set"; then
13980   echo $ECHO_N "(cached) $ECHO_C" >&6
13981 else
13982   cat >conftest.$ac_ext <<_ACEOF
13983 #line 13983 "configure"
13984 #include "confdefs.h"
13985 #include <$ac_header>
13986 _ACEOF
13987 if { (eval echo "$as_me:13987: \"$ac_cpp conftest.$ac_ext\"") >&5
13988   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13989   ac_status=$?
13990   egrep -v '^ *\+' conftest.er1 >conftest.err
13991   rm -f conftest.er1
13992   cat conftest.err >&5
13993   echo "$as_me:13993: \$? = $ac_status" >&5
13994   (exit $ac_status); } >/dev/null; then
13995   if test -s conftest.err; then
13996     ac_cpp_err=$ac_c_preproc_warn_flag
13997   else
13998     ac_cpp_err=
13999   fi
14000 else
14001   ac_cpp_err=yes
14002 fi
14003 if test -z "$ac_cpp_err"; then
14004   eval "$as_ac_Header=yes"
14005 else
14006   echo "$as_me: failed program was:" >&5
14007   cat conftest.$ac_ext >&5
14008   eval "$as_ac_Header=no"
14009 fi
14010 rm -f conftest.err conftest.$ac_ext
14011 fi
14012 echo "$as_me:14012: result: `eval echo '${'$as_ac_Header'}'`" >&5
14013 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
14014 if test `eval echo '${'$as_ac_Header'}'` = yes; then
14015   cat >>confdefs.h <<EOF
14016 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
14017 EOF
14018
14019 fi
14020 done
14021
14022         ;;
14023 esac
14024
14025 echo "$as_me:14025: checking for ANSI C header files" >&5
14026 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
14027 if test "${ac_cv_header_stdc+set}" = set; then
14028   echo $ECHO_N "(cached) $ECHO_C" >&6
14029 else
14030   cat >conftest.$ac_ext <<_ACEOF
14031 #line 14031 "configure"
14032 #include "confdefs.h"
14033 #include <stdlib.h>
14034 #include <stdarg.h>
14035 #include <string.h>
14036 #include <float.h>
14037
14038 _ACEOF
14039 if { (eval echo "$as_me:14039: \"$ac_cpp conftest.$ac_ext\"") >&5
14040   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
14041   ac_status=$?
14042   egrep -v '^ *\+' conftest.er1 >conftest.err
14043   rm -f conftest.er1
14044   cat conftest.err >&5
14045   echo "$as_me:14045: \$? = $ac_status" >&5
14046   (exit $ac_status); } >/dev/null; then
14047   if test -s conftest.err; then
14048     ac_cpp_err=$ac_c_preproc_warn_flag
14049   else
14050     ac_cpp_err=
14051   fi
14052 else
14053   ac_cpp_err=yes
14054 fi
14055 if test -z "$ac_cpp_err"; then
14056   ac_cv_header_stdc=yes
14057 else
14058   echo "$as_me: failed program was:" >&5
14059   cat conftest.$ac_ext >&5
14060   ac_cv_header_stdc=no
14061 fi
14062 rm -f conftest.err conftest.$ac_ext
14063
14064 if test $ac_cv_header_stdc = yes; then
14065   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
14066   cat >conftest.$ac_ext <<_ACEOF
14067 #line 14067 "configure"
14068 #include "confdefs.h"
14069 #include <string.h>
14070
14071 _ACEOF
14072 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14073   egrep "memchr" >/dev/null 2>&1; then
14074   :
14075 else
14076   ac_cv_header_stdc=no
14077 fi
14078 rm -rf conftest*
14079
14080 fi
14081
14082 if test $ac_cv_header_stdc = yes; then
14083   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
14084   cat >conftest.$ac_ext <<_ACEOF
14085 #line 14085 "configure"
14086 #include "confdefs.h"
14087 #include <stdlib.h>
14088
14089 _ACEOF
14090 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14091   egrep "free" >/dev/null 2>&1; then
14092   :
14093 else
14094   ac_cv_header_stdc=no
14095 fi
14096 rm -rf conftest*
14097
14098 fi
14099
14100 if test $ac_cv_header_stdc = yes; then
14101   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
14102   if test "$cross_compiling" = yes; then
14103   :
14104 else
14105   cat >conftest.$ac_ext <<_ACEOF
14106 #line 14106 "configure"
14107 #include "confdefs.h"
14108 #include <ctype.h>
14109 #if ((' ' & 0x0FF) == 0x020)
14110 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
14111 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
14112 #else
14113 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
14114                      || ('j' <= (c) && (c) <= 'r') \
14115                      || ('s' <= (c) && (c) <= 'z'))
14116 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
14117 #endif
14118
14119 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
14120 int
14121 main ()
14122 {
14123   int i;
14124   for (i = 0; i < 256; i++)
14125     if (XOR (islower (i), ISLOWER (i))
14126         || toupper (i) != TOUPPER (i))
14127       $ac_main_return(2);
14128   $ac_main_return (0);
14129 }
14130 _ACEOF
14131 rm -f conftest$ac_exeext
14132 if { (eval echo "$as_me:14132: \"$ac_link\"") >&5
14133   (eval $ac_link) 2>&5
14134   ac_status=$?
14135   echo "$as_me:14135: \$? = $ac_status" >&5
14136   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
14137   { (eval echo "$as_me:14137: \"$ac_try\"") >&5
14138   (eval $ac_try) 2>&5
14139   ac_status=$?
14140   echo "$as_me:14140: \$? = $ac_status" >&5
14141   (exit $ac_status); }; }; then
14142   :
14143 else
14144   echo "$as_me: program exited with status $ac_status" >&5
14145 echo "$as_me: failed program was:" >&5
14146 cat conftest.$ac_ext >&5
14147 ac_cv_header_stdc=no
14148 fi
14149 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
14150 fi
14151 fi
14152 fi
14153 echo "$as_me:14153: result: $ac_cv_header_stdc" >&5
14154 echo "${ECHO_T}$ac_cv_header_stdc" >&6
14155 if test $ac_cv_header_stdc = yes; then
14156
14157 cat >>confdefs.h <<\EOF
14158 #define STDC_HEADERS 1
14159 EOF
14160
14161 fi
14162
14163 echo "$as_me:14163: checking whether time.h and sys/time.h may both be included" >&5
14164 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
14165 if test "${ac_cv_header_time+set}" = set; then
14166   echo $ECHO_N "(cached) $ECHO_C" >&6
14167 else
14168   cat >conftest.$ac_ext <<_ACEOF
14169 #line 14169 "configure"
14170 #include "confdefs.h"
14171 #include <sys/types.h>
14172 #include <sys/time.h>
14173 #include <time.h>
14174
14175 int
14176 main ()
14177 {
14178 if ((struct tm *) 0)
14179 return 0;
14180   ;
14181   return 0;
14182 }
14183 _ACEOF
14184 rm -f conftest.$ac_objext
14185 if { (eval echo "$as_me:14185: \"$ac_compile\"") >&5
14186   (eval $ac_compile) 2>&5
14187   ac_status=$?
14188   echo "$as_me:14188: \$? = $ac_status" >&5
14189   (exit $ac_status); } &&
14190          { ac_try='test -s conftest.$ac_objext'
14191   { (eval echo "$as_me:14191: \"$ac_try\"") >&5
14192   (eval $ac_try) 2>&5
14193   ac_status=$?
14194   echo "$as_me:14194: \$? = $ac_status" >&5
14195   (exit $ac_status); }; }; then
14196   ac_cv_header_time=yes
14197 else
14198   echo "$as_me: failed program was:" >&5
14199 cat conftest.$ac_ext >&5
14200 ac_cv_header_time=no
14201 fi
14202 rm -f conftest.$ac_objext conftest.$ac_ext
14203 fi
14204 echo "$as_me:14204: result: $ac_cv_header_time" >&5
14205 echo "${ECHO_T}$ac_cv_header_time" >&6
14206 if test $ac_cv_header_time = yes; then
14207
14208 cat >>confdefs.h <<\EOF
14209 #define TIME_WITH_SYS_TIME 1
14210 EOF
14211
14212 fi
14213
14214 for ac_header in \
14215 getopt.h \
14216 locale.h \
14217 math.h \
14218 stdarg.h \
14219 sys/ioctl.h \
14220 sys/select.h \
14221 sys/time.h \
14222 termios.h \
14223 unistd.h \
14224
14225 do
14226 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
14227 echo "$as_me:14227: checking for $ac_header" >&5
14228 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
14229 if eval "test \"\${$as_ac_Header+set}\" = set"; then
14230   echo $ECHO_N "(cached) $ECHO_C" >&6
14231 else
14232   cat >conftest.$ac_ext <<_ACEOF
14233 #line 14233 "configure"
14234 #include "confdefs.h"
14235 #include <$ac_header>
14236 _ACEOF
14237 if { (eval echo "$as_me:14237: \"$ac_cpp conftest.$ac_ext\"") >&5
14238   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
14239   ac_status=$?
14240   egrep -v '^ *\+' conftest.er1 >conftest.err
14241   rm -f conftest.er1
14242   cat conftest.err >&5
14243   echo "$as_me:14243: \$? = $ac_status" >&5
14244   (exit $ac_status); } >/dev/null; then
14245   if test -s conftest.err; then
14246     ac_cpp_err=$ac_c_preproc_warn_flag
14247   else
14248     ac_cpp_err=
14249   fi
14250 else
14251   ac_cpp_err=yes
14252 fi
14253 if test -z "$ac_cpp_err"; then
14254   eval "$as_ac_Header=yes"
14255 else
14256   echo "$as_me: failed program was:" >&5
14257   cat conftest.$ac_ext >&5
14258   eval "$as_ac_Header=no"
14259 fi
14260 rm -f conftest.err conftest.$ac_ext
14261 fi
14262 echo "$as_me:14262: result: `eval echo '${'$as_ac_Header'}'`" >&5
14263 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
14264 if test `eval echo '${'$as_ac_Header'}'` = yes; then
14265   cat >>confdefs.h <<EOF
14266 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
14267 EOF
14268
14269 fi
14270 done
14271
14272 for ac_header in unistd.h getopt.h
14273 do
14274 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
14275 echo "$as_me:14275: checking for $ac_header" >&5
14276 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
14277 if eval "test \"\${$as_ac_Header+set}\" = set"; then
14278   echo $ECHO_N "(cached) $ECHO_C" >&6
14279 else
14280   cat >conftest.$ac_ext <<_ACEOF
14281 #line 14281 "configure"
14282 #include "confdefs.h"
14283 #include <$ac_header>
14284 _ACEOF
14285 if { (eval echo "$as_me:14285: \"$ac_cpp conftest.$ac_ext\"") >&5
14286   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
14287   ac_status=$?
14288   egrep -v '^ *\+' conftest.er1 >conftest.err
14289   rm -f conftest.er1
14290   cat conftest.err >&5
14291   echo "$as_me:14291: \$? = $ac_status" >&5
14292   (exit $ac_status); } >/dev/null; then
14293   if test -s conftest.err; then
14294     ac_cpp_err=$ac_c_preproc_warn_flag
14295   else
14296     ac_cpp_err=
14297   fi
14298 else
14299   ac_cpp_err=yes
14300 fi
14301 if test -z "$ac_cpp_err"; then
14302   eval "$as_ac_Header=yes"
14303 else
14304   echo "$as_me: failed program was:" >&5
14305   cat conftest.$ac_ext >&5
14306   eval "$as_ac_Header=no"
14307 fi
14308 rm -f conftest.err conftest.$ac_ext
14309 fi
14310 echo "$as_me:14310: result: `eval echo '${'$as_ac_Header'}'`" >&5
14311 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
14312 if test `eval echo '${'$as_ac_Header'}'` = yes; then
14313   cat >>confdefs.h <<EOF
14314 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
14315 EOF
14316
14317 fi
14318 done
14319
14320 echo "$as_me:14320: checking for header declaring getopt variables" >&5
14321 echo $ECHO_N "checking for header declaring getopt variables... $ECHO_C" >&6
14322 if test "${cf_cv_getopt_header+set}" = set; then
14323   echo $ECHO_N "(cached) $ECHO_C" >&6
14324 else
14325
14326 cf_cv_getopt_header=none
14327 for cf_header in stdio.h stdlib.h unistd.h getopt.h
14328 do
14329 cat >conftest.$ac_ext <<_ACEOF
14330 #line 14330 "configure"
14331 #include "confdefs.h"
14332
14333 #include <$cf_header>
14334 int
14335 main ()
14336 {
14337 int x = optind; char *y = optarg
14338   ;
14339   return 0;
14340 }
14341 _ACEOF
14342 rm -f conftest.$ac_objext
14343 if { (eval echo "$as_me:14343: \"$ac_compile\"") >&5
14344   (eval $ac_compile) 2>&5
14345   ac_status=$?
14346   echo "$as_me:14346: \$? = $ac_status" >&5
14347   (exit $ac_status); } &&
14348          { ac_try='test -s conftest.$ac_objext'
14349   { (eval echo "$as_me:14349: \"$ac_try\"") >&5
14350   (eval $ac_try) 2>&5
14351   ac_status=$?
14352   echo "$as_me:14352: \$? = $ac_status" >&5
14353   (exit $ac_status); }; }; then
14354   cf_cv_getopt_header=$cf_header
14355  break
14356 else
14357   echo "$as_me: failed program was:" >&5
14358 cat conftest.$ac_ext >&5
14359 fi
14360 rm -f conftest.$ac_objext conftest.$ac_ext
14361 done
14362
14363 fi
14364 echo "$as_me:14364: result: $cf_cv_getopt_header" >&5
14365 echo "${ECHO_T}$cf_cv_getopt_header" >&6
14366 if test $cf_cv_getopt_header != none ; then
14367
14368 cat >>confdefs.h <<\EOF
14369 #define HAVE_GETOPT_HEADER 1
14370 EOF
14371
14372 fi
14373 if test $cf_cv_getopt_header = getopt.h ; then
14374
14375 cat >>confdefs.h <<\EOF
14376 #define NEED_GETOPT_H 1
14377 EOF
14378
14379 fi
14380
14381 for ac_func in \
14382 getopt \
14383 gettimeofday \
14384
14385 do
14386 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
14387 echo "$as_me:14387: checking for $ac_func" >&5
14388 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
14389 if eval "test \"\${$as_ac_var+set}\" = set"; then
14390   echo $ECHO_N "(cached) $ECHO_C" >&6
14391 else
14392   cat >conftest.$ac_ext <<_ACEOF
14393 #line 14393 "configure"
14394 #include "confdefs.h"
14395 /* System header to define __stub macros and hopefully few prototypes,
14396     which can conflict with char $ac_func (); below.  */
14397 #include <assert.h>
14398 /* Override any gcc2 internal prototype to avoid an error.  */
14399 #ifdef __cplusplus
14400 extern "C"
14401 #endif
14402 /* We use char because int might match the return type of a gcc2
14403    builtin and then its argument prototype would still apply.  */
14404 char $ac_func ();
14405 char (*f) ();
14406
14407 int
14408 main ()
14409 {
14410 /* The GNU C library defines this for functions which it implements
14411     to always fail with ENOSYS.  Some functions are actually named
14412     something starting with __ and the normal name is an alias.  */
14413 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
14414 choke me
14415 #else
14416 f = $ac_func; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
14417 #endif
14418
14419   ;
14420   return 0;
14421 }
14422 _ACEOF
14423 rm -f conftest.$ac_objext conftest$ac_exeext
14424 if { (eval echo "$as_me:14424: \"$ac_link\"") >&5
14425   (eval $ac_link) 2>&5
14426   ac_status=$?
14427   echo "$as_me:14427: \$? = $ac_status" >&5
14428   (exit $ac_status); } &&
14429          { ac_try='test -s conftest$ac_exeext'
14430   { (eval echo "$as_me:14430: \"$ac_try\"") >&5
14431   (eval $ac_try) 2>&5
14432   ac_status=$?
14433   echo "$as_me:14433: \$? = $ac_status" >&5
14434   (exit $ac_status); }; }; then
14435   eval "$as_ac_var=yes"
14436 else
14437   echo "$as_me: failed program was:" >&5
14438 cat conftest.$ac_ext >&5
14439 eval "$as_ac_var=no"
14440 fi
14441 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14442 fi
14443 echo "$as_me:14443: result: `eval echo '${'$as_ac_var'}'`" >&5
14444 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
14445 if test `eval echo '${'$as_ac_var'}'` = yes; then
14446   cat >>confdefs.h <<EOF
14447 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
14448 EOF
14449
14450 fi
14451 done
14452
14453 if test "x$ac_cv_func_getopt" = xno; then
14454         { { echo "$as_me:14454: error: getopt is required for building programs" >&5
14455 echo "$as_me: error: getopt is required for building programs" >&2;}
14456    { (exit 1); exit 1; }; }
14457 fi
14458
14459 if test "$cf_enable_widec" = yes; then
14460
14461 for ac_func in \
14462 mblen \
14463 mbrlen \
14464 mbrtowc \
14465 mbsrtowcs \
14466 mbstowcs \
14467 mbtowc \
14468 wcsrtombs \
14469 wcstombs \
14470
14471 do
14472 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
14473 echo "$as_me:14473: checking for $ac_func" >&5
14474 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
14475 if eval "test \"\${$as_ac_var+set}\" = set"; then
14476   echo $ECHO_N "(cached) $ECHO_C" >&6
14477 else
14478   cat >conftest.$ac_ext <<_ACEOF
14479 #line 14479 "configure"
14480 #include "confdefs.h"
14481 /* System header to define __stub macros and hopefully few prototypes,
14482     which can conflict with char $ac_func (); below.  */
14483 #include <assert.h>
14484 /* Override any gcc2 internal prototype to avoid an error.  */
14485 #ifdef __cplusplus
14486 extern "C"
14487 #endif
14488 /* We use char because int might match the return type of a gcc2
14489    builtin and then its argument prototype would still apply.  */
14490 char $ac_func ();
14491 char (*f) ();
14492
14493 int
14494 main ()
14495 {
14496 /* The GNU C library defines this for functions which it implements
14497     to always fail with ENOSYS.  Some functions are actually named
14498     something starting with __ and the normal name is an alias.  */
14499 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
14500 choke me
14501 #else
14502 f = $ac_func; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
14503 #endif
14504
14505   ;
14506   return 0;
14507 }
14508 _ACEOF
14509 rm -f conftest.$ac_objext conftest$ac_exeext
14510 if { (eval echo "$as_me:14510: \"$ac_link\"") >&5
14511   (eval $ac_link) 2>&5
14512   ac_status=$?
14513   echo "$as_me:14513: \$? = $ac_status" >&5
14514   (exit $ac_status); } &&
14515          { ac_try='test -s conftest$ac_exeext'
14516   { (eval echo "$as_me:14516: \"$ac_try\"") >&5
14517   (eval $ac_try) 2>&5
14518   ac_status=$?
14519   echo "$as_me:14519: \$? = $ac_status" >&5
14520   (exit $ac_status); }; }; then
14521   eval "$as_ac_var=yes"
14522 else
14523   echo "$as_me: failed program was:" >&5
14524 cat conftest.$ac_ext >&5
14525 eval "$as_ac_var=no"
14526 fi
14527 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14528 fi
14529 echo "$as_me:14529: result: `eval echo '${'$as_ac_var'}'`" >&5
14530 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
14531 if test `eval echo '${'$as_ac_var'}'` = yes; then
14532   cat >>confdefs.h <<EOF
14533 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
14534 EOF
14535
14536 fi
14537 done
14538
14539 fi
14540
14541 echo "$as_me:14541: checking definition to turn on extended curses functions" >&5
14542 echo $ECHO_N "checking definition to turn on extended curses functions... $ECHO_C" >&6
14543 if test "${cf_cv_need_xopen_extension+set}" = set; then
14544   echo $ECHO_N "(cached) $ECHO_C" >&6
14545 else
14546
14547 cf_cv_need_xopen_extension=unknown
14548 cat >conftest.$ac_ext <<_ACEOF
14549 #line 14549 "configure"
14550 #include "confdefs.h"
14551
14552 #include <stdlib.h>
14553 #include <${cf_cv_ncurses_header:-curses.h}>
14554 int
14555 main ()
14556 {
14557
14558 #if defined(NCURSES_VERSION_PATCH)
14559 #if (NCURSES_VERSION_PATCH < 20100501) && (NCURSES_VERSION_PATCH >= 20100403)
14560         make an error
14561 #endif
14562 #endif
14563 #ifdef NCURSES_VERSION
14564         cchar_t check;
14565         int check2 = curs_set((int)sizeof(check));
14566 #endif
14567         long x = winnstr(stdscr, "", 0);
14568         int x1, y1;
14569         getbegyx(stdscr, y1, x1)
14570   ;
14571   return 0;
14572 }
14573 _ACEOF
14574 rm -f conftest.$ac_objext conftest$ac_exeext
14575 if { (eval echo "$as_me:14575: \"$ac_link\"") >&5
14576   (eval $ac_link) 2>&5
14577   ac_status=$?
14578   echo "$as_me:14578: \$? = $ac_status" >&5
14579   (exit $ac_status); } &&
14580          { ac_try='test -s conftest$ac_exeext'
14581   { (eval echo "$as_me:14581: \"$ac_try\"") >&5
14582   (eval $ac_try) 2>&5
14583   ac_status=$?
14584   echo "$as_me:14584: \$? = $ac_status" >&5
14585   (exit $ac_status); }; }; then
14586   cf_cv_need_xopen_extension=none
14587 else
14588   echo "$as_me: failed program was:" >&5
14589 cat conftest.$ac_ext >&5
14590
14591         for cf_try_xopen_extension in _XOPEN_SOURCE_EXTENDED NCURSES_WIDECHAR
14592         do
14593                 cat >conftest.$ac_ext <<_ACEOF
14594 #line 14594 "configure"
14595 #include "confdefs.h"
14596
14597 #define $cf_try_xopen_extension 1
14598 #include <stdlib.h>
14599 #include <${cf_cv_ncurses_header:-curses.h}>
14600 int
14601 main ()
14602 {
14603
14604 #ifdef NCURSES_VERSION
14605                 cchar_t check;
14606                 int check2 = curs_set((int)sizeof(check));
14607 #endif
14608                 long x = winnstr(stdscr, "", 0);
14609                 int x1, y1;
14610                 getbegyx(stdscr, y1, x1)
14611   ;
14612   return 0;
14613 }
14614 _ACEOF
14615 rm -f conftest.$ac_objext conftest$ac_exeext
14616 if { (eval echo "$as_me:14616: \"$ac_link\"") >&5
14617   (eval $ac_link) 2>&5
14618   ac_status=$?
14619   echo "$as_me:14619: \$? = $ac_status" >&5
14620   (exit $ac_status); } &&
14621          { ac_try='test -s conftest$ac_exeext'
14622   { (eval echo "$as_me:14622: \"$ac_try\"") >&5
14623   (eval $ac_try) 2>&5
14624   ac_status=$?
14625   echo "$as_me:14625: \$? = $ac_status" >&5
14626   (exit $ac_status); }; }; then
14627   cf_cv_need_xopen_extension=$cf_try_xopen_extension; break
14628 else
14629   echo "$as_me: failed program was:" >&5
14630 cat conftest.$ac_ext >&5
14631 fi
14632 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14633         done
14634
14635 fi
14636 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14637
14638 fi
14639 echo "$as_me:14639: result: $cf_cv_need_xopen_extension" >&5
14640 echo "${ECHO_T}$cf_cv_need_xopen_extension" >&6
14641
14642 case $cf_cv_need_xopen_extension in
14643 (*_*)
14644         CPPFLAGS="$CPPFLAGS -D$cf_cv_need_xopen_extension"
14645         ;;
14646 esac
14647
14648 echo "$as_me:14648: checking for term.h" >&5
14649 echo $ECHO_N "checking for term.h... $ECHO_C" >&6
14650 if test "${cf_cv_term_header+set}" = set; then
14651   echo $ECHO_N "(cached) $ECHO_C" >&6
14652 else
14653
14654 # If we found <ncurses/curses.h>, look for <ncurses/term.h>, but always look
14655 # for <term.h> if we do not find the variant.
14656
14657 cf_header_list="term.h ncurses/term.h ncursesw/term.h"
14658
14659 case ${cf_cv_ncurses_header:-curses.h} in
14660 (*/*)
14661         cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`term.h
14662         cf_header_list="$cf_header_item $cf_header_list"
14663         ;;
14664 esac
14665
14666 for cf_header in $cf_header_list
14667 do
14668         cat >conftest.$ac_ext <<_ACEOF
14669 #line 14669 "configure"
14670 #include "confdefs.h"
14671
14672 #include <${cf_cv_ncurses_header:-curses.h}>
14673 #include <${cf_header}>
14674 int
14675 main ()
14676 {
14677 WINDOW *x
14678   ;
14679   return 0;
14680 }
14681 _ACEOF
14682 rm -f conftest.$ac_objext
14683 if { (eval echo "$as_me:14683: \"$ac_compile\"") >&5
14684   (eval $ac_compile) 2>&5
14685   ac_status=$?
14686   echo "$as_me:14686: \$? = $ac_status" >&5
14687   (exit $ac_status); } &&
14688          { ac_try='test -s conftest.$ac_objext'
14689   { (eval echo "$as_me:14689: \"$ac_try\"") >&5
14690   (eval $ac_try) 2>&5
14691   ac_status=$?
14692   echo "$as_me:14692: \$? = $ac_status" >&5
14693   (exit $ac_status); }; }; then
14694   cf_cv_term_header=$cf_header
14695          break
14696 else
14697   echo "$as_me: failed program was:" >&5
14698 cat conftest.$ac_ext >&5
14699 cf_cv_term_header=no
14700 fi
14701 rm -f conftest.$ac_objext conftest.$ac_ext
14702 done
14703
14704 case $cf_cv_term_header in
14705 (no)
14706         # If curses is ncurses, some packagers still mess it up by trying to make
14707         # us use GNU termcap.  This handles the most common case.
14708         for cf_header in ncurses/term.h ncursesw/term.h
14709         do
14710                 cat >conftest.$ac_ext <<_ACEOF
14711 #line 14711 "configure"
14712 #include "confdefs.h"
14713
14714 #include <${cf_cv_ncurses_header:-curses.h}>
14715 #ifdef NCURSES_VERSION
14716 #include <${cf_header}>
14717 #else
14718 make an error
14719 #endif
14720 int
14721 main ()
14722 {
14723 WINDOW *x
14724   ;
14725   return 0;
14726 }
14727 _ACEOF
14728 rm -f conftest.$ac_objext
14729 if { (eval echo "$as_me:14729: \"$ac_compile\"") >&5
14730   (eval $ac_compile) 2>&5
14731   ac_status=$?
14732   echo "$as_me:14732: \$? = $ac_status" >&5
14733   (exit $ac_status); } &&
14734          { ac_try='test -s conftest.$ac_objext'
14735   { (eval echo "$as_me:14735: \"$ac_try\"") >&5
14736   (eval $ac_try) 2>&5
14737   ac_status=$?
14738   echo "$as_me:14738: \$? = $ac_status" >&5
14739   (exit $ac_status); }; }; then
14740   cf_cv_term_header=$cf_header
14741                          break
14742 else
14743   echo "$as_me: failed program was:" >&5
14744 cat conftest.$ac_ext >&5
14745 cf_cv_term_header=no
14746 fi
14747 rm -f conftest.$ac_objext conftest.$ac_ext
14748         done
14749         ;;
14750 esac
14751
14752 fi
14753 echo "$as_me:14753: result: $cf_cv_term_header" >&5
14754 echo "${ECHO_T}$cf_cv_term_header" >&6
14755
14756 case $cf_cv_term_header in
14757 (term.h)
14758
14759 cat >>confdefs.h <<\EOF
14760 #define HAVE_TERM_H 1
14761 EOF
14762
14763         ;;
14764 (ncurses/term.h)
14765
14766 cat >>confdefs.h <<\EOF
14767 #define HAVE_NCURSES_TERM_H 1
14768 EOF
14769
14770         ;;
14771 (ncursesw/term.h)
14772
14773 cat >>confdefs.h <<\EOF
14774 #define HAVE_NCURSESW_TERM_H 1
14775 EOF
14776
14777         ;;
14778 esac
14779
14780 echo "$as_me:14780: checking for unctrl.h" >&5
14781 echo $ECHO_N "checking for unctrl.h... $ECHO_C" >&6
14782 if test "${cf_cv_unctrl_header+set}" = set; then
14783   echo $ECHO_N "(cached) $ECHO_C" >&6
14784 else
14785
14786 # If we found <ncurses/curses.h>, look for <ncurses/unctrl.h>, but always look
14787 # for <unctrl.h> if we do not find the variant.
14788
14789 cf_header_list="unctrl.h ncurses/unctrl.h ncursesw/unctrl.h"
14790
14791 case ${cf_cv_ncurses_header:-curses.h} in
14792 (*/*)
14793         cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`unctrl.h
14794         cf_header_list="$cf_header_item $cf_header_list"
14795         ;;
14796 esac
14797
14798 for cf_header in $cf_header_list
14799 do
14800         cat >conftest.$ac_ext <<_ACEOF
14801 #line 14801 "configure"
14802 #include "confdefs.h"
14803
14804 #include <${cf_cv_ncurses_header:-curses.h}>
14805 #include <${cf_header}>
14806 int
14807 main ()
14808 {
14809 WINDOW *x
14810   ;
14811   return 0;
14812 }
14813 _ACEOF
14814 rm -f conftest.$ac_objext
14815 if { (eval echo "$as_me:14815: \"$ac_compile\"") >&5
14816   (eval $ac_compile) 2>&5
14817   ac_status=$?
14818   echo "$as_me:14818: \$? = $ac_status" >&5
14819   (exit $ac_status); } &&
14820          { ac_try='test -s conftest.$ac_objext'
14821   { (eval echo "$as_me:14821: \"$ac_try\"") >&5
14822   (eval $ac_try) 2>&5
14823   ac_status=$?
14824   echo "$as_me:14824: \$? = $ac_status" >&5
14825   (exit $ac_status); }; }; then
14826   cf_cv_unctrl_header=$cf_header
14827          break
14828 else
14829   echo "$as_me: failed program was:" >&5
14830 cat conftest.$ac_ext >&5
14831 cf_cv_unctrl_header=no
14832 fi
14833 rm -f conftest.$ac_objext conftest.$ac_ext
14834 done
14835
14836 fi
14837 echo "$as_me:14837: result: $cf_cv_unctrl_header" >&5
14838 echo "${ECHO_T}$cf_cv_unctrl_header" >&6
14839
14840 case $cf_cv_unctrl_header in
14841 (no)
14842         { echo "$as_me:14842: WARNING: unctrl.h header not found" >&5
14843 echo "$as_me: WARNING: unctrl.h header not found" >&2;}
14844         ;;
14845 esac
14846
14847 case $cf_cv_unctrl_header in
14848 (unctrl.h)
14849
14850 cat >>confdefs.h <<\EOF
14851 #define HAVE_UNCTRL_H 1
14852 EOF
14853
14854         ;;
14855 (ncurses/unctrl.h)
14856
14857 cat >>confdefs.h <<\EOF
14858 #define HAVE_NCURSES_UNCTRL_H 1
14859 EOF
14860
14861         ;;
14862 (ncursesw/unctrl.h)
14863
14864 cat >>confdefs.h <<\EOF
14865 #define HAVE_NCURSESW_UNCTRL_H 1
14866 EOF
14867
14868         ;;
14869 esac
14870
14871 for cf_func in \
14872 assume_default_colors \
14873 chgat \
14874 color_set \
14875 filter \
14876 getbegx \
14877 getcurx \
14878 getmaxx \
14879 getnstr \
14880 getparx \
14881 getwin \
14882 mvvline \
14883 mvwvline \
14884 napms \
14885 putwin \
14886 resize_term \
14887 resizeterm \
14888 restartterm \
14889 ripoffline \
14890 scr_dump \
14891 setupterm \
14892 slk_color \
14893 slk_init \
14894 termattrs \
14895 tgetent \
14896 tigetnum \
14897 tigetstr \
14898 typeahead \
14899 use_default_colors \
14900 use_env \
14901 use_extended_names \
14902 use_screen \
14903 use_window \
14904 vid_puts \
14905 vidputs \
14906 vsscanf \
14907 vw_printw \
14908 wchgat \
14909 winsstr \
14910 wresize \
14911 wsyncdown \
14912
14913 do
14914
14915 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14916
14917         echo "$as_me:14917: checking for ${cf_func}" >&5
14918 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
14919
14920 echo "${as_me:-configure}:14920: testing ${cf_func} ..." 1>&5
14921
14922         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
14923   echo $ECHO_N "(cached) $ECHO_C" >&6
14924 else
14925
14926                 eval cf_result='$ac_cv_func_'$cf_func
14927                 if test ".$cf_result" != ".no"; then
14928                         cat >conftest.$ac_ext <<_ACEOF
14929 #line 14929 "configure"
14930 #include "confdefs.h"
14931
14932 #ifdef HAVE_XCURSES
14933 #include <xcurses.h>
14934 char * XCursesProgramName = "test";
14935 #else
14936 #include <${cf_cv_ncurses_header:-curses.h}>
14937 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
14938 #include <ncursesw/term.h>
14939 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
14940 #include <ncurses/term.h>
14941 #elif defined(HAVE_TERM_H)
14942 #include <term.h>
14943 #endif
14944 #endif
14945
14946 int
14947 main ()
14948 {
14949
14950 #ifndef ${cf_func}
14951 long foo = (long)(&${cf_func});
14952 fprintf(stderr, "testing linkage of $cf_func:%p\n", foo);
14953 if (foo + 1234 > 5678)
14954         ${cf_cv_main_return:-return}(foo);
14955 #endif
14956
14957   ;
14958   return 0;
14959 }
14960 _ACEOF
14961 rm -f conftest.$ac_objext conftest$ac_exeext
14962 if { (eval echo "$as_me:14962: \"$ac_link\"") >&5
14963   (eval $ac_link) 2>&5
14964   ac_status=$?
14965   echo "$as_me:14965: \$? = $ac_status" >&5
14966   (exit $ac_status); } &&
14967          { ac_try='test -s conftest$ac_exeext'
14968   { (eval echo "$as_me:14968: \"$ac_try\"") >&5
14969   (eval $ac_try) 2>&5
14970   ac_status=$?
14971   echo "$as_me:14971: \$? = $ac_status" >&5
14972   (exit $ac_status); }; }; then
14973   cf_result=yes
14974 else
14975   echo "$as_me: failed program was:" >&5
14976 cat conftest.$ac_ext >&5
14977 cf_result=no
14978 fi
14979 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14980                 fi
14981                 eval 'cf_cv_func_'$cf_func'=$cf_result'
14982
14983 fi
14984
14985         # use the computed/retrieved cache-value:
14986         eval 'cf_result=$cf_cv_func_'$cf_func
14987         echo "$as_me:14987: result: $cf_result" >&5
14988 echo "${ECHO_T}$cf_result" >&6
14989         if test $cf_result != no; then
14990                 cat >>confdefs.h <<EOF
14991 #define HAVE_${cf_tr_func} 1
14992 EOF
14993
14994         fi
14995 done
14996
14997 for cf_func in tputs
14998 do
14999
15000 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15001
15002         echo "$as_me:15002: checking for ${cf_func}" >&5
15003 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
15004
15005 echo "${as_me:-configure}:15005: testing ${cf_func} ..." 1>&5
15006
15007         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
15008   echo $ECHO_N "(cached) $ECHO_C" >&6
15009 else
15010
15011                 eval cf_result='$ac_cv_func_'$cf_func
15012                 if test ".$cf_result" != ".no"; then
15013                         cat >conftest.$ac_ext <<_ACEOF
15014 #line 15014 "configure"
15015 #include "confdefs.h"
15016
15017 #ifdef HAVE_XCURSES
15018 #include <xcurses.h>
15019 char * XCursesProgramName = "test";
15020 #else
15021 #include <${cf_cv_ncurses_header:-curses.h}>
15022 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
15023 #include <ncursesw/term.h>
15024 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
15025 #include <ncurses/term.h>
15026 #elif defined(HAVE_TERM_H)
15027 #include <term.h>
15028 #endif
15029 #endif
15030
15031 int
15032 main ()
15033 {
15034
15035 #ifndef ${cf_func}
15036 long foo = (long)(&${cf_func});
15037 fprintf(stderr, "testing linkage of $cf_func:%p\n", foo);
15038 if (foo + 1234 > 5678)
15039         ${cf_cv_main_return:-return}(foo);
15040 #endif
15041
15042   ;
15043   return 0;
15044 }
15045 _ACEOF
15046 rm -f conftest.$ac_objext conftest$ac_exeext
15047 if { (eval echo "$as_me:15047: \"$ac_link\"") >&5
15048   (eval $ac_link) 2>&5
15049   ac_status=$?
15050   echo "$as_me:15050: \$? = $ac_status" >&5
15051   (exit $ac_status); } &&
15052          { ac_try='test -s conftest$ac_exeext'
15053   { (eval echo "$as_me:15053: \"$ac_try\"") >&5
15054   (eval $ac_try) 2>&5
15055   ac_status=$?
15056   echo "$as_me:15056: \$? = $ac_status" >&5
15057   (exit $ac_status); }; }; then
15058   cf_result=yes
15059 else
15060   echo "$as_me: failed program was:" >&5
15061 cat conftest.$ac_ext >&5
15062 cf_result=no
15063 fi
15064 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15065                 fi
15066                 eval 'cf_cv_func_'$cf_func'=$cf_result'
15067
15068 fi
15069
15070         # use the computed/retrieved cache-value:
15071         eval 'cf_result=$cf_cv_func_'$cf_func
15072         echo "$as_me:15072: result: $cf_result" >&5
15073 echo "${ECHO_T}$cf_result" >&6
15074         if test $cf_result != no; then
15075                 cat >>confdefs.h <<EOF
15076 #define HAVE_${cf_tr_func} 1
15077 EOF
15078
15079         fi
15080 done
15081
15082 if test x$cf_cv_func_tputs = xyes
15083 then
15084         cf_done=no
15085         for cf_arg in int char
15086         do
15087                 for cf_ret in int void
15088                 do
15089                         if test $cf_ret = void
15090                         then
15091                                 cf_return="/* nothing */"
15092                         else
15093                                 cf_return="return value"
15094                         fi
15095                         cat >conftest.$ac_ext <<_ACEOF
15096 #line 15096 "configure"
15097 #include "confdefs.h"
15098
15099 #include <${cf_cv_ncurses_header:-curses.h}>
15100 #include <$cf_cv_term_header>
15101
15102 static $cf_ret outc($cf_arg value) { $cf_return; }
15103
15104 int
15105 main ()
15106 {
15107
15108         tputs("hello", 0, outc);
15109         ${cf_cv_main_return:-return}(0);
15110
15111   ;
15112   return 0;
15113 }
15114 _ACEOF
15115 rm -f conftest.$ac_objext
15116 if { (eval echo "$as_me:15116: \"$ac_compile\"") >&5
15117   (eval $ac_compile) 2>&5
15118   ac_status=$?
15119   echo "$as_me:15119: \$? = $ac_status" >&5
15120   (exit $ac_status); } &&
15121          { ac_try='test -s conftest.$ac_objext'
15122   { (eval echo "$as_me:15122: \"$ac_try\"") >&5
15123   (eval $ac_try) 2>&5
15124   ac_status=$?
15125   echo "$as_me:15125: \$? = $ac_status" >&5
15126   (exit $ac_status); }; }; then
15127
15128                 test -n "$verbose" && echo "    prototype $cf_ret func($cf_arg value)" 1>&6
15129
15130 echo "${as_me:-configure}:15130: testing prototype $cf_ret func($cf_arg value) ..." 1>&5
15131
15132                 cat >>confdefs.h <<EOF
15133 #define TPUTS_ARG               $cf_arg
15134 #define TPUTS_PROTO(func,value) $cf_ret func(TPUTS_ARG value)
15135 #define TPUTS_RETURN(value)     $cf_return
15136 EOF
15137                 cf_done=yes
15138                 break
15139
15140 else
15141   echo "$as_me: failed program was:" >&5
15142 cat conftest.$ac_ext >&5
15143 fi
15144 rm -f conftest.$ac_objext conftest.$ac_ext
15145                 done
15146                 test $cf_done = yes && break
15147         done
15148 fi
15149
15150 echo "$as_me:15150: checking for ncurses extended functions" >&5
15151 echo $ECHO_N "checking for ncurses extended functions... $ECHO_C" >&6
15152 if test "${cf_cv_ncurses_ext_funcs+set}" = set; then
15153   echo $ECHO_N "(cached) $ECHO_C" >&6
15154 else
15155
15156 cat >conftest.$ac_ext <<_ACEOF
15157 #line 15157 "configure"
15158 #include "confdefs.h"
15159
15160 #include <${cf_cv_ncurses_header:-curses.h}>
15161 int
15162 main ()
15163 {
15164
15165 int x = NCURSES_EXT_FUNCS
15166
15167   ;
15168   return 0;
15169 }
15170 _ACEOF
15171 rm -f conftest.$ac_objext
15172 if { (eval echo "$as_me:15172: \"$ac_compile\"") >&5
15173   (eval $ac_compile) 2>&5
15174   ac_status=$?
15175   echo "$as_me:15175: \$? = $ac_status" >&5
15176   (exit $ac_status); } &&
15177          { ac_try='test -s conftest.$ac_objext'
15178   { (eval echo "$as_me:15178: \"$ac_try\"") >&5
15179   (eval $ac_try) 2>&5
15180   ac_status=$?
15181   echo "$as_me:15181: \$? = $ac_status" >&5
15182   (exit $ac_status); }; }; then
15183   cf_cv_ncurses_ext_funcs=defined
15184 else
15185   echo "$as_me: failed program was:" >&5
15186 cat conftest.$ac_ext >&5
15187
15188 cat >conftest.$ac_ext <<_ACEOF
15189 #line 15189 "configure"
15190 #include "confdefs.h"
15191
15192 #include <${cf_cv_ncurses_header:-curses.h}>
15193 int
15194 main ()
15195 {
15196
15197         (void) assume_default_colors (0, 0);
15198         (void) curses_version ();
15199         (void) define_key (0, 0);
15200         (void) is_term_resized (0, 0);
15201         (void) key_defined (0);
15202         (void) keybound (0, 0);
15203         (void) keyok (0, 0);
15204         (void) resize_term (0, 0);
15205         (void) resizeterm (0, 0);
15206         (void) use_default_colors ();
15207         (void) use_extended_names (0);
15208         (void) wresize (0, 0, 0);
15209   ;
15210   return 0;
15211 }
15212 _ACEOF
15213 rm -f conftest.$ac_objext conftest$ac_exeext
15214 if { (eval echo "$as_me:15214: \"$ac_link\"") >&5
15215   (eval $ac_link) 2>&5
15216   ac_status=$?
15217   echo "$as_me:15217: \$? = $ac_status" >&5
15218   (exit $ac_status); } &&
15219          { ac_try='test -s conftest$ac_exeext'
15220   { (eval echo "$as_me:15220: \"$ac_try\"") >&5
15221   (eval $ac_try) 2>&5
15222   ac_status=$?
15223   echo "$as_me:15223: \$? = $ac_status" >&5
15224   (exit $ac_status); }; }; then
15225   cf_cv_ncurses_ext_funcs=yes
15226 else
15227   echo "$as_me: failed program was:" >&5
15228 cat conftest.$ac_ext >&5
15229 cf_cv_ncurses_ext_funcs=no
15230 fi
15231 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15232
15233 fi
15234 rm -f conftest.$ac_objext conftest.$ac_ext
15235
15236 fi
15237 echo "$as_me:15237: result: $cf_cv_ncurses_ext_funcs" >&5
15238 echo "${ECHO_T}$cf_cv_ncurses_ext_funcs" >&6
15239 test "$cf_cv_ncurses_ext_funcs" = yes &&
15240 cat >>confdefs.h <<\EOF
15241 #define NCURSES_EXT_FUNCS 1
15242 EOF
15243
15244 if test "$cf_enable_widec" = yes
15245 then
15246         # workaround for systems with ncurses before 20111029, due to change of
15247         # feature test macro from _XPG5 to _XOPEN_SOURCE
15248         if test -n "$cf_cv_ncurses_version" && test "x$cf_cv_ncurses_version" != xno
15249         then
15250                 cf_define_xpg5=no
15251                 echo "$as_me:15251: checking if _XPG5 should be defined to enable wide-characters" >&5
15252 echo $ECHO_N "checking if _XPG5 should be defined to enable wide-characters... $ECHO_C" >&6
15253
15254                 cat >conftest.$ac_ext <<_ACEOF
15255 #line 15255 "configure"
15256 #include "confdefs.h"
15257
15258 #include <${cf_cv_ncurses_header:-curses.h}>
15259 int
15260 main ()
15261 {
15262 int x = _XPG5
15263   ;
15264   return 0;
15265 }
15266 _ACEOF
15267 rm -f conftest.$ac_objext
15268 if { (eval echo "$as_me:15268: \"$ac_compile\"") >&5
15269   (eval $ac_compile) 2>&5
15270   ac_status=$?
15271   echo "$as_me:15271: \$? = $ac_status" >&5
15272   (exit $ac_status); } &&
15273          { ac_try='test -s conftest.$ac_objext'
15274   { (eval echo "$as_me:15274: \"$ac_try\"") >&5
15275   (eval $ac_try) 2>&5
15276   ac_status=$?
15277   echo "$as_me:15277: \$? = $ac_status" >&5
15278   (exit $ac_status); }; }; then
15279   :
15280 else
15281   echo "$as_me: failed program was:" >&5
15282 cat conftest.$ac_ext >&5
15283 cf_save_cppflags="$CPPFLAGS"
15284                          CPPFLAGS="$CPPFLAGS -D_XPG5"
15285                          cat >conftest.$ac_ext <<_ACEOF
15286 #line 15286 "configure"
15287 #include "confdefs.h"
15288
15289 #include <${cf_cv_ncurses_header:-curses.h}>
15290 int
15291 main ()
15292 {
15293 int x = _XPG5
15294   ;
15295   return 0;
15296 }
15297 _ACEOF
15298 rm -f conftest.$ac_objext
15299 if { (eval echo "$as_me:15299: \"$ac_compile\"") >&5
15300   (eval $ac_compile) 2>&5
15301   ac_status=$?
15302   echo "$as_me:15302: \$? = $ac_status" >&5
15303   (exit $ac_status); } &&
15304          { ac_try='test -s conftest.$ac_objext'
15305   { (eval echo "$as_me:15305: \"$ac_try\"") >&5
15306   (eval $ac_try) 2>&5
15307   ac_status=$?
15308   echo "$as_me:15308: \$? = $ac_status" >&5
15309   (exit $ac_status); }; }; then
15310   cf_define_xpg5=yes
15311 else
15312   echo "$as_me: failed program was:" >&5
15313 cat conftest.$ac_ext >&5
15314 fi
15315 rm -f conftest.$ac_objext conftest.$ac_ext
15316                          CPPFLAGS="$cf_save_cppflags"
15317 fi
15318 rm -f conftest.$ac_objext conftest.$ac_ext
15319                 echo "$as_me:15319: result: $cf_define_xpg5" >&5
15320 echo "${ECHO_T}$cf_define_xpg5" >&6
15321
15322                 if test "$cf_define_xpg5" = yes
15323                 then
15324                         CPPFLAGS="$CPPFLAGS -D_XPG5"
15325                 fi
15326         fi
15327
15328         echo "$as_me:15328: checking for wide-character functions" >&5
15329 echo $ECHO_N "checking for wide-character functions... $ECHO_C" >&6
15330 if test "${cf_cv_widechar_funcs+set}" = set; then
15331   echo $ECHO_N "(cached) $ECHO_C" >&6
15332 else
15333
15334         cat >conftest.$ac_ext <<_ACEOF
15335 #line 15335 "configure"
15336 #include "confdefs.h"
15337
15338 #include <${cf_cv_ncurses_header:-curses.h}>
15339 int
15340 main ()
15341 {
15342
15343                 static wchar_t src_wchar[2];
15344                 static cchar_t dst_cchar;
15345                 setcchar(&dst_cchar, src_wchar, A_NORMAL, 0, (void *) 0);
15346
15347   ;
15348   return 0;
15349 }
15350 _ACEOF
15351 rm -f conftest.$ac_objext conftest$ac_exeext
15352 if { (eval echo "$as_me:15352: \"$ac_link\"") >&5
15353   (eval $ac_link) 2>&5
15354   ac_status=$?
15355   echo "$as_me:15355: \$? = $ac_status" >&5
15356   (exit $ac_status); } &&
15357          { ac_try='test -s conftest$ac_exeext'
15358   { (eval echo "$as_me:15358: \"$ac_try\"") >&5
15359   (eval $ac_try) 2>&5
15360   ac_status=$?
15361   echo "$as_me:15361: \$? = $ac_status" >&5
15362   (exit $ac_status); }; }; then
15363   cf_cv_widechar_funcs=yes
15364 else
15365   echo "$as_me: failed program was:" >&5
15366 cat conftest.$ac_ext >&5
15367 cf_cv_widechar_funcs=no
15368 fi
15369 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15370
15371 fi
15372 echo "$as_me:15372: result: $cf_cv_widechar_funcs" >&5
15373 echo "${ECHO_T}$cf_cv_widechar_funcs" >&6
15374         if test "$cf_cv_widechar_funcs" != no ; then
15375
15376 cat >>confdefs.h <<\EOF
15377 #define USE_WIDEC_SUPPORT 1
15378 EOF
15379
15380         else
15381                 cat >>confdefs.h <<\EOF
15382 #define USE_WIDEC_SUPPORT 0
15383 EOF
15384
15385         fi
15386 else
15387         cat >>confdefs.h <<\EOF
15388 #define USE_WIDEC_SUPPORT 0
15389 EOF
15390
15391 fi
15392
15393 echo "$as_me:15393: checking if $cf_cv_screen library uses pthreads" >&5
15394 echo $ECHO_N "checking if $cf_cv_screen library uses pthreads... $ECHO_C" >&6
15395 if test "${cf_cv_use_pthreads+set}" = set; then
15396   echo $ECHO_N "(cached) $ECHO_C" >&6
15397 else
15398
15399 cat >conftest.$ac_ext <<_ACEOF
15400 #line 15400 "configure"
15401 #include "confdefs.h"
15402
15403 #include <${cf_cv_ncurses_header:-curses.h}>
15404 extern void _nc_init_pthreads(void);
15405
15406 int
15407 main ()
15408 {
15409
15410         initscr();
15411         _nc_init_pthreads();
15412
15413   ;
15414   return 0;
15415 }
15416 _ACEOF
15417 rm -f conftest.$ac_objext conftest$ac_exeext
15418 if { (eval echo "$as_me:15418: \"$ac_link\"") >&5
15419   (eval $ac_link) 2>&5
15420   ac_status=$?
15421   echo "$as_me:15421: \$? = $ac_status" >&5
15422   (exit $ac_status); } &&
15423          { ac_try='test -s conftest$ac_exeext'
15424   { (eval echo "$as_me:15424: \"$ac_try\"") >&5
15425   (eval $ac_try) 2>&5
15426   ac_status=$?
15427   echo "$as_me:15427: \$? = $ac_status" >&5
15428   (exit $ac_status); }; }; then
15429   cf_cv_use_pthreads=yes
15430 else
15431   echo "$as_me: failed program was:" >&5
15432 cat conftest.$ac_ext >&5
15433 cf_cv_use_pthreads=no
15434 fi
15435 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15436
15437 fi
15438 echo "$as_me:15438: result: $cf_cv_use_pthreads" >&5
15439 echo "${ECHO_T}$cf_cv_use_pthreads" >&6
15440 test $cf_cv_use_pthreads = yes && cat >>confdefs.h <<\EOF
15441 #define USE_PTHREADS 1
15442 EOF
15443
15444 echo "$as_me:15444: checking if sys/time.h works with sys/select.h" >&5
15445 echo $ECHO_N "checking if sys/time.h works with sys/select.h... $ECHO_C" >&6
15446 if test "${cf_cv_sys_time_select+set}" = set; then
15447   echo $ECHO_N "(cached) $ECHO_C" >&6
15448 else
15449
15450 cat >conftest.$ac_ext <<_ACEOF
15451 #line 15451 "configure"
15452 #include "confdefs.h"
15453
15454 #include <sys/types.h>
15455 #ifdef HAVE_SYS_TIME_H
15456 #include <sys/time.h>
15457 #endif
15458 #ifdef HAVE_SYS_SELECT_H
15459 #include <sys/select.h>
15460 #endif
15461
15462 int
15463 main ()
15464 {
15465
15466   ;
15467   return 0;
15468 }
15469 _ACEOF
15470 rm -f conftest.$ac_objext
15471 if { (eval echo "$as_me:15471: \"$ac_compile\"") >&5
15472   (eval $ac_compile) 2>&5
15473   ac_status=$?
15474   echo "$as_me:15474: \$? = $ac_status" >&5
15475   (exit $ac_status); } &&
15476          { ac_try='test -s conftest.$ac_objext'
15477   { (eval echo "$as_me:15477: \"$ac_try\"") >&5
15478   (eval $ac_try) 2>&5
15479   ac_status=$?
15480   echo "$as_me:15480: \$? = $ac_status" >&5
15481   (exit $ac_status); }; }; then
15482   cf_cv_sys_time_select=yes
15483 else
15484   echo "$as_me: failed program was:" >&5
15485 cat conftest.$ac_ext >&5
15486 cf_cv_sys_time_select=no
15487 fi
15488 rm -f conftest.$ac_objext conftest.$ac_ext
15489
15490 fi
15491
15492 echo "$as_me:15492: result: $cf_cv_sys_time_select" >&5
15493 echo "${ECHO_T}$cf_cv_sys_time_select" >&6
15494 test "$cf_cv_sys_time_select" = yes &&
15495 cat >>confdefs.h <<\EOF
15496 #define HAVE_SYS_TIME_SELECT 1
15497 EOF
15498
15499 # special check for test/ditto.c
15500
15501 echo "$as_me:15501: checking for openpty in -lutil" >&5
15502 echo $ECHO_N "checking for openpty in -lutil... $ECHO_C" >&6
15503 if test "${ac_cv_lib_util_openpty+set}" = set; then
15504   echo $ECHO_N "(cached) $ECHO_C" >&6
15505 else
15506   ac_check_lib_save_LIBS=$LIBS
15507 LIBS="-lutil  $LIBS"
15508 cat >conftest.$ac_ext <<_ACEOF
15509 #line 15509 "configure"
15510 #include "confdefs.h"
15511
15512 /* Override any gcc2 internal prototype to avoid an error.  */
15513 #ifdef __cplusplus
15514 extern "C"
15515 #endif
15516 /* We use char because int might match the return type of a gcc2
15517    builtin and then its argument prototype would still apply.  */
15518 char openpty ();
15519 int
15520 main ()
15521 {
15522 openpty ();
15523   ;
15524   return 0;
15525 }
15526 _ACEOF
15527 rm -f conftest.$ac_objext conftest$ac_exeext
15528 if { (eval echo "$as_me:15528: \"$ac_link\"") >&5
15529   (eval $ac_link) 2>&5
15530   ac_status=$?
15531   echo "$as_me:15531: \$? = $ac_status" >&5
15532   (exit $ac_status); } &&
15533          { ac_try='test -s conftest$ac_exeext'
15534   { (eval echo "$as_me:15534: \"$ac_try\"") >&5
15535   (eval $ac_try) 2>&5
15536   ac_status=$?
15537   echo "$as_me:15537: \$? = $ac_status" >&5
15538   (exit $ac_status); }; }; then
15539   ac_cv_lib_util_openpty=yes
15540 else
15541   echo "$as_me: failed program was:" >&5
15542 cat conftest.$ac_ext >&5
15543 ac_cv_lib_util_openpty=no
15544 fi
15545 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15546 LIBS=$ac_check_lib_save_LIBS
15547 fi
15548 echo "$as_me:15548: result: $ac_cv_lib_util_openpty" >&5
15549 echo "${ECHO_T}$ac_cv_lib_util_openpty" >&6
15550 if test $ac_cv_lib_util_openpty = yes; then
15551   cf_cv_lib_util=yes
15552 else
15553   cf_cv_lib_util=no
15554 fi
15555
15556 echo "$as_me:15556: checking for openpty header" >&5
15557 echo $ECHO_N "checking for openpty header... $ECHO_C" >&6
15558 if test "${cf_cv_func_openpty+set}" = set; then
15559   echo $ECHO_N "(cached) $ECHO_C" >&6
15560 else
15561
15562         cf_save_LIBS="$LIBS"
15563         test $cf_cv_lib_util = yes && {
15564 cf_add_libs="-lutil"
15565 # Filter out duplicates - this happens with badly-designed ".pc" files...
15566 for cf_add_1lib in $LIBS
15567 do
15568         for cf_add_2lib in $cf_add_libs
15569         do
15570                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
15571                 then
15572                         cf_add_1lib=
15573                         break
15574                 fi
15575         done
15576         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
15577 done
15578 LIBS="$cf_add_libs"
15579  }
15580         for cf_header in pty.h libutil.h util.h
15581         do
15582         cat >conftest.$ac_ext <<_ACEOF
15583 #line 15583 "configure"
15584 #include "confdefs.h"
15585
15586 #include <$cf_header>
15587
15588 int
15589 main ()
15590 {
15591
15592         int x = openpty((int *)0, (int *)0, (char *)0,
15593                                    (struct termios *)0, (struct winsize *)0);
15594
15595   ;
15596   return 0;
15597 }
15598 _ACEOF
15599 rm -f conftest.$ac_objext conftest$ac_exeext
15600 if { (eval echo "$as_me:15600: \"$ac_link\"") >&5
15601   (eval $ac_link) 2>&5
15602   ac_status=$?
15603   echo "$as_me:15603: \$? = $ac_status" >&5
15604   (exit $ac_status); } &&
15605          { ac_try='test -s conftest$ac_exeext'
15606   { (eval echo "$as_me:15606: \"$ac_try\"") >&5
15607   (eval $ac_try) 2>&5
15608   ac_status=$?
15609   echo "$as_me:15609: \$? = $ac_status" >&5
15610   (exit $ac_status); }; }; then
15611
15612                 cf_cv_func_openpty=$cf_header
15613                 break
15614
15615 else
15616   echo "$as_me: failed program was:" >&5
15617 cat conftest.$ac_ext >&5
15618
15619                 cf_cv_func_openpty=no
15620
15621 fi
15622 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15623         done
15624         LIBS="$cf_save_LIBS"
15625
15626 fi
15627 echo "$as_me:15627: result: $cf_cv_func_openpty" >&5
15628 echo "${ECHO_T}$cf_cv_func_openpty" >&6
15629
15630 if test "$cf_cv_func_openpty" != no ; then
15631
15632 cat >>confdefs.h <<EOF
15633 #define USE_OPENPTY_HEADER <$cf_cv_func_openpty>
15634 EOF
15635
15636 cat >>confdefs.h <<\EOF
15637 #define USE_XTERM_PTY 1
15638 EOF
15639
15640         if test "x$cf_cv_lib_util" = xyes ; then
15641
15642 cf_add_libs="-lutil"
15643 # Filter out duplicates - this happens with badly-designed ".pc" files...
15644 for cf_add_1lib in $TEST_LIBS
15645 do
15646         for cf_add_2lib in $cf_add_libs
15647         do
15648                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
15649                 then
15650                         cf_add_1lib=
15651                         break
15652                 fi
15653         done
15654         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
15655 done
15656 TEST_LIBS="$cf_add_libs"
15657
15658         fi
15659 fi
15660
15661 echo "$as_me:15661: checking for function curses_version" >&5
15662 echo $ECHO_N "checking for function curses_version... $ECHO_C" >&6
15663 if test "${cf_cv_func_curses_version+set}" = set; then
15664   echo $ECHO_N "(cached) $ECHO_C" >&6
15665 else
15666
15667 if test "$cross_compiling" = yes; then
15668   cf_cv_func_curses_version=unknown
15669 else
15670   cat >conftest.$ac_ext <<_ACEOF
15671 #line 15671 "configure"
15672 #include "confdefs.h"
15673
15674 #include <${cf_cv_ncurses_header:-curses.h}>
15675 int main()
15676 {
15677         char temp[1024];
15678         sprintf(temp, "%s\n", curses_version());
15679         ${cf_cv_main_return:-return}(0);
15680 }
15681
15682 _ACEOF
15683 rm -f conftest$ac_exeext
15684 if { (eval echo "$as_me:15684: \"$ac_link\"") >&5
15685   (eval $ac_link) 2>&5
15686   ac_status=$?
15687   echo "$as_me:15687: \$? = $ac_status" >&5
15688   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
15689   { (eval echo "$as_me:15689: \"$ac_try\"") >&5
15690   (eval $ac_try) 2>&5
15691   ac_status=$?
15692   echo "$as_me:15692: \$? = $ac_status" >&5
15693   (exit $ac_status); }; }; then
15694   cf_cv_func_curses_version=yes
15695
15696 else
15697   echo "$as_me: program exited with status $ac_status" >&5
15698 echo "$as_me: failed program was:" >&5
15699 cat conftest.$ac_ext >&5
15700 cf_cv_func_curses_version=no
15701
15702 fi
15703 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
15704 fi
15705 rm -f core
15706 fi
15707 echo "$as_me:15707: result: $cf_cv_func_curses_version" >&5
15708 echo "${ECHO_T}$cf_cv_func_curses_version" >&6
15709 test "$cf_cv_func_curses_version" = yes &&
15710 cat >>confdefs.h <<\EOF
15711 #define HAVE_CURSES_VERSION 1
15712 EOF
15713
15714 echo "$as_me:15714: checking for alternate character set array" >&5
15715 echo $ECHO_N "checking for alternate character set array... $ECHO_C" >&6
15716 if test "${cf_cv_curses_acs_map+set}" = set; then
15717   echo $ECHO_N "(cached) $ECHO_C" >&6
15718 else
15719
15720 cf_cv_curses_acs_map=unknown
15721 for name in acs_map _acs_map __acs_map ${NCURSES_WRAP_PREFIX}acs_map
15722 do
15723 cat >conftest.$ac_ext <<_ACEOF
15724 #line 15724 "configure"
15725 #include "confdefs.h"
15726
15727 #include <${cf_cv_ncurses_header:-curses.h}>
15728
15729 int
15730 main ()
15731 {
15732
15733 $name['k'] = ACS_PLUS
15734
15735   ;
15736   return 0;
15737 }
15738 _ACEOF
15739 rm -f conftest.$ac_objext conftest$ac_exeext
15740 if { (eval echo "$as_me:15740: \"$ac_link\"") >&5
15741   (eval $ac_link) 2>&5
15742   ac_status=$?
15743   echo "$as_me:15743: \$? = $ac_status" >&5
15744   (exit $ac_status); } &&
15745          { ac_try='test -s conftest$ac_exeext'
15746   { (eval echo "$as_me:15746: \"$ac_try\"") >&5
15747   (eval $ac_try) 2>&5
15748   ac_status=$?
15749   echo "$as_me:15749: \$? = $ac_status" >&5
15750   (exit $ac_status); }; }; then
15751   cf_cv_curses_acs_map=$name; break
15752 else
15753   echo "$as_me: failed program was:" >&5
15754 cat conftest.$ac_ext >&5
15755 fi
15756 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15757 done
15758
15759 fi
15760 echo "$as_me:15760: result: $cf_cv_curses_acs_map" >&5
15761 echo "${ECHO_T}$cf_cv_curses_acs_map" >&6
15762
15763 test "$cf_cv_curses_acs_map" != unknown &&
15764 cat >>confdefs.h <<EOF
15765 #define CURSES_ACS_ARRAY $cf_cv_curses_acs_map
15766 EOF
15767
15768 if test "$cf_enable_widec" = yes; then
15769
15770 echo "$as_me:15770: checking for wide alternate character set array" >&5
15771 echo $ECHO_N "checking for wide alternate character set array... $ECHO_C" >&6
15772 if test "${cf_cv_curses_wacs_map+set}" = set; then
15773   echo $ECHO_N "(cached) $ECHO_C" >&6
15774 else
15775
15776         cf_cv_curses_wacs_map=unknown
15777         for name in wacs_map _wacs_map __wacs_map _nc_wacs _wacs_char
15778         do
15779         cat >conftest.$ac_ext <<_ACEOF
15780 #line 15780 "configure"
15781 #include "confdefs.h"
15782
15783 #ifndef _XOPEN_SOURCE_EXTENDED
15784 #define _XOPEN_SOURCE_EXTENDED
15785 #endif
15786 #include <${cf_cv_ncurses_header:-curses.h}>
15787 int
15788 main ()
15789 {
15790 void *foo = &($name['k'])
15791   ;
15792   return 0;
15793 }
15794 _ACEOF
15795 rm -f conftest.$ac_objext conftest$ac_exeext
15796 if { (eval echo "$as_me:15796: \"$ac_link\"") >&5
15797   (eval $ac_link) 2>&5
15798   ac_status=$?
15799   echo "$as_me:15799: \$? = $ac_status" >&5
15800   (exit $ac_status); } &&
15801          { ac_try='test -s conftest$ac_exeext'
15802   { (eval echo "$as_me:15802: \"$ac_try\"") >&5
15803   (eval $ac_try) 2>&5
15804   ac_status=$?
15805   echo "$as_me:15805: \$? = $ac_status" >&5
15806   (exit $ac_status); }; }; then
15807   cf_cv_curses_wacs_map=$name
15808          break
15809 else
15810   echo "$as_me: failed program was:" >&5
15811 cat conftest.$ac_ext >&5
15812 fi
15813 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15814         done
15815 fi
15816 echo "$as_me:15816: result: $cf_cv_curses_wacs_map" >&5
15817 echo "${ECHO_T}$cf_cv_curses_wacs_map" >&6
15818
15819 test "$cf_cv_curses_wacs_map" != unknown &&
15820 cat >>confdefs.h <<EOF
15821 #define CURSES_WACS_ARRAY $cf_cv_curses_wacs_map
15822 EOF
15823
15824 echo "$as_me:15824: checking for wide alternate character constants" >&5
15825 echo $ECHO_N "checking for wide alternate character constants... $ECHO_C" >&6
15826 if test "${cf_cv_curses_wacs_symbols+set}" = set; then
15827   echo $ECHO_N "(cached) $ECHO_C" >&6
15828 else
15829
15830 cf_cv_curses_wacs_symbols=no
15831 if test "$cf_cv_curses_wacs_map" != unknown
15832 then
15833         cat >conftest.$ac_ext <<_ACEOF
15834 #line 15834 "configure"
15835 #include "confdefs.h"
15836
15837 #ifndef _XOPEN_SOURCE_EXTENDED
15838 #define _XOPEN_SOURCE_EXTENDED
15839 #endif
15840 #include <${cf_cv_ncurses_header:-curses.h}>
15841 int
15842 main ()
15843 {
15844 cchar_t *foo = WACS_PLUS;
15845          $cf_cv_curses_wacs_map['k'] = *WACS_PLUS
15846   ;
15847   return 0;
15848 }
15849 _ACEOF
15850 rm -f conftest.$ac_objext conftest$ac_exeext
15851 if { (eval echo "$as_me:15851: \"$ac_link\"") >&5
15852   (eval $ac_link) 2>&5
15853   ac_status=$?
15854   echo "$as_me:15854: \$? = $ac_status" >&5
15855   (exit $ac_status); } &&
15856          { ac_try='test -s conftest$ac_exeext'
15857   { (eval echo "$as_me:15857: \"$ac_try\"") >&5
15858   (eval $ac_try) 2>&5
15859   ac_status=$?
15860   echo "$as_me:15860: \$? = $ac_status" >&5
15861   (exit $ac_status); }; }; then
15862   cf_cv_curses_wacs_symbols=yes
15863 else
15864   echo "$as_me: failed program was:" >&5
15865 cat conftest.$ac_ext >&5
15866 fi
15867 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15868 else
15869         cat >conftest.$ac_ext <<_ACEOF
15870 #line 15870 "configure"
15871 #include "confdefs.h"
15872
15873 #ifndef _XOPEN_SOURCE_EXTENDED
15874 #define _XOPEN_SOURCE_EXTENDED
15875 #endif
15876 #include <${cf_cv_ncurses_header:-curses.h}>
15877 int
15878 main ()
15879 {
15880 cchar_t *foo = WACS_PLUS
15881   ;
15882   return 0;
15883 }
15884 _ACEOF
15885 rm -f conftest.$ac_objext conftest$ac_exeext
15886 if { (eval echo "$as_me:15886: \"$ac_link\"") >&5
15887   (eval $ac_link) 2>&5
15888   ac_status=$?
15889   echo "$as_me:15889: \$? = $ac_status" >&5
15890   (exit $ac_status); } &&
15891          { ac_try='test -s conftest$ac_exeext'
15892   { (eval echo "$as_me:15892: \"$ac_try\"") >&5
15893   (eval $ac_try) 2>&5
15894   ac_status=$?
15895   echo "$as_me:15895: \$? = $ac_status" >&5
15896   (exit $ac_status); }; }; then
15897   cf_cv_curses_wacs_symbols=yes
15898 else
15899   echo "$as_me: failed program was:" >&5
15900 cat conftest.$ac_ext >&5
15901 fi
15902 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15903 fi
15904
15905 fi
15906 echo "$as_me:15906: result: $cf_cv_curses_wacs_symbols" >&5
15907 echo "${ECHO_T}$cf_cv_curses_wacs_symbols" >&6
15908
15909 test "$cf_cv_curses_wacs_symbols" != no &&
15910 cat >>confdefs.h <<\EOF
15911 #define CURSES_WACS_SYMBOLS 1
15912 EOF
15913
15914 fi
15915
15916 echo "$as_me:15916: checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}" >&5
15917 echo $ECHO_N "checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
15918 cat >conftest.$ac_ext <<_ACEOF
15919 #line 15919 "configure"
15920 #include "confdefs.h"
15921
15922 #ifndef _XOPEN_SOURCE_EXTENDED
15923 #define _XOPEN_SOURCE_EXTENDED
15924 #endif
15925 #include <${cf_cv_ncurses_header:-curses.h}>
15926 int
15927 main ()
15928 {
15929
15930 attr_t foo
15931
15932   ;
15933   return 0;
15934 }
15935 _ACEOF
15936 rm -f conftest.$ac_objext
15937 if { (eval echo "$as_me:15937: \"$ac_compile\"") >&5
15938   (eval $ac_compile) 2>&5
15939   ac_status=$?
15940   echo "$as_me:15940: \$? = $ac_status" >&5
15941   (exit $ac_status); } &&
15942          { ac_try='test -s conftest.$ac_objext'
15943   { (eval echo "$as_me:15943: \"$ac_try\"") >&5
15944   (eval $ac_try) 2>&5
15945   ac_status=$?
15946   echo "$as_me:15946: \$? = $ac_status" >&5
15947   (exit $ac_status); }; }; then
15948   cf_result=yes
15949 else
15950   echo "$as_me: failed program was:" >&5
15951 cat conftest.$ac_ext >&5
15952 cf_result=no
15953 fi
15954 rm -f conftest.$ac_objext conftest.$ac_ext
15955 echo "$as_me:15955: result: $cf_result" >&5
15956 echo "${ECHO_T}$cf_result" >&6
15957 if test $cf_result = yes ; then
15958
15959 cf_result=`echo "have_type_attr_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15960
15961 cat >>confdefs.h <<EOF
15962 #define $cf_result 1
15963 EOF
15964
15965 else
15966
15967 cat >>confdefs.h <<EOF
15968 #define attr_t long
15969 EOF
15970
15971 fi
15972
15973 if test "$cf_enable_widec" = yes; then
15974
15975 # This is needed on Tru64 5.0 to declare mbstate_t
15976 echo "$as_me:15976: checking if we must include wchar.h to declare mbstate_t" >&5
15977 echo $ECHO_N "checking if we must include wchar.h to declare mbstate_t... $ECHO_C" >&6
15978 if test "${cf_cv_mbstate_t+set}" = set; then
15979   echo $ECHO_N "(cached) $ECHO_C" >&6
15980 else
15981
15982 cat >conftest.$ac_ext <<_ACEOF
15983 #line 15983 "configure"
15984 #include "confdefs.h"
15985
15986 #include <stdlib.h>
15987 #include <stdarg.h>
15988 #include <stdio.h>
15989 #ifdef HAVE_LIBUTF8_H
15990 #include <libutf8.h>
15991 #endif
15992 int
15993 main ()
15994 {
15995 mbstate_t state
15996   ;
15997   return 0;
15998 }
15999 _ACEOF
16000 rm -f conftest.$ac_objext
16001 if { (eval echo "$as_me:16001: \"$ac_compile\"") >&5
16002   (eval $ac_compile) 2>&5
16003   ac_status=$?
16004   echo "$as_me:16004: \$? = $ac_status" >&5
16005   (exit $ac_status); } &&
16006          { ac_try='test -s conftest.$ac_objext'
16007   { (eval echo "$as_me:16007: \"$ac_try\"") >&5
16008   (eval $ac_try) 2>&5
16009   ac_status=$?
16010   echo "$as_me:16010: \$? = $ac_status" >&5
16011   (exit $ac_status); }; }; then
16012   cf_cv_mbstate_t=no
16013 else
16014   echo "$as_me: failed program was:" >&5
16015 cat conftest.$ac_ext >&5
16016 cat >conftest.$ac_ext <<_ACEOF
16017 #line 16017 "configure"
16018 #include "confdefs.h"
16019
16020 #include <stdlib.h>
16021 #include <stdarg.h>
16022 #include <stdio.h>
16023 #include <wchar.h>
16024 #ifdef HAVE_LIBUTF8_H
16025 #include <libutf8.h>
16026 #endif
16027 int
16028 main ()
16029 {
16030 mbstate_t value
16031   ;
16032   return 0;
16033 }
16034 _ACEOF
16035 rm -f conftest.$ac_objext
16036 if { (eval echo "$as_me:16036: \"$ac_compile\"") >&5
16037   (eval $ac_compile) 2>&5
16038   ac_status=$?
16039   echo "$as_me:16039: \$? = $ac_status" >&5
16040   (exit $ac_status); } &&
16041          { ac_try='test -s conftest.$ac_objext'
16042   { (eval echo "$as_me:16042: \"$ac_try\"") >&5
16043   (eval $ac_try) 2>&5
16044   ac_status=$?
16045   echo "$as_me:16045: \$? = $ac_status" >&5
16046   (exit $ac_status); }; }; then
16047   cf_cv_mbstate_t=yes
16048 else
16049   echo "$as_me: failed program was:" >&5
16050 cat conftest.$ac_ext >&5
16051 cf_cv_mbstate_t=unknown
16052 fi
16053 rm -f conftest.$ac_objext conftest.$ac_ext
16054 fi
16055 rm -f conftest.$ac_objext conftest.$ac_ext
16056 fi
16057 echo "$as_me:16057: result: $cf_cv_mbstate_t" >&5
16058 echo "${ECHO_T}$cf_cv_mbstate_t" >&6
16059
16060 if test "$cf_cv_mbstate_t" = yes ; then
16061
16062 cat >>confdefs.h <<\EOF
16063 #define NEED_WCHAR_H 1
16064 EOF
16065
16066         NEED_WCHAR_H=1
16067 fi
16068
16069 # if we do not find mbstate_t in either place, use substitution to provide a fallback.
16070 if test "$cf_cv_mbstate_t" = unknown ; then
16071         NCURSES_MBSTATE_T=1
16072 fi
16073
16074 # if we find mbstate_t in either place, use substitution to provide a fallback.
16075 if test "$cf_cv_mbstate_t" != unknown ; then
16076         NCURSES_OK_MBSTATE_T=1
16077 fi
16078
16079 # This is needed on Tru64 5.0 to declare wchar_t
16080 echo "$as_me:16080: checking if we must include wchar.h to declare wchar_t" >&5
16081 echo $ECHO_N "checking if we must include wchar.h to declare wchar_t... $ECHO_C" >&6
16082 if test "${cf_cv_wchar_t+set}" = set; then
16083   echo $ECHO_N "(cached) $ECHO_C" >&6
16084 else
16085
16086 cat >conftest.$ac_ext <<_ACEOF
16087 #line 16087 "configure"
16088 #include "confdefs.h"
16089
16090 #include <stdlib.h>
16091 #include <stdarg.h>
16092 #include <stdio.h>
16093 #ifdef HAVE_LIBUTF8_H
16094 #include <libutf8.h>
16095 #endif
16096 int
16097 main ()
16098 {
16099 wchar_t state
16100   ;
16101   return 0;
16102 }
16103 _ACEOF
16104 rm -f conftest.$ac_objext
16105 if { (eval echo "$as_me:16105: \"$ac_compile\"") >&5
16106   (eval $ac_compile) 2>&5
16107   ac_status=$?
16108   echo "$as_me:16108: \$? = $ac_status" >&5
16109   (exit $ac_status); } &&
16110          { ac_try='test -s conftest.$ac_objext'
16111   { (eval echo "$as_me:16111: \"$ac_try\"") >&5
16112   (eval $ac_try) 2>&5
16113   ac_status=$?
16114   echo "$as_me:16114: \$? = $ac_status" >&5
16115   (exit $ac_status); }; }; then
16116   cf_cv_wchar_t=no
16117 else
16118   echo "$as_me: failed program was:" >&5
16119 cat conftest.$ac_ext >&5
16120 cat >conftest.$ac_ext <<_ACEOF
16121 #line 16121 "configure"
16122 #include "confdefs.h"
16123
16124 #include <stdlib.h>
16125 #include <stdarg.h>
16126 #include <stdio.h>
16127 #include <wchar.h>
16128 #ifdef HAVE_LIBUTF8_H
16129 #include <libutf8.h>
16130 #endif
16131 int
16132 main ()
16133 {
16134 wchar_t value
16135   ;
16136   return 0;
16137 }
16138 _ACEOF
16139 rm -f conftest.$ac_objext
16140 if { (eval echo "$as_me:16140: \"$ac_compile\"") >&5
16141   (eval $ac_compile) 2>&5
16142   ac_status=$?
16143   echo "$as_me:16143: \$? = $ac_status" >&5
16144   (exit $ac_status); } &&
16145          { ac_try='test -s conftest.$ac_objext'
16146   { (eval echo "$as_me:16146: \"$ac_try\"") >&5
16147   (eval $ac_try) 2>&5
16148   ac_status=$?
16149   echo "$as_me:16149: \$? = $ac_status" >&5
16150   (exit $ac_status); }; }; then
16151   cf_cv_wchar_t=yes
16152 else
16153   echo "$as_me: failed program was:" >&5
16154 cat conftest.$ac_ext >&5
16155 cf_cv_wchar_t=unknown
16156 fi
16157 rm -f conftest.$ac_objext conftest.$ac_ext
16158 fi
16159 rm -f conftest.$ac_objext conftest.$ac_ext
16160 fi
16161 echo "$as_me:16161: result: $cf_cv_wchar_t" >&5
16162 echo "${ECHO_T}$cf_cv_wchar_t" >&6
16163
16164 if test "$cf_cv_wchar_t" = yes ; then
16165
16166 cat >>confdefs.h <<\EOF
16167 #define NEED_WCHAR_H 1
16168 EOF
16169
16170         NEED_WCHAR_H=1
16171 fi
16172
16173 # if we do not find wchar_t in either place, use substitution to provide a fallback.
16174 if test "$cf_cv_wchar_t" = unknown ; then
16175         NCURSES_WCHAR_T=1
16176 fi
16177
16178 # if we find wchar_t in either place, use substitution to provide a fallback.
16179 if test "$cf_cv_wchar_t" != unknown ; then
16180         NCURSES_OK_WCHAR_T=1
16181 fi
16182
16183 # This is needed on Tru64 5.0 to declare wint_t
16184 echo "$as_me:16184: checking if we must include wchar.h to declare wint_t" >&5
16185 echo $ECHO_N "checking if we must include wchar.h to declare wint_t... $ECHO_C" >&6
16186 if test "${cf_cv_wint_t+set}" = set; then
16187   echo $ECHO_N "(cached) $ECHO_C" >&6
16188 else
16189
16190 cat >conftest.$ac_ext <<_ACEOF
16191 #line 16191 "configure"
16192 #include "confdefs.h"
16193
16194 #include <stdlib.h>
16195 #include <stdarg.h>
16196 #include <stdio.h>
16197 #ifdef HAVE_LIBUTF8_H
16198 #include <libutf8.h>
16199 #endif
16200 int
16201 main ()
16202 {
16203 wint_t state
16204   ;
16205   return 0;
16206 }
16207 _ACEOF
16208 rm -f conftest.$ac_objext
16209 if { (eval echo "$as_me:16209: \"$ac_compile\"") >&5
16210   (eval $ac_compile) 2>&5
16211   ac_status=$?
16212   echo "$as_me:16212: \$? = $ac_status" >&5
16213   (exit $ac_status); } &&
16214          { ac_try='test -s conftest.$ac_objext'
16215   { (eval echo "$as_me:16215: \"$ac_try\"") >&5
16216   (eval $ac_try) 2>&5
16217   ac_status=$?
16218   echo "$as_me:16218: \$? = $ac_status" >&5
16219   (exit $ac_status); }; }; then
16220   cf_cv_wint_t=no
16221 else
16222   echo "$as_me: failed program was:" >&5
16223 cat conftest.$ac_ext >&5
16224 cat >conftest.$ac_ext <<_ACEOF
16225 #line 16225 "configure"
16226 #include "confdefs.h"
16227
16228 #include <stdlib.h>
16229 #include <stdarg.h>
16230 #include <stdio.h>
16231 #include <wchar.h>
16232 #ifdef HAVE_LIBUTF8_H
16233 #include <libutf8.h>
16234 #endif
16235 int
16236 main ()
16237 {
16238 wint_t value
16239   ;
16240   return 0;
16241 }
16242 _ACEOF
16243 rm -f conftest.$ac_objext
16244 if { (eval echo "$as_me:16244: \"$ac_compile\"") >&5
16245   (eval $ac_compile) 2>&5
16246   ac_status=$?
16247   echo "$as_me:16247: \$? = $ac_status" >&5
16248   (exit $ac_status); } &&
16249          { ac_try='test -s conftest.$ac_objext'
16250   { (eval echo "$as_me:16250: \"$ac_try\"") >&5
16251   (eval $ac_try) 2>&5
16252   ac_status=$?
16253   echo "$as_me:16253: \$? = $ac_status" >&5
16254   (exit $ac_status); }; }; then
16255   cf_cv_wint_t=yes
16256 else
16257   echo "$as_me: failed program was:" >&5
16258 cat conftest.$ac_ext >&5
16259 cf_cv_wint_t=unknown
16260 fi
16261 rm -f conftest.$ac_objext conftest.$ac_ext
16262 fi
16263 rm -f conftest.$ac_objext conftest.$ac_ext
16264 fi
16265 echo "$as_me:16265: result: $cf_cv_wint_t" >&5
16266 echo "${ECHO_T}$cf_cv_wint_t" >&6
16267
16268 if test "$cf_cv_wint_t" = yes ; then
16269
16270 cat >>confdefs.h <<\EOF
16271 #define NEED_WCHAR_H 1
16272 EOF
16273
16274         NEED_WCHAR_H=1
16275 fi
16276
16277 # if we do not find wint_t in either place, use substitution to provide a fallback.
16278 if test "$cf_cv_wint_t" = unknown ; then
16279         NCURSES_WINT_T=1
16280 fi
16281
16282 # if we find wint_t in either place, use substitution to provide a fallback.
16283 if test "$cf_cv_wint_t" != unknown ; then
16284         NCURSES_OK_WINT_T=1
16285 fi
16286
16287         if test "$NCURSES_OK_MBSTATE_T" = 0 ; then
16288
16289 echo "$as_me:16289: checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}" >&5
16290 echo $ECHO_N "checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
16291 cat >conftest.$ac_ext <<_ACEOF
16292 #line 16292 "configure"
16293 #include "confdefs.h"
16294
16295 #ifndef _XOPEN_SOURCE_EXTENDED
16296 #define _XOPEN_SOURCE_EXTENDED
16297 #endif
16298 #include <${cf_cv_ncurses_header:-curses.h}>
16299 int
16300 main ()
16301 {
16302
16303 mbstate_t foo
16304
16305   ;
16306   return 0;
16307 }
16308 _ACEOF
16309 rm -f conftest.$ac_objext
16310 if { (eval echo "$as_me:16310: \"$ac_compile\"") >&5
16311   (eval $ac_compile) 2>&5
16312   ac_status=$?
16313   echo "$as_me:16313: \$? = $ac_status" >&5
16314   (exit $ac_status); } &&
16315          { ac_try='test -s conftest.$ac_objext'
16316   { (eval echo "$as_me:16316: \"$ac_try\"") >&5
16317   (eval $ac_try) 2>&5
16318   ac_status=$?
16319   echo "$as_me:16319: \$? = $ac_status" >&5
16320   (exit $ac_status); }; }; then
16321   cf_result=yes
16322 else
16323   echo "$as_me: failed program was:" >&5
16324 cat conftest.$ac_ext >&5
16325 cf_result=no
16326 fi
16327 rm -f conftest.$ac_objext conftest.$ac_ext
16328 echo "$as_me:16328: result: $cf_result" >&5
16329 echo "${ECHO_T}$cf_result" >&6
16330 if test $cf_result = yes ; then
16331
16332 cf_result=`echo "have_type_mbstate_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16333
16334 cat >>confdefs.h <<EOF
16335 #define $cf_result 1
16336 EOF
16337
16338 else
16339
16340 cat >>confdefs.h <<EOF
16341 #define mbstate_t long
16342 EOF
16343
16344 fi
16345
16346         fi
16347
16348         if test "$NCURSES_OK_WCHAR_T" = 0 ; then
16349
16350 echo "$as_me:16350: checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}" >&5
16351 echo $ECHO_N "checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
16352 cat >conftest.$ac_ext <<_ACEOF
16353 #line 16353 "configure"
16354 #include "confdefs.h"
16355
16356 #ifndef _XOPEN_SOURCE_EXTENDED
16357 #define _XOPEN_SOURCE_EXTENDED
16358 #endif
16359 #include <${cf_cv_ncurses_header:-curses.h}>
16360 int
16361 main ()
16362 {
16363
16364 wchar_t foo
16365
16366   ;
16367   return 0;
16368 }
16369 _ACEOF
16370 rm -f conftest.$ac_objext
16371 if { (eval echo "$as_me:16371: \"$ac_compile\"") >&5
16372   (eval $ac_compile) 2>&5
16373   ac_status=$?
16374   echo "$as_me:16374: \$? = $ac_status" >&5
16375   (exit $ac_status); } &&
16376          { ac_try='test -s conftest.$ac_objext'
16377   { (eval echo "$as_me:16377: \"$ac_try\"") >&5
16378   (eval $ac_try) 2>&5
16379   ac_status=$?
16380   echo "$as_me:16380: \$? = $ac_status" >&5
16381   (exit $ac_status); }; }; then
16382   cf_result=yes
16383 else
16384   echo "$as_me: failed program was:" >&5
16385 cat conftest.$ac_ext >&5
16386 cf_result=no
16387 fi
16388 rm -f conftest.$ac_objext conftest.$ac_ext
16389 echo "$as_me:16389: result: $cf_result" >&5
16390 echo "${ECHO_T}$cf_result" >&6
16391 if test $cf_result = yes ; then
16392
16393 cf_result=`echo "have_type_wchar_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16394
16395 cat >>confdefs.h <<EOF
16396 #define $cf_result 1
16397 EOF
16398
16399 else
16400
16401 cat >>confdefs.h <<EOF
16402 #define wchar_t long
16403 EOF
16404
16405 fi
16406
16407         fi
16408
16409         if test "$NCURSES_OK_WINT_T" = 0 ; then
16410
16411 echo "$as_me:16411: checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}" >&5
16412 echo $ECHO_N "checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
16413 cat >conftest.$ac_ext <<_ACEOF
16414 #line 16414 "configure"
16415 #include "confdefs.h"
16416
16417 #ifndef _XOPEN_SOURCE_EXTENDED
16418 #define _XOPEN_SOURCE_EXTENDED
16419 #endif
16420 #include <${cf_cv_ncurses_header:-curses.h}>
16421 int
16422 main ()
16423 {
16424
16425 wint_t foo
16426
16427   ;
16428   return 0;
16429 }
16430 _ACEOF
16431 rm -f conftest.$ac_objext
16432 if { (eval echo "$as_me:16432: \"$ac_compile\"") >&5
16433   (eval $ac_compile) 2>&5
16434   ac_status=$?
16435   echo "$as_me:16435: \$? = $ac_status" >&5
16436   (exit $ac_status); } &&
16437          { ac_try='test -s conftest.$ac_objext'
16438   { (eval echo "$as_me:16438: \"$ac_try\"") >&5
16439   (eval $ac_try) 2>&5
16440   ac_status=$?
16441   echo "$as_me:16441: \$? = $ac_status" >&5
16442   (exit $ac_status); }; }; then
16443   cf_result=yes
16444 else
16445   echo "$as_me: failed program was:" >&5
16446 cat conftest.$ac_ext >&5
16447 cf_result=no
16448 fi
16449 rm -f conftest.$ac_objext conftest.$ac_ext
16450 echo "$as_me:16450: result: $cf_result" >&5
16451 echo "${ECHO_T}$cf_result" >&6
16452 if test $cf_result = yes ; then
16453
16454 cf_result=`echo "have_type_wint_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16455
16456 cat >>confdefs.h <<EOF
16457 #define $cf_result 1
16458 EOF
16459
16460 else
16461
16462 cat >>confdefs.h <<EOF
16463 #define wint_t long
16464 EOF
16465
16466 fi
16467
16468         fi
16469 fi
16470
16471 echo "$as_me:16471: checking for data ospeed declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
16472 echo $ECHO_N "checking for data ospeed declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
16473
16474 cat >conftest.$ac_ext <<_ACEOF
16475 #line 16475 "configure"
16476 #include "confdefs.h"
16477
16478 #ifdef HAVE_XCURSES
16479 #include <xcurses.h>
16480 char * XCursesProgramName = "test";
16481 #else
16482 #include <${cf_cv_ncurses_header:-curses.h}>
16483 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16484 #include <ncursesw/term.h>
16485 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16486 #include <ncurses/term.h>
16487 #elif defined(HAVE_TERM_H)
16488 #include <term.h>
16489 #endif
16490 #endif
16491
16492 int
16493 main ()
16494 {
16495
16496 void *foo = &(ospeed)
16497
16498   ;
16499   return 0;
16500 }
16501 _ACEOF
16502 rm -f conftest.$ac_objext
16503 if { (eval echo "$as_me:16503: \"$ac_compile\"") >&5
16504   (eval $ac_compile) 2>&5
16505   ac_status=$?
16506   echo "$as_me:16506: \$? = $ac_status" >&5
16507   (exit $ac_status); } &&
16508          { ac_try='test -s conftest.$ac_objext'
16509   { (eval echo "$as_me:16509: \"$ac_try\"") >&5
16510   (eval $ac_try) 2>&5
16511   ac_status=$?
16512   echo "$as_me:16512: \$? = $ac_status" >&5
16513   (exit $ac_status); }; }; then
16514   cf_result=yes
16515 else
16516   echo "$as_me: failed program was:" >&5
16517 cat conftest.$ac_ext >&5
16518 cf_result=no
16519 fi
16520 rm -f conftest.$ac_objext conftest.$ac_ext
16521 echo "$as_me:16521: result: $cf_result" >&5
16522 echo "${ECHO_T}$cf_result" >&6
16523
16524 if test $cf_result = yes ; then
16525
16526 cf_result=`echo "have_curses_data_ospeed" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16527
16528         cat >>confdefs.h <<EOF
16529 #define $cf_result 1
16530 EOF
16531
16532 else
16533         echo "$as_me:16533: checking for data ospeed in library" >&5
16534 echo $ECHO_N "checking for data ospeed in library... $ECHO_C" >&6
16535         # BSD linkers insist on making weak linkage, but resolve at runtime.
16536         if test "$cross_compiling" = yes; then
16537
16538         # cross-compiling
16539         cat >conftest.$ac_ext <<_ACEOF
16540 #line 16540 "configure"
16541 #include "confdefs.h"
16542
16543 #ifdef HAVE_XCURSES
16544 #include <xcurses.h>
16545 char * XCursesProgramName = "test";
16546 #else
16547 #include <${cf_cv_ncurses_header:-curses.h}>
16548 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16549 #include <ncursesw/term.h>
16550 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16551 #include <ncurses/term.h>
16552 #elif defined(HAVE_TERM_H)
16553 #include <term.h>
16554 #endif
16555 #endif
16556
16557 extern char ospeed;
16558 int
16559 main ()
16560 {
16561
16562         do {
16563                 void *foo = &(ospeed);
16564                 fprintf(stderr, "testing linkage of ospeed:%p\n", foo);
16565                 ${cf_cv_main_return:-return}(foo == 0);
16566         } while (0)
16567
16568   ;
16569   return 0;
16570 }
16571 _ACEOF
16572 rm -f conftest.$ac_objext conftest$ac_exeext
16573 if { (eval echo "$as_me:16573: \"$ac_link\"") >&5
16574   (eval $ac_link) 2>&5
16575   ac_status=$?
16576   echo "$as_me:16576: \$? = $ac_status" >&5
16577   (exit $ac_status); } &&
16578          { ac_try='test -s conftest$ac_exeext'
16579   { (eval echo "$as_me:16579: \"$ac_try\"") >&5
16580   (eval $ac_try) 2>&5
16581   ac_status=$?
16582   echo "$as_me:16582: \$? = $ac_status" >&5
16583   (exit $ac_status); }; }; then
16584   cf_result=yes
16585 else
16586   echo "$as_me: failed program was:" >&5
16587 cat conftest.$ac_ext >&5
16588 cf_result=no
16589 fi
16590 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16591
16592 else
16593   cat >conftest.$ac_ext <<_ACEOF
16594 #line 16594 "configure"
16595 #include "confdefs.h"
16596
16597 #ifdef HAVE_XCURSES
16598 #include <xcurses.h>
16599 char * XCursesProgramName = "test";
16600 #else
16601 #include <${cf_cv_ncurses_header:-curses.h}>
16602 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16603 #include <ncursesw/term.h>
16604 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16605 #include <ncurses/term.h>
16606 #elif defined(HAVE_TERM_H)
16607 #include <term.h>
16608 #endif
16609 #endif
16610
16611 extern char ospeed;
16612 int main(void)
16613 {
16614         void *foo = &(ospeed);
16615         fprintf(stderr, "testing linkage of ospeed:%p\n", foo);
16616         ${cf_cv_main_return:-return}(foo == 0);
16617 }
16618 _ACEOF
16619 rm -f conftest$ac_exeext
16620 if { (eval echo "$as_me:16620: \"$ac_link\"") >&5
16621   (eval $ac_link) 2>&5
16622   ac_status=$?
16623   echo "$as_me:16623: \$? = $ac_status" >&5
16624   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
16625   { (eval echo "$as_me:16625: \"$ac_try\"") >&5
16626   (eval $ac_try) 2>&5
16627   ac_status=$?
16628   echo "$as_me:16628: \$? = $ac_status" >&5
16629   (exit $ac_status); }; }; then
16630   cf_result=yes
16631 else
16632   echo "$as_me: program exited with status $ac_status" >&5
16633 echo "$as_me: failed program was:" >&5
16634 cat conftest.$ac_ext >&5
16635 cf_result=no
16636 fi
16637 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
16638 fi
16639         echo "$as_me:16639: result: $cf_result" >&5
16640 echo "${ECHO_T}$cf_result" >&6
16641         if test $cf_result = yes ; then
16642
16643 cf_result=`echo "decl_curses_data_ospeed" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16644
16645                 cat >>confdefs.h <<EOF
16646 #define $cf_result 1
16647 EOF
16648
16649         fi
16650 fi
16651
16652 echo "$as_me:16652: checking for data boolnames declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
16653 echo $ECHO_N "checking for data boolnames declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
16654
16655 cat >conftest.$ac_ext <<_ACEOF
16656 #line 16656 "configure"
16657 #include "confdefs.h"
16658
16659 #ifdef HAVE_XCURSES
16660 #include <xcurses.h>
16661 char * XCursesProgramName = "test";
16662 #else
16663 #include <${cf_cv_ncurses_header:-curses.h}>
16664 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16665 #include <ncursesw/term.h>
16666 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16667 #include <ncurses/term.h>
16668 #elif defined(HAVE_TERM_H)
16669 #include <term.h>
16670 #endif
16671 #endif
16672
16673 int
16674 main ()
16675 {
16676
16677 void *foo = &(boolnames)
16678
16679   ;
16680   return 0;
16681 }
16682 _ACEOF
16683 rm -f conftest.$ac_objext
16684 if { (eval echo "$as_me:16684: \"$ac_compile\"") >&5
16685   (eval $ac_compile) 2>&5
16686   ac_status=$?
16687   echo "$as_me:16687: \$? = $ac_status" >&5
16688   (exit $ac_status); } &&
16689          { ac_try='test -s conftest.$ac_objext'
16690   { (eval echo "$as_me:16690: \"$ac_try\"") >&5
16691   (eval $ac_try) 2>&5
16692   ac_status=$?
16693   echo "$as_me:16693: \$? = $ac_status" >&5
16694   (exit $ac_status); }; }; then
16695   cf_result=yes
16696 else
16697   echo "$as_me: failed program was:" >&5
16698 cat conftest.$ac_ext >&5
16699 cf_result=no
16700 fi
16701 rm -f conftest.$ac_objext conftest.$ac_ext
16702 echo "$as_me:16702: result: $cf_result" >&5
16703 echo "${ECHO_T}$cf_result" >&6
16704
16705 if test $cf_result = yes ; then
16706
16707 cf_result=`echo "have_curses_data_boolnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16708
16709         cat >>confdefs.h <<EOF
16710 #define $cf_result 1
16711 EOF
16712
16713 else
16714         echo "$as_me:16714: checking for data boolnames in library" >&5
16715 echo $ECHO_N "checking for data boolnames in library... $ECHO_C" >&6
16716         # BSD linkers insist on making weak linkage, but resolve at runtime.
16717         if test "$cross_compiling" = yes; then
16718
16719         # cross-compiling
16720         cat >conftest.$ac_ext <<_ACEOF
16721 #line 16721 "configure"
16722 #include "confdefs.h"
16723
16724 #ifdef HAVE_XCURSES
16725 #include <xcurses.h>
16726 char * XCursesProgramName = "test";
16727 #else
16728 #include <${cf_cv_ncurses_header:-curses.h}>
16729 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16730 #include <ncursesw/term.h>
16731 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16732 #include <ncurses/term.h>
16733 #elif defined(HAVE_TERM_H)
16734 #include <term.h>
16735 #endif
16736 #endif
16737
16738 extern char boolnames;
16739 int
16740 main ()
16741 {
16742
16743         do {
16744                 void *foo = &(boolnames);
16745                 fprintf(stderr, "testing linkage of boolnames:%p\n", foo);
16746                 ${cf_cv_main_return:-return}(foo == 0);
16747         } while (0)
16748
16749   ;
16750   return 0;
16751 }
16752 _ACEOF
16753 rm -f conftest.$ac_objext conftest$ac_exeext
16754 if { (eval echo "$as_me:16754: \"$ac_link\"") >&5
16755   (eval $ac_link) 2>&5
16756   ac_status=$?
16757   echo "$as_me:16757: \$? = $ac_status" >&5
16758   (exit $ac_status); } &&
16759          { ac_try='test -s conftest$ac_exeext'
16760   { (eval echo "$as_me:16760: \"$ac_try\"") >&5
16761   (eval $ac_try) 2>&5
16762   ac_status=$?
16763   echo "$as_me:16763: \$? = $ac_status" >&5
16764   (exit $ac_status); }; }; then
16765   cf_result=yes
16766 else
16767   echo "$as_me: failed program was:" >&5
16768 cat conftest.$ac_ext >&5
16769 cf_result=no
16770 fi
16771 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16772
16773 else
16774   cat >conftest.$ac_ext <<_ACEOF
16775 #line 16775 "configure"
16776 #include "confdefs.h"
16777
16778 #ifdef HAVE_XCURSES
16779 #include <xcurses.h>
16780 char * XCursesProgramName = "test";
16781 #else
16782 #include <${cf_cv_ncurses_header:-curses.h}>
16783 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16784 #include <ncursesw/term.h>
16785 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16786 #include <ncurses/term.h>
16787 #elif defined(HAVE_TERM_H)
16788 #include <term.h>
16789 #endif
16790 #endif
16791
16792 extern char boolnames;
16793 int main(void)
16794 {
16795         void *foo = &(boolnames);
16796         fprintf(stderr, "testing linkage of boolnames:%p\n", foo);
16797         ${cf_cv_main_return:-return}(foo == 0);
16798 }
16799 _ACEOF
16800 rm -f conftest$ac_exeext
16801 if { (eval echo "$as_me:16801: \"$ac_link\"") >&5
16802   (eval $ac_link) 2>&5
16803   ac_status=$?
16804   echo "$as_me:16804: \$? = $ac_status" >&5
16805   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
16806   { (eval echo "$as_me:16806: \"$ac_try\"") >&5
16807   (eval $ac_try) 2>&5
16808   ac_status=$?
16809   echo "$as_me:16809: \$? = $ac_status" >&5
16810   (exit $ac_status); }; }; then
16811   cf_result=yes
16812 else
16813   echo "$as_me: program exited with status $ac_status" >&5
16814 echo "$as_me: failed program was:" >&5
16815 cat conftest.$ac_ext >&5
16816 cf_result=no
16817 fi
16818 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
16819 fi
16820         echo "$as_me:16820: result: $cf_result" >&5
16821 echo "${ECHO_T}$cf_result" >&6
16822         if test $cf_result = yes ; then
16823
16824 cf_result=`echo "decl_curses_data_boolnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16825
16826                 cat >>confdefs.h <<EOF
16827 #define $cf_result 1
16828 EOF
16829
16830         fi
16831 fi
16832
16833 echo "$as_me:16833: checking for data boolfnames declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
16834 echo $ECHO_N "checking for data boolfnames declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
16835
16836 cat >conftest.$ac_ext <<_ACEOF
16837 #line 16837 "configure"
16838 #include "confdefs.h"
16839
16840 #ifdef HAVE_XCURSES
16841 #include <xcurses.h>
16842 char * XCursesProgramName = "test";
16843 #else
16844 #include <${cf_cv_ncurses_header:-curses.h}>
16845 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16846 #include <ncursesw/term.h>
16847 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16848 #include <ncurses/term.h>
16849 #elif defined(HAVE_TERM_H)
16850 #include <term.h>
16851 #endif
16852 #endif
16853
16854 int
16855 main ()
16856 {
16857
16858 void *foo = &(boolfnames)
16859
16860   ;
16861   return 0;
16862 }
16863 _ACEOF
16864 rm -f conftest.$ac_objext
16865 if { (eval echo "$as_me:16865: \"$ac_compile\"") >&5
16866   (eval $ac_compile) 2>&5
16867   ac_status=$?
16868   echo "$as_me:16868: \$? = $ac_status" >&5
16869   (exit $ac_status); } &&
16870          { ac_try='test -s conftest.$ac_objext'
16871   { (eval echo "$as_me:16871: \"$ac_try\"") >&5
16872   (eval $ac_try) 2>&5
16873   ac_status=$?
16874   echo "$as_me:16874: \$? = $ac_status" >&5
16875   (exit $ac_status); }; }; then
16876   cf_result=yes
16877 else
16878   echo "$as_me: failed program was:" >&5
16879 cat conftest.$ac_ext >&5
16880 cf_result=no
16881 fi
16882 rm -f conftest.$ac_objext conftest.$ac_ext
16883 echo "$as_me:16883: result: $cf_result" >&5
16884 echo "${ECHO_T}$cf_result" >&6
16885
16886 if test $cf_result = yes ; then
16887
16888 cf_result=`echo "have_curses_data_boolfnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16889
16890         cat >>confdefs.h <<EOF
16891 #define $cf_result 1
16892 EOF
16893
16894 else
16895         echo "$as_me:16895: checking for data boolfnames in library" >&5
16896 echo $ECHO_N "checking for data boolfnames in library... $ECHO_C" >&6
16897         # BSD linkers insist on making weak linkage, but resolve at runtime.
16898         if test "$cross_compiling" = yes; then
16899
16900         # cross-compiling
16901         cat >conftest.$ac_ext <<_ACEOF
16902 #line 16902 "configure"
16903 #include "confdefs.h"
16904
16905 #ifdef HAVE_XCURSES
16906 #include <xcurses.h>
16907 char * XCursesProgramName = "test";
16908 #else
16909 #include <${cf_cv_ncurses_header:-curses.h}>
16910 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16911 #include <ncursesw/term.h>
16912 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16913 #include <ncurses/term.h>
16914 #elif defined(HAVE_TERM_H)
16915 #include <term.h>
16916 #endif
16917 #endif
16918
16919 extern char boolfnames;
16920 int
16921 main ()
16922 {
16923
16924         do {
16925                 void *foo = &(boolfnames);
16926                 fprintf(stderr, "testing linkage of boolfnames:%p\n", foo);
16927                 ${cf_cv_main_return:-return}(foo == 0);
16928         } while (0)
16929
16930   ;
16931   return 0;
16932 }
16933 _ACEOF
16934 rm -f conftest.$ac_objext conftest$ac_exeext
16935 if { (eval echo "$as_me:16935: \"$ac_link\"") >&5
16936   (eval $ac_link) 2>&5
16937   ac_status=$?
16938   echo "$as_me:16938: \$? = $ac_status" >&5
16939   (exit $ac_status); } &&
16940          { ac_try='test -s conftest$ac_exeext'
16941   { (eval echo "$as_me:16941: \"$ac_try\"") >&5
16942   (eval $ac_try) 2>&5
16943   ac_status=$?
16944   echo "$as_me:16944: \$? = $ac_status" >&5
16945   (exit $ac_status); }; }; then
16946   cf_result=yes
16947 else
16948   echo "$as_me: failed program was:" >&5
16949 cat conftest.$ac_ext >&5
16950 cf_result=no
16951 fi
16952 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16953
16954 else
16955   cat >conftest.$ac_ext <<_ACEOF
16956 #line 16956 "configure"
16957 #include "confdefs.h"
16958
16959 #ifdef HAVE_XCURSES
16960 #include <xcurses.h>
16961 char * XCursesProgramName = "test";
16962 #else
16963 #include <${cf_cv_ncurses_header:-curses.h}>
16964 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16965 #include <ncursesw/term.h>
16966 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16967 #include <ncurses/term.h>
16968 #elif defined(HAVE_TERM_H)
16969 #include <term.h>
16970 #endif
16971 #endif
16972
16973 extern char boolfnames;
16974 int main(void)
16975 {
16976         void *foo = &(boolfnames);
16977         fprintf(stderr, "testing linkage of boolfnames:%p\n", foo);
16978         ${cf_cv_main_return:-return}(foo == 0);
16979 }
16980 _ACEOF
16981 rm -f conftest$ac_exeext
16982 if { (eval echo "$as_me:16982: \"$ac_link\"") >&5
16983   (eval $ac_link) 2>&5
16984   ac_status=$?
16985   echo "$as_me:16985: \$? = $ac_status" >&5
16986   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
16987   { (eval echo "$as_me:16987: \"$ac_try\"") >&5
16988   (eval $ac_try) 2>&5
16989   ac_status=$?
16990   echo "$as_me:16990: \$? = $ac_status" >&5
16991   (exit $ac_status); }; }; then
16992   cf_result=yes
16993 else
16994   echo "$as_me: program exited with status $ac_status" >&5
16995 echo "$as_me: failed program was:" >&5
16996 cat conftest.$ac_ext >&5
16997 cf_result=no
16998 fi
16999 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
17000 fi
17001         echo "$as_me:17001: result: $cf_result" >&5
17002 echo "${ECHO_T}$cf_result" >&6
17003         if test $cf_result = yes ; then
17004
17005 cf_result=`echo "decl_curses_data_boolfnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17006
17007                 cat >>confdefs.h <<EOF
17008 #define $cf_result 1
17009 EOF
17010
17011         fi
17012 fi
17013
17014 echo "$as_me:17014: checking for data ttytype declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
17015 echo $ECHO_N "checking for data ttytype declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
17016
17017 cat >conftest.$ac_ext <<_ACEOF
17018 #line 17018 "configure"
17019 #include "confdefs.h"
17020
17021 #ifdef HAVE_XCURSES
17022 #include <xcurses.h>
17023 char * XCursesProgramName = "test";
17024 #else
17025 #include <${cf_cv_ncurses_header:-curses.h}>
17026 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
17027 #include <ncursesw/term.h>
17028 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
17029 #include <ncurses/term.h>
17030 #elif defined(HAVE_TERM_H)
17031 #include <term.h>
17032 #endif
17033 #endif
17034
17035 int
17036 main ()
17037 {
17038
17039 void *foo = &(ttytype)
17040
17041   ;
17042   return 0;
17043 }
17044 _ACEOF
17045 rm -f conftest.$ac_objext
17046 if { (eval echo "$as_me:17046: \"$ac_compile\"") >&5
17047   (eval $ac_compile) 2>&5
17048   ac_status=$?
17049   echo "$as_me:17049: \$? = $ac_status" >&5
17050   (exit $ac_status); } &&
17051          { ac_try='test -s conftest.$ac_objext'
17052   { (eval echo "$as_me:17052: \"$ac_try\"") >&5
17053   (eval $ac_try) 2>&5
17054   ac_status=$?
17055   echo "$as_me:17055: \$? = $ac_status" >&5
17056   (exit $ac_status); }; }; then
17057   cf_result=yes
17058 else
17059   echo "$as_me: failed program was:" >&5
17060 cat conftest.$ac_ext >&5
17061 cf_result=no
17062 fi
17063 rm -f conftest.$ac_objext conftest.$ac_ext
17064 echo "$as_me:17064: result: $cf_result" >&5
17065 echo "${ECHO_T}$cf_result" >&6
17066
17067 if test $cf_result = yes ; then
17068
17069 cf_result=`echo "have_curses_data_ttytype" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17070
17071         cat >>confdefs.h <<EOF
17072 #define $cf_result 1
17073 EOF
17074
17075 else
17076         echo "$as_me:17076: checking for data ttytype in library" >&5
17077 echo $ECHO_N "checking for data ttytype in library... $ECHO_C" >&6
17078         # BSD linkers insist on making weak linkage, but resolve at runtime.
17079         if test "$cross_compiling" = yes; then
17080
17081         # cross-compiling
17082         cat >conftest.$ac_ext <<_ACEOF
17083 #line 17083 "configure"
17084 #include "confdefs.h"
17085
17086 #ifdef HAVE_XCURSES
17087 #include <xcurses.h>
17088 char * XCursesProgramName = "test";
17089 #else
17090 #include <${cf_cv_ncurses_header:-curses.h}>
17091 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
17092 #include <ncursesw/term.h>
17093 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
17094 #include <ncurses/term.h>
17095 #elif defined(HAVE_TERM_H)
17096 #include <term.h>
17097 #endif
17098 #endif
17099
17100 extern char ttytype;
17101 int
17102 main ()
17103 {
17104
17105         do {
17106                 void *foo = &(ttytype);
17107                 fprintf(stderr, "testing linkage of ttytype:%p\n", foo);
17108                 ${cf_cv_main_return:-return}(foo == 0);
17109         } while (0)
17110
17111   ;
17112   return 0;
17113 }
17114 _ACEOF
17115 rm -f conftest.$ac_objext conftest$ac_exeext
17116 if { (eval echo "$as_me:17116: \"$ac_link\"") >&5
17117   (eval $ac_link) 2>&5
17118   ac_status=$?
17119   echo "$as_me:17119: \$? = $ac_status" >&5
17120   (exit $ac_status); } &&
17121          { ac_try='test -s conftest$ac_exeext'
17122   { (eval echo "$as_me:17122: \"$ac_try\"") >&5
17123   (eval $ac_try) 2>&5
17124   ac_status=$?
17125   echo "$as_me:17125: \$? = $ac_status" >&5
17126   (exit $ac_status); }; }; then
17127   cf_result=yes
17128 else
17129   echo "$as_me: failed program was:" >&5
17130 cat conftest.$ac_ext >&5
17131 cf_result=no
17132 fi
17133 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17134
17135 else
17136   cat >conftest.$ac_ext <<_ACEOF
17137 #line 17137 "configure"
17138 #include "confdefs.h"
17139
17140 #ifdef HAVE_XCURSES
17141 #include <xcurses.h>
17142 char * XCursesProgramName = "test";
17143 #else
17144 #include <${cf_cv_ncurses_header:-curses.h}>
17145 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
17146 #include <ncursesw/term.h>
17147 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
17148 #include <ncurses/term.h>
17149 #elif defined(HAVE_TERM_H)
17150 #include <term.h>
17151 #endif
17152 #endif
17153
17154 extern char ttytype;
17155 int main(void)
17156 {
17157         void *foo = &(ttytype);
17158         fprintf(stderr, "testing linkage of ttytype:%p\n", foo);
17159         ${cf_cv_main_return:-return}(foo == 0);
17160 }
17161 _ACEOF
17162 rm -f 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); } && { ac_try='./conftest$ac_exeext'
17168   { (eval echo "$as_me:17168: \"$ac_try\"") >&5
17169   (eval $ac_try) 2>&5
17170   ac_status=$?
17171   echo "$as_me:17171: \$? = $ac_status" >&5
17172   (exit $ac_status); }; }; then
17173   cf_result=yes
17174 else
17175   echo "$as_me: program exited with status $ac_status" >&5
17176 echo "$as_me: failed program was:" >&5
17177 cat conftest.$ac_ext >&5
17178 cf_result=no
17179 fi
17180 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
17181 fi
17182         echo "$as_me:17182: result: $cf_result" >&5
17183 echo "${ECHO_T}$cf_result" >&6
17184         if test $cf_result = yes ; then
17185
17186 cf_result=`echo "decl_curses_data_ttytype" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17187
17188                 cat >>confdefs.h <<EOF
17189 #define $cf_result 1
17190 EOF
17191
17192         fi
17193 fi
17194
17195 if ( test "$GCC" = yes || test "$GXX" = yes )
17196 then
17197 echo "$as_me:17197: checking if you want to turn on gcc warnings" >&5
17198 echo $ECHO_N "checking if you want to turn on gcc warnings... $ECHO_C" >&6
17199
17200 # Check whether --enable-warnings or --disable-warnings was given.
17201 if test "${enable_warnings+set}" = set; then
17202   enableval="$enable_warnings"
17203   test "$enableval" != yes && enableval=no
17204         if test "$enableval" != "no" ; then
17205     with_warnings=yes
17206         else
17207                 with_warnings=no
17208         fi
17209 else
17210   enableval=no
17211         with_warnings=no
17212
17213 fi;
17214 echo "$as_me:17214: result: $with_warnings" >&5
17215 echo "${ECHO_T}$with_warnings" >&6
17216 if test "$with_warnings" = "yes"
17217 then
17218
17219 if test "$GCC" = yes
17220 then
17221 cat > conftest.i <<EOF
17222 #ifndef GCC_PRINTF
17223 #define GCC_PRINTF 0
17224 #endif
17225 #ifndef GCC_SCANF
17226 #define GCC_SCANF 0
17227 #endif
17228 #ifndef GCC_NORETURN
17229 #define GCC_NORETURN /* nothing */
17230 #endif
17231 #ifndef GCC_UNUSED
17232 #define GCC_UNUSED /* nothing */
17233 #endif
17234 EOF
17235 if test "$GCC" = yes
17236 then
17237         { echo "$as_me:17237: checking for $CC __attribute__ directives..." >&5
17238 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
17239 cat > conftest.$ac_ext <<EOF
17240 #line 17240 "${as_me:-configure}"
17241 #include "confdefs.h"
17242 #include "conftest.h"
17243 #include "conftest.i"
17244 #if     GCC_PRINTF
17245 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
17246 #else
17247 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
17248 #endif
17249 #if     GCC_SCANF
17250 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
17251 #else
17252 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
17253 #endif
17254 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
17255 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
17256 extern void foo(void) GCC_NORETURN;
17257 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
17258 EOF
17259         cf_printf_attribute=no
17260         cf_scanf_attribute=no
17261         for cf_attribute in scanf printf unused noreturn
17262         do
17263
17264 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17265
17266                 cf_directive="__attribute__(($cf_attribute))"
17267                 echo "checking for $CC $cf_directive" 1>&5
17268
17269                 case $cf_attribute in
17270                 (printf)
17271                         cf_printf_attribute=yes
17272                         cat >conftest.h <<EOF
17273 #define GCC_$cf_ATTRIBUTE 1
17274 EOF
17275                         ;;
17276                 (scanf)
17277                         cf_scanf_attribute=yes
17278                         cat >conftest.h <<EOF
17279 #define GCC_$cf_ATTRIBUTE 1
17280 EOF
17281                         ;;
17282                 (*)
17283                         cat >conftest.h <<EOF
17284 #define GCC_$cf_ATTRIBUTE $cf_directive
17285 EOF
17286                         ;;
17287                 esac
17288
17289                 if { (eval echo "$as_me:17289: \"$ac_compile\"") >&5
17290   (eval $ac_compile) 2>&5
17291   ac_status=$?
17292   echo "$as_me:17292: \$? = $ac_status" >&5
17293   (exit $ac_status); }; then
17294                         test -n "$verbose" && echo "$as_me:17294: result: ... $cf_attribute" >&5
17295 echo "${ECHO_T}... $cf_attribute" >&6
17296                         cat conftest.h >>confdefs.h
17297                         case $cf_attribute in
17298                         (noreturn)
17299
17300 cat >>confdefs.h <<EOF
17301 #define GCC_NORETURN $cf_directive
17302 EOF
17303
17304                                 ;;
17305                         (printf)
17306                                 cf_value='/* nothing */'
17307                                 if test "$cf_printf_attribute" != no ; then
17308                                         cf_value='__attribute__((format(printf,fmt,var)))'
17309
17310 cat >>confdefs.h <<\EOF
17311 #define GCC_PRINTF 1
17312 EOF
17313
17314                                 fi
17315
17316 cat >>confdefs.h <<EOF
17317 #define GCC_PRINTFLIKE(fmt,var) $cf_value
17318 EOF
17319
17320                                 ;;
17321                         (scanf)
17322                                 cf_value='/* nothing */'
17323                                 if test "$cf_scanf_attribute" != no ; then
17324                                         cf_value='__attribute__((format(scanf,fmt,var)))'
17325
17326 cat >>confdefs.h <<\EOF
17327 #define GCC_SCANF 1
17328 EOF
17329
17330                                 fi
17331
17332 cat >>confdefs.h <<EOF
17333 #define GCC_SCANFLIKE(fmt,var) $cf_value
17334 EOF
17335
17336                                 ;;
17337                         (unused)
17338
17339 cat >>confdefs.h <<EOF
17340 #define GCC_UNUSED $cf_directive
17341 EOF
17342
17343                                 ;;
17344                         esac
17345                 fi
17346         done
17347 else
17348         fgrep define conftest.i >>confdefs.h
17349 fi
17350 rm -rf conftest*
17351 fi
17352
17353 INTEL_COMPILER=no
17354
17355 if test "$GCC" = yes ; then
17356         case $host_os in
17357         (linux*|gnu*)
17358                 echo "$as_me:17358: checking if this is really Intel C compiler" >&5
17359 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
17360                 cf_save_CFLAGS="$CFLAGS"
17361                 CFLAGS="$CFLAGS -no-gcc"
17362                 cat >conftest.$ac_ext <<_ACEOF
17363 #line 17363 "configure"
17364 #include "confdefs.h"
17365
17366 int
17367 main ()
17368 {
17369
17370 #ifdef __INTEL_COMPILER
17371 #else
17372 make an error
17373 #endif
17374
17375   ;
17376   return 0;
17377 }
17378 _ACEOF
17379 rm -f conftest.$ac_objext
17380 if { (eval echo "$as_me:17380: \"$ac_compile\"") >&5
17381   (eval $ac_compile) 2>&5
17382   ac_status=$?
17383   echo "$as_me:17383: \$? = $ac_status" >&5
17384   (exit $ac_status); } &&
17385          { ac_try='test -s conftest.$ac_objext'
17386   { (eval echo "$as_me:17386: \"$ac_try\"") >&5
17387   (eval $ac_try) 2>&5
17388   ac_status=$?
17389   echo "$as_me:17389: \$? = $ac_status" >&5
17390   (exit $ac_status); }; }; then
17391   INTEL_COMPILER=yes
17392 cf_save_CFLAGS="$cf_save_CFLAGS -we147"
17393
17394 else
17395   echo "$as_me: failed program was:" >&5
17396 cat conftest.$ac_ext >&5
17397 fi
17398 rm -f conftest.$ac_objext conftest.$ac_ext
17399                 CFLAGS="$cf_save_CFLAGS"
17400                 echo "$as_me:17400: result: $INTEL_COMPILER" >&5
17401 echo "${ECHO_T}$INTEL_COMPILER" >&6
17402                 ;;
17403         esac
17404 fi
17405
17406 CLANG_COMPILER=no
17407
17408 if test "$GCC" = yes ; then
17409         echo "$as_me:17409: checking if this is really Clang C compiler" >&5
17410 echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6
17411         cf_save_CFLAGS="$CFLAGS"
17412         CFLAGS="$CFLAGS -Qunused-arguments"
17413         cat >conftest.$ac_ext <<_ACEOF
17414 #line 17414 "configure"
17415 #include "confdefs.h"
17416
17417 int
17418 main ()
17419 {
17420
17421 #ifdef __clang__
17422 #else
17423 make an error
17424 #endif
17425
17426   ;
17427   return 0;
17428 }
17429 _ACEOF
17430 rm -f conftest.$ac_objext
17431 if { (eval echo "$as_me:17431: \"$ac_compile\"") >&5
17432   (eval $ac_compile) 2>&5
17433   ac_status=$?
17434   echo "$as_me:17434: \$? = $ac_status" >&5
17435   (exit $ac_status); } &&
17436          { ac_try='test -s conftest.$ac_objext'
17437   { (eval echo "$as_me:17437: \"$ac_try\"") >&5
17438   (eval $ac_try) 2>&5
17439   ac_status=$?
17440   echo "$as_me:17440: \$? = $ac_status" >&5
17441   (exit $ac_status); }; }; then
17442   CLANG_COMPILER=yes
17443 cf_save_CFLAGS="$cf_save_CFLAGS -Qunused-arguments"
17444
17445 else
17446   echo "$as_me: failed program was:" >&5
17447 cat conftest.$ac_ext >&5
17448 fi
17449 rm -f conftest.$ac_objext conftest.$ac_ext
17450         CFLAGS="$cf_save_CFLAGS"
17451         echo "$as_me:17451: result: $CLANG_COMPILER" >&5
17452 echo "${ECHO_T}$CLANG_COMPILER" >&6
17453 fi
17454
17455 cat > conftest.$ac_ext <<EOF
17456 #line 17456 "${as_me:-configure}"
17457 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
17458 EOF
17459
17460 if test "$INTEL_COMPILER" = yes
17461 then
17462 # The "-wdXXX" options suppress warnings:
17463 # remark #1419: external declaration in primary source file
17464 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
17465 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
17466 # remark #193: zero used for undefined preprocessing identifier
17467 # remark #593: variable "curs_sb_left_arrow" was set but never used
17468 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
17469 # remark #869: parameter "tw" was never referenced
17470 # remark #981: operands are evaluated in unspecified order
17471 # warning #279: controlling expression is constant
17472
17473         { echo "$as_me:17473: checking for $CC warning options..." >&5
17474 echo "$as_me: checking for $CC warning options..." >&6;}
17475         cf_save_CFLAGS="$CFLAGS"
17476         EXTRA_CFLAGS="-Wall"
17477         for cf_opt in \
17478                 wd1419 \
17479                 wd1683 \
17480                 wd1684 \
17481                 wd193 \
17482                 wd593 \
17483                 wd279 \
17484                 wd810 \
17485                 wd869 \
17486                 wd981
17487         do
17488                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
17489                 if { (eval echo "$as_me:17489: \"$ac_compile\"") >&5
17490   (eval $ac_compile) 2>&5
17491   ac_status=$?
17492   echo "$as_me:17492: \$? = $ac_status" >&5
17493   (exit $ac_status); }; then
17494                         test -n "$verbose" && echo "$as_me:17494: result: ... -$cf_opt" >&5
17495 echo "${ECHO_T}... -$cf_opt" >&6
17496                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
17497                 fi
17498         done
17499         CFLAGS="$cf_save_CFLAGS"
17500
17501 elif test "$GCC" = yes
17502 then
17503         { echo "$as_me:17503: checking for $CC warning options..." >&5
17504 echo "$as_me: checking for $CC warning options..." >&6;}
17505         cf_save_CFLAGS="$CFLAGS"
17506         EXTRA_CFLAGS=
17507         cf_warn_CONST=""
17508         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
17509         cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
17510         test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
17511         for cf_opt in W Wall \
17512                 Wbad-function-cast \
17513                 Wcast-align \
17514                 Wcast-qual \
17515                 Wdeclaration-after-statement \
17516                 Wextra \
17517                 Winline \
17518                 Wmissing-declarations \
17519                 Wmissing-prototypes \
17520                 Wnested-externs \
17521                 Wpointer-arith \
17522                 Wshadow \
17523                 Wstrict-prototypes \
17524                 Wundef $cf_gcc_warnings $cf_warn_CONST
17525         do
17526                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
17527                 if { (eval echo "$as_me:17527: \"$ac_compile\"") >&5
17528   (eval $ac_compile) 2>&5
17529   ac_status=$?
17530   echo "$as_me:17530: \$? = $ac_status" >&5
17531   (exit $ac_status); }; then
17532                         test -n "$verbose" && echo "$as_me:17532: result: ... -$cf_opt" >&5
17533 echo "${ECHO_T}... -$cf_opt" >&6
17534                         case $cf_opt in
17535                         (Wcast-qual)
17536                                 CPPFLAGS="$CPPFLAGS -DXTSTRINGDEFINES"
17537                                 ;;
17538                         (Winline)
17539                                 case $GCC_VERSION in
17540                                 ([34].*)
17541                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
17542
17543 echo "${as_me:-configure}:17543: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
17544
17545                                         continue;;
17546                                 esac
17547                                 ;;
17548                         (Wpointer-arith)
17549                                 case $GCC_VERSION in
17550                                 ([12].*)
17551                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
17552
17553 echo "${as_me:-configure}:17553: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
17554
17555                                         continue;;
17556                                 esac
17557                                 ;;
17558                         esac
17559                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
17560                 fi
17561         done
17562         CFLAGS="$cf_save_CFLAGS"
17563 fi
17564 rm -rf conftest*
17565
17566 fi
17567 fi
17568
17569 echo "$as_me:17569: checking if you want to use dmalloc for testing" >&5
17570 echo $ECHO_N "checking if you want to use dmalloc for testing... $ECHO_C" >&6
17571
17572 # Check whether --with-dmalloc or --without-dmalloc was given.
17573 if test "${with_dmalloc+set}" = set; then
17574   withval="$with_dmalloc"
17575
17576 cat >>confdefs.h <<EOF
17577 #define USE_DMALLOC 1
17578 EOF
17579
17580         : ${with_cflags:=-g}
17581         : ${with_no_leaks:=yes}
17582          with_dmalloc=yes
17583 else
17584   with_dmalloc=
17585 fi;
17586 echo "$as_me:17586: result: ${with_dmalloc:-no}" >&5
17587 echo "${ECHO_T}${with_dmalloc:-no}" >&6
17588
17589 case .$with_cflags in
17590 (.*-g*)
17591         case .$CFLAGS in
17592         (.*-g*)
17593                 ;;
17594         (*)
17595
17596 cf_fix_cppflags=no
17597 cf_new_cflags=
17598 cf_new_cppflags=
17599 cf_new_extra_cppflags=
17600
17601 for cf_add_cflags in -g
17602 do
17603 case $cf_fix_cppflags in
17604 (no)
17605         case $cf_add_cflags in
17606         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
17607                 case $cf_add_cflags in
17608                 (-D*)
17609                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
17610
17611                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17612                                 && test -z "${cf_tst_cflags}" \
17613                                 && cf_fix_cppflags=yes
17614
17615                         if test $cf_fix_cppflags = yes ; then
17616                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
17617                                 continue
17618                         elif test "${cf_tst_cflags}" = "\"'" ; then
17619                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
17620                                 continue
17621                         fi
17622                         ;;
17623                 esac
17624                 case "$CPPFLAGS" in
17625                 (*$cf_add_cflags)
17626                         ;;
17627                 (*)
17628                         case $cf_add_cflags in
17629                         (-D*)
17630                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
17631
17632 CPPFLAGS=`echo "$CPPFLAGS" | \
17633         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
17634                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
17635
17636                                 ;;
17637                         esac
17638                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
17639                         ;;
17640                 esac
17641                 ;;
17642         (*)
17643                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
17644                 ;;
17645         esac
17646         ;;
17647 (yes)
17648         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
17649
17650         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
17651
17652         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17653                 && test -z "${cf_tst_cflags}" \
17654                 && cf_fix_cppflags=no
17655         ;;
17656 esac
17657 done
17658
17659 if test -n "$cf_new_cflags" ; then
17660
17661         CFLAGS="$CFLAGS $cf_new_cflags"
17662 fi
17663
17664 if test -n "$cf_new_cppflags" ; then
17665
17666         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
17667 fi
17668
17669 if test -n "$cf_new_extra_cppflags" ; then
17670
17671         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
17672 fi
17673
17674                 ;;
17675         esac
17676         ;;
17677 esac
17678
17679 if test "$with_dmalloc" = yes ; then
17680         echo "$as_me:17680: checking for dmalloc.h" >&5
17681 echo $ECHO_N "checking for dmalloc.h... $ECHO_C" >&6
17682 if test "${ac_cv_header_dmalloc_h+set}" = set; then
17683   echo $ECHO_N "(cached) $ECHO_C" >&6
17684 else
17685   cat >conftest.$ac_ext <<_ACEOF
17686 #line 17686 "configure"
17687 #include "confdefs.h"
17688 #include <dmalloc.h>
17689 _ACEOF
17690 if { (eval echo "$as_me:17690: \"$ac_cpp conftest.$ac_ext\"") >&5
17691   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
17692   ac_status=$?
17693   egrep -v '^ *\+' conftest.er1 >conftest.err
17694   rm -f conftest.er1
17695   cat conftest.err >&5
17696   echo "$as_me:17696: \$? = $ac_status" >&5
17697   (exit $ac_status); } >/dev/null; then
17698   if test -s conftest.err; then
17699     ac_cpp_err=$ac_c_preproc_warn_flag
17700   else
17701     ac_cpp_err=
17702   fi
17703 else
17704   ac_cpp_err=yes
17705 fi
17706 if test -z "$ac_cpp_err"; then
17707   ac_cv_header_dmalloc_h=yes
17708 else
17709   echo "$as_me: failed program was:" >&5
17710   cat conftest.$ac_ext >&5
17711   ac_cv_header_dmalloc_h=no
17712 fi
17713 rm -f conftest.err conftest.$ac_ext
17714 fi
17715 echo "$as_me:17715: result: $ac_cv_header_dmalloc_h" >&5
17716 echo "${ECHO_T}$ac_cv_header_dmalloc_h" >&6
17717 if test $ac_cv_header_dmalloc_h = yes; then
17718
17719 echo "$as_me:17719: checking for dmalloc_debug in -ldmalloc" >&5
17720 echo $ECHO_N "checking for dmalloc_debug in -ldmalloc... $ECHO_C" >&6
17721 if test "${ac_cv_lib_dmalloc_dmalloc_debug+set}" = set; then
17722   echo $ECHO_N "(cached) $ECHO_C" >&6
17723 else
17724   ac_check_lib_save_LIBS=$LIBS
17725 LIBS="-ldmalloc  $LIBS"
17726 cat >conftest.$ac_ext <<_ACEOF
17727 #line 17727 "configure"
17728 #include "confdefs.h"
17729
17730 /* Override any gcc2 internal prototype to avoid an error.  */
17731 #ifdef __cplusplus
17732 extern "C"
17733 #endif
17734 /* We use char because int might match the return type of a gcc2
17735    builtin and then its argument prototype would still apply.  */
17736 char dmalloc_debug ();
17737 int
17738 main ()
17739 {
17740 dmalloc_debug ();
17741   ;
17742   return 0;
17743 }
17744 _ACEOF
17745 rm -f conftest.$ac_objext conftest$ac_exeext
17746 if { (eval echo "$as_me:17746: \"$ac_link\"") >&5
17747   (eval $ac_link) 2>&5
17748   ac_status=$?
17749   echo "$as_me:17749: \$? = $ac_status" >&5
17750   (exit $ac_status); } &&
17751          { ac_try='test -s conftest$ac_exeext'
17752   { (eval echo "$as_me:17752: \"$ac_try\"") >&5
17753   (eval $ac_try) 2>&5
17754   ac_status=$?
17755   echo "$as_me:17755: \$? = $ac_status" >&5
17756   (exit $ac_status); }; }; then
17757   ac_cv_lib_dmalloc_dmalloc_debug=yes
17758 else
17759   echo "$as_me: failed program was:" >&5
17760 cat conftest.$ac_ext >&5
17761 ac_cv_lib_dmalloc_dmalloc_debug=no
17762 fi
17763 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17764 LIBS=$ac_check_lib_save_LIBS
17765 fi
17766 echo "$as_me:17766: result: $ac_cv_lib_dmalloc_dmalloc_debug" >&5
17767 echo "${ECHO_T}$ac_cv_lib_dmalloc_dmalloc_debug" >&6
17768 if test $ac_cv_lib_dmalloc_dmalloc_debug = yes; then
17769   cat >>confdefs.h <<EOF
17770 #define HAVE_LIBDMALLOC 1
17771 EOF
17772
17773   LIBS="-ldmalloc $LIBS"
17774
17775 fi
17776
17777 fi
17778
17779 fi
17780
17781 echo "$as_me:17781: checking if you want to use dbmalloc for testing" >&5
17782 echo $ECHO_N "checking if you want to use dbmalloc for testing... $ECHO_C" >&6
17783
17784 # Check whether --with-dbmalloc or --without-dbmalloc was given.
17785 if test "${with_dbmalloc+set}" = set; then
17786   withval="$with_dbmalloc"
17787
17788 cat >>confdefs.h <<EOF
17789 #define USE_DBMALLOC 1
17790 EOF
17791
17792         : ${with_cflags:=-g}
17793         : ${with_no_leaks:=yes}
17794          with_dbmalloc=yes
17795 else
17796   with_dbmalloc=
17797 fi;
17798 echo "$as_me:17798: result: ${with_dbmalloc:-no}" >&5
17799 echo "${ECHO_T}${with_dbmalloc:-no}" >&6
17800
17801 case .$with_cflags in
17802 (.*-g*)
17803         case .$CFLAGS in
17804         (.*-g*)
17805                 ;;
17806         (*)
17807
17808 cf_fix_cppflags=no
17809 cf_new_cflags=
17810 cf_new_cppflags=
17811 cf_new_extra_cppflags=
17812
17813 for cf_add_cflags in -g
17814 do
17815 case $cf_fix_cppflags in
17816 (no)
17817         case $cf_add_cflags in
17818         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
17819                 case $cf_add_cflags in
17820                 (-D*)
17821                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
17822
17823                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17824                                 && test -z "${cf_tst_cflags}" \
17825                                 && cf_fix_cppflags=yes
17826
17827                         if test $cf_fix_cppflags = yes ; then
17828                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
17829                                 continue
17830                         elif test "${cf_tst_cflags}" = "\"'" ; then
17831                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
17832                                 continue
17833                         fi
17834                         ;;
17835                 esac
17836                 case "$CPPFLAGS" in
17837                 (*$cf_add_cflags)
17838                         ;;
17839                 (*)
17840                         case $cf_add_cflags in
17841                         (-D*)
17842                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
17843
17844 CPPFLAGS=`echo "$CPPFLAGS" | \
17845         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
17846                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
17847
17848                                 ;;
17849                         esac
17850                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
17851                         ;;
17852                 esac
17853                 ;;
17854         (*)
17855                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
17856                 ;;
17857         esac
17858         ;;
17859 (yes)
17860         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
17861
17862         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
17863
17864         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17865                 && test -z "${cf_tst_cflags}" \
17866                 && cf_fix_cppflags=no
17867         ;;
17868 esac
17869 done
17870
17871 if test -n "$cf_new_cflags" ; then
17872
17873         CFLAGS="$CFLAGS $cf_new_cflags"
17874 fi
17875
17876 if test -n "$cf_new_cppflags" ; then
17877
17878         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
17879 fi
17880
17881 if test -n "$cf_new_extra_cppflags" ; then
17882
17883         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
17884 fi
17885
17886                 ;;
17887         esac
17888         ;;
17889 esac
17890
17891 if test "$with_dbmalloc" = yes ; then
17892         echo "$as_me:17892: checking for dbmalloc.h" >&5
17893 echo $ECHO_N "checking for dbmalloc.h... $ECHO_C" >&6
17894 if test "${ac_cv_header_dbmalloc_h+set}" = set; then
17895   echo $ECHO_N "(cached) $ECHO_C" >&6
17896 else
17897   cat >conftest.$ac_ext <<_ACEOF
17898 #line 17898 "configure"
17899 #include "confdefs.h"
17900 #include <dbmalloc.h>
17901 _ACEOF
17902 if { (eval echo "$as_me:17902: \"$ac_cpp conftest.$ac_ext\"") >&5
17903   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
17904   ac_status=$?
17905   egrep -v '^ *\+' conftest.er1 >conftest.err
17906   rm -f conftest.er1
17907   cat conftest.err >&5
17908   echo "$as_me:17908: \$? = $ac_status" >&5
17909   (exit $ac_status); } >/dev/null; then
17910   if test -s conftest.err; then
17911     ac_cpp_err=$ac_c_preproc_warn_flag
17912   else
17913     ac_cpp_err=
17914   fi
17915 else
17916   ac_cpp_err=yes
17917 fi
17918 if test -z "$ac_cpp_err"; then
17919   ac_cv_header_dbmalloc_h=yes
17920 else
17921   echo "$as_me: failed program was:" >&5
17922   cat conftest.$ac_ext >&5
17923   ac_cv_header_dbmalloc_h=no
17924 fi
17925 rm -f conftest.err conftest.$ac_ext
17926 fi
17927 echo "$as_me:17927: result: $ac_cv_header_dbmalloc_h" >&5
17928 echo "${ECHO_T}$ac_cv_header_dbmalloc_h" >&6
17929 if test $ac_cv_header_dbmalloc_h = yes; then
17930
17931 echo "$as_me:17931: checking for debug_malloc in -ldbmalloc" >&5
17932 echo $ECHO_N "checking for debug_malloc in -ldbmalloc... $ECHO_C" >&6
17933 if test "${ac_cv_lib_dbmalloc_debug_malloc+set}" = set; then
17934   echo $ECHO_N "(cached) $ECHO_C" >&6
17935 else
17936   ac_check_lib_save_LIBS=$LIBS
17937 LIBS="-ldbmalloc  $LIBS"
17938 cat >conftest.$ac_ext <<_ACEOF
17939 #line 17939 "configure"
17940 #include "confdefs.h"
17941
17942 /* Override any gcc2 internal prototype to avoid an error.  */
17943 #ifdef __cplusplus
17944 extern "C"
17945 #endif
17946 /* We use char because int might match the return type of a gcc2
17947    builtin and then its argument prototype would still apply.  */
17948 char debug_malloc ();
17949 int
17950 main ()
17951 {
17952 debug_malloc ();
17953   ;
17954   return 0;
17955 }
17956 _ACEOF
17957 rm -f conftest.$ac_objext conftest$ac_exeext
17958 if { (eval echo "$as_me:17958: \"$ac_link\"") >&5
17959   (eval $ac_link) 2>&5
17960   ac_status=$?
17961   echo "$as_me:17961: \$? = $ac_status" >&5
17962   (exit $ac_status); } &&
17963          { ac_try='test -s conftest$ac_exeext'
17964   { (eval echo "$as_me:17964: \"$ac_try\"") >&5
17965   (eval $ac_try) 2>&5
17966   ac_status=$?
17967   echo "$as_me:17967: \$? = $ac_status" >&5
17968   (exit $ac_status); }; }; then
17969   ac_cv_lib_dbmalloc_debug_malloc=yes
17970 else
17971   echo "$as_me: failed program was:" >&5
17972 cat conftest.$ac_ext >&5
17973 ac_cv_lib_dbmalloc_debug_malloc=no
17974 fi
17975 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17976 LIBS=$ac_check_lib_save_LIBS
17977 fi
17978 echo "$as_me:17978: result: $ac_cv_lib_dbmalloc_debug_malloc" >&5
17979 echo "${ECHO_T}$ac_cv_lib_dbmalloc_debug_malloc" >&6
17980 if test $ac_cv_lib_dbmalloc_debug_malloc = yes; then
17981   cat >>confdefs.h <<EOF
17982 #define HAVE_LIBDBMALLOC 1
17983 EOF
17984
17985   LIBS="-ldbmalloc $LIBS"
17986
17987 fi
17988
17989 fi
17990
17991 fi
17992
17993 echo "$as_me:17993: checking if you want to use valgrind for testing" >&5
17994 echo $ECHO_N "checking if you want to use valgrind for testing... $ECHO_C" >&6
17995
17996 # Check whether --with-valgrind or --without-valgrind was given.
17997 if test "${with_valgrind+set}" = set; then
17998   withval="$with_valgrind"
17999
18000 cat >>confdefs.h <<EOF
18001 #define USE_VALGRIND 1
18002 EOF
18003
18004         : ${with_cflags:=-g}
18005         : ${with_no_leaks:=yes}
18006          with_valgrind=yes
18007 else
18008   with_valgrind=
18009 fi;
18010 echo "$as_me:18010: result: ${with_valgrind:-no}" >&5
18011 echo "${ECHO_T}${with_valgrind:-no}" >&6
18012
18013 case .$with_cflags in
18014 (.*-g*)
18015         case .$CFLAGS in
18016         (.*-g*)
18017                 ;;
18018         (*)
18019
18020 cf_fix_cppflags=no
18021 cf_new_cflags=
18022 cf_new_cppflags=
18023 cf_new_extra_cppflags=
18024
18025 for cf_add_cflags in -g
18026 do
18027 case $cf_fix_cppflags in
18028 (no)
18029         case $cf_add_cflags in
18030         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
18031                 case $cf_add_cflags in
18032                 (-D*)
18033                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
18034
18035                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
18036                                 && test -z "${cf_tst_cflags}" \
18037                                 && cf_fix_cppflags=yes
18038
18039                         if test $cf_fix_cppflags = yes ; then
18040                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
18041                                 continue
18042                         elif test "${cf_tst_cflags}" = "\"'" ; then
18043                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
18044                                 continue
18045                         fi
18046                         ;;
18047                 esac
18048                 case "$CPPFLAGS" in
18049                 (*$cf_add_cflags)
18050                         ;;
18051                 (*)
18052                         case $cf_add_cflags in
18053                         (-D*)
18054                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
18055
18056 CPPFLAGS=`echo "$CPPFLAGS" | \
18057         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
18058                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
18059
18060                                 ;;
18061                         esac
18062                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
18063                         ;;
18064                 esac
18065                 ;;
18066         (*)
18067                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
18068                 ;;
18069         esac
18070         ;;
18071 (yes)
18072         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
18073
18074         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
18075
18076         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
18077                 && test -z "${cf_tst_cflags}" \
18078                 && cf_fix_cppflags=no
18079         ;;
18080 esac
18081 done
18082
18083 if test -n "$cf_new_cflags" ; then
18084
18085         CFLAGS="$CFLAGS $cf_new_cflags"
18086 fi
18087
18088 if test -n "$cf_new_cppflags" ; then
18089
18090         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
18091 fi
18092
18093 if test -n "$cf_new_extra_cppflags" ; then
18094
18095         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
18096 fi
18097
18098                 ;;
18099         esac
18100         ;;
18101 esac
18102
18103 echo "$as_me:18103: checking if you want to perform memory-leak testing" >&5
18104 echo $ECHO_N "checking if you want to perform memory-leak testing... $ECHO_C" >&6
18105
18106 # Check whether --enable-leaks or --disable-leaks was given.
18107 if test "${enable_leaks+set}" = set; then
18108   enableval="$enable_leaks"
18109   if test "x$enableval" = xno; then with_no_leaks=yes; else with_no_leaks=no; fi
18110 else
18111   : ${with_no_leaks:=no}
18112 fi;
18113 echo "$as_me:18113: result: $with_no_leaks" >&5
18114 echo "${ECHO_T}$with_no_leaks" >&6
18115
18116 if test "$with_no_leaks" = yes ; then
18117
18118 cat >>confdefs.h <<\EOF
18119 #define NO_LEAKS 1
18120 EOF
18121
18122 cat >>confdefs.h <<\EOF
18123 #define YY_NO_LEAKS 1
18124 EOF
18125
18126 fi
18127
18128 LD_RPATH_OPT=
18129 echo "$as_me:18129: checking for an rpath option" >&5
18130 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
18131 case $cf_cv_system_name in
18132 (irix*)
18133         if test "$GCC" = yes; then
18134                 LD_RPATH_OPT="-Wl,-rpath,"
18135         else
18136                 LD_RPATH_OPT="-rpath "
18137         fi
18138         ;;
18139 (linux*|gnu*|k*bsd*-gnu|freebsd*)
18140         LD_RPATH_OPT="-Wl,-rpath,"
18141         ;;
18142 (openbsd[2-9].*|mirbsd*)
18143         LD_RPATH_OPT="-Wl,-rpath,"
18144         ;;
18145 (dragonfly*)
18146         LD_RPATH_OPT="-rpath "
18147         ;;
18148 (netbsd*)
18149         LD_RPATH_OPT="-Wl,-rpath,"
18150         ;;
18151 (osf*|mls+*)
18152         LD_RPATH_OPT="-rpath "
18153         ;;
18154 (solaris2*)
18155         LD_RPATH_OPT="-R"
18156         ;;
18157 (*)
18158         ;;
18159 esac
18160 echo "$as_me:18160: result: $LD_RPATH_OPT" >&5
18161 echo "${ECHO_T}$LD_RPATH_OPT" >&6
18162
18163 case "x$LD_RPATH_OPT" in
18164 (x-R*)
18165         echo "$as_me:18165: checking if we need a space after rpath option" >&5
18166 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
18167         cf_save_LIBS="$LIBS"
18168
18169 cf_add_libs="${LD_RPATH_OPT}$libdir"
18170 # Filter out duplicates - this happens with badly-designed ".pc" files...
18171 for cf_add_1lib in $LIBS
18172 do
18173         for cf_add_2lib in $cf_add_libs
18174         do
18175                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
18176                 then
18177                         cf_add_1lib=
18178                         break
18179                 fi
18180         done
18181         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
18182 done
18183 LIBS="$cf_add_libs"
18184
18185         cat >conftest.$ac_ext <<_ACEOF
18186 #line 18186 "configure"
18187 #include "confdefs.h"
18188
18189 int
18190 main ()
18191 {
18192
18193   ;
18194   return 0;
18195 }
18196 _ACEOF
18197 rm -f conftest.$ac_objext conftest$ac_exeext
18198 if { (eval echo "$as_me:18198: \"$ac_link\"") >&5
18199   (eval $ac_link) 2>&5
18200   ac_status=$?
18201   echo "$as_me:18201: \$? = $ac_status" >&5
18202   (exit $ac_status); } &&
18203          { ac_try='test -s conftest$ac_exeext'
18204   { (eval echo "$as_me:18204: \"$ac_try\"") >&5
18205   (eval $ac_try) 2>&5
18206   ac_status=$?
18207   echo "$as_me:18207: \$? = $ac_status" >&5
18208   (exit $ac_status); }; }; then
18209   cf_rpath_space=no
18210 else
18211   echo "$as_me: failed program was:" >&5
18212 cat conftest.$ac_ext >&5
18213 cf_rpath_space=yes
18214 fi
18215 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18216         LIBS="$cf_save_LIBS"
18217         echo "$as_me:18217: result: $cf_rpath_space" >&5
18218 echo "${ECHO_T}$cf_rpath_space" >&6
18219         test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
18220         ;;
18221 esac
18222
18223 echo "$as_me:18223: checking if rpath-hack should be disabled" >&5
18224 echo $ECHO_N "checking if rpath-hack should be disabled... $ECHO_C" >&6
18225
18226 # Check whether --enable-rpath-hack or --disable-rpath-hack was given.
18227 if test "${enable_rpath_hack+set}" = set; then
18228   enableval="$enable_rpath_hack"
18229   test "$enableval" != no && enableval=yes
18230         if test "$enableval" != "yes" ; then
18231     cf_disable_rpath_hack=yes
18232         else
18233                 cf_disable_rpath_hack=no
18234         fi
18235 else
18236   enableval=yes
18237         cf_disable_rpath_hack=no
18238
18239 fi;
18240 echo "$as_me:18240: result: $cf_disable_rpath_hack" >&5
18241 echo "${ECHO_T}$cf_disable_rpath_hack" >&6
18242 if test "$cf_disable_rpath_hack" = no ; then
18243
18244 echo "$as_me:18244: checking for updated LDFLAGS" >&5
18245 echo $ECHO_N "checking for updated LDFLAGS... $ECHO_C" >&6
18246 if test -n "$LD_RPATH_OPT" ; then
18247         echo "$as_me:18247: result: maybe" >&5
18248 echo "${ECHO_T}maybe" >&6
18249
18250         for ac_prog in ldd
18251 do
18252   # Extract the first word of "$ac_prog", so it can be a program name with args.
18253 set dummy $ac_prog; ac_word=$2
18254 echo "$as_me:18254: checking for $ac_word" >&5
18255 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
18256 if test "${ac_cv_prog_cf_ldd_prog+set}" = set; then
18257   echo $ECHO_N "(cached) $ECHO_C" >&6
18258 else
18259   if test -n "$cf_ldd_prog"; then
18260   ac_cv_prog_cf_ldd_prog="$cf_ldd_prog" # Let the user override the test.
18261 else
18262   ac_save_IFS=$IFS; IFS=$ac_path_separator
18263 ac_dummy="$PATH"
18264 for ac_dir in $ac_dummy; do
18265   IFS=$ac_save_IFS
18266   test -z "$ac_dir" && ac_dir=.
18267   $as_executable_p "$ac_dir/$ac_word" || continue
18268 ac_cv_prog_cf_ldd_prog="$ac_prog"
18269 echo "$as_me:18269: found $ac_dir/$ac_word" >&5
18270 break
18271 done
18272
18273 fi
18274 fi
18275 cf_ldd_prog=$ac_cv_prog_cf_ldd_prog
18276 if test -n "$cf_ldd_prog"; then
18277   echo "$as_me:18277: result: $cf_ldd_prog" >&5
18278 echo "${ECHO_T}$cf_ldd_prog" >&6
18279 else
18280   echo "$as_me:18280: result: no" >&5
18281 echo "${ECHO_T}no" >&6
18282 fi
18283
18284   test -n "$cf_ldd_prog" && break
18285 done
18286 test -n "$cf_ldd_prog" || cf_ldd_prog="no"
18287
18288         cf_rpath_list="/usr/lib /lib"
18289         if test "$cf_ldd_prog" != no
18290         then
18291                 cf_rpath_oops=
18292
18293 cat >conftest.$ac_ext <<_ACEOF
18294 #line 18294 "configure"
18295 #include "confdefs.h"
18296 #include <stdio.h>
18297 int
18298 main ()
18299 {
18300 printf("Hello");
18301   ;
18302   return 0;
18303 }
18304 _ACEOF
18305 rm -f conftest.$ac_objext conftest$ac_exeext
18306 if { (eval echo "$as_me:18306: \"$ac_link\"") >&5
18307   (eval $ac_link) 2>&5
18308   ac_status=$?
18309   echo "$as_me:18309: \$? = $ac_status" >&5
18310   (exit $ac_status); } &&
18311          { ac_try='test -s conftest$ac_exeext'
18312   { (eval echo "$as_me:18312: \"$ac_try\"") >&5
18313   (eval $ac_try) 2>&5
18314   ac_status=$?
18315   echo "$as_me:18315: \$? = $ac_status" >&5
18316   (exit $ac_status); }; }; then
18317   cf_rpath_oops=`$cf_ldd_prog conftest$ac_exeext | fgrep ' not found' | sed -e 's% =>.*$%%' |sort | uniq`
18318                  cf_rpath_list=`$cf_ldd_prog conftest$ac_exeext | fgrep / | sed -e 's%^.*[      ]/%/%' -e 's%/[^/][^/]*$%%' |sort | uniq`
18319 else
18320   echo "$as_me: failed program was:" >&5
18321 cat conftest.$ac_ext >&5
18322 fi
18323 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18324
18325                 # If we passed the link-test, but get a "not found" on a given library,
18326                 # this could be due to inept reconfiguration of gcc to make it only
18327                 # partly honor /usr/local/lib (or whatever).  Sometimes this behavior
18328                 # is intentional, e.g., installing gcc in /usr/bin and suppressing the
18329                 # /usr/local libraries.
18330                 if test -n "$cf_rpath_oops"
18331                 then
18332                         for cf_rpath_src in $cf_rpath_oops
18333                         do
18334                                 for cf_rpath_dir in \
18335                                         /usr/local \
18336                                         /usr/pkg \
18337                                         /opt/sfw
18338                                 do
18339                                         if test -f $cf_rpath_dir/lib/$cf_rpath_src
18340                                         then
18341                                                 test -n "$verbose" && echo "    ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src" 1>&6
18342
18343 echo "${as_me:-configure}:18343: testing ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src ..." 1>&5
18344
18345                                                 LDFLAGS="$LDFLAGS -L$cf_rpath_dir/lib"
18346                                                 break
18347                                         fi
18348                                 done
18349                         done
18350                 fi
18351         fi
18352
18353         test -n "$verbose" && echo "    ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
18354
18355 echo "${as_me:-configure}:18355: testing ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
18356
18357 test -n "$verbose" && echo "    ...checking LDFLAGS $LDFLAGS" 1>&6
18358
18359 echo "${as_me:-configure}:18359: testing ...checking LDFLAGS $LDFLAGS ..." 1>&5
18360
18361 cf_rpath_dst=
18362 for cf_rpath_src in $LDFLAGS
18363 do
18364         case $cf_rpath_src in
18365         (-L*)
18366
18367                 # check if this refers to a directory which we will ignore
18368                 cf_rpath_skip=no
18369                 if test -n "$cf_rpath_list"
18370                 then
18371                         for cf_rpath_item in $cf_rpath_list
18372                         do
18373                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
18374                                 then
18375                                         cf_rpath_skip=yes
18376                                         break
18377                                 fi
18378                         done
18379                 fi
18380
18381                 if test "$cf_rpath_skip" = no
18382                 then
18383                         # transform the option
18384                         if test "$LD_RPATH_OPT" = "-R " ; then
18385                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
18386                         else
18387                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
18388                         fi
18389
18390                         # if we have not already added this, add it now
18391                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
18392                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
18393                         then
18394                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
18395
18396 echo "${as_me:-configure}:18396: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
18397
18398                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
18399                         fi
18400                 fi
18401                 ;;
18402         esac
18403         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
18404 done
18405 LDFLAGS=$cf_rpath_dst
18406
18407 test -n "$verbose" && echo "    ...checked LDFLAGS $LDFLAGS" 1>&6
18408
18409 echo "${as_me:-configure}:18409: testing ...checked LDFLAGS $LDFLAGS ..." 1>&5
18410
18411 test -n "$verbose" && echo "    ...checking LIBS $LIBS" 1>&6
18412
18413 echo "${as_me:-configure}:18413: testing ...checking LIBS $LIBS ..." 1>&5
18414
18415 cf_rpath_dst=
18416 for cf_rpath_src in $LIBS
18417 do
18418         case $cf_rpath_src in
18419         (-L*)
18420
18421                 # check if this refers to a directory which we will ignore
18422                 cf_rpath_skip=no
18423                 if test -n "$cf_rpath_list"
18424                 then
18425                         for cf_rpath_item in $cf_rpath_list
18426                         do
18427                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
18428                                 then
18429                                         cf_rpath_skip=yes
18430                                         break
18431                                 fi
18432                         done
18433                 fi
18434
18435                 if test "$cf_rpath_skip" = no
18436                 then
18437                         # transform the option
18438                         if test "$LD_RPATH_OPT" = "-R " ; then
18439                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
18440                         else
18441                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
18442                         fi
18443
18444                         # if we have not already added this, add it now
18445                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
18446                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
18447                         then
18448                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
18449
18450 echo "${as_me:-configure}:18450: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
18451
18452                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
18453                         fi
18454                 fi
18455                 ;;
18456         esac
18457         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
18458 done
18459 LIBS=$cf_rpath_dst
18460
18461 test -n "$verbose" && echo "    ...checked LIBS $LIBS" 1>&6
18462
18463 echo "${as_me:-configure}:18463: testing ...checked LIBS $LIBS ..." 1>&5
18464
18465         test -n "$verbose" && echo "    ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
18466
18467 echo "${as_me:-configure}:18467: testing ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
18468
18469 else
18470         echo "$as_me:18470: result: no" >&5
18471 echo "${ECHO_T}no" >&6
18472 fi
18473
18474 fi
18475
18476 TEST_ARGS="$LIBS"
18477 LIBS=
18478
18479 ac_config_files="$ac_config_files Makefile"
18480 ac_config_commands="$ac_config_commands default"
18481 cat >confcache <<\_ACEOF
18482 # This file is a shell script that caches the results of configure
18483 # tests run on this system so they can be shared between configure
18484 # scripts and configure runs, see configure's option --config-cache.
18485 # It is not useful on other systems.  If it contains results you don't
18486 # want to keep, you may remove or edit it.
18487 #
18488 # config.status only pays attention to the cache file if you give it
18489 # the --recheck option to rerun configure.
18490 #
18491 # `ac_cv_env_foo' variables (set or unset) will be overriden when
18492 # loading this file, other *unset* `ac_cv_foo' will be assigned the
18493 # following values.
18494
18495 _ACEOF
18496
18497 # The following way of writing the cache mishandles newlines in values,
18498 # but we know of no workaround that is simple, portable, and efficient.
18499 # So, don't put newlines in cache variables' values.
18500 # Ultrix sh set writes to stderr and can't be redirected directly,
18501 # and sets the high bit in the cache file unless we assign to the vars.
18502 {
18503   (set) 2>&1 |
18504     case `(ac_space=' '; set | grep ac_space) 2>&1` in
18505     *ac_space=\ *)
18506       # `set' does not quote correctly, so add quotes (double-quote
18507       # substitution turns \\\\ into \\, and sed turns \\ into \).
18508       sed -n \
18509         "s/'/'\\\\''/g;
18510           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
18511       ;;
18512     *)
18513       # `set' quotes correctly as required by POSIX, so do not add quotes.
18514       sed -n \
18515         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
18516       ;;
18517     esac;
18518 } |
18519   sed '
18520      t clear
18521      : clear
18522      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
18523      t end
18524      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
18525      : end' >>confcache
18526 if cmp -s $cache_file confcache; then :; else
18527   if test -w $cache_file; then
18528     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
18529     cat confcache >$cache_file
18530   else
18531     echo "not updating unwritable cache $cache_file"
18532   fi
18533 fi
18534 rm -f confcache
18535
18536 test "x$prefix" = xNONE && prefix=$ac_default_prefix
18537 # Let make expand exec_prefix.
18538 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
18539
18540 # VPATH may cause trouble with some makes, so we remove $(srcdir),
18541 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
18542 # trailing colons and then remove the whole line if VPATH becomes empty
18543 # (actually we leave an empty line to preserve line numbers).
18544 if test "x$srcdir" = x.; then
18545   ac_vpsub='/^[         ]*VPATH[        ]*=/{
18546 s/:*\$(srcdir):*/:/;
18547 s/:*\${srcdir}:*/:/;
18548 s/:*@srcdir@:*/:/;
18549 s/^\([^=]*=[    ]*\):*/\1/;
18550 s/:*$//;
18551 s/^[^=]*=[      ]*$//;
18552 }'
18553 fi
18554
18555 DEFS=-DHAVE_CONFIG_H
18556
18557 : ${CONFIG_STATUS=./config.status}
18558 ac_clean_files_save=$ac_clean_files
18559 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
18560 { echo "$as_me:18560: creating $CONFIG_STATUS" >&5
18561 echo "$as_me: creating $CONFIG_STATUS" >&6;}
18562 cat >$CONFIG_STATUS <<_ACEOF
18563 #! $SHELL
18564 # Generated automatically by configure.
18565 # Run this file to recreate the current configuration.
18566 # Compiler output produced by configure, useful for debugging
18567 # configure, is in config.log if it exists.
18568
18569 debug=false
18570 SHELL=\${CONFIG_SHELL-$SHELL}
18571 ac_cs_invocation="\$0 \$@"
18572
18573 _ACEOF
18574
18575 cat >>$CONFIG_STATUS <<\_ACEOF
18576 # Be Bourne compatible
18577 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
18578   emulate sh
18579   NULLCMD=:
18580 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
18581   set -o posix
18582 fi
18583
18584 # Name of the executable.
18585 as_me=`echo "$0" |sed 's,.*[\\/],,'`
18586
18587 if expr a : '\(a\)' >/dev/null 2>&1; then
18588   as_expr=expr
18589 else
18590   as_expr=false
18591 fi
18592
18593 rm -f conf$$ conf$$.exe conf$$.file
18594 echo >conf$$.file
18595 if ln -s conf$$.file conf$$ 2>/dev/null; then
18596   # We could just check for DJGPP; but this test a) works b) is more generic
18597   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
18598   if test -f conf$$.exe; then
18599     # Don't use ln at all; we don't have any links
18600     as_ln_s='cp -p'
18601   else
18602     as_ln_s='ln -s'
18603   fi
18604 elif ln conf$$.file conf$$ 2>/dev/null; then
18605   as_ln_s=ln
18606 else
18607   as_ln_s='cp -p'
18608 fi
18609 rm -f conf$$ conf$$.exe conf$$.file
18610
18611 as_executable_p="test -f"
18612
18613 # Support unset when possible.
18614 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
18615   as_unset=unset
18616 else
18617   as_unset=false
18618 fi
18619
18620 # NLS nuisances.
18621 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
18622 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
18623 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
18624 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
18625 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
18626 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
18627 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
18628 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
18629
18630 # IFS
18631 # We need space, tab and new line, in precisely that order.
18632 as_nl='
18633 '
18634 IFS="   $as_nl"
18635
18636 # CDPATH.
18637 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
18638
18639 exec 6>&1
18640
18641 _ACEOF
18642
18643 # Files that config.status was made for.
18644 if test -n "$ac_config_files"; then
18645   echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
18646 fi
18647
18648 if test -n "$ac_config_headers"; then
18649   echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
18650 fi
18651
18652 if test -n "$ac_config_links"; then
18653   echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
18654 fi
18655
18656 if test -n "$ac_config_commands"; then
18657   echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
18658 fi
18659
18660 cat >>$CONFIG_STATUS <<\EOF
18661
18662 ac_cs_usage="\
18663 \`$as_me' instantiates files from templates according to the
18664 current configuration.
18665
18666 Usage: $0 [OPTIONS] [FILE]...
18667
18668   -h, --help       print this help, then exit
18669   -V, --version    print version number, then exit
18670   -d, --debug      don't remove temporary files
18671       --recheck    update $as_me by reconfiguring in the same conditions
18672   --file=FILE[:TEMPLATE]
18673                    instantiate the configuration file FILE
18674   --header=FILE[:TEMPLATE]
18675                    instantiate the configuration header FILE
18676
18677 Configuration files:
18678 $config_files
18679
18680 Configuration headers:
18681 $config_headers
18682
18683 Configuration commands:
18684 $config_commands
18685
18686 Report bugs to <dickey@invisible-island.net>."
18687 EOF
18688
18689 cat >>$CONFIG_STATUS <<EOF
18690 ac_cs_version="\\
18691 config.status
18692 configured by $0, generated by GNU Autoconf 2.52.20150926,
18693   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
18694
18695 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
18696 Free Software Foundation, Inc.
18697 This config.status script is free software; the Free Software Foundation
18698 gives unlimited permission to copy, distribute and modify it."
18699 srcdir=$srcdir
18700 INSTALL="$INSTALL"
18701 EOF
18702
18703 cat >>$CONFIG_STATUS <<\EOF
18704 # If no file are specified by the user, then we need to provide default
18705 # value.  By we need to know if files were specified by the user.
18706 ac_need_defaults=:
18707 while test $# != 0
18708 do
18709   case $1 in
18710   --*=*)
18711     ac_option=`expr "x$1" : 'x\([^=]*\)='`
18712     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
18713     shift
18714     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
18715     shift
18716     ;;
18717   -*);;
18718   *) # This is not an option, so the user has probably given explicit
18719      # arguments.
18720      ac_need_defaults=false;;
18721   esac
18722
18723   case $1 in
18724   # Handling of the options.
18725 EOF
18726 cat >>$CONFIG_STATUS <<EOF
18727   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
18728     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
18729     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
18730 EOF
18731 cat >>$CONFIG_STATUS <<\EOF
18732   --version | --vers* | -V )
18733     echo "$ac_cs_version"; exit 0 ;;
18734   --he | --h)
18735     # Conflict between --help and --header
18736     { { echo "$as_me:18736: error: ambiguous option: $1
18737 Try \`$0 --help' for more information." >&5
18738 echo "$as_me: error: ambiguous option: $1
18739 Try \`$0 --help' for more information." >&2;}
18740    { (exit 1); exit 1; }; };;
18741   --help | --hel | -h )
18742     echo "$ac_cs_usage"; exit 0 ;;
18743   --debug | --d* | -d )
18744     debug=: ;;
18745   --file | --fil | --fi | --f )
18746     shift
18747     CONFIG_FILES="$CONFIG_FILES $1"
18748     ac_need_defaults=false;;
18749   --header | --heade | --head | --hea )
18750     shift
18751     CONFIG_HEADERS="$CONFIG_HEADERS $1"
18752     ac_need_defaults=false;;
18753
18754   # This is an error.
18755   -*) { { echo "$as_me:18755: error: unrecognized option: $1
18756 Try \`$0 --help' for more information." >&5
18757 echo "$as_me: error: unrecognized option: $1
18758 Try \`$0 --help' for more information." >&2;}
18759    { (exit 1); exit 1; }; } ;;
18760
18761   *) ac_config_targets="$ac_config_targets $1" ;;
18762
18763   esac
18764   shift
18765 done
18766
18767 exec 5>>config.log
18768 cat >&5 << _ACEOF
18769
18770 ## ----------------------- ##
18771 ## Running config.status.  ##
18772 ## ----------------------- ##
18773
18774 This file was extended by $as_me 2.52.20150926, executed with
18775   CONFIG_FILES    = $CONFIG_FILES
18776   CONFIG_HEADERS  = $CONFIG_HEADERS
18777   CONFIG_LINKS    = $CONFIG_LINKS
18778   CONFIG_COMMANDS = $CONFIG_COMMANDS
18779   > $ac_cs_invocation
18780 on `(hostname || uname -n) 2>/dev/null | sed 1q`
18781
18782 _ACEOF
18783 EOF
18784
18785 cat >>$CONFIG_STATUS <<EOF
18786 #
18787 # INIT-COMMANDS section.
18788 #
18789
18790 AWK="$AWK"
18791 ECHO_CC="$ECHO_CC"
18792 ECHO_LD="$ECHO_LD"
18793 SHOW_CC="$SHOW_LD"
18794
18795 EOF
18796
18797 cat >>$CONFIG_STATUS <<\EOF
18798 for ac_config_target in $ac_config_targets
18799 do
18800   case "$ac_config_target" in
18801   # Handling of arguments.
18802   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
18803   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
18804   "ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS ncurses_cfg.h:ncurses_tst.hin" ;;
18805   *) { { echo "$as_me:18805: error: invalid argument: $ac_config_target" >&5
18806 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
18807    { (exit 1); exit 1; }; };;
18808   esac
18809 done
18810
18811 # If the user did not use the arguments to specify the items to instantiate,
18812 # then the envvar interface is used.  Set only those that are not.
18813 # We use the long form for the default assignment because of an extremely
18814 # bizarre bug on SunOS 4.1.3.
18815 if $ac_need_defaults; then
18816   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
18817   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
18818   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
18819 fi
18820
18821 # Create a temporary directory, and hook for its removal unless debugging.
18822 $debug ||
18823 {
18824   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
18825   trap '{ (exit 1); exit 1; }' 1 2 13 15
18826 }
18827
18828 # Create a (secure) tmp directory for tmp files.
18829 : ${TMPDIR=/tmp}
18830 {
18831   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
18832   test -n "$tmp" && test -d "$tmp"
18833 }  ||
18834 {
18835   tmp=$TMPDIR/cs$$-$RANDOM
18836   (umask 077 && mkdir $tmp)
18837 } ||
18838 {
18839    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
18840    { (exit 1); exit 1; }
18841 }
18842
18843 EOF
18844
18845 cat >>$CONFIG_STATUS <<EOF
18846
18847 #
18848 # CONFIG_FILES section.
18849 #
18850
18851 # No need to generate the scripts if there are no CONFIG_FILES.
18852 # This happens for instance when ./config.status config.h
18853 if test -n "\$CONFIG_FILES"; then
18854   # Protect against being on the right side of a sed subst in config.status.
18855   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
18856    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
18857 s,@SHELL@,$SHELL,;t t
18858 s,@exec_prefix@,$exec_prefix,;t t
18859 s,@prefix@,$prefix,;t t
18860 s,@program_transform_name@,$program_transform_name,;t t
18861 s,@bindir@,$bindir,;t t
18862 s,@sbindir@,$sbindir,;t t
18863 s,@libexecdir@,$libexecdir,;t t
18864 s,@datarootdir@,$datarootdir,;t t
18865 s,@datadir@,$datadir,;t t
18866 s,@sysconfdir@,$sysconfdir,;t t
18867 s,@sharedstatedir@,$sharedstatedir,;t t
18868 s,@localstatedir@,$localstatedir,;t t
18869 s,@libdir@,$libdir,;t t
18870 s,@includedir@,$includedir,;t t
18871 s,@oldincludedir@,$oldincludedir,;t t
18872 s,@infodir@,$infodir,;t t
18873 s,@mandir@,$mandir,;t t
18874 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
18875 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
18876 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
18877 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
18878 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
18879 s,@build_alias@,$build_alias,;t t
18880 s,@host_alias@,$host_alias,;t t
18881 s,@target_alias@,$target_alias,;t t
18882 s,@ECHO_C@,$ECHO_C,;t t
18883 s,@ECHO_N@,$ECHO_N,;t t
18884 s,@ECHO_T@,$ECHO_T,;t t
18885 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
18886 s,@DEFS@,$DEFS,;t t
18887 s,@LIBS@,$LIBS,;t t
18888 s,@build@,$build,;t t
18889 s,@build_cpu@,$build_cpu,;t t
18890 s,@build_vendor@,$build_vendor,;t t
18891 s,@build_os@,$build_os,;t t
18892 s,@host@,$host,;t t
18893 s,@host_cpu@,$host_cpu,;t t
18894 s,@host_vendor@,$host_vendor,;t t
18895 s,@host_os@,$host_os,;t t
18896 s,@SET_MAKE@,$SET_MAKE,;t t
18897 s,@CC@,$CC,;t t
18898 s,@CFLAGS@,$CFLAGS,;t t
18899 s,@LDFLAGS@,$LDFLAGS,;t t
18900 s,@CPPFLAGS@,$CPPFLAGS,;t t
18901 s,@ac_ct_CC@,$ac_ct_CC,;t t
18902 s,@EXEEXT@,$EXEEXT,;t t
18903 s,@OBJEXT@,$OBJEXT,;t t
18904 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
18905 s,@CPP@,$CPP,;t t
18906 s,@AWK@,$AWK,;t t
18907 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
18908 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
18909 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
18910 s,@LINT@,$LINT,;t t
18911 s,@LINT_OPTS@,$LINT_OPTS,;t t
18912 s,@CTAGS@,$CTAGS,;t t
18913 s,@ETAGS@,$ETAGS,;t t
18914 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
18915 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
18916 s,@MATH_LIB@,$MATH_LIB,;t t
18917 s,@top_builddir@,$top_builddir,;t t
18918 s,@CC_G_OPT@,$CC_G_OPT,;t t
18919 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
18920 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
18921 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
18922 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
18923 s,@LD@,$LD,;t t
18924 s,@LDFLAGS_SHARED@,$LDFLAGS_SHARED,;t t
18925 s,@LDFLAGS_STATIC@,$LDFLAGS_STATIC,;t t
18926 s,@LD_MODEL@,$LD_MODEL,;t t
18927 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
18928 s,@LIBTOOL@,$LIBTOOL,;t t
18929 s,@LIBTOOL_OPTS@,$LIBTOOL_OPTS,;t t
18930 s,@LIB_CLEAN@,$LIB_CLEAN,;t t
18931 s,@LIB_COMPILE@,$LIB_COMPILE,;t t
18932 s,@LIB_LINK@,$LIB_LINK,;t t
18933 s,@LINK_TESTS@,$LINK_TESTS,;t t
18934 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
18935 s,@PACKAGE@,$PACKAGE,;t t
18936 s,@PTHREAD@,$PTHREAD,;t t
18937 s,@TEST_ARGS@,$TEST_ARGS,;t t
18938 s,@TEST_DEPS@,$TEST_DEPS,;t t
18939 s,@TEST_LIBS@,$TEST_LIBS,;t t
18940 s,@TINFO_LDFLAGS@,$TINFO_LDFLAGS,;t t
18941 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
18942 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
18943 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
18944 s,@includesubdir@,$includesubdir,;t t
18945 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
18946 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
18947 s,@ECHO_LT@,$ECHO_LT,;t t
18948 s,@ECHO_LD@,$ECHO_LD,;t t
18949 s,@RULE_CC@,$RULE_CC,;t t
18950 s,@SHOW_CC@,$SHOW_CC,;t t
18951 s,@ECHO_CC@,$ECHO_CC,;t t
18952 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
18953 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
18954 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
18955 s,@X_CFLAGS@,$X_CFLAGS,;t t
18956 s,@X_PRE_LIBS@,$X_PRE_LIBS,;t t
18957 s,@X_LIBS@,$X_LIBS,;t t
18958 s,@X_EXTRA_LIBS@,$X_EXTRA_LIBS,;t t
18959 s,@XCURSES_CONFIG@,$XCURSES_CONFIG,;t t
18960 s,@ac_ct_XCURSES_CONFIG@,$ac_ct_XCURSES_CONFIG,;t t
18961 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
18962 s,@cf_ldd_prog@,$cf_ldd_prog,;t t
18963 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
18964 CEOF
18965
18966 EOF
18967
18968   cat >>$CONFIG_STATUS <<\EOF
18969   # Split the substitutions into bite-sized pieces for seds with
18970   # small command number limits, like on Digital OSF/1 and HP-UX.
18971   ac_max_sed_lines=48
18972   ac_sed_frag=1 # Number of current file.
18973   ac_beg=1 # First line for current file.
18974   ac_end=$ac_max_sed_lines # Line after last line for current file.
18975   ac_more_lines=:
18976   ac_sed_cmds=
18977   while $ac_more_lines; do
18978     if test $ac_beg -gt 1; then
18979       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
18980     else
18981       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
18982     fi
18983     if test ! -s $tmp/subs.frag; then
18984       ac_more_lines=false
18985     else
18986       # The purpose of the label and of the branching condition is to
18987       # speed up the sed processing (if there are no `@' at all, there
18988       # is no need to browse any of the substitutions).
18989       # These are the two extra sed commands mentioned above.
18990       (echo ':t
18991   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
18992       # It is possible to make a multiline substitution using escaped newlines.
18993       # Ensure that we do not split the substitution between script fragments.
18994       ac_BEG=$ac_end
18995       ac_END=`expr $ac_end + $ac_max_sed_lines`
18996       sed "1,${ac_BEG}d; ${ac_END}p; q" $tmp/subs.sed >$tmp/subs.next
18997       if test -s $tmp/subs.next; then
18998         grep '^s,@[^@,][^@,]*@,.*\\$' $tmp/subs.next >$tmp/subs.edit
18999         if test ! -s $tmp/subs.edit; then
19000           grep "^s,@[^@,][^@,]*@,.*,;t t$" $tmp/subs.next >$tmp/subs.edit
19001           if test ! -s $tmp/subs.edit; then
19002             if test $ac_beg -gt 1; then
19003               ac_end=`expr $ac_end - 1`
19004               continue
19005             fi
19006           fi
19007         fi
19008       fi
19009
19010       if test -z "$ac_sed_cmds"; then
19011         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
19012       else
19013         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
19014       fi
19015       ac_sed_frag=`expr $ac_sed_frag + 1`
19016       ac_beg=$ac_end
19017       ac_end=`expr $ac_end + $ac_max_sed_lines`
19018     fi
19019   done
19020   if test -z "$ac_sed_cmds"; then
19021     ac_sed_cmds=cat
19022   fi
19023 fi # test -n "$CONFIG_FILES"
19024
19025 EOF
19026 cat >>$CONFIG_STATUS <<\EOF
19027 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
19028   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
19029   case $ac_file in
19030   - | *:- | *:-:* ) # input from stdin
19031         cat >$tmp/stdin
19032         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
19033         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
19034   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
19035         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
19036   * )   ac_file_in=$ac_file.in ;;
19037   esac
19038
19039   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
19040   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
19041          X"$ac_file" : 'X\(//\)[^/]' \| \
19042          X"$ac_file" : 'X\(//\)$' \| \
19043          X"$ac_file" : 'X\(/\)' \| \
19044          .     : '\(.\)' 2>/dev/null ||
19045 echo X"$ac_file" |
19046     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
19047           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
19048           /^X\(\/\/\)$/{ s//\1/; q; }
19049           /^X\(\/\).*/{ s//\1/; q; }
19050           s/.*/./; q'`
19051   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
19052     { case "$ac_dir" in
19053   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
19054   *)                      as_incr_dir=.;;
19055 esac
19056 as_dummy="$ac_dir"
19057 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
19058   case $as_mkdir_dir in
19059     # Skip DOS drivespec
19060     ?:) as_incr_dir=$as_mkdir_dir ;;
19061     *)
19062       as_incr_dir=$as_incr_dir/$as_mkdir_dir
19063       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
19064     ;;
19065   esac
19066 done; }
19067
19068     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
19069     # A "../" for each directory in $ac_dir_suffix.
19070     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
19071   else
19072     ac_dir_suffix= ac_dots=
19073   fi
19074
19075   case $srcdir in
19076   .)  ac_srcdir=.
19077       if test -z "$ac_dots"; then
19078          ac_top_srcdir=.
19079       else
19080          ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'`
19081       fi ;;
19082   [\\/]* | ?:[\\/]* )
19083       ac_srcdir=$srcdir$ac_dir_suffix;
19084       ac_top_srcdir=$srcdir ;;
19085   *) # Relative path.
19086     ac_srcdir=$ac_dots$srcdir$ac_dir_suffix
19087     ac_top_srcdir=$ac_dots$srcdir ;;
19088   esac
19089
19090   case $INSTALL in
19091   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
19092   *) ac_INSTALL=$ac_dots$INSTALL ;;
19093   esac
19094
19095   if test x"$ac_file" != x-; then
19096     { echo "$as_me:19096: creating $ac_file" >&5
19097 echo "$as_me: creating $ac_file" >&6;}
19098     rm -f "$ac_file"
19099   fi
19100   # Let's still pretend it is `configure' which instantiates (i.e., don't
19101   # use $as_me), people would be surprised to read:
19102   #    /* config.h.  Generated automatically by config.status.  */
19103   configure_input="Generated automatically from `echo $ac_file_in |
19104                                                  sed 's,.*/,,'` by configure."
19105
19106   # First look for the input files in the build tree, otherwise in the
19107   # src tree.
19108   ac_file_inputs=`IFS=:
19109     for f in $ac_file_in; do
19110       case $f in
19111       -) echo $tmp/stdin ;;
19112       [\\/$]*)
19113          # Absolute (can't be DOS-style, as IFS=:)
19114          test -f "$f" || { { echo "$as_me:19114: error: cannot find input file: $f" >&5
19115 echo "$as_me: error: cannot find input file: $f" >&2;}
19116    { (exit 1); exit 1; }; }
19117          echo $f;;
19118       *) # Relative
19119          if test -f "$f"; then
19120            # Build tree
19121            echo $f
19122          elif test -f "$srcdir/$f"; then
19123            # Source tree
19124            echo $srcdir/$f
19125          else
19126            # /dev/null tree
19127            { { echo "$as_me:19127: error: cannot find input file: $f" >&5
19128 echo "$as_me: error: cannot find input file: $f" >&2;}
19129    { (exit 1); exit 1; }; }
19130          fi;;
19131       esac
19132     done` || { (exit 1); exit 1; }
19133 EOF
19134 cat >>$CONFIG_STATUS <<\EOF
19135   ac_warn_datarootdir=no
19136   if test x"$ac_file" != x-; then
19137     for ac_item in $ac_file_inputs
19138     do
19139       ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' $ac_item`
19140       if test -n "$ac_seen"; then
19141         ac_used=`grep '@datarootdir@' $ac_item`
19142         if test -z "$ac_used"; then
19143           { echo "$as_me:19143: WARNING: datarootdir was used implicitly but not set:
19144 $ac_seen" >&5
19145 echo "$as_me: WARNING: datarootdir was used implicitly but not set:
19146 $ac_seen" >&2;}
19147           ac_warn_datarootdir=yes
19148         fi
19149       fi
19150       ac_seen=`grep '${datarootdir}' $ac_item`
19151       if test -n "$ac_seen"; then
19152         { echo "$as_me:19152: WARNING: datarootdir was used explicitly but not set:
19153 $ac_seen" >&5
19154 echo "$as_me: WARNING: datarootdir was used explicitly but not set:
19155 $ac_seen" >&2;}
19156         ac_warn_datarootdir=yes
19157       fi
19158     done
19159   fi
19160
19161 if test "x$ac_warn_datarootdir" = xyes; then
19162   ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
19163 fi
19164
19165 EOF
19166 cat >>$CONFIG_STATUS <<EOF
19167   sed "$ac_vpsub
19168 $extrasub
19169 EOF
19170 cat >>$CONFIG_STATUS <<\EOF
19171 :t
19172 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
19173 s,@configure_input@,$configure_input,;t t
19174 s,@srcdir@,$ac_srcdir,;t t
19175 s,@top_srcdir@,$ac_top_srcdir,;t t
19176 s,@INSTALL@,$ac_INSTALL,;t t
19177 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
19178   rm -f $tmp/stdin
19179   if test x"$ac_file" != x-; then
19180     cp $tmp/out $ac_file
19181
19182     for ac_name in prefix exec_prefix datarootdir
19183     do
19184         ac_seen=`fgrep -n '${'$ac_name'[:=].*}' $ac_file`
19185         if test -n "$ac_seen"; then
19186             ac_init=`egrep '[   ]*'$ac_name'[   ]*=' $ac_file`
19187             if test -z "$ac_init"; then
19188               ac_seen=`echo "$ac_seen" |sed -e 's,^,'$ac_file':,'`
19189               { echo "$as_me:19189: WARNING: Variable $ac_name is used but was not set:
19190 $ac_seen" >&5
19191 echo "$as_me: WARNING: Variable $ac_name is used but was not set:
19192 $ac_seen" >&2;}
19193             fi
19194         fi
19195     done
19196     egrep -n '@[a-z_][a-z_0-9]+@' $ac_file >$tmp/out
19197     egrep -n '@[A-Z_][A-Z_0-9]+@' $ac_file >>$tmp/out
19198     if test -s $tmp/out; then
19199       ac_seen=`sed -e 's,^,'$ac_file':,' < $tmp/out`
19200       { echo "$as_me:19200: WARNING: Some variables may not be substituted:
19201 $ac_seen" >&5
19202 echo "$as_me: WARNING: Some variables may not be substituted:
19203 $ac_seen" >&2;}
19204     fi
19205   else
19206     cat $tmp/out
19207   fi
19208   rm -f $tmp/out
19209
19210 done
19211 EOF
19212 cat >>$CONFIG_STATUS <<\EOF
19213
19214 #
19215 # CONFIG_HEADER section.
19216 #
19217
19218 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
19219 # NAME is the cpp macro being defined and VALUE is the value it is being given.
19220 #
19221 # ac_d sets the value in "#define NAME VALUE" lines.
19222 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
19223 ac_dB='[        ].*$,\1#\2'
19224 ac_dC=' '
19225 ac_dD=',;t'
19226 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
19227 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
19228 ac_iB='\([      ]\),\1#\2define\3'
19229 ac_iC=' '
19230 ac_iD='\4,;t'
19231 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
19232 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
19233 ac_uB='$,\1#\2define\3'
19234 ac_uC=' '
19235 ac_uD=',;t'
19236
19237 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
19238   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
19239   case $ac_file in
19240   - | *:- | *:-:* ) # input from stdin
19241         cat >$tmp/stdin
19242         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
19243         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
19244   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
19245         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
19246   * )   ac_file_in=$ac_file.in ;;
19247   esac
19248
19249   test x"$ac_file" != x- && { echo "$as_me:19249: creating $ac_file" >&5
19250 echo "$as_me: creating $ac_file" >&6;}
19251
19252   # First look for the input files in the build tree, otherwise in the
19253   # src tree.
19254   ac_file_inputs=`IFS=:
19255     for f in $ac_file_in; do
19256       case $f in
19257       -) echo $tmp/stdin ;;
19258       [\\/$]*)
19259          # Absolute (can't be DOS-style, as IFS=:)
19260          test -f "$f" || { { echo "$as_me:19260: error: cannot find input file: $f" >&5
19261 echo "$as_me: error: cannot find input file: $f" >&2;}
19262    { (exit 1); exit 1; }; }
19263          echo $f;;
19264       *) # Relative
19265          if test -f "$f"; then
19266            # Build tree
19267            echo $f
19268          elif test -f "$srcdir/$f"; then
19269            # Source tree
19270            echo $srcdir/$f
19271          else
19272            # /dev/null tree
19273            { { echo "$as_me:19273: error: cannot find input file: $f" >&5
19274 echo "$as_me: error: cannot find input file: $f" >&2;}
19275    { (exit 1); exit 1; }; }
19276          fi;;
19277       esac
19278     done` || { (exit 1); exit 1; }
19279   # Remove the trailing spaces.
19280   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
19281
19282 EOF
19283
19284 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
19285 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
19286 # be either 'cat' or 'sort'.
19287 cat confdefs.h | uniq >conftest.vals
19288
19289 # Break up conftest.vals because some shells have a limit on
19290 # the size of here documents, and old seds have small limits too.
19291
19292 rm -f conftest.tail
19293 echo '  rm -f conftest.frag' >> $CONFIG_STATUS
19294 while grep . conftest.vals >/dev/null
19295 do
19296   # Write chunks of a limited-size here document to conftest.frag.
19297   echo '  cat >> conftest.frag <<CEOF' >> $CONFIG_STATUS
19298   sed ${ac_max_here_lines}q conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> $CONFIG_STATUS
19299   echo 'CEOF' >> $CONFIG_STATUS
19300   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
19301   rm -f conftest.vals
19302   mv conftest.tail conftest.vals
19303 done
19304 rm -f conftest.vals
19305
19306 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
19307 # marker @DEFS@.
19308 echo '  cat >> conftest.edit <<CEOF
19309 /@DEFS@/r conftest.frag
19310 /@DEFS@/d
19311 CEOF
19312 sed -f conftest.edit $tmp/in > $tmp/out
19313 rm -f $tmp/in
19314 mv $tmp/out $tmp/in
19315 rm -f conftest.edit conftest.frag
19316 ' >> $CONFIG_STATUS
19317
19318 cat >>$CONFIG_STATUS <<\EOF
19319   # Let's still pretend it is `configure' which instantiates (i.e., don't
19320   # use $as_me), people would be surprised to read:
19321   #    /* config.h.  Generated automatically by config.status.  */
19322   if test x"$ac_file" = x-; then
19323     echo "/* Generated automatically by configure.  */" >$tmp/config.h
19324   else
19325     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
19326   fi
19327   cat $tmp/in >>$tmp/config.h
19328   rm -f $tmp/in
19329   if test x"$ac_file" != x-; then
19330     if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
19331       { echo "$as_me:19331: $ac_file is unchanged" >&5
19332 echo "$as_me: $ac_file is unchanged" >&6;}
19333     else
19334       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
19335          X"$ac_file" : 'X\(//\)[^/]' \| \
19336          X"$ac_file" : 'X\(//\)$' \| \
19337          X"$ac_file" : 'X\(/\)' \| \
19338          .     : '\(.\)' 2>/dev/null ||
19339 echo X"$ac_file" |
19340     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
19341           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
19342           /^X\(\/\/\)$/{ s//\1/; q; }
19343           /^X\(\/\).*/{ s//\1/; q; }
19344           s/.*/./; q'`
19345       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
19346         { case "$ac_dir" in
19347   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
19348   *)                      as_incr_dir=.;;
19349 esac
19350 as_dummy="$ac_dir"
19351 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
19352   case $as_mkdir_dir in
19353     # Skip DOS drivespec
19354     ?:) as_incr_dir=$as_mkdir_dir ;;
19355     *)
19356       as_incr_dir=$as_incr_dir/$as_mkdir_dir
19357       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
19358     ;;
19359   esac
19360 done; }
19361
19362       fi
19363       rm -f $ac_file
19364       mv $tmp/config.h $ac_file
19365     fi
19366   else
19367     cat $tmp/config.h
19368     rm -f $tmp/config.h
19369   fi
19370 done
19371 EOF
19372 cat >>$CONFIG_STATUS <<\EOF
19373 #
19374 # CONFIG_COMMANDS section.
19375 #
19376 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
19377   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
19378   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
19379
19380   case $ac_dest in
19381     default )
19382
19383 for cf_dir in .
19384 do
19385         if test ! -d $srcdir/$cf_dir; then
19386                 continue
19387         elif test -f $srcdir/$cf_dir/programs; then
19388                 $AWK -f $srcdir/mk-test.awk INSTALL=yes ECHO_LINK="$ECHO_LD" $srcdir/$cf_dir/programs >>$cf_dir/Makefile
19389         fi
19390 done
19391
19392         cat >>Makefile <<TEST_EOF
19393
19394 # These rules are generated so we do not rely on suffix rules, which do not
19395 # work consistently for different make-programs (the '\$(MODEL)/' confuses
19396 # some, and the '\$x' confuses others).
19397 TEST_EOF
19398
19399 LIST=`sed -e 's/[       ].*//' -e '/^[#@]/d' $srcdir/modules`
19400 for N in $LIST
19401 do
19402         cat >>Makefile <<TEST_EOF
19403
19404 \$(MODEL)/$N.o : \$(srcdir)/$N.c \\
19405         \$(srcdir)/test.priv.h \\
19406         ncurses_cfg.h
19407         $SHOW_CC
19408         $ECHO_CC\$(CC) -c \$(CFLAGS_DEFAULT) \$(srcdir)/$N.c
19409 TEST_EOF
19410 done
19411
19412 if test -f ../config.guess && test -f ../config.sub
19413 then
19414         cat >>Makefile <<TEST_EOF
19415
19416 # if we used CF_INHERIT for getting these files, we can remove them
19417 distclean::
19418         rm -f config.guess config.sub
19419 TEST_EOF
19420 fi
19421  ;;
19422   esac
19423 done
19424 EOF
19425
19426 cat >>$CONFIG_STATUS <<\EOF
19427
19428 { (exit 0); exit 0; }
19429 EOF
19430 chmod +x $CONFIG_STATUS
19431 ac_clean_files=$ac_clean_files_save
19432
19433 # configure is writing to config.log, and then calls config.status.
19434 # config.status does its own redirection, appending to config.log.
19435 # Unfortunately, on DOS this fails, as config.log is still kept open
19436 # by configure, so config.status won't be able to write to it; its
19437 # output is simply discarded.  So we exec the FD to /dev/null,
19438 # effectively closing config.log, so it can be properly (re)opened and
19439 # appended to by config.status.  When coming back to configure, we
19440 # need to make the FD available again.
19441 if test "$no_create" != yes; then
19442   ac_cs_success=:
19443   exec 5>/dev/null
19444   $SHELL $CONFIG_STATUS || ac_cs_success=false
19445   exec 5>>config.log
19446   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
19447   # would make configure fail if this is the last instruction.
19448   $ac_cs_success || { (exit 1); exit 1; }
19449 fi
19450