]> ncurses.scripts.mit.edu Git - ncurses.git/blob - test/configure
ncurses 6.0 - patch 20160116
[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 Packages:
650   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
651   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
652
653 Optional Features:
654   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
655   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
656
657 General Options:
658   --with-pkg-config{=path} enable/disable use of pkg-config
659   --disable-echo          do not display "compiling" commands
660 Curses Version-dependent Options:
661   --with-ncurses-wrap-prefix naming-prefix for ncurses wrapped-variables
662   --disable-widec         disable checks for wide-character functions
663   --with-curses-dir=DIR   directory in which (n)curses is installed
664   --with-screen=XXX       use specified curses-libraries
665   --with-ncursesw         use wide ncurses-libraries
666   --with-ncurses          use ncurses-libraries
667   --with-pdcurses         compile/link with pdcurses X11 library
668   --with-curses-colr      compile/link with HPUX 10.x color-curses
669   --with-curses-5lib      compile/link with SunOS 5lib curses
670   --with-Xaw3d            link with Xaw 3d library
671   --with-Xaw3dxft         link with Xaw 3d xft library
672   --with-neXtaw           link with neXT Athena library
673   --with-XawPlus          link with Athena-Plus library
674   --with-x                use the X Window System
675 Testing/development Options:
676   --enable-warnings       test: turn on gcc compiler warnings
677   --with-dmalloc          test: use Gray Watson's dmalloc library
678   --with-dbmalloc         test: use Conor Cahill's dbmalloc library
679   --with-valgrind         test: use valgrind
680   --disable-leaks         test: free permanent memory, analyze leaks
681   --disable-rpath-hack    don't add rpath options for additional libraries
682
683 Some influential environment variables:
684   CC          C compiler command
685   CFLAGS      C compiler flags
686   LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
687               nonstandard directory <lib dir>
688   CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
689               headers in a nonstandard directory <include dir>
690   CPP         C preprocessor
691
692 Use these variables to override the choices made by `configure' or to help
693 it to find libraries and programs with nonstandard names/locations.
694
695 EOF
696 fi
697
698 if test "$ac_init_help" = "recursive"; then
699   # If there are subdirs, report their specific --help.
700   ac_popdir=`pwd`
701   for ac_subdir in : $ac_subdirs_all; do test "x$ac_subdir" = x: && continue
702     cd $ac_subdir
703     # A "../" for each directory in /$ac_subdir.
704     ac_dots=`echo $ac_subdir |
705              sed 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g'`
706
707     case $srcdir in
708     .) # No --srcdir option.  We are building in place.
709       ac_sub_srcdir=$srcdir ;;
710     [\\/]* | ?:[\\/]* ) # Absolute path.
711       ac_sub_srcdir=$srcdir/$ac_subdir ;;
712     *) # Relative path.
713       ac_sub_srcdir=$ac_dots$srcdir/$ac_subdir ;;
714     esac
715
716     # Check for guested configure; otherwise get Cygnus style configure.
717     if test -f $ac_sub_srcdir/configure.gnu; then
718       echo
719       $SHELL $ac_sub_srcdir/configure.gnu  --help=recursive
720     elif test -f $ac_sub_srcdir/configure; then
721       echo
722       $SHELL $ac_sub_srcdir/configure  --help=recursive
723     elif test -f $ac_sub_srcdir/configure.ac ||
724            test -f $ac_sub_srcdir/configure.in; then
725       echo
726       $ac_configure --help
727     else
728       echo "$as_me: WARNING: no configuration information is in $ac_subdir" >&2
729     fi
730     cd $ac_popdir
731   done
732 fi
733
734 test -n "$ac_init_help" && exit 0
735 if $ac_init_version; then
736   cat <<\EOF
737
738 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
739 Free Software Foundation, Inc.
740 This configure script is free software; the Free Software Foundation
741 gives unlimited permission to copy, distribute and modify it.
742 EOF
743   exit 0
744 fi
745 exec 5>config.log
746 cat >&5 <<EOF
747 This file contains any messages produced by compilers while
748 running configure, to aid debugging if configure makes a mistake.
749
750 It was created by $as_me, which was
751 generated by GNU Autoconf 2.52.20150926.  Invocation command line was
752
753   $ $0 $@
754
755 EOF
756 {
757 cat <<_ASUNAME
758 ## ---------- ##
759 ## Platform.  ##
760 ## ---------- ##
761
762 hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
763 uname -m = `(uname -m) 2>/dev/null || echo unknown`
764 uname -r = `(uname -r) 2>/dev/null || echo unknown`
765 uname -s = `(uname -s) 2>/dev/null || echo unknown`
766 uname -v = `(uname -v) 2>/dev/null || echo unknown`
767
768 /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
769 /bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
770
771 /bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
772 /usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
773 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
774 hostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
775 /bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
776 /usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
777 /bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
778
779 PATH = $PATH
780
781 _ASUNAME
782 } >&5
783
784 cat >&5 <<EOF
785 ## ------------ ##
786 ## Core tests.  ##
787 ## ------------ ##
788
789 EOF
790
791 # Keep a trace of the command line.
792 # Strip out --no-create and --no-recursion so they do not pile up.
793 # Also quote any args containing shell meta-characters.
794 ac_configure_args=
795 ac_sep=
796 for ac_arg
797 do
798   case $ac_arg in
799   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
800   | --no-cr | --no-c) ;;
801   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
802   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
803   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
804     ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"`
805     ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
806     ac_sep=" " ;;
807   *) ac_configure_args="$ac_configure_args$ac_sep$ac_arg"
808      ac_sep=" " ;;
809   esac
810   # Get rid of the leading space.
811 done
812
813 # When interrupted or exit'd, cleanup temporary files, and complete
814 # config.log.  We remove comments because anyway the quotes in there
815 # would cause problems or look ugly.
816 trap 'exit_status=$?
817   # Save into config.log some information that might help in debugging.
818   echo >&5
819   echo "## ----------------- ##" >&5
820   echo "## Cache variables.  ##" >&5
821   echo "## ----------------- ##" >&5
822   echo >&5
823   # The following way of writing the cache mishandles newlines in values,
824 {
825   (set) 2>&1 |
826     case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
827     *ac_space=\ *)
828       sed -n \
829         "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
830           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
831       ;;
832     *)
833       sed -n \
834         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
835       ;;
836     esac;
837 } >&5
838   sed "/^$/d" confdefs.h >conftest.log
839   if test -s conftest.log; then
840     echo >&5
841     echo "## ------------ ##" >&5
842     echo "## confdefs.h.  ##" >&5
843     echo "## ------------ ##" >&5
844     echo >&5
845     cat conftest.log >&5
846   fi
847   (echo; echo) >&5
848   test "$ac_signal" != 0 &&
849     echo "$as_me: caught signal $ac_signal" >&5
850   echo "$as_me: exit $exit_status" >&5
851   rm -rf conftest* confdefs* core core.* *.core conf$$* $ac_clean_files &&
852     exit $exit_status
853      ' 0
854 for ac_signal in 1 2 13 15; do
855   trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
856 done
857 ac_signal=0
858
859 # confdefs.h avoids OS command line length limits that DEFS can exceed.
860 rm -rf conftest* confdefs.h
861 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
862 echo >confdefs.h
863
864 # Let the site file select an alternate cache file if it wants to.
865 # Prefer explicitly selected file to automatically selected ones.
866 if test -z "$CONFIG_SITE"; then
867   if test "x$prefix" != xNONE; then
868     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
869   else
870     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
871   fi
872 fi
873 for ac_site_file in $CONFIG_SITE; do
874   if test -r "$ac_site_file"; then
875     { echo "$as_me:875: loading site script $ac_site_file" >&5
876 echo "$as_me: loading site script $ac_site_file" >&6;}
877     cat "$ac_site_file" >&5
878     . "$ac_site_file"
879   fi
880 done
881
882 if test -r "$cache_file"; then
883   # Some versions of bash will fail to source /dev/null (special
884   # files actually), so we avoid doing that.
885   if test -f "$cache_file"; then
886     { echo "$as_me:886: loading cache $cache_file" >&5
887 echo "$as_me: loading cache $cache_file" >&6;}
888     case $cache_file in
889       [\\/]* | ?:[\\/]* ) . $cache_file;;
890       *)                      . ./$cache_file;;
891     esac
892   fi
893 else
894   { echo "$as_me:894: creating cache $cache_file" >&5
895 echo "$as_me: creating cache $cache_file" >&6;}
896   >$cache_file
897 fi
898
899 # Check that the precious variables saved in the cache have kept the same
900 # value.
901 ac_cache_corrupted=false
902 for ac_var in `(set) 2>&1 |
903                sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
904   eval ac_old_set=\$ac_cv_env_${ac_var}_set
905   eval ac_new_set=\$ac_env_${ac_var}_set
906   eval ac_old_val="\$ac_cv_env_${ac_var}_value"
907   eval ac_new_val="\$ac_env_${ac_var}_value"
908   case $ac_old_set,$ac_new_set in
909     set,)
910       { echo "$as_me:910: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
911 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
912       ac_cache_corrupted=: ;;
913     ,set)
914       { echo "$as_me:914: error: \`$ac_var' was not set in the previous run" >&5
915 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
916       ac_cache_corrupted=: ;;
917     ,);;
918     *)
919       if test "x$ac_old_val" != "x$ac_new_val"; then
920         { echo "$as_me:920: error: \`$ac_var' has changed since the previous run:" >&5
921 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
922         { echo "$as_me:922:   former value:  $ac_old_val" >&5
923 echo "$as_me:   former value:  $ac_old_val" >&2;}
924         { echo "$as_me:924:   current value: $ac_new_val" >&5
925 echo "$as_me:   current value: $ac_new_val" >&2;}
926         ac_cache_corrupted=:
927       fi;;
928   esac
929   # Pass precious variables to config.status.  It doesn't matter if
930   # we pass some twice (in addition to the command line arguments).
931   if test "$ac_new_set" = set; then
932     case $ac_new_val in
933     *" "*|*"    "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
934       ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"`
935       ac_configure_args="$ac_configure_args '$ac_arg'"
936       ;;
937     *) ac_configure_args="$ac_configure_args $ac_var=$ac_new_val"
938        ;;
939     esac
940   fi
941 done
942 if $ac_cache_corrupted; then
943   { echo "$as_me:943: error: changes in the environment can compromise the build" >&5
944 echo "$as_me: error: changes in the environment can compromise the build" >&2;}
945   { { echo "$as_me:945: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
946 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
947    { (exit 1); exit 1; }; }
948 fi
949
950 ac_ext=c
951 ac_cpp='$CPP $CPPFLAGS'
952 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
953 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
954 ac_compiler_gnu=$ac_cv_c_compiler_gnu
955 ac_main_return=return
956
957 case `echo "testing\c" 2>/dev/null; echo 1,2,3`,`echo -n testing 2>/dev/null; echo 1,2,3` in
958   *c*,-n*) ECHO_N= ECHO_C=      # newlines do not sed ;-) only broken shells would use this case anyway
959                    ECHO_T='     ' ;;
960   *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
961   *)      ECHO_N= ECHO_C='\c' ECHO_T= ;;
962 esac
963 echo "#! $SHELL" >conftest.sh
964 echo  "exit 0"   >>conftest.sh
965 chmod +x conftest.sh
966 if { (echo "$as_me:966: PATH=\".;.\"; conftest.sh") >&5
967   (PATH=".;."; conftest.sh) 2>&5
968   ac_status=$?
969   echo "$as_me:969: \$? = $ac_status" >&5
970   (exit $ac_status); }; then
971   ac_path_separator=';'
972 else
973   ac_path_separator=:
974 fi
975 PATH_SEPARATOR="$ac_path_separator"
976 rm -f conftest.sh
977
978 ac_config_headers="$ac_config_headers ncurses_cfg.h:ncurses_tst.hin"
979
980 test -f config.guess || ( test -f ../config.guess && cp ../config.guess ./ )
981
982 test -f config.sub || ( test -f ../config.sub && cp ../config.sub ./ )
983
984 ac_aux_dir=
985 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
986   if test -f $ac_dir/install-sh; then
987     ac_aux_dir=$ac_dir
988     ac_install_sh="$ac_aux_dir/install-sh -c"
989     break
990   elif test -f $ac_dir/install.sh; then
991     ac_aux_dir=$ac_dir
992     ac_install_sh="$ac_aux_dir/install.sh -c"
993     break
994   elif test -f $ac_dir/shtool; then
995     ac_aux_dir=$ac_dir
996     ac_install_sh="$ac_aux_dir/shtool install -c"
997     break
998   fi
999 done
1000 if test -z "$ac_aux_dir"; then
1001   { { echo "$as_me:1001: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
1002 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
1003    { (exit 1); exit 1; }; }
1004 fi
1005 ac_config_guess="$SHELL $ac_aux_dir/config.guess"
1006 ac_config_sub="$SHELL $ac_aux_dir/config.sub"
1007 ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
1008
1009 # Make sure we can run config.sub.
1010 $ac_config_sub sun4 >/dev/null 2>&1 ||
1011   { { echo "$as_me:1011: error: cannot run $ac_config_sub" >&5
1012 echo "$as_me: error: cannot run $ac_config_sub" >&2;}
1013    { (exit 1); exit 1; }; }
1014
1015 echo "$as_me:1015: checking build system type" >&5
1016 echo $ECHO_N "checking build system type... $ECHO_C" >&6
1017 if test "${ac_cv_build+set}" = set; then
1018   echo $ECHO_N "(cached) $ECHO_C" >&6
1019 else
1020   ac_cv_build_alias=$build_alias
1021 test -z "$ac_cv_build_alias" &&
1022   ac_cv_build_alias=`$ac_config_guess`
1023 test -z "$ac_cv_build_alias" &&
1024   { { echo "$as_me:1024: error: cannot guess build type; you must specify one" >&5
1025 echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
1026    { (exit 1); exit 1; }; }
1027 ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
1028   { { echo "$as_me:1028: error: $ac_config_sub $ac_cv_build_alias failed." >&5
1029 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed." >&2;}
1030    { (exit 1); exit 1; }; }
1031
1032 fi
1033 echo "$as_me:1033: result: $ac_cv_build" >&5
1034 echo "${ECHO_T}$ac_cv_build" >&6
1035 build=$ac_cv_build
1036 build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1037 build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1038 build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1039
1040 if test -f $srcdir/config.guess || test -f $ac_aux_dir/config.guess ; then
1041         echo "$as_me:1041: checking host system type" >&5
1042 echo $ECHO_N "checking host system type... $ECHO_C" >&6
1043 if test "${ac_cv_host+set}" = set; then
1044   echo $ECHO_N "(cached) $ECHO_C" >&6
1045 else
1046   ac_cv_host_alias=$host_alias
1047 test -z "$ac_cv_host_alias" &&
1048   ac_cv_host_alias=$ac_cv_build_alias
1049 ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
1050   { { echo "$as_me:1050: error: $ac_config_sub $ac_cv_host_alias failed" >&5
1051 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
1052    { (exit 1); exit 1; }; }
1053
1054 fi
1055 echo "$as_me:1055: result: $ac_cv_host" >&5
1056 echo "${ECHO_T}$ac_cv_host" >&6
1057 host=$ac_cv_host
1058 host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1059 host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1060 host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1061
1062         system_name="$host_os"
1063 else
1064         system_name="`(uname -s -r) 2>/dev/null`"
1065         if test -z "$system_name" ; then
1066                 system_name="`(hostname) 2>/dev/null`"
1067         fi
1068 fi
1069 test -n "$system_name" &&
1070 cat >>confdefs.h <<EOF
1071 #define SYSTEM_NAME "$system_name"
1072 EOF
1073
1074 if test "${cf_cv_system_name+set}" = set; then
1075   echo $ECHO_N "(cached) $ECHO_C" >&6
1076 else
1077   cf_cv_system_name="$system_name"
1078 fi
1079
1080 test -z "$system_name" && system_name="$cf_cv_system_name"
1081 test -n "$cf_cv_system_name" && echo "$as_me:1081: result: Configuring for $cf_cv_system_name" >&5
1082 echo "${ECHO_T}Configuring for $cf_cv_system_name" >&6
1083
1084 if test ".$system_name" != ".$cf_cv_system_name" ; then
1085         echo "$as_me:1085: result: Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&5
1086 echo "${ECHO_T}Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&6
1087         { { echo "$as_me:1087: error: \"Please remove config.cache and try again.\"" >&5
1088 echo "$as_me: error: \"Please remove config.cache and try again.\"" >&2;}
1089    { (exit 1); exit 1; }; }
1090 fi
1091
1092 test "$program_prefix" != NONE &&
1093   program_transform_name="s,^,$program_prefix,;$program_transform_name"
1094 # Use a double $ so make ignores it.
1095 test "$program_suffix" != NONE &&
1096   program_transform_name="s,\$,$program_suffix,;$program_transform_name"
1097 # Double any \ or $.  echo might interpret backslashes.
1098 # By default was `s,x,x', remove it if useless.
1099 cat <<\_ACEOF >conftest.sed
1100 s/[\\$]/&&/g;s/;s,x,x,$//
1101 _ACEOF
1102 program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
1103 rm conftest.sed
1104
1105 echo "$as_me:1105: checking whether ${MAKE-make} sets \${MAKE}" >&5
1106 echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6
1107 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
1108 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
1109   echo $ECHO_N "(cached) $ECHO_C" >&6
1110 else
1111   cat >conftest.make <<\EOF
1112 all:
1113         @echo 'ac_maketemp="${MAKE}"'
1114 EOF
1115 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
1116 eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
1117 if test -n "$ac_maketemp"; then
1118   eval ac_cv_prog_make_${ac_make}_set=yes
1119 else
1120   eval ac_cv_prog_make_${ac_make}_set=no
1121 fi
1122 rm -f conftest.make
1123 fi
1124 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
1125   echo "$as_me:1125: result: yes" >&5
1126 echo "${ECHO_T}yes" >&6
1127   SET_MAKE=
1128 else
1129   echo "$as_me:1129: result: no" >&5
1130 echo "${ECHO_T}no" >&6
1131   SET_MAKE="MAKE=${MAKE-make}"
1132 fi
1133
1134 ac_ext=c
1135 ac_cpp='$CPP $CPPFLAGS'
1136 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1137 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1138 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1139 ac_main_return=return
1140 if test -n "$ac_tool_prefix"; then
1141   # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
1142 set dummy ${ac_tool_prefix}gcc; ac_word=$2
1143 echo "$as_me:1143: checking for $ac_word" >&5
1144 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1145 if test "${ac_cv_prog_CC+set}" = set; then
1146   echo $ECHO_N "(cached) $ECHO_C" >&6
1147 else
1148   if test -n "$CC"; then
1149   ac_cv_prog_CC="$CC" # Let the user override the test.
1150 else
1151   ac_save_IFS=$IFS; IFS=$ac_path_separator
1152 ac_dummy="$PATH"
1153 for ac_dir in $ac_dummy; do
1154   IFS=$ac_save_IFS
1155   test -z "$ac_dir" && ac_dir=.
1156   $as_executable_p "$ac_dir/$ac_word" || continue
1157 ac_cv_prog_CC="${ac_tool_prefix}gcc"
1158 echo "$as_me:1158: found $ac_dir/$ac_word" >&5
1159 break
1160 done
1161
1162 fi
1163 fi
1164 CC=$ac_cv_prog_CC
1165 if test -n "$CC"; then
1166   echo "$as_me:1166: result: $CC" >&5
1167 echo "${ECHO_T}$CC" >&6
1168 else
1169   echo "$as_me:1169: result: no" >&5
1170 echo "${ECHO_T}no" >&6
1171 fi
1172
1173 fi
1174 if test -z "$ac_cv_prog_CC"; then
1175   ac_ct_CC=$CC
1176   # Extract the first word of "gcc", so it can be a program name with args.
1177 set dummy gcc; ac_word=$2
1178 echo "$as_me:1178: checking for $ac_word" >&5
1179 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1180 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1181   echo $ECHO_N "(cached) $ECHO_C" >&6
1182 else
1183   if test -n "$ac_ct_CC"; then
1184   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1185 else
1186   ac_save_IFS=$IFS; IFS=$ac_path_separator
1187 ac_dummy="$PATH"
1188 for ac_dir in $ac_dummy; do
1189   IFS=$ac_save_IFS
1190   test -z "$ac_dir" && ac_dir=.
1191   $as_executable_p "$ac_dir/$ac_word" || continue
1192 ac_cv_prog_ac_ct_CC="gcc"
1193 echo "$as_me:1193: found $ac_dir/$ac_word" >&5
1194 break
1195 done
1196
1197 fi
1198 fi
1199 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1200 if test -n "$ac_ct_CC"; then
1201   echo "$as_me:1201: result: $ac_ct_CC" >&5
1202 echo "${ECHO_T}$ac_ct_CC" >&6
1203 else
1204   echo "$as_me:1204: result: no" >&5
1205 echo "${ECHO_T}no" >&6
1206 fi
1207
1208   CC=$ac_ct_CC
1209 else
1210   CC="$ac_cv_prog_CC"
1211 fi
1212
1213 if test -z "$CC"; then
1214   if test -n "$ac_tool_prefix"; then
1215   # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
1216 set dummy ${ac_tool_prefix}cc; ac_word=$2
1217 echo "$as_me:1217: checking for $ac_word" >&5
1218 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1219 if test "${ac_cv_prog_CC+set}" = set; then
1220   echo $ECHO_N "(cached) $ECHO_C" >&6
1221 else
1222   if test -n "$CC"; then
1223   ac_cv_prog_CC="$CC" # Let the user override the test.
1224 else
1225   ac_save_IFS=$IFS; IFS=$ac_path_separator
1226 ac_dummy="$PATH"
1227 for ac_dir in $ac_dummy; do
1228   IFS=$ac_save_IFS
1229   test -z "$ac_dir" && ac_dir=.
1230   $as_executable_p "$ac_dir/$ac_word" || continue
1231 ac_cv_prog_CC="${ac_tool_prefix}cc"
1232 echo "$as_me:1232: found $ac_dir/$ac_word" >&5
1233 break
1234 done
1235
1236 fi
1237 fi
1238 CC=$ac_cv_prog_CC
1239 if test -n "$CC"; then
1240   echo "$as_me:1240: result: $CC" >&5
1241 echo "${ECHO_T}$CC" >&6
1242 else
1243   echo "$as_me:1243: result: no" >&5
1244 echo "${ECHO_T}no" >&6
1245 fi
1246
1247 fi
1248 if test -z "$ac_cv_prog_CC"; then
1249   ac_ct_CC=$CC
1250   # Extract the first word of "cc", so it can be a program name with args.
1251 set dummy cc; ac_word=$2
1252 echo "$as_me:1252: checking for $ac_word" >&5
1253 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1254 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1255   echo $ECHO_N "(cached) $ECHO_C" >&6
1256 else
1257   if test -n "$ac_ct_CC"; then
1258   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1259 else
1260   ac_save_IFS=$IFS; IFS=$ac_path_separator
1261 ac_dummy="$PATH"
1262 for ac_dir in $ac_dummy; do
1263   IFS=$ac_save_IFS
1264   test -z "$ac_dir" && ac_dir=.
1265   $as_executable_p "$ac_dir/$ac_word" || continue
1266 ac_cv_prog_ac_ct_CC="cc"
1267 echo "$as_me:1267: found $ac_dir/$ac_word" >&5
1268 break
1269 done
1270
1271 fi
1272 fi
1273 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1274 if test -n "$ac_ct_CC"; then
1275   echo "$as_me:1275: result: $ac_ct_CC" >&5
1276 echo "${ECHO_T}$ac_ct_CC" >&6
1277 else
1278   echo "$as_me:1278: result: no" >&5
1279 echo "${ECHO_T}no" >&6
1280 fi
1281
1282   CC=$ac_ct_CC
1283 else
1284   CC="$ac_cv_prog_CC"
1285 fi
1286
1287 fi
1288 if test -z "$CC"; then
1289   # Extract the first word of "cc", so it can be a program name with args.
1290 set dummy cc; ac_word=$2
1291 echo "$as_me:1291: checking for $ac_word" >&5
1292 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1293 if test "${ac_cv_prog_CC+set}" = set; then
1294   echo $ECHO_N "(cached) $ECHO_C" >&6
1295 else
1296   if test -n "$CC"; then
1297   ac_cv_prog_CC="$CC" # Let the user override the test.
1298 else
1299   ac_prog_rejected=no
1300   ac_save_IFS=$IFS; IFS=$ac_path_separator
1301 ac_dummy="$PATH"
1302 for ac_dir in $ac_dummy; do
1303   IFS=$ac_save_IFS
1304   test -z "$ac_dir" && ac_dir=.
1305   $as_executable_p "$ac_dir/$ac_word" || continue
1306 if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1307   ac_prog_rejected=yes
1308   continue
1309 fi
1310 ac_cv_prog_CC="cc"
1311 echo "$as_me:1311: found $ac_dir/$ac_word" >&5
1312 break
1313 done
1314
1315 if test $ac_prog_rejected = yes; then
1316   # We found a bogon in the path, so make sure we never use it.
1317   set dummy $ac_cv_prog_CC
1318   shift
1319   if test $# != 0; then
1320     # We chose a different compiler from the bogus one.
1321     # However, it has the same basename, so the bogon will be chosen
1322     # first if we set CC to just the basename; use the full file name.
1323     shift
1324     set dummy "$ac_dir/$ac_word" ${1+"$@"}
1325     shift
1326     ac_cv_prog_CC="$@"
1327   fi
1328 fi
1329 fi
1330 fi
1331 CC=$ac_cv_prog_CC
1332 if test -n "$CC"; then
1333   echo "$as_me:1333: result: $CC" >&5
1334 echo "${ECHO_T}$CC" >&6
1335 else
1336   echo "$as_me:1336: result: no" >&5
1337 echo "${ECHO_T}no" >&6
1338 fi
1339
1340 fi
1341 if test -z "$CC"; then
1342   if test -n "$ac_tool_prefix"; then
1343   for ac_prog in cl
1344   do
1345     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
1346 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
1347 echo "$as_me:1347: checking for $ac_word" >&5
1348 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1349 if test "${ac_cv_prog_CC+set}" = set; then
1350   echo $ECHO_N "(cached) $ECHO_C" >&6
1351 else
1352   if test -n "$CC"; then
1353   ac_cv_prog_CC="$CC" # Let the user override the test.
1354 else
1355   ac_save_IFS=$IFS; IFS=$ac_path_separator
1356 ac_dummy="$PATH"
1357 for ac_dir in $ac_dummy; do
1358   IFS=$ac_save_IFS
1359   test -z "$ac_dir" && ac_dir=.
1360   $as_executable_p "$ac_dir/$ac_word" || continue
1361 ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
1362 echo "$as_me:1362: found $ac_dir/$ac_word" >&5
1363 break
1364 done
1365
1366 fi
1367 fi
1368 CC=$ac_cv_prog_CC
1369 if test -n "$CC"; then
1370   echo "$as_me:1370: result: $CC" >&5
1371 echo "${ECHO_T}$CC" >&6
1372 else
1373   echo "$as_me:1373: result: no" >&5
1374 echo "${ECHO_T}no" >&6
1375 fi
1376
1377     test -n "$CC" && break
1378   done
1379 fi
1380 if test -z "$CC"; then
1381   ac_ct_CC=$CC
1382   for ac_prog in cl
1383 do
1384   # Extract the first word of "$ac_prog", so it can be a program name with args.
1385 set dummy $ac_prog; ac_word=$2
1386 echo "$as_me:1386: checking for $ac_word" >&5
1387 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1388 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1389   echo $ECHO_N "(cached) $ECHO_C" >&6
1390 else
1391   if test -n "$ac_ct_CC"; then
1392   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1393 else
1394   ac_save_IFS=$IFS; IFS=$ac_path_separator
1395 ac_dummy="$PATH"
1396 for ac_dir in $ac_dummy; do
1397   IFS=$ac_save_IFS
1398   test -z "$ac_dir" && ac_dir=.
1399   $as_executable_p "$ac_dir/$ac_word" || continue
1400 ac_cv_prog_ac_ct_CC="$ac_prog"
1401 echo "$as_me:1401: found $ac_dir/$ac_word" >&5
1402 break
1403 done
1404
1405 fi
1406 fi
1407 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1408 if test -n "$ac_ct_CC"; then
1409   echo "$as_me:1409: result: $ac_ct_CC" >&5
1410 echo "${ECHO_T}$ac_ct_CC" >&6
1411 else
1412   echo "$as_me:1412: result: no" >&5
1413 echo "${ECHO_T}no" >&6
1414 fi
1415
1416   test -n "$ac_ct_CC" && break
1417 done
1418
1419   CC=$ac_ct_CC
1420 fi
1421
1422 fi
1423
1424 test -z "$CC" && { { echo "$as_me:1424: error: no acceptable cc found in \$PATH" >&5
1425 echo "$as_me: error: no acceptable cc found in \$PATH" >&2;}
1426    { (exit 1); exit 1; }; }
1427
1428 # Provide some information about the compiler.
1429 echo "$as_me:1429:" \
1430      "checking for C compiler version" >&5
1431 ac_compiler=`set X $ac_compile; echo $2`
1432 { (eval echo "$as_me:1432: \"$ac_compiler --version </dev/null >&5\"") >&5
1433   (eval $ac_compiler --version </dev/null >&5) 2>&5
1434   ac_status=$?
1435   echo "$as_me:1435: \$? = $ac_status" >&5
1436   (exit $ac_status); }
1437 { (eval echo "$as_me:1437: \"$ac_compiler -v </dev/null >&5\"") >&5
1438   (eval $ac_compiler -v </dev/null >&5) 2>&5
1439   ac_status=$?
1440   echo "$as_me:1440: \$? = $ac_status" >&5
1441   (exit $ac_status); }
1442 { (eval echo "$as_me:1442: \"$ac_compiler -V </dev/null >&5\"") >&5
1443   (eval $ac_compiler -V </dev/null >&5) 2>&5
1444   ac_status=$?
1445   echo "$as_me:1445: \$? = $ac_status" >&5
1446   (exit $ac_status); }
1447
1448 cat >conftest.$ac_ext <<_ACEOF
1449 #line 1449 "configure"
1450 #include "confdefs.h"
1451
1452 int
1453 main ()
1454 {
1455
1456   ;
1457   return 0;
1458 }
1459 _ACEOF
1460 ac_clean_files_save=$ac_clean_files
1461 ac_clean_files="$ac_clean_files a.out a.exe"
1462 # Try to create an executable without -o first, disregard a.out.
1463 # It will help us diagnose broken compilers, and finding out an intuition
1464 # of exeext.
1465 echo "$as_me:1465: checking for C compiler default output" >&5
1466 echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
1467 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
1468 if { (eval echo "$as_me:1468: \"$ac_link_default\"") >&5
1469   (eval $ac_link_default) 2>&5
1470   ac_status=$?
1471   echo "$as_me:1471: \$? = $ac_status" >&5
1472   (exit $ac_status); }; then
1473   # Find the output, starting from the most likely.  This scheme is
1474 # not robust to junk in `.', hence go to wildcards (a.*) only as a last
1475 # resort.
1476 for ac_file in `ls a.exe conftest.exe 2>/dev/null;
1477                 ls a.out conftest 2>/dev/null;
1478                 ls a.* conftest.* 2>/dev/null`; do
1479   case $ac_file in
1480     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1481     a.out ) # We found the default executable, but exeext='' is most
1482             # certainly right.
1483             break;;
1484     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1485           # FIXME: I believe we export ac_cv_exeext for Libtool --akim.
1486           export ac_cv_exeext
1487           break;;
1488     * ) break;;
1489   esac
1490 done
1491 else
1492   echo "$as_me: failed program was:" >&5
1493 cat conftest.$ac_ext >&5
1494 { { echo "$as_me:1494: error: C compiler cannot create executables" >&5
1495 echo "$as_me: error: C compiler cannot create executables" >&2;}
1496    { (exit 77); exit 77; }; }
1497 fi
1498
1499 ac_exeext=$ac_cv_exeext
1500 echo "$as_me:1500: result: $ac_file" >&5
1501 echo "${ECHO_T}$ac_file" >&6
1502
1503 # Check the compiler produces executables we can run.  If not, either
1504 # the compiler is broken, or we cross compile.
1505 echo "$as_me:1505: checking whether the C compiler works" >&5
1506 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
1507 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0
1508 # If not cross compiling, check that we can run a simple program.
1509 if test "$cross_compiling" != yes; then
1510   if { ac_try='./$ac_file'
1511   { (eval echo "$as_me:1511: \"$ac_try\"") >&5
1512   (eval $ac_try) 2>&5
1513   ac_status=$?
1514   echo "$as_me:1514: \$? = $ac_status" >&5
1515   (exit $ac_status); }; }; then
1516     cross_compiling=no
1517   else
1518     if test "$cross_compiling" = maybe; then
1519         cross_compiling=yes
1520     else
1521         { { echo "$as_me:1521: error: cannot run C compiled programs.
1522 If you meant to cross compile, use \`--host'." >&5
1523 echo "$as_me: error: cannot run C compiled programs.
1524 If you meant to cross compile, use \`--host'." >&2;}
1525    { (exit 1); exit 1; }; }
1526     fi
1527   fi
1528 fi
1529 echo "$as_me:1529: result: yes" >&5
1530 echo "${ECHO_T}yes" >&6
1531
1532 rm -f a.out a.exe conftest$ac_cv_exeext
1533 ac_clean_files=$ac_clean_files_save
1534 # Check the compiler produces executables we can run.  If not, either
1535 # the compiler is broken, or we cross compile.
1536 echo "$as_me:1536: checking whether we are cross compiling" >&5
1537 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
1538 echo "$as_me:1538: result: $cross_compiling" >&5
1539 echo "${ECHO_T}$cross_compiling" >&6
1540
1541 echo "$as_me:1541: checking for executable suffix" >&5
1542 echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6
1543 if { (eval echo "$as_me:1543: \"$ac_link\"") >&5
1544   (eval $ac_link) 2>&5
1545   ac_status=$?
1546   echo "$as_me:1546: \$? = $ac_status" >&5
1547   (exit $ac_status); }; then
1548   # If both `conftest.exe' and `conftest' are `present' (well, observable)
1549 # catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
1550 # work properly (i.e., refer to `conftest.exe'), while it won't with
1551 # `rm'.
1552 for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do
1553   case $ac_file in
1554     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1555     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1556           export ac_cv_exeext
1557           break;;
1558     * ) break;;
1559   esac
1560 done
1561 else
1562   { { echo "$as_me:1562: error: cannot compute EXEEXT: cannot compile and link" >&5
1563 echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;}
1564    { (exit 1); exit 1; }; }
1565 fi
1566
1567 rm -f conftest$ac_cv_exeext
1568 echo "$as_me:1568: result: $ac_cv_exeext" >&5
1569 echo "${ECHO_T}$ac_cv_exeext" >&6
1570
1571 rm -f conftest.$ac_ext
1572 EXEEXT=$ac_cv_exeext
1573 ac_exeext=$EXEEXT
1574 echo "$as_me:1574: checking for object suffix" >&5
1575 echo $ECHO_N "checking for object suffix... $ECHO_C" >&6
1576 if test "${ac_cv_objext+set}" = set; then
1577   echo $ECHO_N "(cached) $ECHO_C" >&6
1578 else
1579   cat >conftest.$ac_ext <<_ACEOF
1580 #line 1580 "configure"
1581 #include "confdefs.h"
1582
1583 int
1584 main ()
1585 {
1586
1587   ;
1588   return 0;
1589 }
1590 _ACEOF
1591 rm -f conftest.o conftest.obj
1592 if { (eval echo "$as_me:1592: \"$ac_compile\"") >&5
1593   (eval $ac_compile) 2>&5
1594   ac_status=$?
1595   echo "$as_me:1595: \$? = $ac_status" >&5
1596   (exit $ac_status); }; then
1597   for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
1598   case $ac_file in
1599     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.map | *.inf ) ;;
1600     *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
1601        break;;
1602   esac
1603 done
1604 else
1605   echo "$as_me: failed program was:" >&5
1606 cat conftest.$ac_ext >&5
1607 { { echo "$as_me:1607: error: cannot compute OBJEXT: cannot compile" >&5
1608 echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;}
1609    { (exit 1); exit 1; }; }
1610 fi
1611
1612 rm -f conftest.$ac_cv_objext conftest.$ac_ext
1613 fi
1614 echo "$as_me:1614: result: $ac_cv_objext" >&5
1615 echo "${ECHO_T}$ac_cv_objext" >&6
1616 OBJEXT=$ac_cv_objext
1617 ac_objext=$OBJEXT
1618 echo "$as_me:1618: checking whether we are using the GNU C compiler" >&5
1619 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
1620 if test "${ac_cv_c_compiler_gnu+set}" = set; then
1621   echo $ECHO_N "(cached) $ECHO_C" >&6
1622 else
1623   cat >conftest.$ac_ext <<_ACEOF
1624 #line 1624 "configure"
1625 #include "confdefs.h"
1626
1627 int
1628 main ()
1629 {
1630 #ifndef __GNUC__
1631        choke me
1632 #endif
1633
1634   ;
1635   return 0;
1636 }
1637 _ACEOF
1638 rm -f conftest.$ac_objext
1639 if { (eval echo "$as_me:1639: \"$ac_compile\"") >&5
1640   (eval $ac_compile) 2>&5
1641   ac_status=$?
1642   echo "$as_me:1642: \$? = $ac_status" >&5
1643   (exit $ac_status); } &&
1644          { ac_try='test -s conftest.$ac_objext'
1645   { (eval echo "$as_me:1645: \"$ac_try\"") >&5
1646   (eval $ac_try) 2>&5
1647   ac_status=$?
1648   echo "$as_me:1648: \$? = $ac_status" >&5
1649   (exit $ac_status); }; }; then
1650   ac_compiler_gnu=yes
1651 else
1652   echo "$as_me: failed program was:" >&5
1653 cat conftest.$ac_ext >&5
1654 ac_compiler_gnu=no
1655 fi
1656 rm -f conftest.$ac_objext conftest.$ac_ext
1657 ac_cv_c_compiler_gnu=$ac_compiler_gnu
1658
1659 fi
1660 echo "$as_me:1660: result: $ac_cv_c_compiler_gnu" >&5
1661 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
1662 GCC=`test $ac_compiler_gnu = yes && echo yes`
1663 ac_test_CFLAGS=${CFLAGS+set}
1664 ac_save_CFLAGS=$CFLAGS
1665 CFLAGS="-g"
1666 echo "$as_me:1666: checking whether $CC accepts -g" >&5
1667 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
1668 if test "${ac_cv_prog_cc_g+set}" = set; then
1669   echo $ECHO_N "(cached) $ECHO_C" >&6
1670 else
1671   cat >conftest.$ac_ext <<_ACEOF
1672 #line 1672 "configure"
1673 #include "confdefs.h"
1674
1675 int
1676 main ()
1677 {
1678
1679   ;
1680   return 0;
1681 }
1682 _ACEOF
1683 rm -f conftest.$ac_objext
1684 if { (eval echo "$as_me:1684: \"$ac_compile\"") >&5
1685   (eval $ac_compile) 2>&5
1686   ac_status=$?
1687   echo "$as_me:1687: \$? = $ac_status" >&5
1688   (exit $ac_status); } &&
1689          { ac_try='test -s conftest.$ac_objext'
1690   { (eval echo "$as_me:1690: \"$ac_try\"") >&5
1691   (eval $ac_try) 2>&5
1692   ac_status=$?
1693   echo "$as_me:1693: \$? = $ac_status" >&5
1694   (exit $ac_status); }; }; then
1695   ac_cv_prog_cc_g=yes
1696 else
1697   echo "$as_me: failed program was:" >&5
1698 cat conftest.$ac_ext >&5
1699 ac_cv_prog_cc_g=no
1700 fi
1701 rm -f conftest.$ac_objext conftest.$ac_ext
1702 fi
1703 echo "$as_me:1703: result: $ac_cv_prog_cc_g" >&5
1704 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
1705 if test "$ac_test_CFLAGS" = set; then
1706   CFLAGS=$ac_save_CFLAGS
1707 elif test $ac_cv_prog_cc_g = yes; then
1708   if test "$GCC" = yes; then
1709     CFLAGS="-g -O2"
1710   else
1711     CFLAGS="-g"
1712   fi
1713 else
1714   if test "$GCC" = yes; then
1715     CFLAGS="-O2"
1716   else
1717     CFLAGS=
1718   fi
1719 fi
1720 # Some people use a C++ compiler to compile C.  Since we use `exit',
1721 # in C++ we need to declare it.  In case someone uses the same compiler
1722 # for both compiling C and C++ we need to have the C++ compiler decide
1723 # the declaration of exit, since it's the most demanding environment.
1724 cat >conftest.$ac_ext <<_ACEOF
1725 #ifndef __cplusplus
1726   choke me
1727 #endif
1728 _ACEOF
1729 rm -f conftest.$ac_objext
1730 if { (eval echo "$as_me:1730: \"$ac_compile\"") >&5
1731   (eval $ac_compile) 2>&5
1732   ac_status=$?
1733   echo "$as_me:1733: \$? = $ac_status" >&5
1734   (exit $ac_status); } &&
1735          { ac_try='test -s conftest.$ac_objext'
1736   { (eval echo "$as_me:1736: \"$ac_try\"") >&5
1737   (eval $ac_try) 2>&5
1738   ac_status=$?
1739   echo "$as_me:1739: \$? = $ac_status" >&5
1740   (exit $ac_status); }; }; then
1741   for ac_declaration in \
1742    ''\
1743    '#include <stdlib.h>' \
1744    'extern "C" void std::exit (int) throw (); using std::exit;' \
1745    'extern "C" void std::exit (int); using std::exit;' \
1746    'extern "C" void exit (int) throw ();' \
1747    'extern "C" void exit (int);' \
1748    'void exit (int);'
1749 do
1750   cat >conftest.$ac_ext <<_ACEOF
1751 #line 1751 "configure"
1752 #include "confdefs.h"
1753 #include <stdlib.h>
1754 $ac_declaration
1755 int
1756 main ()
1757 {
1758 exit (42);
1759   ;
1760   return 0;
1761 }
1762 _ACEOF
1763 rm -f conftest.$ac_objext
1764 if { (eval echo "$as_me:1764: \"$ac_compile\"") >&5
1765   (eval $ac_compile) 2>&5
1766   ac_status=$?
1767   echo "$as_me:1767: \$? = $ac_status" >&5
1768   (exit $ac_status); } &&
1769          { ac_try='test -s conftest.$ac_objext'
1770   { (eval echo "$as_me:1770: \"$ac_try\"") >&5
1771   (eval $ac_try) 2>&5
1772   ac_status=$?
1773   echo "$as_me:1773: \$? = $ac_status" >&5
1774   (exit $ac_status); }; }; then
1775   :
1776 else
1777   echo "$as_me: failed program was:" >&5
1778 cat conftest.$ac_ext >&5
1779 continue
1780 fi
1781 rm -f conftest.$ac_objext conftest.$ac_ext
1782   cat >conftest.$ac_ext <<_ACEOF
1783 #line 1783 "configure"
1784 #include "confdefs.h"
1785 $ac_declaration
1786 int
1787 main ()
1788 {
1789 exit (42);
1790   ;
1791   return 0;
1792 }
1793 _ACEOF
1794 rm -f conftest.$ac_objext
1795 if { (eval echo "$as_me:1795: \"$ac_compile\"") >&5
1796   (eval $ac_compile) 2>&5
1797   ac_status=$?
1798   echo "$as_me:1798: \$? = $ac_status" >&5
1799   (exit $ac_status); } &&
1800          { ac_try='test -s conftest.$ac_objext'
1801   { (eval echo "$as_me:1801: \"$ac_try\"") >&5
1802   (eval $ac_try) 2>&5
1803   ac_status=$?
1804   echo "$as_me:1804: \$? = $ac_status" >&5
1805   (exit $ac_status); }; }; then
1806   break
1807 else
1808   echo "$as_me: failed program was:" >&5
1809 cat conftest.$ac_ext >&5
1810 fi
1811 rm -f conftest.$ac_objext conftest.$ac_ext
1812 done
1813 rm -rf conftest*
1814 if test -n "$ac_declaration"; then
1815   echo '#ifdef __cplusplus' >>confdefs.h
1816   echo $ac_declaration      >>confdefs.h
1817   echo '#endif'             >>confdefs.h
1818 fi
1819
1820 else
1821   echo "$as_me: failed program was:" >&5
1822 cat conftest.$ac_ext >&5
1823 fi
1824 rm -f conftest.$ac_objext conftest.$ac_ext
1825 ac_ext=c
1826 ac_cpp='$CPP $CPPFLAGS'
1827 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1828 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1829 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1830 ac_main_return=return
1831
1832 GCC_VERSION=none
1833 if test "$GCC" = yes ; then
1834         echo "$as_me:1834: checking version of $CC" >&5
1835 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
1836         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.].*//'`"
1837         test -z "$GCC_VERSION" && GCC_VERSION=unknown
1838         echo "$as_me:1838: result: $GCC_VERSION" >&5
1839 echo "${ECHO_T}$GCC_VERSION" >&6
1840 fi
1841
1842 echo "$as_me:1842: checking for $CC option to accept ANSI C" >&5
1843 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
1844 if test "${ac_cv_prog_cc_stdc+set}" = set; then
1845   echo $ECHO_N "(cached) $ECHO_C" >&6
1846 else
1847   ac_cv_prog_cc_stdc=no
1848 ac_save_CC=$CC
1849 cat >conftest.$ac_ext <<_ACEOF
1850 #line 1850 "configure"
1851 #include "confdefs.h"
1852 #include <stdarg.h>
1853 #include <stdio.h>
1854 #include <sys/types.h>
1855 #include <sys/stat.h>
1856 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
1857 struct buf { int x; };
1858 FILE * (*rcsopen) (struct buf *, struct stat *, int);
1859 static char *e (p, i)
1860      char **p;
1861      int i;
1862 {
1863   return p[i];
1864 }
1865 static char *f (char * (*g) (char **, int), char **p, ...)
1866 {
1867   char *s;
1868   va_list v;
1869   va_start (v,p);
1870   s = g (p, va_arg (v,int));
1871   va_end (v);
1872   return s;
1873 }
1874 int test (int i, double x);
1875 struct s1 {int (*f) (int a);};
1876 struct s2 {int (*f) (double a);};
1877 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
1878 int argc;
1879 char **argv;
1880 int
1881 main ()
1882 {
1883 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
1884   ;
1885   return 0;
1886 }
1887 _ACEOF
1888 # Don't try gcc -ansi; that turns off useful extensions and
1889 # breaks some systems' header files.
1890 # AIX                   -qlanglvl=ansi
1891 # Ultrix and OSF/1      -std1
1892 # HP-UX 10.20 and later -Ae
1893 # HP-UX older versions  -Aa -D_HPUX_SOURCE
1894 # SVR4                  -Xc -D__EXTENSIONS__
1895 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
1896 do
1897   CC="$ac_save_CC $ac_arg"
1898   rm -f conftest.$ac_objext
1899 if { (eval echo "$as_me:1899: \"$ac_compile\"") >&5
1900   (eval $ac_compile) 2>&5
1901   ac_status=$?
1902   echo "$as_me:1902: \$? = $ac_status" >&5
1903   (exit $ac_status); } &&
1904          { ac_try='test -s conftest.$ac_objext'
1905   { (eval echo "$as_me:1905: \"$ac_try\"") >&5
1906   (eval $ac_try) 2>&5
1907   ac_status=$?
1908   echo "$as_me:1908: \$? = $ac_status" >&5
1909   (exit $ac_status); }; }; then
1910   ac_cv_prog_cc_stdc=$ac_arg
1911 break
1912 else
1913   echo "$as_me: failed program was:" >&5
1914 cat conftest.$ac_ext >&5
1915 fi
1916 rm -f conftest.$ac_objext
1917 done
1918 rm -f conftest.$ac_ext conftest.$ac_objext
1919 CC=$ac_save_CC
1920
1921 fi
1922
1923 case "x$ac_cv_prog_cc_stdc" in
1924   x|xno)
1925     echo "$as_me:1925: result: none needed" >&5
1926 echo "${ECHO_T}none needed" >&6 ;;
1927   *)
1928     echo "$as_me:1928: result: $ac_cv_prog_cc_stdc" >&5
1929 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
1930     CC="$CC $ac_cv_prog_cc_stdc" ;;
1931 esac
1932
1933 # This should have been defined by AC_PROG_CC
1934 : ${CC:=cc}
1935
1936 echo "$as_me:1936: checking \$CC variable" >&5
1937 echo $ECHO_N "checking \$CC variable... $ECHO_C" >&6
1938 case "$CC" in
1939 (*[\ \  ]-[IUD]*)
1940         echo "$as_me:1940: result: broken" >&5
1941 echo "${ECHO_T}broken" >&6
1942         { echo "$as_me:1942: WARNING: your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options" >&5
1943 echo "$as_me: WARNING: your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options" >&2;}
1944         # humor him...
1945         cf_flags=`echo "$CC" | sed -e 's/^[^    ]*[     ]//'`
1946         CC=`echo "$CC" | sed -e 's/[    ].*//'`
1947
1948 cf_fix_cppflags=no
1949 cf_new_cflags=
1950 cf_new_cppflags=
1951 cf_new_extra_cppflags=
1952
1953 for cf_add_cflags in $cf_flags
1954 do
1955 case $cf_fix_cppflags in
1956 (no)
1957         case $cf_add_cflags in
1958         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
1959                 case $cf_add_cflags in
1960                 (-D*)
1961                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
1962
1963                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
1964                                 && test -z "${cf_tst_cflags}" \
1965                                 && cf_fix_cppflags=yes
1966
1967                         if test $cf_fix_cppflags = yes ; then
1968                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
1969                                 continue
1970                         elif test "${cf_tst_cflags}" = "\"'" ; then
1971                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
1972                                 continue
1973                         fi
1974                         ;;
1975                 esac
1976                 case "$CPPFLAGS" in
1977                 (*$cf_add_cflags)
1978                         ;;
1979                 (*)
1980                         case $cf_add_cflags in
1981                         (-D*)
1982                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
1983
1984 CPPFLAGS=`echo "$CPPFLAGS" | \
1985         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
1986                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
1987
1988                                 ;;
1989                         esac
1990                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
1991                         ;;
1992                 esac
1993                 ;;
1994         (*)
1995                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
1996                 ;;
1997         esac
1998         ;;
1999 (yes)
2000         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
2001
2002         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
2003
2004         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2005                 && test -z "${cf_tst_cflags}" \
2006                 && cf_fix_cppflags=no
2007         ;;
2008 esac
2009 done
2010
2011 if test -n "$cf_new_cflags" ; then
2012
2013         CFLAGS="$CFLAGS $cf_new_cflags"
2014 fi
2015
2016 if test -n "$cf_new_cppflags" ; then
2017
2018         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
2019 fi
2020
2021 if test -n "$cf_new_extra_cppflags" ; then
2022
2023         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
2024 fi
2025
2026         ;;
2027 (*)
2028         echo "$as_me:2028: result: ok" >&5
2029 echo "${ECHO_T}ok" >&6
2030         ;;
2031 esac
2032
2033 ac_ext=c
2034 ac_cpp='$CPP $CPPFLAGS'
2035 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2036 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2037 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2038 ac_main_return=return
2039 echo "$as_me:2039: checking how to run the C preprocessor" >&5
2040 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
2041 # On Suns, sometimes $CPP names a directory.
2042 if test -n "$CPP" && test -d "$CPP"; then
2043   CPP=
2044 fi
2045 if test -z "$CPP"; then
2046   if test "${ac_cv_prog_CPP+set}" = set; then
2047   echo $ECHO_N "(cached) $ECHO_C" >&6
2048 else
2049       # Double quotes because CPP needs to be expanded
2050     for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
2051     do
2052       ac_preproc_ok=false
2053 for ac_c_preproc_warn_flag in '' yes
2054 do
2055   # Use a header file that comes with gcc, so configuring glibc
2056   # with a fresh cross-compiler works.
2057   # On the NeXT, cc -E runs the code through the compiler's parser,
2058   # not just through cpp. "Syntax error" is here to catch this case.
2059   cat >conftest.$ac_ext <<_ACEOF
2060 #line 2060 "configure"
2061 #include "confdefs.h"
2062 #include <assert.h>
2063                      Syntax error
2064 _ACEOF
2065 if { (eval echo "$as_me:2065: \"$ac_cpp conftest.$ac_ext\"") >&5
2066   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2067   ac_status=$?
2068   egrep -v '^ *\+' conftest.er1 >conftest.err
2069   rm -f conftest.er1
2070   cat conftest.err >&5
2071   echo "$as_me:2071: \$? = $ac_status" >&5
2072   (exit $ac_status); } >/dev/null; then
2073   if test -s conftest.err; then
2074     ac_cpp_err=$ac_c_preproc_warn_flag
2075   else
2076     ac_cpp_err=
2077   fi
2078 else
2079   ac_cpp_err=yes
2080 fi
2081 if test -z "$ac_cpp_err"; then
2082   :
2083 else
2084   echo "$as_me: failed program was:" >&5
2085   cat conftest.$ac_ext >&5
2086   # Broken: fails on valid input.
2087 continue
2088 fi
2089 rm -f conftest.err conftest.$ac_ext
2090
2091   # OK, works on sane cases.  Now check whether non-existent headers
2092   # can be detected and how.
2093   cat >conftest.$ac_ext <<_ACEOF
2094 #line 2094 "configure"
2095 #include "confdefs.h"
2096 #include <ac_nonexistent.h>
2097 _ACEOF
2098 if { (eval echo "$as_me:2098: \"$ac_cpp conftest.$ac_ext\"") >&5
2099   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2100   ac_status=$?
2101   egrep -v '^ *\+' conftest.er1 >conftest.err
2102   rm -f conftest.er1
2103   cat conftest.err >&5
2104   echo "$as_me:2104: \$? = $ac_status" >&5
2105   (exit $ac_status); } >/dev/null; then
2106   if test -s conftest.err; then
2107     ac_cpp_err=$ac_c_preproc_warn_flag
2108   else
2109     ac_cpp_err=
2110   fi
2111 else
2112   ac_cpp_err=yes
2113 fi
2114 if test -z "$ac_cpp_err"; then
2115   # Broken: success on invalid input.
2116 continue
2117 else
2118   echo "$as_me: failed program was:" >&5
2119   cat conftest.$ac_ext >&5
2120   # Passes both tests.
2121 ac_preproc_ok=:
2122 break
2123 fi
2124 rm -f conftest.err conftest.$ac_ext
2125
2126 done
2127 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2128 rm -f conftest.err conftest.$ac_ext
2129 if $ac_preproc_ok; then
2130   break
2131 fi
2132
2133     done
2134     ac_cv_prog_CPP=$CPP
2135
2136 fi
2137   CPP=$ac_cv_prog_CPP
2138 else
2139   ac_cv_prog_CPP=$CPP
2140 fi
2141 echo "$as_me:2141: result: $CPP" >&5
2142 echo "${ECHO_T}$CPP" >&6
2143 ac_preproc_ok=false
2144 for ac_c_preproc_warn_flag in '' yes
2145 do
2146   # Use a header file that comes with gcc, so configuring glibc
2147   # with a fresh cross-compiler works.
2148   # On the NeXT, cc -E runs the code through the compiler's parser,
2149   # not just through cpp. "Syntax error" is here to catch this case.
2150   cat >conftest.$ac_ext <<_ACEOF
2151 #line 2151 "configure"
2152 #include "confdefs.h"
2153 #include <assert.h>
2154                      Syntax error
2155 _ACEOF
2156 if { (eval echo "$as_me:2156: \"$ac_cpp conftest.$ac_ext\"") >&5
2157   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2158   ac_status=$?
2159   egrep -v '^ *\+' conftest.er1 >conftest.err
2160   rm -f conftest.er1
2161   cat conftest.err >&5
2162   echo "$as_me:2162: \$? = $ac_status" >&5
2163   (exit $ac_status); } >/dev/null; then
2164   if test -s conftest.err; then
2165     ac_cpp_err=$ac_c_preproc_warn_flag
2166   else
2167     ac_cpp_err=
2168   fi
2169 else
2170   ac_cpp_err=yes
2171 fi
2172 if test -z "$ac_cpp_err"; then
2173   :
2174 else
2175   echo "$as_me: failed program was:" >&5
2176   cat conftest.$ac_ext >&5
2177   # Broken: fails on valid input.
2178 continue
2179 fi
2180 rm -f conftest.err conftest.$ac_ext
2181
2182   # OK, works on sane cases.  Now check whether non-existent headers
2183   # can be detected and how.
2184   cat >conftest.$ac_ext <<_ACEOF
2185 #line 2185 "configure"
2186 #include "confdefs.h"
2187 #include <ac_nonexistent.h>
2188 _ACEOF
2189 if { (eval echo "$as_me:2189: \"$ac_cpp conftest.$ac_ext\"") >&5
2190   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2191   ac_status=$?
2192   egrep -v '^ *\+' conftest.er1 >conftest.err
2193   rm -f conftest.er1
2194   cat conftest.err >&5
2195   echo "$as_me:2195: \$? = $ac_status" >&5
2196   (exit $ac_status); } >/dev/null; then
2197   if test -s conftest.err; then
2198     ac_cpp_err=$ac_c_preproc_warn_flag
2199   else
2200     ac_cpp_err=
2201   fi
2202 else
2203   ac_cpp_err=yes
2204 fi
2205 if test -z "$ac_cpp_err"; then
2206   # Broken: success on invalid input.
2207 continue
2208 else
2209   echo "$as_me: failed program was:" >&5
2210   cat conftest.$ac_ext >&5
2211   # Passes both tests.
2212 ac_preproc_ok=:
2213 break
2214 fi
2215 rm -f conftest.err conftest.$ac_ext
2216
2217 done
2218 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2219 rm -f conftest.err conftest.$ac_ext
2220 if $ac_preproc_ok; then
2221   :
2222 else
2223   { { echo "$as_me:2223: error: C preprocessor \"$CPP\" fails sanity check" >&5
2224 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;}
2225    { (exit 1); exit 1; }; }
2226 fi
2227
2228 ac_ext=c
2229 ac_cpp='$CPP $CPPFLAGS'
2230 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2231 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2232 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2233 ac_main_return=return
2234
2235 for ac_prog in mawk gawk nawk awk
2236 do
2237   # Extract the first word of "$ac_prog", so it can be a program name with args.
2238 set dummy $ac_prog; ac_word=$2
2239 echo "$as_me:2239: checking for $ac_word" >&5
2240 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2241 if test "${ac_cv_prog_AWK+set}" = set; then
2242   echo $ECHO_N "(cached) $ECHO_C" >&6
2243 else
2244   if test -n "$AWK"; then
2245   ac_cv_prog_AWK="$AWK" # Let the user override the test.
2246 else
2247   ac_save_IFS=$IFS; IFS=$ac_path_separator
2248 ac_dummy="$PATH"
2249 for ac_dir in $ac_dummy; do
2250   IFS=$ac_save_IFS
2251   test -z "$ac_dir" && ac_dir=.
2252   $as_executable_p "$ac_dir/$ac_word" || continue
2253 ac_cv_prog_AWK="$ac_prog"
2254 echo "$as_me:2254: found $ac_dir/$ac_word" >&5
2255 break
2256 done
2257
2258 fi
2259 fi
2260 AWK=$ac_cv_prog_AWK
2261 if test -n "$AWK"; then
2262   echo "$as_me:2262: result: $AWK" >&5
2263 echo "${ECHO_T}$AWK" >&6
2264 else
2265   echo "$as_me:2265: result: no" >&5
2266 echo "${ECHO_T}no" >&6
2267 fi
2268
2269   test -n "$AWK" && break
2270 done
2271
2272 # Find a good install program.  We prefer a C program (faster),
2273 # so one script is as good as another.  But avoid the broken or
2274 # incompatible versions:
2275 # SysV /etc/install, /usr/sbin/install
2276 # SunOS /usr/etc/install
2277 # IRIX /sbin/install
2278 # AIX /bin/install
2279 # AmigaOS /C/install, which installs bootblocks on floppy discs
2280 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2281 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2282 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2283 # ./install, which can be erroneously created by make from ./install.sh.
2284 echo "$as_me:2284: checking for a BSD compatible install" >&5
2285 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
2286 if test -z "$INSTALL"; then
2287 if test "${ac_cv_path_install+set}" = set; then
2288   echo $ECHO_N "(cached) $ECHO_C" >&6
2289 else
2290     ac_save_IFS=$IFS; IFS=$ac_path_separator
2291   for ac_dir in $PATH; do
2292     IFS=$ac_save_IFS
2293     # Account for people who put trailing slashes in PATH elements.
2294     case $ac_dir/ in
2295     / | ./ | .// | /cC/* \
2296     | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
2297     | /usr/ucb/* ) ;;
2298     *)
2299       # OSF1 and SCO ODT 3.0 have their own names for install.
2300       # Don't use installbsd from OSF since it installs stuff as root
2301       # by default.
2302       for ac_prog in ginstall scoinst install; do
2303         if $as_executable_p "$ac_dir/$ac_prog"; then
2304           if test $ac_prog = install &&
2305             grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2306             # AIX install.  It has an incompatible calling convention.
2307             :
2308           elif test $ac_prog = install &&
2309             grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2310             # program-specific install script used by HP pwplus--don't use.
2311             :
2312           else
2313             ac_cv_path_install="$ac_dir/$ac_prog -c"
2314             break 2
2315           fi
2316         fi
2317       done
2318       ;;
2319     esac
2320   done
2321
2322 fi
2323   if test "${ac_cv_path_install+set}" = set; then
2324     INSTALL=$ac_cv_path_install
2325   else
2326     # As a last resort, use the slow shell script.  We don't cache a
2327     # path for INSTALL within a source directory, because that will
2328     # break other packages using the cache if that directory is
2329     # removed, or if the path is relative.
2330     INSTALL=$ac_install_sh
2331   fi
2332 fi
2333 echo "$as_me:2333: result: $INSTALL" >&5
2334 echo "${ECHO_T}$INSTALL" >&6
2335
2336 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2337 # It thinks the first close brace ends the variable substitution.
2338 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2339
2340 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2341
2342 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2343
2344 case $INSTALL in
2345 (/*)
2346         ;;
2347 (*)
2348         cf_dir=`echo $INSTALL | sed -e 's%/[^/]*$%%'`
2349         test -z "$cf_dir" && cf_dir=.
2350         INSTALL=`cd $cf_dir && pwd`/`echo $INSTALL | sed -e 's%^.*/%%'`
2351         ;;
2352 esac
2353
2354 for ac_prog in tdlint lint alint splint lclint
2355 do
2356   # Extract the first word of "$ac_prog", so it can be a program name with args.
2357 set dummy $ac_prog; ac_word=$2
2358 echo "$as_me:2358: checking for $ac_word" >&5
2359 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2360 if test "${ac_cv_prog_LINT+set}" = set; then
2361   echo $ECHO_N "(cached) $ECHO_C" >&6
2362 else
2363   if test -n "$LINT"; then
2364   ac_cv_prog_LINT="$LINT" # Let the user override the test.
2365 else
2366   ac_save_IFS=$IFS; IFS=$ac_path_separator
2367 ac_dummy="$PATH"
2368 for ac_dir in $ac_dummy; do
2369   IFS=$ac_save_IFS
2370   test -z "$ac_dir" && ac_dir=.
2371   $as_executable_p "$ac_dir/$ac_word" || continue
2372 ac_cv_prog_LINT="$ac_prog"
2373 echo "$as_me:2373: found $ac_dir/$ac_word" >&5
2374 break
2375 done
2376
2377 fi
2378 fi
2379 LINT=$ac_cv_prog_LINT
2380 if test -n "$LINT"; then
2381   echo "$as_me:2381: result: $LINT" >&5
2382 echo "${ECHO_T}$LINT" >&6
2383 else
2384   echo "$as_me:2384: result: no" >&5
2385 echo "${ECHO_T}no" >&6
2386 fi
2387
2388   test -n "$LINT" && break
2389 done
2390
2391 echo "$as_me:2391: checking if filesystem supports mixed-case filenames" >&5
2392 echo $ECHO_N "checking if filesystem supports mixed-case filenames... $ECHO_C" >&6
2393 if test "${cf_cv_mixedcase+set}" = set; then
2394   echo $ECHO_N "(cached) $ECHO_C" >&6
2395 else
2396
2397 if test "$cross_compiling" = yes ; then
2398         case $target_alias in
2399         (*-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw*|*-uwin*)
2400                 cf_cv_mixedcase=no
2401                 ;;
2402         (*)
2403                 cf_cv_mixedcase=yes
2404                 ;;
2405         esac
2406 else
2407         rm -f conftest CONFTEST
2408         echo test >conftest
2409         if test -f CONFTEST ; then
2410                 cf_cv_mixedcase=no
2411         else
2412                 cf_cv_mixedcase=yes
2413         fi
2414         rm -f conftest CONFTEST
2415 fi
2416
2417 fi
2418 echo "$as_me:2418: result: $cf_cv_mixedcase" >&5
2419 echo "${ECHO_T}$cf_cv_mixedcase" >&6
2420 test "$cf_cv_mixedcase" = yes &&
2421 cat >>confdefs.h <<\EOF
2422 #define MIXEDCASE_FILENAMES 1
2423 EOF
2424
2425 for ac_prog in exctags ctags
2426 do
2427   # Extract the first word of "$ac_prog", so it can be a program name with args.
2428 set dummy $ac_prog; ac_word=$2
2429 echo "$as_me:2429: checking for $ac_word" >&5
2430 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2431 if test "${ac_cv_prog_CTAGS+set}" = set; then
2432   echo $ECHO_N "(cached) $ECHO_C" >&6
2433 else
2434   if test -n "$CTAGS"; then
2435   ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test.
2436 else
2437   ac_save_IFS=$IFS; IFS=$ac_path_separator
2438 ac_dummy="$PATH"
2439 for ac_dir in $ac_dummy; do
2440   IFS=$ac_save_IFS
2441   test -z "$ac_dir" && ac_dir=.
2442   $as_executable_p "$ac_dir/$ac_word" || continue
2443 ac_cv_prog_CTAGS="$ac_prog"
2444 echo "$as_me:2444: found $ac_dir/$ac_word" >&5
2445 break
2446 done
2447
2448 fi
2449 fi
2450 CTAGS=$ac_cv_prog_CTAGS
2451 if test -n "$CTAGS"; then
2452   echo "$as_me:2452: result: $CTAGS" >&5
2453 echo "${ECHO_T}$CTAGS" >&6
2454 else
2455   echo "$as_me:2455: result: no" >&5
2456 echo "${ECHO_T}no" >&6
2457 fi
2458
2459   test -n "$CTAGS" && break
2460 done
2461
2462 for ac_prog in exetags etags
2463 do
2464   # Extract the first word of "$ac_prog", so it can be a program name with args.
2465 set dummy $ac_prog; ac_word=$2
2466 echo "$as_me:2466: checking for $ac_word" >&5
2467 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2468 if test "${ac_cv_prog_ETAGS+set}" = set; then
2469   echo $ECHO_N "(cached) $ECHO_C" >&6
2470 else
2471   if test -n "$ETAGS"; then
2472   ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test.
2473 else
2474   ac_save_IFS=$IFS; IFS=$ac_path_separator
2475 ac_dummy="$PATH"
2476 for ac_dir in $ac_dummy; do
2477   IFS=$ac_save_IFS
2478   test -z "$ac_dir" && ac_dir=.
2479   $as_executable_p "$ac_dir/$ac_word" || continue
2480 ac_cv_prog_ETAGS="$ac_prog"
2481 echo "$as_me:2481: found $ac_dir/$ac_word" >&5
2482 break
2483 done
2484
2485 fi
2486 fi
2487 ETAGS=$ac_cv_prog_ETAGS
2488 if test -n "$ETAGS"; then
2489   echo "$as_me:2489: result: $ETAGS" >&5
2490 echo "${ECHO_T}$ETAGS" >&6
2491 else
2492   echo "$as_me:2492: result: no" >&5
2493 echo "${ECHO_T}no" >&6
2494 fi
2495
2496   test -n "$ETAGS" && break
2497 done
2498
2499 # Extract the first word of "${CTAGS:-ctags}", so it can be a program name with args.
2500 set dummy ${CTAGS:-ctags}; ac_word=$2
2501 echo "$as_me:2501: checking for $ac_word" >&5
2502 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2503 if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" = set; then
2504   echo $ECHO_N "(cached) $ECHO_C" >&6
2505 else
2506   if test -n "$MAKE_LOWER_TAGS"; then
2507   ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test.
2508 else
2509   ac_save_IFS=$IFS; IFS=$ac_path_separator
2510 ac_dummy="$PATH"
2511 for ac_dir in $ac_dummy; do
2512   IFS=$ac_save_IFS
2513   test -z "$ac_dir" && ac_dir=.
2514   $as_executable_p "$ac_dir/$ac_word" || continue
2515 ac_cv_prog_MAKE_LOWER_TAGS="yes"
2516 echo "$as_me:2516: found $ac_dir/$ac_word" >&5
2517 break
2518 done
2519
2520   test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no"
2521 fi
2522 fi
2523 MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS
2524 if test -n "$MAKE_LOWER_TAGS"; then
2525   echo "$as_me:2525: result: $MAKE_LOWER_TAGS" >&5
2526 echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6
2527 else
2528   echo "$as_me:2528: result: no" >&5
2529 echo "${ECHO_T}no" >&6
2530 fi
2531
2532 if test "$cf_cv_mixedcase" = yes ; then
2533         # Extract the first word of "${ETAGS:-etags}", so it can be a program name with args.
2534 set dummy ${ETAGS:-etags}; ac_word=$2
2535 echo "$as_me:2535: checking for $ac_word" >&5
2536 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2537 if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" = set; then
2538   echo $ECHO_N "(cached) $ECHO_C" >&6
2539 else
2540   if test -n "$MAKE_UPPER_TAGS"; then
2541   ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test.
2542 else
2543   ac_save_IFS=$IFS; IFS=$ac_path_separator
2544 ac_dummy="$PATH"
2545 for ac_dir in $ac_dummy; do
2546   IFS=$ac_save_IFS
2547   test -z "$ac_dir" && ac_dir=.
2548   $as_executable_p "$ac_dir/$ac_word" || continue
2549 ac_cv_prog_MAKE_UPPER_TAGS="yes"
2550 echo "$as_me:2550: found $ac_dir/$ac_word" >&5
2551 break
2552 done
2553
2554   test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no"
2555 fi
2556 fi
2557 MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS
2558 if test -n "$MAKE_UPPER_TAGS"; then
2559   echo "$as_me:2559: result: $MAKE_UPPER_TAGS" >&5
2560 echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6
2561 else
2562   echo "$as_me:2562: result: no" >&5
2563 echo "${ECHO_T}no" >&6
2564 fi
2565
2566 else
2567         MAKE_UPPER_TAGS=no
2568 fi
2569
2570 if test "$MAKE_UPPER_TAGS" = yes ; then
2571         MAKE_UPPER_TAGS=
2572 else
2573         MAKE_UPPER_TAGS="#"
2574 fi
2575
2576 if test "$MAKE_LOWER_TAGS" = yes ; then
2577         MAKE_LOWER_TAGS=
2578 else
2579         MAKE_LOWER_TAGS="#"
2580 fi
2581
2582 echo "$as_me:2582: checking if -lm needed for math functions" >&5
2583 echo $ECHO_N "checking if -lm needed for math functions... $ECHO_C" >&6
2584 if test "${cf_cv_need_libm+set}" = set; then
2585   echo $ECHO_N "(cached) $ECHO_C" >&6
2586 else
2587
2588         cat >conftest.$ac_ext <<_ACEOF
2589 #line 2589 "configure"
2590 #include "confdefs.h"
2591
2592         #include <stdio.h>
2593         #include <math.h>
2594
2595 int
2596 main ()
2597 {
2598 double x = rand(); printf("result = %g\n", pow(sin(x),x))
2599   ;
2600   return 0;
2601 }
2602 _ACEOF
2603 rm -f conftest.$ac_objext conftest$ac_exeext
2604 if { (eval echo "$as_me:2604: \"$ac_link\"") >&5
2605   (eval $ac_link) 2>&5
2606   ac_status=$?
2607   echo "$as_me:2607: \$? = $ac_status" >&5
2608   (exit $ac_status); } &&
2609          { ac_try='test -s conftest$ac_exeext'
2610   { (eval echo "$as_me:2610: \"$ac_try\"") >&5
2611   (eval $ac_try) 2>&5
2612   ac_status=$?
2613   echo "$as_me:2613: \$? = $ac_status" >&5
2614   (exit $ac_status); }; }; then
2615   cf_cv_need_libm=no
2616 else
2617   echo "$as_me: failed program was:" >&5
2618 cat conftest.$ac_ext >&5
2619 cf_cv_need_libm=yes
2620 fi
2621 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
2622 fi
2623 echo "$as_me:2623: result: $cf_cv_need_libm" >&5
2624 echo "${ECHO_T}$cf_cv_need_libm" >&6
2625 if test "$cf_cv_need_libm" = yes
2626 then
2627 MATH_LIB=-lm
2628 fi
2629
2630 top_builddir=`pwd`
2631
2632 CC_G_OPT="-g"
2633 CC_SHARED_OPTS=unknown
2634 CPPFLAGS="$CPPFLAGS"
2635 DFT_DEP_SUFFIX=""
2636 DFT_OBJ_SUBDIR=`pwd|sed -e's:.*/::'`
2637 DFT_UPR_MODEL="NORMAL"
2638 LD="ld"
2639 LDFLAGS_SHARED=""
2640 LDFLAGS_STATIC=""
2641 LD_MODEL=""
2642 LD_SHARED_OPTS=""
2643 LIBTOOL=""
2644 LIBTOOL_OPTS=""
2645 LIB_CLEAN=""
2646 LIB_COMPILE=""
2647 LIB_LINK='${CC}'
2648 LINK_TESTS=""
2649 LOCAL_LDFLAGS=""
2650 PACKAGE="ncurses-examples"
2651 PTHREAD="-lm"
2652 TEST_ARGS=""
2653 TEST_DEPS=""
2654 TEST_LIBS=""
2655 TINFO_LDFLAGS=''
2656 TINFO_LIBS='$(LIBS_CURSES)'
2657 cf_cv_abi_version=""
2658 cf_cv_rel_version=""
2659 includesubdir=""
2660
2661 cf_cv_screen=curses
2662 cf_cv_libtype=
2663
2664 if test "$GCC" = yes
2665 then
2666 cat > conftest.i <<EOF
2667 #ifndef GCC_PRINTF
2668 #define GCC_PRINTF 0
2669 #endif
2670 #ifndef GCC_SCANF
2671 #define GCC_SCANF 0
2672 #endif
2673 #ifndef GCC_NORETURN
2674 #define GCC_NORETURN /* nothing */
2675 #endif
2676 #ifndef GCC_UNUSED
2677 #define GCC_UNUSED /* nothing */
2678 #endif
2679 EOF
2680 if test "$GCC" = yes
2681 then
2682         { echo "$as_me:2682: checking for $CC __attribute__ directives..." >&5
2683 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
2684 cat > conftest.$ac_ext <<EOF
2685 #line 2685 "${as_me:-configure}"
2686 #include "confdefs.h"
2687 #include "conftest.h"
2688 #include "conftest.i"
2689 #if     GCC_PRINTF
2690 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
2691 #else
2692 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
2693 #endif
2694 #if     GCC_SCANF
2695 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
2696 #else
2697 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
2698 #endif
2699 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
2700 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
2701 extern void foo(void) GCC_NORETURN;
2702 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
2703 EOF
2704         cf_printf_attribute=no
2705         cf_scanf_attribute=no
2706         for cf_attribute in scanf printf unused noreturn
2707         do
2708
2709 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
2710
2711                 cf_directive="__attribute__(($cf_attribute))"
2712                 echo "checking for $CC $cf_directive" 1>&5
2713
2714                 case $cf_attribute in
2715                 (printf)
2716                         cf_printf_attribute=yes
2717                         cat >conftest.h <<EOF
2718 #define GCC_$cf_ATTRIBUTE 1
2719 EOF
2720                         ;;
2721                 (scanf)
2722                         cf_scanf_attribute=yes
2723                         cat >conftest.h <<EOF
2724 #define GCC_$cf_ATTRIBUTE 1
2725 EOF
2726                         ;;
2727                 (*)
2728                         cat >conftest.h <<EOF
2729 #define GCC_$cf_ATTRIBUTE $cf_directive
2730 EOF
2731                         ;;
2732                 esac
2733
2734                 if { (eval echo "$as_me:2734: \"$ac_compile\"") >&5
2735   (eval $ac_compile) 2>&5
2736   ac_status=$?
2737   echo "$as_me:2737: \$? = $ac_status" >&5
2738   (exit $ac_status); }; then
2739                         test -n "$verbose" && echo "$as_me:2739: result: ... $cf_attribute" >&5
2740 echo "${ECHO_T}... $cf_attribute" >&6
2741                         cat conftest.h >>confdefs.h
2742                         case $cf_attribute in
2743                         (noreturn)
2744
2745 cat >>confdefs.h <<EOF
2746 #define GCC_NORETURN $cf_directive
2747 EOF
2748
2749                                 ;;
2750                         (printf)
2751                                 cf_value='/* nothing */'
2752                                 if test "$cf_printf_attribute" != no ; then
2753                                         cf_value='__attribute__((format(printf,fmt,var)))'
2754
2755 cat >>confdefs.h <<\EOF
2756 #define GCC_PRINTF 1
2757 EOF
2758
2759                                 fi
2760
2761 cat >>confdefs.h <<EOF
2762 #define GCC_PRINTFLIKE(fmt,var) $cf_value
2763 EOF
2764
2765                                 ;;
2766                         (scanf)
2767                                 cf_value='/* nothing */'
2768                                 if test "$cf_scanf_attribute" != no ; then
2769                                         cf_value='__attribute__((format(scanf,fmt,var)))'
2770
2771 cat >>confdefs.h <<\EOF
2772 #define GCC_SCANF 1
2773 EOF
2774
2775                                 fi
2776
2777 cat >>confdefs.h <<EOF
2778 #define GCC_SCANFLIKE(fmt,var) $cf_value
2779 EOF
2780
2781                                 ;;
2782                         (unused)
2783
2784 cat >>confdefs.h <<EOF
2785 #define GCC_UNUSED $cf_directive
2786 EOF
2787
2788                                 ;;
2789                         esac
2790                 fi
2791         done
2792 else
2793         fgrep define conftest.i >>confdefs.h
2794 fi
2795 rm -rf conftest*
2796 fi
2797
2798 cf_XOPEN_SOURCE=500
2799 cf_POSIX_C_SOURCE=199506L
2800 cf_xopen_source=
2801
2802 case $host_os in
2803 (aix[4-7]*)
2804         cf_xopen_source="-D_ALL_SOURCE"
2805         ;;
2806 (cygwin|msys)
2807         cf_XOPEN_SOURCE=600
2808         ;;
2809 (darwin[0-8].*)
2810         cf_xopen_source="-D_APPLE_C_SOURCE"
2811         ;;
2812 (darwin*)
2813         cf_xopen_source="-D_DARWIN_C_SOURCE"
2814         cf_XOPEN_SOURCE=
2815         ;;
2816 (freebsd*|dragonfly*)
2817         # 5.x headers associate
2818         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
2819         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
2820         cf_POSIX_C_SOURCE=200112L
2821         cf_XOPEN_SOURCE=600
2822         cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
2823         ;;
2824 (hpux11*)
2825         cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
2826         ;;
2827 (hpux*)
2828         cf_xopen_source="-D_HPUX_SOURCE"
2829         ;;
2830 (irix[56].*)
2831         cf_xopen_source="-D_SGI_SOURCE"
2832         cf_XOPEN_SOURCE=
2833         ;;
2834 (linux*|gnu*|mint*|k*bsd*-gnu)
2835
2836 echo "$as_me:2836: checking if we must define _GNU_SOURCE" >&5
2837 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
2838 if test "${cf_cv_gnu_source+set}" = set; then
2839   echo $ECHO_N "(cached) $ECHO_C" >&6
2840 else
2841
2842 cat >conftest.$ac_ext <<_ACEOF
2843 #line 2843 "configure"
2844 #include "confdefs.h"
2845 #include <sys/types.h>
2846 int
2847 main ()
2848 {
2849
2850 #ifndef _XOPEN_SOURCE
2851 make an error
2852 #endif
2853   ;
2854   return 0;
2855 }
2856 _ACEOF
2857 rm -f conftest.$ac_objext
2858 if { (eval echo "$as_me:2858: \"$ac_compile\"") >&5
2859   (eval $ac_compile) 2>&5
2860   ac_status=$?
2861   echo "$as_me:2861: \$? = $ac_status" >&5
2862   (exit $ac_status); } &&
2863          { ac_try='test -s conftest.$ac_objext'
2864   { (eval echo "$as_me:2864: \"$ac_try\"") >&5
2865   (eval $ac_try) 2>&5
2866   ac_status=$?
2867   echo "$as_me:2867: \$? = $ac_status" >&5
2868   (exit $ac_status); }; }; then
2869   cf_cv_gnu_source=no
2870 else
2871   echo "$as_me: failed program was:" >&5
2872 cat conftest.$ac_ext >&5
2873 cf_save="$CPPFLAGS"
2874          CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
2875          cat >conftest.$ac_ext <<_ACEOF
2876 #line 2876 "configure"
2877 #include "confdefs.h"
2878 #include <sys/types.h>
2879 int
2880 main ()
2881 {
2882
2883 #ifdef _XOPEN_SOURCE
2884 make an error
2885 #endif
2886   ;
2887   return 0;
2888 }
2889 _ACEOF
2890 rm -f conftest.$ac_objext
2891 if { (eval echo "$as_me:2891: \"$ac_compile\"") >&5
2892   (eval $ac_compile) 2>&5
2893   ac_status=$?
2894   echo "$as_me:2894: \$? = $ac_status" >&5
2895   (exit $ac_status); } &&
2896          { ac_try='test -s conftest.$ac_objext'
2897   { (eval echo "$as_me:2897: \"$ac_try\"") >&5
2898   (eval $ac_try) 2>&5
2899   ac_status=$?
2900   echo "$as_me:2900: \$? = $ac_status" >&5
2901   (exit $ac_status); }; }; then
2902   cf_cv_gnu_source=no
2903 else
2904   echo "$as_me: failed program was:" >&5
2905 cat conftest.$ac_ext >&5
2906 cf_cv_gnu_source=yes
2907 fi
2908 rm -f conftest.$ac_objext conftest.$ac_ext
2909         CPPFLAGS="$cf_save"
2910
2911 fi
2912 rm -f conftest.$ac_objext conftest.$ac_ext
2913
2914 fi
2915 echo "$as_me:2915: result: $cf_cv_gnu_source" >&5
2916 echo "${ECHO_T}$cf_cv_gnu_source" >&6
2917 test "$cf_cv_gnu_source" = yes && CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
2918
2919         ;;
2920 (minix*)
2921         cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this...
2922         ;;
2923 (mirbsd*)
2924         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
2925         cf_XOPEN_SOURCE=
2926
2927 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
2928
2929 cf_save_CFLAGS="$CFLAGS"
2930 cf_save_CPPFLAGS="$CPPFLAGS"
2931
2932 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
2933         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
2934                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
2935
2936 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
2937         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
2938                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
2939
2940 echo "$as_me:2940: checking if we should define _POSIX_C_SOURCE" >&5
2941 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
2942 if test "${cf_cv_posix_c_source+set}" = set; then
2943   echo $ECHO_N "(cached) $ECHO_C" >&6
2944 else
2945
2946 echo "${as_me:-configure}:2946: testing if the symbol is already defined go no further ..." 1>&5
2947
2948         cat >conftest.$ac_ext <<_ACEOF
2949 #line 2949 "configure"
2950 #include "confdefs.h"
2951 #include <sys/types.h>
2952 int
2953 main ()
2954 {
2955
2956 #ifndef _POSIX_C_SOURCE
2957 make an error
2958 #endif
2959   ;
2960   return 0;
2961 }
2962 _ACEOF
2963 rm -f conftest.$ac_objext
2964 if { (eval echo "$as_me:2964: \"$ac_compile\"") >&5
2965   (eval $ac_compile) 2>&5
2966   ac_status=$?
2967   echo "$as_me:2967: \$? = $ac_status" >&5
2968   (exit $ac_status); } &&
2969          { ac_try='test -s conftest.$ac_objext'
2970   { (eval echo "$as_me:2970: \"$ac_try\"") >&5
2971   (eval $ac_try) 2>&5
2972   ac_status=$?
2973   echo "$as_me:2973: \$? = $ac_status" >&5
2974   (exit $ac_status); }; }; then
2975   cf_cv_posix_c_source=no
2976 else
2977   echo "$as_me: failed program was:" >&5
2978 cat conftest.$ac_ext >&5
2979 cf_want_posix_source=no
2980          case .$cf_POSIX_C_SOURCE in
2981          (.[12]??*)
2982                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
2983                 ;;
2984          (.2)
2985                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
2986                 cf_want_posix_source=yes
2987                 ;;
2988          (.*)
2989                 cf_want_posix_source=yes
2990                 ;;
2991          esac
2992          if test "$cf_want_posix_source" = yes ; then
2993                 cat >conftest.$ac_ext <<_ACEOF
2994 #line 2994 "configure"
2995 #include "confdefs.h"
2996 #include <sys/types.h>
2997 int
2998 main ()
2999 {
3000
3001 #ifdef _POSIX_SOURCE
3002 make an error
3003 #endif
3004   ;
3005   return 0;
3006 }
3007 _ACEOF
3008 rm -f conftest.$ac_objext
3009 if { (eval echo "$as_me:3009: \"$ac_compile\"") >&5
3010   (eval $ac_compile) 2>&5
3011   ac_status=$?
3012   echo "$as_me:3012: \$? = $ac_status" >&5
3013   (exit $ac_status); } &&
3014          { ac_try='test -s conftest.$ac_objext'
3015   { (eval echo "$as_me:3015: \"$ac_try\"") >&5
3016   (eval $ac_try) 2>&5
3017   ac_status=$?
3018   echo "$as_me:3018: \$? = $ac_status" >&5
3019   (exit $ac_status); }; }; then
3020   :
3021 else
3022   echo "$as_me: failed program was:" >&5
3023 cat conftest.$ac_ext >&5
3024 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
3025 fi
3026 rm -f conftest.$ac_objext conftest.$ac_ext
3027          fi
3028
3029 echo "${as_me:-configure}:3029: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
3030
3031          CFLAGS="$cf_trim_CFLAGS"
3032          CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
3033
3034 echo "${as_me:-configure}:3034: testing if the second compile does not leave our definition intact error ..." 1>&5
3035
3036          cat >conftest.$ac_ext <<_ACEOF
3037 #line 3037 "configure"
3038 #include "confdefs.h"
3039 #include <sys/types.h>
3040 int
3041 main ()
3042 {
3043
3044 #ifndef _POSIX_C_SOURCE
3045 make an error
3046 #endif
3047   ;
3048   return 0;
3049 }
3050 _ACEOF
3051 rm -f conftest.$ac_objext
3052 if { (eval echo "$as_me:3052: \"$ac_compile\"") >&5
3053   (eval $ac_compile) 2>&5
3054   ac_status=$?
3055   echo "$as_me:3055: \$? = $ac_status" >&5
3056   (exit $ac_status); } &&
3057          { ac_try='test -s conftest.$ac_objext'
3058   { (eval echo "$as_me:3058: \"$ac_try\"") >&5
3059   (eval $ac_try) 2>&5
3060   ac_status=$?
3061   echo "$as_me:3061: \$? = $ac_status" >&5
3062   (exit $ac_status); }; }; then
3063   :
3064 else
3065   echo "$as_me: failed program was:" >&5
3066 cat conftest.$ac_ext >&5
3067 cf_cv_posix_c_source=no
3068 fi
3069 rm -f conftest.$ac_objext conftest.$ac_ext
3070          CFLAGS="$cf_save_CFLAGS"
3071          CPPFLAGS="$cf_save_CPPFLAGS"
3072
3073 fi
3074 rm -f conftest.$ac_objext conftest.$ac_ext
3075
3076 fi
3077 echo "$as_me:3077: result: $cf_cv_posix_c_source" >&5
3078 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
3079
3080 if test "$cf_cv_posix_c_source" != no ; then
3081         CFLAGS="$cf_trim_CFLAGS"
3082         CPPFLAGS="$cf_trim_CPPFLAGS"
3083
3084 cf_fix_cppflags=no
3085 cf_new_cflags=
3086 cf_new_cppflags=
3087 cf_new_extra_cppflags=
3088
3089 for cf_add_cflags in $cf_cv_posix_c_source
3090 do
3091 case $cf_fix_cppflags in
3092 (no)
3093         case $cf_add_cflags in
3094         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
3095                 case $cf_add_cflags in
3096                 (-D*)
3097                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3098
3099                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3100                                 && test -z "${cf_tst_cflags}" \
3101                                 && cf_fix_cppflags=yes
3102
3103                         if test $cf_fix_cppflags = yes ; then
3104                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3105                                 continue
3106                         elif test "${cf_tst_cflags}" = "\"'" ; then
3107                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3108                                 continue
3109                         fi
3110                         ;;
3111                 esac
3112                 case "$CPPFLAGS" in
3113                 (*$cf_add_cflags)
3114                         ;;
3115                 (*)
3116                         case $cf_add_cflags in
3117                         (-D*)
3118                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3119
3120 CPPFLAGS=`echo "$CPPFLAGS" | \
3121         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3122                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3123
3124                                 ;;
3125                         esac
3126                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3127                         ;;
3128                 esac
3129                 ;;
3130         (*)
3131                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
3132                 ;;
3133         esac
3134         ;;
3135 (yes)
3136         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3137
3138         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3139
3140         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3141                 && test -z "${cf_tst_cflags}" \
3142                 && cf_fix_cppflags=no
3143         ;;
3144 esac
3145 done
3146
3147 if test -n "$cf_new_cflags" ; then
3148
3149         CFLAGS="$CFLAGS $cf_new_cflags"
3150 fi
3151
3152 if test -n "$cf_new_cppflags" ; then
3153
3154         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
3155 fi
3156
3157 if test -n "$cf_new_extra_cppflags" ; then
3158
3159         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
3160 fi
3161
3162 fi
3163
3164         ;;
3165 (netbsd*)
3166         cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
3167         ;;
3168 (openbsd[4-9]*)
3169         # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
3170         cf_xopen_source="-D_BSD_SOURCE"
3171         cf_XOPEN_SOURCE=600
3172         ;;
3173 (openbsd*)
3174         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
3175         ;;
3176 (os2*)
3177         cf_XOPEN_SOURCE=
3178         ;;
3179 (osf[45]*)
3180         cf_xopen_source="-D_OSF_SOURCE"
3181         ;;
3182 (nto-qnx*)
3183         cf_xopen_source="-D_QNX_SOURCE"
3184         ;;
3185 (sco*)
3186         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
3187         ;;
3188 (solaris2.*)
3189         cf_xopen_source="-D__EXTENSIONS__"
3190         cf_cv_xopen_source=broken
3191         ;;
3192 (sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
3193         cf_XOPEN_SOURCE=
3194         cf_POSIX_C_SOURCE=
3195         ;;
3196 (*)
3197
3198 echo "$as_me:3198: checking if we should define _XOPEN_SOURCE" >&5
3199 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
3200 if test "${cf_cv_xopen_source+set}" = set; then
3201   echo $ECHO_N "(cached) $ECHO_C" >&6
3202 else
3203
3204         cat >conftest.$ac_ext <<_ACEOF
3205 #line 3205 "configure"
3206 #include "confdefs.h"
3207
3208 #include <stdlib.h>
3209 #include <string.h>
3210 #include <sys/types.h>
3211
3212 int
3213 main ()
3214 {
3215
3216 #ifndef _XOPEN_SOURCE
3217 make an error
3218 #endif
3219   ;
3220   return 0;
3221 }
3222 _ACEOF
3223 rm -f conftest.$ac_objext
3224 if { (eval echo "$as_me:3224: \"$ac_compile\"") >&5
3225   (eval $ac_compile) 2>&5
3226   ac_status=$?
3227   echo "$as_me:3227: \$? = $ac_status" >&5
3228   (exit $ac_status); } &&
3229          { ac_try='test -s conftest.$ac_objext'
3230   { (eval echo "$as_me:3230: \"$ac_try\"") >&5
3231   (eval $ac_try) 2>&5
3232   ac_status=$?
3233   echo "$as_me:3233: \$? = $ac_status" >&5
3234   (exit $ac_status); }; }; then
3235   cf_cv_xopen_source=no
3236 else
3237   echo "$as_me: failed program was:" >&5
3238 cat conftest.$ac_ext >&5
3239 cf_save="$CPPFLAGS"
3240          CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
3241          cat >conftest.$ac_ext <<_ACEOF
3242 #line 3242 "configure"
3243 #include "confdefs.h"
3244
3245 #include <stdlib.h>
3246 #include <string.h>
3247 #include <sys/types.h>
3248
3249 int
3250 main ()
3251 {
3252
3253 #ifdef _XOPEN_SOURCE
3254 make an error
3255 #endif
3256   ;
3257   return 0;
3258 }
3259 _ACEOF
3260 rm -f conftest.$ac_objext
3261 if { (eval echo "$as_me:3261: \"$ac_compile\"") >&5
3262   (eval $ac_compile) 2>&5
3263   ac_status=$?
3264   echo "$as_me:3264: \$? = $ac_status" >&5
3265   (exit $ac_status); } &&
3266          { ac_try='test -s conftest.$ac_objext'
3267   { (eval echo "$as_me:3267: \"$ac_try\"") >&5
3268   (eval $ac_try) 2>&5
3269   ac_status=$?
3270   echo "$as_me:3270: \$? = $ac_status" >&5
3271   (exit $ac_status); }; }; then
3272   cf_cv_xopen_source=no
3273 else
3274   echo "$as_me: failed program was:" >&5
3275 cat conftest.$ac_ext >&5
3276 cf_cv_xopen_source=$cf_XOPEN_SOURCE
3277 fi
3278 rm -f conftest.$ac_objext conftest.$ac_ext
3279         CPPFLAGS="$cf_save"
3280
3281 fi
3282 rm -f conftest.$ac_objext conftest.$ac_ext
3283
3284 fi
3285 echo "$as_me:3285: result: $cf_cv_xopen_source" >&5
3286 echo "${ECHO_T}$cf_cv_xopen_source" >&6
3287
3288 if test "$cf_cv_xopen_source" != no ; then
3289
3290 CFLAGS=`echo "$CFLAGS" | \
3291         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
3292                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
3293
3294 CPPFLAGS=`echo "$CPPFLAGS" | \
3295         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
3296                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
3297
3298         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
3299
3300 cf_fix_cppflags=no
3301 cf_new_cflags=
3302 cf_new_cppflags=
3303 cf_new_extra_cppflags=
3304
3305 for cf_add_cflags in $cf_temp_xopen_source
3306 do
3307 case $cf_fix_cppflags in
3308 (no)
3309         case $cf_add_cflags in
3310         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
3311                 case $cf_add_cflags in
3312                 (-D*)
3313                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3314
3315                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3316                                 && test -z "${cf_tst_cflags}" \
3317                                 && cf_fix_cppflags=yes
3318
3319                         if test $cf_fix_cppflags = yes ; then
3320                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3321                                 continue
3322                         elif test "${cf_tst_cflags}" = "\"'" ; then
3323                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3324                                 continue
3325                         fi
3326                         ;;
3327                 esac
3328                 case "$CPPFLAGS" in
3329                 (*$cf_add_cflags)
3330                         ;;
3331                 (*)
3332                         case $cf_add_cflags in
3333                         (-D*)
3334                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3335
3336 CPPFLAGS=`echo "$CPPFLAGS" | \
3337         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3338                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3339
3340                                 ;;
3341                         esac
3342                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3343                         ;;
3344                 esac
3345                 ;;
3346         (*)
3347                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
3348                 ;;
3349         esac
3350         ;;
3351 (yes)
3352         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3353
3354         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3355
3356         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3357                 && test -z "${cf_tst_cflags}" \
3358                 && cf_fix_cppflags=no
3359         ;;
3360 esac
3361 done
3362
3363 if test -n "$cf_new_cflags" ; then
3364
3365         CFLAGS="$CFLAGS $cf_new_cflags"
3366 fi
3367
3368 if test -n "$cf_new_cppflags" ; then
3369
3370         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
3371 fi
3372
3373 if test -n "$cf_new_extra_cppflags" ; then
3374
3375         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
3376 fi
3377
3378 fi
3379
3380 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
3381
3382 cf_save_CFLAGS="$CFLAGS"
3383 cf_save_CPPFLAGS="$CPPFLAGS"
3384
3385 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
3386         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
3387                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
3388
3389 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
3390         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
3391                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
3392
3393 echo "$as_me:3393: checking if we should define _POSIX_C_SOURCE" >&5
3394 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
3395 if test "${cf_cv_posix_c_source+set}" = set; then
3396   echo $ECHO_N "(cached) $ECHO_C" >&6
3397 else
3398
3399 echo "${as_me:-configure}:3399: testing if the symbol is already defined go no further ..." 1>&5
3400
3401         cat >conftest.$ac_ext <<_ACEOF
3402 #line 3402 "configure"
3403 #include "confdefs.h"
3404 #include <sys/types.h>
3405 int
3406 main ()
3407 {
3408
3409 #ifndef _POSIX_C_SOURCE
3410 make an error
3411 #endif
3412   ;
3413   return 0;
3414 }
3415 _ACEOF
3416 rm -f conftest.$ac_objext
3417 if { (eval echo "$as_me:3417: \"$ac_compile\"") >&5
3418   (eval $ac_compile) 2>&5
3419   ac_status=$?
3420   echo "$as_me:3420: \$? = $ac_status" >&5
3421   (exit $ac_status); } &&
3422          { ac_try='test -s conftest.$ac_objext'
3423   { (eval echo "$as_me:3423: \"$ac_try\"") >&5
3424   (eval $ac_try) 2>&5
3425   ac_status=$?
3426   echo "$as_me:3426: \$? = $ac_status" >&5
3427   (exit $ac_status); }; }; then
3428   cf_cv_posix_c_source=no
3429 else
3430   echo "$as_me: failed program was:" >&5
3431 cat conftest.$ac_ext >&5
3432 cf_want_posix_source=no
3433          case .$cf_POSIX_C_SOURCE in
3434          (.[12]??*)
3435                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
3436                 ;;
3437          (.2)
3438                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
3439                 cf_want_posix_source=yes
3440                 ;;
3441          (.*)
3442                 cf_want_posix_source=yes
3443                 ;;
3444          esac
3445          if test "$cf_want_posix_source" = yes ; then
3446                 cat >conftest.$ac_ext <<_ACEOF
3447 #line 3447 "configure"
3448 #include "confdefs.h"
3449 #include <sys/types.h>
3450 int
3451 main ()
3452 {
3453
3454 #ifdef _POSIX_SOURCE
3455 make an error
3456 #endif
3457   ;
3458   return 0;
3459 }
3460 _ACEOF
3461 rm -f conftest.$ac_objext
3462 if { (eval echo "$as_me:3462: \"$ac_compile\"") >&5
3463   (eval $ac_compile) 2>&5
3464   ac_status=$?
3465   echo "$as_me:3465: \$? = $ac_status" >&5
3466   (exit $ac_status); } &&
3467          { ac_try='test -s conftest.$ac_objext'
3468   { (eval echo "$as_me:3468: \"$ac_try\"") >&5
3469   (eval $ac_try) 2>&5
3470   ac_status=$?
3471   echo "$as_me:3471: \$? = $ac_status" >&5
3472   (exit $ac_status); }; }; then
3473   :
3474 else
3475   echo "$as_me: failed program was:" >&5
3476 cat conftest.$ac_ext >&5
3477 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
3478 fi
3479 rm -f conftest.$ac_objext conftest.$ac_ext
3480          fi
3481
3482 echo "${as_me:-configure}:3482: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
3483
3484          CFLAGS="$cf_trim_CFLAGS"
3485          CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
3486
3487 echo "${as_me:-configure}:3487: testing if the second compile does not leave our definition intact error ..." 1>&5
3488
3489          cat >conftest.$ac_ext <<_ACEOF
3490 #line 3490 "configure"
3491 #include "confdefs.h"
3492 #include <sys/types.h>
3493 int
3494 main ()
3495 {
3496
3497 #ifndef _POSIX_C_SOURCE
3498 make an error
3499 #endif
3500   ;
3501   return 0;
3502 }
3503 _ACEOF
3504 rm -f conftest.$ac_objext
3505 if { (eval echo "$as_me:3505: \"$ac_compile\"") >&5
3506   (eval $ac_compile) 2>&5
3507   ac_status=$?
3508   echo "$as_me:3508: \$? = $ac_status" >&5
3509   (exit $ac_status); } &&
3510          { ac_try='test -s conftest.$ac_objext'
3511   { (eval echo "$as_me:3511: \"$ac_try\"") >&5
3512   (eval $ac_try) 2>&5
3513   ac_status=$?
3514   echo "$as_me:3514: \$? = $ac_status" >&5
3515   (exit $ac_status); }; }; then
3516   :
3517 else
3518   echo "$as_me: failed program was:" >&5
3519 cat conftest.$ac_ext >&5
3520 cf_cv_posix_c_source=no
3521 fi
3522 rm -f conftest.$ac_objext conftest.$ac_ext
3523          CFLAGS="$cf_save_CFLAGS"
3524          CPPFLAGS="$cf_save_CPPFLAGS"
3525
3526 fi
3527 rm -f conftest.$ac_objext conftest.$ac_ext
3528
3529 fi
3530 echo "$as_me:3530: result: $cf_cv_posix_c_source" >&5
3531 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
3532
3533 if test "$cf_cv_posix_c_source" != no ; then
3534         CFLAGS="$cf_trim_CFLAGS"
3535         CPPFLAGS="$cf_trim_CPPFLAGS"
3536
3537 cf_fix_cppflags=no
3538 cf_new_cflags=
3539 cf_new_cppflags=
3540 cf_new_extra_cppflags=
3541
3542 for cf_add_cflags in $cf_cv_posix_c_source
3543 do
3544 case $cf_fix_cppflags in
3545 (no)
3546         case $cf_add_cflags in
3547         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
3548                 case $cf_add_cflags in
3549                 (-D*)
3550                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3551
3552                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3553                                 && test -z "${cf_tst_cflags}" \
3554                                 && cf_fix_cppflags=yes
3555
3556                         if test $cf_fix_cppflags = yes ; then
3557                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3558                                 continue
3559                         elif test "${cf_tst_cflags}" = "\"'" ; then
3560                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3561                                 continue
3562                         fi
3563                         ;;
3564                 esac
3565                 case "$CPPFLAGS" in
3566                 (*$cf_add_cflags)
3567                         ;;
3568                 (*)
3569                         case $cf_add_cflags in
3570                         (-D*)
3571                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3572
3573 CPPFLAGS=`echo "$CPPFLAGS" | \
3574         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3575                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3576
3577                                 ;;
3578                         esac
3579                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3580                         ;;
3581                 esac
3582                 ;;
3583         (*)
3584                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
3585                 ;;
3586         esac
3587         ;;
3588 (yes)
3589         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3590
3591         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3592
3593         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3594                 && test -z "${cf_tst_cflags}" \
3595                 && cf_fix_cppflags=no
3596         ;;
3597 esac
3598 done
3599
3600 if test -n "$cf_new_cflags" ; then
3601
3602         CFLAGS="$CFLAGS $cf_new_cflags"
3603 fi
3604
3605 if test -n "$cf_new_cppflags" ; then
3606
3607         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
3608 fi
3609
3610 if test -n "$cf_new_extra_cppflags" ; then
3611
3612         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
3613 fi
3614
3615 fi
3616
3617         ;;
3618 esac
3619
3620 if test -n "$cf_xopen_source" ; then
3621
3622 cf_fix_cppflags=no
3623 cf_new_cflags=
3624 cf_new_cppflags=
3625 cf_new_extra_cppflags=
3626
3627 for cf_add_cflags in $cf_xopen_source
3628 do
3629 case $cf_fix_cppflags in
3630 (no)
3631         case $cf_add_cflags in
3632         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
3633                 case $cf_add_cflags in
3634                 (-D*)
3635                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3636
3637                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3638                                 && test -z "${cf_tst_cflags}" \
3639                                 && cf_fix_cppflags=yes
3640
3641                         if test $cf_fix_cppflags = yes ; then
3642                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3643                                 continue
3644                         elif test "${cf_tst_cflags}" = "\"'" ; then
3645                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3646                                 continue
3647                         fi
3648                         ;;
3649                 esac
3650                 case "$CPPFLAGS" in
3651                 (*$cf_add_cflags)
3652                         ;;
3653                 (*)
3654                         case $cf_add_cflags in
3655                         (-D*)
3656                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3657
3658 CPPFLAGS=`echo "$CPPFLAGS" | \
3659         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3660                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3661
3662                                 ;;
3663                         esac
3664                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3665                         ;;
3666                 esac
3667                 ;;
3668         (*)
3669                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
3670                 ;;
3671         esac
3672         ;;
3673 (yes)
3674         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3675
3676         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3677
3678         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3679                 && test -z "${cf_tst_cflags}" \
3680                 && cf_fix_cppflags=no
3681         ;;
3682 esac
3683 done
3684
3685 if test -n "$cf_new_cflags" ; then
3686         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
3687
3688 echo "${as_me:-configure}:3688: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
3689
3690         CFLAGS="$CFLAGS $cf_new_cflags"
3691 fi
3692
3693 if test -n "$cf_new_cppflags" ; then
3694         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
3695
3696 echo "${as_me:-configure}:3696: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
3697
3698         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
3699 fi
3700
3701 if test -n "$cf_new_extra_cppflags" ; then
3702         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
3703
3704 echo "${as_me:-configure}:3704: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
3705
3706         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
3707 fi
3708
3709 fi
3710
3711 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
3712         echo "$as_me:3712: checking if _XOPEN_SOURCE really is set" >&5
3713 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
3714         cat >conftest.$ac_ext <<_ACEOF
3715 #line 3715 "configure"
3716 #include "confdefs.h"
3717 #include <stdlib.h>
3718 int
3719 main ()
3720 {
3721
3722 #ifndef _XOPEN_SOURCE
3723 make an error
3724 #endif
3725   ;
3726   return 0;
3727 }
3728 _ACEOF
3729 rm -f conftest.$ac_objext
3730 if { (eval echo "$as_me:3730: \"$ac_compile\"") >&5
3731   (eval $ac_compile) 2>&5
3732   ac_status=$?
3733   echo "$as_me:3733: \$? = $ac_status" >&5
3734   (exit $ac_status); } &&
3735          { ac_try='test -s conftest.$ac_objext'
3736   { (eval echo "$as_me:3736: \"$ac_try\"") >&5
3737   (eval $ac_try) 2>&5
3738   ac_status=$?
3739   echo "$as_me:3739: \$? = $ac_status" >&5
3740   (exit $ac_status); }; }; then
3741   cf_XOPEN_SOURCE_set=yes
3742 else
3743   echo "$as_me: failed program was:" >&5
3744 cat conftest.$ac_ext >&5
3745 cf_XOPEN_SOURCE_set=no
3746 fi
3747 rm -f conftest.$ac_objext conftest.$ac_ext
3748         echo "$as_me:3748: result: $cf_XOPEN_SOURCE_set" >&5
3749 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
3750         if test $cf_XOPEN_SOURCE_set = yes
3751         then
3752                 cat >conftest.$ac_ext <<_ACEOF
3753 #line 3753 "configure"
3754 #include "confdefs.h"
3755 #include <stdlib.h>
3756 int
3757 main ()
3758 {
3759
3760 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_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_XOPEN_SOURCE_set_ok=yes
3780 else
3781   echo "$as_me: failed program was:" >&5
3782 cat conftest.$ac_ext >&5
3783 cf_XOPEN_SOURCE_set_ok=no
3784 fi
3785 rm -f conftest.$ac_objext conftest.$ac_ext
3786                 if test $cf_XOPEN_SOURCE_set_ok = no
3787                 then
3788                         { echo "$as_me:3788: WARNING: _XOPEN_SOURCE is lower than requested" >&5
3789 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
3790                 fi
3791         else
3792
3793 echo "$as_me:3793: checking if we should define _XOPEN_SOURCE" >&5
3794 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
3795 if test "${cf_cv_xopen_source+set}" = set; then
3796   echo $ECHO_N "(cached) $ECHO_C" >&6
3797 else
3798
3799         cat >conftest.$ac_ext <<_ACEOF
3800 #line 3800 "configure"
3801 #include "confdefs.h"
3802
3803 #include <stdlib.h>
3804 #include <string.h>
3805 #include <sys/types.h>
3806
3807 int
3808 main ()
3809 {
3810
3811 #ifndef _XOPEN_SOURCE
3812 make an error
3813 #endif
3814   ;
3815   return 0;
3816 }
3817 _ACEOF
3818 rm -f conftest.$ac_objext
3819 if { (eval echo "$as_me:3819: \"$ac_compile\"") >&5
3820   (eval $ac_compile) 2>&5
3821   ac_status=$?
3822   echo "$as_me:3822: \$? = $ac_status" >&5
3823   (exit $ac_status); } &&
3824          { ac_try='test -s conftest.$ac_objext'
3825   { (eval echo "$as_me:3825: \"$ac_try\"") >&5
3826   (eval $ac_try) 2>&5
3827   ac_status=$?
3828   echo "$as_me:3828: \$? = $ac_status" >&5
3829   (exit $ac_status); }; }; then
3830   cf_cv_xopen_source=no
3831 else
3832   echo "$as_me: failed program was:" >&5
3833 cat conftest.$ac_ext >&5
3834 cf_save="$CPPFLAGS"
3835          CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
3836          cat >conftest.$ac_ext <<_ACEOF
3837 #line 3837 "configure"
3838 #include "confdefs.h"
3839
3840 #include <stdlib.h>
3841 #include <string.h>
3842 #include <sys/types.h>
3843
3844 int
3845 main ()
3846 {
3847
3848 #ifdef _XOPEN_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   cf_cv_xopen_source=no
3868 else
3869   echo "$as_me: failed program was:" >&5
3870 cat conftest.$ac_ext >&5
3871 cf_cv_xopen_source=$cf_XOPEN_SOURCE
3872 fi
3873 rm -f conftest.$ac_objext conftest.$ac_ext
3874         CPPFLAGS="$cf_save"
3875
3876 fi
3877 rm -f conftest.$ac_objext conftest.$ac_ext
3878
3879 fi
3880 echo "$as_me:3880: result: $cf_cv_xopen_source" >&5
3881 echo "${ECHO_T}$cf_cv_xopen_source" >&6
3882
3883 if test "$cf_cv_xopen_source" != no ; then
3884
3885 CFLAGS=`echo "$CFLAGS" | \
3886         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
3887                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
3888
3889 CPPFLAGS=`echo "$CPPFLAGS" | \
3890         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
3891                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
3892
3893         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
3894
3895 cf_fix_cppflags=no
3896 cf_new_cflags=
3897 cf_new_cppflags=
3898 cf_new_extra_cppflags=
3899
3900 for cf_add_cflags in $cf_temp_xopen_source
3901 do
3902 case $cf_fix_cppflags in
3903 (no)
3904         case $cf_add_cflags in
3905         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
3906                 case $cf_add_cflags in
3907                 (-D*)
3908                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3909
3910                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3911                                 && test -z "${cf_tst_cflags}" \
3912                                 && cf_fix_cppflags=yes
3913
3914                         if test $cf_fix_cppflags = yes ; then
3915                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3916                                 continue
3917                         elif test "${cf_tst_cflags}" = "\"'" ; then
3918                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3919                                 continue
3920                         fi
3921                         ;;
3922                 esac
3923                 case "$CPPFLAGS" in
3924                 (*$cf_add_cflags)
3925                         ;;
3926                 (*)
3927                         case $cf_add_cflags in
3928                         (-D*)
3929                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3930
3931 CPPFLAGS=`echo "$CPPFLAGS" | \
3932         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3933                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3934
3935                                 ;;
3936                         esac
3937                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3938                         ;;
3939                 esac
3940                 ;;
3941         (*)
3942                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
3943                 ;;
3944         esac
3945         ;;
3946 (yes)
3947         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3948
3949         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3950
3951         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3952                 && test -z "${cf_tst_cflags}" \
3953                 && cf_fix_cppflags=no
3954         ;;
3955 esac
3956 done
3957
3958 if test -n "$cf_new_cflags" ; then
3959
3960         CFLAGS="$CFLAGS $cf_new_cflags"
3961 fi
3962
3963 if test -n "$cf_new_cppflags" ; then
3964
3965         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
3966 fi
3967
3968 if test -n "$cf_new_extra_cppflags" ; then
3969
3970         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
3971 fi
3972
3973 fi
3974
3975         fi
3976 fi
3977
3978 echo "$as_me:3978: checking for signal global datatype" >&5
3979 echo $ECHO_N "checking for signal global datatype... $ECHO_C" >&6
3980 if test "${cf_cv_sig_atomic_t+set}" = set; then
3981   echo $ECHO_N "(cached) $ECHO_C" >&6
3982 else
3983
3984         for cf_type in \
3985                 "volatile sig_atomic_t" \
3986                 "sig_atomic_t" \
3987                 "int"
3988         do
3989         cat >conftest.$ac_ext <<_ACEOF
3990 #line 3990 "configure"
3991 #include "confdefs.h"
3992
3993 #include <sys/types.h>
3994 #include <signal.h>
3995 #include <stdio.h>
3996
3997 extern $cf_type x;
3998 $cf_type x;
3999 static void handler(int sig)
4000 {
4001         x = 5;
4002 }
4003 int
4004 main ()
4005 {
4006 signal(SIGINT, handler);
4007                  x = 1
4008   ;
4009   return 0;
4010 }
4011 _ACEOF
4012 rm -f conftest.$ac_objext
4013 if { (eval echo "$as_me:4013: \"$ac_compile\"") >&5
4014   (eval $ac_compile) 2>&5
4015   ac_status=$?
4016   echo "$as_me:4016: \$? = $ac_status" >&5
4017   (exit $ac_status); } &&
4018          { ac_try='test -s conftest.$ac_objext'
4019   { (eval echo "$as_me:4019: \"$ac_try\"") >&5
4020   (eval $ac_try) 2>&5
4021   ac_status=$?
4022   echo "$as_me:4022: \$? = $ac_status" >&5
4023   (exit $ac_status); }; }; then
4024   cf_cv_sig_atomic_t=$cf_type
4025 else
4026   echo "$as_me: failed program was:" >&5
4027 cat conftest.$ac_ext >&5
4028 cf_cv_sig_atomic_t=no
4029 fi
4030 rm -f conftest.$ac_objext conftest.$ac_ext
4031                 test "$cf_cv_sig_atomic_t" != no && break
4032         done
4033
4034 fi
4035
4036 echo "$as_me:4036: result: $cf_cv_sig_atomic_t" >&5
4037 echo "${ECHO_T}$cf_cv_sig_atomic_t" >&6
4038 test "$cf_cv_sig_atomic_t" != no &&
4039 cat >>confdefs.h <<EOF
4040 #define SIG_ATOMIC_T $cf_cv_sig_atomic_t
4041 EOF
4042
4043 echo "$as_me:4043: checking if you want to use pkg-config" >&5
4044 echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6
4045
4046 # Check whether --with-pkg-config or --without-pkg-config was given.
4047 if test "${with_pkg_config+set}" = set; then
4048   withval="$with_pkg_config"
4049   cf_pkg_config=$withval
4050 else
4051   cf_pkg_config=yes
4052 fi;
4053 echo "$as_me:4053: result: $cf_pkg_config" >&5
4054 echo "${ECHO_T}$cf_pkg_config" >&6
4055
4056 case $cf_pkg_config in
4057 (no)
4058         PKG_CONFIG=none
4059         ;;
4060 (yes)
4061
4062 if test -n "$ac_tool_prefix"; then
4063   # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
4064 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
4065 echo "$as_me:4065: checking for $ac_word" >&5
4066 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4067 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
4068   echo $ECHO_N "(cached) $ECHO_C" >&6
4069 else
4070   case $PKG_CONFIG in
4071   [\\/]* | ?:[\\/]*)
4072   ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
4073   ;;
4074   *)
4075   ac_save_IFS=$IFS; IFS=$ac_path_separator
4076 ac_dummy="$PATH"
4077 for ac_dir in $ac_dummy; do
4078   IFS=$ac_save_IFS
4079   test -z "$ac_dir" && ac_dir=.
4080   if $as_executable_p "$ac_dir/$ac_word"; then
4081    ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
4082    echo "$as_me:4082: found $ac_dir/$ac_word" >&5
4083    break
4084 fi
4085 done
4086
4087   ;;
4088 esac
4089 fi
4090 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
4091
4092 if test -n "$PKG_CONFIG"; then
4093   echo "$as_me:4093: result: $PKG_CONFIG" >&5
4094 echo "${ECHO_T}$PKG_CONFIG" >&6
4095 else
4096   echo "$as_me:4096: result: no" >&5
4097 echo "${ECHO_T}no" >&6
4098 fi
4099
4100 fi
4101 if test -z "$ac_cv_path_PKG_CONFIG"; then
4102   ac_pt_PKG_CONFIG=$PKG_CONFIG
4103   # Extract the first word of "pkg-config", so it can be a program name with args.
4104 set dummy pkg-config; ac_word=$2
4105 echo "$as_me:4105: checking for $ac_word" >&5
4106 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4107 if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
4108   echo $ECHO_N "(cached) $ECHO_C" >&6
4109 else
4110   case $ac_pt_PKG_CONFIG in
4111   [\\/]* | ?:[\\/]*)
4112   ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
4113   ;;
4114   *)
4115   ac_save_IFS=$IFS; IFS=$ac_path_separator
4116 ac_dummy="$PATH"
4117 for ac_dir in $ac_dummy; do
4118   IFS=$ac_save_IFS
4119   test -z "$ac_dir" && ac_dir=.
4120   if $as_executable_p "$ac_dir/$ac_word"; then
4121    ac_cv_path_ac_pt_PKG_CONFIG="$ac_dir/$ac_word"
4122    echo "$as_me:4122: found $ac_dir/$ac_word" >&5
4123    break
4124 fi
4125 done
4126
4127   test -z "$ac_cv_path_ac_pt_PKG_CONFIG" && ac_cv_path_ac_pt_PKG_CONFIG="none"
4128   ;;
4129 esac
4130 fi
4131 ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
4132
4133 if test -n "$ac_pt_PKG_CONFIG"; then
4134   echo "$as_me:4134: result: $ac_pt_PKG_CONFIG" >&5
4135 echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
4136 else
4137   echo "$as_me:4137: result: no" >&5
4138 echo "${ECHO_T}no" >&6
4139 fi
4140
4141   PKG_CONFIG=$ac_pt_PKG_CONFIG
4142 else
4143   PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
4144 fi
4145
4146         ;;
4147 (*)
4148         PKG_CONFIG=$withval
4149         ;;
4150 esac
4151
4152 test -z "$PKG_CONFIG" && PKG_CONFIG=none
4153 if test "$PKG_CONFIG" != none ; then
4154
4155 if test "x$prefix" != xNONE; then
4156         cf_path_syntax="$prefix"
4157 else
4158         cf_path_syntax="$ac_default_prefix"
4159 fi
4160
4161 case ".$PKG_CONFIG" in
4162 (.\$\(*\)*|.\'*\'*)
4163         ;;
4164 (..|./*|.\\*)
4165         ;;
4166 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
4167         ;;
4168 (.\${*prefix}*|.\${*dir}*)
4169         eval PKG_CONFIG="$PKG_CONFIG"
4170         case ".$PKG_CONFIG" in
4171         (.NONE/*)
4172                 PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
4173                 ;;
4174         esac
4175         ;;
4176 (.no|.NONE/*)
4177         PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
4178         ;;
4179 (*)
4180         { { echo "$as_me:4180: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
4181 echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
4182    { (exit 1); exit 1; }; }
4183         ;;
4184 esac
4185
4186 elif test "x$cf_pkg_config" != xno ; then
4187         { echo "$as_me:4187: WARNING: pkg-config is not installed" >&5
4188 echo "$as_me: WARNING: pkg-config is not installed" >&2;}
4189 fi
4190
4191 echo "$as_me:4191: checking if you want to see long compiling messages" >&5
4192 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
4193
4194 # Check whether --enable-echo or --disable-echo was given.
4195 if test "${enable_echo+set}" = set; then
4196   enableval="$enable_echo"
4197   test "$enableval" != no && enableval=yes
4198         if test "$enableval" != "yes" ; then
4199
4200         ECHO_LT='--silent'
4201         ECHO_LD='@echo linking $@;'
4202         RULE_CC='@echo compiling $<'
4203         SHOW_CC='@echo compiling $@'
4204         ECHO_CC='@'
4205
4206         else
4207
4208         ECHO_LT=''
4209         ECHO_LD=''
4210         RULE_CC=''
4211         SHOW_CC=''
4212         ECHO_CC=''
4213
4214         fi
4215 else
4216   enableval=yes
4217
4218         ECHO_LT=''
4219         ECHO_LD=''
4220         RULE_CC=''
4221         SHOW_CC=''
4222         ECHO_CC=''
4223
4224 fi;
4225 echo "$as_me:4225: result: $enableval" >&5
4226 echo "${ECHO_T}$enableval" >&6
4227
4228 echo "$as_me:4228: checking for ncurses wrap-prefix" >&5
4229 echo $ECHO_N "checking for ncurses wrap-prefix... $ECHO_C" >&6
4230
4231 # Check whether --with-ncurses-wrap-prefix or --without-ncurses-wrap-prefix was given.
4232 if test "${with_ncurses_wrap_prefix+set}" = set; then
4233   withval="$with_ncurses_wrap_prefix"
4234   NCURSES_WRAP_PREFIX=$withval
4235 else
4236   NCURSES_WRAP_PREFIX=_nc_
4237 fi;
4238 echo "$as_me:4238: result: $NCURSES_WRAP_PREFIX" >&5
4239 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
4240
4241 echo "$as_me:4241: checking if you want to check for wide-character functions" >&5
4242 echo $ECHO_N "checking if you want to check for wide-character functions... $ECHO_C" >&6
4243
4244 # Check whether --enable-widec or --disable-widec was given.
4245 if test "${enable_widec+set}" = set; then
4246   enableval="$enable_widec"
4247   test "$enableval" != no && enableval=yes
4248         if test "$enableval" != "yes" ; then
4249     cf_enable_widec=no
4250         else
4251                 cf_enable_widec=yes
4252         fi
4253 else
4254   enableval=yes
4255         cf_enable_widec=yes
4256
4257 fi;
4258 echo "$as_me:4258: result: $cf_enable_widec" >&5
4259 echo "${ECHO_T}$cf_enable_widec" >&6
4260
4261 echo "$as_me:4261: checking for specific curses-directory" >&5
4262 echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
4263
4264 # Check whether --with-curses-dir or --without-curses-dir was given.
4265 if test "${with_curses_dir+set}" = set; then
4266   withval="$with_curses_dir"
4267   cf_cv_curses_dir=$withval
4268 else
4269   cf_cv_curses_dir=no
4270 fi;
4271 echo "$as_me:4271: result: $cf_cv_curses_dir" >&5
4272 echo "${ECHO_T}$cf_cv_curses_dir" >&6
4273
4274 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
4275 then
4276
4277 if test "x$prefix" != xNONE; then
4278         cf_path_syntax="$prefix"
4279 else
4280         cf_path_syntax="$ac_default_prefix"
4281 fi
4282
4283 case ".$withval" in
4284 (.\$\(*\)*|.\'*\'*)
4285         ;;
4286 (..|./*|.\\*)
4287         ;;
4288 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
4289         ;;
4290 (.\${*prefix}*|.\${*dir}*)
4291         eval withval="$withval"
4292         case ".$withval" in
4293         (.NONE/*)
4294                 withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
4295                 ;;
4296         esac
4297         ;;
4298 (.no|.NONE/*)
4299         withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
4300         ;;
4301 (*)
4302         { { echo "$as_me:4302: error: expected a pathname, not \"$withval\"" >&5
4303 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
4304    { (exit 1); exit 1; }; }
4305         ;;
4306 esac
4307
4308         if test -d "$cf_cv_curses_dir"
4309         then
4310
4311 if test -n "$cf_cv_curses_dir/include" ; then
4312   for cf_add_incdir in $cf_cv_curses_dir/include
4313   do
4314         while test $cf_add_incdir != /usr/include
4315         do
4316           if test -d $cf_add_incdir
4317           then
4318                 cf_have_incdir=no
4319                 if test -n "$CFLAGS$CPPFLAGS" ; then
4320                   # a loop is needed to ensure we can add subdirs of existing dirs
4321                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4322                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4323                           cf_have_incdir=yes; break
4324                         fi
4325                   done
4326                 fi
4327
4328                 if test "$cf_have_incdir" = no ; then
4329                   if test "$cf_add_incdir" = /usr/local/include ; then
4330                         if test "$GCC" = yes
4331                         then
4332                           cf_save_CPPFLAGS=$CPPFLAGS
4333                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4334                           cat >conftest.$ac_ext <<_ACEOF
4335 #line 4335 "configure"
4336 #include "confdefs.h"
4337 #include <stdio.h>
4338 int
4339 main ()
4340 {
4341 printf("Hello")
4342   ;
4343   return 0;
4344 }
4345 _ACEOF
4346 rm -f conftest.$ac_objext
4347 if { (eval echo "$as_me:4347: \"$ac_compile\"") >&5
4348   (eval $ac_compile) 2>&5
4349   ac_status=$?
4350   echo "$as_me:4350: \$? = $ac_status" >&5
4351   (exit $ac_status); } &&
4352          { ac_try='test -s conftest.$ac_objext'
4353   { (eval echo "$as_me:4353: \"$ac_try\"") >&5
4354   (eval $ac_try) 2>&5
4355   ac_status=$?
4356   echo "$as_me:4356: \$? = $ac_status" >&5
4357   (exit $ac_status); }; }; then
4358   :
4359 else
4360   echo "$as_me: failed program was:" >&5
4361 cat conftest.$ac_ext >&5
4362 cf_have_incdir=yes
4363 fi
4364 rm -f conftest.$ac_objext conftest.$ac_ext
4365                           CPPFLAGS=$cf_save_CPPFLAGS
4366                         fi
4367                   fi
4368                 fi
4369
4370                 if test "$cf_have_incdir" = no ; then
4371                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4372
4373 echo "${as_me:-configure}:4373: testing adding $cf_add_incdir to include-path ..." 1>&5
4374
4375                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4376
4377                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
4378                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4379                   cf_add_incdir="$cf_top_incdir"
4380                 else
4381                   break
4382                 fi
4383           else
4384                 break
4385           fi
4386         done
4387   done
4388 fi
4389
4390 if test -n "$cf_cv_curses_dir/lib" ; then
4391         for cf_add_libdir in $cf_cv_curses_dir/lib
4392         do
4393                 if test $cf_add_libdir = /usr/lib ; then
4394                         :
4395                 elif test -d $cf_add_libdir
4396                 then
4397                         cf_have_libdir=no
4398                         if test -n "$LDFLAGS$LIBS" ; then
4399                                 # a loop is needed to ensure we can add subdirs of existing dirs
4400                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
4401                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
4402                                                 cf_have_libdir=yes; break
4403                                         fi
4404                                 done
4405                         fi
4406                         if test "$cf_have_libdir" = no ; then
4407                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
4408
4409 echo "${as_me:-configure}:4409: testing adding $cf_add_libdir to library-path ..." 1>&5
4410
4411                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
4412                         fi
4413                 fi
4414         done
4415 fi
4416
4417         fi
4418 fi
4419
4420 cf_cv_screen=curses
4421
4422 echo "$as_me:4422: checking for specified curses library type" >&5
4423 echo $ECHO_N "checking for specified curses library type... $ECHO_C" >&6
4424
4425 # Check whether --with-screen or --without-screen was given.
4426 if test "${with_screen+set}" = set; then
4427   withval="$with_screen"
4428   cf_cv_screen=$withval
4429 else
4430
4431 # Check whether --with-ncursesw or --without-ncursesw was given.
4432 if test "${with_ncursesw+set}" = set; then
4433   withval="$with_ncursesw"
4434   cf_cv_screen=ncursesw
4435 else
4436
4437 # Check whether --with-ncurses or --without-ncurses was given.
4438 if test "${with_ncurses+set}" = set; then
4439   withval="$with_ncurses"
4440   cf_cv_screen=ncurses
4441 else
4442
4443 # Check whether --with-pdcurses or --without-pdcurses was given.
4444 if test "${with_pdcurses+set}" = set; then
4445   withval="$with_pdcurses"
4446   cf_cv_screen=pdcurses
4447 else
4448
4449 # Check whether --with-curses-colr or --without-curses-colr was given.
4450 if test "${with_curses_colr+set}" = set; then
4451   withval="$with_curses_colr"
4452   cf_cv_screen=curses_colr
4453 else
4454
4455 # Check whether --with-curses-5lib or --without-curses-5lib was given.
4456 if test "${with_curses_5lib+set}" = set; then
4457   withval="$with_curses_5lib"
4458   cf_cv_screen=curses_5lib
4459 fi;
4460 fi;
4461 fi;
4462 fi;
4463 fi;
4464 fi;
4465
4466 echo "$as_me:4466: result: $cf_cv_screen" >&5
4467 echo "${ECHO_T}$cf_cv_screen" >&6
4468
4469 case $cf_cv_screen in
4470 (curses|curses_*)
4471
4472 echo "$as_me:4472: checking for extra include directories" >&5
4473 echo $ECHO_N "checking for extra include directories... $ECHO_C" >&6
4474 if test "${cf_cv_curses_incdir+set}" = set; then
4475   echo $ECHO_N "(cached) $ECHO_C" >&6
4476 else
4477
4478 cf_cv_curses_incdir=no
4479 case $host_os in
4480 (hpux10.*)
4481         if test "x$cf_cv_screen" = "xcurses_colr"
4482         then
4483                 test -d /usr/include/curses_colr && \
4484                 cf_cv_curses_incdir="-I/usr/include/curses_colr"
4485         fi
4486         ;;
4487 (sunos3*|sunos4*)
4488         if test "x$cf_cv_screen" = "xcurses_5lib"
4489         then
4490                 test -d /usr/5lib && \
4491                 test -d /usr/5include && \
4492                 cf_cv_curses_incdir="-I/usr/5include"
4493         fi
4494         ;;
4495 esac
4496
4497 fi
4498 echo "$as_me:4498: result: $cf_cv_curses_incdir" >&5
4499 echo "${ECHO_T}$cf_cv_curses_incdir" >&6
4500 test "$cf_cv_curses_incdir" != no && CPPFLAGS="$CPPFLAGS $cf_cv_curses_incdir"
4501
4502 echo "$as_me:4502: checking if we have identified curses headers" >&5
4503 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
4504 if test "${cf_cv_ncurses_header+set}" = set; then
4505   echo $ECHO_N "(cached) $ECHO_C" >&6
4506 else
4507
4508 cf_cv_ncurses_header=none
4509 for cf_header in \
4510         ncurses.h  \
4511         curses.h  ncurses/ncurses.h ncurses/curses.h
4512 do
4513 cat >conftest.$ac_ext <<_ACEOF
4514 #line 4514 "configure"
4515 #include "confdefs.h"
4516 #include <${cf_header}>
4517 int
4518 main ()
4519 {
4520 initscr(); tgoto("?", 0,0)
4521   ;
4522   return 0;
4523 }
4524 _ACEOF
4525 rm -f conftest.$ac_objext
4526 if { (eval echo "$as_me:4526: \"$ac_compile\"") >&5
4527   (eval $ac_compile) 2>&5
4528   ac_status=$?
4529   echo "$as_me:4529: \$? = $ac_status" >&5
4530   (exit $ac_status); } &&
4531          { ac_try='test -s conftest.$ac_objext'
4532   { (eval echo "$as_me:4532: \"$ac_try\"") >&5
4533   (eval $ac_try) 2>&5
4534   ac_status=$?
4535   echo "$as_me:4535: \$? = $ac_status" >&5
4536   (exit $ac_status); }; }; then
4537   cf_cv_ncurses_header=$cf_header; break
4538 else
4539   echo "$as_me: failed program was:" >&5
4540 cat conftest.$ac_ext >&5
4541 fi
4542 rm -f conftest.$ac_objext conftest.$ac_ext
4543 done
4544
4545 fi
4546 echo "$as_me:4546: result: $cf_cv_ncurses_header" >&5
4547 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
4548
4549 if test "$cf_cv_ncurses_header" = none ; then
4550         { { echo "$as_me:4550: error: No curses header-files found" >&5
4551 echo "$as_me: error: No curses header-files found" >&2;}
4552    { (exit 1); exit 1; }; }
4553 fi
4554
4555 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
4556
4557 for ac_header in $cf_cv_ncurses_header
4558 do
4559 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
4560 echo "$as_me:4560: checking for $ac_header" >&5
4561 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
4562 if eval "test \"\${$as_ac_Header+set}\" = set"; then
4563   echo $ECHO_N "(cached) $ECHO_C" >&6
4564 else
4565   cat >conftest.$ac_ext <<_ACEOF
4566 #line 4566 "configure"
4567 #include "confdefs.h"
4568 #include <$ac_header>
4569 _ACEOF
4570 if { (eval echo "$as_me:4570: \"$ac_cpp conftest.$ac_ext\"") >&5
4571   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
4572   ac_status=$?
4573   egrep -v '^ *\+' conftest.er1 >conftest.err
4574   rm -f conftest.er1
4575   cat conftest.err >&5
4576   echo "$as_me:4576: \$? = $ac_status" >&5
4577   (exit $ac_status); } >/dev/null; then
4578   if test -s conftest.err; then
4579     ac_cpp_err=$ac_c_preproc_warn_flag
4580   else
4581     ac_cpp_err=
4582   fi
4583 else
4584   ac_cpp_err=yes
4585 fi
4586 if test -z "$ac_cpp_err"; then
4587   eval "$as_ac_Header=yes"
4588 else
4589   echo "$as_me: failed program was:" >&5
4590   cat conftest.$ac_ext >&5
4591   eval "$as_ac_Header=no"
4592 fi
4593 rm -f conftest.err conftest.$ac_ext
4594 fi
4595 echo "$as_me:4595: result: `eval echo '${'$as_ac_Header'}'`" >&5
4596 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
4597 if test `eval echo '${'$as_ac_Header'}'` = yes; then
4598   cat >>confdefs.h <<EOF
4599 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
4600 EOF
4601
4602 fi
4603 done
4604
4605 echo "$as_me:4605: checking for terminfo header" >&5
4606 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
4607 if test "${cf_cv_term_header+set}" = set; then
4608   echo $ECHO_N "(cached) $ECHO_C" >&6
4609 else
4610
4611 case ${cf_cv_ncurses_header} in
4612 (*/ncurses.h|*/ncursesw.h)
4613         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
4614         ;;
4615 (*)
4616         cf_term_header=term.h
4617         ;;
4618 esac
4619
4620 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
4621 do
4622 cat >conftest.$ac_ext <<_ACEOF
4623 #line 4623 "configure"
4624 #include "confdefs.h"
4625 #include <stdio.h>
4626 #include <${cf_cv_ncurses_header:-curses.h}>
4627 #include <$cf_test>
4628
4629 int
4630 main ()
4631 {
4632 int x = auto_left_margin
4633   ;
4634   return 0;
4635 }
4636 _ACEOF
4637 rm -f conftest.$ac_objext
4638 if { (eval echo "$as_me:4638: \"$ac_compile\"") >&5
4639   (eval $ac_compile) 2>&5
4640   ac_status=$?
4641   echo "$as_me:4641: \$? = $ac_status" >&5
4642   (exit $ac_status); } &&
4643          { ac_try='test -s conftest.$ac_objext'
4644   { (eval echo "$as_me:4644: \"$ac_try\"") >&5
4645   (eval $ac_try) 2>&5
4646   ac_status=$?
4647   echo "$as_me:4647: \$? = $ac_status" >&5
4648   (exit $ac_status); }; }; then
4649
4650         cf_cv_term_header="$cf_test"
4651 else
4652   echo "$as_me: failed program was:" >&5
4653 cat conftest.$ac_ext >&5
4654
4655         cf_cv_term_header=unknown
4656
4657 fi
4658 rm -f conftest.$ac_objext conftest.$ac_ext
4659         test "$cf_cv_term_header" != unknown && break
4660 done
4661
4662 fi
4663 echo "$as_me:4663: result: $cf_cv_term_header" >&5
4664 echo "${ECHO_T}$cf_cv_term_header" >&6
4665
4666 # Set definitions to allow ifdef'ing to accommodate subdirectories
4667
4668 case $cf_cv_term_header in
4669 (*term.h)
4670
4671 cat >>confdefs.h <<\EOF
4672 #define HAVE_TERM_H 1
4673 EOF
4674
4675         ;;
4676 esac
4677
4678 case $cf_cv_term_header in
4679 (ncurses/term.h)
4680
4681 cat >>confdefs.h <<\EOF
4682 #define HAVE_NCURSES_TERM_H 1
4683 EOF
4684
4685         ;;
4686 (ncursesw/term.h)
4687
4688 cat >>confdefs.h <<\EOF
4689 #define HAVE_NCURSESW_TERM_H 1
4690 EOF
4691
4692         ;;
4693 esac
4694
4695 echo "$as_me:4695: checking for ncurses version" >&5
4696 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
4697 if test "${cf_cv_ncurses_version+set}" = set; then
4698   echo $ECHO_N "(cached) $ECHO_C" >&6
4699 else
4700
4701         cf_cv_ncurses_version=no
4702         cf_tempfile=out$$
4703         rm -f $cf_tempfile
4704         if test "$cross_compiling" = yes; then
4705
4706         # This will not work if the preprocessor splits the line after the
4707         # Autoconf token.  The 'unproto' program does that.
4708         cat > conftest.$ac_ext <<EOF
4709 #include <${cf_cv_ncurses_header:-curses.h}>
4710 #undef Autoconf
4711 #ifdef NCURSES_VERSION
4712 Autoconf NCURSES_VERSION
4713 #else
4714 #ifdef __NCURSES_H
4715 Autoconf "old"
4716 #endif
4717 ;
4718 #endif
4719 EOF
4720         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
4721         { (eval echo "$as_me:4721: \"$cf_try\"") >&5
4722   (eval $cf_try) 2>&5
4723   ac_status=$?
4724   echo "$as_me:4724: \$? = $ac_status" >&5
4725   (exit $ac_status); }
4726         if test -f conftest.out ; then
4727                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
4728                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
4729                 rm -f conftest.out
4730         fi
4731
4732 else
4733   cat >conftest.$ac_ext <<_ACEOF
4734 #line 4734 "configure"
4735 #include "confdefs.h"
4736
4737 #include <${cf_cv_ncurses_header:-curses.h}>
4738 #include <stdio.h>
4739 int main()
4740 {
4741         FILE *fp = fopen("$cf_tempfile", "w");
4742 #ifdef NCURSES_VERSION
4743 # ifdef NCURSES_VERSION_PATCH
4744         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
4745 # else
4746         fprintf(fp, "%s\n", NCURSES_VERSION);
4747 # endif
4748 #else
4749 # ifdef __NCURSES_H
4750         fprintf(fp, "old\n");
4751 # else
4752         make an error
4753 # endif
4754 #endif
4755         ${cf_cv_main_return:-return}(0);
4756 }
4757 _ACEOF
4758 rm -f conftest$ac_exeext
4759 if { (eval echo "$as_me:4759: \"$ac_link\"") >&5
4760   (eval $ac_link) 2>&5
4761   ac_status=$?
4762   echo "$as_me:4762: \$? = $ac_status" >&5
4763   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
4764   { (eval echo "$as_me:4764: \"$ac_try\"") >&5
4765   (eval $ac_try) 2>&5
4766   ac_status=$?
4767   echo "$as_me:4767: \$? = $ac_status" >&5
4768   (exit $ac_status); }; }; then
4769
4770         cf_cv_ncurses_version=`cat $cf_tempfile`
4771 else
4772   echo "$as_me: program exited with status $ac_status" >&5
4773 echo "$as_me: failed program was:" >&5
4774 cat conftest.$ac_ext >&5
4775 fi
4776 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
4777 fi
4778         rm -f $cf_tempfile
4779
4780 fi
4781 echo "$as_me:4781: result: $cf_cv_ncurses_version" >&5
4782 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
4783 test "$cf_cv_ncurses_version" = no ||
4784 cat >>confdefs.h <<\EOF
4785 #define NCURSES 1
4786 EOF
4787
4788 echo "$as_me:4788: checking if we have identified curses libraries" >&5
4789 echo $ECHO_N "checking if we have identified curses libraries... $ECHO_C" >&6
4790 cat >conftest.$ac_ext <<_ACEOF
4791 #line 4791 "configure"
4792 #include "confdefs.h"
4793 #include <${cf_cv_ncurses_header:-curses.h}>
4794 int
4795 main ()
4796 {
4797 initscr(); tgoto("?", 0,0)
4798   ;
4799   return 0;
4800 }
4801 _ACEOF
4802 rm -f conftest.$ac_objext conftest$ac_exeext
4803 if { (eval echo "$as_me:4803: \"$ac_link\"") >&5
4804   (eval $ac_link) 2>&5
4805   ac_status=$?
4806   echo "$as_me:4806: \$? = $ac_status" >&5
4807   (exit $ac_status); } &&
4808          { ac_try='test -s conftest$ac_exeext'
4809   { (eval echo "$as_me:4809: \"$ac_try\"") >&5
4810   (eval $ac_try) 2>&5
4811   ac_status=$?
4812   echo "$as_me:4812: \$? = $ac_status" >&5
4813   (exit $ac_status); }; }; then
4814   cf_result=yes
4815 else
4816   echo "$as_me: failed program was:" >&5
4817 cat conftest.$ac_ext >&5
4818 cf_result=no
4819 fi
4820 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4821 echo "$as_me:4821: result: $cf_result" >&5
4822 echo "${ECHO_T}$cf_result" >&6
4823
4824 if test "$cf_result" = no ; then
4825 case $host_os in
4826 (freebsd*)
4827         echo "$as_me:4827: checking for tgoto in -lmytinfo" >&5
4828 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
4829 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
4830   echo $ECHO_N "(cached) $ECHO_C" >&6
4831 else
4832   ac_check_lib_save_LIBS=$LIBS
4833 LIBS="-lmytinfo  $LIBS"
4834 cat >conftest.$ac_ext <<_ACEOF
4835 #line 4835 "configure"
4836 #include "confdefs.h"
4837
4838 /* Override any gcc2 internal prototype to avoid an error.  */
4839 #ifdef __cplusplus
4840 extern "C"
4841 #endif
4842 /* We use char because int might match the return type of a gcc2
4843    builtin and then its argument prototype would still apply.  */
4844 char tgoto ();
4845 int
4846 main ()
4847 {
4848 tgoto ();
4849   ;
4850   return 0;
4851 }
4852 _ACEOF
4853 rm -f conftest.$ac_objext conftest$ac_exeext
4854 if { (eval echo "$as_me:4854: \"$ac_link\"") >&5
4855   (eval $ac_link) 2>&5
4856   ac_status=$?
4857   echo "$as_me:4857: \$? = $ac_status" >&5
4858   (exit $ac_status); } &&
4859          { ac_try='test -s conftest$ac_exeext'
4860   { (eval echo "$as_me:4860: \"$ac_try\"") >&5
4861   (eval $ac_try) 2>&5
4862   ac_status=$?
4863   echo "$as_me:4863: \$? = $ac_status" >&5
4864   (exit $ac_status); }; }; then
4865   ac_cv_lib_mytinfo_tgoto=yes
4866 else
4867   echo "$as_me: failed program was:" >&5
4868 cat conftest.$ac_ext >&5
4869 ac_cv_lib_mytinfo_tgoto=no
4870 fi
4871 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4872 LIBS=$ac_check_lib_save_LIBS
4873 fi
4874 echo "$as_me:4874: result: $ac_cv_lib_mytinfo_tgoto" >&5
4875 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
4876 if test $ac_cv_lib_mytinfo_tgoto = yes; then
4877
4878 cf_add_libs="-lmytinfo"
4879 # Filter out duplicates - this happens with badly-designed ".pc" files...
4880 for cf_add_1lib in $LIBS
4881 do
4882         for cf_add_2lib in $cf_add_libs
4883         do
4884                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
4885                 then
4886                         cf_add_1lib=
4887                         break
4888                 fi
4889         done
4890         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
4891 done
4892 LIBS="$cf_add_libs"
4893
4894 fi
4895
4896         ;;
4897 (hpux10.*)
4898         # Looking at HPUX 10.20, the Hcurses library is the oldest (1997), cur_colr
4899         # next (1998), and xcurses "newer" (2000).  There is no header file for
4900         # Hcurses; the subdirectory curses_colr has the headers (curses.h and
4901         # term.h) for cur_colr
4902         if test "x$cf_cv_screen" = "xcurses_colr"
4903         then
4904                 echo "$as_me:4904: checking for initscr in -lcur_colr" >&5
4905 echo $ECHO_N "checking for initscr in -lcur_colr... $ECHO_C" >&6
4906 if test "${ac_cv_lib_cur_colr_initscr+set}" = set; then
4907   echo $ECHO_N "(cached) $ECHO_C" >&6
4908 else
4909   ac_check_lib_save_LIBS=$LIBS
4910 LIBS="-lcur_colr  $LIBS"
4911 cat >conftest.$ac_ext <<_ACEOF
4912 #line 4912 "configure"
4913 #include "confdefs.h"
4914
4915 /* Override any gcc2 internal prototype to avoid an error.  */
4916 #ifdef __cplusplus
4917 extern "C"
4918 #endif
4919 /* We use char because int might match the return type of a gcc2
4920    builtin and then its argument prototype would still apply.  */
4921 char initscr ();
4922 int
4923 main ()
4924 {
4925 initscr ();
4926   ;
4927   return 0;
4928 }
4929 _ACEOF
4930 rm -f conftest.$ac_objext conftest$ac_exeext
4931 if { (eval echo "$as_me:4931: \"$ac_link\"") >&5
4932   (eval $ac_link) 2>&5
4933   ac_status=$?
4934   echo "$as_me:4934: \$? = $ac_status" >&5
4935   (exit $ac_status); } &&
4936          { ac_try='test -s conftest$ac_exeext'
4937   { (eval echo "$as_me:4937: \"$ac_try\"") >&5
4938   (eval $ac_try) 2>&5
4939   ac_status=$?
4940   echo "$as_me:4940: \$? = $ac_status" >&5
4941   (exit $ac_status); }; }; then
4942   ac_cv_lib_cur_colr_initscr=yes
4943 else
4944   echo "$as_me: failed program was:" >&5
4945 cat conftest.$ac_ext >&5
4946 ac_cv_lib_cur_colr_initscr=no
4947 fi
4948 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4949 LIBS=$ac_check_lib_save_LIBS
4950 fi
4951 echo "$as_me:4951: result: $ac_cv_lib_cur_colr_initscr" >&5
4952 echo "${ECHO_T}$ac_cv_lib_cur_colr_initscr" >&6
4953 if test $ac_cv_lib_cur_colr_initscr = yes; then
4954
4955 cf_add_libs="-lcur_colr"
4956 # Filter out duplicates - this happens with badly-designed ".pc" files...
4957 for cf_add_1lib in $LIBS
4958 do
4959         for cf_add_2lib in $cf_add_libs
4960         do
4961                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
4962                 then
4963                         cf_add_1lib=
4964                         break
4965                 fi
4966         done
4967         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
4968 done
4969 LIBS="$cf_add_libs"
4970
4971                         ac_cv_func_initscr=yes
4972
4973 else
4974
4975                 echo "$as_me:4975: checking for initscr in -lHcurses" >&5
4976 echo $ECHO_N "checking for initscr in -lHcurses... $ECHO_C" >&6
4977 if test "${ac_cv_lib_Hcurses_initscr+set}" = set; then
4978   echo $ECHO_N "(cached) $ECHO_C" >&6
4979 else
4980   ac_check_lib_save_LIBS=$LIBS
4981 LIBS="-lHcurses  $LIBS"
4982 cat >conftest.$ac_ext <<_ACEOF
4983 #line 4983 "configure"
4984 #include "confdefs.h"
4985
4986 /* Override any gcc2 internal prototype to avoid an error.  */
4987 #ifdef __cplusplus
4988 extern "C"
4989 #endif
4990 /* We use char because int might match the return type of a gcc2
4991    builtin and then its argument prototype would still apply.  */
4992 char initscr ();
4993 int
4994 main ()
4995 {
4996 initscr ();
4997   ;
4998   return 0;
4999 }
5000 _ACEOF
5001 rm -f conftest.$ac_objext conftest$ac_exeext
5002 if { (eval echo "$as_me:5002: \"$ac_link\"") >&5
5003   (eval $ac_link) 2>&5
5004   ac_status=$?
5005   echo "$as_me:5005: \$? = $ac_status" >&5
5006   (exit $ac_status); } &&
5007          { ac_try='test -s conftest$ac_exeext'
5008   { (eval echo "$as_me:5008: \"$ac_try\"") >&5
5009   (eval $ac_try) 2>&5
5010   ac_status=$?
5011   echo "$as_me:5011: \$? = $ac_status" >&5
5012   (exit $ac_status); }; }; then
5013   ac_cv_lib_Hcurses_initscr=yes
5014 else
5015   echo "$as_me: failed program was:" >&5
5016 cat conftest.$ac_ext >&5
5017 ac_cv_lib_Hcurses_initscr=no
5018 fi
5019 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5020 LIBS=$ac_check_lib_save_LIBS
5021 fi
5022 echo "$as_me:5022: result: $ac_cv_lib_Hcurses_initscr" >&5
5023 echo "${ECHO_T}$ac_cv_lib_Hcurses_initscr" >&6
5024 if test $ac_cv_lib_Hcurses_initscr = yes; then
5025
5026                         # HP's header uses __HP_CURSES, but user claims _HP_CURSES.
5027
5028 cf_add_libs="-lHcurses"
5029 # Filter out duplicates - this happens with badly-designed ".pc" files...
5030 for cf_add_1lib in $LIBS
5031 do
5032         for cf_add_2lib in $cf_add_libs
5033         do
5034                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5035                 then
5036                         cf_add_1lib=
5037                         break
5038                 fi
5039         done
5040         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5041 done
5042 LIBS="$cf_add_libs"
5043
5044                         CPPFLAGS="$CPPFLAGS -D__HP_CURSES -D_HP_CURSES"
5045                         ac_cv_func_initscr=yes
5046
5047 fi
5048
5049 fi
5050
5051         fi
5052         ;;
5053 (linux*)
5054         case `arch 2>/dev/null` in
5055         (x86_64)
5056                 if test -d /lib64
5057                 then
5058
5059 if test -n "/lib64" ; then
5060         for cf_add_libdir in /lib64
5061         do
5062                 if test $cf_add_libdir = /usr/lib ; then
5063                         :
5064                 elif test -d $cf_add_libdir
5065                 then
5066                         cf_have_libdir=no
5067                         if test -n "$LDFLAGS$LIBS" ; then
5068                                 # a loop is needed to ensure we can add subdirs of existing dirs
5069                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
5070                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5071                                                 cf_have_libdir=yes; break
5072                                         fi
5073                                 done
5074                         fi
5075                         if test "$cf_have_libdir" = no ; then
5076                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5077
5078 echo "${as_me:-configure}:5078: testing adding $cf_add_libdir to library-path ..." 1>&5
5079
5080                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5081                         fi
5082                 fi
5083         done
5084 fi
5085
5086                 else
5087
5088 if test -n "/lib" ; then
5089         for cf_add_libdir in /lib
5090         do
5091                 if test $cf_add_libdir = /usr/lib ; then
5092                         :
5093                 elif test -d $cf_add_libdir
5094                 then
5095                         cf_have_libdir=no
5096                         if test -n "$LDFLAGS$LIBS" ; then
5097                                 # a loop is needed to ensure we can add subdirs of existing dirs
5098                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
5099                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5100                                                 cf_have_libdir=yes; break
5101                                         fi
5102                                 done
5103                         fi
5104                         if test "$cf_have_libdir" = no ; then
5105                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5106
5107 echo "${as_me:-configure}:5107: testing adding $cf_add_libdir to library-path ..." 1>&5
5108
5109                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5110                         fi
5111                 fi
5112         done
5113 fi
5114
5115                 fi
5116                 ;;
5117         (*)
5118
5119 if test -n "/lib" ; then
5120         for cf_add_libdir in /lib
5121         do
5122                 if test $cf_add_libdir = /usr/lib ; then
5123                         :
5124                 elif test -d $cf_add_libdir
5125                 then
5126                         cf_have_libdir=no
5127                         if test -n "$LDFLAGS$LIBS" ; then
5128                                 # a loop is needed to ensure we can add subdirs of existing dirs
5129                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
5130                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5131                                                 cf_have_libdir=yes; break
5132                                         fi
5133                                 done
5134                         fi
5135                         if test "$cf_have_libdir" = no ; then
5136                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5137
5138 echo "${as_me:-configure}:5138: testing adding $cf_add_libdir to library-path ..." 1>&5
5139
5140                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5141                         fi
5142                 fi
5143         done
5144 fi
5145
5146                 ;;
5147         esac
5148         ;;
5149 (sunos3*|sunos4*)
5150         if test "x$cf_cv_screen" = "xcurses_5lib"
5151         then
5152                 if test -d /usr/5lib ; then
5153
5154 if test -n "/usr/5lib" ; then
5155         for cf_add_libdir in /usr/5lib
5156         do
5157                 if test $cf_add_libdir = /usr/lib ; then
5158                         :
5159                 elif test -d $cf_add_libdir
5160                 then
5161                         cf_have_libdir=no
5162                         if test -n "$LDFLAGS$LIBS" ; then
5163                                 # a loop is needed to ensure we can add subdirs of existing dirs
5164                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
5165                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5166                                                 cf_have_libdir=yes; break
5167                                         fi
5168                                 done
5169                         fi
5170                         if test "$cf_have_libdir" = no ; then
5171                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5172
5173 echo "${as_me:-configure}:5173: testing adding $cf_add_libdir to library-path ..." 1>&5
5174
5175                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5176                         fi
5177                 fi
5178         done
5179 fi
5180
5181 cf_add_libs="-lcurses -ltermcap"
5182 # Filter out duplicates - this happens with badly-designed ".pc" files...
5183 for cf_add_1lib in $LIBS
5184 do
5185         for cf_add_2lib in $cf_add_libs
5186         do
5187                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5188                 then
5189                         cf_add_1lib=
5190                         break
5191                 fi
5192         done
5193         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5194 done
5195 LIBS="$cf_add_libs"
5196
5197                 fi
5198         fi
5199         ac_cv_func_initscr=yes
5200         ;;
5201 esac
5202
5203 if test ".$ac_cv_func_initscr" != .yes ; then
5204         cf_save_LIBS="$LIBS"
5205
5206         if test ".${cf_cv_ncurses_version:-no}" != .no
5207         then
5208                 cf_check_list="ncurses curses cursesX"
5209         else
5210                 cf_check_list="cursesX curses ncurses"
5211         fi
5212
5213         # Check for library containing tgoto.  Do this before curses library
5214         # because it may be needed to link the test-case for initscr.
5215         if test "x$cf_term_lib" = x
5216         then
5217                 echo "$as_me:5217: checking for tgoto" >&5
5218 echo $ECHO_N "checking for tgoto... $ECHO_C" >&6
5219 if test "${ac_cv_func_tgoto+set}" = set; then
5220   echo $ECHO_N "(cached) $ECHO_C" >&6
5221 else
5222   cat >conftest.$ac_ext <<_ACEOF
5223 #line 5223 "configure"
5224 #include "confdefs.h"
5225 /* System header to define __stub macros and hopefully few prototypes,
5226     which can conflict with char tgoto (); below.  */
5227 #include <assert.h>
5228 /* Override any gcc2 internal prototype to avoid an error.  */
5229 #ifdef __cplusplus
5230 extern "C"
5231 #endif
5232 /* We use char because int might match the return type of a gcc2
5233    builtin and then its argument prototype would still apply.  */
5234 char tgoto ();
5235 char (*f) ();
5236
5237 int
5238 main ()
5239 {
5240 /* The GNU C library defines this for functions which it implements
5241     to always fail with ENOSYS.  Some functions are actually named
5242     something starting with __ and the normal name is an alias.  */
5243 #if defined (__stub_tgoto) || defined (__stub___tgoto)
5244 choke me
5245 #else
5246 f = tgoto; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
5247 #endif
5248
5249   ;
5250   return 0;
5251 }
5252 _ACEOF
5253 rm -f conftest.$ac_objext conftest$ac_exeext
5254 if { (eval echo "$as_me:5254: \"$ac_link\"") >&5
5255   (eval $ac_link) 2>&5
5256   ac_status=$?
5257   echo "$as_me:5257: \$? = $ac_status" >&5
5258   (exit $ac_status); } &&
5259          { ac_try='test -s conftest$ac_exeext'
5260   { (eval echo "$as_me:5260: \"$ac_try\"") >&5
5261   (eval $ac_try) 2>&5
5262   ac_status=$?
5263   echo "$as_me:5263: \$? = $ac_status" >&5
5264   (exit $ac_status); }; }; then
5265   ac_cv_func_tgoto=yes
5266 else
5267   echo "$as_me: failed program was:" >&5
5268 cat conftest.$ac_ext >&5
5269 ac_cv_func_tgoto=no
5270 fi
5271 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5272 fi
5273 echo "$as_me:5273: result: $ac_cv_func_tgoto" >&5
5274 echo "${ECHO_T}$ac_cv_func_tgoto" >&6
5275 if test $ac_cv_func_tgoto = yes; then
5276   cf_term_lib=predefined
5277 else
5278
5279                         for cf_term_lib in $cf_check_list otermcap termcap tinfo termlib unknown
5280                         do
5281                                 as_ac_Lib=`echo "ac_cv_lib_$cf_term_lib''_tgoto" | $as_tr_sh`
5282 echo "$as_me:5282: checking for tgoto in -l$cf_term_lib" >&5
5283 echo $ECHO_N "checking for tgoto in -l$cf_term_lib... $ECHO_C" >&6
5284 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
5285   echo $ECHO_N "(cached) $ECHO_C" >&6
5286 else
5287   ac_check_lib_save_LIBS=$LIBS
5288 LIBS="-l$cf_term_lib  $LIBS"
5289 cat >conftest.$ac_ext <<_ACEOF
5290 #line 5290 "configure"
5291 #include "confdefs.h"
5292
5293 /* Override any gcc2 internal prototype to avoid an error.  */
5294 #ifdef __cplusplus
5295 extern "C"
5296 #endif
5297 /* We use char because int might match the return type of a gcc2
5298    builtin and then its argument prototype would still apply.  */
5299 char tgoto ();
5300 int
5301 main ()
5302 {
5303 tgoto ();
5304   ;
5305   return 0;
5306 }
5307 _ACEOF
5308 rm -f conftest.$ac_objext 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); } &&
5314          { ac_try='test -s conftest$ac_exeext'
5315   { (eval echo "$as_me:5315: \"$ac_try\"") >&5
5316   (eval $ac_try) 2>&5
5317   ac_status=$?
5318   echo "$as_me:5318: \$? = $ac_status" >&5
5319   (exit $ac_status); }; }; then
5320   eval "$as_ac_Lib=yes"
5321 else
5322   echo "$as_me: failed program was:" >&5
5323 cat conftest.$ac_ext >&5
5324 eval "$as_ac_Lib=no"
5325 fi
5326 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5327 LIBS=$ac_check_lib_save_LIBS
5328 fi
5329 echo "$as_me:5329: result: `eval echo '${'$as_ac_Lib'}'`" >&5
5330 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
5331 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
5332   break
5333 fi
5334
5335                         done
5336
5337 fi
5338
5339         fi
5340
5341         # Check for library containing initscr
5342         test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS"
5343         if test "x$cf_curs_lib" = x
5344         then
5345                 for cf_curs_lib in $cf_check_list xcurses jcurses pdcurses unknown
5346                 do
5347                         as_ac_Lib=`echo "ac_cv_lib_$cf_curs_lib''_initscr" | $as_tr_sh`
5348 echo "$as_me:5348: checking for initscr in -l$cf_curs_lib" >&5
5349 echo $ECHO_N "checking for initscr in -l$cf_curs_lib... $ECHO_C" >&6
5350 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
5351   echo $ECHO_N "(cached) $ECHO_C" >&6
5352 else
5353   ac_check_lib_save_LIBS=$LIBS
5354 LIBS="-l$cf_curs_lib  $LIBS"
5355 cat >conftest.$ac_ext <<_ACEOF
5356 #line 5356 "configure"
5357 #include "confdefs.h"
5358
5359 /* Override any gcc2 internal prototype to avoid an error.  */
5360 #ifdef __cplusplus
5361 extern "C"
5362 #endif
5363 /* We use char because int might match the return type of a gcc2
5364    builtin and then its argument prototype would still apply.  */
5365 char initscr ();
5366 int
5367 main ()
5368 {
5369 initscr ();
5370   ;
5371   return 0;
5372 }
5373 _ACEOF
5374 rm -f conftest.$ac_objext conftest$ac_exeext
5375 if { (eval echo "$as_me:5375: \"$ac_link\"") >&5
5376   (eval $ac_link) 2>&5
5377   ac_status=$?
5378   echo "$as_me:5378: \$? = $ac_status" >&5
5379   (exit $ac_status); } &&
5380          { ac_try='test -s conftest$ac_exeext'
5381   { (eval echo "$as_me:5381: \"$ac_try\"") >&5
5382   (eval $ac_try) 2>&5
5383   ac_status=$?
5384   echo "$as_me:5384: \$? = $ac_status" >&5
5385   (exit $ac_status); }; }; then
5386   eval "$as_ac_Lib=yes"
5387 else
5388   echo "$as_me: failed program was:" >&5
5389 cat conftest.$ac_ext >&5
5390 eval "$as_ac_Lib=no"
5391 fi
5392 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5393 LIBS=$ac_check_lib_save_LIBS
5394 fi
5395 echo "$as_me:5395: result: `eval echo '${'$as_ac_Lib'}'`" >&5
5396 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
5397 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
5398   break
5399 fi
5400
5401                 done
5402         fi
5403         test $cf_curs_lib = unknown && { { echo "$as_me:5403: error: no curses library found" >&5
5404 echo "$as_me: error: no curses library found" >&2;}
5405    { (exit 1); exit 1; }; }
5406
5407         LIBS="-l$cf_curs_lib $cf_save_LIBS"
5408         if test "$cf_term_lib" = unknown ; then
5409                 echo "$as_me:5409: checking if we can link with $cf_curs_lib library" >&5
5410 echo $ECHO_N "checking if we can link with $cf_curs_lib library... $ECHO_C" >&6
5411                 cat >conftest.$ac_ext <<_ACEOF
5412 #line 5412 "configure"
5413 #include "confdefs.h"
5414 #include <${cf_cv_ncurses_header:-curses.h}>
5415 int
5416 main ()
5417 {
5418 initscr()
5419   ;
5420   return 0;
5421 }
5422 _ACEOF
5423 rm -f conftest.$ac_objext conftest$ac_exeext
5424 if { (eval echo "$as_me:5424: \"$ac_link\"") >&5
5425   (eval $ac_link) 2>&5
5426   ac_status=$?
5427   echo "$as_me:5427: \$? = $ac_status" >&5
5428   (exit $ac_status); } &&
5429          { ac_try='test -s conftest$ac_exeext'
5430   { (eval echo "$as_me:5430: \"$ac_try\"") >&5
5431   (eval $ac_try) 2>&5
5432   ac_status=$?
5433   echo "$as_me:5433: \$? = $ac_status" >&5
5434   (exit $ac_status); }; }; then
5435   cf_result=yes
5436 else
5437   echo "$as_me: failed program was:" >&5
5438 cat conftest.$ac_ext >&5
5439 cf_result=no
5440 fi
5441 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5442                 echo "$as_me:5442: result: $cf_result" >&5
5443 echo "${ECHO_T}$cf_result" >&6
5444                 test $cf_result = no && { { echo "$as_me:5444: error: Cannot link curses library" >&5
5445 echo "$as_me: error: Cannot link curses library" >&2;}
5446    { (exit 1); exit 1; }; }
5447         elif test "$cf_curs_lib" = "$cf_term_lib" ; then
5448                 :
5449         elif test "$cf_term_lib" != predefined ; then
5450                 echo "$as_me:5450: checking if we need both $cf_curs_lib and $cf_term_lib libraries" >&5
5451 echo $ECHO_N "checking if we need both $cf_curs_lib and $cf_term_lib libraries... $ECHO_C" >&6
5452                 cat >conftest.$ac_ext <<_ACEOF
5453 #line 5453 "configure"
5454 #include "confdefs.h"
5455 #include <${cf_cv_ncurses_header:-curses.h}>
5456 int
5457 main ()
5458 {
5459 initscr(); tgoto((char *)0, 0, 0);
5460   ;
5461   return 0;
5462 }
5463 _ACEOF
5464 rm -f conftest.$ac_objext conftest$ac_exeext
5465 if { (eval echo "$as_me:5465: \"$ac_link\"") >&5
5466   (eval $ac_link) 2>&5
5467   ac_status=$?
5468   echo "$as_me:5468: \$? = $ac_status" >&5
5469   (exit $ac_status); } &&
5470          { ac_try='test -s conftest$ac_exeext'
5471   { (eval echo "$as_me:5471: \"$ac_try\"") >&5
5472   (eval $ac_try) 2>&5
5473   ac_status=$?
5474   echo "$as_me:5474: \$? = $ac_status" >&5
5475   (exit $ac_status); }; }; then
5476   cf_result=no
5477 else
5478   echo "$as_me: failed program was:" >&5
5479 cat conftest.$ac_ext >&5
5480
5481                         LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
5482                         cat >conftest.$ac_ext <<_ACEOF
5483 #line 5483 "configure"
5484 #include "confdefs.h"
5485 #include <${cf_cv_ncurses_header:-curses.h}>
5486 int
5487 main ()
5488 {
5489 initscr()
5490   ;
5491   return 0;
5492 }
5493 _ACEOF
5494 rm -f conftest.$ac_objext conftest$ac_exeext
5495 if { (eval echo "$as_me:5495: \"$ac_link\"") >&5
5496   (eval $ac_link) 2>&5
5497   ac_status=$?
5498   echo "$as_me:5498: \$? = $ac_status" >&5
5499   (exit $ac_status); } &&
5500          { ac_try='test -s conftest$ac_exeext'
5501   { (eval echo "$as_me:5501: \"$ac_try\"") >&5
5502   (eval $ac_try) 2>&5
5503   ac_status=$?
5504   echo "$as_me:5504: \$? = $ac_status" >&5
5505   (exit $ac_status); }; }; then
5506   cf_result=yes
5507 else
5508   echo "$as_me: failed program was:" >&5
5509 cat conftest.$ac_ext >&5
5510 cf_result=error
5511 fi
5512 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5513
5514 fi
5515 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5516                 echo "$as_me:5516: result: $cf_result" >&5
5517 echo "${ECHO_T}$cf_result" >&6
5518         fi
5519 fi
5520 fi
5521
5522         ;;
5523 (ncursesw*)
5524
5525 echo "$as_me:5525: checking for multibyte character support" >&5
5526 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
5527 if test "${cf_cv_utf8_lib+set}" = set; then
5528   echo $ECHO_N "(cached) $ECHO_C" >&6
5529 else
5530
5531         cf_save_LIBS="$LIBS"
5532         cat >conftest.$ac_ext <<_ACEOF
5533 #line 5533 "configure"
5534 #include "confdefs.h"
5535
5536 #include <stdlib.h>
5537 int
5538 main ()
5539 {
5540 putwc(0,0);
5541   ;
5542   return 0;
5543 }
5544 _ACEOF
5545 rm -f conftest.$ac_objext conftest$ac_exeext
5546 if { (eval echo "$as_me:5546: \"$ac_link\"") >&5
5547   (eval $ac_link) 2>&5
5548   ac_status=$?
5549   echo "$as_me:5549: \$? = $ac_status" >&5
5550   (exit $ac_status); } &&
5551          { ac_try='test -s conftest$ac_exeext'
5552   { (eval echo "$as_me:5552: \"$ac_try\"") >&5
5553   (eval $ac_try) 2>&5
5554   ac_status=$?
5555   echo "$as_me:5555: \$? = $ac_status" >&5
5556   (exit $ac_status); }; }; then
5557   cf_cv_utf8_lib=yes
5558 else
5559   echo "$as_me: failed program was:" >&5
5560 cat conftest.$ac_ext >&5
5561
5562 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
5563 # will be set on completion of the AC_TRY_LINK below.
5564 cf_cv_header_path_utf8=
5565 cf_cv_library_path_utf8=
5566
5567 echo "${as_me:-configure}:5567: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
5568
5569 cf_save_LIBS="$LIBS"
5570
5571 cat >conftest.$ac_ext <<_ACEOF
5572 #line 5572 "configure"
5573 #include "confdefs.h"
5574
5575 #include <libutf8.h>
5576 int
5577 main ()
5578 {
5579 putwc(0,0);
5580   ;
5581   return 0;
5582 }
5583 _ACEOF
5584 rm -f conftest.$ac_objext conftest$ac_exeext
5585 if { (eval echo "$as_me:5585: \"$ac_link\"") >&5
5586   (eval $ac_link) 2>&5
5587   ac_status=$?
5588   echo "$as_me:5588: \$? = $ac_status" >&5
5589   (exit $ac_status); } &&
5590          { ac_try='test -s conftest$ac_exeext'
5591   { (eval echo "$as_me:5591: \"$ac_try\"") >&5
5592   (eval $ac_try) 2>&5
5593   ac_status=$?
5594   echo "$as_me:5594: \$? = $ac_status" >&5
5595   (exit $ac_status); }; }; then
5596
5597         cf_cv_find_linkage_utf8=yes
5598         cf_cv_header_path_utf8=/usr/include
5599         cf_cv_library_path_utf8=/usr/lib
5600
5601 else
5602   echo "$as_me: failed program was:" >&5
5603 cat conftest.$ac_ext >&5
5604
5605 LIBS="-lutf8  $cf_save_LIBS"
5606
5607 cat >conftest.$ac_ext <<_ACEOF
5608 #line 5608 "configure"
5609 #include "confdefs.h"
5610
5611 #include <libutf8.h>
5612 int
5613 main ()
5614 {
5615 putwc(0,0);
5616   ;
5617   return 0;
5618 }
5619 _ACEOF
5620 rm -f conftest.$ac_objext conftest$ac_exeext
5621 if { (eval echo "$as_me:5621: \"$ac_link\"") >&5
5622   (eval $ac_link) 2>&5
5623   ac_status=$?
5624   echo "$as_me:5624: \$? = $ac_status" >&5
5625   (exit $ac_status); } &&
5626          { ac_try='test -s conftest$ac_exeext'
5627   { (eval echo "$as_me:5627: \"$ac_try\"") >&5
5628   (eval $ac_try) 2>&5
5629   ac_status=$?
5630   echo "$as_me:5630: \$? = $ac_status" >&5
5631   (exit $ac_status); }; }; then
5632
5633         cf_cv_find_linkage_utf8=yes
5634         cf_cv_header_path_utf8=/usr/include
5635         cf_cv_library_path_utf8=/usr/lib
5636         cf_cv_library_file_utf8="-lutf8"
5637
5638 else
5639   echo "$as_me: failed program was:" >&5
5640 cat conftest.$ac_ext >&5
5641
5642         cf_cv_find_linkage_utf8=no
5643         LIBS="$cf_save_LIBS"
5644
5645         test -n "$verbose" && echo "    find linkage for utf8 library" 1>&6
5646
5647 echo "${as_me:-configure}:5647: testing find linkage for utf8 library ..." 1>&5
5648
5649 echo "${as_me:-configure}:5649: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
5650
5651         cf_save_CPPFLAGS="$CPPFLAGS"
5652         cf_test_CPPFLAGS="$CPPFLAGS"
5653
5654 cf_search=
5655
5656 # collect the current set of include-directories from compiler flags
5657 cf_header_path_list=""
5658 if test -n "${CFLAGS}${CPPFLAGS}" ; then
5659         for cf_header_path in $CPPFLAGS $CFLAGS
5660         do
5661                 case $cf_header_path in
5662                 (-I*)
5663                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
5664
5665 test "x$cf_header_path" != "xNONE" && \
5666 test -d "$cf_header_path" && \
5667  {
5668         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
5669         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
5670         test -d $cf_header_path/include/utf8 &&       cf_search="$cf_search $cf_header_path/include/utf8"
5671         test -d $cf_header_path/include/utf8/include &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
5672         test -d $cf_header_path/utf8/include &&       cf_search="$cf_search $cf_header_path/utf8/include"
5673         test -d $cf_header_path/utf8/include/utf8 &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
5674 }
5675
5676                         cf_header_path_list="$cf_header_path_list $cf_search"
5677                         ;;
5678                 esac
5679         done
5680 fi
5681
5682 # add the variations for the package we are looking for
5683
5684 cf_search=
5685
5686 test "x$prefix" != "xNONE" && \
5687 test -d "$prefix" && \
5688  {
5689         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
5690         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
5691         test -d $prefix/include/utf8 &&       cf_search="$cf_search $prefix/include/utf8"
5692         test -d $prefix/include/utf8/include &&    cf_search="$cf_search $prefix/include/utf8/include"
5693         test -d $prefix/utf8/include &&       cf_search="$cf_search $prefix/utf8/include"
5694         test -d $prefix/utf8/include/utf8 &&    cf_search="$cf_search $prefix/utf8/include/utf8"
5695 }
5696
5697 for cf_subdir_prefix in \
5698         /usr \
5699         /usr/local \
5700         /usr/pkg \
5701         /opt \
5702         /opt/local \
5703         $HOME
5704 do
5705
5706 test "x$cf_subdir_prefix" != "x$prefix" && \
5707 test -d "$cf_subdir_prefix" && \
5708 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
5709         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
5710         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
5711         test -d $cf_subdir_prefix/include/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/include/utf8"
5712         test -d $cf_subdir_prefix/include/utf8/include &&    cf_search="$cf_search $cf_subdir_prefix/include/utf8/include"
5713         test -d $cf_subdir_prefix/utf8/include &&       cf_search="$cf_search $cf_subdir_prefix/utf8/include"
5714         test -d $cf_subdir_prefix/utf8/include/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/include/utf8"
5715 }
5716
5717 done
5718
5719 test "$includedir" != NONE && \
5720 test "$includedir" != "/usr/include" && \
5721 test -d "$includedir" && {
5722         test -d $includedir &&    cf_search="$cf_search $includedir"
5723         test -d $includedir/utf8 && cf_search="$cf_search $includedir/utf8"
5724 }
5725
5726 test "$oldincludedir" != NONE && \
5727 test "$oldincludedir" != "/usr/include" && \
5728 test -d "$oldincludedir" && {
5729         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
5730         test -d $oldincludedir/utf8 && cf_search="$cf_search $oldincludedir/utf8"
5731 }
5732
5733 cf_search="$cf_search $cf_header_path_list"
5734
5735         for cf_cv_header_path_utf8 in $cf_search
5736         do
5737                 if test -d $cf_cv_header_path_utf8 ; then
5738                         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
5739
5740 echo "${as_me:-configure}:5740: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
5741
5742                         CPPFLAGS="$cf_save_CPPFLAGS -I$cf_cv_header_path_utf8"
5743                         cat >conftest.$ac_ext <<_ACEOF
5744 #line 5744 "configure"
5745 #include "confdefs.h"
5746
5747 #include <libutf8.h>
5748 int
5749 main ()
5750 {
5751 putwc(0,0);
5752   ;
5753   return 0;
5754 }
5755 _ACEOF
5756 rm -f conftest.$ac_objext
5757 if { (eval echo "$as_me:5757: \"$ac_compile\"") >&5
5758   (eval $ac_compile) 2>&5
5759   ac_status=$?
5760   echo "$as_me:5760: \$? = $ac_status" >&5
5761   (exit $ac_status); } &&
5762          { ac_try='test -s conftest.$ac_objext'
5763   { (eval echo "$as_me:5763: \"$ac_try\"") >&5
5764   (eval $ac_try) 2>&5
5765   ac_status=$?
5766   echo "$as_me:5766: \$? = $ac_status" >&5
5767   (exit $ac_status); }; }; then
5768
5769                                 test -n "$verbose" && echo "    ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
5770
5771 echo "${as_me:-configure}:5771: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
5772
5773                                 cf_cv_find_linkage_utf8=maybe
5774                                 cf_test_CPPFLAGS="$CPPFLAGS"
5775                                 break
5776 else
5777   echo "$as_me: failed program was:" >&5
5778 cat conftest.$ac_ext >&5
5779
5780                                 CPPFLAGS="$cf_save_CPPFLAGS"
5781
5782 fi
5783 rm -f conftest.$ac_objext conftest.$ac_ext
5784                 fi
5785         done
5786
5787         if test "$cf_cv_find_linkage_utf8" = maybe ; then
5788
5789 echo "${as_me:-configure}:5789: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
5790
5791                 cf_save_LIBS="$LIBS"
5792                 cf_save_LDFLAGS="$LDFLAGS"
5793
5794                 if test "$cf_cv_find_linkage_utf8" != yes ; then
5795
5796 cf_search=
5797 cf_library_path_list=""
5798 if test -n "${LDFLAGS}${LIBS}" ; then
5799         for cf_library_path in $LDFLAGS $LIBS
5800         do
5801                 case $cf_library_path in
5802                 (-L*)
5803                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
5804
5805 test "x$cf_library_path" != "xNONE" && \
5806 test -d "$cf_library_path" && \
5807  {
5808         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
5809         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
5810         test -d $cf_library_path/lib/utf8 &&       cf_search="$cf_search $cf_library_path/lib/utf8"
5811         test -d $cf_library_path/lib/utf8/lib &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
5812         test -d $cf_library_path/utf8/lib &&       cf_search="$cf_search $cf_library_path/utf8/lib"
5813         test -d $cf_library_path/utf8/lib/utf8 &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
5814 }
5815
5816                         cf_library_path_list="$cf_library_path_list $cf_search"
5817                         ;;
5818                 esac
5819         done
5820 fi
5821
5822 cf_search=
5823
5824 test "x$prefix" != "xNONE" && \
5825 test -d "$prefix" && \
5826  {
5827         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
5828         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
5829         test -d $prefix/lib/utf8 &&       cf_search="$cf_search $prefix/lib/utf8"
5830         test -d $prefix/lib/utf8/lib &&    cf_search="$cf_search $prefix/lib/utf8/lib"
5831         test -d $prefix/utf8/lib &&       cf_search="$cf_search $prefix/utf8/lib"
5832         test -d $prefix/utf8/lib/utf8 &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
5833 }
5834
5835 for cf_subdir_prefix in \
5836         /usr \
5837         /usr/local \
5838         /usr/pkg \
5839         /opt \
5840         /opt/local \
5841         $HOME
5842 do
5843
5844 test "x$cf_subdir_prefix" != "x$prefix" && \
5845 test -d "$cf_subdir_prefix" && \
5846 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
5847         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
5848         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
5849         test -d $cf_subdir_prefix/lib/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/lib/utf8"
5850         test -d $cf_subdir_prefix/lib/utf8/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/utf8/lib"
5851         test -d $cf_subdir_prefix/utf8/lib &&       cf_search="$cf_search $cf_subdir_prefix/utf8/lib"
5852         test -d $cf_subdir_prefix/utf8/lib/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/lib/utf8"
5853 }
5854
5855 done
5856
5857 cf_search="$cf_library_path_list $cf_search"
5858
5859                         for cf_cv_library_path_utf8 in $cf_search
5860                         do
5861                                 if test -d $cf_cv_library_path_utf8 ; then
5862                                         test -n "$verbose" && echo "    ... testing $cf_cv_library_path_utf8" 1>&6
5863
5864 echo "${as_me:-configure}:5864: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
5865
5866                                         CPPFLAGS="$cf_test_CPPFLAGS"
5867                                         LIBS="-lutf8  $cf_save_LIBS"
5868                                         LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
5869                                         cat >conftest.$ac_ext <<_ACEOF
5870 #line 5870 "configure"
5871 #include "confdefs.h"
5872
5873 #include <libutf8.h>
5874 int
5875 main ()
5876 {
5877 putwc(0,0);
5878   ;
5879   return 0;
5880 }
5881 _ACEOF
5882 rm -f conftest.$ac_objext conftest$ac_exeext
5883 if { (eval echo "$as_me:5883: \"$ac_link\"") >&5
5884   (eval $ac_link) 2>&5
5885   ac_status=$?
5886   echo "$as_me:5886: \$? = $ac_status" >&5
5887   (exit $ac_status); } &&
5888          { ac_try='test -s conftest$ac_exeext'
5889   { (eval echo "$as_me:5889: \"$ac_try\"") >&5
5890   (eval $ac_try) 2>&5
5891   ac_status=$?
5892   echo "$as_me:5892: \$? = $ac_status" >&5
5893   (exit $ac_status); }; }; then
5894
5895                                         test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
5896
5897 echo "${as_me:-configure}:5897: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
5898
5899                                         cf_cv_find_linkage_utf8=yes
5900                                         cf_cv_library_file_utf8="-lutf8"
5901                                         break
5902 else
5903   echo "$as_me: failed program was:" >&5
5904 cat conftest.$ac_ext >&5
5905
5906                                         CPPFLAGS="$cf_save_CPPFLAGS"
5907                                         LIBS="$cf_save_LIBS"
5908                                         LDFLAGS="$cf_save_LDFLAGS"
5909
5910 fi
5911 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5912                                 fi
5913                         done
5914                         CPPFLAGS="$cf_save_CPPFLAGS"
5915                         LDFLAGS="$cf_save_LDFLAGS"
5916                 fi
5917
5918         else
5919                 cf_cv_find_linkage_utf8=no
5920         fi
5921
5922 fi
5923 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5924
5925 fi
5926 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5927
5928 LIBS="$cf_save_LIBS"
5929
5930 if test "$cf_cv_find_linkage_utf8" = yes ; then
5931 cf_cv_utf8_lib=add-on
5932 else
5933 cf_cv_utf8_lib=no
5934 fi
5935
5936 fi
5937 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5938 fi
5939 echo "$as_me:5939: result: $cf_cv_utf8_lib" >&5
5940 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
5941
5942 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
5943 # ncurses/ncursesw:
5944 if test "$cf_cv_utf8_lib" = "add-on" ; then
5945
5946 cat >>confdefs.h <<\EOF
5947 #define HAVE_LIBUTF8_H 1
5948 EOF
5949
5950 if test -n "$cf_cv_header_path_utf8" ; then
5951   for cf_add_incdir in $cf_cv_header_path_utf8
5952   do
5953         while test $cf_add_incdir != /usr/include
5954         do
5955           if test -d $cf_add_incdir
5956           then
5957                 cf_have_incdir=no
5958                 if test -n "$CFLAGS$CPPFLAGS" ; then
5959                   # a loop is needed to ensure we can add subdirs of existing dirs
5960                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5961                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5962                           cf_have_incdir=yes; break
5963                         fi
5964                   done
5965                 fi
5966
5967                 if test "$cf_have_incdir" = no ; then
5968                   if test "$cf_add_incdir" = /usr/local/include ; then
5969                         if test "$GCC" = yes
5970                         then
5971                           cf_save_CPPFLAGS=$CPPFLAGS
5972                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5973                           cat >conftest.$ac_ext <<_ACEOF
5974 #line 5974 "configure"
5975 #include "confdefs.h"
5976 #include <stdio.h>
5977 int
5978 main ()
5979 {
5980 printf("Hello")
5981   ;
5982   return 0;
5983 }
5984 _ACEOF
5985 rm -f conftest.$ac_objext
5986 if { (eval echo "$as_me:5986: \"$ac_compile\"") >&5
5987   (eval $ac_compile) 2>&5
5988   ac_status=$?
5989   echo "$as_me:5989: \$? = $ac_status" >&5
5990   (exit $ac_status); } &&
5991          { ac_try='test -s conftest.$ac_objext'
5992   { (eval echo "$as_me:5992: \"$ac_try\"") >&5
5993   (eval $ac_try) 2>&5
5994   ac_status=$?
5995   echo "$as_me:5995: \$? = $ac_status" >&5
5996   (exit $ac_status); }; }; then
5997   :
5998 else
5999   echo "$as_me: failed program was:" >&5
6000 cat conftest.$ac_ext >&5
6001 cf_have_incdir=yes
6002 fi
6003 rm -f conftest.$ac_objext conftest.$ac_ext
6004                           CPPFLAGS=$cf_save_CPPFLAGS
6005                         fi
6006                   fi
6007                 fi
6008
6009                 if test "$cf_have_incdir" = no ; then
6010                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6011
6012 echo "${as_me:-configure}:6012: testing adding $cf_add_incdir to include-path ..." 1>&5
6013
6014                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6015
6016                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6017                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6018                   cf_add_incdir="$cf_top_incdir"
6019                 else
6020                   break
6021                 fi
6022           else
6023                 break
6024           fi
6025         done
6026   done
6027 fi
6028
6029 if test -n "$cf_cv_library_path_utf8" ; then
6030         for cf_add_libdir in $cf_cv_library_path_utf8
6031         do
6032                 if test $cf_add_libdir = /usr/lib ; then
6033                         :
6034                 elif test -d $cf_add_libdir
6035                 then
6036                         cf_have_libdir=no
6037                         if test -n "$LDFLAGS$LIBS" ; then
6038                                 # a loop is needed to ensure we can add subdirs of existing dirs
6039                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6040                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6041                                                 cf_have_libdir=yes; break
6042                                         fi
6043                                 done
6044                         fi
6045                         if test "$cf_have_libdir" = no ; then
6046                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6047
6048 echo "${as_me:-configure}:6048: testing adding $cf_add_libdir to library-path ..." 1>&5
6049
6050                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6051                         fi
6052                 fi
6053         done
6054 fi
6055
6056 cf_add_libs="$cf_cv_library_file_utf8"
6057 # Filter out duplicates - this happens with badly-designed ".pc" files...
6058 for cf_add_1lib in $LIBS
6059 do
6060         for cf_add_2lib in $cf_add_libs
6061         do
6062                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6063                 then
6064                         cf_add_1lib=
6065                         break
6066                 fi
6067         done
6068         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6069 done
6070 LIBS="$cf_add_libs"
6071
6072 fi
6073
6074 cf_ncuconfig_root=$cf_cv_screen
6075 cf_have_ncuconfig=no
6076
6077 if test "x${PKG_CONFIG:=none}" != xnone; then
6078         echo "$as_me:6078: checking pkg-config for $cf_ncuconfig_root" >&5
6079 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
6080         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
6081                 echo "$as_me:6081: result: yes" >&5
6082 echo "${ECHO_T}yes" >&6
6083
6084                 echo "$as_me:6084: checking if the $cf_ncuconfig_root package files work" >&5
6085 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
6086                 cf_have_ncuconfig=unknown
6087
6088                 cf_save_CPPFLAGS="$CPPFLAGS"
6089                 cf_save_LIBS="$LIBS"
6090
6091                 CPPFLAGS="$CPPFLAGS `$PKG_CONFIG --cflags $cf_ncuconfig_root`"
6092
6093 cf_add_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
6094 # Filter out duplicates - this happens with badly-designed ".pc" files...
6095 for cf_add_1lib in $LIBS
6096 do
6097         for cf_add_2lib in $cf_add_libs
6098         do
6099                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6100                 then
6101                         cf_add_1lib=
6102                         break
6103                 fi
6104         done
6105         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6106 done
6107 LIBS="$cf_add_libs"
6108
6109                 cat >conftest.$ac_ext <<_ACEOF
6110 #line 6110 "configure"
6111 #include "confdefs.h"
6112 #include <${cf_cv_ncurses_header:-curses.h}>
6113 int
6114 main ()
6115 {
6116 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
6117   ;
6118   return 0;
6119 }
6120 _ACEOF
6121 rm -f conftest.$ac_objext conftest$ac_exeext
6122 if { (eval echo "$as_me:6122: \"$ac_link\"") >&5
6123   (eval $ac_link) 2>&5
6124   ac_status=$?
6125   echo "$as_me:6125: \$? = $ac_status" >&5
6126   (exit $ac_status); } &&
6127          { ac_try='test -s conftest$ac_exeext'
6128   { (eval echo "$as_me:6128: \"$ac_try\"") >&5
6129   (eval $ac_try) 2>&5
6130   ac_status=$?
6131   echo "$as_me:6131: \$? = $ac_status" >&5
6132   (exit $ac_status); }; }; then
6133   if test "$cross_compiling" = yes; then
6134   cf_have_ncuconfig=maybe
6135 else
6136   cat >conftest.$ac_ext <<_ACEOF
6137 #line 6137 "configure"
6138 #include "confdefs.h"
6139 #include <${cf_cv_ncurses_header:-curses.h}>
6140                                 int main(void)
6141                                 { char *xx = curses_version(); return (xx == 0); }
6142 _ACEOF
6143 rm -f conftest$ac_exeext
6144 if { (eval echo "$as_me:6144: \"$ac_link\"") >&5
6145   (eval $ac_link) 2>&5
6146   ac_status=$?
6147   echo "$as_me:6147: \$? = $ac_status" >&5
6148   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
6149   { (eval echo "$as_me:6149: \"$ac_try\"") >&5
6150   (eval $ac_try) 2>&5
6151   ac_status=$?
6152   echo "$as_me:6152: \$? = $ac_status" >&5
6153   (exit $ac_status); }; }; then
6154   cf_have_ncuconfig=yes
6155 else
6156   echo "$as_me: program exited with status $ac_status" >&5
6157 echo "$as_me: failed program was:" >&5
6158 cat conftest.$ac_ext >&5
6159 cf_have_ncuconfig=no
6160 fi
6161 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
6162 fi
6163 else
6164   echo "$as_me: failed program was:" >&5
6165 cat conftest.$ac_ext >&5
6166 cf_have_ncuconfig=no
6167 fi
6168 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6169                 echo "$as_me:6169: result: $cf_have_ncuconfig" >&5
6170 echo "${ECHO_T}$cf_have_ncuconfig" >&6
6171                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
6172                 if test "$cf_have_ncuconfig" != "yes"
6173                 then
6174                         CPPFLAGS="$cf_save_CPPFLAGS"
6175                         LIBS="$cf_save_LIBS"
6176                         NCURSES_CONFIG_PKG=none
6177                 else
6178
6179 cat >>confdefs.h <<\EOF
6180 #define NCURSES 1
6181 EOF
6182
6183                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
6184                 fi
6185
6186         else
6187                 echo "$as_me:6187: result: no" >&5
6188 echo "${ECHO_T}no" >&6
6189                 NCURSES_CONFIG_PKG=none
6190         fi
6191 else
6192         NCURSES_CONFIG_PKG=none
6193 fi
6194
6195 if test "x$cf_have_ncuconfig" = "xno"; then
6196         echo "Looking for ${cf_ncuconfig_root}-config"
6197
6198 if test -n "$ac_tool_prefix"; then
6199   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
6200   do
6201     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
6202 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
6203 echo "$as_me:6203: checking for $ac_word" >&5
6204 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
6205 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
6206   echo $ECHO_N "(cached) $ECHO_C" >&6
6207 else
6208   if test -n "$NCURSES_CONFIG"; then
6209   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
6210 else
6211   ac_save_IFS=$IFS; IFS=$ac_path_separator
6212 ac_dummy="$PATH"
6213 for ac_dir in $ac_dummy; do
6214   IFS=$ac_save_IFS
6215   test -z "$ac_dir" && ac_dir=.
6216   $as_executable_p "$ac_dir/$ac_word" || continue
6217 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
6218 echo "$as_me:6218: found $ac_dir/$ac_word" >&5
6219 break
6220 done
6221
6222 fi
6223 fi
6224 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
6225 if test -n "$NCURSES_CONFIG"; then
6226   echo "$as_me:6226: result: $NCURSES_CONFIG" >&5
6227 echo "${ECHO_T}$NCURSES_CONFIG" >&6
6228 else
6229   echo "$as_me:6229: result: no" >&5
6230 echo "${ECHO_T}no" >&6
6231 fi
6232
6233     test -n "$NCURSES_CONFIG" && break
6234   done
6235 fi
6236 if test -z "$NCURSES_CONFIG"; then
6237   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
6238   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
6239 do
6240   # Extract the first word of "$ac_prog", so it can be a program name with args.
6241 set dummy $ac_prog; ac_word=$2
6242 echo "$as_me:6242: checking for $ac_word" >&5
6243 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
6244 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
6245   echo $ECHO_N "(cached) $ECHO_C" >&6
6246 else
6247   if test -n "$ac_ct_NCURSES_CONFIG"; then
6248   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
6249 else
6250   ac_save_IFS=$IFS; IFS=$ac_path_separator
6251 ac_dummy="$PATH"
6252 for ac_dir in $ac_dummy; do
6253   IFS=$ac_save_IFS
6254   test -z "$ac_dir" && ac_dir=.
6255   $as_executable_p "$ac_dir/$ac_word" || continue
6256 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
6257 echo "$as_me:6257: found $ac_dir/$ac_word" >&5
6258 break
6259 done
6260
6261 fi
6262 fi
6263 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
6264 if test -n "$ac_ct_NCURSES_CONFIG"; then
6265   echo "$as_me:6265: result: $ac_ct_NCURSES_CONFIG" >&5
6266 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
6267 else
6268   echo "$as_me:6268: result: no" >&5
6269 echo "${ECHO_T}no" >&6
6270 fi
6271
6272   test -n "$ac_ct_NCURSES_CONFIG" && break
6273 done
6274 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
6275
6276   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
6277 fi
6278
6279         if test "$NCURSES_CONFIG" != none ; then
6280
6281                 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
6282
6283 cf_add_libs="`$NCURSES_CONFIG --libs`"
6284 # Filter out duplicates - this happens with badly-designed ".pc" files...
6285 for cf_add_1lib in $LIBS
6286 do
6287         for cf_add_2lib in $cf_add_libs
6288         do
6289                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6290                 then
6291                         cf_add_1lib=
6292                         break
6293                 fi
6294         done
6295         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6296 done
6297 LIBS="$cf_add_libs"
6298
6299                 # even with config script, some packages use no-override for curses.h
6300
6301 echo "$as_me:6301: checking if we have identified curses headers" >&5
6302 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
6303 if test "${cf_cv_ncurses_header+set}" = set; then
6304   echo $ECHO_N "(cached) $ECHO_C" >&6
6305 else
6306
6307 cf_cv_ncurses_header=none
6308 for cf_header in \
6309         ncurses.h $cf_cv_screen/ncurses.h \
6310         curses.h $cf_cv_screen/curses.h
6311 do
6312 cat >conftest.$ac_ext <<_ACEOF
6313 #line 6313 "configure"
6314 #include "confdefs.h"
6315 #include <${cf_header}>
6316 int
6317 main ()
6318 {
6319 initscr(); tgoto("?", 0,0)
6320   ;
6321   return 0;
6322 }
6323 _ACEOF
6324 rm -f conftest.$ac_objext
6325 if { (eval echo "$as_me:6325: \"$ac_compile\"") >&5
6326   (eval $ac_compile) 2>&5
6327   ac_status=$?
6328   echo "$as_me:6328: \$? = $ac_status" >&5
6329   (exit $ac_status); } &&
6330          { ac_try='test -s conftest.$ac_objext'
6331   { (eval echo "$as_me:6331: \"$ac_try\"") >&5
6332   (eval $ac_try) 2>&5
6333   ac_status=$?
6334   echo "$as_me:6334: \$? = $ac_status" >&5
6335   (exit $ac_status); }; }; then
6336   cf_cv_ncurses_header=$cf_header; break
6337 else
6338   echo "$as_me: failed program was:" >&5
6339 cat conftest.$ac_ext >&5
6340 fi
6341 rm -f conftest.$ac_objext conftest.$ac_ext
6342 done
6343
6344 fi
6345 echo "$as_me:6345: result: $cf_cv_ncurses_header" >&5
6346 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
6347
6348 if test "$cf_cv_ncurses_header" = none ; then
6349         { { echo "$as_me:6349: error: No curses header-files found" >&5
6350 echo "$as_me: error: No curses header-files found" >&2;}
6351    { (exit 1); exit 1; }; }
6352 fi
6353
6354 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
6355
6356 for ac_header in $cf_cv_ncurses_header
6357 do
6358 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
6359 echo "$as_me:6359: checking for $ac_header" >&5
6360 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
6361 if eval "test \"\${$as_ac_Header+set}\" = set"; then
6362   echo $ECHO_N "(cached) $ECHO_C" >&6
6363 else
6364   cat >conftest.$ac_ext <<_ACEOF
6365 #line 6365 "configure"
6366 #include "confdefs.h"
6367 #include <$ac_header>
6368 _ACEOF
6369 if { (eval echo "$as_me:6369: \"$ac_cpp conftest.$ac_ext\"") >&5
6370   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
6371   ac_status=$?
6372   egrep -v '^ *\+' conftest.er1 >conftest.err
6373   rm -f conftest.er1
6374   cat conftest.err >&5
6375   echo "$as_me:6375: \$? = $ac_status" >&5
6376   (exit $ac_status); } >/dev/null; then
6377   if test -s conftest.err; then
6378     ac_cpp_err=$ac_c_preproc_warn_flag
6379   else
6380     ac_cpp_err=
6381   fi
6382 else
6383   ac_cpp_err=yes
6384 fi
6385 if test -z "$ac_cpp_err"; then
6386   eval "$as_ac_Header=yes"
6387 else
6388   echo "$as_me: failed program was:" >&5
6389   cat conftest.$ac_ext >&5
6390   eval "$as_ac_Header=no"
6391 fi
6392 rm -f conftest.err conftest.$ac_ext
6393 fi
6394 echo "$as_me:6394: result: `eval echo '${'$as_ac_Header'}'`" >&5
6395 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
6396 if test `eval echo '${'$as_ac_Header'}'` = yes; then
6397   cat >>confdefs.h <<EOF
6398 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
6399 EOF
6400
6401 fi
6402 done
6403
6404 cat >>confdefs.h <<\EOF
6405 #define NCURSES 1
6406 EOF
6407
6408 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
6409
6410                 cat >>confdefs.h <<EOF
6411 #define $cf_nculib_ROOT 1
6412 EOF
6413
6414                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
6415
6416         else
6417
6418 cf_ncuhdr_root=$cf_cv_screen
6419
6420 test -n "$cf_cv_curses_dir" && \
6421 test "$cf_cv_curses_dir" != "no" && { \
6422
6423 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
6424   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
6425   do
6426         while test $cf_add_incdir != /usr/include
6427         do
6428           if test -d $cf_add_incdir
6429           then
6430                 cf_have_incdir=no
6431                 if test -n "$CFLAGS$CPPFLAGS" ; then
6432                   # a loop is needed to ensure we can add subdirs of existing dirs
6433                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6434                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6435                           cf_have_incdir=yes; break
6436                         fi
6437                   done
6438                 fi
6439
6440                 if test "$cf_have_incdir" = no ; then
6441                   if test "$cf_add_incdir" = /usr/local/include ; then
6442                         if test "$GCC" = yes
6443                         then
6444                           cf_save_CPPFLAGS=$CPPFLAGS
6445                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6446                           cat >conftest.$ac_ext <<_ACEOF
6447 #line 6447 "configure"
6448 #include "confdefs.h"
6449 #include <stdio.h>
6450 int
6451 main ()
6452 {
6453 printf("Hello")
6454   ;
6455   return 0;
6456 }
6457 _ACEOF
6458 rm -f conftest.$ac_objext
6459 if { (eval echo "$as_me:6459: \"$ac_compile\"") >&5
6460   (eval $ac_compile) 2>&5
6461   ac_status=$?
6462   echo "$as_me:6462: \$? = $ac_status" >&5
6463   (exit $ac_status); } &&
6464          { ac_try='test -s conftest.$ac_objext'
6465   { (eval echo "$as_me:6465: \"$ac_try\"") >&5
6466   (eval $ac_try) 2>&5
6467   ac_status=$?
6468   echo "$as_me:6468: \$? = $ac_status" >&5
6469   (exit $ac_status); }; }; then
6470   :
6471 else
6472   echo "$as_me: failed program was:" >&5
6473 cat conftest.$ac_ext >&5
6474 cf_have_incdir=yes
6475 fi
6476 rm -f conftest.$ac_objext conftest.$ac_ext
6477                           CPPFLAGS=$cf_save_CPPFLAGS
6478                         fi
6479                   fi
6480                 fi
6481
6482                 if test "$cf_have_incdir" = no ; then
6483                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6484
6485 echo "${as_me:-configure}:6485: testing adding $cf_add_incdir to include-path ..." 1>&5
6486
6487                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6488
6489                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6490                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6491                   cf_add_incdir="$cf_top_incdir"
6492                 else
6493                   break
6494                 fi
6495           else
6496                 break
6497           fi
6498         done
6499   done
6500 fi
6501
6502 }
6503
6504 echo "$as_me:6504: checking for $cf_ncuhdr_root header in include-path" >&5
6505 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
6506 if test "${cf_cv_ncurses_h+set}" = set; then
6507   echo $ECHO_N "(cached) $ECHO_C" >&6
6508 else
6509
6510         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
6511         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
6512         for cf_header in $cf_header_list
6513         do
6514
6515         cat >conftest.$ac_ext <<_ACEOF
6516 #line 6516 "configure"
6517 #include "confdefs.h"
6518
6519 #include <$cf_header>
6520 int
6521 main ()
6522 {
6523
6524 #ifdef NCURSES_VERSION
6525
6526 printf("%s\n", NCURSES_VERSION);
6527 #else
6528 #ifdef __NCURSES_H
6529 printf("old\n");
6530 #else
6531         make an error
6532 #endif
6533 #endif
6534
6535   ;
6536   return 0;
6537 }
6538 _ACEOF
6539 rm -f conftest.$ac_objext
6540 if { (eval echo "$as_me:6540: \"$ac_compile\"") >&5
6541   (eval $ac_compile) 2>&5
6542   ac_status=$?
6543   echo "$as_me:6543: \$? = $ac_status" >&5
6544   (exit $ac_status); } &&
6545          { ac_try='test -s conftest.$ac_objext'
6546   { (eval echo "$as_me:6546: \"$ac_try\"") >&5
6547   (eval $ac_try) 2>&5
6548   ac_status=$?
6549   echo "$as_me:6549: \$? = $ac_status" >&5
6550   (exit $ac_status); }; }; then
6551   cf_cv_ncurses_h=$cf_header
6552
6553 else
6554   echo "$as_me: failed program was:" >&5
6555 cat conftest.$ac_ext >&5
6556 cf_cv_ncurses_h=no
6557 fi
6558 rm -f conftest.$ac_objext conftest.$ac_ext
6559
6560                 test "$cf_cv_ncurses_h" != no && break
6561         done
6562
6563 fi
6564 echo "$as_me:6564: result: $cf_cv_ncurses_h" >&5
6565 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
6566
6567 if test "$cf_cv_ncurses_h" != no ; then
6568         cf_cv_ncurses_header=$cf_cv_ncurses_h
6569 else
6570
6571 echo "$as_me:6571: checking for $cf_ncuhdr_root include-path" >&5
6572 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
6573 if test "${cf_cv_ncurses_h2+set}" = set; then
6574   echo $ECHO_N "(cached) $ECHO_C" >&6
6575 else
6576
6577         test -n "$verbose" && echo
6578
6579 cf_search=
6580
6581 # collect the current set of include-directories from compiler flags
6582 cf_header_path_list=""
6583 if test -n "${CFLAGS}${CPPFLAGS}" ; then
6584         for cf_header_path in $CPPFLAGS $CFLAGS
6585         do
6586                 case $cf_header_path in
6587                 (-I*)
6588                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
6589
6590 test "x$cf_header_path" != "xNONE" && \
6591 test -d "$cf_header_path" && \
6592  {
6593         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
6594         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
6595         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
6596         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
6597         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
6598         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"
6599 }
6600
6601                         cf_header_path_list="$cf_header_path_list $cf_search"
6602                         ;;
6603                 esac
6604         done
6605 fi
6606
6607 # add the variations for the package we are looking for
6608
6609 cf_search=
6610
6611 test "x$prefix" != "xNONE" && \
6612 test -d "$prefix" && \
6613  {
6614         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
6615         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
6616         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
6617         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
6618         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
6619         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
6620 }
6621
6622 for cf_subdir_prefix in \
6623         /usr \
6624         /usr/local \
6625         /usr/pkg \
6626         /opt \
6627         /opt/local \
6628         $HOME
6629 do
6630
6631 test "x$cf_subdir_prefix" != "x$prefix" && \
6632 test -d "$cf_subdir_prefix" && \
6633 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
6634         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
6635         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
6636         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
6637         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
6638         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
6639         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"
6640 }
6641
6642 done
6643
6644 test "$includedir" != NONE && \
6645 test "$includedir" != "/usr/include" && \
6646 test -d "$includedir" && {
6647         test -d $includedir &&    cf_search="$cf_search $includedir"
6648         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
6649 }
6650
6651 test "$oldincludedir" != NONE && \
6652 test "$oldincludedir" != "/usr/include" && \
6653 test -d "$oldincludedir" && {
6654         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
6655         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
6656 }
6657
6658 cf_search="$cf_search $cf_header_path_list"
6659
6660         test -n "$verbose" && echo search path $cf_search
6661         cf_save2_CPPFLAGS="$CPPFLAGS"
6662         for cf_incdir in $cf_search
6663         do
6664
6665 if test -n "$cf_incdir" ; then
6666   for cf_add_incdir in $cf_incdir
6667   do
6668         while test $cf_add_incdir != /usr/include
6669         do
6670           if test -d $cf_add_incdir
6671           then
6672                 cf_have_incdir=no
6673                 if test -n "$CFLAGS$CPPFLAGS" ; then
6674                   # a loop is needed to ensure we can add subdirs of existing dirs
6675                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6676                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6677                           cf_have_incdir=yes; break
6678                         fi
6679                   done
6680                 fi
6681
6682                 if test "$cf_have_incdir" = no ; then
6683                   if test "$cf_add_incdir" = /usr/local/include ; then
6684                         if test "$GCC" = yes
6685                         then
6686                           cf_save_CPPFLAGS=$CPPFLAGS
6687                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6688                           cat >conftest.$ac_ext <<_ACEOF
6689 #line 6689 "configure"
6690 #include "confdefs.h"
6691 #include <stdio.h>
6692 int
6693 main ()
6694 {
6695 printf("Hello")
6696   ;
6697   return 0;
6698 }
6699 _ACEOF
6700 rm -f conftest.$ac_objext
6701 if { (eval echo "$as_me:6701: \"$ac_compile\"") >&5
6702   (eval $ac_compile) 2>&5
6703   ac_status=$?
6704   echo "$as_me:6704: \$? = $ac_status" >&5
6705   (exit $ac_status); } &&
6706          { ac_try='test -s conftest.$ac_objext'
6707   { (eval echo "$as_me:6707: \"$ac_try\"") >&5
6708   (eval $ac_try) 2>&5
6709   ac_status=$?
6710   echo "$as_me:6710: \$? = $ac_status" >&5
6711   (exit $ac_status); }; }; then
6712   :
6713 else
6714   echo "$as_me: failed program was:" >&5
6715 cat conftest.$ac_ext >&5
6716 cf_have_incdir=yes
6717 fi
6718 rm -f conftest.$ac_objext conftest.$ac_ext
6719                           CPPFLAGS=$cf_save_CPPFLAGS
6720                         fi
6721                   fi
6722                 fi
6723
6724                 if test "$cf_have_incdir" = no ; then
6725                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6726
6727 echo "${as_me:-configure}:6727: testing adding $cf_add_incdir to include-path ..." 1>&5
6728
6729                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6730
6731                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6732                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6733                   cf_add_incdir="$cf_top_incdir"
6734                 else
6735                   break
6736                 fi
6737           else
6738                 break
6739           fi
6740         done
6741   done
6742 fi
6743
6744                 for cf_header in \
6745                         ncurses.h \
6746                         curses.h
6747                 do
6748
6749         cat >conftest.$ac_ext <<_ACEOF
6750 #line 6750 "configure"
6751 #include "confdefs.h"
6752
6753 #include <$cf_header>
6754 int
6755 main ()
6756 {
6757
6758 #ifdef NCURSES_VERSION
6759
6760 printf("%s\n", NCURSES_VERSION);
6761 #else
6762 #ifdef __NCURSES_H
6763 printf("old\n");
6764 #else
6765         make an error
6766 #endif
6767 #endif
6768
6769   ;
6770   return 0;
6771 }
6772 _ACEOF
6773 rm -f conftest.$ac_objext
6774 if { (eval echo "$as_me:6774: \"$ac_compile\"") >&5
6775   (eval $ac_compile) 2>&5
6776   ac_status=$?
6777   echo "$as_me:6777: \$? = $ac_status" >&5
6778   (exit $ac_status); } &&
6779          { ac_try='test -s conftest.$ac_objext'
6780   { (eval echo "$as_me:6780: \"$ac_try\"") >&5
6781   (eval $ac_try) 2>&5
6782   ac_status=$?
6783   echo "$as_me:6783: \$? = $ac_status" >&5
6784   (exit $ac_status); }; }; then
6785   cf_cv_ncurses_h2=$cf_header
6786
6787 else
6788   echo "$as_me: failed program was:" >&5
6789 cat conftest.$ac_ext >&5
6790 cf_cv_ncurses_h2=no
6791 fi
6792 rm -f conftest.$ac_objext conftest.$ac_ext
6793
6794                         if test "$cf_cv_ncurses_h2" != no ; then
6795                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
6796                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
6797                                 break
6798                         fi
6799                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
6800                 done
6801                 CPPFLAGS="$cf_save2_CPPFLAGS"
6802                 test "$cf_cv_ncurses_h2" != no && break
6803         done
6804         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:6804: error: not found" >&5
6805 echo "$as_me: error: not found" >&2;}
6806    { (exit 1); exit 1; }; }
6807
6808 fi
6809 echo "$as_me:6809: result: $cf_cv_ncurses_h2" >&5
6810 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
6811
6812         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
6813         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
6814         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
6815                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
6816         fi
6817
6818 if test -n "$cf_1st_incdir" ; then
6819   for cf_add_incdir in $cf_1st_incdir
6820   do
6821         while test $cf_add_incdir != /usr/include
6822         do
6823           if test -d $cf_add_incdir
6824           then
6825                 cf_have_incdir=no
6826                 if test -n "$CFLAGS$CPPFLAGS" ; then
6827                   # a loop is needed to ensure we can add subdirs of existing dirs
6828                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6829                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6830                           cf_have_incdir=yes; break
6831                         fi
6832                   done
6833                 fi
6834
6835                 if test "$cf_have_incdir" = no ; then
6836                   if test "$cf_add_incdir" = /usr/local/include ; then
6837                         if test "$GCC" = yes
6838                         then
6839                           cf_save_CPPFLAGS=$CPPFLAGS
6840                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6841                           cat >conftest.$ac_ext <<_ACEOF
6842 #line 6842 "configure"
6843 #include "confdefs.h"
6844 #include <stdio.h>
6845 int
6846 main ()
6847 {
6848 printf("Hello")
6849   ;
6850   return 0;
6851 }
6852 _ACEOF
6853 rm -f conftest.$ac_objext
6854 if { (eval echo "$as_me:6854: \"$ac_compile\"") >&5
6855   (eval $ac_compile) 2>&5
6856   ac_status=$?
6857   echo "$as_me:6857: \$? = $ac_status" >&5
6858   (exit $ac_status); } &&
6859          { ac_try='test -s conftest.$ac_objext'
6860   { (eval echo "$as_me:6860: \"$ac_try\"") >&5
6861   (eval $ac_try) 2>&5
6862   ac_status=$?
6863   echo "$as_me:6863: \$? = $ac_status" >&5
6864   (exit $ac_status); }; }; then
6865   :
6866 else
6867   echo "$as_me: failed program was:" >&5
6868 cat conftest.$ac_ext >&5
6869 cf_have_incdir=yes
6870 fi
6871 rm -f conftest.$ac_objext conftest.$ac_ext
6872                           CPPFLAGS=$cf_save_CPPFLAGS
6873                         fi
6874                   fi
6875                 fi
6876
6877                 if test "$cf_have_incdir" = no ; then
6878                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6879
6880 echo "${as_me:-configure}:6880: testing adding $cf_add_incdir to include-path ..." 1>&5
6881
6882                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6883
6884                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6885                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6886                   cf_add_incdir="$cf_top_incdir"
6887                 else
6888                   break
6889                 fi
6890           else
6891                 break
6892           fi
6893         done
6894   done
6895 fi
6896
6897 fi
6898
6899 # Set definitions to allow ifdef'ing for ncurses.h
6900
6901 case $cf_cv_ncurses_header in
6902 (*ncurses.h)
6903
6904 cat >>confdefs.h <<\EOF
6905 #define HAVE_NCURSES_H 1
6906 EOF
6907
6908         ;;
6909 esac
6910
6911 case $cf_cv_ncurses_header in
6912 (ncurses/curses.h|ncurses/ncurses.h)
6913
6914 cat >>confdefs.h <<\EOF
6915 #define HAVE_NCURSES_NCURSES_H 1
6916 EOF
6917
6918         ;;
6919 (ncursesw/curses.h|ncursesw/ncurses.h)
6920
6921 cat >>confdefs.h <<\EOF
6922 #define HAVE_NCURSESW_NCURSES_H 1
6923 EOF
6924
6925         ;;
6926 esac
6927
6928 echo "$as_me:6928: checking for terminfo header" >&5
6929 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
6930 if test "${cf_cv_term_header+set}" = set; then
6931   echo $ECHO_N "(cached) $ECHO_C" >&6
6932 else
6933
6934 case ${cf_cv_ncurses_header} in
6935 (*/ncurses.h|*/ncursesw.h)
6936         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
6937         ;;
6938 (*)
6939         cf_term_header=term.h
6940         ;;
6941 esac
6942
6943 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
6944 do
6945 cat >conftest.$ac_ext <<_ACEOF
6946 #line 6946 "configure"
6947 #include "confdefs.h"
6948 #include <stdio.h>
6949 #include <${cf_cv_ncurses_header:-curses.h}>
6950 #include <$cf_test>
6951
6952 int
6953 main ()
6954 {
6955 int x = auto_left_margin
6956   ;
6957   return 0;
6958 }
6959 _ACEOF
6960 rm -f conftest.$ac_objext
6961 if { (eval echo "$as_me:6961: \"$ac_compile\"") >&5
6962   (eval $ac_compile) 2>&5
6963   ac_status=$?
6964   echo "$as_me:6964: \$? = $ac_status" >&5
6965   (exit $ac_status); } &&
6966          { ac_try='test -s conftest.$ac_objext'
6967   { (eval echo "$as_me:6967: \"$ac_try\"") >&5
6968   (eval $ac_try) 2>&5
6969   ac_status=$?
6970   echo "$as_me:6970: \$? = $ac_status" >&5
6971   (exit $ac_status); }; }; then
6972
6973         cf_cv_term_header="$cf_test"
6974 else
6975   echo "$as_me: failed program was:" >&5
6976 cat conftest.$ac_ext >&5
6977
6978         cf_cv_term_header=unknown
6979
6980 fi
6981 rm -f conftest.$ac_objext conftest.$ac_ext
6982         test "$cf_cv_term_header" != unknown && break
6983 done
6984
6985 fi
6986 echo "$as_me:6986: result: $cf_cv_term_header" >&5
6987 echo "${ECHO_T}$cf_cv_term_header" >&6
6988
6989 # Set definitions to allow ifdef'ing to accommodate subdirectories
6990
6991 case $cf_cv_term_header in
6992 (*term.h)
6993
6994 cat >>confdefs.h <<\EOF
6995 #define HAVE_TERM_H 1
6996 EOF
6997
6998         ;;
6999 esac
7000
7001 case $cf_cv_term_header in
7002 (ncurses/term.h)
7003
7004 cat >>confdefs.h <<\EOF
7005 #define HAVE_NCURSES_TERM_H 1
7006 EOF
7007
7008         ;;
7009 (ncursesw/term.h)
7010
7011 cat >>confdefs.h <<\EOF
7012 #define HAVE_NCURSESW_TERM_H 1
7013 EOF
7014
7015         ;;
7016 esac
7017
7018 # some applications need this, but should check for NCURSES_VERSION
7019
7020 cat >>confdefs.h <<\EOF
7021 #define NCURSES 1
7022 EOF
7023
7024 echo "$as_me:7024: checking for ncurses version" >&5
7025 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
7026 if test "${cf_cv_ncurses_version+set}" = set; then
7027   echo $ECHO_N "(cached) $ECHO_C" >&6
7028 else
7029
7030         cf_cv_ncurses_version=no
7031         cf_tempfile=out$$
7032         rm -f $cf_tempfile
7033         if test "$cross_compiling" = yes; then
7034
7035         # This will not work if the preprocessor splits the line after the
7036         # Autoconf token.  The 'unproto' program does that.
7037         cat > conftest.$ac_ext <<EOF
7038 #include <${cf_cv_ncurses_header:-curses.h}>
7039 #undef Autoconf
7040 #ifdef NCURSES_VERSION
7041 Autoconf NCURSES_VERSION
7042 #else
7043 #ifdef __NCURSES_H
7044 Autoconf "old"
7045 #endif
7046 ;
7047 #endif
7048 EOF
7049         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
7050         { (eval echo "$as_me:7050: \"$cf_try\"") >&5
7051   (eval $cf_try) 2>&5
7052   ac_status=$?
7053   echo "$as_me:7053: \$? = $ac_status" >&5
7054   (exit $ac_status); }
7055         if test -f conftest.out ; then
7056                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
7057                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
7058                 rm -f conftest.out
7059         fi
7060
7061 else
7062   cat >conftest.$ac_ext <<_ACEOF
7063 #line 7063 "configure"
7064 #include "confdefs.h"
7065
7066 #include <${cf_cv_ncurses_header:-curses.h}>
7067 #include <stdio.h>
7068 int main()
7069 {
7070         FILE *fp = fopen("$cf_tempfile", "w");
7071 #ifdef NCURSES_VERSION
7072 # ifdef NCURSES_VERSION_PATCH
7073         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
7074 # else
7075         fprintf(fp, "%s\n", NCURSES_VERSION);
7076 # endif
7077 #else
7078 # ifdef __NCURSES_H
7079         fprintf(fp, "old\n");
7080 # else
7081         make an error
7082 # endif
7083 #endif
7084         ${cf_cv_main_return:-return}(0);
7085 }
7086 _ACEOF
7087 rm -f conftest$ac_exeext
7088 if { (eval echo "$as_me:7088: \"$ac_link\"") >&5
7089   (eval $ac_link) 2>&5
7090   ac_status=$?
7091   echo "$as_me:7091: \$? = $ac_status" >&5
7092   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
7093   { (eval echo "$as_me:7093: \"$ac_try\"") >&5
7094   (eval $ac_try) 2>&5
7095   ac_status=$?
7096   echo "$as_me:7096: \$? = $ac_status" >&5
7097   (exit $ac_status); }; }; then
7098
7099         cf_cv_ncurses_version=`cat $cf_tempfile`
7100 else
7101   echo "$as_me: program exited with status $ac_status" >&5
7102 echo "$as_me: failed program was:" >&5
7103 cat conftest.$ac_ext >&5
7104 fi
7105 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
7106 fi
7107         rm -f $cf_tempfile
7108
7109 fi
7110 echo "$as_me:7110: result: $cf_cv_ncurses_version" >&5
7111 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
7112 test "$cf_cv_ncurses_version" = no ||
7113 cat >>confdefs.h <<\EOF
7114 #define NCURSES 1
7115 EOF
7116
7117 cf_nculib_root=$cf_cv_screen
7118         # This works, except for the special case where we find gpm, but
7119         # ncurses is in a nonstandard location via $LIBS, and we really want
7120         # to link gpm.
7121 cf_ncurses_LIBS=""
7122 cf_ncurses_SAVE="$LIBS"
7123 echo "$as_me:7123: checking for Gpm_Open in -lgpm" >&5
7124 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
7125 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
7126   echo $ECHO_N "(cached) $ECHO_C" >&6
7127 else
7128   ac_check_lib_save_LIBS=$LIBS
7129 LIBS="-lgpm  $LIBS"
7130 cat >conftest.$ac_ext <<_ACEOF
7131 #line 7131 "configure"
7132 #include "confdefs.h"
7133
7134 /* Override any gcc2 internal prototype to avoid an error.  */
7135 #ifdef __cplusplus
7136 extern "C"
7137 #endif
7138 /* We use char because int might match the return type of a gcc2
7139    builtin and then its argument prototype would still apply.  */
7140 char Gpm_Open ();
7141 int
7142 main ()
7143 {
7144 Gpm_Open ();
7145   ;
7146   return 0;
7147 }
7148 _ACEOF
7149 rm -f conftest.$ac_objext conftest$ac_exeext
7150 if { (eval echo "$as_me:7150: \"$ac_link\"") >&5
7151   (eval $ac_link) 2>&5
7152   ac_status=$?
7153   echo "$as_me:7153: \$? = $ac_status" >&5
7154   (exit $ac_status); } &&
7155          { ac_try='test -s conftest$ac_exeext'
7156   { (eval echo "$as_me:7156: \"$ac_try\"") >&5
7157   (eval $ac_try) 2>&5
7158   ac_status=$?
7159   echo "$as_me:7159: \$? = $ac_status" >&5
7160   (exit $ac_status); }; }; then
7161   ac_cv_lib_gpm_Gpm_Open=yes
7162 else
7163   echo "$as_me: failed program was:" >&5
7164 cat conftest.$ac_ext >&5
7165 ac_cv_lib_gpm_Gpm_Open=no
7166 fi
7167 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7168 LIBS=$ac_check_lib_save_LIBS
7169 fi
7170 echo "$as_me:7170: result: $ac_cv_lib_gpm_Gpm_Open" >&5
7171 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
7172 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
7173   echo "$as_me:7173: checking for initscr in -lgpm" >&5
7174 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
7175 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
7176   echo $ECHO_N "(cached) $ECHO_C" >&6
7177 else
7178   ac_check_lib_save_LIBS=$LIBS
7179 LIBS="-lgpm  $LIBS"
7180 cat >conftest.$ac_ext <<_ACEOF
7181 #line 7181 "configure"
7182 #include "confdefs.h"
7183
7184 /* Override any gcc2 internal prototype to avoid an error.  */
7185 #ifdef __cplusplus
7186 extern "C"
7187 #endif
7188 /* We use char because int might match the return type of a gcc2
7189    builtin and then its argument prototype would still apply.  */
7190 char initscr ();
7191 int
7192 main ()
7193 {
7194 initscr ();
7195   ;
7196   return 0;
7197 }
7198 _ACEOF
7199 rm -f conftest.$ac_objext conftest$ac_exeext
7200 if { (eval echo "$as_me:7200: \"$ac_link\"") >&5
7201   (eval $ac_link) 2>&5
7202   ac_status=$?
7203   echo "$as_me:7203: \$? = $ac_status" >&5
7204   (exit $ac_status); } &&
7205          { ac_try='test -s conftest$ac_exeext'
7206   { (eval echo "$as_me:7206: \"$ac_try\"") >&5
7207   (eval $ac_try) 2>&5
7208   ac_status=$?
7209   echo "$as_me:7209: \$? = $ac_status" >&5
7210   (exit $ac_status); }; }; then
7211   ac_cv_lib_gpm_initscr=yes
7212 else
7213   echo "$as_me: failed program was:" >&5
7214 cat conftest.$ac_ext >&5
7215 ac_cv_lib_gpm_initscr=no
7216 fi
7217 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7218 LIBS=$ac_check_lib_save_LIBS
7219 fi
7220 echo "$as_me:7220: result: $ac_cv_lib_gpm_initscr" >&5
7221 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
7222 if test $ac_cv_lib_gpm_initscr = yes; then
7223   LIBS="$cf_ncurses_SAVE"
7224 else
7225   cf_ncurses_LIBS="-lgpm"
7226 fi
7227
7228 fi
7229
7230 case $host_os in
7231 (freebsd*)
7232         # This is only necessary if you are linking against an obsolete
7233         # version of ncurses (but it should do no harm, since it's static).
7234         if test "$cf_nculib_root" = ncurses ; then
7235                 echo "$as_me:7235: checking for tgoto in -lmytinfo" >&5
7236 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
7237 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
7238   echo $ECHO_N "(cached) $ECHO_C" >&6
7239 else
7240   ac_check_lib_save_LIBS=$LIBS
7241 LIBS="-lmytinfo  $LIBS"
7242 cat >conftest.$ac_ext <<_ACEOF
7243 #line 7243 "configure"
7244 #include "confdefs.h"
7245
7246 /* Override any gcc2 internal prototype to avoid an error.  */
7247 #ifdef __cplusplus
7248 extern "C"
7249 #endif
7250 /* We use char because int might match the return type of a gcc2
7251    builtin and then its argument prototype would still apply.  */
7252 char tgoto ();
7253 int
7254 main ()
7255 {
7256 tgoto ();
7257   ;
7258   return 0;
7259 }
7260 _ACEOF
7261 rm -f conftest.$ac_objext conftest$ac_exeext
7262 if { (eval echo "$as_me:7262: \"$ac_link\"") >&5
7263   (eval $ac_link) 2>&5
7264   ac_status=$?
7265   echo "$as_me:7265: \$? = $ac_status" >&5
7266   (exit $ac_status); } &&
7267          { ac_try='test -s conftest$ac_exeext'
7268   { (eval echo "$as_me:7268: \"$ac_try\"") >&5
7269   (eval $ac_try) 2>&5
7270   ac_status=$?
7271   echo "$as_me:7271: \$? = $ac_status" >&5
7272   (exit $ac_status); }; }; then
7273   ac_cv_lib_mytinfo_tgoto=yes
7274 else
7275   echo "$as_me: failed program was:" >&5
7276 cat conftest.$ac_ext >&5
7277 ac_cv_lib_mytinfo_tgoto=no
7278 fi
7279 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7280 LIBS=$ac_check_lib_save_LIBS
7281 fi
7282 echo "$as_me:7282: result: $ac_cv_lib_mytinfo_tgoto" >&5
7283 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
7284 if test $ac_cv_lib_mytinfo_tgoto = yes; then
7285   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
7286 fi
7287
7288         fi
7289         ;;
7290 esac
7291
7292 cf_add_libs="$cf_ncurses_LIBS"
7293 # Filter out duplicates - this happens with badly-designed ".pc" files...
7294 for cf_add_1lib in $LIBS
7295 do
7296         for cf_add_2lib in $cf_add_libs
7297         do
7298                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7299                 then
7300                         cf_add_1lib=
7301                         break
7302                 fi
7303         done
7304         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7305 done
7306 LIBS="$cf_add_libs"
7307
7308 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
7309 then
7310
7311 cf_add_libs="-l$cf_nculib_root"
7312 # Filter out duplicates - this happens with badly-designed ".pc" files...
7313 for cf_add_1lib in $LIBS
7314 do
7315         for cf_add_2lib in $cf_add_libs
7316         do
7317                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7318                 then
7319                         cf_add_1lib=
7320                         break
7321                 fi
7322         done
7323         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7324 done
7325 LIBS="$cf_add_libs"
7326
7327 else
7328
7329         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
7330         cf_libdir=""
7331         echo "$as_me:7331: checking for initscr" >&5
7332 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
7333 if test "${ac_cv_func_initscr+set}" = set; then
7334   echo $ECHO_N "(cached) $ECHO_C" >&6
7335 else
7336   cat >conftest.$ac_ext <<_ACEOF
7337 #line 7337 "configure"
7338 #include "confdefs.h"
7339 /* System header to define __stub macros and hopefully few prototypes,
7340     which can conflict with char initscr (); below.  */
7341 #include <assert.h>
7342 /* Override any gcc2 internal prototype to avoid an error.  */
7343 #ifdef __cplusplus
7344 extern "C"
7345 #endif
7346 /* We use char because int might match the return type of a gcc2
7347    builtin and then its argument prototype would still apply.  */
7348 char initscr ();
7349 char (*f) ();
7350
7351 int
7352 main ()
7353 {
7354 /* The GNU C library defines this for functions which it implements
7355     to always fail with ENOSYS.  Some functions are actually named
7356     something starting with __ and the normal name is an alias.  */
7357 #if defined (__stub_initscr) || defined (__stub___initscr)
7358 choke me
7359 #else
7360 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
7361 #endif
7362
7363   ;
7364   return 0;
7365 }
7366 _ACEOF
7367 rm -f conftest.$ac_objext conftest$ac_exeext
7368 if { (eval echo "$as_me:7368: \"$ac_link\"") >&5
7369   (eval $ac_link) 2>&5
7370   ac_status=$?
7371   echo "$as_me:7371: \$? = $ac_status" >&5
7372   (exit $ac_status); } &&
7373          { ac_try='test -s conftest$ac_exeext'
7374   { (eval echo "$as_me:7374: \"$ac_try\"") >&5
7375   (eval $ac_try) 2>&5
7376   ac_status=$?
7377   echo "$as_me:7377: \$? = $ac_status" >&5
7378   (exit $ac_status); }; }; then
7379   ac_cv_func_initscr=yes
7380 else
7381   echo "$as_me: failed program was:" >&5
7382 cat conftest.$ac_ext >&5
7383 ac_cv_func_initscr=no
7384 fi
7385 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7386 fi
7387 echo "$as_me:7387: result: $ac_cv_func_initscr" >&5
7388 echo "${ECHO_T}$ac_cv_func_initscr" >&6
7389 if test $ac_cv_func_initscr = yes; then
7390   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
7391 else
7392
7393                 cf_save_LIBS="$LIBS"
7394                 echo "$as_me:7394: checking for initscr in -l$cf_nculib_root" >&5
7395 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
7396                 LIBS="-l$cf_nculib_root $LIBS"
7397                 cat >conftest.$ac_ext <<_ACEOF
7398 #line 7398 "configure"
7399 #include "confdefs.h"
7400 #include <${cf_cv_ncurses_header:-curses.h}>
7401 int
7402 main ()
7403 {
7404 initscr()
7405   ;
7406   return 0;
7407 }
7408 _ACEOF
7409 rm -f conftest.$ac_objext conftest$ac_exeext
7410 if { (eval echo "$as_me:7410: \"$ac_link\"") >&5
7411   (eval $ac_link) 2>&5
7412   ac_status=$?
7413   echo "$as_me:7413: \$? = $ac_status" >&5
7414   (exit $ac_status); } &&
7415          { ac_try='test -s conftest$ac_exeext'
7416   { (eval echo "$as_me:7416: \"$ac_try\"") >&5
7417   (eval $ac_try) 2>&5
7418   ac_status=$?
7419   echo "$as_me:7419: \$? = $ac_status" >&5
7420   (exit $ac_status); }; }; then
7421   echo "$as_me:7421: result: yes" >&5
7422 echo "${ECHO_T}yes" >&6
7423                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
7424
7425 else
7426   echo "$as_me: failed program was:" >&5
7427 cat conftest.$ac_ext >&5
7428 echo "$as_me:7428: result: no" >&5
7429 echo "${ECHO_T}no" >&6
7430
7431 cf_search=
7432 cf_library_path_list=""
7433 if test -n "${LDFLAGS}${LIBS}" ; then
7434         for cf_library_path in $LDFLAGS $LIBS
7435         do
7436                 case $cf_library_path in
7437                 (-L*)
7438                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
7439
7440 test "x$cf_library_path" != "xNONE" && \
7441 test -d "$cf_library_path" && \
7442  {
7443         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
7444         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
7445         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
7446         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
7447         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
7448         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"
7449 }
7450
7451                         cf_library_path_list="$cf_library_path_list $cf_search"
7452                         ;;
7453                 esac
7454         done
7455 fi
7456
7457 cf_search=
7458
7459 test "x$prefix" != "xNONE" && \
7460 test -d "$prefix" && \
7461  {
7462         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
7463         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
7464         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
7465         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
7466         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
7467         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
7468 }
7469
7470 for cf_subdir_prefix in \
7471         /usr \
7472         /usr/local \
7473         /usr/pkg \
7474         /opt \
7475         /opt/local \
7476         $HOME
7477 do
7478
7479 test "x$cf_subdir_prefix" != "x$prefix" && \
7480 test -d "$cf_subdir_prefix" && \
7481 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
7482         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
7483         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
7484         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
7485         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
7486         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
7487         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"
7488 }
7489
7490 done
7491
7492 cf_search="$cf_library_path_list $cf_search"
7493
7494                         for cf_libdir in $cf_search
7495                         do
7496                                 echo "$as_me:7496: checking for -l$cf_nculib_root in $cf_libdir" >&5
7497 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
7498                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
7499                                 cat >conftest.$ac_ext <<_ACEOF
7500 #line 7500 "configure"
7501 #include "confdefs.h"
7502 #include <${cf_cv_ncurses_header:-curses.h}>
7503 int
7504 main ()
7505 {
7506 initscr()
7507   ;
7508   return 0;
7509 }
7510 _ACEOF
7511 rm -f conftest.$ac_objext conftest$ac_exeext
7512 if { (eval echo "$as_me:7512: \"$ac_link\"") >&5
7513   (eval $ac_link) 2>&5
7514   ac_status=$?
7515   echo "$as_me:7515: \$? = $ac_status" >&5
7516   (exit $ac_status); } &&
7517          { ac_try='test -s conftest$ac_exeext'
7518   { (eval echo "$as_me:7518: \"$ac_try\"") >&5
7519   (eval $ac_try) 2>&5
7520   ac_status=$?
7521   echo "$as_me:7521: \$? = $ac_status" >&5
7522   (exit $ac_status); }; }; then
7523   echo "$as_me:7523: result: yes" >&5
7524 echo "${ECHO_T}yes" >&6
7525                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
7526                                          break
7527 else
7528   echo "$as_me: failed program was:" >&5
7529 cat conftest.$ac_ext >&5
7530 echo "$as_me:7530: result: no" >&5
7531 echo "${ECHO_T}no" >&6
7532                                          LIBS="$cf_save_LIBS"
7533 fi
7534 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7535                         done
7536
7537 fi
7538 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7539
7540 fi
7541
7542 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
7543
7544 if test $cf_found_library = no ; then
7545         { { echo "$as_me:7545: error: Cannot link $cf_nculib_root library" >&5
7546 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
7547    { (exit 1); exit 1; }; }
7548 fi
7549
7550 fi
7551
7552 if test -n "$cf_ncurses_LIBS" ; then
7553         echo "$as_me:7553: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
7554 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
7555         cf_ncurses_SAVE="$LIBS"
7556         for p in $cf_ncurses_LIBS ; do
7557                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
7558                 if test "$q" != "$LIBS" ; then
7559                         LIBS="$q"
7560                 fi
7561         done
7562         cat >conftest.$ac_ext <<_ACEOF
7563 #line 7563 "configure"
7564 #include "confdefs.h"
7565 #include <${cf_cv_ncurses_header:-curses.h}>
7566 int
7567 main ()
7568 {
7569 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
7570   ;
7571   return 0;
7572 }
7573 _ACEOF
7574 rm -f conftest.$ac_objext conftest$ac_exeext
7575 if { (eval echo "$as_me:7575: \"$ac_link\"") >&5
7576   (eval $ac_link) 2>&5
7577   ac_status=$?
7578   echo "$as_me:7578: \$? = $ac_status" >&5
7579   (exit $ac_status); } &&
7580          { ac_try='test -s conftest$ac_exeext'
7581   { (eval echo "$as_me:7581: \"$ac_try\"") >&5
7582   (eval $ac_try) 2>&5
7583   ac_status=$?
7584   echo "$as_me:7584: \$? = $ac_status" >&5
7585   (exit $ac_status); }; }; then
7586   echo "$as_me:7586: result: yes" >&5
7587 echo "${ECHO_T}yes" >&6
7588 else
7589   echo "$as_me: failed program was:" >&5
7590 cat conftest.$ac_ext >&5
7591 echo "$as_me:7591: result: no" >&5
7592 echo "${ECHO_T}no" >&6
7593                  LIBS="$cf_ncurses_SAVE"
7594 fi
7595 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7596 fi
7597
7598 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
7599
7600 cat >>confdefs.h <<EOF
7601 #define $cf_nculib_ROOT 1
7602 EOF
7603
7604         fi
7605 else
7606         NCURSES_CONFIG=none
7607 fi
7608
7609         ;;
7610 (ncurses*)
7611
7612 cf_ncuconfig_root=$cf_cv_screen
7613 cf_have_ncuconfig=no
7614
7615 if test "x${PKG_CONFIG:=none}" != xnone; then
7616         echo "$as_me:7616: checking pkg-config for $cf_ncuconfig_root" >&5
7617 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
7618         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
7619                 echo "$as_me:7619: result: yes" >&5
7620 echo "${ECHO_T}yes" >&6
7621
7622                 echo "$as_me:7622: checking if the $cf_ncuconfig_root package files work" >&5
7623 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
7624                 cf_have_ncuconfig=unknown
7625
7626                 cf_save_CPPFLAGS="$CPPFLAGS"
7627                 cf_save_LIBS="$LIBS"
7628
7629                 CPPFLAGS="$CPPFLAGS `$PKG_CONFIG --cflags $cf_ncuconfig_root`"
7630
7631 cf_add_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
7632 # Filter out duplicates - this happens with badly-designed ".pc" files...
7633 for cf_add_1lib in $LIBS
7634 do
7635         for cf_add_2lib in $cf_add_libs
7636         do
7637                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7638                 then
7639                         cf_add_1lib=
7640                         break
7641                 fi
7642         done
7643         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7644 done
7645 LIBS="$cf_add_libs"
7646
7647                 cat >conftest.$ac_ext <<_ACEOF
7648 #line 7648 "configure"
7649 #include "confdefs.h"
7650 #include <${cf_cv_ncurses_header:-curses.h}>
7651 int
7652 main ()
7653 {
7654 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
7655   ;
7656   return 0;
7657 }
7658 _ACEOF
7659 rm -f conftest.$ac_objext conftest$ac_exeext
7660 if { (eval echo "$as_me:7660: \"$ac_link\"") >&5
7661   (eval $ac_link) 2>&5
7662   ac_status=$?
7663   echo "$as_me:7663: \$? = $ac_status" >&5
7664   (exit $ac_status); } &&
7665          { ac_try='test -s conftest$ac_exeext'
7666   { (eval echo "$as_me:7666: \"$ac_try\"") >&5
7667   (eval $ac_try) 2>&5
7668   ac_status=$?
7669   echo "$as_me:7669: \$? = $ac_status" >&5
7670   (exit $ac_status); }; }; then
7671   if test "$cross_compiling" = yes; then
7672   cf_have_ncuconfig=maybe
7673 else
7674   cat >conftest.$ac_ext <<_ACEOF
7675 #line 7675 "configure"
7676 #include "confdefs.h"
7677 #include <${cf_cv_ncurses_header:-curses.h}>
7678                                 int main(void)
7679                                 { char *xx = curses_version(); return (xx == 0); }
7680 _ACEOF
7681 rm -f conftest$ac_exeext
7682 if { (eval echo "$as_me:7682: \"$ac_link\"") >&5
7683   (eval $ac_link) 2>&5
7684   ac_status=$?
7685   echo "$as_me:7685: \$? = $ac_status" >&5
7686   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
7687   { (eval echo "$as_me:7687: \"$ac_try\"") >&5
7688   (eval $ac_try) 2>&5
7689   ac_status=$?
7690   echo "$as_me:7690: \$? = $ac_status" >&5
7691   (exit $ac_status); }; }; then
7692   cf_have_ncuconfig=yes
7693 else
7694   echo "$as_me: program exited with status $ac_status" >&5
7695 echo "$as_me: failed program was:" >&5
7696 cat conftest.$ac_ext >&5
7697 cf_have_ncuconfig=no
7698 fi
7699 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
7700 fi
7701 else
7702   echo "$as_me: failed program was:" >&5
7703 cat conftest.$ac_ext >&5
7704 cf_have_ncuconfig=no
7705 fi
7706 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7707                 echo "$as_me:7707: result: $cf_have_ncuconfig" >&5
7708 echo "${ECHO_T}$cf_have_ncuconfig" >&6
7709                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
7710                 if test "$cf_have_ncuconfig" != "yes"
7711                 then
7712                         CPPFLAGS="$cf_save_CPPFLAGS"
7713                         LIBS="$cf_save_LIBS"
7714                         NCURSES_CONFIG_PKG=none
7715                 else
7716
7717 cat >>confdefs.h <<\EOF
7718 #define NCURSES 1
7719 EOF
7720
7721                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
7722                 fi
7723
7724         else
7725                 echo "$as_me:7725: result: no" >&5
7726 echo "${ECHO_T}no" >&6
7727                 NCURSES_CONFIG_PKG=none
7728         fi
7729 else
7730         NCURSES_CONFIG_PKG=none
7731 fi
7732
7733 if test "x$cf_have_ncuconfig" = "xno"; then
7734         echo "Looking for ${cf_ncuconfig_root}-config"
7735
7736 if test -n "$ac_tool_prefix"; then
7737   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7738   do
7739     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
7740 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
7741 echo "$as_me:7741: checking for $ac_word" >&5
7742 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7743 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
7744   echo $ECHO_N "(cached) $ECHO_C" >&6
7745 else
7746   if test -n "$NCURSES_CONFIG"; then
7747   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
7748 else
7749   ac_save_IFS=$IFS; IFS=$ac_path_separator
7750 ac_dummy="$PATH"
7751 for ac_dir in $ac_dummy; do
7752   IFS=$ac_save_IFS
7753   test -z "$ac_dir" && ac_dir=.
7754   $as_executable_p "$ac_dir/$ac_word" || continue
7755 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
7756 echo "$as_me:7756: found $ac_dir/$ac_word" >&5
7757 break
7758 done
7759
7760 fi
7761 fi
7762 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
7763 if test -n "$NCURSES_CONFIG"; then
7764   echo "$as_me:7764: result: $NCURSES_CONFIG" >&5
7765 echo "${ECHO_T}$NCURSES_CONFIG" >&6
7766 else
7767   echo "$as_me:7767: result: no" >&5
7768 echo "${ECHO_T}no" >&6
7769 fi
7770
7771     test -n "$NCURSES_CONFIG" && break
7772   done
7773 fi
7774 if test -z "$NCURSES_CONFIG"; then
7775   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
7776   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7777 do
7778   # Extract the first word of "$ac_prog", so it can be a program name with args.
7779 set dummy $ac_prog; ac_word=$2
7780 echo "$as_me:7780: checking for $ac_word" >&5
7781 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7782 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
7783   echo $ECHO_N "(cached) $ECHO_C" >&6
7784 else
7785   if test -n "$ac_ct_NCURSES_CONFIG"; then
7786   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
7787 else
7788   ac_save_IFS=$IFS; IFS=$ac_path_separator
7789 ac_dummy="$PATH"
7790 for ac_dir in $ac_dummy; do
7791   IFS=$ac_save_IFS
7792   test -z "$ac_dir" && ac_dir=.
7793   $as_executable_p "$ac_dir/$ac_word" || continue
7794 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
7795 echo "$as_me:7795: found $ac_dir/$ac_word" >&5
7796 break
7797 done
7798
7799 fi
7800 fi
7801 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
7802 if test -n "$ac_ct_NCURSES_CONFIG"; then
7803   echo "$as_me:7803: result: $ac_ct_NCURSES_CONFIG" >&5
7804 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
7805 else
7806   echo "$as_me:7806: result: no" >&5
7807 echo "${ECHO_T}no" >&6
7808 fi
7809
7810   test -n "$ac_ct_NCURSES_CONFIG" && break
7811 done
7812 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
7813
7814   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
7815 fi
7816
7817         if test "$NCURSES_CONFIG" != none ; then
7818
7819                 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
7820
7821 cf_add_libs="`$NCURSES_CONFIG --libs`"
7822 # Filter out duplicates - this happens with badly-designed ".pc" files...
7823 for cf_add_1lib in $LIBS
7824 do
7825         for cf_add_2lib in $cf_add_libs
7826         do
7827                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7828                 then
7829                         cf_add_1lib=
7830                         break
7831                 fi
7832         done
7833         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7834 done
7835 LIBS="$cf_add_libs"
7836
7837                 # even with config script, some packages use no-override for curses.h
7838
7839 echo "$as_me:7839: checking if we have identified curses headers" >&5
7840 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
7841 if test "${cf_cv_ncurses_header+set}" = set; then
7842   echo $ECHO_N "(cached) $ECHO_C" >&6
7843 else
7844
7845 cf_cv_ncurses_header=none
7846 for cf_header in \
7847         ncurses.h $cf_cv_screen/ncurses.h \
7848         curses.h $cf_cv_screen/curses.h
7849 do
7850 cat >conftest.$ac_ext <<_ACEOF
7851 #line 7851 "configure"
7852 #include "confdefs.h"
7853 #include <${cf_header}>
7854 int
7855 main ()
7856 {
7857 initscr(); tgoto("?", 0,0)
7858   ;
7859   return 0;
7860 }
7861 _ACEOF
7862 rm -f conftest.$ac_objext
7863 if { (eval echo "$as_me:7863: \"$ac_compile\"") >&5
7864   (eval $ac_compile) 2>&5
7865   ac_status=$?
7866   echo "$as_me:7866: \$? = $ac_status" >&5
7867   (exit $ac_status); } &&
7868          { ac_try='test -s conftest.$ac_objext'
7869   { (eval echo "$as_me:7869: \"$ac_try\"") >&5
7870   (eval $ac_try) 2>&5
7871   ac_status=$?
7872   echo "$as_me:7872: \$? = $ac_status" >&5
7873   (exit $ac_status); }; }; then
7874   cf_cv_ncurses_header=$cf_header; break
7875 else
7876   echo "$as_me: failed program was:" >&5
7877 cat conftest.$ac_ext >&5
7878 fi
7879 rm -f conftest.$ac_objext conftest.$ac_ext
7880 done
7881
7882 fi
7883 echo "$as_me:7883: result: $cf_cv_ncurses_header" >&5
7884 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
7885
7886 if test "$cf_cv_ncurses_header" = none ; then
7887         { { echo "$as_me:7887: error: No curses header-files found" >&5
7888 echo "$as_me: error: No curses header-files found" >&2;}
7889    { (exit 1); exit 1; }; }
7890 fi
7891
7892 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
7893
7894 for ac_header in $cf_cv_ncurses_header
7895 do
7896 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
7897 echo "$as_me:7897: checking for $ac_header" >&5
7898 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
7899 if eval "test \"\${$as_ac_Header+set}\" = set"; then
7900   echo $ECHO_N "(cached) $ECHO_C" >&6
7901 else
7902   cat >conftest.$ac_ext <<_ACEOF
7903 #line 7903 "configure"
7904 #include "confdefs.h"
7905 #include <$ac_header>
7906 _ACEOF
7907 if { (eval echo "$as_me:7907: \"$ac_cpp conftest.$ac_ext\"") >&5
7908   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
7909   ac_status=$?
7910   egrep -v '^ *\+' conftest.er1 >conftest.err
7911   rm -f conftest.er1
7912   cat conftest.err >&5
7913   echo "$as_me:7913: \$? = $ac_status" >&5
7914   (exit $ac_status); } >/dev/null; then
7915   if test -s conftest.err; then
7916     ac_cpp_err=$ac_c_preproc_warn_flag
7917   else
7918     ac_cpp_err=
7919   fi
7920 else
7921   ac_cpp_err=yes
7922 fi
7923 if test -z "$ac_cpp_err"; then
7924   eval "$as_ac_Header=yes"
7925 else
7926   echo "$as_me: failed program was:" >&5
7927   cat conftest.$ac_ext >&5
7928   eval "$as_ac_Header=no"
7929 fi
7930 rm -f conftest.err conftest.$ac_ext
7931 fi
7932 echo "$as_me:7932: result: `eval echo '${'$as_ac_Header'}'`" >&5
7933 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
7934 if test `eval echo '${'$as_ac_Header'}'` = yes; then
7935   cat >>confdefs.h <<EOF
7936 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
7937 EOF
7938
7939 fi
7940 done
7941
7942 cat >>confdefs.h <<\EOF
7943 #define NCURSES 1
7944 EOF
7945
7946 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
7947
7948                 cat >>confdefs.h <<EOF
7949 #define $cf_nculib_ROOT 1
7950 EOF
7951
7952                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
7953
7954         else
7955
7956 cf_ncuhdr_root=$cf_cv_screen
7957
7958 test -n "$cf_cv_curses_dir" && \
7959 test "$cf_cv_curses_dir" != "no" && { \
7960
7961 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
7962   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
7963   do
7964         while test $cf_add_incdir != /usr/include
7965         do
7966           if test -d $cf_add_incdir
7967           then
7968                 cf_have_incdir=no
7969                 if test -n "$CFLAGS$CPPFLAGS" ; then
7970                   # a loop is needed to ensure we can add subdirs of existing dirs
7971                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7972                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7973                           cf_have_incdir=yes; break
7974                         fi
7975                   done
7976                 fi
7977
7978                 if test "$cf_have_incdir" = no ; then
7979                   if test "$cf_add_incdir" = /usr/local/include ; then
7980                         if test "$GCC" = yes
7981                         then
7982                           cf_save_CPPFLAGS=$CPPFLAGS
7983                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7984                           cat >conftest.$ac_ext <<_ACEOF
7985 #line 7985 "configure"
7986 #include "confdefs.h"
7987 #include <stdio.h>
7988 int
7989 main ()
7990 {
7991 printf("Hello")
7992   ;
7993   return 0;
7994 }
7995 _ACEOF
7996 rm -f conftest.$ac_objext
7997 if { (eval echo "$as_me:7997: \"$ac_compile\"") >&5
7998   (eval $ac_compile) 2>&5
7999   ac_status=$?
8000   echo "$as_me:8000: \$? = $ac_status" >&5
8001   (exit $ac_status); } &&
8002          { ac_try='test -s conftest.$ac_objext'
8003   { (eval echo "$as_me:8003: \"$ac_try\"") >&5
8004   (eval $ac_try) 2>&5
8005   ac_status=$?
8006   echo "$as_me:8006: \$? = $ac_status" >&5
8007   (exit $ac_status); }; }; then
8008   :
8009 else
8010   echo "$as_me: failed program was:" >&5
8011 cat conftest.$ac_ext >&5
8012 cf_have_incdir=yes
8013 fi
8014 rm -f conftest.$ac_objext conftest.$ac_ext
8015                           CPPFLAGS=$cf_save_CPPFLAGS
8016                         fi
8017                   fi
8018                 fi
8019
8020                 if test "$cf_have_incdir" = no ; then
8021                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8022
8023 echo "${as_me:-configure}:8023: testing adding $cf_add_incdir to include-path ..." 1>&5
8024
8025                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8026
8027                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8028                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8029                   cf_add_incdir="$cf_top_incdir"
8030                 else
8031                   break
8032                 fi
8033           else
8034                 break
8035           fi
8036         done
8037   done
8038 fi
8039
8040 }
8041
8042 echo "$as_me:8042: checking for $cf_ncuhdr_root header in include-path" >&5
8043 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
8044 if test "${cf_cv_ncurses_h+set}" = set; then
8045   echo $ECHO_N "(cached) $ECHO_C" >&6
8046 else
8047
8048         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
8049         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
8050         for cf_header in $cf_header_list
8051         do
8052
8053         cat >conftest.$ac_ext <<_ACEOF
8054 #line 8054 "configure"
8055 #include "confdefs.h"
8056
8057 #include <$cf_header>
8058 int
8059 main ()
8060 {
8061
8062 #ifdef NCURSES_VERSION
8063
8064 printf("%s\n", NCURSES_VERSION);
8065 #else
8066 #ifdef __NCURSES_H
8067 printf("old\n");
8068 #else
8069         make an error
8070 #endif
8071 #endif
8072
8073   ;
8074   return 0;
8075 }
8076 _ACEOF
8077 rm -f conftest.$ac_objext
8078 if { (eval echo "$as_me:8078: \"$ac_compile\"") >&5
8079   (eval $ac_compile) 2>&5
8080   ac_status=$?
8081   echo "$as_me:8081: \$? = $ac_status" >&5
8082   (exit $ac_status); } &&
8083          { ac_try='test -s conftest.$ac_objext'
8084   { (eval echo "$as_me:8084: \"$ac_try\"") >&5
8085   (eval $ac_try) 2>&5
8086   ac_status=$?
8087   echo "$as_me:8087: \$? = $ac_status" >&5
8088   (exit $ac_status); }; }; then
8089   cf_cv_ncurses_h=$cf_header
8090
8091 else
8092   echo "$as_me: failed program was:" >&5
8093 cat conftest.$ac_ext >&5
8094 cf_cv_ncurses_h=no
8095 fi
8096 rm -f conftest.$ac_objext conftest.$ac_ext
8097
8098                 test "$cf_cv_ncurses_h" != no && break
8099         done
8100
8101 fi
8102 echo "$as_me:8102: result: $cf_cv_ncurses_h" >&5
8103 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
8104
8105 if test "$cf_cv_ncurses_h" != no ; then
8106         cf_cv_ncurses_header=$cf_cv_ncurses_h
8107 else
8108
8109 echo "$as_me:8109: checking for $cf_ncuhdr_root include-path" >&5
8110 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
8111 if test "${cf_cv_ncurses_h2+set}" = set; then
8112   echo $ECHO_N "(cached) $ECHO_C" >&6
8113 else
8114
8115         test -n "$verbose" && echo
8116
8117 cf_search=
8118
8119 # collect the current set of include-directories from compiler flags
8120 cf_header_path_list=""
8121 if test -n "${CFLAGS}${CPPFLAGS}" ; then
8122         for cf_header_path in $CPPFLAGS $CFLAGS
8123         do
8124                 case $cf_header_path in
8125                 (-I*)
8126                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
8127
8128 test "x$cf_header_path" != "xNONE" && \
8129 test -d "$cf_header_path" && \
8130  {
8131         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
8132         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
8133         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
8134         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
8135         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
8136         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"
8137 }
8138
8139                         cf_header_path_list="$cf_header_path_list $cf_search"
8140                         ;;
8141                 esac
8142         done
8143 fi
8144
8145 # add the variations for the package we are looking for
8146
8147 cf_search=
8148
8149 test "x$prefix" != "xNONE" && \
8150 test -d "$prefix" && \
8151  {
8152         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
8153         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
8154         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
8155         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
8156         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
8157         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8158 }
8159
8160 for cf_subdir_prefix in \
8161         /usr \
8162         /usr/local \
8163         /usr/pkg \
8164         /opt \
8165         /opt/local \
8166         $HOME
8167 do
8168
8169 test "x$cf_subdir_prefix" != "x$prefix" && \
8170 test -d "$cf_subdir_prefix" && \
8171 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
8172         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
8173         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
8174         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
8175         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
8176         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
8177         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"
8178 }
8179
8180 done
8181
8182 test "$includedir" != NONE && \
8183 test "$includedir" != "/usr/include" && \
8184 test -d "$includedir" && {
8185         test -d $includedir &&    cf_search="$cf_search $includedir"
8186         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
8187 }
8188
8189 test "$oldincludedir" != NONE && \
8190 test "$oldincludedir" != "/usr/include" && \
8191 test -d "$oldincludedir" && {
8192         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
8193         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
8194 }
8195
8196 cf_search="$cf_search $cf_header_path_list"
8197
8198         test -n "$verbose" && echo search path $cf_search
8199         cf_save2_CPPFLAGS="$CPPFLAGS"
8200         for cf_incdir in $cf_search
8201         do
8202
8203 if test -n "$cf_incdir" ; then
8204   for cf_add_incdir in $cf_incdir
8205   do
8206         while test $cf_add_incdir != /usr/include
8207         do
8208           if test -d $cf_add_incdir
8209           then
8210                 cf_have_incdir=no
8211                 if test -n "$CFLAGS$CPPFLAGS" ; then
8212                   # a loop is needed to ensure we can add subdirs of existing dirs
8213                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8214                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8215                           cf_have_incdir=yes; break
8216                         fi
8217                   done
8218                 fi
8219
8220                 if test "$cf_have_incdir" = no ; then
8221                   if test "$cf_add_incdir" = /usr/local/include ; then
8222                         if test "$GCC" = yes
8223                         then
8224                           cf_save_CPPFLAGS=$CPPFLAGS
8225                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8226                           cat >conftest.$ac_ext <<_ACEOF
8227 #line 8227 "configure"
8228 #include "confdefs.h"
8229 #include <stdio.h>
8230 int
8231 main ()
8232 {
8233 printf("Hello")
8234   ;
8235   return 0;
8236 }
8237 _ACEOF
8238 rm -f conftest.$ac_objext
8239 if { (eval echo "$as_me:8239: \"$ac_compile\"") >&5
8240   (eval $ac_compile) 2>&5
8241   ac_status=$?
8242   echo "$as_me:8242: \$? = $ac_status" >&5
8243   (exit $ac_status); } &&
8244          { ac_try='test -s conftest.$ac_objext'
8245   { (eval echo "$as_me:8245: \"$ac_try\"") >&5
8246   (eval $ac_try) 2>&5
8247   ac_status=$?
8248   echo "$as_me:8248: \$? = $ac_status" >&5
8249   (exit $ac_status); }; }; then
8250   :
8251 else
8252   echo "$as_me: failed program was:" >&5
8253 cat conftest.$ac_ext >&5
8254 cf_have_incdir=yes
8255 fi
8256 rm -f conftest.$ac_objext conftest.$ac_ext
8257                           CPPFLAGS=$cf_save_CPPFLAGS
8258                         fi
8259                   fi
8260                 fi
8261
8262                 if test "$cf_have_incdir" = no ; then
8263                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8264
8265 echo "${as_me:-configure}:8265: testing adding $cf_add_incdir to include-path ..." 1>&5
8266
8267                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8268
8269                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8270                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8271                   cf_add_incdir="$cf_top_incdir"
8272                 else
8273                   break
8274                 fi
8275           else
8276                 break
8277           fi
8278         done
8279   done
8280 fi
8281
8282                 for cf_header in \
8283                         ncurses.h \
8284                         curses.h
8285                 do
8286
8287         cat >conftest.$ac_ext <<_ACEOF
8288 #line 8288 "configure"
8289 #include "confdefs.h"
8290
8291 #include <$cf_header>
8292 int
8293 main ()
8294 {
8295
8296 #ifdef NCURSES_VERSION
8297
8298 printf("%s\n", NCURSES_VERSION);
8299 #else
8300 #ifdef __NCURSES_H
8301 printf("old\n");
8302 #else
8303         make an error
8304 #endif
8305 #endif
8306
8307   ;
8308   return 0;
8309 }
8310 _ACEOF
8311 rm -f conftest.$ac_objext
8312 if { (eval echo "$as_me:8312: \"$ac_compile\"") >&5
8313   (eval $ac_compile) 2>&5
8314   ac_status=$?
8315   echo "$as_me:8315: \$? = $ac_status" >&5
8316   (exit $ac_status); } &&
8317          { ac_try='test -s conftest.$ac_objext'
8318   { (eval echo "$as_me:8318: \"$ac_try\"") >&5
8319   (eval $ac_try) 2>&5
8320   ac_status=$?
8321   echo "$as_me:8321: \$? = $ac_status" >&5
8322   (exit $ac_status); }; }; then
8323   cf_cv_ncurses_h2=$cf_header
8324
8325 else
8326   echo "$as_me: failed program was:" >&5
8327 cat conftest.$ac_ext >&5
8328 cf_cv_ncurses_h2=no
8329 fi
8330 rm -f conftest.$ac_objext conftest.$ac_ext
8331
8332                         if test "$cf_cv_ncurses_h2" != no ; then
8333                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
8334                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
8335                                 break
8336                         fi
8337                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
8338                 done
8339                 CPPFLAGS="$cf_save2_CPPFLAGS"
8340                 test "$cf_cv_ncurses_h2" != no && break
8341         done
8342         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:8342: error: not found" >&5
8343 echo "$as_me: error: not found" >&2;}
8344    { (exit 1); exit 1; }; }
8345
8346 fi
8347 echo "$as_me:8347: result: $cf_cv_ncurses_h2" >&5
8348 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
8349
8350         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
8351         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
8352         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
8353                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
8354         fi
8355
8356 if test -n "$cf_1st_incdir" ; then
8357   for cf_add_incdir in $cf_1st_incdir
8358   do
8359         while test $cf_add_incdir != /usr/include
8360         do
8361           if test -d $cf_add_incdir
8362           then
8363                 cf_have_incdir=no
8364                 if test -n "$CFLAGS$CPPFLAGS" ; then
8365                   # a loop is needed to ensure we can add subdirs of existing dirs
8366                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8367                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8368                           cf_have_incdir=yes; break
8369                         fi
8370                   done
8371                 fi
8372
8373                 if test "$cf_have_incdir" = no ; then
8374                   if test "$cf_add_incdir" = /usr/local/include ; then
8375                         if test "$GCC" = yes
8376                         then
8377                           cf_save_CPPFLAGS=$CPPFLAGS
8378                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8379                           cat >conftest.$ac_ext <<_ACEOF
8380 #line 8380 "configure"
8381 #include "confdefs.h"
8382 #include <stdio.h>
8383 int
8384 main ()
8385 {
8386 printf("Hello")
8387   ;
8388   return 0;
8389 }
8390 _ACEOF
8391 rm -f conftest.$ac_objext
8392 if { (eval echo "$as_me:8392: \"$ac_compile\"") >&5
8393   (eval $ac_compile) 2>&5
8394   ac_status=$?
8395   echo "$as_me:8395: \$? = $ac_status" >&5
8396   (exit $ac_status); } &&
8397          { ac_try='test -s conftest.$ac_objext'
8398   { (eval echo "$as_me:8398: \"$ac_try\"") >&5
8399   (eval $ac_try) 2>&5
8400   ac_status=$?
8401   echo "$as_me:8401: \$? = $ac_status" >&5
8402   (exit $ac_status); }; }; then
8403   :
8404 else
8405   echo "$as_me: failed program was:" >&5
8406 cat conftest.$ac_ext >&5
8407 cf_have_incdir=yes
8408 fi
8409 rm -f conftest.$ac_objext conftest.$ac_ext
8410                           CPPFLAGS=$cf_save_CPPFLAGS
8411                         fi
8412                   fi
8413                 fi
8414
8415                 if test "$cf_have_incdir" = no ; then
8416                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8417
8418 echo "${as_me:-configure}:8418: testing adding $cf_add_incdir to include-path ..." 1>&5
8419
8420                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8421
8422                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8423                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8424                   cf_add_incdir="$cf_top_incdir"
8425                 else
8426                   break
8427                 fi
8428           else
8429                 break
8430           fi
8431         done
8432   done
8433 fi
8434
8435 fi
8436
8437 # Set definitions to allow ifdef'ing for ncurses.h
8438
8439 case $cf_cv_ncurses_header in
8440 (*ncurses.h)
8441
8442 cat >>confdefs.h <<\EOF
8443 #define HAVE_NCURSES_H 1
8444 EOF
8445
8446         ;;
8447 esac
8448
8449 case $cf_cv_ncurses_header in
8450 (ncurses/curses.h|ncurses/ncurses.h)
8451
8452 cat >>confdefs.h <<\EOF
8453 #define HAVE_NCURSES_NCURSES_H 1
8454 EOF
8455
8456         ;;
8457 (ncursesw/curses.h|ncursesw/ncurses.h)
8458
8459 cat >>confdefs.h <<\EOF
8460 #define HAVE_NCURSESW_NCURSES_H 1
8461 EOF
8462
8463         ;;
8464 esac
8465
8466 echo "$as_me:8466: checking for terminfo header" >&5
8467 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
8468 if test "${cf_cv_term_header+set}" = set; then
8469   echo $ECHO_N "(cached) $ECHO_C" >&6
8470 else
8471
8472 case ${cf_cv_ncurses_header} in
8473 (*/ncurses.h|*/ncursesw.h)
8474         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
8475         ;;
8476 (*)
8477         cf_term_header=term.h
8478         ;;
8479 esac
8480
8481 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
8482 do
8483 cat >conftest.$ac_ext <<_ACEOF
8484 #line 8484 "configure"
8485 #include "confdefs.h"
8486 #include <stdio.h>
8487 #include <${cf_cv_ncurses_header:-curses.h}>
8488 #include <$cf_test>
8489
8490 int
8491 main ()
8492 {
8493 int x = auto_left_margin
8494   ;
8495   return 0;
8496 }
8497 _ACEOF
8498 rm -f conftest.$ac_objext
8499 if { (eval echo "$as_me:8499: \"$ac_compile\"") >&5
8500   (eval $ac_compile) 2>&5
8501   ac_status=$?
8502   echo "$as_me:8502: \$? = $ac_status" >&5
8503   (exit $ac_status); } &&
8504          { ac_try='test -s conftest.$ac_objext'
8505   { (eval echo "$as_me:8505: \"$ac_try\"") >&5
8506   (eval $ac_try) 2>&5
8507   ac_status=$?
8508   echo "$as_me:8508: \$? = $ac_status" >&5
8509   (exit $ac_status); }; }; then
8510
8511         cf_cv_term_header="$cf_test"
8512 else
8513   echo "$as_me: failed program was:" >&5
8514 cat conftest.$ac_ext >&5
8515
8516         cf_cv_term_header=unknown
8517
8518 fi
8519 rm -f conftest.$ac_objext conftest.$ac_ext
8520         test "$cf_cv_term_header" != unknown && break
8521 done
8522
8523 fi
8524 echo "$as_me:8524: result: $cf_cv_term_header" >&5
8525 echo "${ECHO_T}$cf_cv_term_header" >&6
8526
8527 # Set definitions to allow ifdef'ing to accommodate subdirectories
8528
8529 case $cf_cv_term_header in
8530 (*term.h)
8531
8532 cat >>confdefs.h <<\EOF
8533 #define HAVE_TERM_H 1
8534 EOF
8535
8536         ;;
8537 esac
8538
8539 case $cf_cv_term_header in
8540 (ncurses/term.h)
8541
8542 cat >>confdefs.h <<\EOF
8543 #define HAVE_NCURSES_TERM_H 1
8544 EOF
8545
8546         ;;
8547 (ncursesw/term.h)
8548
8549 cat >>confdefs.h <<\EOF
8550 #define HAVE_NCURSESW_TERM_H 1
8551 EOF
8552
8553         ;;
8554 esac
8555
8556 # some applications need this, but should check for NCURSES_VERSION
8557
8558 cat >>confdefs.h <<\EOF
8559 #define NCURSES 1
8560 EOF
8561
8562 echo "$as_me:8562: checking for ncurses version" >&5
8563 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
8564 if test "${cf_cv_ncurses_version+set}" = set; then
8565   echo $ECHO_N "(cached) $ECHO_C" >&6
8566 else
8567
8568         cf_cv_ncurses_version=no
8569         cf_tempfile=out$$
8570         rm -f $cf_tempfile
8571         if test "$cross_compiling" = yes; then
8572
8573         # This will not work if the preprocessor splits the line after the
8574         # Autoconf token.  The 'unproto' program does that.
8575         cat > conftest.$ac_ext <<EOF
8576 #include <${cf_cv_ncurses_header:-curses.h}>
8577 #undef Autoconf
8578 #ifdef NCURSES_VERSION
8579 Autoconf NCURSES_VERSION
8580 #else
8581 #ifdef __NCURSES_H
8582 Autoconf "old"
8583 #endif
8584 ;
8585 #endif
8586 EOF
8587         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
8588         { (eval echo "$as_me:8588: \"$cf_try\"") >&5
8589   (eval $cf_try) 2>&5
8590   ac_status=$?
8591   echo "$as_me:8591: \$? = $ac_status" >&5
8592   (exit $ac_status); }
8593         if test -f conftest.out ; then
8594                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
8595                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
8596                 rm -f conftest.out
8597         fi
8598
8599 else
8600   cat >conftest.$ac_ext <<_ACEOF
8601 #line 8601 "configure"
8602 #include "confdefs.h"
8603
8604 #include <${cf_cv_ncurses_header:-curses.h}>
8605 #include <stdio.h>
8606 int main()
8607 {
8608         FILE *fp = fopen("$cf_tempfile", "w");
8609 #ifdef NCURSES_VERSION
8610 # ifdef NCURSES_VERSION_PATCH
8611         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
8612 # else
8613         fprintf(fp, "%s\n", NCURSES_VERSION);
8614 # endif
8615 #else
8616 # ifdef __NCURSES_H
8617         fprintf(fp, "old\n");
8618 # else
8619         make an error
8620 # endif
8621 #endif
8622         ${cf_cv_main_return:-return}(0);
8623 }
8624 _ACEOF
8625 rm -f conftest$ac_exeext
8626 if { (eval echo "$as_me:8626: \"$ac_link\"") >&5
8627   (eval $ac_link) 2>&5
8628   ac_status=$?
8629   echo "$as_me:8629: \$? = $ac_status" >&5
8630   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
8631   { (eval echo "$as_me:8631: \"$ac_try\"") >&5
8632   (eval $ac_try) 2>&5
8633   ac_status=$?
8634   echo "$as_me:8634: \$? = $ac_status" >&5
8635   (exit $ac_status); }; }; then
8636
8637         cf_cv_ncurses_version=`cat $cf_tempfile`
8638 else
8639   echo "$as_me: program exited with status $ac_status" >&5
8640 echo "$as_me: failed program was:" >&5
8641 cat conftest.$ac_ext >&5
8642 fi
8643 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
8644 fi
8645         rm -f $cf_tempfile
8646
8647 fi
8648 echo "$as_me:8648: result: $cf_cv_ncurses_version" >&5
8649 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
8650 test "$cf_cv_ncurses_version" = no ||
8651 cat >>confdefs.h <<\EOF
8652 #define NCURSES 1
8653 EOF
8654
8655 cf_nculib_root=$cf_cv_screen
8656         # This works, except for the special case where we find gpm, but
8657         # ncurses is in a nonstandard location via $LIBS, and we really want
8658         # to link gpm.
8659 cf_ncurses_LIBS=""
8660 cf_ncurses_SAVE="$LIBS"
8661 echo "$as_me:8661: checking for Gpm_Open in -lgpm" >&5
8662 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
8663 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
8664   echo $ECHO_N "(cached) $ECHO_C" >&6
8665 else
8666   ac_check_lib_save_LIBS=$LIBS
8667 LIBS="-lgpm  $LIBS"
8668 cat >conftest.$ac_ext <<_ACEOF
8669 #line 8669 "configure"
8670 #include "confdefs.h"
8671
8672 /* Override any gcc2 internal prototype to avoid an error.  */
8673 #ifdef __cplusplus
8674 extern "C"
8675 #endif
8676 /* We use char because int might match the return type of a gcc2
8677    builtin and then its argument prototype would still apply.  */
8678 char Gpm_Open ();
8679 int
8680 main ()
8681 {
8682 Gpm_Open ();
8683   ;
8684   return 0;
8685 }
8686 _ACEOF
8687 rm -f conftest.$ac_objext conftest$ac_exeext
8688 if { (eval echo "$as_me:8688: \"$ac_link\"") >&5
8689   (eval $ac_link) 2>&5
8690   ac_status=$?
8691   echo "$as_me:8691: \$? = $ac_status" >&5
8692   (exit $ac_status); } &&
8693          { ac_try='test -s conftest$ac_exeext'
8694   { (eval echo "$as_me:8694: \"$ac_try\"") >&5
8695   (eval $ac_try) 2>&5
8696   ac_status=$?
8697   echo "$as_me:8697: \$? = $ac_status" >&5
8698   (exit $ac_status); }; }; then
8699   ac_cv_lib_gpm_Gpm_Open=yes
8700 else
8701   echo "$as_me: failed program was:" >&5
8702 cat conftest.$ac_ext >&5
8703 ac_cv_lib_gpm_Gpm_Open=no
8704 fi
8705 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8706 LIBS=$ac_check_lib_save_LIBS
8707 fi
8708 echo "$as_me:8708: result: $ac_cv_lib_gpm_Gpm_Open" >&5
8709 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
8710 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
8711   echo "$as_me:8711: checking for initscr in -lgpm" >&5
8712 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
8713 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
8714   echo $ECHO_N "(cached) $ECHO_C" >&6
8715 else
8716   ac_check_lib_save_LIBS=$LIBS
8717 LIBS="-lgpm  $LIBS"
8718 cat >conftest.$ac_ext <<_ACEOF
8719 #line 8719 "configure"
8720 #include "confdefs.h"
8721
8722 /* Override any gcc2 internal prototype to avoid an error.  */
8723 #ifdef __cplusplus
8724 extern "C"
8725 #endif
8726 /* We use char because int might match the return type of a gcc2
8727    builtin and then its argument prototype would still apply.  */
8728 char initscr ();
8729 int
8730 main ()
8731 {
8732 initscr ();
8733   ;
8734   return 0;
8735 }
8736 _ACEOF
8737 rm -f conftest.$ac_objext conftest$ac_exeext
8738 if { (eval echo "$as_me:8738: \"$ac_link\"") >&5
8739   (eval $ac_link) 2>&5
8740   ac_status=$?
8741   echo "$as_me:8741: \$? = $ac_status" >&5
8742   (exit $ac_status); } &&
8743          { ac_try='test -s conftest$ac_exeext'
8744   { (eval echo "$as_me:8744: \"$ac_try\"") >&5
8745   (eval $ac_try) 2>&5
8746   ac_status=$?
8747   echo "$as_me:8747: \$? = $ac_status" >&5
8748   (exit $ac_status); }; }; then
8749   ac_cv_lib_gpm_initscr=yes
8750 else
8751   echo "$as_me: failed program was:" >&5
8752 cat conftest.$ac_ext >&5
8753 ac_cv_lib_gpm_initscr=no
8754 fi
8755 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8756 LIBS=$ac_check_lib_save_LIBS
8757 fi
8758 echo "$as_me:8758: result: $ac_cv_lib_gpm_initscr" >&5
8759 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
8760 if test $ac_cv_lib_gpm_initscr = yes; then
8761   LIBS="$cf_ncurses_SAVE"
8762 else
8763   cf_ncurses_LIBS="-lgpm"
8764 fi
8765
8766 fi
8767
8768 case $host_os in
8769 (freebsd*)
8770         # This is only necessary if you are linking against an obsolete
8771         # version of ncurses (but it should do no harm, since it's static).
8772         if test "$cf_nculib_root" = ncurses ; then
8773                 echo "$as_me:8773: checking for tgoto in -lmytinfo" >&5
8774 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
8775 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
8776   echo $ECHO_N "(cached) $ECHO_C" >&6
8777 else
8778   ac_check_lib_save_LIBS=$LIBS
8779 LIBS="-lmytinfo  $LIBS"
8780 cat >conftest.$ac_ext <<_ACEOF
8781 #line 8781 "configure"
8782 #include "confdefs.h"
8783
8784 /* Override any gcc2 internal prototype to avoid an error.  */
8785 #ifdef __cplusplus
8786 extern "C"
8787 #endif
8788 /* We use char because int might match the return type of a gcc2
8789    builtin and then its argument prototype would still apply.  */
8790 char tgoto ();
8791 int
8792 main ()
8793 {
8794 tgoto ();
8795   ;
8796   return 0;
8797 }
8798 _ACEOF
8799 rm -f conftest.$ac_objext conftest$ac_exeext
8800 if { (eval echo "$as_me:8800: \"$ac_link\"") >&5
8801   (eval $ac_link) 2>&5
8802   ac_status=$?
8803   echo "$as_me:8803: \$? = $ac_status" >&5
8804   (exit $ac_status); } &&
8805          { ac_try='test -s conftest$ac_exeext'
8806   { (eval echo "$as_me:8806: \"$ac_try\"") >&5
8807   (eval $ac_try) 2>&5
8808   ac_status=$?
8809   echo "$as_me:8809: \$? = $ac_status" >&5
8810   (exit $ac_status); }; }; then
8811   ac_cv_lib_mytinfo_tgoto=yes
8812 else
8813   echo "$as_me: failed program was:" >&5
8814 cat conftest.$ac_ext >&5
8815 ac_cv_lib_mytinfo_tgoto=no
8816 fi
8817 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8818 LIBS=$ac_check_lib_save_LIBS
8819 fi
8820 echo "$as_me:8820: result: $ac_cv_lib_mytinfo_tgoto" >&5
8821 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
8822 if test $ac_cv_lib_mytinfo_tgoto = yes; then
8823   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
8824 fi
8825
8826         fi
8827         ;;
8828 esac
8829
8830 cf_add_libs="$cf_ncurses_LIBS"
8831 # Filter out duplicates - this happens with badly-designed ".pc" files...
8832 for cf_add_1lib in $LIBS
8833 do
8834         for cf_add_2lib in $cf_add_libs
8835         do
8836                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
8837                 then
8838                         cf_add_1lib=
8839                         break
8840                 fi
8841         done
8842         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
8843 done
8844 LIBS="$cf_add_libs"
8845
8846 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
8847 then
8848
8849 cf_add_libs="-l$cf_nculib_root"
8850 # Filter out duplicates - this happens with badly-designed ".pc" files...
8851 for cf_add_1lib in $LIBS
8852 do
8853         for cf_add_2lib in $cf_add_libs
8854         do
8855                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
8856                 then
8857                         cf_add_1lib=
8858                         break
8859                 fi
8860         done
8861         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
8862 done
8863 LIBS="$cf_add_libs"
8864
8865 else
8866
8867         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
8868         cf_libdir=""
8869         echo "$as_me:8869: checking for initscr" >&5
8870 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
8871 if test "${ac_cv_func_initscr+set}" = set; then
8872   echo $ECHO_N "(cached) $ECHO_C" >&6
8873 else
8874   cat >conftest.$ac_ext <<_ACEOF
8875 #line 8875 "configure"
8876 #include "confdefs.h"
8877 /* System header to define __stub macros and hopefully few prototypes,
8878     which can conflict with char initscr (); below.  */
8879 #include <assert.h>
8880 /* Override any gcc2 internal prototype to avoid an error.  */
8881 #ifdef __cplusplus
8882 extern "C"
8883 #endif
8884 /* We use char because int might match the return type of a gcc2
8885    builtin and then its argument prototype would still apply.  */
8886 char initscr ();
8887 char (*f) ();
8888
8889 int
8890 main ()
8891 {
8892 /* The GNU C library defines this for functions which it implements
8893     to always fail with ENOSYS.  Some functions are actually named
8894     something starting with __ and the normal name is an alias.  */
8895 #if defined (__stub_initscr) || defined (__stub___initscr)
8896 choke me
8897 #else
8898 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
8899 #endif
8900
8901   ;
8902   return 0;
8903 }
8904 _ACEOF
8905 rm -f conftest.$ac_objext conftest$ac_exeext
8906 if { (eval echo "$as_me:8906: \"$ac_link\"") >&5
8907   (eval $ac_link) 2>&5
8908   ac_status=$?
8909   echo "$as_me:8909: \$? = $ac_status" >&5
8910   (exit $ac_status); } &&
8911          { ac_try='test -s conftest$ac_exeext'
8912   { (eval echo "$as_me:8912: \"$ac_try\"") >&5
8913   (eval $ac_try) 2>&5
8914   ac_status=$?
8915   echo "$as_me:8915: \$? = $ac_status" >&5
8916   (exit $ac_status); }; }; then
8917   ac_cv_func_initscr=yes
8918 else
8919   echo "$as_me: failed program was:" >&5
8920 cat conftest.$ac_ext >&5
8921 ac_cv_func_initscr=no
8922 fi
8923 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8924 fi
8925 echo "$as_me:8925: result: $ac_cv_func_initscr" >&5
8926 echo "${ECHO_T}$ac_cv_func_initscr" >&6
8927 if test $ac_cv_func_initscr = yes; then
8928   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8929 else
8930
8931                 cf_save_LIBS="$LIBS"
8932                 echo "$as_me:8932: checking for initscr in -l$cf_nculib_root" >&5
8933 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
8934                 LIBS="-l$cf_nculib_root $LIBS"
8935                 cat >conftest.$ac_ext <<_ACEOF
8936 #line 8936 "configure"
8937 #include "confdefs.h"
8938 #include <${cf_cv_ncurses_header:-curses.h}>
8939 int
8940 main ()
8941 {
8942 initscr()
8943   ;
8944   return 0;
8945 }
8946 _ACEOF
8947 rm -f conftest.$ac_objext conftest$ac_exeext
8948 if { (eval echo "$as_me:8948: \"$ac_link\"") >&5
8949   (eval $ac_link) 2>&5
8950   ac_status=$?
8951   echo "$as_me:8951: \$? = $ac_status" >&5
8952   (exit $ac_status); } &&
8953          { ac_try='test -s conftest$ac_exeext'
8954   { (eval echo "$as_me:8954: \"$ac_try\"") >&5
8955   (eval $ac_try) 2>&5
8956   ac_status=$?
8957   echo "$as_me:8957: \$? = $ac_status" >&5
8958   (exit $ac_status); }; }; then
8959   echo "$as_me:8959: result: yes" >&5
8960 echo "${ECHO_T}yes" >&6
8961                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8962
8963 else
8964   echo "$as_me: failed program was:" >&5
8965 cat conftest.$ac_ext >&5
8966 echo "$as_me:8966: result: no" >&5
8967 echo "${ECHO_T}no" >&6
8968
8969 cf_search=
8970 cf_library_path_list=""
8971 if test -n "${LDFLAGS}${LIBS}" ; then
8972         for cf_library_path in $LDFLAGS $LIBS
8973         do
8974                 case $cf_library_path in
8975                 (-L*)
8976                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
8977
8978 test "x$cf_library_path" != "xNONE" && \
8979 test -d "$cf_library_path" && \
8980  {
8981         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
8982         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
8983         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
8984         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
8985         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
8986         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"
8987 }
8988
8989                         cf_library_path_list="$cf_library_path_list $cf_search"
8990                         ;;
8991                 esac
8992         done
8993 fi
8994
8995 cf_search=
8996
8997 test "x$prefix" != "xNONE" && \
8998 test -d "$prefix" && \
8999  {
9000         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
9001         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
9002         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
9003         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
9004         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
9005         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
9006 }
9007
9008 for cf_subdir_prefix in \
9009         /usr \
9010         /usr/local \
9011         /usr/pkg \
9012         /opt \
9013         /opt/local \
9014         $HOME
9015 do
9016
9017 test "x$cf_subdir_prefix" != "x$prefix" && \
9018 test -d "$cf_subdir_prefix" && \
9019 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
9020         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
9021         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
9022         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
9023         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
9024         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
9025         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"
9026 }
9027
9028 done
9029
9030 cf_search="$cf_library_path_list $cf_search"
9031
9032                         for cf_libdir in $cf_search
9033                         do
9034                                 echo "$as_me:9034: checking for -l$cf_nculib_root in $cf_libdir" >&5
9035 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
9036                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
9037                                 cat >conftest.$ac_ext <<_ACEOF
9038 #line 9038 "configure"
9039 #include "confdefs.h"
9040 #include <${cf_cv_ncurses_header:-curses.h}>
9041 int
9042 main ()
9043 {
9044 initscr()
9045   ;
9046   return 0;
9047 }
9048 _ACEOF
9049 rm -f conftest.$ac_objext conftest$ac_exeext
9050 if { (eval echo "$as_me:9050: \"$ac_link\"") >&5
9051   (eval $ac_link) 2>&5
9052   ac_status=$?
9053   echo "$as_me:9053: \$? = $ac_status" >&5
9054   (exit $ac_status); } &&
9055          { ac_try='test -s conftest$ac_exeext'
9056   { (eval echo "$as_me:9056: \"$ac_try\"") >&5
9057   (eval $ac_try) 2>&5
9058   ac_status=$?
9059   echo "$as_me:9059: \$? = $ac_status" >&5
9060   (exit $ac_status); }; }; then
9061   echo "$as_me:9061: result: yes" >&5
9062 echo "${ECHO_T}yes" >&6
9063                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9064                                          break
9065 else
9066   echo "$as_me: failed program was:" >&5
9067 cat conftest.$ac_ext >&5
9068 echo "$as_me:9068: result: no" >&5
9069 echo "${ECHO_T}no" >&6
9070                                          LIBS="$cf_save_LIBS"
9071 fi
9072 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9073                         done
9074
9075 fi
9076 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9077
9078 fi
9079
9080 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
9081
9082 if test $cf_found_library = no ; then
9083         { { echo "$as_me:9083: error: Cannot link $cf_nculib_root library" >&5
9084 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
9085    { (exit 1); exit 1; }; }
9086 fi
9087
9088 fi
9089
9090 if test -n "$cf_ncurses_LIBS" ; then
9091         echo "$as_me:9091: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
9092 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
9093         cf_ncurses_SAVE="$LIBS"
9094         for p in $cf_ncurses_LIBS ; do
9095                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
9096                 if test "$q" != "$LIBS" ; then
9097                         LIBS="$q"
9098                 fi
9099         done
9100         cat >conftest.$ac_ext <<_ACEOF
9101 #line 9101 "configure"
9102 #include "confdefs.h"
9103 #include <${cf_cv_ncurses_header:-curses.h}>
9104 int
9105 main ()
9106 {
9107 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
9108   ;
9109   return 0;
9110 }
9111 _ACEOF
9112 rm -f conftest.$ac_objext conftest$ac_exeext
9113 if { (eval echo "$as_me:9113: \"$ac_link\"") >&5
9114   (eval $ac_link) 2>&5
9115   ac_status=$?
9116   echo "$as_me:9116: \$? = $ac_status" >&5
9117   (exit $ac_status); } &&
9118          { ac_try='test -s conftest$ac_exeext'
9119   { (eval echo "$as_me:9119: \"$ac_try\"") >&5
9120   (eval $ac_try) 2>&5
9121   ac_status=$?
9122   echo "$as_me:9122: \$? = $ac_status" >&5
9123   (exit $ac_status); }; }; then
9124   echo "$as_me:9124: result: yes" >&5
9125 echo "${ECHO_T}yes" >&6
9126 else
9127   echo "$as_me: failed program was:" >&5
9128 cat conftest.$ac_ext >&5
9129 echo "$as_me:9129: result: no" >&5
9130 echo "${ECHO_T}no" >&6
9131                  LIBS="$cf_ncurses_SAVE"
9132 fi
9133 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9134 fi
9135
9136 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9137
9138 cat >>confdefs.h <<EOF
9139 #define $cf_nculib_ROOT 1
9140 EOF
9141
9142         fi
9143 else
9144         NCURSES_CONFIG=none
9145 fi
9146
9147         ;;
9148 (pdcurses)
9149         echo "$as_me:9149: checking for X" >&5
9150 echo $ECHO_N "checking for X... $ECHO_C" >&6
9151
9152 # Check whether --with-x or --without-x was given.
9153 if test "${with_x+set}" = set; then
9154   withval="$with_x"
9155
9156 fi;
9157 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
9158 if test "x$with_x" = xno; then
9159   # The user explicitly disabled X.
9160   have_x=disabled
9161 else
9162   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
9163     # Both variables are already set.
9164     have_x=yes
9165   else
9166     if test "${ac_cv_have_x+set}" = set; then
9167   echo $ECHO_N "(cached) $ECHO_C" >&6
9168 else
9169   # One or both of the vars are not set, and there is no cached value.
9170 ac_x_includes=no ac_x_libraries=no
9171 rm -fr conftest.dir
9172 if mkdir conftest.dir; then
9173   cd conftest.dir
9174   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
9175   cat >Imakefile <<'EOF'
9176 acfindx:
9177         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
9178 EOF
9179   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
9180     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
9181     eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
9182     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
9183     for ac_extension in a so sl dylib dll; do
9184       if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
9185          test -f $ac_im_libdir/libX11.$ac_extension; then
9186         ac_im_usrlibdir=$ac_im_libdir; break
9187       fi
9188     done
9189     # Screen out bogus values from the imake configuration.  They are
9190     # bogus both because they are the default anyway, and because
9191     # using them would break gcc on systems where it needs fixed includes.
9192     case $ac_im_incroot in
9193         /usr/include) ;;
9194         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
9195     esac
9196     case $ac_im_usrlibdir in
9197         /usr/lib | /lib) ;;
9198         *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
9199     esac
9200   fi
9201   cd ..
9202   rm -fr conftest.dir
9203 fi
9204
9205 # Standard set of common directories for X headers.
9206 # Check X11 before X11Rn because it is often a symlink to the current release.
9207 ac_x_header_dirs='
9208 /usr/X11/include
9209 /usr/X11R6/include
9210 /usr/X11R5/include
9211 /usr/X11R4/include
9212
9213 /usr/include/X11
9214 /usr/include/X11R6
9215 /usr/include/X11R5
9216 /usr/include/X11R4
9217
9218 /usr/local/X11/include
9219 /usr/local/X11R6/include
9220 /usr/local/X11R5/include
9221 /usr/local/X11R4/include
9222
9223 /usr/local/include/X11
9224 /usr/local/include/X11R6
9225 /usr/local/include/X11R5
9226 /usr/local/include/X11R4
9227
9228 /usr/X386/include
9229 /usr/x386/include
9230 /usr/XFree86/include/X11
9231
9232 /usr/include
9233 /usr/local/include
9234 /usr/unsupported/include
9235 /usr/athena/include
9236 /usr/local/x11r5/include
9237 /usr/lpp/Xamples/include
9238
9239 /usr/openwin/include
9240 /usr/openwin/share/include'
9241
9242 if test "$ac_x_includes" = no; then
9243   # Guess where to find include files, by looking for Intrinsic.h.
9244   # First, try using that file with no special directory specified.
9245   cat >conftest.$ac_ext <<_ACEOF
9246 #line 9246 "configure"
9247 #include "confdefs.h"
9248 #include <X11/Intrinsic.h>
9249 _ACEOF
9250 if { (eval echo "$as_me:9250: \"$ac_cpp conftest.$ac_ext\"") >&5
9251   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
9252   ac_status=$?
9253   egrep -v '^ *\+' conftest.er1 >conftest.err
9254   rm -f conftest.er1
9255   cat conftest.err >&5
9256   echo "$as_me:9256: \$? = $ac_status" >&5
9257   (exit $ac_status); } >/dev/null; then
9258   if test -s conftest.err; then
9259     ac_cpp_err=$ac_c_preproc_warn_flag
9260   else
9261     ac_cpp_err=
9262   fi
9263 else
9264   ac_cpp_err=yes
9265 fi
9266 if test -z "$ac_cpp_err"; then
9267   # We can compile using X headers with no special include directory.
9268 ac_x_includes=
9269 else
9270   echo "$as_me: failed program was:" >&5
9271   cat conftest.$ac_ext >&5
9272   for ac_dir in $ac_x_header_dirs; do
9273   if test -r "$ac_dir/X11/Intrinsic.h"; then
9274     ac_x_includes=$ac_dir
9275     break
9276   fi
9277 done
9278 fi
9279 rm -f conftest.err conftest.$ac_ext
9280 fi # $ac_x_includes = no
9281
9282 if test "$ac_x_libraries" = no; then
9283   # Check for the libraries.
9284   # See if we find them without any special options.
9285   # Don't add to $LIBS permanently.
9286   ac_save_LIBS=$LIBS
9287   LIBS="-lXt $LIBS"
9288   cat >conftest.$ac_ext <<_ACEOF
9289 #line 9289 "configure"
9290 #include "confdefs.h"
9291 #include <X11/Intrinsic.h>
9292 int
9293 main ()
9294 {
9295 XtMalloc (0)
9296   ;
9297   return 0;
9298 }
9299 _ACEOF
9300 rm -f conftest.$ac_objext conftest$ac_exeext
9301 if { (eval echo "$as_me:9301: \"$ac_link\"") >&5
9302   (eval $ac_link) 2>&5
9303   ac_status=$?
9304   echo "$as_me:9304: \$? = $ac_status" >&5
9305   (exit $ac_status); } &&
9306          { ac_try='test -s conftest$ac_exeext'
9307   { (eval echo "$as_me:9307: \"$ac_try\"") >&5
9308   (eval $ac_try) 2>&5
9309   ac_status=$?
9310   echo "$as_me:9310: \$? = $ac_status" >&5
9311   (exit $ac_status); }; }; then
9312   LIBS=$ac_save_LIBS
9313 # We can link X programs with no special library path.
9314 ac_x_libraries=
9315 else
9316   echo "$as_me: failed program was:" >&5
9317 cat conftest.$ac_ext >&5
9318 LIBS=$ac_save_LIBS
9319 for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
9320 do
9321   # Don't even attempt the hair of trying to link an X program!
9322   for ac_extension in a so sl dylib dll; do
9323     if test -r $ac_dir/libXt.$ac_extension; then
9324       ac_x_libraries=$ac_dir
9325       break 2
9326     fi
9327   done
9328 done
9329 fi
9330 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9331 fi # $ac_x_libraries = no
9332
9333 if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then
9334   # Didn't find X anywhere.  Cache the known absence of X.
9335   ac_cv_have_x="have_x=no"
9336 else
9337   # Record where we found X for the cache.
9338   ac_cv_have_x="have_x=yes \
9339                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
9340 fi
9341 fi
9342
9343   fi
9344   eval "$ac_cv_have_x"
9345 fi # $with_x != no
9346
9347 if test "$have_x" != yes; then
9348   echo "$as_me:9348: result: $have_x" >&5
9349 echo "${ECHO_T}$have_x" >&6
9350   no_x=yes
9351 else
9352   # If each of the values was on the command line, it overrides each guess.
9353   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
9354   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
9355   # Update the cache value to reflect the command line values.
9356   ac_cv_have_x="have_x=yes \
9357                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
9358   echo "$as_me:9358: result: libraries $x_libraries, headers $x_includes" >&5
9359 echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6
9360 fi
9361
9362 if test "$no_x" = yes; then
9363   # Not all programs may use this symbol, but it does not hurt to define it.
9364
9365 cat >>confdefs.h <<\EOF
9366 #define X_DISPLAY_MISSING 1
9367 EOF
9368
9369   X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
9370 else
9371   if test -n "$x_includes"; then
9372     X_CFLAGS="$X_CFLAGS -I$x_includes"
9373   fi
9374
9375   # It would also be nice to do this for all -L options, not just this one.
9376   if test -n "$x_libraries"; then
9377     X_LIBS="$X_LIBS -L$x_libraries"
9378     # For Solaris; some versions of Sun CC require a space after -R and
9379     # others require no space.  Words are not sufficient . . . .
9380     case `(uname -sr) 2>/dev/null` in
9381     "SunOS 5"*)
9382       echo "$as_me:9382: checking whether -R must be followed by a space" >&5
9383 echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6
9384       ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
9385       cat >conftest.$ac_ext <<_ACEOF
9386 #line 9386 "configure"
9387 #include "confdefs.h"
9388
9389 int
9390 main ()
9391 {
9392
9393   ;
9394   return 0;
9395 }
9396 _ACEOF
9397 rm -f conftest.$ac_objext conftest$ac_exeext
9398 if { (eval echo "$as_me:9398: \"$ac_link\"") >&5
9399   (eval $ac_link) 2>&5
9400   ac_status=$?
9401   echo "$as_me:9401: \$? = $ac_status" >&5
9402   (exit $ac_status); } &&
9403          { ac_try='test -s conftest$ac_exeext'
9404   { (eval echo "$as_me:9404: \"$ac_try\"") >&5
9405   (eval $ac_try) 2>&5
9406   ac_status=$?
9407   echo "$as_me:9407: \$? = $ac_status" >&5
9408   (exit $ac_status); }; }; then
9409   ac_R_nospace=yes
9410 else
9411   echo "$as_me: failed program was:" >&5
9412 cat conftest.$ac_ext >&5
9413 ac_R_nospace=no
9414 fi
9415 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9416       if test $ac_R_nospace = yes; then
9417         echo "$as_me:9417: result: no" >&5
9418 echo "${ECHO_T}no" >&6
9419         X_LIBS="$X_LIBS -R$x_libraries"
9420       else
9421         LIBS="$ac_xsave_LIBS -R $x_libraries"
9422         cat >conftest.$ac_ext <<_ACEOF
9423 #line 9423 "configure"
9424 #include "confdefs.h"
9425
9426 int
9427 main ()
9428 {
9429
9430   ;
9431   return 0;
9432 }
9433 _ACEOF
9434 rm -f conftest.$ac_objext conftest$ac_exeext
9435 if { (eval echo "$as_me:9435: \"$ac_link\"") >&5
9436   (eval $ac_link) 2>&5
9437   ac_status=$?
9438   echo "$as_me:9438: \$? = $ac_status" >&5
9439   (exit $ac_status); } &&
9440          { ac_try='test -s conftest$ac_exeext'
9441   { (eval echo "$as_me:9441: \"$ac_try\"") >&5
9442   (eval $ac_try) 2>&5
9443   ac_status=$?
9444   echo "$as_me:9444: \$? = $ac_status" >&5
9445   (exit $ac_status); }; }; then
9446   ac_R_space=yes
9447 else
9448   echo "$as_me: failed program was:" >&5
9449 cat conftest.$ac_ext >&5
9450 ac_R_space=no
9451 fi
9452 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9453         if test $ac_R_space = yes; then
9454           echo "$as_me:9454: result: yes" >&5
9455 echo "${ECHO_T}yes" >&6
9456           X_LIBS="$X_LIBS -R $x_libraries"
9457         else
9458           echo "$as_me:9458: result: neither works" >&5
9459 echo "${ECHO_T}neither works" >&6
9460         fi
9461       fi
9462       LIBS=$ac_xsave_LIBS
9463     esac
9464   fi
9465
9466   # Check for system-dependent libraries X programs must link with.
9467   # Do this before checking for the system-independent R6 libraries
9468   # (-lICE), since we may need -lsocket or whatever for X linking.
9469
9470   if test "$ISC" = yes; then
9471     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
9472   else
9473     # Martyn Johnson says this is needed for Ultrix, if the X
9474     # libraries were built with DECnet support.  And Karl Berry says
9475     # the Alpha needs dnet_stub (dnet does not exist).
9476     ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
9477     cat >conftest.$ac_ext <<_ACEOF
9478 #line 9478 "configure"
9479 #include "confdefs.h"
9480
9481 /* Override any gcc2 internal prototype to avoid an error.  */
9482 #ifdef __cplusplus
9483 extern "C"
9484 #endif
9485 /* We use char because int might match the return type of a gcc2
9486    builtin and then its argument prototype would still apply.  */
9487 char XOpenDisplay ();
9488 int
9489 main ()
9490 {
9491 XOpenDisplay ();
9492   ;
9493   return 0;
9494 }
9495 _ACEOF
9496 rm -f conftest.$ac_objext conftest$ac_exeext
9497 if { (eval echo "$as_me:9497: \"$ac_link\"") >&5
9498   (eval $ac_link) 2>&5
9499   ac_status=$?
9500   echo "$as_me:9500: \$? = $ac_status" >&5
9501   (exit $ac_status); } &&
9502          { ac_try='test -s conftest$ac_exeext'
9503   { (eval echo "$as_me:9503: \"$ac_try\"") >&5
9504   (eval $ac_try) 2>&5
9505   ac_status=$?
9506   echo "$as_me:9506: \$? = $ac_status" >&5
9507   (exit $ac_status); }; }; then
9508   :
9509 else
9510   echo "$as_me: failed program was:" >&5
9511 cat conftest.$ac_ext >&5
9512 echo "$as_me:9512: checking for dnet_ntoa in -ldnet" >&5
9513 echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6
9514 if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then
9515   echo $ECHO_N "(cached) $ECHO_C" >&6
9516 else
9517   ac_check_lib_save_LIBS=$LIBS
9518 LIBS="-ldnet  $LIBS"
9519 cat >conftest.$ac_ext <<_ACEOF
9520 #line 9520 "configure"
9521 #include "confdefs.h"
9522
9523 /* Override any gcc2 internal prototype to avoid an error.  */
9524 #ifdef __cplusplus
9525 extern "C"
9526 #endif
9527 /* We use char because int might match the return type of a gcc2
9528    builtin and then its argument prototype would still apply.  */
9529 char dnet_ntoa ();
9530 int
9531 main ()
9532 {
9533 dnet_ntoa ();
9534   ;
9535   return 0;
9536 }
9537 _ACEOF
9538 rm -f conftest.$ac_objext conftest$ac_exeext
9539 if { (eval echo "$as_me:9539: \"$ac_link\"") >&5
9540   (eval $ac_link) 2>&5
9541   ac_status=$?
9542   echo "$as_me:9542: \$? = $ac_status" >&5
9543   (exit $ac_status); } &&
9544          { ac_try='test -s conftest$ac_exeext'
9545   { (eval echo "$as_me:9545: \"$ac_try\"") >&5
9546   (eval $ac_try) 2>&5
9547   ac_status=$?
9548   echo "$as_me:9548: \$? = $ac_status" >&5
9549   (exit $ac_status); }; }; then
9550   ac_cv_lib_dnet_dnet_ntoa=yes
9551 else
9552   echo "$as_me: failed program was:" >&5
9553 cat conftest.$ac_ext >&5
9554 ac_cv_lib_dnet_dnet_ntoa=no
9555 fi
9556 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9557 LIBS=$ac_check_lib_save_LIBS
9558 fi
9559 echo "$as_me:9559: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
9560 echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6
9561 if test $ac_cv_lib_dnet_dnet_ntoa = yes; then
9562   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
9563 fi
9564
9565     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
9566       echo "$as_me:9566: checking for dnet_ntoa in -ldnet_stub" >&5
9567 echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6
9568 if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then
9569   echo $ECHO_N "(cached) $ECHO_C" >&6
9570 else
9571   ac_check_lib_save_LIBS=$LIBS
9572 LIBS="-ldnet_stub  $LIBS"
9573 cat >conftest.$ac_ext <<_ACEOF
9574 #line 9574 "configure"
9575 #include "confdefs.h"
9576
9577 /* Override any gcc2 internal prototype to avoid an error.  */
9578 #ifdef __cplusplus
9579 extern "C"
9580 #endif
9581 /* We use char because int might match the return type of a gcc2
9582    builtin and then its argument prototype would still apply.  */
9583 char dnet_ntoa ();
9584 int
9585 main ()
9586 {
9587 dnet_ntoa ();
9588   ;
9589   return 0;
9590 }
9591 _ACEOF
9592 rm -f conftest.$ac_objext conftest$ac_exeext
9593 if { (eval echo "$as_me:9593: \"$ac_link\"") >&5
9594   (eval $ac_link) 2>&5
9595   ac_status=$?
9596   echo "$as_me:9596: \$? = $ac_status" >&5
9597   (exit $ac_status); } &&
9598          { ac_try='test -s conftest$ac_exeext'
9599   { (eval echo "$as_me:9599: \"$ac_try\"") >&5
9600   (eval $ac_try) 2>&5
9601   ac_status=$?
9602   echo "$as_me:9602: \$? = $ac_status" >&5
9603   (exit $ac_status); }; }; then
9604   ac_cv_lib_dnet_stub_dnet_ntoa=yes
9605 else
9606   echo "$as_me: failed program was:" >&5
9607 cat conftest.$ac_ext >&5
9608 ac_cv_lib_dnet_stub_dnet_ntoa=no
9609 fi
9610 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9611 LIBS=$ac_check_lib_save_LIBS
9612 fi
9613 echo "$as_me:9613: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
9614 echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6
9615 if test $ac_cv_lib_dnet_stub_dnet_ntoa = yes; then
9616   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
9617 fi
9618
9619     fi
9620 fi
9621 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9622     LIBS="$ac_xsave_LIBS"
9623
9624     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
9625     # to get the SysV transport functions.
9626     # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4)
9627     # needs -lnsl.
9628     # The nsl library prevents programs from opening the X display
9629     # on Irix 5.2, according to T.E. Dickey.
9630     # The functions gethostbyname, getservbyname, and inet_addr are
9631     # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
9632     echo "$as_me:9632: checking for gethostbyname" >&5
9633 echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6
9634 if test "${ac_cv_func_gethostbyname+set}" = set; then
9635   echo $ECHO_N "(cached) $ECHO_C" >&6
9636 else
9637   cat >conftest.$ac_ext <<_ACEOF
9638 #line 9638 "configure"
9639 #include "confdefs.h"
9640 /* System header to define __stub macros and hopefully few prototypes,
9641     which can conflict with char gethostbyname (); below.  */
9642 #include <assert.h>
9643 /* Override any gcc2 internal prototype to avoid an error.  */
9644 #ifdef __cplusplus
9645 extern "C"
9646 #endif
9647 /* We use char because int might match the return type of a gcc2
9648    builtin and then its argument prototype would still apply.  */
9649 char gethostbyname ();
9650 char (*f) ();
9651
9652 int
9653 main ()
9654 {
9655 /* The GNU C library defines this for functions which it implements
9656     to always fail with ENOSYS.  Some functions are actually named
9657     something starting with __ and the normal name is an alias.  */
9658 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
9659 choke me
9660 #else
9661 f = gethostbyname; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
9662 #endif
9663
9664   ;
9665   return 0;
9666 }
9667 _ACEOF
9668 rm -f conftest.$ac_objext conftest$ac_exeext
9669 if { (eval echo "$as_me:9669: \"$ac_link\"") >&5
9670   (eval $ac_link) 2>&5
9671   ac_status=$?
9672   echo "$as_me:9672: \$? = $ac_status" >&5
9673   (exit $ac_status); } &&
9674          { ac_try='test -s conftest$ac_exeext'
9675   { (eval echo "$as_me:9675: \"$ac_try\"") >&5
9676   (eval $ac_try) 2>&5
9677   ac_status=$?
9678   echo "$as_me:9678: \$? = $ac_status" >&5
9679   (exit $ac_status); }; }; then
9680   ac_cv_func_gethostbyname=yes
9681 else
9682   echo "$as_me: failed program was:" >&5
9683 cat conftest.$ac_ext >&5
9684 ac_cv_func_gethostbyname=no
9685 fi
9686 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9687 fi
9688 echo "$as_me:9688: result: $ac_cv_func_gethostbyname" >&5
9689 echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6
9690
9691     if test $ac_cv_func_gethostbyname = no; then
9692       echo "$as_me:9692: checking for gethostbyname in -lnsl" >&5
9693 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6
9694 if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
9695   echo $ECHO_N "(cached) $ECHO_C" >&6
9696 else
9697   ac_check_lib_save_LIBS=$LIBS
9698 LIBS="-lnsl  $LIBS"
9699 cat >conftest.$ac_ext <<_ACEOF
9700 #line 9700 "configure"
9701 #include "confdefs.h"
9702
9703 /* Override any gcc2 internal prototype to avoid an error.  */
9704 #ifdef __cplusplus
9705 extern "C"
9706 #endif
9707 /* We use char because int might match the return type of a gcc2
9708    builtin and then its argument prototype would still apply.  */
9709 char gethostbyname ();
9710 int
9711 main ()
9712 {
9713 gethostbyname ();
9714   ;
9715   return 0;
9716 }
9717 _ACEOF
9718 rm -f conftest.$ac_objext conftest$ac_exeext
9719 if { (eval echo "$as_me:9719: \"$ac_link\"") >&5
9720   (eval $ac_link) 2>&5
9721   ac_status=$?
9722   echo "$as_me:9722: \$? = $ac_status" >&5
9723   (exit $ac_status); } &&
9724          { ac_try='test -s conftest$ac_exeext'
9725   { (eval echo "$as_me:9725: \"$ac_try\"") >&5
9726   (eval $ac_try) 2>&5
9727   ac_status=$?
9728   echo "$as_me:9728: \$? = $ac_status" >&5
9729   (exit $ac_status); }; }; then
9730   ac_cv_lib_nsl_gethostbyname=yes
9731 else
9732   echo "$as_me: failed program was:" >&5
9733 cat conftest.$ac_ext >&5
9734 ac_cv_lib_nsl_gethostbyname=no
9735 fi
9736 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9737 LIBS=$ac_check_lib_save_LIBS
9738 fi
9739 echo "$as_me:9739: result: $ac_cv_lib_nsl_gethostbyname" >&5
9740 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6
9741 if test $ac_cv_lib_nsl_gethostbyname = yes; then
9742   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
9743 fi
9744
9745       if test $ac_cv_lib_nsl_gethostbyname = no; then
9746         echo "$as_me:9746: checking for gethostbyname in -lbsd" >&5
9747 echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6
9748 if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then
9749   echo $ECHO_N "(cached) $ECHO_C" >&6
9750 else
9751   ac_check_lib_save_LIBS=$LIBS
9752 LIBS="-lbsd  $LIBS"
9753 cat >conftest.$ac_ext <<_ACEOF
9754 #line 9754 "configure"
9755 #include "confdefs.h"
9756
9757 /* Override any gcc2 internal prototype to avoid an error.  */
9758 #ifdef __cplusplus
9759 extern "C"
9760 #endif
9761 /* We use char because int might match the return type of a gcc2
9762    builtin and then its argument prototype would still apply.  */
9763 char gethostbyname ();
9764 int
9765 main ()
9766 {
9767 gethostbyname ();
9768   ;
9769   return 0;
9770 }
9771 _ACEOF
9772 rm -f conftest.$ac_objext conftest$ac_exeext
9773 if { (eval echo "$as_me:9773: \"$ac_link\"") >&5
9774   (eval $ac_link) 2>&5
9775   ac_status=$?
9776   echo "$as_me:9776: \$? = $ac_status" >&5
9777   (exit $ac_status); } &&
9778          { ac_try='test -s conftest$ac_exeext'
9779   { (eval echo "$as_me:9779: \"$ac_try\"") >&5
9780   (eval $ac_try) 2>&5
9781   ac_status=$?
9782   echo "$as_me:9782: \$? = $ac_status" >&5
9783   (exit $ac_status); }; }; then
9784   ac_cv_lib_bsd_gethostbyname=yes
9785 else
9786   echo "$as_me: failed program was:" >&5
9787 cat conftest.$ac_ext >&5
9788 ac_cv_lib_bsd_gethostbyname=no
9789 fi
9790 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9791 LIBS=$ac_check_lib_save_LIBS
9792 fi
9793 echo "$as_me:9793: result: $ac_cv_lib_bsd_gethostbyname" >&5
9794 echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6
9795 if test $ac_cv_lib_bsd_gethostbyname = yes; then
9796   X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
9797 fi
9798
9799       fi
9800     fi
9801
9802     # lieder@skyler.mavd.honeywell.com says without -lsocket,
9803     # socket/setsockopt and other routines are undefined under SCO ODT
9804     # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
9805     # on later versions), says Simon Leinen: it contains gethostby*
9806     # variants that don't use the nameserver (or something).  -lsocket
9807     # must be given before -lnsl if both are needed.  We assume that
9808     # if connect needs -lnsl, so does gethostbyname.
9809     echo "$as_me:9809: checking for connect" >&5
9810 echo $ECHO_N "checking for connect... $ECHO_C" >&6
9811 if test "${ac_cv_func_connect+set}" = set; then
9812   echo $ECHO_N "(cached) $ECHO_C" >&6
9813 else
9814   cat >conftest.$ac_ext <<_ACEOF
9815 #line 9815 "configure"
9816 #include "confdefs.h"
9817 /* System header to define __stub macros and hopefully few prototypes,
9818     which can conflict with char connect (); below.  */
9819 #include <assert.h>
9820 /* Override any gcc2 internal prototype to avoid an error.  */
9821 #ifdef __cplusplus
9822 extern "C"
9823 #endif
9824 /* We use char because int might match the return type of a gcc2
9825    builtin and then its argument prototype would still apply.  */
9826 char connect ();
9827 char (*f) ();
9828
9829 int
9830 main ()
9831 {
9832 /* The GNU C library defines this for functions which it implements
9833     to always fail with ENOSYS.  Some functions are actually named
9834     something starting with __ and the normal name is an alias.  */
9835 #if defined (__stub_connect) || defined (__stub___connect)
9836 choke me
9837 #else
9838 f = connect; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
9839 #endif
9840
9841   ;
9842   return 0;
9843 }
9844 _ACEOF
9845 rm -f conftest.$ac_objext conftest$ac_exeext
9846 if { (eval echo "$as_me:9846: \"$ac_link\"") >&5
9847   (eval $ac_link) 2>&5
9848   ac_status=$?
9849   echo "$as_me:9849: \$? = $ac_status" >&5
9850   (exit $ac_status); } &&
9851          { ac_try='test -s conftest$ac_exeext'
9852   { (eval echo "$as_me:9852: \"$ac_try\"") >&5
9853   (eval $ac_try) 2>&5
9854   ac_status=$?
9855   echo "$as_me:9855: \$? = $ac_status" >&5
9856   (exit $ac_status); }; }; then
9857   ac_cv_func_connect=yes
9858 else
9859   echo "$as_me: failed program was:" >&5
9860 cat conftest.$ac_ext >&5
9861 ac_cv_func_connect=no
9862 fi
9863 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9864 fi
9865 echo "$as_me:9865: result: $ac_cv_func_connect" >&5
9866 echo "${ECHO_T}$ac_cv_func_connect" >&6
9867
9868     if test $ac_cv_func_connect = no; then
9869       echo "$as_me:9869: checking for connect in -lsocket" >&5
9870 echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6
9871 if test "${ac_cv_lib_socket_connect+set}" = set; then
9872   echo $ECHO_N "(cached) $ECHO_C" >&6
9873 else
9874   ac_check_lib_save_LIBS=$LIBS
9875 LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
9876 cat >conftest.$ac_ext <<_ACEOF
9877 #line 9877 "configure"
9878 #include "confdefs.h"
9879
9880 /* Override any gcc2 internal prototype to avoid an error.  */
9881 #ifdef __cplusplus
9882 extern "C"
9883 #endif
9884 /* We use char because int might match the return type of a gcc2
9885    builtin and then its argument prototype would still apply.  */
9886 char connect ();
9887 int
9888 main ()
9889 {
9890 connect ();
9891   ;
9892   return 0;
9893 }
9894 _ACEOF
9895 rm -f conftest.$ac_objext conftest$ac_exeext
9896 if { (eval echo "$as_me:9896: \"$ac_link\"") >&5
9897   (eval $ac_link) 2>&5
9898   ac_status=$?
9899   echo "$as_me:9899: \$? = $ac_status" >&5
9900   (exit $ac_status); } &&
9901          { ac_try='test -s conftest$ac_exeext'
9902   { (eval echo "$as_me:9902: \"$ac_try\"") >&5
9903   (eval $ac_try) 2>&5
9904   ac_status=$?
9905   echo "$as_me:9905: \$? = $ac_status" >&5
9906   (exit $ac_status); }; }; then
9907   ac_cv_lib_socket_connect=yes
9908 else
9909   echo "$as_me: failed program was:" >&5
9910 cat conftest.$ac_ext >&5
9911 ac_cv_lib_socket_connect=no
9912 fi
9913 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9914 LIBS=$ac_check_lib_save_LIBS
9915 fi
9916 echo "$as_me:9916: result: $ac_cv_lib_socket_connect" >&5
9917 echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6
9918 if test $ac_cv_lib_socket_connect = yes; then
9919   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
9920 fi
9921
9922     fi
9923
9924     # Guillermo Gomez says -lposix is necessary on A/UX.
9925     echo "$as_me:9925: checking for remove" >&5
9926 echo $ECHO_N "checking for remove... $ECHO_C" >&6
9927 if test "${ac_cv_func_remove+set}" = set; then
9928   echo $ECHO_N "(cached) $ECHO_C" >&6
9929 else
9930   cat >conftest.$ac_ext <<_ACEOF
9931 #line 9931 "configure"
9932 #include "confdefs.h"
9933 /* System header to define __stub macros and hopefully few prototypes,
9934     which can conflict with char remove (); below.  */
9935 #include <assert.h>
9936 /* Override any gcc2 internal prototype to avoid an error.  */
9937 #ifdef __cplusplus
9938 extern "C"
9939 #endif
9940 /* We use char because int might match the return type of a gcc2
9941    builtin and then its argument prototype would still apply.  */
9942 char remove ();
9943 char (*f) ();
9944
9945 int
9946 main ()
9947 {
9948 /* The GNU C library defines this for functions which it implements
9949     to always fail with ENOSYS.  Some functions are actually named
9950     something starting with __ and the normal name is an alias.  */
9951 #if defined (__stub_remove) || defined (__stub___remove)
9952 choke me
9953 #else
9954 f = remove; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
9955 #endif
9956
9957   ;
9958   return 0;
9959 }
9960 _ACEOF
9961 rm -f conftest.$ac_objext conftest$ac_exeext
9962 if { (eval echo "$as_me:9962: \"$ac_link\"") >&5
9963   (eval $ac_link) 2>&5
9964   ac_status=$?
9965   echo "$as_me:9965: \$? = $ac_status" >&5
9966   (exit $ac_status); } &&
9967          { ac_try='test -s conftest$ac_exeext'
9968   { (eval echo "$as_me:9968: \"$ac_try\"") >&5
9969   (eval $ac_try) 2>&5
9970   ac_status=$?
9971   echo "$as_me:9971: \$? = $ac_status" >&5
9972   (exit $ac_status); }; }; then
9973   ac_cv_func_remove=yes
9974 else
9975   echo "$as_me: failed program was:" >&5
9976 cat conftest.$ac_ext >&5
9977 ac_cv_func_remove=no
9978 fi
9979 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9980 fi
9981 echo "$as_me:9981: result: $ac_cv_func_remove" >&5
9982 echo "${ECHO_T}$ac_cv_func_remove" >&6
9983
9984     if test $ac_cv_func_remove = no; then
9985       echo "$as_me:9985: checking for remove in -lposix" >&5
9986 echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6
9987 if test "${ac_cv_lib_posix_remove+set}" = set; then
9988   echo $ECHO_N "(cached) $ECHO_C" >&6
9989 else
9990   ac_check_lib_save_LIBS=$LIBS
9991 LIBS="-lposix  $LIBS"
9992 cat >conftest.$ac_ext <<_ACEOF
9993 #line 9993 "configure"
9994 #include "confdefs.h"
9995
9996 /* Override any gcc2 internal prototype to avoid an error.  */
9997 #ifdef __cplusplus
9998 extern "C"
9999 #endif
10000 /* We use char because int might match the return type of a gcc2
10001    builtin and then its argument prototype would still apply.  */
10002 char remove ();
10003 int
10004 main ()
10005 {
10006 remove ();
10007   ;
10008   return 0;
10009 }
10010 _ACEOF
10011 rm -f conftest.$ac_objext conftest$ac_exeext
10012 if { (eval echo "$as_me:10012: \"$ac_link\"") >&5
10013   (eval $ac_link) 2>&5
10014   ac_status=$?
10015   echo "$as_me:10015: \$? = $ac_status" >&5
10016   (exit $ac_status); } &&
10017          { ac_try='test -s conftest$ac_exeext'
10018   { (eval echo "$as_me:10018: \"$ac_try\"") >&5
10019   (eval $ac_try) 2>&5
10020   ac_status=$?
10021   echo "$as_me:10021: \$? = $ac_status" >&5
10022   (exit $ac_status); }; }; then
10023   ac_cv_lib_posix_remove=yes
10024 else
10025   echo "$as_me: failed program was:" >&5
10026 cat conftest.$ac_ext >&5
10027 ac_cv_lib_posix_remove=no
10028 fi
10029 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10030 LIBS=$ac_check_lib_save_LIBS
10031 fi
10032 echo "$as_me:10032: result: $ac_cv_lib_posix_remove" >&5
10033 echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6
10034 if test $ac_cv_lib_posix_remove = yes; then
10035   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
10036 fi
10037
10038     fi
10039
10040     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
10041     echo "$as_me:10041: checking for shmat" >&5
10042 echo $ECHO_N "checking for shmat... $ECHO_C" >&6
10043 if test "${ac_cv_func_shmat+set}" = set; then
10044   echo $ECHO_N "(cached) $ECHO_C" >&6
10045 else
10046   cat >conftest.$ac_ext <<_ACEOF
10047 #line 10047 "configure"
10048 #include "confdefs.h"
10049 /* System header to define __stub macros and hopefully few prototypes,
10050     which can conflict with char shmat (); below.  */
10051 #include <assert.h>
10052 /* Override any gcc2 internal prototype to avoid an error.  */
10053 #ifdef __cplusplus
10054 extern "C"
10055 #endif
10056 /* We use char because int might match the return type of a gcc2
10057    builtin and then its argument prototype would still apply.  */
10058 char shmat ();
10059 char (*f) ();
10060
10061 int
10062 main ()
10063 {
10064 /* The GNU C library defines this for functions which it implements
10065     to always fail with ENOSYS.  Some functions are actually named
10066     something starting with __ and the normal name is an alias.  */
10067 #if defined (__stub_shmat) || defined (__stub___shmat)
10068 choke me
10069 #else
10070 f = shmat; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
10071 #endif
10072
10073   ;
10074   return 0;
10075 }
10076 _ACEOF
10077 rm -f conftest.$ac_objext conftest$ac_exeext
10078 if { (eval echo "$as_me:10078: \"$ac_link\"") >&5
10079   (eval $ac_link) 2>&5
10080   ac_status=$?
10081   echo "$as_me:10081: \$? = $ac_status" >&5
10082   (exit $ac_status); } &&
10083          { ac_try='test -s conftest$ac_exeext'
10084   { (eval echo "$as_me:10084: \"$ac_try\"") >&5
10085   (eval $ac_try) 2>&5
10086   ac_status=$?
10087   echo "$as_me:10087: \$? = $ac_status" >&5
10088   (exit $ac_status); }; }; then
10089   ac_cv_func_shmat=yes
10090 else
10091   echo "$as_me: failed program was:" >&5
10092 cat conftest.$ac_ext >&5
10093 ac_cv_func_shmat=no
10094 fi
10095 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10096 fi
10097 echo "$as_me:10097: result: $ac_cv_func_shmat" >&5
10098 echo "${ECHO_T}$ac_cv_func_shmat" >&6
10099
10100     if test $ac_cv_func_shmat = no; then
10101       echo "$as_me:10101: checking for shmat in -lipc" >&5
10102 echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6
10103 if test "${ac_cv_lib_ipc_shmat+set}" = set; then
10104   echo $ECHO_N "(cached) $ECHO_C" >&6
10105 else
10106   ac_check_lib_save_LIBS=$LIBS
10107 LIBS="-lipc  $LIBS"
10108 cat >conftest.$ac_ext <<_ACEOF
10109 #line 10109 "configure"
10110 #include "confdefs.h"
10111
10112 /* Override any gcc2 internal prototype to avoid an error.  */
10113 #ifdef __cplusplus
10114 extern "C"
10115 #endif
10116 /* We use char because int might match the return type of a gcc2
10117    builtin and then its argument prototype would still apply.  */
10118 char shmat ();
10119 int
10120 main ()
10121 {
10122 shmat ();
10123   ;
10124   return 0;
10125 }
10126 _ACEOF
10127 rm -f conftest.$ac_objext conftest$ac_exeext
10128 if { (eval echo "$as_me:10128: \"$ac_link\"") >&5
10129   (eval $ac_link) 2>&5
10130   ac_status=$?
10131   echo "$as_me:10131: \$? = $ac_status" >&5
10132   (exit $ac_status); } &&
10133          { ac_try='test -s conftest$ac_exeext'
10134   { (eval echo "$as_me:10134: \"$ac_try\"") >&5
10135   (eval $ac_try) 2>&5
10136   ac_status=$?
10137   echo "$as_me:10137: \$? = $ac_status" >&5
10138   (exit $ac_status); }; }; then
10139   ac_cv_lib_ipc_shmat=yes
10140 else
10141   echo "$as_me: failed program was:" >&5
10142 cat conftest.$ac_ext >&5
10143 ac_cv_lib_ipc_shmat=no
10144 fi
10145 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10146 LIBS=$ac_check_lib_save_LIBS
10147 fi
10148 echo "$as_me:10148: result: $ac_cv_lib_ipc_shmat" >&5
10149 echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6
10150 if test $ac_cv_lib_ipc_shmat = yes; then
10151   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
10152 fi
10153
10154     fi
10155   fi
10156
10157   # Check for libraries that X11R6 Xt/Xaw programs need.
10158   ac_save_LDFLAGS=$LDFLAGS
10159   test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
10160   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
10161   # check for ICE first), but we must link in the order -lSM -lICE or
10162   # we get undefined symbols.  So assume we have SM if we have ICE.
10163   # These have to be linked with before -lX11, unlike the other
10164   # libraries we check for below, so use a different variable.
10165   # John Interrante, Karl Berry
10166   echo "$as_me:10166: checking for IceConnectionNumber in -lICE" >&5
10167 echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6
10168 if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then
10169   echo $ECHO_N "(cached) $ECHO_C" >&6
10170 else
10171   ac_check_lib_save_LIBS=$LIBS
10172 LIBS="-lICE $X_EXTRA_LIBS $LIBS"
10173 cat >conftest.$ac_ext <<_ACEOF
10174 #line 10174 "configure"
10175 #include "confdefs.h"
10176
10177 /* Override any gcc2 internal prototype to avoid an error.  */
10178 #ifdef __cplusplus
10179 extern "C"
10180 #endif
10181 /* We use char because int might match the return type of a gcc2
10182    builtin and then its argument prototype would still apply.  */
10183 char IceConnectionNumber ();
10184 int
10185 main ()
10186 {
10187 IceConnectionNumber ();
10188   ;
10189   return 0;
10190 }
10191 _ACEOF
10192 rm -f conftest.$ac_objext conftest$ac_exeext
10193 if { (eval echo "$as_me:10193: \"$ac_link\"") >&5
10194   (eval $ac_link) 2>&5
10195   ac_status=$?
10196   echo "$as_me:10196: \$? = $ac_status" >&5
10197   (exit $ac_status); } &&
10198          { ac_try='test -s conftest$ac_exeext'
10199   { (eval echo "$as_me:10199: \"$ac_try\"") >&5
10200   (eval $ac_try) 2>&5
10201   ac_status=$?
10202   echo "$as_me:10202: \$? = $ac_status" >&5
10203   (exit $ac_status); }; }; then
10204   ac_cv_lib_ICE_IceConnectionNumber=yes
10205 else
10206   echo "$as_me: failed program was:" >&5
10207 cat conftest.$ac_ext >&5
10208 ac_cv_lib_ICE_IceConnectionNumber=no
10209 fi
10210 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10211 LIBS=$ac_check_lib_save_LIBS
10212 fi
10213 echo "$as_me:10213: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
10214 echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6
10215 if test $ac_cv_lib_ICE_IceConnectionNumber = yes; then
10216   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
10217 fi
10218
10219   LDFLAGS=$ac_save_LDFLAGS
10220
10221 fi
10222
10223 cf_x_athena=${cf_x_athena:-Xaw}
10224
10225 echo "$as_me:10225: checking if you want to link with Xaw 3d library" >&5
10226 echo $ECHO_N "checking if you want to link with Xaw 3d library... $ECHO_C" >&6
10227 withval=
10228
10229 # Check whether --with-Xaw3d or --without-Xaw3d was given.
10230 if test "${with_Xaw3d+set}" = set; then
10231   withval="$with_Xaw3d"
10232
10233 fi;
10234 if test "$withval" = yes ; then
10235         cf_x_athena=Xaw3d
10236         echo "$as_me:10236: result: yes" >&5
10237 echo "${ECHO_T}yes" >&6
10238 else
10239         echo "$as_me:10239: result: no" >&5
10240 echo "${ECHO_T}no" >&6
10241 fi
10242
10243 echo "$as_me:10243: checking if you want to link with Xaw 3d xft library" >&5
10244 echo $ECHO_N "checking if you want to link with Xaw 3d xft library... $ECHO_C" >&6
10245 withval=
10246
10247 # Check whether --with-Xaw3dxft or --without-Xaw3dxft was given.
10248 if test "${with_Xaw3dxft+set}" = set; then
10249   withval="$with_Xaw3dxft"
10250
10251 fi;
10252 if test "$withval" = yes ; then
10253         cf_x_athena=Xaw3dxft
10254         echo "$as_me:10254: result: yes" >&5
10255 echo "${ECHO_T}yes" >&6
10256 else
10257         echo "$as_me:10257: result: no" >&5
10258 echo "${ECHO_T}no" >&6
10259 fi
10260
10261 echo "$as_me:10261: checking if you want to link with neXT Athena library" >&5
10262 echo $ECHO_N "checking if you want to link with neXT Athena library... $ECHO_C" >&6
10263 withval=
10264
10265 # Check whether --with-neXtaw or --without-neXtaw was given.
10266 if test "${with_neXtaw+set}" = set; then
10267   withval="$with_neXtaw"
10268
10269 fi;
10270 if test "$withval" = yes ; then
10271         cf_x_athena=neXtaw
10272         echo "$as_me:10272: result: yes" >&5
10273 echo "${ECHO_T}yes" >&6
10274 else
10275         echo "$as_me:10275: result: no" >&5
10276 echo "${ECHO_T}no" >&6
10277 fi
10278
10279 echo "$as_me:10279: checking if you want to link with Athena-Plus library" >&5
10280 echo $ECHO_N "checking if you want to link with Athena-Plus library... $ECHO_C" >&6
10281 withval=
10282
10283 # Check whether --with-XawPlus or --without-XawPlus was given.
10284 if test "${with_XawPlus+set}" = set; then
10285   withval="$with_XawPlus"
10286
10287 fi;
10288 if test "$withval" = yes ; then
10289         cf_x_athena=XawPlus
10290         echo "$as_me:10290: result: yes" >&5
10291 echo "${ECHO_T}yes" >&6
10292 else
10293         echo "$as_me:10293: result: no" >&5
10294 echo "${ECHO_T}no" >&6
10295 fi
10296
10297 cf_x_athena_lib=""
10298
10299 if test "$PKG_CONFIG" != none ; then
10300         cf_athena_list=
10301         test "$cf_x_athena" = Xaw && cf_athena_list="xaw8 xaw7 xaw6"
10302         for cf_athena_pkg in \
10303                 $cf_athena_list \
10304                 ${cf_x_athena} \
10305                 ${cf_x_athena}-devel \
10306                 lib${cf_x_athena} \
10307                 lib${cf_x_athena}-devel
10308         do
10309
10310 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists $cf_athena_pkg; then
10311         test -n "$verbose" && echo "    found package $cf_athena_pkg" 1>&6
10312
10313 echo "${as_me:-configure}:10313: testing found package $cf_athena_pkg ..." 1>&5
10314
10315         cf_pkgconfig_incs="`$PKG_CONFIG --cflags $cf_athena_pkg 2>/dev/null`"
10316         cf_pkgconfig_libs="`$PKG_CONFIG --libs   $cf_athena_pkg 2>/dev/null`"
10317         test -n "$verbose" && echo "    package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs" 1>&6
10318
10319 echo "${as_me:-configure}:10319: testing package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs ..." 1>&5
10320
10321         test -n "$verbose" && echo "    package $cf_athena_pkg LIBS: $cf_pkgconfig_libs" 1>&6
10322
10323 echo "${as_me:-configure}:10323: testing package $cf_athena_pkg LIBS: $cf_pkgconfig_libs ..." 1>&5
10324
10325 cf_fix_cppflags=no
10326 cf_new_cflags=
10327 cf_new_cppflags=
10328 cf_new_extra_cppflags=
10329
10330 for cf_add_cflags in $cf_pkgconfig_incs
10331 do
10332 case $cf_fix_cppflags in
10333 (no)
10334         case $cf_add_cflags in
10335         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10336                 case $cf_add_cflags in
10337                 (-D*)
10338                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10339
10340                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10341                                 && test -z "${cf_tst_cflags}" \
10342                                 && cf_fix_cppflags=yes
10343
10344                         if test $cf_fix_cppflags = yes ; then
10345                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10346                                 continue
10347                         elif test "${cf_tst_cflags}" = "\"'" ; then
10348                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10349                                 continue
10350                         fi
10351                         ;;
10352                 esac
10353                 case "$CPPFLAGS" in
10354                 (*$cf_add_cflags)
10355                         ;;
10356                 (*)
10357                         case $cf_add_cflags in
10358                         (-D*)
10359                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10360
10361 CPPFLAGS=`echo "$CPPFLAGS" | \
10362         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10363                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10364
10365                                 ;;
10366                         esac
10367                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10368                         ;;
10369                 esac
10370                 ;;
10371         (*)
10372                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10373                 ;;
10374         esac
10375         ;;
10376 (yes)
10377         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10378
10379         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10380
10381         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10382                 && test -z "${cf_tst_cflags}" \
10383                 && cf_fix_cppflags=no
10384         ;;
10385 esac
10386 done
10387
10388 if test -n "$cf_new_cflags" ; then
10389
10390         CFLAGS="$CFLAGS $cf_new_cflags"
10391 fi
10392
10393 if test -n "$cf_new_cppflags" ; then
10394
10395         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10396 fi
10397
10398 if test -n "$cf_new_extra_cppflags" ; then
10399
10400         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10401 fi
10402
10403 cf_add_libs="$cf_pkgconfig_libs"
10404 # Filter out duplicates - this happens with badly-designed ".pc" files...
10405 for cf_add_1lib in $LIBS
10406 do
10407         for cf_add_2lib in $cf_add_libs
10408         do
10409                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
10410                 then
10411                         cf_add_1lib=
10412                         break
10413                 fi
10414         done
10415         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
10416 done
10417 LIBS="$cf_add_libs"
10418
10419                         cf_x_athena_lib="$cf_pkgconfig_libs"
10420
10421 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
10422
10423                         cat >>confdefs.h <<EOF
10424 #define $cf_x_athena_LIBS 1
10425 EOF
10426
10427         for cf_trim_lib in Xmu Xt X11
10428         do
10429                 case "$LIBS" in
10430                 (*-l$cf_trim_lib\ *-l$cf_trim_lib*)
10431                         LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
10432                         test -n "$verbose" && echo "    ..trimmed $LIBS" 1>&6
10433
10434 echo "${as_me:-configure}:10434: testing ..trimmed $LIBS ..." 1>&5
10435
10436                         ;;
10437                 esac
10438         done
10439
10440 echo "$as_me:10440: checking for usable $cf_x_athena/Xmu package" >&5
10441 echo $ECHO_N "checking for usable $cf_x_athena/Xmu package... $ECHO_C" >&6
10442 if test "${cf_cv_xaw_compat+set}" = set; then
10443   echo $ECHO_N "(cached) $ECHO_C" >&6
10444 else
10445
10446 cat >conftest.$ac_ext <<_ACEOF
10447 #line 10447 "configure"
10448 #include "confdefs.h"
10449
10450 #include <X11/Xmu/CharSet.h>
10451
10452 int
10453 main ()
10454 {
10455
10456 int check = XmuCompareISOLatin1("big", "small")
10457
10458   ;
10459   return 0;
10460 }
10461 _ACEOF
10462 rm -f conftest.$ac_objext conftest$ac_exeext
10463 if { (eval echo "$as_me:10463: \"$ac_link\"") >&5
10464   (eval $ac_link) 2>&5
10465   ac_status=$?
10466   echo "$as_me:10466: \$? = $ac_status" >&5
10467   (exit $ac_status); } &&
10468          { ac_try='test -s conftest$ac_exeext'
10469   { (eval echo "$as_me:10469: \"$ac_try\"") >&5
10470   (eval $ac_try) 2>&5
10471   ac_status=$?
10472   echo "$as_me:10472: \$? = $ac_status" >&5
10473   (exit $ac_status); }; }; then
10474   cf_cv_xaw_compat=yes
10475 else
10476   echo "$as_me: failed program was:" >&5
10477 cat conftest.$ac_ext >&5
10478 cf_cv_xaw_compat=no
10479 fi
10480 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10481 fi
10482 echo "$as_me:10482: result: $cf_cv_xaw_compat" >&5
10483 echo "${ECHO_T}$cf_cv_xaw_compat" >&6
10484
10485                         if test "$cf_cv_xaw_compat" = no
10486                         then
10487                                 # workaround for broken ".pc" files...
10488                                 case "$cf_x_athena_lib" in
10489                                 (*-lXmu*)
10490                                         ;;
10491                                 (*)
10492                                         test -n "$verbose" && echo "    work around broken package" 1>&6
10493
10494 echo "${as_me:-configure}:10494: testing work around broken package ..." 1>&5
10495
10496                                         cf_save_xmu="$LIBS"
10497                                         cf_first_lib=`echo "$cf_save_xmu" | sed -e 's/^  *//' -e 's/ .*//'`
10498
10499 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xmu; then
10500         test -n "$verbose" && echo "    found package xmu" 1>&6
10501
10502 echo "${as_me:-configure}:10502: testing found package xmu ..." 1>&5
10503
10504         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xmu 2>/dev/null`"
10505         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xmu 2>/dev/null`"
10506         test -n "$verbose" && echo "    package xmu CFLAGS: $cf_pkgconfig_incs" 1>&6
10507
10508 echo "${as_me:-configure}:10508: testing package xmu CFLAGS: $cf_pkgconfig_incs ..." 1>&5
10509
10510         test -n "$verbose" && echo "    package xmu LIBS: $cf_pkgconfig_libs" 1>&6
10511
10512 echo "${as_me:-configure}:10512: testing package xmu LIBS: $cf_pkgconfig_libs ..." 1>&5
10513
10514 cf_fix_cppflags=no
10515 cf_new_cflags=
10516 cf_new_cppflags=
10517 cf_new_extra_cppflags=
10518
10519 for cf_add_cflags in $cf_pkgconfig_incs
10520 do
10521 case $cf_fix_cppflags in
10522 (no)
10523         case $cf_add_cflags in
10524         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10525                 case $cf_add_cflags in
10526                 (-D*)
10527                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10528
10529                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10530                                 && test -z "${cf_tst_cflags}" \
10531                                 && cf_fix_cppflags=yes
10532
10533                         if test $cf_fix_cppflags = yes ; then
10534                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10535                                 continue
10536                         elif test "${cf_tst_cflags}" = "\"'" ; then
10537                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10538                                 continue
10539                         fi
10540                         ;;
10541                 esac
10542                 case "$CPPFLAGS" in
10543                 (*$cf_add_cflags)
10544                         ;;
10545                 (*)
10546                         case $cf_add_cflags in
10547                         (-D*)
10548                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10549
10550 CPPFLAGS=`echo "$CPPFLAGS" | \
10551         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10552                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10553
10554                                 ;;
10555                         esac
10556                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10557                         ;;
10558                 esac
10559                 ;;
10560         (*)
10561                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10562                 ;;
10563         esac
10564         ;;
10565 (yes)
10566         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10567
10568         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10569
10570         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10571                 && test -z "${cf_tst_cflags}" \
10572                 && cf_fix_cppflags=no
10573         ;;
10574 esac
10575 done
10576
10577 if test -n "$cf_new_cflags" ; then
10578
10579         CFLAGS="$CFLAGS $cf_new_cflags"
10580 fi
10581
10582 if test -n "$cf_new_cppflags" ; then
10583
10584         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10585 fi
10586
10587 if test -n "$cf_new_extra_cppflags" ; then
10588
10589         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10590 fi
10591
10592 cf_add_libs="$cf_pkgconfig_libs"
10593 # Filter out duplicates - this happens with badly-designed ".pc" files...
10594 for cf_add_1lib in $LIBS
10595 do
10596         for cf_add_2lib in $cf_add_libs
10597         do
10598                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
10599                 then
10600                         cf_add_1lib=
10601                         break
10602                 fi
10603         done
10604         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
10605 done
10606 LIBS="$cf_add_libs"
10607
10608                                                         LIBS="$cf_save_xmu"
10609
10610 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
10611
10612 echo "${as_me:-configure}:10612: testing ...before $LIBS ..." 1>&5
10613
10614 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib $cf_pkgconfig_libs %" -e 's%  % %g'`
10615 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
10616
10617 echo "${as_me:-configure}:10617: testing ...after  $LIBS ..." 1>&5
10618
10619 else
10620         cf_pkgconfig_incs=
10621         cf_pkgconfig_libs=
10622
10623 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
10624
10625 echo "${as_me:-configure}:10625: testing ...before $LIBS ..." 1>&5
10626
10627 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib -lXmu %" -e 's%  % %g'`
10628 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
10629
10630 echo "${as_me:-configure}:10630: testing ...after  $LIBS ..." 1>&5
10631
10632 fi
10633
10634         for cf_trim_lib in Xmu Xt X11
10635         do
10636                 case "$LIBS" in
10637                 (*-l$cf_trim_lib\ *-l$cf_trim_lib*)
10638                         LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
10639                         test -n "$verbose" && echo "    ..trimmed $LIBS" 1>&6
10640
10641 echo "${as_me:-configure}:10641: testing ..trimmed $LIBS ..." 1>&5
10642
10643                         ;;
10644                 esac
10645         done
10646
10647                                         ;;
10648                                 esac
10649                         fi
10650
10651                         break
10652 else
10653         cf_pkgconfig_incs=
10654         cf_pkgconfig_libs=
10655         :
10656 fi
10657
10658         done
10659 fi
10660
10661 if test -z "$cf_x_athena_lib" ; then
10662
10663 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists Xext; then
10664         test -n "$verbose" && echo "    found package Xext" 1>&6
10665
10666 echo "${as_me:-configure}:10666: testing found package Xext ..." 1>&5
10667
10668         cf_pkgconfig_incs="`$PKG_CONFIG --cflags Xext 2>/dev/null`"
10669         cf_pkgconfig_libs="`$PKG_CONFIG --libs   Xext 2>/dev/null`"
10670         test -n "$verbose" && echo "    package Xext CFLAGS: $cf_pkgconfig_incs" 1>&6
10671
10672 echo "${as_me:-configure}:10672: testing package Xext CFLAGS: $cf_pkgconfig_incs ..." 1>&5
10673
10674         test -n "$verbose" && echo "    package Xext LIBS: $cf_pkgconfig_libs" 1>&6
10675
10676 echo "${as_me:-configure}:10676: testing package Xext LIBS: $cf_pkgconfig_libs ..." 1>&5
10677
10678 cf_fix_cppflags=no
10679 cf_new_cflags=
10680 cf_new_cppflags=
10681 cf_new_extra_cppflags=
10682
10683 for cf_add_cflags in $cf_pkgconfig_incs
10684 do
10685 case $cf_fix_cppflags in
10686 (no)
10687         case $cf_add_cflags in
10688         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10689                 case $cf_add_cflags in
10690                 (-D*)
10691                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10692
10693                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10694                                 && test -z "${cf_tst_cflags}" \
10695                                 && cf_fix_cppflags=yes
10696
10697                         if test $cf_fix_cppflags = yes ; then
10698                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10699                                 continue
10700                         elif test "${cf_tst_cflags}" = "\"'" ; then
10701                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10702                                 continue
10703                         fi
10704                         ;;
10705                 esac
10706                 case "$CPPFLAGS" in
10707                 (*$cf_add_cflags)
10708                         ;;
10709                 (*)
10710                         case $cf_add_cflags in
10711                         (-D*)
10712                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10713
10714 CPPFLAGS=`echo "$CPPFLAGS" | \
10715         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10716                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10717
10718                                 ;;
10719                         esac
10720                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10721                         ;;
10722                 esac
10723                 ;;
10724         (*)
10725                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10726                 ;;
10727         esac
10728         ;;
10729 (yes)
10730         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10731
10732         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10733
10734         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10735                 && test -z "${cf_tst_cflags}" \
10736                 && cf_fix_cppflags=no
10737         ;;
10738 esac
10739 done
10740
10741 if test -n "$cf_new_cflags" ; then
10742
10743         CFLAGS="$CFLAGS $cf_new_cflags"
10744 fi
10745
10746 if test -n "$cf_new_cppflags" ; then
10747
10748         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10749 fi
10750
10751 if test -n "$cf_new_extra_cppflags" ; then
10752
10753         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10754 fi
10755
10756 cf_add_libs="$cf_pkgconfig_libs"
10757 # Filter out duplicates - this happens with badly-designed ".pc" files...
10758 for cf_add_1lib in $LIBS
10759 do
10760         for cf_add_2lib in $cf_add_libs
10761         do
10762                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
10763                 then
10764                         cf_add_1lib=
10765                         break
10766                 fi
10767         done
10768         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
10769 done
10770 LIBS="$cf_add_libs"
10771
10772         :
10773 else
10774         cf_pkgconfig_incs=
10775         cf_pkgconfig_libs=
10776
10777         echo "$as_me:10777: checking for XextCreateExtension in -lXext" >&5
10778 echo $ECHO_N "checking for XextCreateExtension in -lXext... $ECHO_C" >&6
10779 if test "${ac_cv_lib_Xext_XextCreateExtension+set}" = set; then
10780   echo $ECHO_N "(cached) $ECHO_C" >&6
10781 else
10782   ac_check_lib_save_LIBS=$LIBS
10783 LIBS="-lXext  $LIBS"
10784 cat >conftest.$ac_ext <<_ACEOF
10785 #line 10785 "configure"
10786 #include "confdefs.h"
10787
10788 /* Override any gcc2 internal prototype to avoid an error.  */
10789 #ifdef __cplusplus
10790 extern "C"
10791 #endif
10792 /* We use char because int might match the return type of a gcc2
10793    builtin and then its argument prototype would still apply.  */
10794 char XextCreateExtension ();
10795 int
10796 main ()
10797 {
10798 XextCreateExtension ();
10799   ;
10800   return 0;
10801 }
10802 _ACEOF
10803 rm -f conftest.$ac_objext conftest$ac_exeext
10804 if { (eval echo "$as_me:10804: \"$ac_link\"") >&5
10805   (eval $ac_link) 2>&5
10806   ac_status=$?
10807   echo "$as_me:10807: \$? = $ac_status" >&5
10808   (exit $ac_status); } &&
10809          { ac_try='test -s conftest$ac_exeext'
10810   { (eval echo "$as_me:10810: \"$ac_try\"") >&5
10811   (eval $ac_try) 2>&5
10812   ac_status=$?
10813   echo "$as_me:10813: \$? = $ac_status" >&5
10814   (exit $ac_status); }; }; then
10815   ac_cv_lib_Xext_XextCreateExtension=yes
10816 else
10817   echo "$as_me: failed program was:" >&5
10818 cat conftest.$ac_ext >&5
10819 ac_cv_lib_Xext_XextCreateExtension=no
10820 fi
10821 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10822 LIBS=$ac_check_lib_save_LIBS
10823 fi
10824 echo "$as_me:10824: result: $ac_cv_lib_Xext_XextCreateExtension" >&5
10825 echo "${ECHO_T}$ac_cv_lib_Xext_XextCreateExtension" >&6
10826 if test $ac_cv_lib_Xext_XextCreateExtension = yes; then
10827
10828 cf_add_libs="-lXext"
10829 # Filter out duplicates - this happens with badly-designed ".pc" files...
10830 for cf_add_1lib in $LIBS
10831 do
10832         for cf_add_2lib in $cf_add_libs
10833         do
10834                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
10835                 then
10836                         cf_add_1lib=
10837                         break
10838                 fi
10839         done
10840         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
10841 done
10842 LIBS="$cf_add_libs"
10843
10844 fi
10845
10846 fi
10847
10848 # OSX is schizoid about who owns /usr/X11 (old) versus /opt/X11 (new), and (and
10849 # in some cases has installed dummy files in the former, other cases replaced
10850 # it with a link to the new location).  This complicates the configure script.
10851 # Check for that pitfall, and recover using pkg-config
10852 #
10853 # If none of these are set, the configuration is almost certainly broken.
10854 if test -z "${X_CFLAGS}${X_PRE_LIBS}${X_LIBS}${X_EXTRA_LIBS}"
10855 then
10856
10857 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists x11; then
10858         test -n "$verbose" && echo "    found package x11" 1>&6
10859
10860 echo "${as_me:-configure}:10860: testing found package x11 ..." 1>&5
10861
10862         cf_pkgconfig_incs="`$PKG_CONFIG --cflags x11 2>/dev/null`"
10863         cf_pkgconfig_libs="`$PKG_CONFIG --libs   x11 2>/dev/null`"
10864         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
10865
10866 echo "${as_me:-configure}:10866: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
10867
10868         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
10869
10870 echo "${as_me:-configure}:10870: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
10871
10872 cf_fix_cppflags=no
10873 cf_new_cflags=
10874 cf_new_cppflags=
10875 cf_new_extra_cppflags=
10876
10877 for cf_add_cflags in $cf_pkgconfig_incs
10878 do
10879 case $cf_fix_cppflags in
10880 (no)
10881         case $cf_add_cflags in
10882         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10883                 case $cf_add_cflags in
10884                 (-D*)
10885                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10886
10887                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10888                                 && test -z "${cf_tst_cflags}" \
10889                                 && cf_fix_cppflags=yes
10890
10891                         if test $cf_fix_cppflags = yes ; then
10892                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10893                                 continue
10894                         elif test "${cf_tst_cflags}" = "\"'" ; then
10895                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10896                                 continue
10897                         fi
10898                         ;;
10899                 esac
10900                 case "$CPPFLAGS" in
10901                 (*$cf_add_cflags)
10902                         ;;
10903                 (*)
10904                         case $cf_add_cflags in
10905                         (-D*)
10906                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10907
10908 CPPFLAGS=`echo "$CPPFLAGS" | \
10909         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10910                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10911
10912                                 ;;
10913                         esac
10914                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10915                         ;;
10916                 esac
10917                 ;;
10918         (*)
10919                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10920                 ;;
10921         esac
10922         ;;
10923 (yes)
10924         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10925
10926         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10927
10928         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10929                 && test -z "${cf_tst_cflags}" \
10930                 && cf_fix_cppflags=no
10931         ;;
10932 esac
10933 done
10934
10935 if test -n "$cf_new_cflags" ; then
10936
10937         CFLAGS="$CFLAGS $cf_new_cflags"
10938 fi
10939
10940 if test -n "$cf_new_cppflags" ; then
10941
10942         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10943 fi
10944
10945 if test -n "$cf_new_extra_cppflags" ; then
10946
10947         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10948 fi
10949
10950 cf_add_libs="$cf_pkgconfig_libs"
10951 # Filter out duplicates - this happens with badly-designed ".pc" files...
10952 for cf_add_1lib in $LIBS
10953 do
10954         for cf_add_2lib in $cf_add_libs
10955         do
10956                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
10957                 then
10958                         cf_add_1lib=
10959                         break
10960                 fi
10961         done
10962         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
10963 done
10964 LIBS="$cf_add_libs"
10965
10966         :
10967 else
10968         cf_pkgconfig_incs=
10969         cf_pkgconfig_libs=
10970         { echo "$as_me:10970: WARNING: unable to find X11 library" >&5
10971 echo "$as_me: WARNING: unable to find X11 library" >&2;}
10972 fi
10973
10974 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists ice; then
10975         test -n "$verbose" && echo "    found package ice" 1>&6
10976
10977 echo "${as_me:-configure}:10977: testing found package ice ..." 1>&5
10978
10979         cf_pkgconfig_incs="`$PKG_CONFIG --cflags ice 2>/dev/null`"
10980         cf_pkgconfig_libs="`$PKG_CONFIG --libs   ice 2>/dev/null`"
10981         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
10982
10983 echo "${as_me:-configure}:10983: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
10984
10985         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
10986
10987 echo "${as_me:-configure}:10987: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
10988
10989 cf_fix_cppflags=no
10990 cf_new_cflags=
10991 cf_new_cppflags=
10992 cf_new_extra_cppflags=
10993
10994 for cf_add_cflags in $cf_pkgconfig_incs
10995 do
10996 case $cf_fix_cppflags in
10997 (no)
10998         case $cf_add_cflags in
10999         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11000                 case $cf_add_cflags in
11001                 (-D*)
11002                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11003
11004                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11005                                 && test -z "${cf_tst_cflags}" \
11006                                 && cf_fix_cppflags=yes
11007
11008                         if test $cf_fix_cppflags = yes ; then
11009                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11010                                 continue
11011                         elif test "${cf_tst_cflags}" = "\"'" ; then
11012                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11013                                 continue
11014                         fi
11015                         ;;
11016                 esac
11017                 case "$CPPFLAGS" in
11018                 (*$cf_add_cflags)
11019                         ;;
11020                 (*)
11021                         case $cf_add_cflags in
11022                         (-D*)
11023                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11024
11025 CPPFLAGS=`echo "$CPPFLAGS" | \
11026         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11027                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11028
11029                                 ;;
11030                         esac
11031                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11032                         ;;
11033                 esac
11034                 ;;
11035         (*)
11036                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11037                 ;;
11038         esac
11039         ;;
11040 (yes)
11041         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11042
11043         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11044
11045         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11046                 && test -z "${cf_tst_cflags}" \
11047                 && cf_fix_cppflags=no
11048         ;;
11049 esac
11050 done
11051
11052 if test -n "$cf_new_cflags" ; then
11053
11054         CFLAGS="$CFLAGS $cf_new_cflags"
11055 fi
11056
11057 if test -n "$cf_new_cppflags" ; then
11058
11059         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11060 fi
11061
11062 if test -n "$cf_new_extra_cppflags" ; then
11063
11064         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11065 fi
11066
11067 cf_add_libs="$cf_pkgconfig_libs"
11068 # Filter out duplicates - this happens with badly-designed ".pc" files...
11069 for cf_add_1lib in $LIBS
11070 do
11071         for cf_add_2lib in $cf_add_libs
11072         do
11073                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11074                 then
11075                         cf_add_1lib=
11076                         break
11077                 fi
11078         done
11079         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11080 done
11081 LIBS="$cf_add_libs"
11082
11083         :
11084 else
11085         cf_pkgconfig_incs=
11086         cf_pkgconfig_libs=
11087         { echo "$as_me:11087: WARNING: unable to find ICE library" >&5
11088 echo "$as_me: WARNING: unable to find ICE library" >&2;}
11089 fi
11090
11091 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists sm; then
11092         test -n "$verbose" && echo "    found package sm" 1>&6
11093
11094 echo "${as_me:-configure}:11094: testing found package sm ..." 1>&5
11095
11096         cf_pkgconfig_incs="`$PKG_CONFIG --cflags sm 2>/dev/null`"
11097         cf_pkgconfig_libs="`$PKG_CONFIG --libs   sm 2>/dev/null`"
11098         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
11099
11100 echo "${as_me:-configure}:11100: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11101
11102         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
11103
11104 echo "${as_me:-configure}:11104: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
11105
11106 cf_fix_cppflags=no
11107 cf_new_cflags=
11108 cf_new_cppflags=
11109 cf_new_extra_cppflags=
11110
11111 for cf_add_cflags in $cf_pkgconfig_incs
11112 do
11113 case $cf_fix_cppflags in
11114 (no)
11115         case $cf_add_cflags in
11116         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11117                 case $cf_add_cflags in
11118                 (-D*)
11119                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11120
11121                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11122                                 && test -z "${cf_tst_cflags}" \
11123                                 && cf_fix_cppflags=yes
11124
11125                         if test $cf_fix_cppflags = yes ; then
11126                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11127                                 continue
11128                         elif test "${cf_tst_cflags}" = "\"'" ; then
11129                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11130                                 continue
11131                         fi
11132                         ;;
11133                 esac
11134                 case "$CPPFLAGS" in
11135                 (*$cf_add_cflags)
11136                         ;;
11137                 (*)
11138                         case $cf_add_cflags in
11139                         (-D*)
11140                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11141
11142 CPPFLAGS=`echo "$CPPFLAGS" | \
11143         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11144                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11145
11146                                 ;;
11147                         esac
11148                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11149                         ;;
11150                 esac
11151                 ;;
11152         (*)
11153                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11154                 ;;
11155         esac
11156         ;;
11157 (yes)
11158         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11159
11160         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11161
11162         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11163                 && test -z "${cf_tst_cflags}" \
11164                 && cf_fix_cppflags=no
11165         ;;
11166 esac
11167 done
11168
11169 if test -n "$cf_new_cflags" ; then
11170
11171         CFLAGS="$CFLAGS $cf_new_cflags"
11172 fi
11173
11174 if test -n "$cf_new_cppflags" ; then
11175
11176         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11177 fi
11178
11179 if test -n "$cf_new_extra_cppflags" ; then
11180
11181         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11182 fi
11183
11184 cf_add_libs="$cf_pkgconfig_libs"
11185 # Filter out duplicates - this happens with badly-designed ".pc" files...
11186 for cf_add_1lib in $LIBS
11187 do
11188         for cf_add_2lib in $cf_add_libs
11189         do
11190                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11191                 then
11192                         cf_add_1lib=
11193                         break
11194                 fi
11195         done
11196         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11197 done
11198 LIBS="$cf_add_libs"
11199
11200         :
11201 else
11202         cf_pkgconfig_incs=
11203         cf_pkgconfig_libs=
11204         { echo "$as_me:11204: WARNING: unable to find SM library" >&5
11205 echo "$as_me: WARNING: unable to find SM library" >&2;}
11206 fi
11207
11208 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xt; then
11209         test -n "$verbose" && echo "    found package xt" 1>&6
11210
11211 echo "${as_me:-configure}:11211: testing found package xt ..." 1>&5
11212
11213         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xt 2>/dev/null`"
11214         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xt 2>/dev/null`"
11215         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
11216
11217 echo "${as_me:-configure}:11217: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11218
11219         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
11220
11221 echo "${as_me:-configure}:11221: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
11222
11223 cf_fix_cppflags=no
11224 cf_new_cflags=
11225 cf_new_cppflags=
11226 cf_new_extra_cppflags=
11227
11228 for cf_add_cflags in $cf_pkgconfig_incs
11229 do
11230 case $cf_fix_cppflags in
11231 (no)
11232         case $cf_add_cflags in
11233         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11234                 case $cf_add_cflags in
11235                 (-D*)
11236                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11237
11238                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11239                                 && test -z "${cf_tst_cflags}" \
11240                                 && cf_fix_cppflags=yes
11241
11242                         if test $cf_fix_cppflags = yes ; then
11243                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11244                                 continue
11245                         elif test "${cf_tst_cflags}" = "\"'" ; then
11246                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11247                                 continue
11248                         fi
11249                         ;;
11250                 esac
11251                 case "$CPPFLAGS" in
11252                 (*$cf_add_cflags)
11253                         ;;
11254                 (*)
11255                         case $cf_add_cflags in
11256                         (-D*)
11257                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11258
11259 CPPFLAGS=`echo "$CPPFLAGS" | \
11260         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11261                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11262
11263                                 ;;
11264                         esac
11265                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11266                         ;;
11267                 esac
11268                 ;;
11269         (*)
11270                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11271                 ;;
11272         esac
11273         ;;
11274 (yes)
11275         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11276
11277         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11278
11279         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11280                 && test -z "${cf_tst_cflags}" \
11281                 && cf_fix_cppflags=no
11282         ;;
11283 esac
11284 done
11285
11286 if test -n "$cf_new_cflags" ; then
11287
11288         CFLAGS="$CFLAGS $cf_new_cflags"
11289 fi
11290
11291 if test -n "$cf_new_cppflags" ; then
11292
11293         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11294 fi
11295
11296 if test -n "$cf_new_extra_cppflags" ; then
11297
11298         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11299 fi
11300
11301 cf_add_libs="$cf_pkgconfig_libs"
11302 # Filter out duplicates - this happens with badly-designed ".pc" files...
11303 for cf_add_1lib in $LIBS
11304 do
11305         for cf_add_2lib in $cf_add_libs
11306         do
11307                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11308                 then
11309                         cf_add_1lib=
11310                         break
11311                 fi
11312         done
11313         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11314 done
11315 LIBS="$cf_add_libs"
11316
11317         :
11318 else
11319         cf_pkgconfig_incs=
11320         cf_pkgconfig_libs=
11321         { echo "$as_me:11321: WARNING: unable to find Xt library" >&5
11322 echo "$as_me: WARNING: unable to find Xt library" >&2;}
11323 fi
11324
11325 fi
11326
11327 cf_have_X_LIBS=no
11328
11329 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xt; then
11330         test -n "$verbose" && echo "    found package xt" 1>&6
11331
11332 echo "${as_me:-configure}:11332: testing found package xt ..." 1>&5
11333
11334         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xt 2>/dev/null`"
11335         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xt 2>/dev/null`"
11336         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
11337
11338 echo "${as_me:-configure}:11338: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11339
11340         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
11341
11342 echo "${as_me:-configure}:11342: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
11343
11344 cf_fix_cppflags=no
11345 cf_new_cflags=
11346 cf_new_cppflags=
11347 cf_new_extra_cppflags=
11348
11349 for cf_add_cflags in $cf_pkgconfig_incs
11350 do
11351 case $cf_fix_cppflags in
11352 (no)
11353         case $cf_add_cflags in
11354         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11355                 case $cf_add_cflags in
11356                 (-D*)
11357                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11358
11359                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11360                                 && test -z "${cf_tst_cflags}" \
11361                                 && cf_fix_cppflags=yes
11362
11363                         if test $cf_fix_cppflags = yes ; then
11364                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11365                                 continue
11366                         elif test "${cf_tst_cflags}" = "\"'" ; then
11367                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11368                                 continue
11369                         fi
11370                         ;;
11371                 esac
11372                 case "$CPPFLAGS" in
11373                 (*$cf_add_cflags)
11374                         ;;
11375                 (*)
11376                         case $cf_add_cflags in
11377                         (-D*)
11378                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11379
11380 CPPFLAGS=`echo "$CPPFLAGS" | \
11381         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11382                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11383
11384                                 ;;
11385                         esac
11386                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11387                         ;;
11388                 esac
11389                 ;;
11390         (*)
11391                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11392                 ;;
11393         esac
11394         ;;
11395 (yes)
11396         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11397
11398         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11399
11400         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11401                 && test -z "${cf_tst_cflags}" \
11402                 && cf_fix_cppflags=no
11403         ;;
11404 esac
11405 done
11406
11407 if test -n "$cf_new_cflags" ; then
11408
11409         CFLAGS="$CFLAGS $cf_new_cflags"
11410 fi
11411
11412 if test -n "$cf_new_cppflags" ; then
11413
11414         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11415 fi
11416
11417 if test -n "$cf_new_extra_cppflags" ; then
11418
11419         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11420 fi
11421
11422 cf_add_libs="$cf_pkgconfig_libs"
11423 # Filter out duplicates - this happens with badly-designed ".pc" files...
11424 for cf_add_1lib in $LIBS
11425 do
11426         for cf_add_2lib in $cf_add_libs
11427         do
11428                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11429                 then
11430                         cf_add_1lib=
11431                         break
11432                 fi
11433         done
11434         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11435 done
11436 LIBS="$cf_add_libs"
11437
11438         case "x$LIBS" in
11439         (*-lX11*)
11440                 ;;
11441         (*)
11442 # we have an "xt" package, but it may omit Xt's dependency on X11
11443 echo "$as_me:11443: checking for usable X dependency" >&5
11444 echo $ECHO_N "checking for usable X dependency... $ECHO_C" >&6
11445 if test "${cf_cv_xt_x11_compat+set}" = set; then
11446   echo $ECHO_N "(cached) $ECHO_C" >&6
11447 else
11448
11449 cat >conftest.$ac_ext <<_ACEOF
11450 #line 11450 "configure"
11451 #include "confdefs.h"
11452
11453 #include <X11/Xlib.h>
11454
11455 int
11456 main ()
11457 {
11458
11459         int rc1 = XDrawLine((Display*) 0, (Drawable) 0, (GC) 0, 0, 0, 0, 0);
11460         int rc2 = XClearWindow((Display*) 0, (Window) 0);
11461         int rc3 = XMoveWindow((Display*) 0, (Window) 0, 0, 0);
11462         int rc4 = XMoveResizeWindow((Display*)0, (Window)0, 0, 0, 0, 0);
11463
11464   ;
11465   return 0;
11466 }
11467 _ACEOF
11468 rm -f conftest.$ac_objext conftest$ac_exeext
11469 if { (eval echo "$as_me:11469: \"$ac_link\"") >&5
11470   (eval $ac_link) 2>&5
11471   ac_status=$?
11472   echo "$as_me:11472: \$? = $ac_status" >&5
11473   (exit $ac_status); } &&
11474          { ac_try='test -s conftest$ac_exeext'
11475   { (eval echo "$as_me:11475: \"$ac_try\"") >&5
11476   (eval $ac_try) 2>&5
11477   ac_status=$?
11478   echo "$as_me:11478: \$? = $ac_status" >&5
11479   (exit $ac_status); }; }; then
11480   cf_cv_xt_x11_compat=yes
11481 else
11482   echo "$as_me: failed program was:" >&5
11483 cat conftest.$ac_ext >&5
11484 cf_cv_xt_x11_compat=no
11485 fi
11486 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11487 fi
11488 echo "$as_me:11488: result: $cf_cv_xt_x11_compat" >&5
11489 echo "${ECHO_T}$cf_cv_xt_x11_compat" >&6
11490                 if test "$cf_cv_xt_x11_compat" = no
11491                 then
11492                         test -n "$verbose" && echo "    work around broken X11 dependency" 1>&6
11493
11494 echo "${as_me:-configure}:11494: testing work around broken X11 dependency ..." 1>&5
11495
11496                         # 2010/11/19 - good enough until a working Xt on Xcb is delivered.
11497
11498 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists x11; then
11499         test -n "$verbose" && echo "    found package x11" 1>&6
11500
11501 echo "${as_me:-configure}:11501: testing found package x11 ..." 1>&5
11502
11503         cf_pkgconfig_incs="`$PKG_CONFIG --cflags x11 2>/dev/null`"
11504         cf_pkgconfig_libs="`$PKG_CONFIG --libs   x11 2>/dev/null`"
11505         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
11506
11507 echo "${as_me:-configure}:11507: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11508
11509         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
11510
11511 echo "${as_me:-configure}:11511: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
11512
11513 cf_fix_cppflags=no
11514 cf_new_cflags=
11515 cf_new_cppflags=
11516 cf_new_extra_cppflags=
11517
11518 for cf_add_cflags in $cf_pkgconfig_incs
11519 do
11520 case $cf_fix_cppflags in
11521 (no)
11522         case $cf_add_cflags in
11523         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11524                 case $cf_add_cflags in
11525                 (-D*)
11526                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11527
11528                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11529                                 && test -z "${cf_tst_cflags}" \
11530                                 && cf_fix_cppflags=yes
11531
11532                         if test $cf_fix_cppflags = yes ; then
11533                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11534                                 continue
11535                         elif test "${cf_tst_cflags}" = "\"'" ; then
11536                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11537                                 continue
11538                         fi
11539                         ;;
11540                 esac
11541                 case "$CPPFLAGS" in
11542                 (*$cf_add_cflags)
11543                         ;;
11544                 (*)
11545                         case $cf_add_cflags in
11546                         (-D*)
11547                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11548
11549 CPPFLAGS=`echo "$CPPFLAGS" | \
11550         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11551                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11552
11553                                 ;;
11554                         esac
11555                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11556                         ;;
11557                 esac
11558                 ;;
11559         (*)
11560                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11561                 ;;
11562         esac
11563         ;;
11564 (yes)
11565         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11566
11567         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11568
11569         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11570                 && test -z "${cf_tst_cflags}" \
11571                 && cf_fix_cppflags=no
11572         ;;
11573 esac
11574 done
11575
11576 if test -n "$cf_new_cflags" ; then
11577
11578         CFLAGS="$CFLAGS $cf_new_cflags"
11579 fi
11580
11581 if test -n "$cf_new_cppflags" ; then
11582
11583         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11584 fi
11585
11586 if test -n "$cf_new_extra_cppflags" ; then
11587
11588         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11589 fi
11590
11591 cf_add_libs="$cf_pkgconfig_libs"
11592 # Filter out duplicates - this happens with badly-designed ".pc" files...
11593 for cf_add_1lib in $LIBS
11594 do
11595         for cf_add_2lib in $cf_add_libs
11596         do
11597                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11598                 then
11599                         cf_add_1lib=
11600                         break
11601                 fi
11602         done
11603         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11604 done
11605 LIBS="$cf_add_libs"
11606
11607         :
11608 else
11609         cf_pkgconfig_incs=
11610         cf_pkgconfig_libs=
11611
11612 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
11613
11614 echo "${as_me:-configure}:11614: testing ...before $LIBS ..." 1>&5
11615
11616 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%-lXt %-lXt -lX11 %" -e 's%  % %g'`
11617 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
11618
11619 echo "${as_me:-configure}:11619: testing ...after  $LIBS ..." 1>&5
11620
11621 fi
11622
11623                 fi
11624                 ;;
11625         esac
11626
11627 echo "$as_me:11627: checking for usable X Toolkit package" >&5
11628 echo $ECHO_N "checking for usable X Toolkit package... $ECHO_C" >&6
11629 if test "${cf_cv_xt_ice_compat+set}" = set; then
11630   echo $ECHO_N "(cached) $ECHO_C" >&6
11631 else
11632
11633 cat >conftest.$ac_ext <<_ACEOF
11634 #line 11634 "configure"
11635 #include "confdefs.h"
11636
11637 #include <X11/Shell.h>
11638
11639 int
11640 main ()
11641 {
11642 int num = IceConnectionNumber(0)
11643
11644   ;
11645   return 0;
11646 }
11647 _ACEOF
11648 rm -f conftest.$ac_objext conftest$ac_exeext
11649 if { (eval echo "$as_me:11649: \"$ac_link\"") >&5
11650   (eval $ac_link) 2>&5
11651   ac_status=$?
11652   echo "$as_me:11652: \$? = $ac_status" >&5
11653   (exit $ac_status); } &&
11654          { ac_try='test -s conftest$ac_exeext'
11655   { (eval echo "$as_me:11655: \"$ac_try\"") >&5
11656   (eval $ac_try) 2>&5
11657   ac_status=$?
11658   echo "$as_me:11658: \$? = $ac_status" >&5
11659   (exit $ac_status); }; }; then
11660   cf_cv_xt_ice_compat=yes
11661 else
11662   echo "$as_me: failed program was:" >&5
11663 cat conftest.$ac_ext >&5
11664 cf_cv_xt_ice_compat=no
11665 fi
11666 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11667 fi
11668 echo "$as_me:11668: result: $cf_cv_xt_ice_compat" >&5
11669 echo "${ECHO_T}$cf_cv_xt_ice_compat" >&6
11670
11671         if test "$cf_cv_xt_ice_compat" = no
11672         then
11673                 # workaround for broken ".pc" files used for X Toolkit.
11674                 case "x$X_PRE_LIBS" in
11675                 (*-lICE*)
11676                         case "x$LIBS" in
11677                         (*-lICE*)
11678                                 ;;
11679                         (*)
11680                                 test -n "$verbose" && echo "    work around broken ICE dependency" 1>&6
11681
11682 echo "${as_me:-configure}:11682: testing work around broken ICE dependency ..." 1>&5
11683
11684 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists ice; then
11685         test -n "$verbose" && echo "    found package ice" 1>&6
11686
11687 echo "${as_me:-configure}:11687: testing found package ice ..." 1>&5
11688
11689         cf_pkgconfig_incs="`$PKG_CONFIG --cflags ice 2>/dev/null`"
11690         cf_pkgconfig_libs="`$PKG_CONFIG --libs   ice 2>/dev/null`"
11691         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
11692
11693 echo "${as_me:-configure}:11693: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11694
11695         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
11696
11697 echo "${as_me:-configure}:11697: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
11698
11699 cf_fix_cppflags=no
11700 cf_new_cflags=
11701 cf_new_cppflags=
11702 cf_new_extra_cppflags=
11703
11704 for cf_add_cflags in $cf_pkgconfig_incs
11705 do
11706 case $cf_fix_cppflags in
11707 (no)
11708         case $cf_add_cflags in
11709         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11710                 case $cf_add_cflags in
11711                 (-D*)
11712                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11713
11714                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11715                                 && test -z "${cf_tst_cflags}" \
11716                                 && cf_fix_cppflags=yes
11717
11718                         if test $cf_fix_cppflags = yes ; then
11719                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11720                                 continue
11721                         elif test "${cf_tst_cflags}" = "\"'" ; then
11722                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11723                                 continue
11724                         fi
11725                         ;;
11726                 esac
11727                 case "$CPPFLAGS" in
11728                 (*$cf_add_cflags)
11729                         ;;
11730                 (*)
11731                         case $cf_add_cflags in
11732                         (-D*)
11733                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11734
11735 CPPFLAGS=`echo "$CPPFLAGS" | \
11736         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11737                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11738
11739                                 ;;
11740                         esac
11741                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11742                         ;;
11743                 esac
11744                 ;;
11745         (*)
11746                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11747                 ;;
11748         esac
11749         ;;
11750 (yes)
11751         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11752
11753         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11754
11755         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11756                 && test -z "${cf_tst_cflags}" \
11757                 && cf_fix_cppflags=no
11758         ;;
11759 esac
11760 done
11761
11762 if test -n "$cf_new_cflags" ; then
11763
11764         CFLAGS="$CFLAGS $cf_new_cflags"
11765 fi
11766
11767 if test -n "$cf_new_cppflags" ; then
11768
11769         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11770 fi
11771
11772 if test -n "$cf_new_extra_cppflags" ; then
11773
11774         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11775 fi
11776
11777 cf_add_libs="$cf_pkgconfig_libs"
11778 # Filter out duplicates - this happens with badly-designed ".pc" files...
11779 for cf_add_1lib in $LIBS
11780 do
11781         for cf_add_2lib in $cf_add_libs
11782         do
11783                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11784                 then
11785                         cf_add_1lib=
11786                         break
11787                 fi
11788         done
11789         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11790 done
11791 LIBS="$cf_add_libs"
11792
11793 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists sm; then
11794         test -n "$verbose" && echo "    found package sm" 1>&6
11795
11796 echo "${as_me:-configure}:11796: testing found package sm ..." 1>&5
11797
11798         cf_pkgconfig_incs="`$PKG_CONFIG --cflags sm 2>/dev/null`"
11799         cf_pkgconfig_libs="`$PKG_CONFIG --libs   sm 2>/dev/null`"
11800         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
11801
11802 echo "${as_me:-configure}:11802: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11803
11804         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
11805
11806 echo "${as_me:-configure}:11806: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
11807
11808 cf_fix_cppflags=no
11809 cf_new_cflags=
11810 cf_new_cppflags=
11811 cf_new_extra_cppflags=
11812
11813 for cf_add_cflags in $cf_pkgconfig_incs
11814 do
11815 case $cf_fix_cppflags in
11816 (no)
11817         case $cf_add_cflags in
11818         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11819                 case $cf_add_cflags in
11820                 (-D*)
11821                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11822
11823                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11824                                 && test -z "${cf_tst_cflags}" \
11825                                 && cf_fix_cppflags=yes
11826
11827                         if test $cf_fix_cppflags = yes ; then
11828                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11829                                 continue
11830                         elif test "${cf_tst_cflags}" = "\"'" ; then
11831                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11832                                 continue
11833                         fi
11834                         ;;
11835                 esac
11836                 case "$CPPFLAGS" in
11837                 (*$cf_add_cflags)
11838                         ;;
11839                 (*)
11840                         case $cf_add_cflags in
11841                         (-D*)
11842                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11843
11844 CPPFLAGS=`echo "$CPPFLAGS" | \
11845         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11846                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11847
11848                                 ;;
11849                         esac
11850                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11851                         ;;
11852                 esac
11853                 ;;
11854         (*)
11855                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11856                 ;;
11857         esac
11858         ;;
11859 (yes)
11860         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11861
11862         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11863
11864         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11865                 && test -z "${cf_tst_cflags}" \
11866                 && cf_fix_cppflags=no
11867         ;;
11868 esac
11869 done
11870
11871 if test -n "$cf_new_cflags" ; then
11872
11873         CFLAGS="$CFLAGS $cf_new_cflags"
11874 fi
11875
11876 if test -n "$cf_new_cppflags" ; then
11877
11878         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11879 fi
11880
11881 if test -n "$cf_new_extra_cppflags" ; then
11882
11883         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11884 fi
11885
11886 cf_add_libs="$cf_pkgconfig_libs"
11887 # Filter out duplicates - this happens with badly-designed ".pc" files...
11888 for cf_add_1lib in $LIBS
11889 do
11890         for cf_add_2lib in $cf_add_libs
11891         do
11892                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11893                 then
11894                         cf_add_1lib=
11895                         break
11896                 fi
11897         done
11898         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11899 done
11900 LIBS="$cf_add_libs"
11901
11902         :
11903 else
11904         cf_pkgconfig_incs=
11905         cf_pkgconfig_libs=
11906         :
11907 fi
11908
11909 else
11910         cf_pkgconfig_incs=
11911         cf_pkgconfig_libs=
11912
11913 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
11914
11915 echo "${as_me:-configure}:11915: testing ...before $LIBS ..." 1>&5
11916
11917 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%-lXt %-lXt $X_PRE_LIBS %" -e 's%  % %g'`
11918 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
11919
11920 echo "${as_me:-configure}:11920: testing ...after  $LIBS ..." 1>&5
11921
11922 fi
11923
11924                                 ;;
11925                         esac
11926                         ;;
11927                 esac
11928         fi
11929
11930         cf_have_X_LIBS=yes
11931
11932 else
11933         cf_pkgconfig_incs=
11934         cf_pkgconfig_libs=
11935
11936         LDFLAGS="$X_LIBS $LDFLAGS"
11937
11938 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
11939
11940 echo "${as_me:-configure}:11940: testing checking additions to CFLAGS ..." 1>&5
11941
11942 cf_check_cflags="$CFLAGS"
11943 cf_check_cppflags="$CPPFLAGS"
11944
11945 cf_fix_cppflags=no
11946 cf_new_cflags=
11947 cf_new_cppflags=
11948 cf_new_extra_cppflags=
11949
11950 for cf_add_cflags in $X_CFLAGS
11951 do
11952 case $cf_fix_cppflags in
11953 (no)
11954         case $cf_add_cflags in
11955         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11956                 case $cf_add_cflags in
11957                 (-D*)
11958                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11959
11960                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11961                                 && test -z "${cf_tst_cflags}" \
11962                                 && cf_fix_cppflags=yes
11963
11964                         if test $cf_fix_cppflags = yes ; then
11965                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11966                                 continue
11967                         elif test "${cf_tst_cflags}" = "\"'" ; then
11968                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11969                                 continue
11970                         fi
11971                         ;;
11972                 esac
11973                 case "$CPPFLAGS" in
11974                 (*$cf_add_cflags)
11975                         ;;
11976                 (*)
11977                         case $cf_add_cflags in
11978                         (-D*)
11979                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11980
11981 CPPFLAGS=`echo "$CPPFLAGS" | \
11982         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11983                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11984
11985                                 ;;
11986                         esac
11987                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11988                         ;;
11989                 esac
11990                 ;;
11991         (*)
11992                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11993                 ;;
11994         esac
11995         ;;
11996 (yes)
11997         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11998
11999         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12000
12001         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12002                 && test -z "${cf_tst_cflags}" \
12003                 && cf_fix_cppflags=no
12004         ;;
12005 esac
12006 done
12007
12008 if test -n "$cf_new_cflags" ; then
12009         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
12010
12011 echo "${as_me:-configure}:12011: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
12012
12013         CFLAGS="$CFLAGS $cf_new_cflags"
12014 fi
12015
12016 if test -n "$cf_new_cppflags" ; then
12017         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
12018
12019 echo "${as_me:-configure}:12019: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
12020
12021         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
12022 fi
12023
12024 if test -n "$cf_new_extra_cppflags" ; then
12025         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
12026
12027 echo "${as_me:-configure}:12027: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
12028
12029         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
12030 fi
12031
12032 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
12033 cat >conftest.$ac_ext <<_ACEOF
12034 #line 12034 "configure"
12035 #include "confdefs.h"
12036 #include <stdio.h>
12037 int
12038 main ()
12039 {
12040 printf("Hello world");
12041   ;
12042   return 0;
12043 }
12044 _ACEOF
12045 rm -f conftest.$ac_objext conftest$ac_exeext
12046 if { (eval echo "$as_me:12046: \"$ac_link\"") >&5
12047   (eval $ac_link) 2>&5
12048   ac_status=$?
12049   echo "$as_me:12049: \$? = $ac_status" >&5
12050   (exit $ac_status); } &&
12051          { ac_try='test -s conftest$ac_exeext'
12052   { (eval echo "$as_me:12052: \"$ac_try\"") >&5
12053   (eval $ac_try) 2>&5
12054   ac_status=$?
12055   echo "$as_me:12055: \$? = $ac_status" >&5
12056   (exit $ac_status); }; }; then
12057   :
12058 else
12059   echo "$as_me: failed program was:" >&5
12060 cat conftest.$ac_ext >&5
12061 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
12062
12063 echo "${as_me:-configure}:12063: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
12064
12065          if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
12066                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
12067
12068 echo "${as_me:-configure}:12068: testing but keeping change to \$CPPFLAGS ..." 1>&5
12069
12070          fi
12071          CFLAGS="$cf_check_flags"
12072 fi
12073 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12074 fi
12075
12076         echo "$as_me:12076: checking for XOpenDisplay" >&5
12077 echo $ECHO_N "checking for XOpenDisplay... $ECHO_C" >&6
12078 if test "${ac_cv_func_XOpenDisplay+set}" = set; then
12079   echo $ECHO_N "(cached) $ECHO_C" >&6
12080 else
12081   cat >conftest.$ac_ext <<_ACEOF
12082 #line 12082 "configure"
12083 #include "confdefs.h"
12084 /* System header to define __stub macros and hopefully few prototypes,
12085     which can conflict with char XOpenDisplay (); below.  */
12086 #include <assert.h>
12087 /* Override any gcc2 internal prototype to avoid an error.  */
12088 #ifdef __cplusplus
12089 extern "C"
12090 #endif
12091 /* We use char because int might match the return type of a gcc2
12092    builtin and then its argument prototype would still apply.  */
12093 char XOpenDisplay ();
12094 char (*f) ();
12095
12096 int
12097 main ()
12098 {
12099 /* The GNU C library defines this for functions which it implements
12100     to always fail with ENOSYS.  Some functions are actually named
12101     something starting with __ and the normal name is an alias.  */
12102 #if defined (__stub_XOpenDisplay) || defined (__stub___XOpenDisplay)
12103 choke me
12104 #else
12105 f = XOpenDisplay; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
12106 #endif
12107
12108   ;
12109   return 0;
12110 }
12111 _ACEOF
12112 rm -f conftest.$ac_objext conftest$ac_exeext
12113 if { (eval echo "$as_me:12113: \"$ac_link\"") >&5
12114   (eval $ac_link) 2>&5
12115   ac_status=$?
12116   echo "$as_me:12116: \$? = $ac_status" >&5
12117   (exit $ac_status); } &&
12118          { ac_try='test -s conftest$ac_exeext'
12119   { (eval echo "$as_me:12119: \"$ac_try\"") >&5
12120   (eval $ac_try) 2>&5
12121   ac_status=$?
12122   echo "$as_me:12122: \$? = $ac_status" >&5
12123   (exit $ac_status); }; }; then
12124   ac_cv_func_XOpenDisplay=yes
12125 else
12126   echo "$as_me: failed program was:" >&5
12127 cat conftest.$ac_ext >&5
12128 ac_cv_func_XOpenDisplay=no
12129 fi
12130 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12131 fi
12132 echo "$as_me:12132: result: $ac_cv_func_XOpenDisplay" >&5
12133 echo "${ECHO_T}$ac_cv_func_XOpenDisplay" >&6
12134 if test $ac_cv_func_XOpenDisplay = yes; then
12135   :
12136 else
12137
12138         echo "$as_me:12138: checking for XOpenDisplay in -lX11" >&5
12139 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
12140 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
12141   echo $ECHO_N "(cached) $ECHO_C" >&6
12142 else
12143   ac_check_lib_save_LIBS=$LIBS
12144 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
12145 cat >conftest.$ac_ext <<_ACEOF
12146 #line 12146 "configure"
12147 #include "confdefs.h"
12148
12149 /* Override any gcc2 internal prototype to avoid an error.  */
12150 #ifdef __cplusplus
12151 extern "C"
12152 #endif
12153 /* We use char because int might match the return type of a gcc2
12154    builtin and then its argument prototype would still apply.  */
12155 char XOpenDisplay ();
12156 int
12157 main ()
12158 {
12159 XOpenDisplay ();
12160   ;
12161   return 0;
12162 }
12163 _ACEOF
12164 rm -f conftest.$ac_objext conftest$ac_exeext
12165 if { (eval echo "$as_me:12165: \"$ac_link\"") >&5
12166   (eval $ac_link) 2>&5
12167   ac_status=$?
12168   echo "$as_me:12168: \$? = $ac_status" >&5
12169   (exit $ac_status); } &&
12170          { ac_try='test -s conftest$ac_exeext'
12171   { (eval echo "$as_me:12171: \"$ac_try\"") >&5
12172   (eval $ac_try) 2>&5
12173   ac_status=$?
12174   echo "$as_me:12174: \$? = $ac_status" >&5
12175   (exit $ac_status); }; }; then
12176   ac_cv_lib_X11_XOpenDisplay=yes
12177 else
12178   echo "$as_me: failed program was:" >&5
12179 cat conftest.$ac_ext >&5
12180 ac_cv_lib_X11_XOpenDisplay=no
12181 fi
12182 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12183 LIBS=$ac_check_lib_save_LIBS
12184 fi
12185 echo "$as_me:12185: result: $ac_cv_lib_X11_XOpenDisplay" >&5
12186 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
12187 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
12188
12189 cf_add_libs="-lX11"
12190 # Filter out duplicates - this happens with badly-designed ".pc" files...
12191 for cf_add_1lib in $LIBS
12192 do
12193         for cf_add_2lib in $cf_add_libs
12194         do
12195                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12196                 then
12197                         cf_add_1lib=
12198                         break
12199                 fi
12200         done
12201         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12202 done
12203 LIBS="$cf_add_libs"
12204
12205 fi
12206
12207 fi
12208
12209         echo "$as_me:12209: checking for XtAppInitialize" >&5
12210 echo $ECHO_N "checking for XtAppInitialize... $ECHO_C" >&6
12211 if test "${ac_cv_func_XtAppInitialize+set}" = set; then
12212   echo $ECHO_N "(cached) $ECHO_C" >&6
12213 else
12214   cat >conftest.$ac_ext <<_ACEOF
12215 #line 12215 "configure"
12216 #include "confdefs.h"
12217 /* System header to define __stub macros and hopefully few prototypes,
12218     which can conflict with char XtAppInitialize (); below.  */
12219 #include <assert.h>
12220 /* Override any gcc2 internal prototype to avoid an error.  */
12221 #ifdef __cplusplus
12222 extern "C"
12223 #endif
12224 /* We use char because int might match the return type of a gcc2
12225    builtin and then its argument prototype would still apply.  */
12226 char XtAppInitialize ();
12227 char (*f) ();
12228
12229 int
12230 main ()
12231 {
12232 /* The GNU C library defines this for functions which it implements
12233     to always fail with ENOSYS.  Some functions are actually named
12234     something starting with __ and the normal name is an alias.  */
12235 #if defined (__stub_XtAppInitialize) || defined (__stub___XtAppInitialize)
12236 choke me
12237 #else
12238 f = XtAppInitialize; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
12239 #endif
12240
12241   ;
12242   return 0;
12243 }
12244 _ACEOF
12245 rm -f conftest.$ac_objext conftest$ac_exeext
12246 if { (eval echo "$as_me:12246: \"$ac_link\"") >&5
12247   (eval $ac_link) 2>&5
12248   ac_status=$?
12249   echo "$as_me:12249: \$? = $ac_status" >&5
12250   (exit $ac_status); } &&
12251          { ac_try='test -s conftest$ac_exeext'
12252   { (eval echo "$as_me:12252: \"$ac_try\"") >&5
12253   (eval $ac_try) 2>&5
12254   ac_status=$?
12255   echo "$as_me:12255: \$? = $ac_status" >&5
12256   (exit $ac_status); }; }; then
12257   ac_cv_func_XtAppInitialize=yes
12258 else
12259   echo "$as_me: failed program was:" >&5
12260 cat conftest.$ac_ext >&5
12261 ac_cv_func_XtAppInitialize=no
12262 fi
12263 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12264 fi
12265 echo "$as_me:12265: result: $ac_cv_func_XtAppInitialize" >&5
12266 echo "${ECHO_T}$ac_cv_func_XtAppInitialize" >&6
12267 if test $ac_cv_func_XtAppInitialize = yes; then
12268   :
12269 else
12270
12271         echo "$as_me:12271: checking for XtAppInitialize in -lXt" >&5
12272 echo $ECHO_N "checking for XtAppInitialize in -lXt... $ECHO_C" >&6
12273 if test "${ac_cv_lib_Xt_XtAppInitialize+set}" = set; then
12274   echo $ECHO_N "(cached) $ECHO_C" >&6
12275 else
12276   ac_check_lib_save_LIBS=$LIBS
12277 LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
12278 cat >conftest.$ac_ext <<_ACEOF
12279 #line 12279 "configure"
12280 #include "confdefs.h"
12281
12282 /* Override any gcc2 internal prototype to avoid an error.  */
12283 #ifdef __cplusplus
12284 extern "C"
12285 #endif
12286 /* We use char because int might match the return type of a gcc2
12287    builtin and then its argument prototype would still apply.  */
12288 char XtAppInitialize ();
12289 int
12290 main ()
12291 {
12292 XtAppInitialize ();
12293   ;
12294   return 0;
12295 }
12296 _ACEOF
12297 rm -f conftest.$ac_objext conftest$ac_exeext
12298 if { (eval echo "$as_me:12298: \"$ac_link\"") >&5
12299   (eval $ac_link) 2>&5
12300   ac_status=$?
12301   echo "$as_me:12301: \$? = $ac_status" >&5
12302   (exit $ac_status); } &&
12303          { ac_try='test -s conftest$ac_exeext'
12304   { (eval echo "$as_me:12304: \"$ac_try\"") >&5
12305   (eval $ac_try) 2>&5
12306   ac_status=$?
12307   echo "$as_me:12307: \$? = $ac_status" >&5
12308   (exit $ac_status); }; }; then
12309   ac_cv_lib_Xt_XtAppInitialize=yes
12310 else
12311   echo "$as_me: failed program was:" >&5
12312 cat conftest.$ac_ext >&5
12313 ac_cv_lib_Xt_XtAppInitialize=no
12314 fi
12315 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12316 LIBS=$ac_check_lib_save_LIBS
12317 fi
12318 echo "$as_me:12318: result: $ac_cv_lib_Xt_XtAppInitialize" >&5
12319 echo "${ECHO_T}$ac_cv_lib_Xt_XtAppInitialize" >&6
12320 if test $ac_cv_lib_Xt_XtAppInitialize = yes; then
12321
12322 cat >>confdefs.h <<\EOF
12323 #define HAVE_LIBXT 1
12324 EOF
12325
12326                  cf_have_X_LIBS=Xt
12327                  LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS"
12328 fi
12329
12330 fi
12331
12332 fi
12333
12334 if test $cf_have_X_LIBS = no ; then
12335         { echo "$as_me:12335: WARNING: Unable to successfully link X Toolkit library (-lXt) with
12336 test program.  You will have to check and add the proper libraries by hand
12337 to makefile." >&5
12338 echo "$as_me: WARNING: Unable to successfully link X Toolkit library (-lXt) with
12339 test program.  You will have to check and add the proper libraries by hand
12340 to makefile." >&2;}
12341 fi
12342
12343 cf_x_athena_root=$cf_x_athena
12344 cf_x_athena_inc=""
12345
12346 for cf_path in default \
12347         /usr/contrib/X11R6 \
12348         /usr/contrib/X11R5 \
12349         /usr/lib/X11R5 \
12350         /usr/local
12351 do
12352         if test -z "$cf_x_athena_inc" ; then
12353                 cf_save="$CPPFLAGS"
12354                 cf_test=X11/$cf_x_athena_root/SimpleMenu.h
12355                 if test $cf_path != default ; then
12356                         CPPFLAGS="$cf_save -I$cf_path/include"
12357                         echo "$as_me:12357: checking for $cf_test in $cf_path" >&5
12358 echo $ECHO_N "checking for $cf_test in $cf_path... $ECHO_C" >&6
12359                 else
12360                         echo "$as_me:12360: checking for $cf_test" >&5
12361 echo $ECHO_N "checking for $cf_test... $ECHO_C" >&6
12362                 fi
12363                 cat >conftest.$ac_ext <<_ACEOF
12364 #line 12364 "configure"
12365 #include "confdefs.h"
12366
12367 #include <X11/Intrinsic.h>
12368 #include <$cf_test>
12369 int
12370 main ()
12371 {
12372
12373   ;
12374   return 0;
12375 }
12376 _ACEOF
12377 rm -f conftest.$ac_objext
12378 if { (eval echo "$as_me:12378: \"$ac_compile\"") >&5
12379   (eval $ac_compile) 2>&5
12380   ac_status=$?
12381   echo "$as_me:12381: \$? = $ac_status" >&5
12382   (exit $ac_status); } &&
12383          { ac_try='test -s conftest.$ac_objext'
12384   { (eval echo "$as_me:12384: \"$ac_try\"") >&5
12385   (eval $ac_try) 2>&5
12386   ac_status=$?
12387   echo "$as_me:12387: \$? = $ac_status" >&5
12388   (exit $ac_status); }; }; then
12389   cf_result=yes
12390 else
12391   echo "$as_me: failed program was:" >&5
12392 cat conftest.$ac_ext >&5
12393 cf_result=no
12394 fi
12395 rm -f conftest.$ac_objext conftest.$ac_ext
12396                 echo "$as_me:12396: result: $cf_result" >&5
12397 echo "${ECHO_T}$cf_result" >&6
12398                 if test "$cf_result" = yes ; then
12399                         cf_x_athena_inc=$cf_path
12400                         break
12401                 else
12402                         CPPFLAGS="$cf_save"
12403                 fi
12404         fi
12405 done
12406
12407 if test -z "$cf_x_athena_inc" ; then
12408         { echo "$as_me:12408: WARNING: Unable to successfully find Athena header files with test program" >&5
12409 echo "$as_me: WARNING: Unable to successfully find Athena header files with test program" >&2;}
12410 elif test "$cf_x_athena_inc" != default ; then
12411         CPPFLAGS="$CPPFLAGS -I$cf_x_athena_inc"
12412 fi
12413
12414 cf_x_athena_root=$cf_x_athena
12415 cf_x_athena_lib=""
12416
12417 for cf_path in default \
12418         /usr/contrib/X11R6 \
12419         /usr/contrib/X11R5 \
12420         /usr/lib/X11R5 \
12421         /usr/local
12422 do
12423         for cf_lib in \
12424                 ${cf_x_athena_root} \
12425                 ${cf_x_athena_root}7 \
12426                 ${cf_x_athena_root}6
12427         do
12428         for cf_libs in \
12429                 "-l$cf_lib -lXmu" \
12430                 "-l$cf_lib -lXpm -lXmu" \
12431                 "-l${cf_lib}_s -lXmu_s"
12432         do
12433                 if test -z "$cf_x_athena_lib" ; then
12434                         cf_save="$LIBS"
12435                         cf_test=XawSimpleMenuAddGlobalActions
12436                         if test $cf_path != default ; then
12437
12438 cf_add_libs="-L$cf_path/lib $cf_libs"
12439 # Filter out duplicates - this happens with badly-designed ".pc" files...
12440 for cf_add_1lib in $LIBS
12441 do
12442         for cf_add_2lib in $cf_add_libs
12443         do
12444                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12445                 then
12446                         cf_add_1lib=
12447                         break
12448                 fi
12449         done
12450         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12451 done
12452 LIBS="$cf_add_libs"
12453
12454                                 echo "$as_me:12454: checking for $cf_libs in $cf_path" >&5
12455 echo $ECHO_N "checking for $cf_libs in $cf_path... $ECHO_C" >&6
12456                         else
12457
12458 cf_add_libs="$cf_libs"
12459 # Filter out duplicates - this happens with badly-designed ".pc" files...
12460 for cf_add_1lib in $LIBS
12461 do
12462         for cf_add_2lib in $cf_add_libs
12463         do
12464                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12465                 then
12466                         cf_add_1lib=
12467                         break
12468                 fi
12469         done
12470         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12471 done
12472 LIBS="$cf_add_libs"
12473
12474                                 echo "$as_me:12474: checking for $cf_test in $cf_libs" >&5
12475 echo $ECHO_N "checking for $cf_test in $cf_libs... $ECHO_C" >&6
12476                         fi
12477                         cat >conftest.$ac_ext <<_ACEOF
12478 #line 12478 "configure"
12479 #include "confdefs.h"
12480
12481 #include <X11/Intrinsic.h>
12482 #include <X11/$cf_x_athena_root/SimpleMenu.h>
12483
12484 int
12485 main ()
12486 {
12487
12488 $cf_test((XtAppContext) 0)
12489   ;
12490   return 0;
12491 }
12492 _ACEOF
12493 rm -f conftest.$ac_objext conftest$ac_exeext
12494 if { (eval echo "$as_me:12494: \"$ac_link\"") >&5
12495   (eval $ac_link) 2>&5
12496   ac_status=$?
12497   echo "$as_me:12497: \$? = $ac_status" >&5
12498   (exit $ac_status); } &&
12499          { ac_try='test -s conftest$ac_exeext'
12500   { (eval echo "$as_me:12500: \"$ac_try\"") >&5
12501   (eval $ac_try) 2>&5
12502   ac_status=$?
12503   echo "$as_me:12503: \$? = $ac_status" >&5
12504   (exit $ac_status); }; }; then
12505   cf_result=yes
12506 else
12507   echo "$as_me: failed program was:" >&5
12508 cat conftest.$ac_ext >&5
12509 cf_result=no
12510 fi
12511 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12512                         echo "$as_me:12512: result: $cf_result" >&5
12513 echo "${ECHO_T}$cf_result" >&6
12514                         if test "$cf_result" = yes ; then
12515                                 cf_x_athena_lib="$cf_libs"
12516                                 break
12517                         fi
12518                         LIBS="$cf_save"
12519                 fi
12520         done # cf_libs
12521                 test -n "$cf_x_athena_lib" && break
12522         done # cf_lib
12523 done
12524
12525 if test -z "$cf_x_athena_lib" ; then
12526         { { echo "$as_me:12526: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&5
12527 echo "$as_me: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&2;}
12528    { (exit 1); exit 1; }; }
12529 fi
12530
12531 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
12532
12533 cat >>confdefs.h <<EOF
12534 #define $cf_x_athena_LIBS 1
12535 EOF
12536
12537 fi
12538
12539 if test -n "$ac_tool_prefix"; then
12540   for ac_prog in xcurses-config
12541   do
12542     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
12543 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
12544 echo "$as_me:12544: checking for $ac_word" >&5
12545 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
12546 if test "${ac_cv_prog_XCURSES_CONFIG+set}" = set; then
12547   echo $ECHO_N "(cached) $ECHO_C" >&6
12548 else
12549   if test -n "$XCURSES_CONFIG"; then
12550   ac_cv_prog_XCURSES_CONFIG="$XCURSES_CONFIG" # Let the user override the test.
12551 else
12552   ac_save_IFS=$IFS; IFS=$ac_path_separator
12553 ac_dummy="$PATH"
12554 for ac_dir in $ac_dummy; do
12555   IFS=$ac_save_IFS
12556   test -z "$ac_dir" && ac_dir=.
12557   $as_executable_p "$ac_dir/$ac_word" || continue
12558 ac_cv_prog_XCURSES_CONFIG="$ac_tool_prefix$ac_prog"
12559 echo "$as_me:12559: found $ac_dir/$ac_word" >&5
12560 break
12561 done
12562
12563 fi
12564 fi
12565 XCURSES_CONFIG=$ac_cv_prog_XCURSES_CONFIG
12566 if test -n "$XCURSES_CONFIG"; then
12567   echo "$as_me:12567: result: $XCURSES_CONFIG" >&5
12568 echo "${ECHO_T}$XCURSES_CONFIG" >&6
12569 else
12570   echo "$as_me:12570: result: no" >&5
12571 echo "${ECHO_T}no" >&6
12572 fi
12573
12574     test -n "$XCURSES_CONFIG" && break
12575   done
12576 fi
12577 if test -z "$XCURSES_CONFIG"; then
12578   ac_ct_XCURSES_CONFIG=$XCURSES_CONFIG
12579   for ac_prog in xcurses-config
12580 do
12581   # Extract the first word of "$ac_prog", so it can be a program name with args.
12582 set dummy $ac_prog; ac_word=$2
12583 echo "$as_me:12583: checking for $ac_word" >&5
12584 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
12585 if test "${ac_cv_prog_ac_ct_XCURSES_CONFIG+set}" = set; then
12586   echo $ECHO_N "(cached) $ECHO_C" >&6
12587 else
12588   if test -n "$ac_ct_XCURSES_CONFIG"; then
12589   ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_ct_XCURSES_CONFIG" # Let the user override the test.
12590 else
12591   ac_save_IFS=$IFS; IFS=$ac_path_separator
12592 ac_dummy="$PATH"
12593 for ac_dir in $ac_dummy; do
12594   IFS=$ac_save_IFS
12595   test -z "$ac_dir" && ac_dir=.
12596   $as_executable_p "$ac_dir/$ac_word" || continue
12597 ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_prog"
12598 echo "$as_me:12598: found $ac_dir/$ac_word" >&5
12599 break
12600 done
12601
12602 fi
12603 fi
12604 ac_ct_XCURSES_CONFIG=$ac_cv_prog_ac_ct_XCURSES_CONFIG
12605 if test -n "$ac_ct_XCURSES_CONFIG"; then
12606   echo "$as_me:12606: result: $ac_ct_XCURSES_CONFIG" >&5
12607 echo "${ECHO_T}$ac_ct_XCURSES_CONFIG" >&6
12608 else
12609   echo "$as_me:12609: result: no" >&5
12610 echo "${ECHO_T}no" >&6
12611 fi
12612
12613   test -n "$ac_ct_XCURSES_CONFIG" && break
12614 done
12615 test -n "$ac_ct_XCURSES_CONFIG" || ac_ct_XCURSES_CONFIG="none"
12616
12617   XCURSES_CONFIG=$ac_ct_XCURSES_CONFIG
12618 fi
12619
12620 if test "$XCURSES_CONFIG" != none ; then
12621
12622 CPPFLAGS="$CPPFLAGS `$XCURSES_CONFIG --cflags`"
12623
12624 cf_add_libs="`$XCURSES_CONFIG --libs`"
12625 # Filter out duplicates - this happens with badly-designed ".pc" files...
12626 for cf_add_1lib in $LIBS
12627 do
12628         for cf_add_2lib in $cf_add_libs
12629         do
12630                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12631                 then
12632                         cf_add_1lib=
12633                         break
12634                 fi
12635         done
12636         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12637 done
12638 LIBS="$cf_add_libs"
12639
12640 cf_cv_lib_XCurses=yes
12641
12642 else
12643
12644 LDFLAGS="$LDFLAGS $X_LIBS"
12645
12646 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
12647
12648 echo "${as_me:-configure}:12648: testing checking additions to CFLAGS ..." 1>&5
12649
12650 cf_check_cflags="$CFLAGS"
12651 cf_check_cppflags="$CPPFLAGS"
12652
12653 cf_fix_cppflags=no
12654 cf_new_cflags=
12655 cf_new_cppflags=
12656 cf_new_extra_cppflags=
12657
12658 for cf_add_cflags in $X_CFLAGS
12659 do
12660 case $cf_fix_cppflags in
12661 (no)
12662         case $cf_add_cflags in
12663         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12664                 case $cf_add_cflags in
12665                 (-D*)
12666                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12667
12668                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12669                                 && test -z "${cf_tst_cflags}" \
12670                                 && cf_fix_cppflags=yes
12671
12672                         if test $cf_fix_cppflags = yes ; then
12673                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12674                                 continue
12675                         elif test "${cf_tst_cflags}" = "\"'" ; then
12676                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12677                                 continue
12678                         fi
12679                         ;;
12680                 esac
12681                 case "$CPPFLAGS" in
12682                 (*$cf_add_cflags)
12683                         ;;
12684                 (*)
12685                         case $cf_add_cflags in
12686                         (-D*)
12687                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12688
12689 CPPFLAGS=`echo "$CPPFLAGS" | \
12690         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12691                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12692
12693                                 ;;
12694                         esac
12695                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
12696                         ;;
12697                 esac
12698                 ;;
12699         (*)
12700                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
12701                 ;;
12702         esac
12703         ;;
12704 (yes)
12705         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12706
12707         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12708
12709         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12710                 && test -z "${cf_tst_cflags}" \
12711                 && cf_fix_cppflags=no
12712         ;;
12713 esac
12714 done
12715
12716 if test -n "$cf_new_cflags" ; then
12717         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
12718
12719 echo "${as_me:-configure}:12719: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
12720
12721         CFLAGS="$CFLAGS $cf_new_cflags"
12722 fi
12723
12724 if test -n "$cf_new_cppflags" ; then
12725         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
12726
12727 echo "${as_me:-configure}:12727: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
12728
12729         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
12730 fi
12731
12732 if test -n "$cf_new_extra_cppflags" ; then
12733         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
12734
12735 echo "${as_me:-configure}:12735: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
12736
12737         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
12738 fi
12739
12740 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
12741 cat >conftest.$ac_ext <<_ACEOF
12742 #line 12742 "configure"
12743 #include "confdefs.h"
12744 #include <stdio.h>
12745 int
12746 main ()
12747 {
12748 printf("Hello world");
12749   ;
12750   return 0;
12751 }
12752 _ACEOF
12753 rm -f conftest.$ac_objext conftest$ac_exeext
12754 if { (eval echo "$as_me:12754: \"$ac_link\"") >&5
12755   (eval $ac_link) 2>&5
12756   ac_status=$?
12757   echo "$as_me:12757: \$? = $ac_status" >&5
12758   (exit $ac_status); } &&
12759          { ac_try='test -s conftest$ac_exeext'
12760   { (eval echo "$as_me:12760: \"$ac_try\"") >&5
12761   (eval $ac_try) 2>&5
12762   ac_status=$?
12763   echo "$as_me:12763: \$? = $ac_status" >&5
12764   (exit $ac_status); }; }; then
12765   :
12766 else
12767   echo "$as_me: failed program was:" >&5
12768 cat conftest.$ac_ext >&5
12769 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
12770
12771 echo "${as_me:-configure}:12771: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
12772
12773          if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
12774                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
12775
12776 echo "${as_me:-configure}:12776: testing but keeping change to \$CPPFLAGS ..." 1>&5
12777
12778          fi
12779          CFLAGS="$cf_check_flags"
12780 fi
12781 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12782 fi
12783
12784 echo "$as_me:12784: checking for XOpenDisplay in -lX11" >&5
12785 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
12786 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
12787   echo $ECHO_N "(cached) $ECHO_C" >&6
12788 else
12789   ac_check_lib_save_LIBS=$LIBS
12790 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
12791 cat >conftest.$ac_ext <<_ACEOF
12792 #line 12792 "configure"
12793 #include "confdefs.h"
12794
12795 /* Override any gcc2 internal prototype to avoid an error.  */
12796 #ifdef __cplusplus
12797 extern "C"
12798 #endif
12799 /* We use char because int might match the return type of a gcc2
12800    builtin and then its argument prototype would still apply.  */
12801 char XOpenDisplay ();
12802 int
12803 main ()
12804 {
12805 XOpenDisplay ();
12806   ;
12807   return 0;
12808 }
12809 _ACEOF
12810 rm -f conftest.$ac_objext conftest$ac_exeext
12811 if { (eval echo "$as_me:12811: \"$ac_link\"") >&5
12812   (eval $ac_link) 2>&5
12813   ac_status=$?
12814   echo "$as_me:12814: \$? = $ac_status" >&5
12815   (exit $ac_status); } &&
12816          { ac_try='test -s conftest$ac_exeext'
12817   { (eval echo "$as_me:12817: \"$ac_try\"") >&5
12818   (eval $ac_try) 2>&5
12819   ac_status=$?
12820   echo "$as_me:12820: \$? = $ac_status" >&5
12821   (exit $ac_status); }; }; then
12822   ac_cv_lib_X11_XOpenDisplay=yes
12823 else
12824   echo "$as_me: failed program was:" >&5
12825 cat conftest.$ac_ext >&5
12826 ac_cv_lib_X11_XOpenDisplay=no
12827 fi
12828 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12829 LIBS=$ac_check_lib_save_LIBS
12830 fi
12831 echo "$as_me:12831: result: $ac_cv_lib_X11_XOpenDisplay" >&5
12832 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
12833 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
12834
12835 cf_add_libs="-lX11"
12836 # Filter out duplicates - this happens with badly-designed ".pc" files...
12837 for cf_add_1lib in $LIBS
12838 do
12839         for cf_add_2lib in $cf_add_libs
12840         do
12841                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12842                 then
12843                         cf_add_1lib=
12844                         break
12845                 fi
12846         done
12847         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12848 done
12849 LIBS="$cf_add_libs"
12850
12851 fi
12852
12853 echo "$as_me:12853: checking for XCurses library" >&5
12854 echo $ECHO_N "checking for XCurses library... $ECHO_C" >&6
12855 if test "${cf_cv_lib_XCurses+set}" = set; then
12856   echo $ECHO_N "(cached) $ECHO_C" >&6
12857 else
12858
12859 cf_add_libs="-lXCurses"
12860 # Filter out duplicates - this happens with badly-designed ".pc" files...
12861 for cf_add_1lib in $LIBS
12862 do
12863         for cf_add_2lib in $cf_add_libs
12864         do
12865                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12866                 then
12867                         cf_add_1lib=
12868                         break
12869                 fi
12870         done
12871         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12872 done
12873 LIBS="$cf_add_libs"
12874
12875 cat >conftest.$ac_ext <<_ACEOF
12876 #line 12876 "configure"
12877 #include "confdefs.h"
12878
12879 #include <xcurses.h>
12880 char *XCursesProgramName = "test";
12881
12882 int
12883 main ()
12884 {
12885 XCursesExit();
12886   ;
12887   return 0;
12888 }
12889 _ACEOF
12890 rm -f conftest.$ac_objext conftest$ac_exeext
12891 if { (eval echo "$as_me:12891: \"$ac_link\"") >&5
12892   (eval $ac_link) 2>&5
12893   ac_status=$?
12894   echo "$as_me:12894: \$? = $ac_status" >&5
12895   (exit $ac_status); } &&
12896          { ac_try='test -s conftest$ac_exeext'
12897   { (eval echo "$as_me:12897: \"$ac_try\"") >&5
12898   (eval $ac_try) 2>&5
12899   ac_status=$?
12900   echo "$as_me:12900: \$? = $ac_status" >&5
12901   (exit $ac_status); }; }; then
12902   cf_cv_lib_XCurses=yes
12903 else
12904   echo "$as_me: failed program was:" >&5
12905 cat conftest.$ac_ext >&5
12906 cf_cv_lib_XCurses=no
12907 fi
12908 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12909
12910 fi
12911 echo "$as_me:12911: result: $cf_cv_lib_XCurses" >&5
12912 echo "${ECHO_T}$cf_cv_lib_XCurses" >&6
12913
12914 fi
12915
12916 if test $cf_cv_lib_XCurses = yes ; then
12917
12918 cat >>confdefs.h <<\EOF
12919 #define UNIX 1
12920 EOF
12921
12922 cat >>confdefs.h <<\EOF
12923 #define XCURSES 1
12924 EOF
12925
12926         echo "$as_me:12926: checking for xcurses.h" >&5
12927 echo $ECHO_N "checking for xcurses.h... $ECHO_C" >&6
12928 if test "${ac_cv_header_xcurses_h+set}" = set; then
12929   echo $ECHO_N "(cached) $ECHO_C" >&6
12930 else
12931   cat >conftest.$ac_ext <<_ACEOF
12932 #line 12932 "configure"
12933 #include "confdefs.h"
12934 #include <xcurses.h>
12935 _ACEOF
12936 if { (eval echo "$as_me:12936: \"$ac_cpp conftest.$ac_ext\"") >&5
12937   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
12938   ac_status=$?
12939   egrep -v '^ *\+' conftest.er1 >conftest.err
12940   rm -f conftest.er1
12941   cat conftest.err >&5
12942   echo "$as_me:12942: \$? = $ac_status" >&5
12943   (exit $ac_status); } >/dev/null; then
12944   if test -s conftest.err; then
12945     ac_cpp_err=$ac_c_preproc_warn_flag
12946   else
12947     ac_cpp_err=
12948   fi
12949 else
12950   ac_cpp_err=yes
12951 fi
12952 if test -z "$ac_cpp_err"; then
12953   ac_cv_header_xcurses_h=yes
12954 else
12955   echo "$as_me: failed program was:" >&5
12956   cat conftest.$ac_ext >&5
12957   ac_cv_header_xcurses_h=no
12958 fi
12959 rm -f conftest.err conftest.$ac_ext
12960 fi
12961 echo "$as_me:12961: result: $ac_cv_header_xcurses_h" >&5
12962 echo "${ECHO_T}$ac_cv_header_xcurses_h" >&6
12963 if test $ac_cv_header_xcurses_h = yes; then
12964
12965 cat >>confdefs.h <<\EOF
12966 #define HAVE_XCURSES 1
12967 EOF
12968
12969 fi
12970
12971 else
12972         { { echo "$as_me:12972: error: Cannot link with XCurses" >&5
12973 echo "$as_me: error: Cannot link with XCurses" >&2;}
12974    { (exit 1); exit 1; }; }
12975 fi
12976
12977         ;;
12978 (*)
12979         { { echo "$as_me:12979: error: unexpected screen-value: $cf_cv_screen" >&5
12980 echo "$as_me: error: unexpected screen-value: $cf_cv_screen" >&2;}
12981    { (exit 1); exit 1; }; }
12982         ;;
12983 esac
12984
12985 case $cf_cv_screen in
12986 (ncurses*)
12987         cf_cv_libtype=`echo "$cf_cv_screen" | sed -e 's/^ncurses//'`
12988         ;;
12989 (curses|curses_*)
12990
12991 echo "$as_me:12991: checking for NetBSD form.h" >&5
12992 echo $ECHO_N "checking for NetBSD form.h... $ECHO_C" >&6
12993 if test "${cf_cv_netbsd_form_h+set}" = set; then
12994   echo $ECHO_N "(cached) $ECHO_C" >&6
12995 else
12996
12997 cat >conftest.$ac_ext <<_ACEOF
12998 #line 12998 "configure"
12999 #include "confdefs.h"
13000
13001 #include <${cf_cv_ncurses_header:-curses.h}>
13002 #include <form.h>
13003
13004 int
13005 main ()
13006 {
13007
13008         FORM *form;
13009         int y = current_field(form)->cursor_ypos;
13010         int x = current_field(form)->cursor_xpos;
13011
13012   ;
13013   return 0;
13014 }
13015 _ACEOF
13016 rm -f conftest.$ac_objext
13017 if { (eval echo "$as_me:13017: \"$ac_compile\"") >&5
13018   (eval $ac_compile) 2>&5
13019   ac_status=$?
13020   echo "$as_me:13020: \$? = $ac_status" >&5
13021   (exit $ac_status); } &&
13022          { ac_try='test -s conftest.$ac_objext'
13023   { (eval echo "$as_me:13023: \"$ac_try\"") >&5
13024   (eval $ac_try) 2>&5
13025   ac_status=$?
13026   echo "$as_me:13026: \$? = $ac_status" >&5
13027   (exit $ac_status); }; }; then
13028   cf_cv_netbsd_form_h=yes
13029
13030 else
13031   echo "$as_me: failed program was:" >&5
13032 cat conftest.$ac_ext >&5
13033 cf_cv_netbsd_form_h=no
13034 fi
13035 rm -f conftest.$ac_objext conftest.$ac_ext
13036
13037 fi
13038 echo "$as_me:13038: result: $cf_cv_netbsd_form_h" >&5
13039 echo "${ECHO_T}$cf_cv_netbsd_form_h" >&6
13040
13041 test "$cf_cv_netbsd_form_h" = yes &&
13042 cat >>confdefs.h <<\EOF
13043 #define HAVE_NETBSD_FORM_H 1
13044 EOF
13045
13046 echo "$as_me:13046: checking for NetBSD menu.h" >&5
13047 echo $ECHO_N "checking for NetBSD menu.h... $ECHO_C" >&6
13048 if test "${cf_cv_netbsd_menu_h+set}" = set; then
13049   echo $ECHO_N "(cached) $ECHO_C" >&6
13050 else
13051
13052 cat >conftest.$ac_ext <<_ACEOF
13053 #line 13053 "configure"
13054 #include "confdefs.h"
13055
13056 #include <${cf_cv_ncurses_header:-curses.h}>
13057 #include <menu.h>
13058
13059 int
13060 main ()
13061 {
13062
13063         MENU *menu;
13064         int y = menu->max_item_width;
13065
13066   ;
13067   return 0;
13068 }
13069 _ACEOF
13070 rm -f conftest.$ac_objext
13071 if { (eval echo "$as_me:13071: \"$ac_compile\"") >&5
13072   (eval $ac_compile) 2>&5
13073   ac_status=$?
13074   echo "$as_me:13074: \$? = $ac_status" >&5
13075   (exit $ac_status); } &&
13076          { ac_try='test -s conftest.$ac_objext'
13077   { (eval echo "$as_me:13077: \"$ac_try\"") >&5
13078   (eval $ac_try) 2>&5
13079   ac_status=$?
13080   echo "$as_me:13080: \$? = $ac_status" >&5
13081   (exit $ac_status); }; }; then
13082   cf_cv_netbsd_menu_h=yes
13083
13084 else
13085   echo "$as_me: failed program was:" >&5
13086 cat conftest.$ac_ext >&5
13087 cf_cv_netbsd_menu_h=no
13088 fi
13089 rm -f conftest.$ac_objext conftest.$ac_ext
13090
13091 fi
13092 echo "$as_me:13092: result: $cf_cv_netbsd_menu_h" >&5
13093 echo "${ECHO_T}$cf_cv_netbsd_menu_h" >&6
13094
13095 test "$cf_cv_netbsd_menu_h" = yes &&
13096 cat >>confdefs.h <<\EOF
13097 #define HAVE_NETBSD_MENU_H 1
13098 EOF
13099
13100         ;;
13101 esac
13102
13103 case $cf_cv_screen in
13104 (pdcurses)
13105         ;;
13106 (*)
13107         # look for curses-related libraries
13108
13109 as_ac_Lib=`echo "ac_cv_lib_panel$cf_cv_libtype''_new_panel" | $as_tr_sh`
13110 echo "$as_me:13110: checking for new_panel in -lpanel$cf_cv_libtype" >&5
13111 echo $ECHO_N "checking for new_panel in -lpanel$cf_cv_libtype... $ECHO_C" >&6
13112 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
13113   echo $ECHO_N "(cached) $ECHO_C" >&6
13114 else
13115   ac_check_lib_save_LIBS=$LIBS
13116 LIBS="-lpanel$cf_cv_libtype  $LIBS"
13117 cat >conftest.$ac_ext <<_ACEOF
13118 #line 13118 "configure"
13119 #include "confdefs.h"
13120
13121 /* Override any gcc2 internal prototype to avoid an error.  */
13122 #ifdef __cplusplus
13123 extern "C"
13124 #endif
13125 /* We use char because int might match the return type of a gcc2
13126    builtin and then its argument prototype would still apply.  */
13127 char new_panel ();
13128 int
13129 main ()
13130 {
13131 new_panel ();
13132   ;
13133   return 0;
13134 }
13135 _ACEOF
13136 rm -f conftest.$ac_objext conftest$ac_exeext
13137 if { (eval echo "$as_me:13137: \"$ac_link\"") >&5
13138   (eval $ac_link) 2>&5
13139   ac_status=$?
13140   echo "$as_me:13140: \$? = $ac_status" >&5
13141   (exit $ac_status); } &&
13142          { ac_try='test -s conftest$ac_exeext'
13143   { (eval echo "$as_me:13143: \"$ac_try\"") >&5
13144   (eval $ac_try) 2>&5
13145   ac_status=$?
13146   echo "$as_me:13146: \$? = $ac_status" >&5
13147   (exit $ac_status); }; }; then
13148   eval "$as_ac_Lib=yes"
13149 else
13150   echo "$as_me: failed program was:" >&5
13151 cat conftest.$ac_ext >&5
13152 eval "$as_ac_Lib=no"
13153 fi
13154 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13155 LIBS=$ac_check_lib_save_LIBS
13156 fi
13157 echo "$as_me:13157: result: `eval echo '${'$as_ac_Lib'}'`" >&5
13158 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
13159 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
13160
13161 cf_upper=`echo "have_libpanel" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
13162
13163 cf_add_libs="-lpanel$cf_cv_libtype"
13164 # Filter out duplicates - this happens with badly-designed ".pc" files...
13165 for cf_add_1lib in $LIBS
13166 do
13167         for cf_add_2lib in $cf_add_libs
13168         do
13169                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13170                 then
13171                         cf_add_1lib=
13172                         break
13173                 fi
13174         done
13175         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13176 done
13177 LIBS="$cf_add_libs"
13178
13179 cat >>confdefs.h <<EOF
13180 #define $cf_upper 1
13181 EOF
13182
13183 fi
13184
13185 as_ac_Lib=`echo "ac_cv_lib_menu$cf_cv_libtype''_menu_driver" | $as_tr_sh`
13186 echo "$as_me:13186: checking for menu_driver in -lmenu$cf_cv_libtype" >&5
13187 echo $ECHO_N "checking for menu_driver in -lmenu$cf_cv_libtype... $ECHO_C" >&6
13188 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
13189   echo $ECHO_N "(cached) $ECHO_C" >&6
13190 else
13191   ac_check_lib_save_LIBS=$LIBS
13192 LIBS="-lmenu$cf_cv_libtype  $LIBS"
13193 cat >conftest.$ac_ext <<_ACEOF
13194 #line 13194 "configure"
13195 #include "confdefs.h"
13196
13197 /* Override any gcc2 internal prototype to avoid an error.  */
13198 #ifdef __cplusplus
13199 extern "C"
13200 #endif
13201 /* We use char because int might match the return type of a gcc2
13202    builtin and then its argument prototype would still apply.  */
13203 char menu_driver ();
13204 int
13205 main ()
13206 {
13207 menu_driver ();
13208   ;
13209   return 0;
13210 }
13211 _ACEOF
13212 rm -f conftest.$ac_objext conftest$ac_exeext
13213 if { (eval echo "$as_me:13213: \"$ac_link\"") >&5
13214   (eval $ac_link) 2>&5
13215   ac_status=$?
13216   echo "$as_me:13216: \$? = $ac_status" >&5
13217   (exit $ac_status); } &&
13218          { ac_try='test -s conftest$ac_exeext'
13219   { (eval echo "$as_me:13219: \"$ac_try\"") >&5
13220   (eval $ac_try) 2>&5
13221   ac_status=$?
13222   echo "$as_me:13222: \$? = $ac_status" >&5
13223   (exit $ac_status); }; }; then
13224   eval "$as_ac_Lib=yes"
13225 else
13226   echo "$as_me: failed program was:" >&5
13227 cat conftest.$ac_ext >&5
13228 eval "$as_ac_Lib=no"
13229 fi
13230 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13231 LIBS=$ac_check_lib_save_LIBS
13232 fi
13233 echo "$as_me:13233: result: `eval echo '${'$as_ac_Lib'}'`" >&5
13234 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
13235 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
13236
13237 cf_upper=`echo "have_libmenu" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
13238
13239 cf_add_libs="-lmenu$cf_cv_libtype"
13240 # Filter out duplicates - this happens with badly-designed ".pc" files...
13241 for cf_add_1lib in $LIBS
13242 do
13243         for cf_add_2lib in $cf_add_libs
13244         do
13245                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13246                 then
13247                         cf_add_1lib=
13248                         break
13249                 fi
13250         done
13251         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13252 done
13253 LIBS="$cf_add_libs"
13254
13255 cat >>confdefs.h <<EOF
13256 #define $cf_upper 1
13257 EOF
13258
13259 fi
13260
13261 as_ac_Lib=`echo "ac_cv_lib_form$cf_cv_libtype''_form_driver" | $as_tr_sh`
13262 echo "$as_me:13262: checking for form_driver in -lform$cf_cv_libtype" >&5
13263 echo $ECHO_N "checking for form_driver in -lform$cf_cv_libtype... $ECHO_C" >&6
13264 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
13265   echo $ECHO_N "(cached) $ECHO_C" >&6
13266 else
13267   ac_check_lib_save_LIBS=$LIBS
13268 LIBS="-lform$cf_cv_libtype  $LIBS"
13269 cat >conftest.$ac_ext <<_ACEOF
13270 #line 13270 "configure"
13271 #include "confdefs.h"
13272
13273 /* Override any gcc2 internal prototype to avoid an error.  */
13274 #ifdef __cplusplus
13275 extern "C"
13276 #endif
13277 /* We use char because int might match the return type of a gcc2
13278    builtin and then its argument prototype would still apply.  */
13279 char form_driver ();
13280 int
13281 main ()
13282 {
13283 form_driver ();
13284   ;
13285   return 0;
13286 }
13287 _ACEOF
13288 rm -f conftest.$ac_objext conftest$ac_exeext
13289 if { (eval echo "$as_me:13289: \"$ac_link\"") >&5
13290   (eval $ac_link) 2>&5
13291   ac_status=$?
13292   echo "$as_me:13292: \$? = $ac_status" >&5
13293   (exit $ac_status); } &&
13294          { ac_try='test -s conftest$ac_exeext'
13295   { (eval echo "$as_me:13295: \"$ac_try\"") >&5
13296   (eval $ac_try) 2>&5
13297   ac_status=$?
13298   echo "$as_me:13298: \$? = $ac_status" >&5
13299   (exit $ac_status); }; }; then
13300   eval "$as_ac_Lib=yes"
13301 else
13302   echo "$as_me: failed program was:" >&5
13303 cat conftest.$ac_ext >&5
13304 eval "$as_ac_Lib=no"
13305 fi
13306 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13307 LIBS=$ac_check_lib_save_LIBS
13308 fi
13309 echo "$as_me:13309: result: `eval echo '${'$as_ac_Lib'}'`" >&5
13310 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
13311 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
13312
13313 cf_upper=`echo "have_libform" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
13314
13315 cf_add_libs="-lform$cf_cv_libtype"
13316 # Filter out duplicates - this happens with badly-designed ".pc" files...
13317 for cf_add_1lib in $LIBS
13318 do
13319         for cf_add_2lib in $cf_add_libs
13320         do
13321                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13322                 then
13323                         cf_add_1lib=
13324                         break
13325                 fi
13326         done
13327         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13328 done
13329 LIBS="$cf_add_libs"
13330
13331 cat >>confdefs.h <<EOF
13332 #define $cf_upper 1
13333 EOF
13334
13335 fi
13336
13337         # look for curses-related headers
13338
13339 for ac_header in \
13340                 nc_alloc.h \
13341                 nomacros.h \
13342                 form.h \
13343                 menu.h \
13344                 panel.h \
13345                 term_entry.h \
13346
13347 do
13348 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
13349 echo "$as_me:13349: checking for $ac_header" >&5
13350 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
13351 if eval "test \"\${$as_ac_Header+set}\" = set"; then
13352   echo $ECHO_N "(cached) $ECHO_C" >&6
13353 else
13354   cat >conftest.$ac_ext <<_ACEOF
13355 #line 13355 "configure"
13356 #include "confdefs.h"
13357 #include <$ac_header>
13358 _ACEOF
13359 if { (eval echo "$as_me:13359: \"$ac_cpp conftest.$ac_ext\"") >&5
13360   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13361   ac_status=$?
13362   egrep -v '^ *\+' conftest.er1 >conftest.err
13363   rm -f conftest.er1
13364   cat conftest.err >&5
13365   echo "$as_me:13365: \$? = $ac_status" >&5
13366   (exit $ac_status); } >/dev/null; then
13367   if test -s conftest.err; then
13368     ac_cpp_err=$ac_c_preproc_warn_flag
13369   else
13370     ac_cpp_err=
13371   fi
13372 else
13373   ac_cpp_err=yes
13374 fi
13375 if test -z "$ac_cpp_err"; then
13376   eval "$as_ac_Header=yes"
13377 else
13378   echo "$as_me: failed program was:" >&5
13379   cat conftest.$ac_ext >&5
13380   eval "$as_ac_Header=no"
13381 fi
13382 rm -f conftest.err conftest.$ac_ext
13383 fi
13384 echo "$as_me:13384: result: `eval echo '${'$as_ac_Header'}'`" >&5
13385 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
13386 if test `eval echo '${'$as_ac_Header'}'` = yes; then
13387   cat >>confdefs.h <<EOF
13388 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
13389 EOF
13390
13391 fi
13392 done
13393
13394         ;;
13395 esac
13396
13397 echo "$as_me:13397: checking for ANSI C header files" >&5
13398 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
13399 if test "${ac_cv_header_stdc+set}" = set; then
13400   echo $ECHO_N "(cached) $ECHO_C" >&6
13401 else
13402   cat >conftest.$ac_ext <<_ACEOF
13403 #line 13403 "configure"
13404 #include "confdefs.h"
13405 #include <stdlib.h>
13406 #include <stdarg.h>
13407 #include <string.h>
13408 #include <float.h>
13409
13410 _ACEOF
13411 if { (eval echo "$as_me:13411: \"$ac_cpp conftest.$ac_ext\"") >&5
13412   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13413   ac_status=$?
13414   egrep -v '^ *\+' conftest.er1 >conftest.err
13415   rm -f conftest.er1
13416   cat conftest.err >&5
13417   echo "$as_me:13417: \$? = $ac_status" >&5
13418   (exit $ac_status); } >/dev/null; then
13419   if test -s conftest.err; then
13420     ac_cpp_err=$ac_c_preproc_warn_flag
13421   else
13422     ac_cpp_err=
13423   fi
13424 else
13425   ac_cpp_err=yes
13426 fi
13427 if test -z "$ac_cpp_err"; then
13428   ac_cv_header_stdc=yes
13429 else
13430   echo "$as_me: failed program was:" >&5
13431   cat conftest.$ac_ext >&5
13432   ac_cv_header_stdc=no
13433 fi
13434 rm -f conftest.err conftest.$ac_ext
13435
13436 if test $ac_cv_header_stdc = yes; then
13437   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
13438   cat >conftest.$ac_ext <<_ACEOF
13439 #line 13439 "configure"
13440 #include "confdefs.h"
13441 #include <string.h>
13442
13443 _ACEOF
13444 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13445   egrep "memchr" >/dev/null 2>&1; then
13446   :
13447 else
13448   ac_cv_header_stdc=no
13449 fi
13450 rm -rf conftest*
13451
13452 fi
13453
13454 if test $ac_cv_header_stdc = yes; then
13455   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
13456   cat >conftest.$ac_ext <<_ACEOF
13457 #line 13457 "configure"
13458 #include "confdefs.h"
13459 #include <stdlib.h>
13460
13461 _ACEOF
13462 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13463   egrep "free" >/dev/null 2>&1; then
13464   :
13465 else
13466   ac_cv_header_stdc=no
13467 fi
13468 rm -rf conftest*
13469
13470 fi
13471
13472 if test $ac_cv_header_stdc = yes; then
13473   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
13474   if test "$cross_compiling" = yes; then
13475   :
13476 else
13477   cat >conftest.$ac_ext <<_ACEOF
13478 #line 13478 "configure"
13479 #include "confdefs.h"
13480 #include <ctype.h>
13481 #if ((' ' & 0x0FF) == 0x020)
13482 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
13483 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
13484 #else
13485 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
13486                      || ('j' <= (c) && (c) <= 'r') \
13487                      || ('s' <= (c) && (c) <= 'z'))
13488 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
13489 #endif
13490
13491 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
13492 int
13493 main ()
13494 {
13495   int i;
13496   for (i = 0; i < 256; i++)
13497     if (XOR (islower (i), ISLOWER (i))
13498         || toupper (i) != TOUPPER (i))
13499       $ac_main_return(2);
13500   $ac_main_return (0);
13501 }
13502 _ACEOF
13503 rm -f conftest$ac_exeext
13504 if { (eval echo "$as_me:13504: \"$ac_link\"") >&5
13505   (eval $ac_link) 2>&5
13506   ac_status=$?
13507   echo "$as_me:13507: \$? = $ac_status" >&5
13508   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
13509   { (eval echo "$as_me:13509: \"$ac_try\"") >&5
13510   (eval $ac_try) 2>&5
13511   ac_status=$?
13512   echo "$as_me:13512: \$? = $ac_status" >&5
13513   (exit $ac_status); }; }; then
13514   :
13515 else
13516   echo "$as_me: program exited with status $ac_status" >&5
13517 echo "$as_me: failed program was:" >&5
13518 cat conftest.$ac_ext >&5
13519 ac_cv_header_stdc=no
13520 fi
13521 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
13522 fi
13523 fi
13524 fi
13525 echo "$as_me:13525: result: $ac_cv_header_stdc" >&5
13526 echo "${ECHO_T}$ac_cv_header_stdc" >&6
13527 if test $ac_cv_header_stdc = yes; then
13528
13529 cat >>confdefs.h <<\EOF
13530 #define STDC_HEADERS 1
13531 EOF
13532
13533 fi
13534
13535 echo "$as_me:13535: checking whether time.h and sys/time.h may both be included" >&5
13536 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
13537 if test "${ac_cv_header_time+set}" = set; then
13538   echo $ECHO_N "(cached) $ECHO_C" >&6
13539 else
13540   cat >conftest.$ac_ext <<_ACEOF
13541 #line 13541 "configure"
13542 #include "confdefs.h"
13543 #include <sys/types.h>
13544 #include <sys/time.h>
13545 #include <time.h>
13546
13547 int
13548 main ()
13549 {
13550 if ((struct tm *) 0)
13551 return 0;
13552   ;
13553   return 0;
13554 }
13555 _ACEOF
13556 rm -f conftest.$ac_objext
13557 if { (eval echo "$as_me:13557: \"$ac_compile\"") >&5
13558   (eval $ac_compile) 2>&5
13559   ac_status=$?
13560   echo "$as_me:13560: \$? = $ac_status" >&5
13561   (exit $ac_status); } &&
13562          { ac_try='test -s conftest.$ac_objext'
13563   { (eval echo "$as_me:13563: \"$ac_try\"") >&5
13564   (eval $ac_try) 2>&5
13565   ac_status=$?
13566   echo "$as_me:13566: \$? = $ac_status" >&5
13567   (exit $ac_status); }; }; then
13568   ac_cv_header_time=yes
13569 else
13570   echo "$as_me: failed program was:" >&5
13571 cat conftest.$ac_ext >&5
13572 ac_cv_header_time=no
13573 fi
13574 rm -f conftest.$ac_objext conftest.$ac_ext
13575 fi
13576 echo "$as_me:13576: result: $ac_cv_header_time" >&5
13577 echo "${ECHO_T}$ac_cv_header_time" >&6
13578 if test $ac_cv_header_time = yes; then
13579
13580 cat >>confdefs.h <<\EOF
13581 #define TIME_WITH_SYS_TIME 1
13582 EOF
13583
13584 fi
13585
13586 for ac_header in \
13587 getopt.h \
13588 locale.h \
13589 math.h \
13590 stdarg.h \
13591 sys/ioctl.h \
13592 sys/select.h \
13593 sys/time.h \
13594 termios.h \
13595 unistd.h \
13596
13597 do
13598 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
13599 echo "$as_me:13599: checking for $ac_header" >&5
13600 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
13601 if eval "test \"\${$as_ac_Header+set}\" = set"; then
13602   echo $ECHO_N "(cached) $ECHO_C" >&6
13603 else
13604   cat >conftest.$ac_ext <<_ACEOF
13605 #line 13605 "configure"
13606 #include "confdefs.h"
13607 #include <$ac_header>
13608 _ACEOF
13609 if { (eval echo "$as_me:13609: \"$ac_cpp conftest.$ac_ext\"") >&5
13610   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13611   ac_status=$?
13612   egrep -v '^ *\+' conftest.er1 >conftest.err
13613   rm -f conftest.er1
13614   cat conftest.err >&5
13615   echo "$as_me:13615: \$? = $ac_status" >&5
13616   (exit $ac_status); } >/dev/null; then
13617   if test -s conftest.err; then
13618     ac_cpp_err=$ac_c_preproc_warn_flag
13619   else
13620     ac_cpp_err=
13621   fi
13622 else
13623   ac_cpp_err=yes
13624 fi
13625 if test -z "$ac_cpp_err"; then
13626   eval "$as_ac_Header=yes"
13627 else
13628   echo "$as_me: failed program was:" >&5
13629   cat conftest.$ac_ext >&5
13630   eval "$as_ac_Header=no"
13631 fi
13632 rm -f conftest.err conftest.$ac_ext
13633 fi
13634 echo "$as_me:13634: result: `eval echo '${'$as_ac_Header'}'`" >&5
13635 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
13636 if test `eval echo '${'$as_ac_Header'}'` = yes; then
13637   cat >>confdefs.h <<EOF
13638 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
13639 EOF
13640
13641 fi
13642 done
13643
13644 for ac_header in unistd.h getopt.h
13645 do
13646 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
13647 echo "$as_me:13647: checking for $ac_header" >&5
13648 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
13649 if eval "test \"\${$as_ac_Header+set}\" = set"; then
13650   echo $ECHO_N "(cached) $ECHO_C" >&6
13651 else
13652   cat >conftest.$ac_ext <<_ACEOF
13653 #line 13653 "configure"
13654 #include "confdefs.h"
13655 #include <$ac_header>
13656 _ACEOF
13657 if { (eval echo "$as_me:13657: \"$ac_cpp conftest.$ac_ext\"") >&5
13658   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13659   ac_status=$?
13660   egrep -v '^ *\+' conftest.er1 >conftest.err
13661   rm -f conftest.er1
13662   cat conftest.err >&5
13663   echo "$as_me:13663: \$? = $ac_status" >&5
13664   (exit $ac_status); } >/dev/null; then
13665   if test -s conftest.err; then
13666     ac_cpp_err=$ac_c_preproc_warn_flag
13667   else
13668     ac_cpp_err=
13669   fi
13670 else
13671   ac_cpp_err=yes
13672 fi
13673 if test -z "$ac_cpp_err"; then
13674   eval "$as_ac_Header=yes"
13675 else
13676   echo "$as_me: failed program was:" >&5
13677   cat conftest.$ac_ext >&5
13678   eval "$as_ac_Header=no"
13679 fi
13680 rm -f conftest.err conftest.$ac_ext
13681 fi
13682 echo "$as_me:13682: result: `eval echo '${'$as_ac_Header'}'`" >&5
13683 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
13684 if test `eval echo '${'$as_ac_Header'}'` = yes; then
13685   cat >>confdefs.h <<EOF
13686 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
13687 EOF
13688
13689 fi
13690 done
13691
13692 echo "$as_me:13692: checking for header declaring getopt variables" >&5
13693 echo $ECHO_N "checking for header declaring getopt variables... $ECHO_C" >&6
13694 if test "${cf_cv_getopt_header+set}" = set; then
13695   echo $ECHO_N "(cached) $ECHO_C" >&6
13696 else
13697
13698 cf_cv_getopt_header=none
13699 for cf_header in stdio.h stdlib.h unistd.h getopt.h
13700 do
13701 cat >conftest.$ac_ext <<_ACEOF
13702 #line 13702 "configure"
13703 #include "confdefs.h"
13704
13705 #include <$cf_header>
13706 int
13707 main ()
13708 {
13709 int x = optind; char *y = optarg
13710   ;
13711   return 0;
13712 }
13713 _ACEOF
13714 rm -f conftest.$ac_objext
13715 if { (eval echo "$as_me:13715: \"$ac_compile\"") >&5
13716   (eval $ac_compile) 2>&5
13717   ac_status=$?
13718   echo "$as_me:13718: \$? = $ac_status" >&5
13719   (exit $ac_status); } &&
13720          { ac_try='test -s conftest.$ac_objext'
13721   { (eval echo "$as_me:13721: \"$ac_try\"") >&5
13722   (eval $ac_try) 2>&5
13723   ac_status=$?
13724   echo "$as_me:13724: \$? = $ac_status" >&5
13725   (exit $ac_status); }; }; then
13726   cf_cv_getopt_header=$cf_header
13727  break
13728 else
13729   echo "$as_me: failed program was:" >&5
13730 cat conftest.$ac_ext >&5
13731 fi
13732 rm -f conftest.$ac_objext conftest.$ac_ext
13733 done
13734
13735 fi
13736 echo "$as_me:13736: result: $cf_cv_getopt_header" >&5
13737 echo "${ECHO_T}$cf_cv_getopt_header" >&6
13738 if test $cf_cv_getopt_header != none ; then
13739
13740 cat >>confdefs.h <<\EOF
13741 #define HAVE_GETOPT_HEADER 1
13742 EOF
13743
13744 fi
13745 if test $cf_cv_getopt_header = getopt.h ; then
13746
13747 cat >>confdefs.h <<\EOF
13748 #define NEED_GETOPT_H 1
13749 EOF
13750
13751 fi
13752
13753 for ac_func in \
13754 getopt \
13755 gettimeofday \
13756
13757 do
13758 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
13759 echo "$as_me:13759: checking for $ac_func" >&5
13760 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
13761 if eval "test \"\${$as_ac_var+set}\" = set"; then
13762   echo $ECHO_N "(cached) $ECHO_C" >&6
13763 else
13764   cat >conftest.$ac_ext <<_ACEOF
13765 #line 13765 "configure"
13766 #include "confdefs.h"
13767 /* System header to define __stub macros and hopefully few prototypes,
13768     which can conflict with char $ac_func (); below.  */
13769 #include <assert.h>
13770 /* Override any gcc2 internal prototype to avoid an error.  */
13771 #ifdef __cplusplus
13772 extern "C"
13773 #endif
13774 /* We use char because int might match the return type of a gcc2
13775    builtin and then its argument prototype would still apply.  */
13776 char $ac_func ();
13777 char (*f) ();
13778
13779 int
13780 main ()
13781 {
13782 /* The GNU C library defines this for functions which it implements
13783     to always fail with ENOSYS.  Some functions are actually named
13784     something starting with __ and the normal name is an alias.  */
13785 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
13786 choke me
13787 #else
13788 f = $ac_func; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
13789 #endif
13790
13791   ;
13792   return 0;
13793 }
13794 _ACEOF
13795 rm -f conftest.$ac_objext conftest$ac_exeext
13796 if { (eval echo "$as_me:13796: \"$ac_link\"") >&5
13797   (eval $ac_link) 2>&5
13798   ac_status=$?
13799   echo "$as_me:13799: \$? = $ac_status" >&5
13800   (exit $ac_status); } &&
13801          { ac_try='test -s conftest$ac_exeext'
13802   { (eval echo "$as_me:13802: \"$ac_try\"") >&5
13803   (eval $ac_try) 2>&5
13804   ac_status=$?
13805   echo "$as_me:13805: \$? = $ac_status" >&5
13806   (exit $ac_status); }; }; then
13807   eval "$as_ac_var=yes"
13808 else
13809   echo "$as_me: failed program was:" >&5
13810 cat conftest.$ac_ext >&5
13811 eval "$as_ac_var=no"
13812 fi
13813 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13814 fi
13815 echo "$as_me:13815: result: `eval echo '${'$as_ac_var'}'`" >&5
13816 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
13817 if test `eval echo '${'$as_ac_var'}'` = yes; then
13818   cat >>confdefs.h <<EOF
13819 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
13820 EOF
13821
13822 fi
13823 done
13824
13825 if test "x$ac_cv_func_getopt" = xno; then
13826         { { echo "$as_me:13826: error: getopt is required for building programs" >&5
13827 echo "$as_me: error: getopt is required for building programs" >&2;}
13828    { (exit 1); exit 1; }; }
13829 fi
13830
13831 if test "$cf_enable_widec" = yes; then
13832
13833 for ac_func in \
13834 mblen \
13835 mbrlen \
13836 mbrtowc \
13837 mbsrtowcs \
13838 mbstowcs \
13839 mbtowc \
13840 wcsrtombs \
13841 wcstombs \
13842
13843 do
13844 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
13845 echo "$as_me:13845: checking for $ac_func" >&5
13846 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
13847 if eval "test \"\${$as_ac_var+set}\" = set"; then
13848   echo $ECHO_N "(cached) $ECHO_C" >&6
13849 else
13850   cat >conftest.$ac_ext <<_ACEOF
13851 #line 13851 "configure"
13852 #include "confdefs.h"
13853 /* System header to define __stub macros and hopefully few prototypes,
13854     which can conflict with char $ac_func (); below.  */
13855 #include <assert.h>
13856 /* Override any gcc2 internal prototype to avoid an error.  */
13857 #ifdef __cplusplus
13858 extern "C"
13859 #endif
13860 /* We use char because int might match the return type of a gcc2
13861    builtin and then its argument prototype would still apply.  */
13862 char $ac_func ();
13863 char (*f) ();
13864
13865 int
13866 main ()
13867 {
13868 /* The GNU C library defines this for functions which it implements
13869     to always fail with ENOSYS.  Some functions are actually named
13870     something starting with __ and the normal name is an alias.  */
13871 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
13872 choke me
13873 #else
13874 f = $ac_func; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
13875 #endif
13876
13877   ;
13878   return 0;
13879 }
13880 _ACEOF
13881 rm -f conftest.$ac_objext conftest$ac_exeext
13882 if { (eval echo "$as_me:13882: \"$ac_link\"") >&5
13883   (eval $ac_link) 2>&5
13884   ac_status=$?
13885   echo "$as_me:13885: \$? = $ac_status" >&5
13886   (exit $ac_status); } &&
13887          { ac_try='test -s conftest$ac_exeext'
13888   { (eval echo "$as_me:13888: \"$ac_try\"") >&5
13889   (eval $ac_try) 2>&5
13890   ac_status=$?
13891   echo "$as_me:13891: \$? = $ac_status" >&5
13892   (exit $ac_status); }; }; then
13893   eval "$as_ac_var=yes"
13894 else
13895   echo "$as_me: failed program was:" >&5
13896 cat conftest.$ac_ext >&5
13897 eval "$as_ac_var=no"
13898 fi
13899 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13900 fi
13901 echo "$as_me:13901: result: `eval echo '${'$as_ac_var'}'`" >&5
13902 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
13903 if test `eval echo '${'$as_ac_var'}'` = yes; then
13904   cat >>confdefs.h <<EOF
13905 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
13906 EOF
13907
13908 fi
13909 done
13910
13911 fi
13912
13913 echo "$as_me:13913: checking definition to turn on extended curses functions" >&5
13914 echo $ECHO_N "checking definition to turn on extended curses functions... $ECHO_C" >&6
13915 if test "${cf_cv_need_xopen_extension+set}" = set; then
13916   echo $ECHO_N "(cached) $ECHO_C" >&6
13917 else
13918
13919 cf_cv_need_xopen_extension=unknown
13920 cat >conftest.$ac_ext <<_ACEOF
13921 #line 13921 "configure"
13922 #include "confdefs.h"
13923
13924 #include <stdlib.h>
13925 #include <${cf_cv_ncurses_header:-curses.h}>
13926 int
13927 main ()
13928 {
13929
13930 #if defined(NCURSES_VERSION_PATCH)
13931 #if (NCURSES_VERSION_PATCH < 20100501) && (NCURSES_VERSION_PATCH >= 20100403)
13932         make an error
13933 #endif
13934 #endif
13935 #ifdef NCURSES_VERSION
13936         cchar_t check;
13937         int check2 = curs_set((int)sizeof(check));
13938 #endif
13939         long x = winnstr(stdscr, "", 0);
13940         int x1, y1;
13941         getbegyx(stdscr, y1, x1)
13942   ;
13943   return 0;
13944 }
13945 _ACEOF
13946 rm -f conftest.$ac_objext conftest$ac_exeext
13947 if { (eval echo "$as_me:13947: \"$ac_link\"") >&5
13948   (eval $ac_link) 2>&5
13949   ac_status=$?
13950   echo "$as_me:13950: \$? = $ac_status" >&5
13951   (exit $ac_status); } &&
13952          { ac_try='test -s conftest$ac_exeext'
13953   { (eval echo "$as_me:13953: \"$ac_try\"") >&5
13954   (eval $ac_try) 2>&5
13955   ac_status=$?
13956   echo "$as_me:13956: \$? = $ac_status" >&5
13957   (exit $ac_status); }; }; then
13958   cf_cv_need_xopen_extension=none
13959 else
13960   echo "$as_me: failed program was:" >&5
13961 cat conftest.$ac_ext >&5
13962
13963         for cf_try_xopen_extension in _XOPEN_SOURCE_EXTENDED NCURSES_WIDECHAR
13964         do
13965                 cat >conftest.$ac_ext <<_ACEOF
13966 #line 13966 "configure"
13967 #include "confdefs.h"
13968
13969 #define $cf_try_xopen_extension 1
13970 #include <stdlib.h>
13971 #include <${cf_cv_ncurses_header:-curses.h}>
13972 int
13973 main ()
13974 {
13975
13976 #ifdef NCURSES_VERSION
13977                 cchar_t check;
13978                 int check2 = curs_set((int)sizeof(check));
13979 #endif
13980                 long x = winnstr(stdscr, "", 0);
13981                 int x1, y1;
13982                 getbegyx(stdscr, y1, x1)
13983   ;
13984   return 0;
13985 }
13986 _ACEOF
13987 rm -f conftest.$ac_objext conftest$ac_exeext
13988 if { (eval echo "$as_me:13988: \"$ac_link\"") >&5
13989   (eval $ac_link) 2>&5
13990   ac_status=$?
13991   echo "$as_me:13991: \$? = $ac_status" >&5
13992   (exit $ac_status); } &&
13993          { ac_try='test -s conftest$ac_exeext'
13994   { (eval echo "$as_me:13994: \"$ac_try\"") >&5
13995   (eval $ac_try) 2>&5
13996   ac_status=$?
13997   echo "$as_me:13997: \$? = $ac_status" >&5
13998   (exit $ac_status); }; }; then
13999   cf_cv_need_xopen_extension=$cf_try_xopen_extension; break
14000 else
14001   echo "$as_me: failed program was:" >&5
14002 cat conftest.$ac_ext >&5
14003 fi
14004 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14005         done
14006
14007 fi
14008 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14009
14010 fi
14011 echo "$as_me:14011: result: $cf_cv_need_xopen_extension" >&5
14012 echo "${ECHO_T}$cf_cv_need_xopen_extension" >&6
14013
14014 case $cf_cv_need_xopen_extension in
14015 (*_*)
14016         CPPFLAGS="$CPPFLAGS -D$cf_cv_need_xopen_extension"
14017         ;;
14018 esac
14019
14020 echo "$as_me:14020: checking for term.h" >&5
14021 echo $ECHO_N "checking for term.h... $ECHO_C" >&6
14022 if test "${cf_cv_term_header+set}" = set; then
14023   echo $ECHO_N "(cached) $ECHO_C" >&6
14024 else
14025
14026 # If we found <ncurses/curses.h>, look for <ncurses/term.h>, but always look
14027 # for <term.h> if we do not find the variant.
14028
14029 cf_header_list="term.h ncurses/term.h ncursesw/term.h"
14030
14031 case ${cf_cv_ncurses_header:-curses.h} in
14032 (*/*)
14033         cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`term.h
14034         cf_header_list="$cf_header_item $cf_header_list"
14035         ;;
14036 esac
14037
14038 for cf_header in $cf_header_list
14039 do
14040         cat >conftest.$ac_ext <<_ACEOF
14041 #line 14041 "configure"
14042 #include "confdefs.h"
14043
14044 #include <${cf_cv_ncurses_header:-curses.h}>
14045 #include <${cf_header}>
14046 int
14047 main ()
14048 {
14049 WINDOW *x
14050   ;
14051   return 0;
14052 }
14053 _ACEOF
14054 rm -f conftest.$ac_objext
14055 if { (eval echo "$as_me:14055: \"$ac_compile\"") >&5
14056   (eval $ac_compile) 2>&5
14057   ac_status=$?
14058   echo "$as_me:14058: \$? = $ac_status" >&5
14059   (exit $ac_status); } &&
14060          { ac_try='test -s conftest.$ac_objext'
14061   { (eval echo "$as_me:14061: \"$ac_try\"") >&5
14062   (eval $ac_try) 2>&5
14063   ac_status=$?
14064   echo "$as_me:14064: \$? = $ac_status" >&5
14065   (exit $ac_status); }; }; then
14066   cf_cv_term_header=$cf_header
14067          break
14068 else
14069   echo "$as_me: failed program was:" >&5
14070 cat conftest.$ac_ext >&5
14071 cf_cv_term_header=no
14072 fi
14073 rm -f conftest.$ac_objext conftest.$ac_ext
14074 done
14075
14076 case $cf_cv_term_header in
14077 (no)
14078         # If curses is ncurses, some packagers still mess it up by trying to make
14079         # us use GNU termcap.  This handles the most common case.
14080         for cf_header in ncurses/term.h ncursesw/term.h
14081         do
14082                 cat >conftest.$ac_ext <<_ACEOF
14083 #line 14083 "configure"
14084 #include "confdefs.h"
14085
14086 #include <${cf_cv_ncurses_header:-curses.h}>
14087 #ifdef NCURSES_VERSION
14088 #include <${cf_header}>
14089 #else
14090 make an error
14091 #endif
14092 int
14093 main ()
14094 {
14095 WINDOW *x
14096   ;
14097   return 0;
14098 }
14099 _ACEOF
14100 rm -f conftest.$ac_objext
14101 if { (eval echo "$as_me:14101: \"$ac_compile\"") >&5
14102   (eval $ac_compile) 2>&5
14103   ac_status=$?
14104   echo "$as_me:14104: \$? = $ac_status" >&5
14105   (exit $ac_status); } &&
14106          { ac_try='test -s conftest.$ac_objext'
14107   { (eval echo "$as_me:14107: \"$ac_try\"") >&5
14108   (eval $ac_try) 2>&5
14109   ac_status=$?
14110   echo "$as_me:14110: \$? = $ac_status" >&5
14111   (exit $ac_status); }; }; then
14112   cf_cv_term_header=$cf_header
14113                          break
14114 else
14115   echo "$as_me: failed program was:" >&5
14116 cat conftest.$ac_ext >&5
14117 cf_cv_term_header=no
14118 fi
14119 rm -f conftest.$ac_objext conftest.$ac_ext
14120         done
14121         ;;
14122 esac
14123
14124 fi
14125 echo "$as_me:14125: result: $cf_cv_term_header" >&5
14126 echo "${ECHO_T}$cf_cv_term_header" >&6
14127
14128 case $cf_cv_term_header in
14129 (term.h)
14130
14131 cat >>confdefs.h <<\EOF
14132 #define HAVE_TERM_H 1
14133 EOF
14134
14135         ;;
14136 (ncurses/term.h)
14137
14138 cat >>confdefs.h <<\EOF
14139 #define HAVE_NCURSES_TERM_H 1
14140 EOF
14141
14142         ;;
14143 (ncursesw/term.h)
14144
14145 cat >>confdefs.h <<\EOF
14146 #define HAVE_NCURSESW_TERM_H 1
14147 EOF
14148
14149         ;;
14150 esac
14151
14152 echo "$as_me:14152: checking for unctrl.h" >&5
14153 echo $ECHO_N "checking for unctrl.h... $ECHO_C" >&6
14154 if test "${cf_cv_unctrl_header+set}" = set; then
14155   echo $ECHO_N "(cached) $ECHO_C" >&6
14156 else
14157
14158 # If we found <ncurses/curses.h>, look for <ncurses/unctrl.h>, but always look
14159 # for <unctrl.h> if we do not find the variant.
14160
14161 cf_header_list="unctrl.h ncurses/unctrl.h ncursesw/unctrl.h"
14162
14163 case ${cf_cv_ncurses_header:-curses.h} in
14164 (*/*)
14165         cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`unctrl.h
14166         cf_header_list="$cf_header_item $cf_header_list"
14167         ;;
14168 esac
14169
14170 for cf_header in $cf_header_list
14171 do
14172         cat >conftest.$ac_ext <<_ACEOF
14173 #line 14173 "configure"
14174 #include "confdefs.h"
14175
14176 #include <${cf_cv_ncurses_header:-curses.h}>
14177 #include <${cf_header}>
14178 int
14179 main ()
14180 {
14181 WINDOW *x
14182   ;
14183   return 0;
14184 }
14185 _ACEOF
14186 rm -f conftest.$ac_objext
14187 if { (eval echo "$as_me:14187: \"$ac_compile\"") >&5
14188   (eval $ac_compile) 2>&5
14189   ac_status=$?
14190   echo "$as_me:14190: \$? = $ac_status" >&5
14191   (exit $ac_status); } &&
14192          { ac_try='test -s conftest.$ac_objext'
14193   { (eval echo "$as_me:14193: \"$ac_try\"") >&5
14194   (eval $ac_try) 2>&5
14195   ac_status=$?
14196   echo "$as_me:14196: \$? = $ac_status" >&5
14197   (exit $ac_status); }; }; then
14198   cf_cv_unctrl_header=$cf_header
14199          break
14200 else
14201   echo "$as_me: failed program was:" >&5
14202 cat conftest.$ac_ext >&5
14203 cf_cv_unctrl_header=no
14204 fi
14205 rm -f conftest.$ac_objext conftest.$ac_ext
14206 done
14207
14208 fi
14209 echo "$as_me:14209: result: $cf_cv_unctrl_header" >&5
14210 echo "${ECHO_T}$cf_cv_unctrl_header" >&6
14211
14212 case $cf_cv_unctrl_header in
14213 (no)
14214         { echo "$as_me:14214: WARNING: unctrl.h header not found" >&5
14215 echo "$as_me: WARNING: unctrl.h header not found" >&2;}
14216         ;;
14217 esac
14218
14219 case $cf_cv_unctrl_header in
14220 (unctrl.h)
14221
14222 cat >>confdefs.h <<\EOF
14223 #define HAVE_UNCTRL_H 1
14224 EOF
14225
14226         ;;
14227 (ncurses/unctrl.h)
14228
14229 cat >>confdefs.h <<\EOF
14230 #define HAVE_NCURSES_UNCTRL_H 1
14231 EOF
14232
14233         ;;
14234 (ncursesw/unctrl.h)
14235
14236 cat >>confdefs.h <<\EOF
14237 #define HAVE_NCURSESW_UNCTRL_H 1
14238 EOF
14239
14240         ;;
14241 esac
14242
14243 for cf_func in \
14244 assume_default_colors \
14245 chgat \
14246 color_set \
14247 filter \
14248 getbegx \
14249 getcurx \
14250 getmaxx \
14251 getnstr \
14252 getparx \
14253 getwin \
14254 mvvline \
14255 mvwvline \
14256 napms \
14257 putwin \
14258 resize_term \
14259 resizeterm \
14260 ripoffline \
14261 scr_dump \
14262 setupterm \
14263 slk_color \
14264 slk_init \
14265 termattrs \
14266 tgetent \
14267 tigetnum \
14268 tigetstr \
14269 typeahead \
14270 use_default_colors \
14271 use_env \
14272 use_extended_names \
14273 use_screen \
14274 use_window \
14275 vid_puts \
14276 vidputs \
14277 vsscanf \
14278 vw_printw \
14279 wchgat \
14280 winsstr \
14281 wresize \
14282 wsyncdown \
14283
14284 do
14285
14286 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14287
14288         echo "$as_me:14288: checking for ${cf_func}" >&5
14289 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
14290
14291 echo "${as_me:-configure}:14291: testing ${cf_func} ..." 1>&5
14292
14293         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
14294   echo $ECHO_N "(cached) $ECHO_C" >&6
14295 else
14296
14297                 eval cf_result='$ac_cv_func_'$cf_func
14298                 if test ".$cf_result" != ".no"; then
14299                         cat >conftest.$ac_ext <<_ACEOF
14300 #line 14300 "configure"
14301 #include "confdefs.h"
14302
14303 #ifdef HAVE_XCURSES
14304 #include <xcurses.h>
14305 char * XCursesProgramName = "test";
14306 #else
14307 #include <${cf_cv_ncurses_header:-curses.h}>
14308 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
14309 #include <ncursesw/term.h>
14310 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
14311 #include <ncurses/term.h>
14312 #elif defined(HAVE_TERM_H)
14313 #include <term.h>
14314 #endif
14315 #endif
14316
14317 int
14318 main ()
14319 {
14320
14321 #ifndef ${cf_func}
14322 long foo = (long)(&${cf_func});
14323 fprintf(stderr, "testing linkage of $cf_func:%p\n", foo);
14324 if (foo + 1234 > 5678)
14325         ${cf_cv_main_return:-return}(foo);
14326 #endif
14327
14328   ;
14329   return 0;
14330 }
14331 _ACEOF
14332 rm -f conftest.$ac_objext conftest$ac_exeext
14333 if { (eval echo "$as_me:14333: \"$ac_link\"") >&5
14334   (eval $ac_link) 2>&5
14335   ac_status=$?
14336   echo "$as_me:14336: \$? = $ac_status" >&5
14337   (exit $ac_status); } &&
14338          { ac_try='test -s conftest$ac_exeext'
14339   { (eval echo "$as_me:14339: \"$ac_try\"") >&5
14340   (eval $ac_try) 2>&5
14341   ac_status=$?
14342   echo "$as_me:14342: \$? = $ac_status" >&5
14343   (exit $ac_status); }; }; then
14344   cf_result=yes
14345 else
14346   echo "$as_me: failed program was:" >&5
14347 cat conftest.$ac_ext >&5
14348 cf_result=no
14349 fi
14350 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14351                 fi
14352                 eval 'cf_cv_func_'$cf_func'=$cf_result'
14353
14354 fi
14355
14356         # use the computed/retrieved cache-value:
14357         eval 'cf_result=$cf_cv_func_'$cf_func
14358         echo "$as_me:14358: result: $cf_result" >&5
14359 echo "${ECHO_T}$cf_result" >&6
14360         if test $cf_result != no; then
14361                 cat >>confdefs.h <<EOF
14362 #define HAVE_${cf_tr_func} 1
14363 EOF
14364
14365         fi
14366 done
14367
14368 for cf_func in tputs
14369 do
14370
14371 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14372
14373         echo "$as_me:14373: checking for ${cf_func}" >&5
14374 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
14375
14376 echo "${as_me:-configure}:14376: testing ${cf_func} ..." 1>&5
14377
14378         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
14379   echo $ECHO_N "(cached) $ECHO_C" >&6
14380 else
14381
14382                 eval cf_result='$ac_cv_func_'$cf_func
14383                 if test ".$cf_result" != ".no"; then
14384                         cat >conftest.$ac_ext <<_ACEOF
14385 #line 14385 "configure"
14386 #include "confdefs.h"
14387
14388 #ifdef HAVE_XCURSES
14389 #include <xcurses.h>
14390 char * XCursesProgramName = "test";
14391 #else
14392 #include <${cf_cv_ncurses_header:-curses.h}>
14393 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
14394 #include <ncursesw/term.h>
14395 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
14396 #include <ncurses/term.h>
14397 #elif defined(HAVE_TERM_H)
14398 #include <term.h>
14399 #endif
14400 #endif
14401
14402 int
14403 main ()
14404 {
14405
14406 #ifndef ${cf_func}
14407 long foo = (long)(&${cf_func});
14408 fprintf(stderr, "testing linkage of $cf_func:%p\n", foo);
14409 if (foo + 1234 > 5678)
14410         ${cf_cv_main_return:-return}(foo);
14411 #endif
14412
14413   ;
14414   return 0;
14415 }
14416 _ACEOF
14417 rm -f conftest.$ac_objext conftest$ac_exeext
14418 if { (eval echo "$as_me:14418: \"$ac_link\"") >&5
14419   (eval $ac_link) 2>&5
14420   ac_status=$?
14421   echo "$as_me:14421: \$? = $ac_status" >&5
14422   (exit $ac_status); } &&
14423          { ac_try='test -s conftest$ac_exeext'
14424   { (eval echo "$as_me:14424: \"$ac_try\"") >&5
14425   (eval $ac_try) 2>&5
14426   ac_status=$?
14427   echo "$as_me:14427: \$? = $ac_status" >&5
14428   (exit $ac_status); }; }; then
14429   cf_result=yes
14430 else
14431   echo "$as_me: failed program was:" >&5
14432 cat conftest.$ac_ext >&5
14433 cf_result=no
14434 fi
14435 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14436                 fi
14437                 eval 'cf_cv_func_'$cf_func'=$cf_result'
14438
14439 fi
14440
14441         # use the computed/retrieved cache-value:
14442         eval 'cf_result=$cf_cv_func_'$cf_func
14443         echo "$as_me:14443: result: $cf_result" >&5
14444 echo "${ECHO_T}$cf_result" >&6
14445         if test $cf_result != no; then
14446                 cat >>confdefs.h <<EOF
14447 #define HAVE_${cf_tr_func} 1
14448 EOF
14449
14450         fi
14451 done
14452
14453 if test x$cf_cv_func_tputs = xyes
14454 then
14455         cf_done=no
14456         for cf_arg in int char
14457         do
14458                 for cf_ret in int void
14459                 do
14460                         if test $cf_ret = void
14461                         then
14462                                 cf_return="/* nothing */"
14463                         else
14464                                 cf_return="return value"
14465                         fi
14466                         cat >conftest.$ac_ext <<_ACEOF
14467 #line 14467 "configure"
14468 #include "confdefs.h"
14469
14470 #include <${cf_cv_ncurses_header:-curses.h}>
14471 #include <$cf_cv_term_header>
14472
14473 static $cf_ret outc($cf_arg value) { $cf_return; }
14474
14475 int
14476 main ()
14477 {
14478
14479         tputs("hello", 0, outc);
14480         ${cf_cv_main_return:-return}(0);
14481
14482   ;
14483   return 0;
14484 }
14485 _ACEOF
14486 rm -f conftest.$ac_objext
14487 if { (eval echo "$as_me:14487: \"$ac_compile\"") >&5
14488   (eval $ac_compile) 2>&5
14489   ac_status=$?
14490   echo "$as_me:14490: \$? = $ac_status" >&5
14491   (exit $ac_status); } &&
14492          { ac_try='test -s conftest.$ac_objext'
14493   { (eval echo "$as_me:14493: \"$ac_try\"") >&5
14494   (eval $ac_try) 2>&5
14495   ac_status=$?
14496   echo "$as_me:14496: \$? = $ac_status" >&5
14497   (exit $ac_status); }; }; then
14498
14499                 test -n "$verbose" && echo "    prototype $cf_ret func($cf_arg value)" 1>&6
14500
14501 echo "${as_me:-configure}:14501: testing prototype $cf_ret func($cf_arg value) ..." 1>&5
14502
14503                 cat >>confdefs.h <<EOF
14504 #define TPUTS_ARG               $cf_arg
14505 #define TPUTS_PROTO(func,value) $cf_ret func(TPUTS_ARG value)
14506 #define TPUTS_RETURN(value)     $cf_return
14507 EOF
14508                 cf_done=yes
14509                 break
14510
14511 else
14512   echo "$as_me: failed program was:" >&5
14513 cat conftest.$ac_ext >&5
14514 fi
14515 rm -f conftest.$ac_objext conftest.$ac_ext
14516                 done
14517                 test $cf_done = yes && break
14518         done
14519 fi
14520
14521 echo "$as_me:14521: checking for ncurses extended functions" >&5
14522 echo $ECHO_N "checking for ncurses extended functions... $ECHO_C" >&6
14523 if test "${cf_cv_ncurses_ext_funcs+set}" = set; then
14524   echo $ECHO_N "(cached) $ECHO_C" >&6
14525 else
14526
14527 cat >conftest.$ac_ext <<_ACEOF
14528 #line 14528 "configure"
14529 #include "confdefs.h"
14530
14531 #include <${cf_cv_ncurses_header:-curses.h}>
14532 int
14533 main ()
14534 {
14535
14536 int x = NCURSES_EXT_FUNCS
14537
14538   ;
14539   return 0;
14540 }
14541 _ACEOF
14542 rm -f conftest.$ac_objext
14543 if { (eval echo "$as_me:14543: \"$ac_compile\"") >&5
14544   (eval $ac_compile) 2>&5
14545   ac_status=$?
14546   echo "$as_me:14546: \$? = $ac_status" >&5
14547   (exit $ac_status); } &&
14548          { ac_try='test -s conftest.$ac_objext'
14549   { (eval echo "$as_me:14549: \"$ac_try\"") >&5
14550   (eval $ac_try) 2>&5
14551   ac_status=$?
14552   echo "$as_me:14552: \$? = $ac_status" >&5
14553   (exit $ac_status); }; }; then
14554   cf_cv_ncurses_ext_funcs=defined
14555 else
14556   echo "$as_me: failed program was:" >&5
14557 cat conftest.$ac_ext >&5
14558
14559 cat >conftest.$ac_ext <<_ACEOF
14560 #line 14560 "configure"
14561 #include "confdefs.h"
14562
14563 #include <${cf_cv_ncurses_header:-curses.h}>
14564 int
14565 main ()
14566 {
14567
14568         (void) assume_default_colors (0, 0);
14569         (void) curses_version ();
14570         (void) define_key (0, 0);
14571         (void) is_term_resized (0, 0);
14572         (void) key_defined (0);
14573         (void) keybound (0, 0);
14574         (void) keyok (0, 0);
14575         (void) resize_term (0, 0);
14576         (void) resizeterm (0, 0);
14577         (void) use_default_colors ();
14578         (void) use_extended_names (0);
14579         (void) wresize (0, 0, 0);
14580   ;
14581   return 0;
14582 }
14583 _ACEOF
14584 rm -f conftest.$ac_objext conftest$ac_exeext
14585 if { (eval echo "$as_me:14585: \"$ac_link\"") >&5
14586   (eval $ac_link) 2>&5
14587   ac_status=$?
14588   echo "$as_me:14588: \$? = $ac_status" >&5
14589   (exit $ac_status); } &&
14590          { ac_try='test -s conftest$ac_exeext'
14591   { (eval echo "$as_me:14591: \"$ac_try\"") >&5
14592   (eval $ac_try) 2>&5
14593   ac_status=$?
14594   echo "$as_me:14594: \$? = $ac_status" >&5
14595   (exit $ac_status); }; }; then
14596   cf_cv_ncurses_ext_funcs=yes
14597 else
14598   echo "$as_me: failed program was:" >&5
14599 cat conftest.$ac_ext >&5
14600 cf_cv_ncurses_ext_funcs=no
14601 fi
14602 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14603
14604 fi
14605 rm -f conftest.$ac_objext conftest.$ac_ext
14606
14607 fi
14608 echo "$as_me:14608: result: $cf_cv_ncurses_ext_funcs" >&5
14609 echo "${ECHO_T}$cf_cv_ncurses_ext_funcs" >&6
14610 test "$cf_cv_ncurses_ext_funcs" = yes &&
14611 cat >>confdefs.h <<\EOF
14612 #define NCURSES_EXT_FUNCS 1
14613 EOF
14614
14615 if test "$cf_enable_widec" = yes
14616 then
14617         # workaround for systems with ncurses before 20111029, due to change of
14618         # feature test macro from _XPG5 to _XOPEN_SOURCE
14619         if test -n "$cf_cv_ncurses_version" && test "x$cf_cv_ncurses_version" != xno
14620         then
14621                 cf_define_xpg5=no
14622                 echo "$as_me:14622: checking if _XPG5 should be defined to enable wide-characters" >&5
14623 echo $ECHO_N "checking if _XPG5 should be defined to enable wide-characters... $ECHO_C" >&6
14624
14625                 cat >conftest.$ac_ext <<_ACEOF
14626 #line 14626 "configure"
14627 #include "confdefs.h"
14628
14629 #include <${cf_cv_ncurses_header:-curses.h}>
14630 int
14631 main ()
14632 {
14633 int x = _XPG5
14634   ;
14635   return 0;
14636 }
14637 _ACEOF
14638 rm -f conftest.$ac_objext
14639 if { (eval echo "$as_me:14639: \"$ac_compile\"") >&5
14640   (eval $ac_compile) 2>&5
14641   ac_status=$?
14642   echo "$as_me:14642: \$? = $ac_status" >&5
14643   (exit $ac_status); } &&
14644          { ac_try='test -s conftest.$ac_objext'
14645   { (eval echo "$as_me:14645: \"$ac_try\"") >&5
14646   (eval $ac_try) 2>&5
14647   ac_status=$?
14648   echo "$as_me:14648: \$? = $ac_status" >&5
14649   (exit $ac_status); }; }; then
14650   :
14651 else
14652   echo "$as_me: failed program was:" >&5
14653 cat conftest.$ac_ext >&5
14654 cf_save_cppflags="$CPPFLAGS"
14655                          CPPFLAGS="$CPPFLAGS -D_XPG5"
14656                          cat >conftest.$ac_ext <<_ACEOF
14657 #line 14657 "configure"
14658 #include "confdefs.h"
14659
14660 #include <${cf_cv_ncurses_header:-curses.h}>
14661 int
14662 main ()
14663 {
14664 int x = _XPG5
14665   ;
14666   return 0;
14667 }
14668 _ACEOF
14669 rm -f conftest.$ac_objext
14670 if { (eval echo "$as_me:14670: \"$ac_compile\"") >&5
14671   (eval $ac_compile) 2>&5
14672   ac_status=$?
14673   echo "$as_me:14673: \$? = $ac_status" >&5
14674   (exit $ac_status); } &&
14675          { ac_try='test -s conftest.$ac_objext'
14676   { (eval echo "$as_me:14676: \"$ac_try\"") >&5
14677   (eval $ac_try) 2>&5
14678   ac_status=$?
14679   echo "$as_me:14679: \$? = $ac_status" >&5
14680   (exit $ac_status); }; }; then
14681   cf_define_xpg5=yes
14682 else
14683   echo "$as_me: failed program was:" >&5
14684 cat conftest.$ac_ext >&5
14685 fi
14686 rm -f conftest.$ac_objext conftest.$ac_ext
14687                          CPPFLAGS="$cf_save_cppflags"
14688 fi
14689 rm -f conftest.$ac_objext conftest.$ac_ext
14690                 echo "$as_me:14690: result: $cf_define_xpg5" >&5
14691 echo "${ECHO_T}$cf_define_xpg5" >&6
14692
14693                 if test "$cf_define_xpg5" = yes
14694                 then
14695                         CPPFLAGS="$CPPFLAGS -D_XPG5"
14696                 fi
14697         fi
14698
14699         echo "$as_me:14699: checking for wide-character functions" >&5
14700 echo $ECHO_N "checking for wide-character functions... $ECHO_C" >&6
14701 if test "${cf_cv_widechar_funcs+set}" = set; then
14702   echo $ECHO_N "(cached) $ECHO_C" >&6
14703 else
14704
14705         cat >conftest.$ac_ext <<_ACEOF
14706 #line 14706 "configure"
14707 #include "confdefs.h"
14708
14709 #include <${cf_cv_ncurses_header:-curses.h}>
14710 int
14711 main ()
14712 {
14713
14714                 static wchar_t src_wchar[2];
14715                 static cchar_t dst_cchar;
14716                 setcchar(&dst_cchar, src_wchar, A_NORMAL, 0, (void *) 0);
14717
14718   ;
14719   return 0;
14720 }
14721 _ACEOF
14722 rm -f conftest.$ac_objext conftest$ac_exeext
14723 if { (eval echo "$as_me:14723: \"$ac_link\"") >&5
14724   (eval $ac_link) 2>&5
14725   ac_status=$?
14726   echo "$as_me:14726: \$? = $ac_status" >&5
14727   (exit $ac_status); } &&
14728          { ac_try='test -s conftest$ac_exeext'
14729   { (eval echo "$as_me:14729: \"$ac_try\"") >&5
14730   (eval $ac_try) 2>&5
14731   ac_status=$?
14732   echo "$as_me:14732: \$? = $ac_status" >&5
14733   (exit $ac_status); }; }; then
14734   cf_cv_widechar_funcs=yes
14735 else
14736   echo "$as_me: failed program was:" >&5
14737 cat conftest.$ac_ext >&5
14738 cf_cv_widechar_funcs=no
14739 fi
14740 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14741
14742 fi
14743 echo "$as_me:14743: result: $cf_cv_widechar_funcs" >&5
14744 echo "${ECHO_T}$cf_cv_widechar_funcs" >&6
14745         if test "$cf_cv_widechar_funcs" != no ; then
14746
14747 cat >>confdefs.h <<\EOF
14748 #define USE_WIDEC_SUPPORT 1
14749 EOF
14750
14751         else
14752                 cat >>confdefs.h <<\EOF
14753 #define USE_WIDEC_SUPPORT 0
14754 EOF
14755
14756         fi
14757 else
14758         cat >>confdefs.h <<\EOF
14759 #define USE_WIDEC_SUPPORT 0
14760 EOF
14761
14762 fi
14763
14764 echo "$as_me:14764: checking if $cf_cv_screen library uses pthreads" >&5
14765 echo $ECHO_N "checking if $cf_cv_screen library uses pthreads... $ECHO_C" >&6
14766 if test "${cf_cv_use_pthreads+set}" = set; then
14767   echo $ECHO_N "(cached) $ECHO_C" >&6
14768 else
14769
14770 cat >conftest.$ac_ext <<_ACEOF
14771 #line 14771 "configure"
14772 #include "confdefs.h"
14773
14774 #include <${cf_cv_ncurses_header:-curses.h}>
14775 extern void _nc_init_pthreads(void);
14776
14777 int
14778 main ()
14779 {
14780
14781         initscr();
14782         _nc_init_pthreads();
14783
14784   ;
14785   return 0;
14786 }
14787 _ACEOF
14788 rm -f conftest.$ac_objext conftest$ac_exeext
14789 if { (eval echo "$as_me:14789: \"$ac_link\"") >&5
14790   (eval $ac_link) 2>&5
14791   ac_status=$?
14792   echo "$as_me:14792: \$? = $ac_status" >&5
14793   (exit $ac_status); } &&
14794          { ac_try='test -s conftest$ac_exeext'
14795   { (eval echo "$as_me:14795: \"$ac_try\"") >&5
14796   (eval $ac_try) 2>&5
14797   ac_status=$?
14798   echo "$as_me:14798: \$? = $ac_status" >&5
14799   (exit $ac_status); }; }; then
14800   cf_cv_use_pthreads=yes
14801 else
14802   echo "$as_me: failed program was:" >&5
14803 cat conftest.$ac_ext >&5
14804 cf_cv_use_pthreads=no
14805 fi
14806 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14807
14808 fi
14809 echo "$as_me:14809: result: $cf_cv_use_pthreads" >&5
14810 echo "${ECHO_T}$cf_cv_use_pthreads" >&6
14811 test $cf_cv_use_pthreads = yes && cat >>confdefs.h <<\EOF
14812 #define USE_PTHREADS 1
14813 EOF
14814
14815 echo "$as_me:14815: checking if sys/time.h works with sys/select.h" >&5
14816 echo $ECHO_N "checking if sys/time.h works with sys/select.h... $ECHO_C" >&6
14817 if test "${cf_cv_sys_time_select+set}" = set; then
14818   echo $ECHO_N "(cached) $ECHO_C" >&6
14819 else
14820
14821 cat >conftest.$ac_ext <<_ACEOF
14822 #line 14822 "configure"
14823 #include "confdefs.h"
14824
14825 #include <sys/types.h>
14826 #ifdef HAVE_SYS_TIME_H
14827 #include <sys/time.h>
14828 #endif
14829 #ifdef HAVE_SYS_SELECT_H
14830 #include <sys/select.h>
14831 #endif
14832
14833 int
14834 main ()
14835 {
14836
14837   ;
14838   return 0;
14839 }
14840 _ACEOF
14841 rm -f conftest.$ac_objext
14842 if { (eval echo "$as_me:14842: \"$ac_compile\"") >&5
14843   (eval $ac_compile) 2>&5
14844   ac_status=$?
14845   echo "$as_me:14845: \$? = $ac_status" >&5
14846   (exit $ac_status); } &&
14847          { ac_try='test -s conftest.$ac_objext'
14848   { (eval echo "$as_me:14848: \"$ac_try\"") >&5
14849   (eval $ac_try) 2>&5
14850   ac_status=$?
14851   echo "$as_me:14851: \$? = $ac_status" >&5
14852   (exit $ac_status); }; }; then
14853   cf_cv_sys_time_select=yes
14854 else
14855   echo "$as_me: failed program was:" >&5
14856 cat conftest.$ac_ext >&5
14857 cf_cv_sys_time_select=no
14858 fi
14859 rm -f conftest.$ac_objext conftest.$ac_ext
14860
14861 fi
14862
14863 echo "$as_me:14863: result: $cf_cv_sys_time_select" >&5
14864 echo "${ECHO_T}$cf_cv_sys_time_select" >&6
14865 test "$cf_cv_sys_time_select" = yes &&
14866 cat >>confdefs.h <<\EOF
14867 #define HAVE_SYS_TIME_SELECT 1
14868 EOF
14869
14870 # special check for test/ditto.c
14871
14872 echo "$as_me:14872: checking for openpty in -lutil" >&5
14873 echo $ECHO_N "checking for openpty in -lutil... $ECHO_C" >&6
14874 if test "${ac_cv_lib_util_openpty+set}" = set; then
14875   echo $ECHO_N "(cached) $ECHO_C" >&6
14876 else
14877   ac_check_lib_save_LIBS=$LIBS
14878 LIBS="-lutil  $LIBS"
14879 cat >conftest.$ac_ext <<_ACEOF
14880 #line 14880 "configure"
14881 #include "confdefs.h"
14882
14883 /* Override any gcc2 internal prototype to avoid an error.  */
14884 #ifdef __cplusplus
14885 extern "C"
14886 #endif
14887 /* We use char because int might match the return type of a gcc2
14888    builtin and then its argument prototype would still apply.  */
14889 char openpty ();
14890 int
14891 main ()
14892 {
14893 openpty ();
14894   ;
14895   return 0;
14896 }
14897 _ACEOF
14898 rm -f conftest.$ac_objext conftest$ac_exeext
14899 if { (eval echo "$as_me:14899: \"$ac_link\"") >&5
14900   (eval $ac_link) 2>&5
14901   ac_status=$?
14902   echo "$as_me:14902: \$? = $ac_status" >&5
14903   (exit $ac_status); } &&
14904          { ac_try='test -s conftest$ac_exeext'
14905   { (eval echo "$as_me:14905: \"$ac_try\"") >&5
14906   (eval $ac_try) 2>&5
14907   ac_status=$?
14908   echo "$as_me:14908: \$? = $ac_status" >&5
14909   (exit $ac_status); }; }; then
14910   ac_cv_lib_util_openpty=yes
14911 else
14912   echo "$as_me: failed program was:" >&5
14913 cat conftest.$ac_ext >&5
14914 ac_cv_lib_util_openpty=no
14915 fi
14916 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14917 LIBS=$ac_check_lib_save_LIBS
14918 fi
14919 echo "$as_me:14919: result: $ac_cv_lib_util_openpty" >&5
14920 echo "${ECHO_T}$ac_cv_lib_util_openpty" >&6
14921 if test $ac_cv_lib_util_openpty = yes; then
14922   cf_cv_lib_util=yes
14923 else
14924   cf_cv_lib_util=no
14925 fi
14926
14927 echo "$as_me:14927: checking for openpty header" >&5
14928 echo $ECHO_N "checking for openpty header... $ECHO_C" >&6
14929 if test "${cf_cv_func_openpty+set}" = set; then
14930   echo $ECHO_N "(cached) $ECHO_C" >&6
14931 else
14932
14933         cf_save_LIBS="$LIBS"
14934         test $cf_cv_lib_util = yes && {
14935 cf_add_libs="-lutil"
14936 # Filter out duplicates - this happens with badly-designed ".pc" files...
14937 for cf_add_1lib in $LIBS
14938 do
14939         for cf_add_2lib in $cf_add_libs
14940         do
14941                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
14942                 then
14943                         cf_add_1lib=
14944                         break
14945                 fi
14946         done
14947         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
14948 done
14949 LIBS="$cf_add_libs"
14950  }
14951         for cf_header in pty.h libutil.h util.h
14952         do
14953         cat >conftest.$ac_ext <<_ACEOF
14954 #line 14954 "configure"
14955 #include "confdefs.h"
14956
14957 #include <$cf_header>
14958
14959 int
14960 main ()
14961 {
14962
14963         int x = openpty((int *)0, (int *)0, (char *)0,
14964                                    (struct termios *)0, (struct winsize *)0);
14965
14966   ;
14967   return 0;
14968 }
14969 _ACEOF
14970 rm -f conftest.$ac_objext conftest$ac_exeext
14971 if { (eval echo "$as_me:14971: \"$ac_link\"") >&5
14972   (eval $ac_link) 2>&5
14973   ac_status=$?
14974   echo "$as_me:14974: \$? = $ac_status" >&5
14975   (exit $ac_status); } &&
14976          { ac_try='test -s conftest$ac_exeext'
14977   { (eval echo "$as_me:14977: \"$ac_try\"") >&5
14978   (eval $ac_try) 2>&5
14979   ac_status=$?
14980   echo "$as_me:14980: \$? = $ac_status" >&5
14981   (exit $ac_status); }; }; then
14982
14983                 cf_cv_func_openpty=$cf_header
14984                 break
14985
14986 else
14987   echo "$as_me: failed program was:" >&5
14988 cat conftest.$ac_ext >&5
14989
14990                 cf_cv_func_openpty=no
14991
14992 fi
14993 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14994         done
14995         LIBS="$cf_save_LIBS"
14996
14997 fi
14998 echo "$as_me:14998: result: $cf_cv_func_openpty" >&5
14999 echo "${ECHO_T}$cf_cv_func_openpty" >&6
15000
15001 if test "$cf_cv_func_openpty" != no ; then
15002
15003 cat >>confdefs.h <<EOF
15004 #define USE_OPENPTY_HEADER <$cf_cv_func_openpty>
15005 EOF
15006
15007 cat >>confdefs.h <<\EOF
15008 #define USE_XTERM_PTY 1
15009 EOF
15010
15011         if test "x$cf_cv_lib_util" = xyes ; then
15012
15013 cf_add_libs="-lutil"
15014 # Filter out duplicates - this happens with badly-designed ".pc" files...
15015 for cf_add_1lib in $TEST_LIBS
15016 do
15017         for cf_add_2lib in $cf_add_libs
15018         do
15019                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
15020                 then
15021                         cf_add_1lib=
15022                         break
15023                 fi
15024         done
15025         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
15026 done
15027 TEST_LIBS="$cf_add_libs"
15028
15029         fi
15030 fi
15031
15032 echo "$as_me:15032: checking for function curses_version" >&5
15033 echo $ECHO_N "checking for function curses_version... $ECHO_C" >&6
15034 if test "${cf_cv_func_curses_version+set}" = set; then
15035   echo $ECHO_N "(cached) $ECHO_C" >&6
15036 else
15037
15038 if test "$cross_compiling" = yes; then
15039   cf_cv_func_curses_version=unknown
15040 else
15041   cat >conftest.$ac_ext <<_ACEOF
15042 #line 15042 "configure"
15043 #include "confdefs.h"
15044
15045 #include <${cf_cv_ncurses_header:-curses.h}>
15046 int main()
15047 {
15048         char temp[1024];
15049         sprintf(temp, "%s\n", curses_version());
15050         ${cf_cv_main_return:-return}(0);
15051 }
15052
15053 _ACEOF
15054 rm -f conftest$ac_exeext
15055 if { (eval echo "$as_me:15055: \"$ac_link\"") >&5
15056   (eval $ac_link) 2>&5
15057   ac_status=$?
15058   echo "$as_me:15058: \$? = $ac_status" >&5
15059   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
15060   { (eval echo "$as_me:15060: \"$ac_try\"") >&5
15061   (eval $ac_try) 2>&5
15062   ac_status=$?
15063   echo "$as_me:15063: \$? = $ac_status" >&5
15064   (exit $ac_status); }; }; then
15065   cf_cv_func_curses_version=yes
15066
15067 else
15068   echo "$as_me: program exited with status $ac_status" >&5
15069 echo "$as_me: failed program was:" >&5
15070 cat conftest.$ac_ext >&5
15071 cf_cv_func_curses_version=no
15072
15073 fi
15074 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
15075 fi
15076 rm -f core
15077 fi
15078 echo "$as_me:15078: result: $cf_cv_func_curses_version" >&5
15079 echo "${ECHO_T}$cf_cv_func_curses_version" >&6
15080 test "$cf_cv_func_curses_version" = yes &&
15081 cat >>confdefs.h <<\EOF
15082 #define HAVE_CURSES_VERSION 1
15083 EOF
15084
15085 echo "$as_me:15085: checking for alternate character set array" >&5
15086 echo $ECHO_N "checking for alternate character set array... $ECHO_C" >&6
15087 if test "${cf_cv_curses_acs_map+set}" = set; then
15088   echo $ECHO_N "(cached) $ECHO_C" >&6
15089 else
15090
15091 cf_cv_curses_acs_map=unknown
15092 for name in acs_map _acs_map __acs_map ${NCURSES_WRAP_PREFIX}acs_map
15093 do
15094 cat >conftest.$ac_ext <<_ACEOF
15095 #line 15095 "configure"
15096 #include "confdefs.h"
15097
15098 #include <${cf_cv_ncurses_header:-curses.h}>
15099
15100 int
15101 main ()
15102 {
15103
15104 $name['k'] = ACS_PLUS
15105
15106   ;
15107   return 0;
15108 }
15109 _ACEOF
15110 rm -f conftest.$ac_objext conftest$ac_exeext
15111 if { (eval echo "$as_me:15111: \"$ac_link\"") >&5
15112   (eval $ac_link) 2>&5
15113   ac_status=$?
15114   echo "$as_me:15114: \$? = $ac_status" >&5
15115   (exit $ac_status); } &&
15116          { ac_try='test -s conftest$ac_exeext'
15117   { (eval echo "$as_me:15117: \"$ac_try\"") >&5
15118   (eval $ac_try) 2>&5
15119   ac_status=$?
15120   echo "$as_me:15120: \$? = $ac_status" >&5
15121   (exit $ac_status); }; }; then
15122   cf_cv_curses_acs_map=$name; break
15123 else
15124   echo "$as_me: failed program was:" >&5
15125 cat conftest.$ac_ext >&5
15126 fi
15127 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15128 done
15129
15130 fi
15131 echo "$as_me:15131: result: $cf_cv_curses_acs_map" >&5
15132 echo "${ECHO_T}$cf_cv_curses_acs_map" >&6
15133
15134 test "$cf_cv_curses_acs_map" != unknown &&
15135 cat >>confdefs.h <<EOF
15136 #define CURSES_ACS_ARRAY $cf_cv_curses_acs_map
15137 EOF
15138
15139 if test "$cf_enable_widec" = yes; then
15140
15141 echo "$as_me:15141: checking for wide alternate character set array" >&5
15142 echo $ECHO_N "checking for wide alternate character set array... $ECHO_C" >&6
15143 if test "${cf_cv_curses_wacs_map+set}" = set; then
15144   echo $ECHO_N "(cached) $ECHO_C" >&6
15145 else
15146
15147         cf_cv_curses_wacs_map=unknown
15148         for name in wacs_map _wacs_map __wacs_map _nc_wacs _wacs_char
15149         do
15150         cat >conftest.$ac_ext <<_ACEOF
15151 #line 15151 "configure"
15152 #include "confdefs.h"
15153
15154 #ifndef _XOPEN_SOURCE_EXTENDED
15155 #define _XOPEN_SOURCE_EXTENDED
15156 #endif
15157 #include <${cf_cv_ncurses_header:-curses.h}>
15158 int
15159 main ()
15160 {
15161 void *foo = &($name['k'])
15162   ;
15163   return 0;
15164 }
15165 _ACEOF
15166 rm -f conftest.$ac_objext conftest$ac_exeext
15167 if { (eval echo "$as_me:15167: \"$ac_link\"") >&5
15168   (eval $ac_link) 2>&5
15169   ac_status=$?
15170   echo "$as_me:15170: \$? = $ac_status" >&5
15171   (exit $ac_status); } &&
15172          { ac_try='test -s conftest$ac_exeext'
15173   { (eval echo "$as_me:15173: \"$ac_try\"") >&5
15174   (eval $ac_try) 2>&5
15175   ac_status=$?
15176   echo "$as_me:15176: \$? = $ac_status" >&5
15177   (exit $ac_status); }; }; then
15178   cf_cv_curses_wacs_map=$name
15179          break
15180 else
15181   echo "$as_me: failed program was:" >&5
15182 cat conftest.$ac_ext >&5
15183 fi
15184 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15185         done
15186 fi
15187 echo "$as_me:15187: result: $cf_cv_curses_wacs_map" >&5
15188 echo "${ECHO_T}$cf_cv_curses_wacs_map" >&6
15189
15190 test "$cf_cv_curses_wacs_map" != unknown &&
15191 cat >>confdefs.h <<EOF
15192 #define CURSES_WACS_ARRAY $cf_cv_curses_wacs_map
15193 EOF
15194
15195 echo "$as_me:15195: checking for wide alternate character constants" >&5
15196 echo $ECHO_N "checking for wide alternate character constants... $ECHO_C" >&6
15197 if test "${cf_cv_curses_wacs_symbols+set}" = set; then
15198   echo $ECHO_N "(cached) $ECHO_C" >&6
15199 else
15200
15201 cf_cv_curses_wacs_symbols=no
15202 if test "$cf_cv_curses_wacs_map" != unknown
15203 then
15204         cat >conftest.$ac_ext <<_ACEOF
15205 #line 15205 "configure"
15206 #include "confdefs.h"
15207
15208 #ifndef _XOPEN_SOURCE_EXTENDED
15209 #define _XOPEN_SOURCE_EXTENDED
15210 #endif
15211 #include <${cf_cv_ncurses_header:-curses.h}>
15212 int
15213 main ()
15214 {
15215 cchar_t *foo = WACS_PLUS;
15216          $cf_cv_curses_wacs_map['k'] = *WACS_PLUS
15217   ;
15218   return 0;
15219 }
15220 _ACEOF
15221 rm -f conftest.$ac_objext conftest$ac_exeext
15222 if { (eval echo "$as_me:15222: \"$ac_link\"") >&5
15223   (eval $ac_link) 2>&5
15224   ac_status=$?
15225   echo "$as_me:15225: \$? = $ac_status" >&5
15226   (exit $ac_status); } &&
15227          { ac_try='test -s conftest$ac_exeext'
15228   { (eval echo "$as_me:15228: \"$ac_try\"") >&5
15229   (eval $ac_try) 2>&5
15230   ac_status=$?
15231   echo "$as_me:15231: \$? = $ac_status" >&5
15232   (exit $ac_status); }; }; then
15233   cf_cv_curses_wacs_symbols=yes
15234 else
15235   echo "$as_me: failed program was:" >&5
15236 cat conftest.$ac_ext >&5
15237 fi
15238 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15239 else
15240         cat >conftest.$ac_ext <<_ACEOF
15241 #line 15241 "configure"
15242 #include "confdefs.h"
15243
15244 #ifndef _XOPEN_SOURCE_EXTENDED
15245 #define _XOPEN_SOURCE_EXTENDED
15246 #endif
15247 #include <${cf_cv_ncurses_header:-curses.h}>
15248 int
15249 main ()
15250 {
15251 cchar_t *foo = WACS_PLUS
15252   ;
15253   return 0;
15254 }
15255 _ACEOF
15256 rm -f conftest.$ac_objext conftest$ac_exeext
15257 if { (eval echo "$as_me:15257: \"$ac_link\"") >&5
15258   (eval $ac_link) 2>&5
15259   ac_status=$?
15260   echo "$as_me:15260: \$? = $ac_status" >&5
15261   (exit $ac_status); } &&
15262          { ac_try='test -s conftest$ac_exeext'
15263   { (eval echo "$as_me:15263: \"$ac_try\"") >&5
15264   (eval $ac_try) 2>&5
15265   ac_status=$?
15266   echo "$as_me:15266: \$? = $ac_status" >&5
15267   (exit $ac_status); }; }; then
15268   cf_cv_curses_wacs_symbols=yes
15269 else
15270   echo "$as_me: failed program was:" >&5
15271 cat conftest.$ac_ext >&5
15272 fi
15273 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15274 fi
15275
15276 fi
15277 echo "$as_me:15277: result: $cf_cv_curses_wacs_symbols" >&5
15278 echo "${ECHO_T}$cf_cv_curses_wacs_symbols" >&6
15279
15280 test "$cf_cv_curses_wacs_symbols" != no &&
15281 cat >>confdefs.h <<\EOF
15282 #define CURSES_WACS_SYMBOLS 1
15283 EOF
15284
15285 fi
15286
15287 echo "$as_me:15287: checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}" >&5
15288 echo $ECHO_N "checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
15289 cat >conftest.$ac_ext <<_ACEOF
15290 #line 15290 "configure"
15291 #include "confdefs.h"
15292
15293 #ifndef _XOPEN_SOURCE_EXTENDED
15294 #define _XOPEN_SOURCE_EXTENDED
15295 #endif
15296 #include <${cf_cv_ncurses_header:-curses.h}>
15297 int
15298 main ()
15299 {
15300
15301 attr_t foo
15302
15303   ;
15304   return 0;
15305 }
15306 _ACEOF
15307 rm -f conftest.$ac_objext
15308 if { (eval echo "$as_me:15308: \"$ac_compile\"") >&5
15309   (eval $ac_compile) 2>&5
15310   ac_status=$?
15311   echo "$as_me:15311: \$? = $ac_status" >&5
15312   (exit $ac_status); } &&
15313          { ac_try='test -s conftest.$ac_objext'
15314   { (eval echo "$as_me:15314: \"$ac_try\"") >&5
15315   (eval $ac_try) 2>&5
15316   ac_status=$?
15317   echo "$as_me:15317: \$? = $ac_status" >&5
15318   (exit $ac_status); }; }; then
15319   cf_result=yes
15320 else
15321   echo "$as_me: failed program was:" >&5
15322 cat conftest.$ac_ext >&5
15323 cf_result=no
15324 fi
15325 rm -f conftest.$ac_objext conftest.$ac_ext
15326 echo "$as_me:15326: result: $cf_result" >&5
15327 echo "${ECHO_T}$cf_result" >&6
15328 if test $cf_result = yes ; then
15329
15330 cf_result=`echo "have_type_attr_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15331
15332 cat >>confdefs.h <<EOF
15333 #define $cf_result 1
15334 EOF
15335
15336 else
15337
15338 cat >>confdefs.h <<EOF
15339 #define attr_t long
15340 EOF
15341
15342 fi
15343
15344 if test "$cf_enable_widec" = yes; then
15345
15346 # This is needed on Tru64 5.0 to declare mbstate_t
15347 echo "$as_me:15347: checking if we must include wchar.h to declare mbstate_t" >&5
15348 echo $ECHO_N "checking if we must include wchar.h to declare mbstate_t... $ECHO_C" >&6
15349 if test "${cf_cv_mbstate_t+set}" = set; then
15350   echo $ECHO_N "(cached) $ECHO_C" >&6
15351 else
15352
15353 cat >conftest.$ac_ext <<_ACEOF
15354 #line 15354 "configure"
15355 #include "confdefs.h"
15356
15357 #include <stdlib.h>
15358 #include <stdarg.h>
15359 #include <stdio.h>
15360 #ifdef HAVE_LIBUTF8_H
15361 #include <libutf8.h>
15362 #endif
15363 int
15364 main ()
15365 {
15366 mbstate_t state
15367   ;
15368   return 0;
15369 }
15370 _ACEOF
15371 rm -f conftest.$ac_objext
15372 if { (eval echo "$as_me:15372: \"$ac_compile\"") >&5
15373   (eval $ac_compile) 2>&5
15374   ac_status=$?
15375   echo "$as_me:15375: \$? = $ac_status" >&5
15376   (exit $ac_status); } &&
15377          { ac_try='test -s conftest.$ac_objext'
15378   { (eval echo "$as_me:15378: \"$ac_try\"") >&5
15379   (eval $ac_try) 2>&5
15380   ac_status=$?
15381   echo "$as_me:15381: \$? = $ac_status" >&5
15382   (exit $ac_status); }; }; then
15383   cf_cv_mbstate_t=no
15384 else
15385   echo "$as_me: failed program was:" >&5
15386 cat conftest.$ac_ext >&5
15387 cat >conftest.$ac_ext <<_ACEOF
15388 #line 15388 "configure"
15389 #include "confdefs.h"
15390
15391 #include <stdlib.h>
15392 #include <stdarg.h>
15393 #include <stdio.h>
15394 #include <wchar.h>
15395 #ifdef HAVE_LIBUTF8_H
15396 #include <libutf8.h>
15397 #endif
15398 int
15399 main ()
15400 {
15401 mbstate_t value
15402   ;
15403   return 0;
15404 }
15405 _ACEOF
15406 rm -f conftest.$ac_objext
15407 if { (eval echo "$as_me:15407: \"$ac_compile\"") >&5
15408   (eval $ac_compile) 2>&5
15409   ac_status=$?
15410   echo "$as_me:15410: \$? = $ac_status" >&5
15411   (exit $ac_status); } &&
15412          { ac_try='test -s conftest.$ac_objext'
15413   { (eval echo "$as_me:15413: \"$ac_try\"") >&5
15414   (eval $ac_try) 2>&5
15415   ac_status=$?
15416   echo "$as_me:15416: \$? = $ac_status" >&5
15417   (exit $ac_status); }; }; then
15418   cf_cv_mbstate_t=yes
15419 else
15420   echo "$as_me: failed program was:" >&5
15421 cat conftest.$ac_ext >&5
15422 cf_cv_mbstate_t=unknown
15423 fi
15424 rm -f conftest.$ac_objext conftest.$ac_ext
15425 fi
15426 rm -f conftest.$ac_objext conftest.$ac_ext
15427 fi
15428 echo "$as_me:15428: result: $cf_cv_mbstate_t" >&5
15429 echo "${ECHO_T}$cf_cv_mbstate_t" >&6
15430
15431 if test "$cf_cv_mbstate_t" = yes ; then
15432
15433 cat >>confdefs.h <<\EOF
15434 #define NEED_WCHAR_H 1
15435 EOF
15436
15437         NEED_WCHAR_H=1
15438 fi
15439
15440 # if we do not find mbstate_t in either place, use substitution to provide a fallback.
15441 if test "$cf_cv_mbstate_t" = unknown ; then
15442         NCURSES_MBSTATE_T=1
15443 fi
15444
15445 # if we find mbstate_t in either place, use substitution to provide a fallback.
15446 if test "$cf_cv_mbstate_t" != unknown ; then
15447         NCURSES_OK_MBSTATE_T=1
15448 fi
15449
15450 # This is needed on Tru64 5.0 to declare wchar_t
15451 echo "$as_me:15451: checking if we must include wchar.h to declare wchar_t" >&5
15452 echo $ECHO_N "checking if we must include wchar.h to declare wchar_t... $ECHO_C" >&6
15453 if test "${cf_cv_wchar_t+set}" = set; then
15454   echo $ECHO_N "(cached) $ECHO_C" >&6
15455 else
15456
15457 cat >conftest.$ac_ext <<_ACEOF
15458 #line 15458 "configure"
15459 #include "confdefs.h"
15460
15461 #include <stdlib.h>
15462 #include <stdarg.h>
15463 #include <stdio.h>
15464 #ifdef HAVE_LIBUTF8_H
15465 #include <libutf8.h>
15466 #endif
15467 int
15468 main ()
15469 {
15470 wchar_t state
15471   ;
15472   return 0;
15473 }
15474 _ACEOF
15475 rm -f conftest.$ac_objext
15476 if { (eval echo "$as_me:15476: \"$ac_compile\"") >&5
15477   (eval $ac_compile) 2>&5
15478   ac_status=$?
15479   echo "$as_me:15479: \$? = $ac_status" >&5
15480   (exit $ac_status); } &&
15481          { ac_try='test -s conftest.$ac_objext'
15482   { (eval echo "$as_me:15482: \"$ac_try\"") >&5
15483   (eval $ac_try) 2>&5
15484   ac_status=$?
15485   echo "$as_me:15485: \$? = $ac_status" >&5
15486   (exit $ac_status); }; }; then
15487   cf_cv_wchar_t=no
15488 else
15489   echo "$as_me: failed program was:" >&5
15490 cat conftest.$ac_ext >&5
15491 cat >conftest.$ac_ext <<_ACEOF
15492 #line 15492 "configure"
15493 #include "confdefs.h"
15494
15495 #include <stdlib.h>
15496 #include <stdarg.h>
15497 #include <stdio.h>
15498 #include <wchar.h>
15499 #ifdef HAVE_LIBUTF8_H
15500 #include <libutf8.h>
15501 #endif
15502 int
15503 main ()
15504 {
15505 wchar_t value
15506   ;
15507   return 0;
15508 }
15509 _ACEOF
15510 rm -f conftest.$ac_objext
15511 if { (eval echo "$as_me:15511: \"$ac_compile\"") >&5
15512   (eval $ac_compile) 2>&5
15513   ac_status=$?
15514   echo "$as_me:15514: \$? = $ac_status" >&5
15515   (exit $ac_status); } &&
15516          { ac_try='test -s conftest.$ac_objext'
15517   { (eval echo "$as_me:15517: \"$ac_try\"") >&5
15518   (eval $ac_try) 2>&5
15519   ac_status=$?
15520   echo "$as_me:15520: \$? = $ac_status" >&5
15521   (exit $ac_status); }; }; then
15522   cf_cv_wchar_t=yes
15523 else
15524   echo "$as_me: failed program was:" >&5
15525 cat conftest.$ac_ext >&5
15526 cf_cv_wchar_t=unknown
15527 fi
15528 rm -f conftest.$ac_objext conftest.$ac_ext
15529 fi
15530 rm -f conftest.$ac_objext conftest.$ac_ext
15531 fi
15532 echo "$as_me:15532: result: $cf_cv_wchar_t" >&5
15533 echo "${ECHO_T}$cf_cv_wchar_t" >&6
15534
15535 if test "$cf_cv_wchar_t" = yes ; then
15536
15537 cat >>confdefs.h <<\EOF
15538 #define NEED_WCHAR_H 1
15539 EOF
15540
15541         NEED_WCHAR_H=1
15542 fi
15543
15544 # if we do not find wchar_t in either place, use substitution to provide a fallback.
15545 if test "$cf_cv_wchar_t" = unknown ; then
15546         NCURSES_WCHAR_T=1
15547 fi
15548
15549 # if we find wchar_t in either place, use substitution to provide a fallback.
15550 if test "$cf_cv_wchar_t" != unknown ; then
15551         NCURSES_OK_WCHAR_T=1
15552 fi
15553
15554 # This is needed on Tru64 5.0 to declare wint_t
15555 echo "$as_me:15555: checking if we must include wchar.h to declare wint_t" >&5
15556 echo $ECHO_N "checking if we must include wchar.h to declare wint_t... $ECHO_C" >&6
15557 if test "${cf_cv_wint_t+set}" = set; then
15558   echo $ECHO_N "(cached) $ECHO_C" >&6
15559 else
15560
15561 cat >conftest.$ac_ext <<_ACEOF
15562 #line 15562 "configure"
15563 #include "confdefs.h"
15564
15565 #include <stdlib.h>
15566 #include <stdarg.h>
15567 #include <stdio.h>
15568 #ifdef HAVE_LIBUTF8_H
15569 #include <libutf8.h>
15570 #endif
15571 int
15572 main ()
15573 {
15574 wint_t state
15575   ;
15576   return 0;
15577 }
15578 _ACEOF
15579 rm -f conftest.$ac_objext
15580 if { (eval echo "$as_me:15580: \"$ac_compile\"") >&5
15581   (eval $ac_compile) 2>&5
15582   ac_status=$?
15583   echo "$as_me:15583: \$? = $ac_status" >&5
15584   (exit $ac_status); } &&
15585          { ac_try='test -s conftest.$ac_objext'
15586   { (eval echo "$as_me:15586: \"$ac_try\"") >&5
15587   (eval $ac_try) 2>&5
15588   ac_status=$?
15589   echo "$as_me:15589: \$? = $ac_status" >&5
15590   (exit $ac_status); }; }; then
15591   cf_cv_wint_t=no
15592 else
15593   echo "$as_me: failed program was:" >&5
15594 cat conftest.$ac_ext >&5
15595 cat >conftest.$ac_ext <<_ACEOF
15596 #line 15596 "configure"
15597 #include "confdefs.h"
15598
15599 #include <stdlib.h>
15600 #include <stdarg.h>
15601 #include <stdio.h>
15602 #include <wchar.h>
15603 #ifdef HAVE_LIBUTF8_H
15604 #include <libutf8.h>
15605 #endif
15606 int
15607 main ()
15608 {
15609 wint_t value
15610   ;
15611   return 0;
15612 }
15613 _ACEOF
15614 rm -f conftest.$ac_objext
15615 if { (eval echo "$as_me:15615: \"$ac_compile\"") >&5
15616   (eval $ac_compile) 2>&5
15617   ac_status=$?
15618   echo "$as_me:15618: \$? = $ac_status" >&5
15619   (exit $ac_status); } &&
15620          { ac_try='test -s conftest.$ac_objext'
15621   { (eval echo "$as_me:15621: \"$ac_try\"") >&5
15622   (eval $ac_try) 2>&5
15623   ac_status=$?
15624   echo "$as_me:15624: \$? = $ac_status" >&5
15625   (exit $ac_status); }; }; then
15626   cf_cv_wint_t=yes
15627 else
15628   echo "$as_me: failed program was:" >&5
15629 cat conftest.$ac_ext >&5
15630 cf_cv_wint_t=unknown
15631 fi
15632 rm -f conftest.$ac_objext conftest.$ac_ext
15633 fi
15634 rm -f conftest.$ac_objext conftest.$ac_ext
15635 fi
15636 echo "$as_me:15636: result: $cf_cv_wint_t" >&5
15637 echo "${ECHO_T}$cf_cv_wint_t" >&6
15638
15639 if test "$cf_cv_wint_t" = yes ; then
15640
15641 cat >>confdefs.h <<\EOF
15642 #define NEED_WCHAR_H 1
15643 EOF
15644
15645         NEED_WCHAR_H=1
15646 fi
15647
15648 # if we do not find wint_t in either place, use substitution to provide a fallback.
15649 if test "$cf_cv_wint_t" = unknown ; then
15650         NCURSES_WINT_T=1
15651 fi
15652
15653 # if we find wint_t in either place, use substitution to provide a fallback.
15654 if test "$cf_cv_wint_t" != unknown ; then
15655         NCURSES_OK_WINT_T=1
15656 fi
15657
15658         if test "$NCURSES_OK_MBSTATE_T" = 0 ; then
15659
15660 echo "$as_me:15660: checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}" >&5
15661 echo $ECHO_N "checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
15662 cat >conftest.$ac_ext <<_ACEOF
15663 #line 15663 "configure"
15664 #include "confdefs.h"
15665
15666 #ifndef _XOPEN_SOURCE_EXTENDED
15667 #define _XOPEN_SOURCE_EXTENDED
15668 #endif
15669 #include <${cf_cv_ncurses_header:-curses.h}>
15670 int
15671 main ()
15672 {
15673
15674 mbstate_t foo
15675
15676   ;
15677   return 0;
15678 }
15679 _ACEOF
15680 rm -f conftest.$ac_objext
15681 if { (eval echo "$as_me:15681: \"$ac_compile\"") >&5
15682   (eval $ac_compile) 2>&5
15683   ac_status=$?
15684   echo "$as_me:15684: \$? = $ac_status" >&5
15685   (exit $ac_status); } &&
15686          { ac_try='test -s conftest.$ac_objext'
15687   { (eval echo "$as_me:15687: \"$ac_try\"") >&5
15688   (eval $ac_try) 2>&5
15689   ac_status=$?
15690   echo "$as_me:15690: \$? = $ac_status" >&5
15691   (exit $ac_status); }; }; then
15692   cf_result=yes
15693 else
15694   echo "$as_me: failed program was:" >&5
15695 cat conftest.$ac_ext >&5
15696 cf_result=no
15697 fi
15698 rm -f conftest.$ac_objext conftest.$ac_ext
15699 echo "$as_me:15699: result: $cf_result" >&5
15700 echo "${ECHO_T}$cf_result" >&6
15701 if test $cf_result = yes ; then
15702
15703 cf_result=`echo "have_type_mbstate_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15704
15705 cat >>confdefs.h <<EOF
15706 #define $cf_result 1
15707 EOF
15708
15709 else
15710
15711 cat >>confdefs.h <<EOF
15712 #define mbstate_t long
15713 EOF
15714
15715 fi
15716
15717         fi
15718
15719         if test "$NCURSES_OK_WCHAR_T" = 0 ; then
15720
15721 echo "$as_me:15721: checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}" >&5
15722 echo $ECHO_N "checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
15723 cat >conftest.$ac_ext <<_ACEOF
15724 #line 15724 "configure"
15725 #include "confdefs.h"
15726
15727 #ifndef _XOPEN_SOURCE_EXTENDED
15728 #define _XOPEN_SOURCE_EXTENDED
15729 #endif
15730 #include <${cf_cv_ncurses_header:-curses.h}>
15731 int
15732 main ()
15733 {
15734
15735 wchar_t foo
15736
15737   ;
15738   return 0;
15739 }
15740 _ACEOF
15741 rm -f conftest.$ac_objext
15742 if { (eval echo "$as_me:15742: \"$ac_compile\"") >&5
15743   (eval $ac_compile) 2>&5
15744   ac_status=$?
15745   echo "$as_me:15745: \$? = $ac_status" >&5
15746   (exit $ac_status); } &&
15747          { ac_try='test -s conftest.$ac_objext'
15748   { (eval echo "$as_me:15748: \"$ac_try\"") >&5
15749   (eval $ac_try) 2>&5
15750   ac_status=$?
15751   echo "$as_me:15751: \$? = $ac_status" >&5
15752   (exit $ac_status); }; }; then
15753   cf_result=yes
15754 else
15755   echo "$as_me: failed program was:" >&5
15756 cat conftest.$ac_ext >&5
15757 cf_result=no
15758 fi
15759 rm -f conftest.$ac_objext conftest.$ac_ext
15760 echo "$as_me:15760: result: $cf_result" >&5
15761 echo "${ECHO_T}$cf_result" >&6
15762 if test $cf_result = yes ; then
15763
15764 cf_result=`echo "have_type_wchar_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15765
15766 cat >>confdefs.h <<EOF
15767 #define $cf_result 1
15768 EOF
15769
15770 else
15771
15772 cat >>confdefs.h <<EOF
15773 #define wchar_t long
15774 EOF
15775
15776 fi
15777
15778         fi
15779
15780         if test "$NCURSES_OK_WINT_T" = 0 ; then
15781
15782 echo "$as_me:15782: checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}" >&5
15783 echo $ECHO_N "checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
15784 cat >conftest.$ac_ext <<_ACEOF
15785 #line 15785 "configure"
15786 #include "confdefs.h"
15787
15788 #ifndef _XOPEN_SOURCE_EXTENDED
15789 #define _XOPEN_SOURCE_EXTENDED
15790 #endif
15791 #include <${cf_cv_ncurses_header:-curses.h}>
15792 int
15793 main ()
15794 {
15795
15796 wint_t foo
15797
15798   ;
15799   return 0;
15800 }
15801 _ACEOF
15802 rm -f conftest.$ac_objext
15803 if { (eval echo "$as_me:15803: \"$ac_compile\"") >&5
15804   (eval $ac_compile) 2>&5
15805   ac_status=$?
15806   echo "$as_me:15806: \$? = $ac_status" >&5
15807   (exit $ac_status); } &&
15808          { ac_try='test -s conftest.$ac_objext'
15809   { (eval echo "$as_me:15809: \"$ac_try\"") >&5
15810   (eval $ac_try) 2>&5
15811   ac_status=$?
15812   echo "$as_me:15812: \$? = $ac_status" >&5
15813   (exit $ac_status); }; }; then
15814   cf_result=yes
15815 else
15816   echo "$as_me: failed program was:" >&5
15817 cat conftest.$ac_ext >&5
15818 cf_result=no
15819 fi
15820 rm -f conftest.$ac_objext conftest.$ac_ext
15821 echo "$as_me:15821: result: $cf_result" >&5
15822 echo "${ECHO_T}$cf_result" >&6
15823 if test $cf_result = yes ; then
15824
15825 cf_result=`echo "have_type_wint_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15826
15827 cat >>confdefs.h <<EOF
15828 #define $cf_result 1
15829 EOF
15830
15831 else
15832
15833 cat >>confdefs.h <<EOF
15834 #define wint_t long
15835 EOF
15836
15837 fi
15838
15839         fi
15840 fi
15841
15842 echo "$as_me:15842: checking for data ospeed declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
15843 echo $ECHO_N "checking for data ospeed declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
15844
15845 cat >conftest.$ac_ext <<_ACEOF
15846 #line 15846 "configure"
15847 #include "confdefs.h"
15848
15849 #ifdef HAVE_XCURSES
15850 #include <xcurses.h>
15851 char * XCursesProgramName = "test";
15852 #else
15853 #include <${cf_cv_ncurses_header:-curses.h}>
15854 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
15855 #include <ncursesw/term.h>
15856 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
15857 #include <ncurses/term.h>
15858 #elif defined(HAVE_TERM_H)
15859 #include <term.h>
15860 #endif
15861 #endif
15862
15863 int
15864 main ()
15865 {
15866
15867 void *foo = &(ospeed)
15868
15869   ;
15870   return 0;
15871 }
15872 _ACEOF
15873 rm -f conftest.$ac_objext
15874 if { (eval echo "$as_me:15874: \"$ac_compile\"") >&5
15875   (eval $ac_compile) 2>&5
15876   ac_status=$?
15877   echo "$as_me:15877: \$? = $ac_status" >&5
15878   (exit $ac_status); } &&
15879          { ac_try='test -s conftest.$ac_objext'
15880   { (eval echo "$as_me:15880: \"$ac_try\"") >&5
15881   (eval $ac_try) 2>&5
15882   ac_status=$?
15883   echo "$as_me:15883: \$? = $ac_status" >&5
15884   (exit $ac_status); }; }; then
15885   cf_result=yes
15886 else
15887   echo "$as_me: failed program was:" >&5
15888 cat conftest.$ac_ext >&5
15889 cf_result=no
15890 fi
15891 rm -f conftest.$ac_objext conftest.$ac_ext
15892 echo "$as_me:15892: result: $cf_result" >&5
15893 echo "${ECHO_T}$cf_result" >&6
15894
15895 if test $cf_result = yes ; then
15896
15897 cf_result=`echo "have_curses_data_ospeed" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15898
15899         cat >>confdefs.h <<EOF
15900 #define $cf_result 1
15901 EOF
15902
15903 else
15904         echo "$as_me:15904: checking for data ospeed in library" >&5
15905 echo $ECHO_N "checking for data ospeed in library... $ECHO_C" >&6
15906         # BSD linkers insist on making weak linkage, but resolve at runtime.
15907         if test "$cross_compiling" = yes; then
15908
15909         # cross-compiling
15910         cat >conftest.$ac_ext <<_ACEOF
15911 #line 15911 "configure"
15912 #include "confdefs.h"
15913
15914 #ifdef HAVE_XCURSES
15915 #include <xcurses.h>
15916 char * XCursesProgramName = "test";
15917 #else
15918 #include <${cf_cv_ncurses_header:-curses.h}>
15919 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
15920 #include <ncursesw/term.h>
15921 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
15922 #include <ncurses/term.h>
15923 #elif defined(HAVE_TERM_H)
15924 #include <term.h>
15925 #endif
15926 #endif
15927
15928 extern char ospeed;
15929 int
15930 main ()
15931 {
15932
15933         do {
15934                 void *foo = &(ospeed);
15935                 fprintf(stderr, "testing linkage of ospeed:%p\n", foo);
15936                 ${cf_cv_main_return:-return}(foo == 0);
15937         } while (0)
15938
15939   ;
15940   return 0;
15941 }
15942 _ACEOF
15943 rm -f conftest.$ac_objext conftest$ac_exeext
15944 if { (eval echo "$as_me:15944: \"$ac_link\"") >&5
15945   (eval $ac_link) 2>&5
15946   ac_status=$?
15947   echo "$as_me:15947: \$? = $ac_status" >&5
15948   (exit $ac_status); } &&
15949          { ac_try='test -s conftest$ac_exeext'
15950   { (eval echo "$as_me:15950: \"$ac_try\"") >&5
15951   (eval $ac_try) 2>&5
15952   ac_status=$?
15953   echo "$as_me:15953: \$? = $ac_status" >&5
15954   (exit $ac_status); }; }; then
15955   cf_result=yes
15956 else
15957   echo "$as_me: failed program was:" >&5
15958 cat conftest.$ac_ext >&5
15959 cf_result=no
15960 fi
15961 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15962
15963 else
15964   cat >conftest.$ac_ext <<_ACEOF
15965 #line 15965 "configure"
15966 #include "confdefs.h"
15967
15968 #ifdef HAVE_XCURSES
15969 #include <xcurses.h>
15970 char * XCursesProgramName = "test";
15971 #else
15972 #include <${cf_cv_ncurses_header:-curses.h}>
15973 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
15974 #include <ncursesw/term.h>
15975 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
15976 #include <ncurses/term.h>
15977 #elif defined(HAVE_TERM_H)
15978 #include <term.h>
15979 #endif
15980 #endif
15981
15982 extern char ospeed;
15983 int main(void)
15984 {
15985         void *foo = &(ospeed);
15986         fprintf(stderr, "testing linkage of ospeed:%p\n", foo);
15987         ${cf_cv_main_return:-return}(foo == 0);
15988 }
15989 _ACEOF
15990 rm -f conftest$ac_exeext
15991 if { (eval echo "$as_me:15991: \"$ac_link\"") >&5
15992   (eval $ac_link) 2>&5
15993   ac_status=$?
15994   echo "$as_me:15994: \$? = $ac_status" >&5
15995   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
15996   { (eval echo "$as_me:15996: \"$ac_try\"") >&5
15997   (eval $ac_try) 2>&5
15998   ac_status=$?
15999   echo "$as_me:15999: \$? = $ac_status" >&5
16000   (exit $ac_status); }; }; then
16001   cf_result=yes
16002 else
16003   echo "$as_me: program exited with status $ac_status" >&5
16004 echo "$as_me: failed program was:" >&5
16005 cat conftest.$ac_ext >&5
16006 cf_result=no
16007 fi
16008 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
16009 fi
16010         echo "$as_me:16010: result: $cf_result" >&5
16011 echo "${ECHO_T}$cf_result" >&6
16012         if test $cf_result = yes ; then
16013
16014 cf_result=`echo "decl_curses_data_ospeed" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16015
16016                 cat >>confdefs.h <<EOF
16017 #define $cf_result 1
16018 EOF
16019
16020         fi
16021 fi
16022
16023 echo "$as_me:16023: checking for data boolnames declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
16024 echo $ECHO_N "checking for data boolnames declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
16025
16026 cat >conftest.$ac_ext <<_ACEOF
16027 #line 16027 "configure"
16028 #include "confdefs.h"
16029
16030 #ifdef HAVE_XCURSES
16031 #include <xcurses.h>
16032 char * XCursesProgramName = "test";
16033 #else
16034 #include <${cf_cv_ncurses_header:-curses.h}>
16035 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16036 #include <ncursesw/term.h>
16037 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16038 #include <ncurses/term.h>
16039 #elif defined(HAVE_TERM_H)
16040 #include <term.h>
16041 #endif
16042 #endif
16043
16044 int
16045 main ()
16046 {
16047
16048 void *foo = &(boolnames)
16049
16050   ;
16051   return 0;
16052 }
16053 _ACEOF
16054 rm -f conftest.$ac_objext
16055 if { (eval echo "$as_me:16055: \"$ac_compile\"") >&5
16056   (eval $ac_compile) 2>&5
16057   ac_status=$?
16058   echo "$as_me:16058: \$? = $ac_status" >&5
16059   (exit $ac_status); } &&
16060          { ac_try='test -s conftest.$ac_objext'
16061   { (eval echo "$as_me:16061: \"$ac_try\"") >&5
16062   (eval $ac_try) 2>&5
16063   ac_status=$?
16064   echo "$as_me:16064: \$? = $ac_status" >&5
16065   (exit $ac_status); }; }; then
16066   cf_result=yes
16067 else
16068   echo "$as_me: failed program was:" >&5
16069 cat conftest.$ac_ext >&5
16070 cf_result=no
16071 fi
16072 rm -f conftest.$ac_objext conftest.$ac_ext
16073 echo "$as_me:16073: result: $cf_result" >&5
16074 echo "${ECHO_T}$cf_result" >&6
16075
16076 if test $cf_result = yes ; then
16077
16078 cf_result=`echo "have_curses_data_boolnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16079
16080         cat >>confdefs.h <<EOF
16081 #define $cf_result 1
16082 EOF
16083
16084 else
16085         echo "$as_me:16085: checking for data boolnames in library" >&5
16086 echo $ECHO_N "checking for data boolnames in library... $ECHO_C" >&6
16087         # BSD linkers insist on making weak linkage, but resolve at runtime.
16088         if test "$cross_compiling" = yes; then
16089
16090         # cross-compiling
16091         cat >conftest.$ac_ext <<_ACEOF
16092 #line 16092 "configure"
16093 #include "confdefs.h"
16094
16095 #ifdef HAVE_XCURSES
16096 #include <xcurses.h>
16097 char * XCursesProgramName = "test";
16098 #else
16099 #include <${cf_cv_ncurses_header:-curses.h}>
16100 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16101 #include <ncursesw/term.h>
16102 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16103 #include <ncurses/term.h>
16104 #elif defined(HAVE_TERM_H)
16105 #include <term.h>
16106 #endif
16107 #endif
16108
16109 extern char boolnames;
16110 int
16111 main ()
16112 {
16113
16114         do {
16115                 void *foo = &(boolnames);
16116                 fprintf(stderr, "testing linkage of boolnames:%p\n", foo);
16117                 ${cf_cv_main_return:-return}(foo == 0);
16118         } while (0)
16119
16120   ;
16121   return 0;
16122 }
16123 _ACEOF
16124 rm -f conftest.$ac_objext conftest$ac_exeext
16125 if { (eval echo "$as_me:16125: \"$ac_link\"") >&5
16126   (eval $ac_link) 2>&5
16127   ac_status=$?
16128   echo "$as_me:16128: \$? = $ac_status" >&5
16129   (exit $ac_status); } &&
16130          { ac_try='test -s conftest$ac_exeext'
16131   { (eval echo "$as_me:16131: \"$ac_try\"") >&5
16132   (eval $ac_try) 2>&5
16133   ac_status=$?
16134   echo "$as_me:16134: \$? = $ac_status" >&5
16135   (exit $ac_status); }; }; then
16136   cf_result=yes
16137 else
16138   echo "$as_me: failed program was:" >&5
16139 cat conftest.$ac_ext >&5
16140 cf_result=no
16141 fi
16142 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16143
16144 else
16145   cat >conftest.$ac_ext <<_ACEOF
16146 #line 16146 "configure"
16147 #include "confdefs.h"
16148
16149 #ifdef HAVE_XCURSES
16150 #include <xcurses.h>
16151 char * XCursesProgramName = "test";
16152 #else
16153 #include <${cf_cv_ncurses_header:-curses.h}>
16154 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16155 #include <ncursesw/term.h>
16156 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16157 #include <ncurses/term.h>
16158 #elif defined(HAVE_TERM_H)
16159 #include <term.h>
16160 #endif
16161 #endif
16162
16163 extern char boolnames;
16164 int main(void)
16165 {
16166         void *foo = &(boolnames);
16167         fprintf(stderr, "testing linkage of boolnames:%p\n", foo);
16168         ${cf_cv_main_return:-return}(foo == 0);
16169 }
16170 _ACEOF
16171 rm -f conftest$ac_exeext
16172 if { (eval echo "$as_me:16172: \"$ac_link\"") >&5
16173   (eval $ac_link) 2>&5
16174   ac_status=$?
16175   echo "$as_me:16175: \$? = $ac_status" >&5
16176   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
16177   { (eval echo "$as_me:16177: \"$ac_try\"") >&5
16178   (eval $ac_try) 2>&5
16179   ac_status=$?
16180   echo "$as_me:16180: \$? = $ac_status" >&5
16181   (exit $ac_status); }; }; then
16182   cf_result=yes
16183 else
16184   echo "$as_me: program exited with status $ac_status" >&5
16185 echo "$as_me: failed program was:" >&5
16186 cat conftest.$ac_ext >&5
16187 cf_result=no
16188 fi
16189 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
16190 fi
16191         echo "$as_me:16191: result: $cf_result" >&5
16192 echo "${ECHO_T}$cf_result" >&6
16193         if test $cf_result = yes ; then
16194
16195 cf_result=`echo "decl_curses_data_boolnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16196
16197                 cat >>confdefs.h <<EOF
16198 #define $cf_result 1
16199 EOF
16200
16201         fi
16202 fi
16203
16204 echo "$as_me:16204: checking for data boolfnames declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
16205 echo $ECHO_N "checking for data boolfnames declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
16206
16207 cat >conftest.$ac_ext <<_ACEOF
16208 #line 16208 "configure"
16209 #include "confdefs.h"
16210
16211 #ifdef HAVE_XCURSES
16212 #include <xcurses.h>
16213 char * XCursesProgramName = "test";
16214 #else
16215 #include <${cf_cv_ncurses_header:-curses.h}>
16216 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16217 #include <ncursesw/term.h>
16218 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16219 #include <ncurses/term.h>
16220 #elif defined(HAVE_TERM_H)
16221 #include <term.h>
16222 #endif
16223 #endif
16224
16225 int
16226 main ()
16227 {
16228
16229 void *foo = &(boolfnames)
16230
16231   ;
16232   return 0;
16233 }
16234 _ACEOF
16235 rm -f conftest.$ac_objext
16236 if { (eval echo "$as_me:16236: \"$ac_compile\"") >&5
16237   (eval $ac_compile) 2>&5
16238   ac_status=$?
16239   echo "$as_me:16239: \$? = $ac_status" >&5
16240   (exit $ac_status); } &&
16241          { ac_try='test -s conftest.$ac_objext'
16242   { (eval echo "$as_me:16242: \"$ac_try\"") >&5
16243   (eval $ac_try) 2>&5
16244   ac_status=$?
16245   echo "$as_me:16245: \$? = $ac_status" >&5
16246   (exit $ac_status); }; }; then
16247   cf_result=yes
16248 else
16249   echo "$as_me: failed program was:" >&5
16250 cat conftest.$ac_ext >&5
16251 cf_result=no
16252 fi
16253 rm -f conftest.$ac_objext conftest.$ac_ext
16254 echo "$as_me:16254: result: $cf_result" >&5
16255 echo "${ECHO_T}$cf_result" >&6
16256
16257 if test $cf_result = yes ; then
16258
16259 cf_result=`echo "have_curses_data_boolfnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16260
16261         cat >>confdefs.h <<EOF
16262 #define $cf_result 1
16263 EOF
16264
16265 else
16266         echo "$as_me:16266: checking for data boolfnames in library" >&5
16267 echo $ECHO_N "checking for data boolfnames in library... $ECHO_C" >&6
16268         # BSD linkers insist on making weak linkage, but resolve at runtime.
16269         if test "$cross_compiling" = yes; then
16270
16271         # cross-compiling
16272         cat >conftest.$ac_ext <<_ACEOF
16273 #line 16273 "configure"
16274 #include "confdefs.h"
16275
16276 #ifdef HAVE_XCURSES
16277 #include <xcurses.h>
16278 char * XCursesProgramName = "test";
16279 #else
16280 #include <${cf_cv_ncurses_header:-curses.h}>
16281 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16282 #include <ncursesw/term.h>
16283 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16284 #include <ncurses/term.h>
16285 #elif defined(HAVE_TERM_H)
16286 #include <term.h>
16287 #endif
16288 #endif
16289
16290 extern char boolfnames;
16291 int
16292 main ()
16293 {
16294
16295         do {
16296                 void *foo = &(boolfnames);
16297                 fprintf(stderr, "testing linkage of boolfnames:%p\n", foo);
16298                 ${cf_cv_main_return:-return}(foo == 0);
16299         } while (0)
16300
16301   ;
16302   return 0;
16303 }
16304 _ACEOF
16305 rm -f conftest.$ac_objext conftest$ac_exeext
16306 if { (eval echo "$as_me:16306: \"$ac_link\"") >&5
16307   (eval $ac_link) 2>&5
16308   ac_status=$?
16309   echo "$as_me:16309: \$? = $ac_status" >&5
16310   (exit $ac_status); } &&
16311          { ac_try='test -s conftest$ac_exeext'
16312   { (eval echo "$as_me:16312: \"$ac_try\"") >&5
16313   (eval $ac_try) 2>&5
16314   ac_status=$?
16315   echo "$as_me:16315: \$? = $ac_status" >&5
16316   (exit $ac_status); }; }; then
16317   cf_result=yes
16318 else
16319   echo "$as_me: failed program was:" >&5
16320 cat conftest.$ac_ext >&5
16321 cf_result=no
16322 fi
16323 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16324
16325 else
16326   cat >conftest.$ac_ext <<_ACEOF
16327 #line 16327 "configure"
16328 #include "confdefs.h"
16329
16330 #ifdef HAVE_XCURSES
16331 #include <xcurses.h>
16332 char * XCursesProgramName = "test";
16333 #else
16334 #include <${cf_cv_ncurses_header:-curses.h}>
16335 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16336 #include <ncursesw/term.h>
16337 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16338 #include <ncurses/term.h>
16339 #elif defined(HAVE_TERM_H)
16340 #include <term.h>
16341 #endif
16342 #endif
16343
16344 extern char boolfnames;
16345 int main(void)
16346 {
16347         void *foo = &(boolfnames);
16348         fprintf(stderr, "testing linkage of boolfnames:%p\n", foo);
16349         ${cf_cv_main_return:-return}(foo == 0);
16350 }
16351 _ACEOF
16352 rm -f conftest$ac_exeext
16353 if { (eval echo "$as_me:16353: \"$ac_link\"") >&5
16354   (eval $ac_link) 2>&5
16355   ac_status=$?
16356   echo "$as_me:16356: \$? = $ac_status" >&5
16357   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
16358   { (eval echo "$as_me:16358: \"$ac_try\"") >&5
16359   (eval $ac_try) 2>&5
16360   ac_status=$?
16361   echo "$as_me:16361: \$? = $ac_status" >&5
16362   (exit $ac_status); }; }; then
16363   cf_result=yes
16364 else
16365   echo "$as_me: program exited with status $ac_status" >&5
16366 echo "$as_me: failed program was:" >&5
16367 cat conftest.$ac_ext >&5
16368 cf_result=no
16369 fi
16370 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
16371 fi
16372         echo "$as_me:16372: result: $cf_result" >&5
16373 echo "${ECHO_T}$cf_result" >&6
16374         if test $cf_result = yes ; then
16375
16376 cf_result=`echo "decl_curses_data_boolfnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16377
16378                 cat >>confdefs.h <<EOF
16379 #define $cf_result 1
16380 EOF
16381
16382         fi
16383 fi
16384
16385 if ( test "$GCC" = yes || test "$GXX" = yes )
16386 then
16387 echo "$as_me:16387: checking if you want to turn on gcc warnings" >&5
16388 echo $ECHO_N "checking if you want to turn on gcc warnings... $ECHO_C" >&6
16389
16390 # Check whether --enable-warnings or --disable-warnings was given.
16391 if test "${enable_warnings+set}" = set; then
16392   enableval="$enable_warnings"
16393   test "$enableval" != yes && enableval=no
16394         if test "$enableval" != "no" ; then
16395     with_warnings=yes
16396         else
16397                 with_warnings=no
16398         fi
16399 else
16400   enableval=no
16401         with_warnings=no
16402
16403 fi;
16404 echo "$as_me:16404: result: $with_warnings" >&5
16405 echo "${ECHO_T}$with_warnings" >&6
16406 if test "$with_warnings" = "yes"
16407 then
16408
16409 if test "$GCC" = yes
16410 then
16411 cat > conftest.i <<EOF
16412 #ifndef GCC_PRINTF
16413 #define GCC_PRINTF 0
16414 #endif
16415 #ifndef GCC_SCANF
16416 #define GCC_SCANF 0
16417 #endif
16418 #ifndef GCC_NORETURN
16419 #define GCC_NORETURN /* nothing */
16420 #endif
16421 #ifndef GCC_UNUSED
16422 #define GCC_UNUSED /* nothing */
16423 #endif
16424 EOF
16425 if test "$GCC" = yes
16426 then
16427         { echo "$as_me:16427: checking for $CC __attribute__ directives..." >&5
16428 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
16429 cat > conftest.$ac_ext <<EOF
16430 #line 16430 "${as_me:-configure}"
16431 #include "confdefs.h"
16432 #include "conftest.h"
16433 #include "conftest.i"
16434 #if     GCC_PRINTF
16435 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
16436 #else
16437 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
16438 #endif
16439 #if     GCC_SCANF
16440 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
16441 #else
16442 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
16443 #endif
16444 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
16445 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
16446 extern void foo(void) GCC_NORETURN;
16447 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
16448 EOF
16449         cf_printf_attribute=no
16450         cf_scanf_attribute=no
16451         for cf_attribute in scanf printf unused noreturn
16452         do
16453
16454 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16455
16456                 cf_directive="__attribute__(($cf_attribute))"
16457                 echo "checking for $CC $cf_directive" 1>&5
16458
16459                 case $cf_attribute in
16460                 (printf)
16461                         cf_printf_attribute=yes
16462                         cat >conftest.h <<EOF
16463 #define GCC_$cf_ATTRIBUTE 1
16464 EOF
16465                         ;;
16466                 (scanf)
16467                         cf_scanf_attribute=yes
16468                         cat >conftest.h <<EOF
16469 #define GCC_$cf_ATTRIBUTE 1
16470 EOF
16471                         ;;
16472                 (*)
16473                         cat >conftest.h <<EOF
16474 #define GCC_$cf_ATTRIBUTE $cf_directive
16475 EOF
16476                         ;;
16477                 esac
16478
16479                 if { (eval echo "$as_me:16479: \"$ac_compile\"") >&5
16480   (eval $ac_compile) 2>&5
16481   ac_status=$?
16482   echo "$as_me:16482: \$? = $ac_status" >&5
16483   (exit $ac_status); }; then
16484                         test -n "$verbose" && echo "$as_me:16484: result: ... $cf_attribute" >&5
16485 echo "${ECHO_T}... $cf_attribute" >&6
16486                         cat conftest.h >>confdefs.h
16487                         case $cf_attribute in
16488                         (noreturn)
16489
16490 cat >>confdefs.h <<EOF
16491 #define GCC_NORETURN $cf_directive
16492 EOF
16493
16494                                 ;;
16495                         (printf)
16496                                 cf_value='/* nothing */'
16497                                 if test "$cf_printf_attribute" != no ; then
16498                                         cf_value='__attribute__((format(printf,fmt,var)))'
16499
16500 cat >>confdefs.h <<\EOF
16501 #define GCC_PRINTF 1
16502 EOF
16503
16504                                 fi
16505
16506 cat >>confdefs.h <<EOF
16507 #define GCC_PRINTFLIKE(fmt,var) $cf_value
16508 EOF
16509
16510                                 ;;
16511                         (scanf)
16512                                 cf_value='/* nothing */'
16513                                 if test "$cf_scanf_attribute" != no ; then
16514                                         cf_value='__attribute__((format(scanf,fmt,var)))'
16515
16516 cat >>confdefs.h <<\EOF
16517 #define GCC_SCANF 1
16518 EOF
16519
16520                                 fi
16521
16522 cat >>confdefs.h <<EOF
16523 #define GCC_SCANFLIKE(fmt,var) $cf_value
16524 EOF
16525
16526                                 ;;
16527                         (unused)
16528
16529 cat >>confdefs.h <<EOF
16530 #define GCC_UNUSED $cf_directive
16531 EOF
16532
16533                                 ;;
16534                         esac
16535                 fi
16536         done
16537 else
16538         fgrep define conftest.i >>confdefs.h
16539 fi
16540 rm -rf conftest*
16541 fi
16542
16543 INTEL_COMPILER=no
16544
16545 if test "$GCC" = yes ; then
16546         case $host_os in
16547         (linux*|gnu*)
16548                 echo "$as_me:16548: checking if this is really Intel C compiler" >&5
16549 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
16550                 cf_save_CFLAGS="$CFLAGS"
16551                 CFLAGS="$CFLAGS -no-gcc"
16552                 cat >conftest.$ac_ext <<_ACEOF
16553 #line 16553 "configure"
16554 #include "confdefs.h"
16555
16556 int
16557 main ()
16558 {
16559
16560 #ifdef __INTEL_COMPILER
16561 #else
16562 make an error
16563 #endif
16564
16565   ;
16566   return 0;
16567 }
16568 _ACEOF
16569 rm -f conftest.$ac_objext
16570 if { (eval echo "$as_me:16570: \"$ac_compile\"") >&5
16571   (eval $ac_compile) 2>&5
16572   ac_status=$?
16573   echo "$as_me:16573: \$? = $ac_status" >&5
16574   (exit $ac_status); } &&
16575          { ac_try='test -s conftest.$ac_objext'
16576   { (eval echo "$as_me:16576: \"$ac_try\"") >&5
16577   (eval $ac_try) 2>&5
16578   ac_status=$?
16579   echo "$as_me:16579: \$? = $ac_status" >&5
16580   (exit $ac_status); }; }; then
16581   INTEL_COMPILER=yes
16582 cf_save_CFLAGS="$cf_save_CFLAGS -we147"
16583
16584 else
16585   echo "$as_me: failed program was:" >&5
16586 cat conftest.$ac_ext >&5
16587 fi
16588 rm -f conftest.$ac_objext conftest.$ac_ext
16589                 CFLAGS="$cf_save_CFLAGS"
16590                 echo "$as_me:16590: result: $INTEL_COMPILER" >&5
16591 echo "${ECHO_T}$INTEL_COMPILER" >&6
16592                 ;;
16593         esac
16594 fi
16595
16596 CLANG_COMPILER=no
16597
16598 if test "$GCC" = yes ; then
16599         echo "$as_me:16599: checking if this is really Clang C compiler" >&5
16600 echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6
16601         cf_save_CFLAGS="$CFLAGS"
16602         CFLAGS="$CFLAGS -Qunused-arguments"
16603         cat >conftest.$ac_ext <<_ACEOF
16604 #line 16604 "configure"
16605 #include "confdefs.h"
16606
16607 int
16608 main ()
16609 {
16610
16611 #ifdef __clang__
16612 #else
16613 make an error
16614 #endif
16615
16616   ;
16617   return 0;
16618 }
16619 _ACEOF
16620 rm -f conftest.$ac_objext
16621 if { (eval echo "$as_me:16621: \"$ac_compile\"") >&5
16622   (eval $ac_compile) 2>&5
16623   ac_status=$?
16624   echo "$as_me:16624: \$? = $ac_status" >&5
16625   (exit $ac_status); } &&
16626          { ac_try='test -s conftest.$ac_objext'
16627   { (eval echo "$as_me:16627: \"$ac_try\"") >&5
16628   (eval $ac_try) 2>&5
16629   ac_status=$?
16630   echo "$as_me:16630: \$? = $ac_status" >&5
16631   (exit $ac_status); }; }; then
16632   CLANG_COMPILER=yes
16633 cf_save_CFLAGS="$cf_save_CFLAGS -Qunused-arguments"
16634
16635 else
16636   echo "$as_me: failed program was:" >&5
16637 cat conftest.$ac_ext >&5
16638 fi
16639 rm -f conftest.$ac_objext conftest.$ac_ext
16640         CFLAGS="$cf_save_CFLAGS"
16641         echo "$as_me:16641: result: $CLANG_COMPILER" >&5
16642 echo "${ECHO_T}$CLANG_COMPILER" >&6
16643 fi
16644
16645 cat > conftest.$ac_ext <<EOF
16646 #line 16646 "${as_me:-configure}"
16647 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
16648 EOF
16649
16650 if test "$INTEL_COMPILER" = yes
16651 then
16652 # The "-wdXXX" options suppress warnings:
16653 # remark #1419: external declaration in primary source file
16654 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
16655 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
16656 # remark #193: zero used for undefined preprocessing identifier
16657 # remark #593: variable "curs_sb_left_arrow" was set but never used
16658 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
16659 # remark #869: parameter "tw" was never referenced
16660 # remark #981: operands are evaluated in unspecified order
16661 # warning #279: controlling expression is constant
16662
16663         { echo "$as_me:16663: checking for $CC warning options..." >&5
16664 echo "$as_me: checking for $CC warning options..." >&6;}
16665         cf_save_CFLAGS="$CFLAGS"
16666         EXTRA_CFLAGS="-Wall"
16667         for cf_opt in \
16668                 wd1419 \
16669                 wd1683 \
16670                 wd1684 \
16671                 wd193 \
16672                 wd593 \
16673                 wd279 \
16674                 wd810 \
16675                 wd869 \
16676                 wd981
16677         do
16678                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
16679                 if { (eval echo "$as_me:16679: \"$ac_compile\"") >&5
16680   (eval $ac_compile) 2>&5
16681   ac_status=$?
16682   echo "$as_me:16682: \$? = $ac_status" >&5
16683   (exit $ac_status); }; then
16684                         test -n "$verbose" && echo "$as_me:16684: result: ... -$cf_opt" >&5
16685 echo "${ECHO_T}... -$cf_opt" >&6
16686                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
16687                 fi
16688         done
16689         CFLAGS="$cf_save_CFLAGS"
16690
16691 elif test "$GCC" = yes
16692 then
16693         { echo "$as_me:16693: checking for $CC warning options..." >&5
16694 echo "$as_me: checking for $CC warning options..." >&6;}
16695         cf_save_CFLAGS="$CFLAGS"
16696         EXTRA_CFLAGS=
16697         cf_warn_CONST=""
16698         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
16699         cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
16700         test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
16701         for cf_opt in W Wall \
16702                 Wbad-function-cast \
16703                 Wcast-align \
16704                 Wcast-qual \
16705                 Wdeclaration-after-statement \
16706                 Wextra \
16707                 Winline \
16708                 Wmissing-declarations \
16709                 Wmissing-prototypes \
16710                 Wnested-externs \
16711                 Wpointer-arith \
16712                 Wshadow \
16713                 Wstrict-prototypes \
16714                 Wundef $cf_gcc_warnings $cf_warn_CONST
16715         do
16716                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
16717                 if { (eval echo "$as_me:16717: \"$ac_compile\"") >&5
16718   (eval $ac_compile) 2>&5
16719   ac_status=$?
16720   echo "$as_me:16720: \$? = $ac_status" >&5
16721   (exit $ac_status); }; then
16722                         test -n "$verbose" && echo "$as_me:16722: result: ... -$cf_opt" >&5
16723 echo "${ECHO_T}... -$cf_opt" >&6
16724                         case $cf_opt in
16725                         (Wcast-qual)
16726                                 CPPFLAGS="$CPPFLAGS -DXTSTRINGDEFINES"
16727                                 ;;
16728                         (Winline)
16729                                 case $GCC_VERSION in
16730                                 ([34].*)
16731                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
16732
16733 echo "${as_me:-configure}:16733: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
16734
16735                                         continue;;
16736                                 esac
16737                                 ;;
16738                         (Wpointer-arith)
16739                                 case $GCC_VERSION in
16740                                 ([12].*)
16741                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
16742
16743 echo "${as_me:-configure}:16743: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
16744
16745                                         continue;;
16746                                 esac
16747                                 ;;
16748                         esac
16749                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
16750                 fi
16751         done
16752         CFLAGS="$cf_save_CFLAGS"
16753 fi
16754 rm -rf conftest*
16755
16756 fi
16757 fi
16758
16759 echo "$as_me:16759: checking if you want to use dmalloc for testing" >&5
16760 echo $ECHO_N "checking if you want to use dmalloc for testing... $ECHO_C" >&6
16761
16762 # Check whether --with-dmalloc or --without-dmalloc was given.
16763 if test "${with_dmalloc+set}" = set; then
16764   withval="$with_dmalloc"
16765
16766 cat >>confdefs.h <<EOF
16767 #define USE_DMALLOC 1
16768 EOF
16769
16770         : ${with_cflags:=-g}
16771         : ${with_no_leaks:=yes}
16772          with_dmalloc=yes
16773 else
16774   with_dmalloc=
16775 fi;
16776 echo "$as_me:16776: result: ${with_dmalloc:-no}" >&5
16777 echo "${ECHO_T}${with_dmalloc:-no}" >&6
16778
16779 case .$with_cflags in
16780 (.*-g*)
16781         case .$CFLAGS in
16782         (.*-g*)
16783                 ;;
16784         (*)
16785
16786 cf_fix_cppflags=no
16787 cf_new_cflags=
16788 cf_new_cppflags=
16789 cf_new_extra_cppflags=
16790
16791 for cf_add_cflags in -g
16792 do
16793 case $cf_fix_cppflags in
16794 (no)
16795         case $cf_add_cflags in
16796         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
16797                 case $cf_add_cflags in
16798                 (-D*)
16799                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
16800
16801                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16802                                 && test -z "${cf_tst_cflags}" \
16803                                 && cf_fix_cppflags=yes
16804
16805                         if test $cf_fix_cppflags = yes ; then
16806                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
16807                                 continue
16808                         elif test "${cf_tst_cflags}" = "\"'" ; then
16809                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
16810                                 continue
16811                         fi
16812                         ;;
16813                 esac
16814                 case "$CPPFLAGS" in
16815                 (*$cf_add_cflags)
16816                         ;;
16817                 (*)
16818                         case $cf_add_cflags in
16819                         (-D*)
16820                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
16821
16822 CPPFLAGS=`echo "$CPPFLAGS" | \
16823         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
16824                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
16825
16826                                 ;;
16827                         esac
16828                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
16829                         ;;
16830                 esac
16831                 ;;
16832         (*)
16833                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
16834                 ;;
16835         esac
16836         ;;
16837 (yes)
16838         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
16839
16840         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
16841
16842         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16843                 && test -z "${cf_tst_cflags}" \
16844                 && cf_fix_cppflags=no
16845         ;;
16846 esac
16847 done
16848
16849 if test -n "$cf_new_cflags" ; then
16850
16851         CFLAGS="$CFLAGS $cf_new_cflags"
16852 fi
16853
16854 if test -n "$cf_new_cppflags" ; then
16855
16856         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
16857 fi
16858
16859 if test -n "$cf_new_extra_cppflags" ; then
16860
16861         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
16862 fi
16863
16864                 ;;
16865         esac
16866         ;;
16867 esac
16868
16869 if test "$with_dmalloc" = yes ; then
16870         echo "$as_me:16870: checking for dmalloc.h" >&5
16871 echo $ECHO_N "checking for dmalloc.h... $ECHO_C" >&6
16872 if test "${ac_cv_header_dmalloc_h+set}" = set; then
16873   echo $ECHO_N "(cached) $ECHO_C" >&6
16874 else
16875   cat >conftest.$ac_ext <<_ACEOF
16876 #line 16876 "configure"
16877 #include "confdefs.h"
16878 #include <dmalloc.h>
16879 _ACEOF
16880 if { (eval echo "$as_me:16880: \"$ac_cpp conftest.$ac_ext\"") >&5
16881   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
16882   ac_status=$?
16883   egrep -v '^ *\+' conftest.er1 >conftest.err
16884   rm -f conftest.er1
16885   cat conftest.err >&5
16886   echo "$as_me:16886: \$? = $ac_status" >&5
16887   (exit $ac_status); } >/dev/null; then
16888   if test -s conftest.err; then
16889     ac_cpp_err=$ac_c_preproc_warn_flag
16890   else
16891     ac_cpp_err=
16892   fi
16893 else
16894   ac_cpp_err=yes
16895 fi
16896 if test -z "$ac_cpp_err"; then
16897   ac_cv_header_dmalloc_h=yes
16898 else
16899   echo "$as_me: failed program was:" >&5
16900   cat conftest.$ac_ext >&5
16901   ac_cv_header_dmalloc_h=no
16902 fi
16903 rm -f conftest.err conftest.$ac_ext
16904 fi
16905 echo "$as_me:16905: result: $ac_cv_header_dmalloc_h" >&5
16906 echo "${ECHO_T}$ac_cv_header_dmalloc_h" >&6
16907 if test $ac_cv_header_dmalloc_h = yes; then
16908
16909 echo "$as_me:16909: checking for dmalloc_debug in -ldmalloc" >&5
16910 echo $ECHO_N "checking for dmalloc_debug in -ldmalloc... $ECHO_C" >&6
16911 if test "${ac_cv_lib_dmalloc_dmalloc_debug+set}" = set; then
16912   echo $ECHO_N "(cached) $ECHO_C" >&6
16913 else
16914   ac_check_lib_save_LIBS=$LIBS
16915 LIBS="-ldmalloc  $LIBS"
16916 cat >conftest.$ac_ext <<_ACEOF
16917 #line 16917 "configure"
16918 #include "confdefs.h"
16919
16920 /* Override any gcc2 internal prototype to avoid an error.  */
16921 #ifdef __cplusplus
16922 extern "C"
16923 #endif
16924 /* We use char because int might match the return type of a gcc2
16925    builtin and then its argument prototype would still apply.  */
16926 char dmalloc_debug ();
16927 int
16928 main ()
16929 {
16930 dmalloc_debug ();
16931   ;
16932   return 0;
16933 }
16934 _ACEOF
16935 rm -f conftest.$ac_objext conftest$ac_exeext
16936 if { (eval echo "$as_me:16936: \"$ac_link\"") >&5
16937   (eval $ac_link) 2>&5
16938   ac_status=$?
16939   echo "$as_me:16939: \$? = $ac_status" >&5
16940   (exit $ac_status); } &&
16941          { ac_try='test -s conftest$ac_exeext'
16942   { (eval echo "$as_me:16942: \"$ac_try\"") >&5
16943   (eval $ac_try) 2>&5
16944   ac_status=$?
16945   echo "$as_me:16945: \$? = $ac_status" >&5
16946   (exit $ac_status); }; }; then
16947   ac_cv_lib_dmalloc_dmalloc_debug=yes
16948 else
16949   echo "$as_me: failed program was:" >&5
16950 cat conftest.$ac_ext >&5
16951 ac_cv_lib_dmalloc_dmalloc_debug=no
16952 fi
16953 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16954 LIBS=$ac_check_lib_save_LIBS
16955 fi
16956 echo "$as_me:16956: result: $ac_cv_lib_dmalloc_dmalloc_debug" >&5
16957 echo "${ECHO_T}$ac_cv_lib_dmalloc_dmalloc_debug" >&6
16958 if test $ac_cv_lib_dmalloc_dmalloc_debug = yes; then
16959   cat >>confdefs.h <<EOF
16960 #define HAVE_LIBDMALLOC 1
16961 EOF
16962
16963   LIBS="-ldmalloc $LIBS"
16964
16965 fi
16966
16967 fi
16968
16969 fi
16970
16971 echo "$as_me:16971: checking if you want to use dbmalloc for testing" >&5
16972 echo $ECHO_N "checking if you want to use dbmalloc for testing... $ECHO_C" >&6
16973
16974 # Check whether --with-dbmalloc or --without-dbmalloc was given.
16975 if test "${with_dbmalloc+set}" = set; then
16976   withval="$with_dbmalloc"
16977
16978 cat >>confdefs.h <<EOF
16979 #define USE_DBMALLOC 1
16980 EOF
16981
16982         : ${with_cflags:=-g}
16983         : ${with_no_leaks:=yes}
16984          with_dbmalloc=yes
16985 else
16986   with_dbmalloc=
16987 fi;
16988 echo "$as_me:16988: result: ${with_dbmalloc:-no}" >&5
16989 echo "${ECHO_T}${with_dbmalloc:-no}" >&6
16990
16991 case .$with_cflags in
16992 (.*-g*)
16993         case .$CFLAGS in
16994         (.*-g*)
16995                 ;;
16996         (*)
16997
16998 cf_fix_cppflags=no
16999 cf_new_cflags=
17000 cf_new_cppflags=
17001 cf_new_extra_cppflags=
17002
17003 for cf_add_cflags in -g
17004 do
17005 case $cf_fix_cppflags in
17006 (no)
17007         case $cf_add_cflags in
17008         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
17009                 case $cf_add_cflags in
17010                 (-D*)
17011                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
17012
17013                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17014                                 && test -z "${cf_tst_cflags}" \
17015                                 && cf_fix_cppflags=yes
17016
17017                         if test $cf_fix_cppflags = yes ; then
17018                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
17019                                 continue
17020                         elif test "${cf_tst_cflags}" = "\"'" ; then
17021                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
17022                                 continue
17023                         fi
17024                         ;;
17025                 esac
17026                 case "$CPPFLAGS" in
17027                 (*$cf_add_cflags)
17028                         ;;
17029                 (*)
17030                         case $cf_add_cflags in
17031                         (-D*)
17032                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
17033
17034 CPPFLAGS=`echo "$CPPFLAGS" | \
17035         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
17036                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
17037
17038                                 ;;
17039                         esac
17040                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
17041                         ;;
17042                 esac
17043                 ;;
17044         (*)
17045                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
17046                 ;;
17047         esac
17048         ;;
17049 (yes)
17050         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
17051
17052         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
17053
17054         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17055                 && test -z "${cf_tst_cflags}" \
17056                 && cf_fix_cppflags=no
17057         ;;
17058 esac
17059 done
17060
17061 if test -n "$cf_new_cflags" ; then
17062
17063         CFLAGS="$CFLAGS $cf_new_cflags"
17064 fi
17065
17066 if test -n "$cf_new_cppflags" ; then
17067
17068         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
17069 fi
17070
17071 if test -n "$cf_new_extra_cppflags" ; then
17072
17073         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
17074 fi
17075
17076                 ;;
17077         esac
17078         ;;
17079 esac
17080
17081 if test "$with_dbmalloc" = yes ; then
17082         echo "$as_me:17082: checking for dbmalloc.h" >&5
17083 echo $ECHO_N "checking for dbmalloc.h... $ECHO_C" >&6
17084 if test "${ac_cv_header_dbmalloc_h+set}" = set; then
17085   echo $ECHO_N "(cached) $ECHO_C" >&6
17086 else
17087   cat >conftest.$ac_ext <<_ACEOF
17088 #line 17088 "configure"
17089 #include "confdefs.h"
17090 #include <dbmalloc.h>
17091 _ACEOF
17092 if { (eval echo "$as_me:17092: \"$ac_cpp conftest.$ac_ext\"") >&5
17093   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
17094   ac_status=$?
17095   egrep -v '^ *\+' conftest.er1 >conftest.err
17096   rm -f conftest.er1
17097   cat conftest.err >&5
17098   echo "$as_me:17098: \$? = $ac_status" >&5
17099   (exit $ac_status); } >/dev/null; then
17100   if test -s conftest.err; then
17101     ac_cpp_err=$ac_c_preproc_warn_flag
17102   else
17103     ac_cpp_err=
17104   fi
17105 else
17106   ac_cpp_err=yes
17107 fi
17108 if test -z "$ac_cpp_err"; then
17109   ac_cv_header_dbmalloc_h=yes
17110 else
17111   echo "$as_me: failed program was:" >&5
17112   cat conftest.$ac_ext >&5
17113   ac_cv_header_dbmalloc_h=no
17114 fi
17115 rm -f conftest.err conftest.$ac_ext
17116 fi
17117 echo "$as_me:17117: result: $ac_cv_header_dbmalloc_h" >&5
17118 echo "${ECHO_T}$ac_cv_header_dbmalloc_h" >&6
17119 if test $ac_cv_header_dbmalloc_h = yes; then
17120
17121 echo "$as_me:17121: checking for debug_malloc in -ldbmalloc" >&5
17122 echo $ECHO_N "checking for debug_malloc in -ldbmalloc... $ECHO_C" >&6
17123 if test "${ac_cv_lib_dbmalloc_debug_malloc+set}" = set; then
17124   echo $ECHO_N "(cached) $ECHO_C" >&6
17125 else
17126   ac_check_lib_save_LIBS=$LIBS
17127 LIBS="-ldbmalloc  $LIBS"
17128 cat >conftest.$ac_ext <<_ACEOF
17129 #line 17129 "configure"
17130 #include "confdefs.h"
17131
17132 /* Override any gcc2 internal prototype to avoid an error.  */
17133 #ifdef __cplusplus
17134 extern "C"
17135 #endif
17136 /* We use char because int might match the return type of a gcc2
17137    builtin and then its argument prototype would still apply.  */
17138 char debug_malloc ();
17139 int
17140 main ()
17141 {
17142 debug_malloc ();
17143   ;
17144   return 0;
17145 }
17146 _ACEOF
17147 rm -f conftest.$ac_objext conftest$ac_exeext
17148 if { (eval echo "$as_me:17148: \"$ac_link\"") >&5
17149   (eval $ac_link) 2>&5
17150   ac_status=$?
17151   echo "$as_me:17151: \$? = $ac_status" >&5
17152   (exit $ac_status); } &&
17153          { ac_try='test -s conftest$ac_exeext'
17154   { (eval echo "$as_me:17154: \"$ac_try\"") >&5
17155   (eval $ac_try) 2>&5
17156   ac_status=$?
17157   echo "$as_me:17157: \$? = $ac_status" >&5
17158   (exit $ac_status); }; }; then
17159   ac_cv_lib_dbmalloc_debug_malloc=yes
17160 else
17161   echo "$as_me: failed program was:" >&5
17162 cat conftest.$ac_ext >&5
17163 ac_cv_lib_dbmalloc_debug_malloc=no
17164 fi
17165 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17166 LIBS=$ac_check_lib_save_LIBS
17167 fi
17168 echo "$as_me:17168: result: $ac_cv_lib_dbmalloc_debug_malloc" >&5
17169 echo "${ECHO_T}$ac_cv_lib_dbmalloc_debug_malloc" >&6
17170 if test $ac_cv_lib_dbmalloc_debug_malloc = yes; then
17171   cat >>confdefs.h <<EOF
17172 #define HAVE_LIBDBMALLOC 1
17173 EOF
17174
17175   LIBS="-ldbmalloc $LIBS"
17176
17177 fi
17178
17179 fi
17180
17181 fi
17182
17183 echo "$as_me:17183: checking if you want to use valgrind for testing" >&5
17184 echo $ECHO_N "checking if you want to use valgrind for testing... $ECHO_C" >&6
17185
17186 # Check whether --with-valgrind or --without-valgrind was given.
17187 if test "${with_valgrind+set}" = set; then
17188   withval="$with_valgrind"
17189
17190 cat >>confdefs.h <<EOF
17191 #define USE_VALGRIND 1
17192 EOF
17193
17194         : ${with_cflags:=-g}
17195         : ${with_no_leaks:=yes}
17196          with_valgrind=yes
17197 else
17198   with_valgrind=
17199 fi;
17200 echo "$as_me:17200: result: ${with_valgrind:-no}" >&5
17201 echo "${ECHO_T}${with_valgrind:-no}" >&6
17202
17203 case .$with_cflags in
17204 (.*-g*)
17205         case .$CFLAGS in
17206         (.*-g*)
17207                 ;;
17208         (*)
17209
17210 cf_fix_cppflags=no
17211 cf_new_cflags=
17212 cf_new_cppflags=
17213 cf_new_extra_cppflags=
17214
17215 for cf_add_cflags in -g
17216 do
17217 case $cf_fix_cppflags in
17218 (no)
17219         case $cf_add_cflags in
17220         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
17221                 case $cf_add_cflags in
17222                 (-D*)
17223                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
17224
17225                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17226                                 && test -z "${cf_tst_cflags}" \
17227                                 && cf_fix_cppflags=yes
17228
17229                         if test $cf_fix_cppflags = yes ; then
17230                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
17231                                 continue
17232                         elif test "${cf_tst_cflags}" = "\"'" ; then
17233                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
17234                                 continue
17235                         fi
17236                         ;;
17237                 esac
17238                 case "$CPPFLAGS" in
17239                 (*$cf_add_cflags)
17240                         ;;
17241                 (*)
17242                         case $cf_add_cflags in
17243                         (-D*)
17244                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
17245
17246 CPPFLAGS=`echo "$CPPFLAGS" | \
17247         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
17248                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
17249
17250                                 ;;
17251                         esac
17252                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
17253                         ;;
17254                 esac
17255                 ;;
17256         (*)
17257                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
17258                 ;;
17259         esac
17260         ;;
17261 (yes)
17262         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
17263
17264         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
17265
17266         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17267                 && test -z "${cf_tst_cflags}" \
17268                 && cf_fix_cppflags=no
17269         ;;
17270 esac
17271 done
17272
17273 if test -n "$cf_new_cflags" ; then
17274
17275         CFLAGS="$CFLAGS $cf_new_cflags"
17276 fi
17277
17278 if test -n "$cf_new_cppflags" ; then
17279
17280         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
17281 fi
17282
17283 if test -n "$cf_new_extra_cppflags" ; then
17284
17285         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
17286 fi
17287
17288                 ;;
17289         esac
17290         ;;
17291 esac
17292
17293 echo "$as_me:17293: checking if you want to perform memory-leak testing" >&5
17294 echo $ECHO_N "checking if you want to perform memory-leak testing... $ECHO_C" >&6
17295
17296 # Check whether --enable-leaks or --disable-leaks was given.
17297 if test "${enable_leaks+set}" = set; then
17298   enableval="$enable_leaks"
17299   if test "x$enableval" = xno; then with_no_leaks=yes; else with_no_leaks=no; fi
17300 else
17301   : ${with_no_leaks:=no}
17302 fi;
17303 echo "$as_me:17303: result: $with_no_leaks" >&5
17304 echo "${ECHO_T}$with_no_leaks" >&6
17305
17306 if test "$with_no_leaks" = yes ; then
17307
17308 cat >>confdefs.h <<\EOF
17309 #define NO_LEAKS 1
17310 EOF
17311
17312 cat >>confdefs.h <<\EOF
17313 #define YY_NO_LEAKS 1
17314 EOF
17315
17316 fi
17317
17318 LD_RPATH_OPT=
17319 echo "$as_me:17319: checking for an rpath option" >&5
17320 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
17321 case $cf_cv_system_name in
17322 (irix*)
17323         if test "$GCC" = yes; then
17324                 LD_RPATH_OPT="-Wl,-rpath,"
17325         else
17326                 LD_RPATH_OPT="-rpath "
17327         fi
17328         ;;
17329 (linux*|gnu*|k*bsd*-gnu)
17330         LD_RPATH_OPT="-Wl,-rpath,"
17331         ;;
17332 (openbsd[2-9].*|mirbsd*)
17333         LD_RPATH_OPT="-Wl,-rpath,"
17334         ;;
17335 (dragonfly*|freebsd*)
17336         LD_RPATH_OPT="-rpath "
17337         ;;
17338 (netbsd*)
17339         LD_RPATH_OPT="-Wl,-rpath,"
17340         ;;
17341 (osf*|mls+*)
17342         LD_RPATH_OPT="-rpath "
17343         ;;
17344 (solaris2*)
17345         LD_RPATH_OPT="-R"
17346         ;;
17347 (*)
17348         ;;
17349 esac
17350 echo "$as_me:17350: result: $LD_RPATH_OPT" >&5
17351 echo "${ECHO_T}$LD_RPATH_OPT" >&6
17352
17353 case "x$LD_RPATH_OPT" in
17354 (x-R*)
17355         echo "$as_me:17355: checking if we need a space after rpath option" >&5
17356 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
17357         cf_save_LIBS="$LIBS"
17358
17359 cf_add_libs="${LD_RPATH_OPT}$libdir"
17360 # Filter out duplicates - this happens with badly-designed ".pc" files...
17361 for cf_add_1lib in $LIBS
17362 do
17363         for cf_add_2lib in $cf_add_libs
17364         do
17365                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
17366                 then
17367                         cf_add_1lib=
17368                         break
17369                 fi
17370         done
17371         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
17372 done
17373 LIBS="$cf_add_libs"
17374
17375         cat >conftest.$ac_ext <<_ACEOF
17376 #line 17376 "configure"
17377 #include "confdefs.h"
17378
17379 int
17380 main ()
17381 {
17382
17383   ;
17384   return 0;
17385 }
17386 _ACEOF
17387 rm -f conftest.$ac_objext conftest$ac_exeext
17388 if { (eval echo "$as_me:17388: \"$ac_link\"") >&5
17389   (eval $ac_link) 2>&5
17390   ac_status=$?
17391   echo "$as_me:17391: \$? = $ac_status" >&5
17392   (exit $ac_status); } &&
17393          { ac_try='test -s conftest$ac_exeext'
17394   { (eval echo "$as_me:17394: \"$ac_try\"") >&5
17395   (eval $ac_try) 2>&5
17396   ac_status=$?
17397   echo "$as_me:17397: \$? = $ac_status" >&5
17398   (exit $ac_status); }; }; then
17399   cf_rpath_space=no
17400 else
17401   echo "$as_me: failed program was:" >&5
17402 cat conftest.$ac_ext >&5
17403 cf_rpath_space=yes
17404 fi
17405 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17406         LIBS="$cf_save_LIBS"
17407         echo "$as_me:17407: result: $cf_rpath_space" >&5
17408 echo "${ECHO_T}$cf_rpath_space" >&6
17409         test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
17410         ;;
17411 esac
17412
17413 echo "$as_me:17413: checking if rpath-hack should be disabled" >&5
17414 echo $ECHO_N "checking if rpath-hack should be disabled... $ECHO_C" >&6
17415
17416 # Check whether --enable-rpath-hack or --disable-rpath-hack was given.
17417 if test "${enable_rpath_hack+set}" = set; then
17418   enableval="$enable_rpath_hack"
17419   test "$enableval" != no && enableval=yes
17420         if test "$enableval" != "yes" ; then
17421     cf_disable_rpath_hack=yes
17422         else
17423                 cf_disable_rpath_hack=no
17424         fi
17425 else
17426   enableval=yes
17427         cf_disable_rpath_hack=no
17428
17429 fi;
17430 echo "$as_me:17430: result: $cf_disable_rpath_hack" >&5
17431 echo "${ECHO_T}$cf_disable_rpath_hack" >&6
17432 if test "$cf_disable_rpath_hack" = no ; then
17433
17434 echo "$as_me:17434: checking for updated LDFLAGS" >&5
17435 echo $ECHO_N "checking for updated LDFLAGS... $ECHO_C" >&6
17436 if test -n "$LD_RPATH_OPT" ; then
17437         echo "$as_me:17437: result: maybe" >&5
17438 echo "${ECHO_T}maybe" >&6
17439
17440         for ac_prog in ldd
17441 do
17442   # Extract the first word of "$ac_prog", so it can be a program name with args.
17443 set dummy $ac_prog; ac_word=$2
17444 echo "$as_me:17444: checking for $ac_word" >&5
17445 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
17446 if test "${ac_cv_prog_cf_ldd_prog+set}" = set; then
17447   echo $ECHO_N "(cached) $ECHO_C" >&6
17448 else
17449   if test -n "$cf_ldd_prog"; then
17450   ac_cv_prog_cf_ldd_prog="$cf_ldd_prog" # Let the user override the test.
17451 else
17452   ac_save_IFS=$IFS; IFS=$ac_path_separator
17453 ac_dummy="$PATH"
17454 for ac_dir in $ac_dummy; do
17455   IFS=$ac_save_IFS
17456   test -z "$ac_dir" && ac_dir=.
17457   $as_executable_p "$ac_dir/$ac_word" || continue
17458 ac_cv_prog_cf_ldd_prog="$ac_prog"
17459 echo "$as_me:17459: found $ac_dir/$ac_word" >&5
17460 break
17461 done
17462
17463 fi
17464 fi
17465 cf_ldd_prog=$ac_cv_prog_cf_ldd_prog
17466 if test -n "$cf_ldd_prog"; then
17467   echo "$as_me:17467: result: $cf_ldd_prog" >&5
17468 echo "${ECHO_T}$cf_ldd_prog" >&6
17469 else
17470   echo "$as_me:17470: result: no" >&5
17471 echo "${ECHO_T}no" >&6
17472 fi
17473
17474   test -n "$cf_ldd_prog" && break
17475 done
17476 test -n "$cf_ldd_prog" || cf_ldd_prog="no"
17477
17478         cf_rpath_list="/usr/lib /lib"
17479         if test "$cf_ldd_prog" != no
17480         then
17481                 cf_rpath_oops=
17482
17483 cat >conftest.$ac_ext <<_ACEOF
17484 #line 17484 "configure"
17485 #include "confdefs.h"
17486 #include <stdio.h>
17487 int
17488 main ()
17489 {
17490 printf("Hello");
17491   ;
17492   return 0;
17493 }
17494 _ACEOF
17495 rm -f conftest.$ac_objext conftest$ac_exeext
17496 if { (eval echo "$as_me:17496: \"$ac_link\"") >&5
17497   (eval $ac_link) 2>&5
17498   ac_status=$?
17499   echo "$as_me:17499: \$? = $ac_status" >&5
17500   (exit $ac_status); } &&
17501          { ac_try='test -s conftest$ac_exeext'
17502   { (eval echo "$as_me:17502: \"$ac_try\"") >&5
17503   (eval $ac_try) 2>&5
17504   ac_status=$?
17505   echo "$as_me:17505: \$? = $ac_status" >&5
17506   (exit $ac_status); }; }; then
17507   cf_rpath_oops=`$cf_ldd_prog conftest$ac_exeext | fgrep ' not found' | sed -e 's% =>.*$%%' |sort | uniq`
17508                  cf_rpath_list=`$cf_ldd_prog conftest$ac_exeext | fgrep / | sed -e 's%^.*[      ]/%/%' -e 's%/[^/][^/]*$%%' |sort | uniq`
17509 else
17510   echo "$as_me: failed program was:" >&5
17511 cat conftest.$ac_ext >&5
17512 fi
17513 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17514
17515                 # If we passed the link-test, but get a "not found" on a given library,
17516                 # this could be due to inept reconfiguration of gcc to make it only
17517                 # partly honor /usr/local/lib (or whatever).  Sometimes this behavior
17518                 # is intentional, e.g., installing gcc in /usr/bin and suppressing the
17519                 # /usr/local libraries.
17520                 if test -n "$cf_rpath_oops"
17521                 then
17522                         for cf_rpath_src in $cf_rpath_oops
17523                         do
17524                                 for cf_rpath_dir in \
17525                                         /usr/local \
17526                                         /usr/pkg \
17527                                         /opt/sfw
17528                                 do
17529                                         if test -f $cf_rpath_dir/lib/$cf_rpath_src
17530                                         then
17531                                                 test -n "$verbose" && echo "    ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src" 1>&6
17532
17533 echo "${as_me:-configure}:17533: testing ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src ..." 1>&5
17534
17535                                                 LDFLAGS="$LDFLAGS -L$cf_rpath_dir/lib"
17536                                                 break
17537                                         fi
17538                                 done
17539                         done
17540                 fi
17541         fi
17542
17543         test -n "$verbose" && echo "    ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
17544
17545 echo "${as_me:-configure}:17545: testing ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
17546
17547 test -n "$verbose" && echo "    ...checking LDFLAGS $LDFLAGS" 1>&6
17548
17549 echo "${as_me:-configure}:17549: testing ...checking LDFLAGS $LDFLAGS ..." 1>&5
17550
17551 cf_rpath_dst=
17552 for cf_rpath_src in $LDFLAGS
17553 do
17554         case $cf_rpath_src in
17555         (-L*)
17556
17557                 # check if this refers to a directory which we will ignore
17558                 cf_rpath_skip=no
17559                 if test -n "$cf_rpath_list"
17560                 then
17561                         for cf_rpath_item in $cf_rpath_list
17562                         do
17563                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
17564                                 then
17565                                         cf_rpath_skip=yes
17566                                         break
17567                                 fi
17568                         done
17569                 fi
17570
17571                 if test "$cf_rpath_skip" = no
17572                 then
17573                         # transform the option
17574                         if test "$LD_RPATH_OPT" = "-R " ; then
17575                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
17576                         else
17577                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
17578                         fi
17579
17580                         # if we have not already added this, add it now
17581                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
17582                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
17583                         then
17584                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
17585
17586 echo "${as_me:-configure}:17586: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
17587
17588                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
17589                         fi
17590                 fi
17591                 ;;
17592         esac
17593         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
17594 done
17595 LDFLAGS=$cf_rpath_dst
17596
17597 test -n "$verbose" && echo "    ...checked LDFLAGS $LDFLAGS" 1>&6
17598
17599 echo "${as_me:-configure}:17599: testing ...checked LDFLAGS $LDFLAGS ..." 1>&5
17600
17601 test -n "$verbose" && echo "    ...checking LIBS $LIBS" 1>&6
17602
17603 echo "${as_me:-configure}:17603: testing ...checking LIBS $LIBS ..." 1>&5
17604
17605 cf_rpath_dst=
17606 for cf_rpath_src in $LIBS
17607 do
17608         case $cf_rpath_src in
17609         (-L*)
17610
17611                 # check if this refers to a directory which we will ignore
17612                 cf_rpath_skip=no
17613                 if test -n "$cf_rpath_list"
17614                 then
17615                         for cf_rpath_item in $cf_rpath_list
17616                         do
17617                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
17618                                 then
17619                                         cf_rpath_skip=yes
17620                                         break
17621                                 fi
17622                         done
17623                 fi
17624
17625                 if test "$cf_rpath_skip" = no
17626                 then
17627                         # transform the option
17628                         if test "$LD_RPATH_OPT" = "-R " ; then
17629                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
17630                         else
17631                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
17632                         fi
17633
17634                         # if we have not already added this, add it now
17635                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
17636                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
17637                         then
17638                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
17639
17640 echo "${as_me:-configure}:17640: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
17641
17642                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
17643                         fi
17644                 fi
17645                 ;;
17646         esac
17647         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
17648 done
17649 LIBS=$cf_rpath_dst
17650
17651 test -n "$verbose" && echo "    ...checked LIBS $LIBS" 1>&6
17652
17653 echo "${as_me:-configure}:17653: testing ...checked LIBS $LIBS ..." 1>&5
17654
17655         test -n "$verbose" && echo "    ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
17656
17657 echo "${as_me:-configure}:17657: testing ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
17658
17659 else
17660         echo "$as_me:17660: result: no" >&5
17661 echo "${ECHO_T}no" >&6
17662 fi
17663
17664 fi
17665
17666 TEST_ARGS="$LIBS"
17667 LIBS=
17668
17669 ac_config_files="$ac_config_files Makefile"
17670 ac_config_commands="$ac_config_commands default"
17671 cat >confcache <<\_ACEOF
17672 # This file is a shell script that caches the results of configure
17673 # tests run on this system so they can be shared between configure
17674 # scripts and configure runs, see configure's option --config-cache.
17675 # It is not useful on other systems.  If it contains results you don't
17676 # want to keep, you may remove or edit it.
17677 #
17678 # config.status only pays attention to the cache file if you give it
17679 # the --recheck option to rerun configure.
17680 #
17681 # `ac_cv_env_foo' variables (set or unset) will be overriden when
17682 # loading this file, other *unset* `ac_cv_foo' will be assigned the
17683 # following values.
17684
17685 _ACEOF
17686
17687 # The following way of writing the cache mishandles newlines in values,
17688 # but we know of no workaround that is simple, portable, and efficient.
17689 # So, don't put newlines in cache variables' values.
17690 # Ultrix sh set writes to stderr and can't be redirected directly,
17691 # and sets the high bit in the cache file unless we assign to the vars.
17692 {
17693   (set) 2>&1 |
17694     case `(ac_space=' '; set | grep ac_space) 2>&1` in
17695     *ac_space=\ *)
17696       # `set' does not quote correctly, so add quotes (double-quote
17697       # substitution turns \\\\ into \\, and sed turns \\ into \).
17698       sed -n \
17699         "s/'/'\\\\''/g;
17700           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
17701       ;;
17702     *)
17703       # `set' quotes correctly as required by POSIX, so do not add quotes.
17704       sed -n \
17705         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
17706       ;;
17707     esac;
17708 } |
17709   sed '
17710      t clear
17711      : clear
17712      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
17713      t end
17714      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
17715      : end' >>confcache
17716 if cmp -s $cache_file confcache; then :; else
17717   if test -w $cache_file; then
17718     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
17719     cat confcache >$cache_file
17720   else
17721     echo "not updating unwritable cache $cache_file"
17722   fi
17723 fi
17724 rm -f confcache
17725
17726 test "x$prefix" = xNONE && prefix=$ac_default_prefix
17727 # Let make expand exec_prefix.
17728 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
17729
17730 # VPATH may cause trouble with some makes, so we remove $(srcdir),
17731 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
17732 # trailing colons and then remove the whole line if VPATH becomes empty
17733 # (actually we leave an empty line to preserve line numbers).
17734 if test "x$srcdir" = x.; then
17735   ac_vpsub='/^[         ]*VPATH[        ]*=/{
17736 s/:*\$(srcdir):*/:/;
17737 s/:*\${srcdir}:*/:/;
17738 s/:*@srcdir@:*/:/;
17739 s/^\([^=]*=[    ]*\):*/\1/;
17740 s/:*$//;
17741 s/^[^=]*=[      ]*$//;
17742 }'
17743 fi
17744
17745 DEFS=-DHAVE_CONFIG_H
17746
17747 : ${CONFIG_STATUS=./config.status}
17748 ac_clean_files_save=$ac_clean_files
17749 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
17750 { echo "$as_me:17750: creating $CONFIG_STATUS" >&5
17751 echo "$as_me: creating $CONFIG_STATUS" >&6;}
17752 cat >$CONFIG_STATUS <<_ACEOF
17753 #! $SHELL
17754 # Generated automatically by configure.
17755 # Run this file to recreate the current configuration.
17756 # Compiler output produced by configure, useful for debugging
17757 # configure, is in config.log if it exists.
17758
17759 debug=false
17760 SHELL=\${CONFIG_SHELL-$SHELL}
17761 ac_cs_invocation="\$0 \$@"
17762
17763 _ACEOF
17764
17765 cat >>$CONFIG_STATUS <<\_ACEOF
17766 # Be Bourne compatible
17767 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
17768   emulate sh
17769   NULLCMD=:
17770 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
17771   set -o posix
17772 fi
17773
17774 # Name of the executable.
17775 as_me=`echo "$0" |sed 's,.*[\\/],,'`
17776
17777 if expr a : '\(a\)' >/dev/null 2>&1; then
17778   as_expr=expr
17779 else
17780   as_expr=false
17781 fi
17782
17783 rm -f conf$$ conf$$.exe conf$$.file
17784 echo >conf$$.file
17785 if ln -s conf$$.file conf$$ 2>/dev/null; then
17786   # We could just check for DJGPP; but this test a) works b) is more generic
17787   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
17788   if test -f conf$$.exe; then
17789     # Don't use ln at all; we don't have any links
17790     as_ln_s='cp -p'
17791   else
17792     as_ln_s='ln -s'
17793   fi
17794 elif ln conf$$.file conf$$ 2>/dev/null; then
17795   as_ln_s=ln
17796 else
17797   as_ln_s='cp -p'
17798 fi
17799 rm -f conf$$ conf$$.exe conf$$.file
17800
17801 as_executable_p="test -f"
17802
17803 # Support unset when possible.
17804 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
17805   as_unset=unset
17806 else
17807   as_unset=false
17808 fi
17809
17810 # NLS nuisances.
17811 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
17812 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
17813 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
17814 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
17815 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
17816 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
17817 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
17818 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
17819
17820 # IFS
17821 # We need space, tab and new line, in precisely that order.
17822 as_nl='
17823 '
17824 IFS="   $as_nl"
17825
17826 # CDPATH.
17827 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
17828
17829 exec 6>&1
17830
17831 _ACEOF
17832
17833 # Files that config.status was made for.
17834 if test -n "$ac_config_files"; then
17835   echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
17836 fi
17837
17838 if test -n "$ac_config_headers"; then
17839   echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
17840 fi
17841
17842 if test -n "$ac_config_links"; then
17843   echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
17844 fi
17845
17846 if test -n "$ac_config_commands"; then
17847   echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
17848 fi
17849
17850 cat >>$CONFIG_STATUS <<\EOF
17851
17852 ac_cs_usage="\
17853 \`$as_me' instantiates files from templates according to the
17854 current configuration.
17855
17856 Usage: $0 [OPTIONS] [FILE]...
17857
17858   -h, --help       print this help, then exit
17859   -V, --version    print version number, then exit
17860   -d, --debug      don't remove temporary files
17861       --recheck    update $as_me by reconfiguring in the same conditions
17862   --file=FILE[:TEMPLATE]
17863                    instantiate the configuration file FILE
17864   --header=FILE[:TEMPLATE]
17865                    instantiate the configuration header FILE
17866
17867 Configuration files:
17868 $config_files
17869
17870 Configuration headers:
17871 $config_headers
17872
17873 Configuration commands:
17874 $config_commands
17875
17876 Report bugs to <dickey@invisible-island.net>."
17877 EOF
17878
17879 cat >>$CONFIG_STATUS <<EOF
17880 ac_cs_version="\\
17881 config.status
17882 configured by $0, generated by GNU Autoconf 2.52.20150926,
17883   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
17884
17885 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
17886 Free Software Foundation, Inc.
17887 This config.status script is free software; the Free Software Foundation
17888 gives unlimited permission to copy, distribute and modify it."
17889 srcdir=$srcdir
17890 INSTALL="$INSTALL"
17891 EOF
17892
17893 cat >>$CONFIG_STATUS <<\EOF
17894 # If no file are specified by the user, then we need to provide default
17895 # value.  By we need to know if files were specified by the user.
17896 ac_need_defaults=:
17897 while test $# != 0
17898 do
17899   case $1 in
17900   --*=*)
17901     ac_option=`expr "x$1" : 'x\([^=]*\)='`
17902     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
17903     shift
17904     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
17905     shift
17906     ;;
17907   -*);;
17908   *) # This is not an option, so the user has probably given explicit
17909      # arguments.
17910      ac_need_defaults=false;;
17911   esac
17912
17913   case $1 in
17914   # Handling of the options.
17915 EOF
17916 cat >>$CONFIG_STATUS <<EOF
17917   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
17918     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
17919     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
17920 EOF
17921 cat >>$CONFIG_STATUS <<\EOF
17922   --version | --vers* | -V )
17923     echo "$ac_cs_version"; exit 0 ;;
17924   --he | --h)
17925     # Conflict between --help and --header
17926     { { echo "$as_me:17926: error: ambiguous option: $1
17927 Try \`$0 --help' for more information." >&5
17928 echo "$as_me: error: ambiguous option: $1
17929 Try \`$0 --help' for more information." >&2;}
17930    { (exit 1); exit 1; }; };;
17931   --help | --hel | -h )
17932     echo "$ac_cs_usage"; exit 0 ;;
17933   --debug | --d* | -d )
17934     debug=: ;;
17935   --file | --fil | --fi | --f )
17936     shift
17937     CONFIG_FILES="$CONFIG_FILES $1"
17938     ac_need_defaults=false;;
17939   --header | --heade | --head | --hea )
17940     shift
17941     CONFIG_HEADERS="$CONFIG_HEADERS $1"
17942     ac_need_defaults=false;;
17943
17944   # This is an error.
17945   -*) { { echo "$as_me:17945: error: unrecognized option: $1
17946 Try \`$0 --help' for more information." >&5
17947 echo "$as_me: error: unrecognized option: $1
17948 Try \`$0 --help' for more information." >&2;}
17949    { (exit 1); exit 1; }; } ;;
17950
17951   *) ac_config_targets="$ac_config_targets $1" ;;
17952
17953   esac
17954   shift
17955 done
17956
17957 exec 5>>config.log
17958 cat >&5 << _ACEOF
17959
17960 ## ----------------------- ##
17961 ## Running config.status.  ##
17962 ## ----------------------- ##
17963
17964 This file was extended by $as_me 2.52.20150926, executed with
17965   CONFIG_FILES    = $CONFIG_FILES
17966   CONFIG_HEADERS  = $CONFIG_HEADERS
17967   CONFIG_LINKS    = $CONFIG_LINKS
17968   CONFIG_COMMANDS = $CONFIG_COMMANDS
17969   > $ac_cs_invocation
17970 on `(hostname || uname -n) 2>/dev/null | sed 1q`
17971
17972 _ACEOF
17973 EOF
17974
17975 cat >>$CONFIG_STATUS <<EOF
17976 #
17977 # INIT-COMMANDS section.
17978 #
17979
17980 AWK="$AWK"
17981 ECHO_CC="$ECHO_CC"
17982 ECHO_LD="$ECHO_LD"
17983 SHOW_CC="$SHOW_LD"
17984
17985 EOF
17986
17987 cat >>$CONFIG_STATUS <<\EOF
17988 for ac_config_target in $ac_config_targets
17989 do
17990   case "$ac_config_target" in
17991   # Handling of arguments.
17992   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
17993   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
17994   "ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS ncurses_cfg.h:ncurses_tst.hin" ;;
17995   *) { { echo "$as_me:17995: error: invalid argument: $ac_config_target" >&5
17996 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
17997    { (exit 1); exit 1; }; };;
17998   esac
17999 done
18000
18001 # If the user did not use the arguments to specify the items to instantiate,
18002 # then the envvar interface is used.  Set only those that are not.
18003 # We use the long form for the default assignment because of an extremely
18004 # bizarre bug on SunOS 4.1.3.
18005 if $ac_need_defaults; then
18006   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
18007   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
18008   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
18009 fi
18010
18011 # Create a temporary directory, and hook for its removal unless debugging.
18012 $debug ||
18013 {
18014   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
18015   trap '{ (exit 1); exit 1; }' 1 2 13 15
18016 }
18017
18018 # Create a (secure) tmp directory for tmp files.
18019 : ${TMPDIR=/tmp}
18020 {
18021   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
18022   test -n "$tmp" && test -d "$tmp"
18023 }  ||
18024 {
18025   tmp=$TMPDIR/cs$$-$RANDOM
18026   (umask 077 && mkdir $tmp)
18027 } ||
18028 {
18029    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
18030    { (exit 1); exit 1; }
18031 }
18032
18033 EOF
18034
18035 cat >>$CONFIG_STATUS <<EOF
18036
18037 #
18038 # CONFIG_FILES section.
18039 #
18040
18041 # No need to generate the scripts if there are no CONFIG_FILES.
18042 # This happens for instance when ./config.status config.h
18043 if test -n "\$CONFIG_FILES"; then
18044   # Protect against being on the right side of a sed subst in config.status.
18045   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
18046    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
18047 s,@SHELL@,$SHELL,;t t
18048 s,@exec_prefix@,$exec_prefix,;t t
18049 s,@prefix@,$prefix,;t t
18050 s,@program_transform_name@,$program_transform_name,;t t
18051 s,@bindir@,$bindir,;t t
18052 s,@sbindir@,$sbindir,;t t
18053 s,@libexecdir@,$libexecdir,;t t
18054 s,@datarootdir@,$datarootdir,;t t
18055 s,@datadir@,$datadir,;t t
18056 s,@sysconfdir@,$sysconfdir,;t t
18057 s,@sharedstatedir@,$sharedstatedir,;t t
18058 s,@localstatedir@,$localstatedir,;t t
18059 s,@libdir@,$libdir,;t t
18060 s,@includedir@,$includedir,;t t
18061 s,@oldincludedir@,$oldincludedir,;t t
18062 s,@infodir@,$infodir,;t t
18063 s,@mandir@,$mandir,;t t
18064 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
18065 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
18066 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
18067 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
18068 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
18069 s,@build_alias@,$build_alias,;t t
18070 s,@host_alias@,$host_alias,;t t
18071 s,@target_alias@,$target_alias,;t t
18072 s,@ECHO_C@,$ECHO_C,;t t
18073 s,@ECHO_N@,$ECHO_N,;t t
18074 s,@ECHO_T@,$ECHO_T,;t t
18075 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
18076 s,@DEFS@,$DEFS,;t t
18077 s,@LIBS@,$LIBS,;t t
18078 s,@build@,$build,;t t
18079 s,@build_cpu@,$build_cpu,;t t
18080 s,@build_vendor@,$build_vendor,;t t
18081 s,@build_os@,$build_os,;t t
18082 s,@host@,$host,;t t
18083 s,@host_cpu@,$host_cpu,;t t
18084 s,@host_vendor@,$host_vendor,;t t
18085 s,@host_os@,$host_os,;t t
18086 s,@SET_MAKE@,$SET_MAKE,;t t
18087 s,@CC@,$CC,;t t
18088 s,@CFLAGS@,$CFLAGS,;t t
18089 s,@LDFLAGS@,$LDFLAGS,;t t
18090 s,@CPPFLAGS@,$CPPFLAGS,;t t
18091 s,@ac_ct_CC@,$ac_ct_CC,;t t
18092 s,@EXEEXT@,$EXEEXT,;t t
18093 s,@OBJEXT@,$OBJEXT,;t t
18094 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
18095 s,@CPP@,$CPP,;t t
18096 s,@AWK@,$AWK,;t t
18097 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
18098 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
18099 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
18100 s,@LINT@,$LINT,;t t
18101 s,@LINT_OPTS@,$LINT_OPTS,;t t
18102 s,@CTAGS@,$CTAGS,;t t
18103 s,@ETAGS@,$ETAGS,;t t
18104 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
18105 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
18106 s,@MATH_LIB@,$MATH_LIB,;t t
18107 s,@top_builddir@,$top_builddir,;t t
18108 s,@CC_G_OPT@,$CC_G_OPT,;t t
18109 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
18110 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
18111 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
18112 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
18113 s,@LD@,$LD,;t t
18114 s,@LDFLAGS_SHARED@,$LDFLAGS_SHARED,;t t
18115 s,@LDFLAGS_STATIC@,$LDFLAGS_STATIC,;t t
18116 s,@LD_MODEL@,$LD_MODEL,;t t
18117 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
18118 s,@LIBTOOL@,$LIBTOOL,;t t
18119 s,@LIBTOOL_OPTS@,$LIBTOOL_OPTS,;t t
18120 s,@LIB_CLEAN@,$LIB_CLEAN,;t t
18121 s,@LIB_COMPILE@,$LIB_COMPILE,;t t
18122 s,@LIB_LINK@,$LIB_LINK,;t t
18123 s,@LINK_TESTS@,$LINK_TESTS,;t t
18124 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
18125 s,@PACKAGE@,$PACKAGE,;t t
18126 s,@PTHREAD@,$PTHREAD,;t t
18127 s,@TEST_ARGS@,$TEST_ARGS,;t t
18128 s,@TEST_DEPS@,$TEST_DEPS,;t t
18129 s,@TEST_LIBS@,$TEST_LIBS,;t t
18130 s,@TINFO_LDFLAGS@,$TINFO_LDFLAGS,;t t
18131 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
18132 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
18133 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
18134 s,@includesubdir@,$includesubdir,;t t
18135 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
18136 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
18137 s,@ECHO_LT@,$ECHO_LT,;t t
18138 s,@ECHO_LD@,$ECHO_LD,;t t
18139 s,@RULE_CC@,$RULE_CC,;t t
18140 s,@SHOW_CC@,$SHOW_CC,;t t
18141 s,@ECHO_CC@,$ECHO_CC,;t t
18142 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
18143 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
18144 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
18145 s,@X_CFLAGS@,$X_CFLAGS,;t t
18146 s,@X_PRE_LIBS@,$X_PRE_LIBS,;t t
18147 s,@X_LIBS@,$X_LIBS,;t t
18148 s,@X_EXTRA_LIBS@,$X_EXTRA_LIBS,;t t
18149 s,@XCURSES_CONFIG@,$XCURSES_CONFIG,;t t
18150 s,@ac_ct_XCURSES_CONFIG@,$ac_ct_XCURSES_CONFIG,;t t
18151 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
18152 s,@cf_ldd_prog@,$cf_ldd_prog,;t t
18153 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
18154 CEOF
18155
18156 EOF
18157
18158   cat >>$CONFIG_STATUS <<\EOF
18159   # Split the substitutions into bite-sized pieces for seds with
18160   # small command number limits, like on Digital OSF/1 and HP-UX.
18161   ac_max_sed_lines=48
18162   ac_sed_frag=1 # Number of current file.
18163   ac_beg=1 # First line for current file.
18164   ac_end=$ac_max_sed_lines # Line after last line for current file.
18165   ac_more_lines=:
18166   ac_sed_cmds=
18167   while $ac_more_lines; do
18168     if test $ac_beg -gt 1; then
18169       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
18170     else
18171       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
18172     fi
18173     if test ! -s $tmp/subs.frag; then
18174       ac_more_lines=false
18175     else
18176       # The purpose of the label and of the branching condition is to
18177       # speed up the sed processing (if there are no `@' at all, there
18178       # is no need to browse any of the substitutions).
18179       # These are the two extra sed commands mentioned above.
18180       (echo ':t
18181   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
18182       # It is possible to make a multiline substitution using escaped newlines.
18183       # Ensure that we do not split the substitution between script fragments.
18184       ac_BEG=$ac_end
18185       ac_END=`expr $ac_end + $ac_max_sed_lines`
18186       sed "1,${ac_BEG}d; ${ac_END}p; q" $tmp/subs.sed >$tmp/subs.next
18187       if test -s $tmp/subs.next; then
18188         grep '^s,@[^@,][^@,]*@,.*\\$' $tmp/subs.next >$tmp/subs.edit
18189         if test ! -s $tmp/subs.edit; then
18190           grep "^s,@[^@,][^@,]*@,.*,;t t$" $tmp/subs.next >$tmp/subs.edit
18191           if test ! -s $tmp/subs.edit; then
18192             if test $ac_beg -gt 1; then
18193               ac_end=`expr $ac_end - 1`
18194               continue
18195             fi
18196           fi
18197         fi
18198       fi
18199
18200       if test -z "$ac_sed_cmds"; then
18201         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
18202       else
18203         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
18204       fi
18205       ac_sed_frag=`expr $ac_sed_frag + 1`
18206       ac_beg=$ac_end
18207       ac_end=`expr $ac_end + $ac_max_sed_lines`
18208     fi
18209   done
18210   if test -z "$ac_sed_cmds"; then
18211     ac_sed_cmds=cat
18212   fi
18213 fi # test -n "$CONFIG_FILES"
18214
18215 EOF
18216 cat >>$CONFIG_STATUS <<\EOF
18217 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
18218   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
18219   case $ac_file in
18220   - | *:- | *:-:* ) # input from stdin
18221         cat >$tmp/stdin
18222         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
18223         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
18224   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
18225         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
18226   * )   ac_file_in=$ac_file.in ;;
18227   esac
18228
18229   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
18230   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
18231          X"$ac_file" : 'X\(//\)[^/]' \| \
18232          X"$ac_file" : 'X\(//\)$' \| \
18233          X"$ac_file" : 'X\(/\)' \| \
18234          .     : '\(.\)' 2>/dev/null ||
18235 echo X"$ac_file" |
18236     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
18237           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
18238           /^X\(\/\/\)$/{ s//\1/; q; }
18239           /^X\(\/\).*/{ s//\1/; q; }
18240           s/.*/./; q'`
18241   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
18242     { case "$ac_dir" in
18243   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
18244   *)                      as_incr_dir=.;;
18245 esac
18246 as_dummy="$ac_dir"
18247 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
18248   case $as_mkdir_dir in
18249     # Skip DOS drivespec
18250     ?:) as_incr_dir=$as_mkdir_dir ;;
18251     *)
18252       as_incr_dir=$as_incr_dir/$as_mkdir_dir
18253       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
18254     ;;
18255   esac
18256 done; }
18257
18258     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
18259     # A "../" for each directory in $ac_dir_suffix.
18260     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
18261   else
18262     ac_dir_suffix= ac_dots=
18263   fi
18264
18265   case $srcdir in
18266   .)  ac_srcdir=.
18267       if test -z "$ac_dots"; then
18268          ac_top_srcdir=.
18269       else
18270          ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'`
18271       fi ;;
18272   [\\/]* | ?:[\\/]* )
18273       ac_srcdir=$srcdir$ac_dir_suffix;
18274       ac_top_srcdir=$srcdir ;;
18275   *) # Relative path.
18276     ac_srcdir=$ac_dots$srcdir$ac_dir_suffix
18277     ac_top_srcdir=$ac_dots$srcdir ;;
18278   esac
18279
18280   case $INSTALL in
18281   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
18282   *) ac_INSTALL=$ac_dots$INSTALL ;;
18283   esac
18284
18285   if test x"$ac_file" != x-; then
18286     { echo "$as_me:18286: creating $ac_file" >&5
18287 echo "$as_me: creating $ac_file" >&6;}
18288     rm -f "$ac_file"
18289   fi
18290   # Let's still pretend it is `configure' which instantiates (i.e., don't
18291   # use $as_me), people would be surprised to read:
18292   #    /* config.h.  Generated automatically by config.status.  */
18293   configure_input="Generated automatically from `echo $ac_file_in |
18294                                                  sed 's,.*/,,'` by configure."
18295
18296   # First look for the input files in the build tree, otherwise in the
18297   # src tree.
18298   ac_file_inputs=`IFS=:
18299     for f in $ac_file_in; do
18300       case $f in
18301       -) echo $tmp/stdin ;;
18302       [\\/$]*)
18303          # Absolute (can't be DOS-style, as IFS=:)
18304          test -f "$f" || { { echo "$as_me:18304: error: cannot find input file: $f" >&5
18305 echo "$as_me: error: cannot find input file: $f" >&2;}
18306    { (exit 1); exit 1; }; }
18307          echo $f;;
18308       *) # Relative
18309          if test -f "$f"; then
18310            # Build tree
18311            echo $f
18312          elif test -f "$srcdir/$f"; then
18313            # Source tree
18314            echo $srcdir/$f
18315          else
18316            # /dev/null tree
18317            { { echo "$as_me:18317: error: cannot find input file: $f" >&5
18318 echo "$as_me: error: cannot find input file: $f" >&2;}
18319    { (exit 1); exit 1; }; }
18320          fi;;
18321       esac
18322     done` || { (exit 1); exit 1; }
18323 EOF
18324 cat >>$CONFIG_STATUS <<\EOF
18325   ac_warn_datarootdir=no
18326   if test x"$ac_file" != x-; then
18327     for ac_item in $ac_file_inputs
18328     do
18329       ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' $ac_item`
18330       if test -n "$ac_seen"; then
18331         ac_used=`grep '@datarootdir@' $ac_item`
18332         if test -z "$ac_used"; then
18333           { echo "$as_me:18333: WARNING: datarootdir was used implicitly but not set:
18334 $ac_seen" >&5
18335 echo "$as_me: WARNING: datarootdir was used implicitly but not set:
18336 $ac_seen" >&2;}
18337           ac_warn_datarootdir=yes
18338         fi
18339       fi
18340       ac_seen=`grep '${datarootdir}' $ac_item`
18341       if test -n "$ac_seen"; then
18342         { echo "$as_me:18342: WARNING: datarootdir was used explicitly but not set:
18343 $ac_seen" >&5
18344 echo "$as_me: WARNING: datarootdir was used explicitly but not set:
18345 $ac_seen" >&2;}
18346         ac_warn_datarootdir=yes
18347       fi
18348     done
18349   fi
18350
18351 if test "x$ac_warn_datarootdir" = xyes; then
18352   ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
18353 fi
18354
18355 EOF
18356 cat >>$CONFIG_STATUS <<EOF
18357   sed "$ac_vpsub
18358 $extrasub
18359 EOF
18360 cat >>$CONFIG_STATUS <<\EOF
18361 :t
18362 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
18363 s,@configure_input@,$configure_input,;t t
18364 s,@srcdir@,$ac_srcdir,;t t
18365 s,@top_srcdir@,$ac_top_srcdir,;t t
18366 s,@INSTALL@,$ac_INSTALL,;t t
18367 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
18368   rm -f $tmp/stdin
18369   if test x"$ac_file" != x-; then
18370     cp $tmp/out $ac_file
18371
18372     for ac_name in prefix exec_prefix datarootdir
18373     do
18374         ac_seen=`fgrep -n '${'$ac_name'[:=].*}' $ac_file`
18375         if test -n "$ac_seen"; then
18376             ac_init=`egrep '[   ]*'$ac_name'[   ]*=' $ac_file`
18377             if test -z "$ac_init"; then
18378               ac_seen=`echo "$ac_seen" |sed -e 's,^,'$ac_file':,'`
18379               { echo "$as_me:18379: WARNING: Variable $ac_name is used but was not set:
18380 $ac_seen" >&5
18381 echo "$as_me: WARNING: Variable $ac_name is used but was not set:
18382 $ac_seen" >&2;}
18383             fi
18384         fi
18385     done
18386     egrep -n '@[a-z_][a-z_0-9]+@' $ac_file >$tmp/out
18387     egrep -n '@[A-Z_][A-Z_0-9]+@' $ac_file >>$tmp/out
18388     if test -s $tmp/out; then
18389       ac_seen=`sed -e 's,^,'$ac_file':,' < $tmp/out`
18390       { echo "$as_me:18390: WARNING: Some variables may not be substituted:
18391 $ac_seen" >&5
18392 echo "$as_me: WARNING: Some variables may not be substituted:
18393 $ac_seen" >&2;}
18394     fi
18395   else
18396     cat $tmp/out
18397   fi
18398   rm -f $tmp/out
18399
18400 done
18401 EOF
18402 cat >>$CONFIG_STATUS <<\EOF
18403
18404 #
18405 # CONFIG_HEADER section.
18406 #
18407
18408 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
18409 # NAME is the cpp macro being defined and VALUE is the value it is being given.
18410 #
18411 # ac_d sets the value in "#define NAME VALUE" lines.
18412 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
18413 ac_dB='[        ].*$,\1#\2'
18414 ac_dC=' '
18415 ac_dD=',;t'
18416 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
18417 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
18418 ac_iB='\([      ]\),\1#\2define\3'
18419 ac_iC=' '
18420 ac_iD='\4,;t'
18421 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
18422 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
18423 ac_uB='$,\1#\2define\3'
18424 ac_uC=' '
18425 ac_uD=',;t'
18426
18427 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
18428   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
18429   case $ac_file in
18430   - | *:- | *:-:* ) # input from stdin
18431         cat >$tmp/stdin
18432         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
18433         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
18434   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
18435         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
18436   * )   ac_file_in=$ac_file.in ;;
18437   esac
18438
18439   test x"$ac_file" != x- && { echo "$as_me:18439: creating $ac_file" >&5
18440 echo "$as_me: creating $ac_file" >&6;}
18441
18442   # First look for the input files in the build tree, otherwise in the
18443   # src tree.
18444   ac_file_inputs=`IFS=:
18445     for f in $ac_file_in; do
18446       case $f in
18447       -) echo $tmp/stdin ;;
18448       [\\/$]*)
18449          # Absolute (can't be DOS-style, as IFS=:)
18450          test -f "$f" || { { echo "$as_me:18450: error: cannot find input file: $f" >&5
18451 echo "$as_me: error: cannot find input file: $f" >&2;}
18452    { (exit 1); exit 1; }; }
18453          echo $f;;
18454       *) # Relative
18455          if test -f "$f"; then
18456            # Build tree
18457            echo $f
18458          elif test -f "$srcdir/$f"; then
18459            # Source tree
18460            echo $srcdir/$f
18461          else
18462            # /dev/null tree
18463            { { echo "$as_me:18463: error: cannot find input file: $f" >&5
18464 echo "$as_me: error: cannot find input file: $f" >&2;}
18465    { (exit 1); exit 1; }; }
18466          fi;;
18467       esac
18468     done` || { (exit 1); exit 1; }
18469   # Remove the trailing spaces.
18470   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
18471
18472 EOF
18473
18474 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
18475 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
18476 # be either 'cat' or 'sort'.
18477 cat confdefs.h | uniq >conftest.vals
18478
18479 # Break up conftest.vals because some shells have a limit on
18480 # the size of here documents, and old seds have small limits too.
18481
18482 rm -f conftest.tail
18483 echo '  rm -f conftest.frag' >> $CONFIG_STATUS
18484 while grep . conftest.vals >/dev/null
18485 do
18486   # Write chunks of a limited-size here document to conftest.frag.
18487   echo '  cat >> conftest.frag <<CEOF' >> $CONFIG_STATUS
18488   sed ${ac_max_here_lines}q conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> $CONFIG_STATUS
18489   echo 'CEOF' >> $CONFIG_STATUS
18490   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
18491   rm -f conftest.vals
18492   mv conftest.tail conftest.vals
18493 done
18494 rm -f conftest.vals
18495
18496 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
18497 # marker @DEFS@.
18498 echo '  cat >> conftest.edit <<CEOF
18499 /@DEFS@/r conftest.frag
18500 /@DEFS@/d
18501 CEOF
18502 sed -f conftest.edit $tmp/in > $tmp/out
18503 rm -f $tmp/in
18504 mv $tmp/out $tmp/in
18505 rm -f conftest.edit conftest.frag
18506 ' >> $CONFIG_STATUS
18507
18508 cat >>$CONFIG_STATUS <<\EOF
18509   # Let's still pretend it is `configure' which instantiates (i.e., don't
18510   # use $as_me), people would be surprised to read:
18511   #    /* config.h.  Generated automatically by config.status.  */
18512   if test x"$ac_file" = x-; then
18513     echo "/* Generated automatically by configure.  */" >$tmp/config.h
18514   else
18515     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
18516   fi
18517   cat $tmp/in >>$tmp/config.h
18518   rm -f $tmp/in
18519   if test x"$ac_file" != x-; then
18520     if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
18521       { echo "$as_me:18521: $ac_file is unchanged" >&5
18522 echo "$as_me: $ac_file is unchanged" >&6;}
18523     else
18524       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
18525          X"$ac_file" : 'X\(//\)[^/]' \| \
18526          X"$ac_file" : 'X\(//\)$' \| \
18527          X"$ac_file" : 'X\(/\)' \| \
18528          .     : '\(.\)' 2>/dev/null ||
18529 echo X"$ac_file" |
18530     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
18531           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
18532           /^X\(\/\/\)$/{ s//\1/; q; }
18533           /^X\(\/\).*/{ s//\1/; q; }
18534           s/.*/./; q'`
18535       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
18536         { case "$ac_dir" in
18537   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
18538   *)                      as_incr_dir=.;;
18539 esac
18540 as_dummy="$ac_dir"
18541 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
18542   case $as_mkdir_dir in
18543     # Skip DOS drivespec
18544     ?:) as_incr_dir=$as_mkdir_dir ;;
18545     *)
18546       as_incr_dir=$as_incr_dir/$as_mkdir_dir
18547       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
18548     ;;
18549   esac
18550 done; }
18551
18552       fi
18553       rm -f $ac_file
18554       mv $tmp/config.h $ac_file
18555     fi
18556   else
18557     cat $tmp/config.h
18558     rm -f $tmp/config.h
18559   fi
18560 done
18561 EOF
18562 cat >>$CONFIG_STATUS <<\EOF
18563 #
18564 # CONFIG_COMMANDS section.
18565 #
18566 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
18567   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
18568   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
18569
18570   case $ac_dest in
18571     default )
18572
18573 for cf_dir in .
18574 do
18575         if test ! -d $srcdir/$cf_dir; then
18576                 continue
18577         elif test -f $srcdir/$cf_dir/programs; then
18578                 $AWK -f $srcdir/mk-test.awk INSTALL=yes ECHO_LINK="$ECHO_LD" $srcdir/$cf_dir/programs >>$cf_dir/Makefile
18579         fi
18580 done
18581
18582         cat >>Makefile <<TEST_EOF
18583
18584 # These rules are generated so we do not rely on suffix rules, which do not
18585 # work consistently for different make-programs (the '\$(MODEL)/' confuses
18586 # some, and the '\$x' confuses others).
18587 TEST_EOF
18588
18589 LIST=`sed -e 's/[       ].*//' -e '/^[#@]/d' $srcdir/modules`
18590 for N in $LIST
18591 do
18592         cat >>Makefile <<TEST_EOF
18593
18594 \$(MODEL)/$N.o : \$(srcdir)/$N.c \\
18595         \$(srcdir)/test.priv.h \\
18596         ncurses_cfg.h
18597         $SHOW_CC
18598         $ECHO_CC\$(CC) -c \$(CFLAGS_DEFAULT) \$(srcdir)/$N.c
18599 TEST_EOF
18600 done
18601
18602 if test -f ../config.guess && test -f ../config.sub
18603 then
18604         cat >>Makefile <<TEST_EOF
18605
18606 # if we used CF_INHERIT for getting these files, we can remove them
18607 distclean::
18608         rm -f config.guess config.sub
18609 TEST_EOF
18610 fi
18611  ;;
18612   esac
18613 done
18614 EOF
18615
18616 cat >>$CONFIG_STATUS <<\EOF
18617
18618 { (exit 0); exit 0; }
18619 EOF
18620 chmod +x $CONFIG_STATUS
18621 ac_clean_files=$ac_clean_files_save
18622
18623 # configure is writing to config.log, and then calls config.status.
18624 # config.status does its own redirection, appending to config.log.
18625 # Unfortunately, on DOS this fails, as config.log is still kept open
18626 # by configure, so config.status won't be able to write to it; its
18627 # output is simply discarded.  So we exec the FD to /dev/null,
18628 # effectively closing config.log, so it can be properly (re)opened and
18629 # appended to by config.status.  When coming back to configure, we
18630 # need to make the FD available again.
18631 if test "$no_create" != yes; then
18632   ac_cs_success=:
18633   exec 5>/dev/null
18634   $SHELL $CONFIG_STATUS || ac_cs_success=false
18635   exec 5>>config.log
18636   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
18637   # would make configure fail if this is the last instruction.
18638   $ac_cs_success || { (exit 1); exit 1; }
18639 fi
18640