]> ncurses.scripts.mit.edu Git - ncurses.git/blob - test/configure
ncurses 6.0 - patch 20180106
[ncurses.git] / test / configure
1 #! /bin/sh
2 # Guess values for system-dependent variables and create Makefiles.
3 # Generated by Autoconf 2.52.20170501.
4 #
5 # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
6 # Free Software Foundation, Inc.
7 # This configure script is free software; the Free Software Foundation
8 # gives unlimited permission to copy, distribute and modify it.
9
10 # Avoid depending upon Character Ranges.
11 as_cr_letters='abcdefghijklmnopqrstuvwxyz'
12 as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
13 as_cr_Letters=$as_cr_letters$as_cr_LETTERS
14 as_cr_digits='0123456789'
15 as_cr_alnum=$as_cr_Letters$as_cr_digits
16
17 # Sed expression to map a string onto a valid variable name.
18 as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
19
20 # Sed expression to map a string onto a valid CPP name.
21 as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
22
23 # Be Bourne compatible
24 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
25   emulate sh
26   NULLCMD=:
27 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
28   set -o posix
29 fi
30
31 # Name of the executable.
32 as_me=`echo "$0" |sed 's,.*[\\/],,'`
33
34 if expr a : '\(a\)' >/dev/null 2>&1; then
35   as_expr=expr
36 else
37   as_expr=false
38 fi
39
40 rm -f conf$$ conf$$.exe conf$$.file
41 echo >conf$$.file
42 if ln -s conf$$.file conf$$ 2>/dev/null; then
43   # We could just check for DJGPP; but this test a) works b) is more generic
44   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
45   if test -f conf$$.exe; then
46     # Don't use ln at all; we don't have any links
47     as_ln_s='cp -p'
48   else
49     as_ln_s='ln -s'
50   fi
51 elif ln conf$$.file conf$$ 2>/dev/null; then
52   as_ln_s=ln
53 else
54   as_ln_s='cp -p'
55 fi
56 rm -f conf$$ conf$$.exe conf$$.file
57
58 as_executable_p="test -f"
59
60 # Support unset when possible.
61 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
62   as_unset=unset
63 else
64   as_unset=false
65 fi
66
67 # NLS nuisances.
68 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
69 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
70 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
71 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
72 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
73 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
74 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
75 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
76
77 # IFS
78 # We need space, tab and new line, in precisely that order.
79 as_nl='
80 '
81 IFS="   $as_nl"
82
83 # CDPATH.
84 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
85
86 # Name of the host.
87 # hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
88 # so uname gets run too.
89 ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
90
91 exec 6>&1
92
93 #
94 # Initializations.
95 #
96 ac_default_prefix=/usr/local
97 cross_compiling=no
98 subdirs=
99 MFLAGS= MAKEFLAGS=
100 SHELL=${CONFIG_SHELL-/bin/sh}
101
102 # Maximum number of lines to put in a shell here document.
103 # This variable seems obsolete.  It should probably be removed, and
104 # only ac_max_sed_lines should be used.
105 : ${ac_max_here_lines=38}
106
107 ac_unique_file="ncurses.c"
108
109 # Initialize some variables set by options.
110 ac_init_help=
111 ac_init_version=false
112 # The variables have the same names as the options, with
113 # dashes changed to underlines.
114 cache_file=/dev/null
115 exec_prefix=NONE
116 no_create=
117 no_recursion=
118 prefix=NONE
119 program_prefix=NONE
120 program_suffix=NONE
121 program_transform_name=s,x,x,
122 silent=
123 site=
124 srcdir=
125 verbose=
126 x_includes=NONE
127 x_libraries=NONE
128
129 # Installation directory options.
130 # These are left unexpanded so users can "make install exec_prefix=/foo"
131 # and all the variables that are supposed to be based on exec_prefix
132 # by default will actually change.
133 # Use braces instead of parens because sh, perl, etc. also accept them.
134 bindir='${exec_prefix}/bin'
135 sbindir='${exec_prefix}/sbin'
136 libexecdir='${exec_prefix}/libexec'
137 datarootdir='${prefix}/share'
138 datadir='${datarootdir}'
139 sysconfdir='${prefix}/etc'
140 sharedstatedir='${prefix}/com'
141 localstatedir='${prefix}/var'
142 libdir='${exec_prefix}/lib'
143 includedir='${prefix}/include'
144 oldincludedir='/usr/include'
145 infodir='${datarootdir}/info'
146 mandir='${datarootdir}/man'
147
148 # Identity of this package.
149 PACKAGE_NAME=
150 PACKAGE_TARNAME=
151 PACKAGE_VERSION=
152 PACKAGE_STRING=
153 PACKAGE_BUGREPORT=
154
155 ac_prev=
156 for ac_option
157 do
158   # If the previous option needs an argument, assign it.
159   if test -n "$ac_prev"; then
160     eval "$ac_prev=\$ac_option"
161     ac_prev=
162     continue
163   fi
164
165   ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
166
167   # Accept the important Cygnus configure options, so we can diagnose typos.
168
169   case $ac_option in
170
171   -bindir | --bindir | --bindi | --bind | --bin | --bi)
172     ac_prev=bindir ;;
173   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
174     bindir=$ac_optarg ;;
175
176   -build | --build | --buil | --bui | --bu)
177     ac_prev=build_alias ;;
178   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
179     build_alias=$ac_optarg ;;
180
181   -cache-file | --cache-file | --cache-fil | --cache-fi \
182   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
183     ac_prev=cache_file ;;
184   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
185   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
186     cache_file=$ac_optarg ;;
187
188   --config-cache | -C)
189     cache_file=config.cache ;;
190
191   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
192     ac_prev=datadir ;;
193   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
194   | --da=*)
195     datadir=$ac_optarg ;;
196
197   -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
198   | --dataroo | --dataro | --datar)
199     ac_prev=datarootdir ;;
200   -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
201   | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
202     datarootdir=$ac_optarg ;;
203
204   -disable-* | --disable-*)
205     ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
206     # Reject names that are not valid shell variable names.
207     expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
208       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
209    { (exit 1); exit 1; }; }
210     ac_feature=`echo $ac_feature | sed 's/-/_/g'`
211     eval "enable_$ac_feature=no" ;;
212
213   -enable-* | --enable-*)
214     ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
215     # Reject names that are not valid shell variable names.
216     expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
217       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
218    { (exit 1); exit 1; }; }
219     ac_feature=`echo $ac_feature | sed 's/-/_/g'`
220     case $ac_option in
221       *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
222       *) ac_optarg=yes ;;
223     esac
224     eval "enable_$ac_feature='$ac_optarg'" ;;
225
226   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
227   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
228   | --exec | --exe | --ex)
229     ac_prev=exec_prefix ;;
230   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
231   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
232   | --exec=* | --exe=* | --ex=*)
233     exec_prefix=$ac_optarg ;;
234
235   -gas | --gas | --ga | --g)
236     # Obsolete; use --with-gas.
237     with_gas=yes ;;
238
239   -help | --help | --hel | --he | -h)
240     ac_init_help=long ;;
241   -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
242     ac_init_help=recursive ;;
243   -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
244     ac_init_help=short ;;
245
246   -host | --host | --hos | --ho)
247     ac_prev=host_alias ;;
248   -host=* | --host=* | --hos=* | --ho=*)
249     host_alias=$ac_optarg ;;
250
251   -includedir | --includedir | --includedi | --included | --include \
252   | --includ | --inclu | --incl | --inc)
253     ac_prev=includedir ;;
254   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
255   | --includ=* | --inclu=* | --incl=* | --inc=*)
256     includedir=$ac_optarg ;;
257
258   -infodir | --infodir | --infodi | --infod | --info | --inf)
259     ac_prev=infodir ;;
260   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
261     infodir=$ac_optarg ;;
262
263   -libdir | --libdir | --libdi | --libd)
264     ac_prev=libdir ;;
265   -libdir=* | --libdir=* | --libdi=* | --libd=*)
266     libdir=$ac_optarg ;;
267
268   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
269   | --libexe | --libex | --libe)
270     ac_prev=libexecdir ;;
271   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
272   | --libexe=* | --libex=* | --libe=*)
273     libexecdir=$ac_optarg ;;
274
275   -localstatedir | --localstatedir | --localstatedi | --localstated \
276   | --localstate | --localstat | --localsta | --localst \
277   | --locals | --local | --loca | --loc | --lo)
278     ac_prev=localstatedir ;;
279   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
280   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
281   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
282     localstatedir=$ac_optarg ;;
283
284   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
285     ac_prev=mandir ;;
286   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
287     mandir=$ac_optarg ;;
288
289   -nfp | --nfp | --nf)
290     # Obsolete; use --without-fp.
291     with_fp=no ;;
292
293   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
294   | --no-cr | --no-c)
295     no_create=yes ;;
296
297   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
298   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
299     no_recursion=yes ;;
300
301   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
302   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
303   | --oldin | --oldi | --old | --ol | --o)
304     ac_prev=oldincludedir ;;
305   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
306   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
307   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
308     oldincludedir=$ac_optarg ;;
309
310   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
311     ac_prev=prefix ;;
312   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
313     prefix=$ac_optarg ;;
314
315   -program-prefix | --program-prefix | --program-prefi | --program-pref \
316   | --program-pre | --program-pr | --program-p)
317     ac_prev=program_prefix ;;
318   -program-prefix=* | --program-prefix=* | --program-prefi=* \
319   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
320     program_prefix=$ac_optarg ;;
321
322   -program-suffix | --program-suffix | --program-suffi | --program-suff \
323   | --program-suf | --program-su | --program-s)
324     ac_prev=program_suffix ;;
325   -program-suffix=* | --program-suffix=* | --program-suffi=* \
326   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
327     program_suffix=$ac_optarg ;;
328
329   -program-transform-name | --program-transform-name \
330   | --program-transform-nam | --program-transform-na \
331   | --program-transform-n | --program-transform- \
332   | --program-transform | --program-transfor \
333   | --program-transfo | --program-transf \
334   | --program-trans | --program-tran \
335   | --progr-tra | --program-tr | --program-t)
336     ac_prev=program_transform_name ;;
337   -program-transform-name=* | --program-transform-name=* \
338   | --program-transform-nam=* | --program-transform-na=* \
339   | --program-transform-n=* | --program-transform-=* \
340   | --program-transform=* | --program-transfor=* \
341   | --program-transfo=* | --program-transf=* \
342   | --program-trans=* | --program-tran=* \
343   | --progr-tra=* | --program-tr=* | --program-t=*)
344     program_transform_name=$ac_optarg ;;
345
346   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
347   | -silent | --silent | --silen | --sile | --sil)
348     silent=yes ;;
349
350   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
351     ac_prev=sbindir ;;
352   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
353   | --sbi=* | --sb=*)
354     sbindir=$ac_optarg ;;
355
356   -sharedstatedir | --sharedstatedir | --sharedstatedi \
357   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
358   | --sharedst | --shareds | --shared | --share | --shar \
359   | --sha | --sh)
360     ac_prev=sharedstatedir ;;
361   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
362   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
363   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
364   | --sha=* | --sh=*)
365     sharedstatedir=$ac_optarg ;;
366
367   -site | --site | --sit)
368     ac_prev=site ;;
369   -site=* | --site=* | --sit=*)
370     site=$ac_optarg ;;
371
372   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
373     ac_prev=srcdir ;;
374   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
375     srcdir=$ac_optarg ;;
376
377   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
378   | --syscon | --sysco | --sysc | --sys | --sy)
379     ac_prev=sysconfdir ;;
380   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
381   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
382     sysconfdir=$ac_optarg ;;
383
384   -target | --target | --targe | --targ | --tar | --ta | --t)
385     ac_prev=target_alias ;;
386   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
387     target_alias=$ac_optarg ;;
388
389   -v | -verbose | --verbose | --verbos | --verbo | --verb)
390     verbose=yes ;;
391
392   -version | --version | --versio | --versi | --vers | -V)
393     ac_init_version=: ;;
394
395   -with-* | --with-*)
396     ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
397     # Reject names that are not valid shell variable names.
398     expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
399       { echo "$as_me: error: invalid package name: $ac_package" >&2
400    { (exit 1); exit 1; }; }
401     ac_package=`echo $ac_package| sed 's/-/_/g'`
402     case $ac_option in
403       *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
404       *) ac_optarg=yes ;;
405     esac
406     eval "with_$ac_package='$ac_optarg'" ;;
407
408   -without-* | --without-*)
409     ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
410     # Reject names that are not valid shell variable names.
411     expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
412       { echo "$as_me: error: invalid package name: $ac_package" >&2
413    { (exit 1); exit 1; }; }
414     ac_package=`echo $ac_package | sed 's/-/_/g'`
415     eval "with_$ac_package=no" ;;
416
417   --x)
418     # Obsolete; use --with-x.
419     with_x=yes ;;
420
421   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
422   | --x-incl | --x-inc | --x-in | --x-i)
423     ac_prev=x_includes ;;
424   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
425   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
426     x_includes=$ac_optarg ;;
427
428   -x-libraries | --x-libraries | --x-librarie | --x-librari \
429   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
430     ac_prev=x_libraries ;;
431   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
432   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
433     x_libraries=$ac_optarg ;;
434
435   -*) { echo "$as_me: error: unrecognized option: $ac_option
436 Try \`$0 --help' for more information." >&2
437    { (exit 1); exit 1; }; }
438     ;;
439
440   *=*)
441     ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
442     # Reject names that are not valid shell variable names.
443     expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
444       { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
445    { (exit 1); exit 1; }; }
446     ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
447     eval "$ac_envvar='$ac_optarg'"
448     export $ac_envvar ;;
449
450   *)
451     # FIXME: should be removed in autoconf 3.0.
452     echo "$as_me: WARNING: you should use --build, --host, --target" >&2
453     expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
454       echo "$as_me: WARNING: invalid host type: $ac_option" >&2
455     : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
456     ;;
457
458   esac
459 done
460
461 if test -n "$ac_prev"; then
462   ac_option=--`echo $ac_prev | sed 's/_/-/g'`
463   { echo "$as_me: error: missing argument to $ac_option" >&2
464    { (exit 1); exit 1; }; }
465 fi
466
467 # Be sure to have absolute paths.
468 for ac_var in exec_prefix prefix
469 do
470   eval ac_val=$`echo $ac_var`
471   case $ac_val in
472     [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
473     *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
474    { (exit 1); exit 1; }; };;
475   esac
476 done
477
478 # Be sure to have absolute paths.
479 for ac_var in bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir \
480               localstatedir libdir includedir oldincludedir infodir mandir
481 do
482   eval ac_val=$`echo $ac_var`
483   case $ac_val in
484     [\\/$]* | ?:[\\/]* ) ;;
485     *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
486    { (exit 1); exit 1; }; };;
487   esac
488 done
489
490 # There might be people who depend on the old broken behavior: `$host'
491 # used to hold the argument of --host etc.
492 build=$build_alias
493 host=$host_alias
494 target=$target_alias
495
496 # FIXME: should be removed in autoconf 3.0.
497 if test "x$host_alias" != x; then
498   if test "x$build_alias" = x; then
499     cross_compiling=maybe
500     echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
501     If a cross compiler is detected then cross compile mode will be used." >&2
502   elif test "x$build_alias" != "x$host_alias"; then
503     cross_compiling=yes
504   fi
505 fi
506
507 ac_tool_prefix=
508 test -n "$host_alias" && ac_tool_prefix=$host_alias-
509
510 test "$silent" = yes && exec 6>/dev/null
511
512 # Find the source files, if location was not specified.
513 if test -z "$srcdir"; then
514   ac_srcdir_defaulted=yes
515   # Try the directory containing this script, then its parent.
516   ac_prog=$0
517   ac_confdir=`echo "$ac_prog" | sed 's%[\\/][^\\/][^\\/]*$%%'`
518   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
519   srcdir=$ac_confdir
520   if test ! -r $srcdir/$ac_unique_file; then
521     srcdir=..
522   fi
523 else
524   ac_srcdir_defaulted=no
525 fi
526 if test ! -r $srcdir/$ac_unique_file; then
527   if test "$ac_srcdir_defaulted" = yes; then
528     { echo "$as_me: error: cannot find sources in $ac_confdir or .." >&2
529    { (exit 1); exit 1; }; }
530   else
531     { echo "$as_me: error: cannot find sources in $srcdir" >&2
532    { (exit 1); exit 1; }; }
533   fi
534 fi
535 srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
536 ac_env_build_alias_set=${build_alias+set}
537 ac_env_build_alias_value=$build_alias
538 ac_cv_env_build_alias_set=${build_alias+set}
539 ac_cv_env_build_alias_value=$build_alias
540 ac_env_host_alias_set=${host_alias+set}
541 ac_env_host_alias_value=$host_alias
542 ac_cv_env_host_alias_set=${host_alias+set}
543 ac_cv_env_host_alias_value=$host_alias
544 ac_env_target_alias_set=${target_alias+set}
545 ac_env_target_alias_value=$target_alias
546 ac_cv_env_target_alias_set=${target_alias+set}
547 ac_cv_env_target_alias_value=$target_alias
548 ac_env_CC_set=${CC+set}
549 ac_env_CC_value=$CC
550 ac_cv_env_CC_set=${CC+set}
551 ac_cv_env_CC_value=$CC
552 ac_env_CFLAGS_set=${CFLAGS+set}
553 ac_env_CFLAGS_value=$CFLAGS
554 ac_cv_env_CFLAGS_set=${CFLAGS+set}
555 ac_cv_env_CFLAGS_value=$CFLAGS
556 ac_env_LDFLAGS_set=${LDFLAGS+set}
557 ac_env_LDFLAGS_value=$LDFLAGS
558 ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
559 ac_cv_env_LDFLAGS_value=$LDFLAGS
560 ac_env_CPPFLAGS_set=${CPPFLAGS+set}
561 ac_env_CPPFLAGS_value=$CPPFLAGS
562 ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
563 ac_cv_env_CPPFLAGS_value=$CPPFLAGS
564 ac_env_CPP_set=${CPP+set}
565 ac_env_CPP_value=$CPP
566 ac_cv_env_CPP_set=${CPP+set}
567 ac_cv_env_CPP_value=$CPP
568
569 #
570 # Report the --help message.
571 #
572 if test "$ac_init_help" = "long"; then
573   # Omit some internal or obsolete options to make the list less imposing.
574   # This message is too long to be a string in the A/UX 3.1 sh.
575   cat <<EOF
576 \`configure' configures this package to adapt to many kinds of systems.
577
578 Usage: $0 [OPTION]... [VAR=VALUE]...
579
580 To assign environment variables (e.g., CC, CFLAGS...), specify them as
581 VAR=VALUE.  See below for descriptions of some of the useful variables.
582
583 Defaults for the options are specified in brackets.
584
585 Configuration:
586   -h, --help              display this help and exit
587       --help=short        display options specific to this package
588       --help=recursive    display the short help of all the included packages
589   -V, --version           display version information and exit
590   -q, --quiet, --silent   do not print \`checking...' messages
591       --cache-file=FILE   cache test results in FILE [disabled]
592   -C, --config-cache      alias for \`--cache-file=config.cache'
593   -n, --no-create         do not create output files
594       --srcdir=DIR        find the sources in DIR [configure dir or \`..']
595
596 EOF
597
598   cat <<EOF
599 Installation directories:
600   --prefix=PREFIX         install architecture-independent files in PREFIX
601                           [$ac_default_prefix]
602   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
603                           [PREFIX]
604
605 By default, \`make install' will install all the files in
606 \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
607 an installation prefix other than \`$ac_default_prefix' using \`--prefix',
608 for instance \`--prefix=\$HOME'.
609
610 For better control, use the options below.
611
612 Fine tuning of the installation directories:
613   --bindir=DIR            user executables [EPREFIX/bin]
614   --sbindir=DIR           system admin executables [EPREFIX/sbin]
615   --libexecdir=DIR        program executables [EPREFIX/libexec]
616   --datarootdir=DIR       read-only architecture-independent data [PREFIX/share]
617   --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
618   --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
619   --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
620   --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
621   --libdir=DIR            object code libraries [EPREFIX/lib]
622   --includedir=DIR        C header files [PREFIX/include]
623   --oldincludedir=DIR     C header files for non-gcc [/usr/include]
624   --infodir=DIR           info documentation [DATAROOTDIR/info]
625   --mandir=DIR            man documentation [DATAROOTDIR/man]
626 EOF
627
628   cat <<\EOF
629
630 Program names:
631   --program-prefix=PREFIX            prepend PREFIX to installed program names
632   --program-suffix=SUFFIX            append SUFFIX to installed program names
633   --program-transform-name=PROGRAM   run sed PROGRAM on installed program names
634
635 X features:
636   --x-includes=DIR    X include files are in DIR
637   --x-libraries=DIR   X library files are in DIR
638
639 System types:
640   --build=BUILD           configure for building on BUILD [guessed]
641   --host=HOST       build programs to run on HOST [BUILD]
642 EOF
643 fi
644
645 if test -n "$ac_init_help"; then
646
647   cat <<\EOF
648
649 Optional Features:
650   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
651   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
652
653 Optional Packages:
654   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
655   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
656
657   --enable-string-hacks   work around bogus compiler/loader warnings
658 General Options:
659   --with-pkg-config{=path} enable/disable use of pkg-config
660   --disable-echo          do not display "compiling" commands
661 Curses Version-dependent Options:
662   --with-ncurses-wrap-prefix naming-prefix for ncurses wrapped-variables
663   --disable-widec         disable checks for wide-character functions
664   --with-curses-dir=DIR   directory in which (n)curses is installed
665   --with-screen=XXX       use specified curses-libraries
666   --with-ncursesw         use wide ncurses-libraries
667   --with-ncurses          use ncurses-libraries
668   --with-pdcurses         compile/link with pdcurses X11 library
669   --with-curses-colr      compile/link with HPUX 10.x color-curses
670   --with-curses-5lib      compile/link with SunOS 5lib curses
671   --with-Xaw3d            link with Xaw 3d library
672   --with-Xaw3dxft         link with Xaw 3d xft library
673   --with-neXtaw           link with neXT Athena library
674   --with-XawPlus          link with Athena-Plus library
675   --with-x                use the X Window System
676   --with-x11-rgb=FILE   file containing X11 rgb information (EPREFIX/lib/X11/rgb.txt)
677   --disable-panel         disable checks for panel functions
678   --disable-menu          disable checks for menu functions
679   --disable-form          disable checks for form functions
680 Testing/development Options:
681   --enable-warnings       test: turn on gcc compiler warnings
682   --with-dmalloc          test: use Gray Watson's dmalloc library
683   --with-dbmalloc         test: use Conor Cahill's dbmalloc library
684   --with-valgrind         test: use valgrind
685   --disable-leaks         test: free permanent memory, analyze leaks
686   --disable-rpath-hack    don't add rpath options for additional libraries
687
688 Some influential environment variables:
689   CC          C compiler command
690   CFLAGS      C compiler flags
691   LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
692               nonstandard directory <lib dir>
693   CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
694               headers in a nonstandard directory <include dir>
695   CPP         C preprocessor
696
697 Use these variables to override the choices made by `configure' or to help
698 it to find libraries and programs with nonstandard names/locations.
699
700 EOF
701 fi
702
703 if test "$ac_init_help" = "recursive"; then
704   # If there are subdirs, report their specific --help.
705   ac_popdir=`pwd`
706   for ac_subdir in : $ac_subdirs_all; do test "x$ac_subdir" = x: && continue
707     cd $ac_subdir
708     # A "../" for each directory in /$ac_subdir.
709     ac_dots=`echo $ac_subdir |
710              sed 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g'`
711
712     case $srcdir in
713     .) # No --srcdir option.  We are building in place.
714       ac_sub_srcdir=$srcdir ;;
715     [\\/]* | ?:[\\/]* ) # Absolute path.
716       ac_sub_srcdir=$srcdir/$ac_subdir ;;
717     *) # Relative path.
718       ac_sub_srcdir=$ac_dots$srcdir/$ac_subdir ;;
719     esac
720
721     # Check for guested configure; otherwise get Cygnus style configure.
722     if test -f $ac_sub_srcdir/configure.gnu; then
723       echo
724       $SHELL $ac_sub_srcdir/configure.gnu  --help=recursive
725     elif test -f $ac_sub_srcdir/configure; then
726       echo
727       $SHELL $ac_sub_srcdir/configure  --help=recursive
728     elif test -f $ac_sub_srcdir/configure.ac ||
729            test -f $ac_sub_srcdir/configure.in; then
730       echo
731       $ac_configure --help
732     else
733       echo "$as_me: WARNING: no configuration information is in $ac_subdir" >&2
734     fi
735     cd $ac_popdir
736   done
737 fi
738
739 test -n "$ac_init_help" && exit 0
740 if $ac_init_version; then
741   cat <<\EOF
742
743 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
744 Free Software Foundation, Inc.
745 This configure script is free software; the Free Software Foundation
746 gives unlimited permission to copy, distribute and modify it.
747 EOF
748   exit 0
749 fi
750 exec 5>config.log
751 cat >&5 <<EOF
752 This file contains any messages produced by compilers while
753 running configure, to aid debugging if configure makes a mistake.
754
755 It was created by $as_me, which was
756 generated by GNU Autoconf 2.52.20170501.  Invocation command line was
757
758   $ $0 $@
759
760 EOF
761 {
762 cat <<_ASUNAME
763 ## ---------- ##
764 ## Platform.  ##
765 ## ---------- ##
766
767 hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
768 uname -m = `(uname -m) 2>/dev/null || echo unknown`
769 uname -r = `(uname -r) 2>/dev/null || echo unknown`
770 uname -s = `(uname -s) 2>/dev/null || echo unknown`
771 uname -v = `(uname -v) 2>/dev/null || echo unknown`
772
773 /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
774 /bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
775
776 /bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
777 /usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
778 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
779 hostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
780 /bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
781 /usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
782 /bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
783
784 PATH = $PATH
785
786 _ASUNAME
787 } >&5
788
789 cat >&5 <<EOF
790 ## ------------ ##
791 ## Core tests.  ##
792 ## ------------ ##
793
794 EOF
795
796 # Keep a trace of the command line.
797 # Strip out --no-create and --no-recursion so they do not pile up.
798 # Also quote any args containing shell meta-characters.
799 ac_configure_args=
800 ac_sep=
801 for ac_arg
802 do
803   case $ac_arg in
804   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
805   | --no-cr | --no-c) ;;
806   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
807   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
808   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
809     ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"`
810     ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
811     ac_sep=" " ;;
812   *) ac_configure_args="$ac_configure_args$ac_sep$ac_arg"
813      ac_sep=" " ;;
814   esac
815   # Get rid of the leading space.
816 done
817
818 # When interrupted or exit'd, cleanup temporary files, and complete
819 # config.log.  We remove comments because anyway the quotes in there
820 # would cause problems or look ugly.
821 trap 'exit_status=$?
822   # Save into config.log some information that might help in debugging.
823   echo >&5
824   echo "## ----------------- ##" >&5
825   echo "## Cache variables.  ##" >&5
826   echo "## ----------------- ##" >&5
827   echo >&5
828   # The following way of writing the cache mishandles newlines in values,
829 {
830   (set) 2>&1 |
831     case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
832     *ac_space=\ *)
833       sed -n \
834         "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
835           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
836       ;;
837     *)
838       sed -n \
839         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
840       ;;
841     esac;
842 } >&5
843   sed "/^$/d" confdefs.h >conftest.log
844   if test -s conftest.log; then
845     echo >&5
846     echo "## ------------ ##" >&5
847     echo "## confdefs.h.  ##" >&5
848     echo "## ------------ ##" >&5
849     echo >&5
850     cat conftest.log >&5
851   fi
852   (echo; echo) >&5
853   test "$ac_signal" != 0 &&
854     echo "$as_me: caught signal $ac_signal" >&5
855   echo "$as_me: exit $exit_status" >&5
856   rm -rf conftest* confdefs* core core.* *.core conf$$* $ac_clean_files &&
857     exit $exit_status
858      ' 0
859 for ac_signal in 1 2 13 15; do
860   trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
861 done
862 ac_signal=0
863
864 # confdefs.h avoids OS command line length limits that DEFS can exceed.
865 rm -rf conftest* confdefs.h
866 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
867 echo >confdefs.h
868
869 # Let the site file select an alternate cache file if it wants to.
870 # Prefer explicitly selected file to automatically selected ones.
871 if test -z "$CONFIG_SITE"; then
872   if test "x$prefix" != xNONE; then
873     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
874   else
875     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
876   fi
877 fi
878 for ac_site_file in $CONFIG_SITE; do
879   if test -r "$ac_site_file"; then
880     { echo "$as_me:880: loading site script $ac_site_file" >&5
881 echo "$as_me: loading site script $ac_site_file" >&6;}
882     cat "$ac_site_file" >&5
883     . "$ac_site_file"
884   fi
885 done
886
887 if test -r "$cache_file"; then
888   # Some versions of bash will fail to source /dev/null (special
889   # files actually), so we avoid doing that.
890   if test -f "$cache_file"; then
891     { echo "$as_me:891: loading cache $cache_file" >&5
892 echo "$as_me: loading cache $cache_file" >&6;}
893     case $cache_file in
894       [\\/]* | ?:[\\/]* ) . $cache_file;;
895       *)                      . ./$cache_file;;
896     esac
897   fi
898 else
899   { echo "$as_me:899: creating cache $cache_file" >&5
900 echo "$as_me: creating cache $cache_file" >&6;}
901   >$cache_file
902 fi
903
904 # Check that the precious variables saved in the cache have kept the same
905 # value.
906 ac_cache_corrupted=false
907 for ac_var in `(set) 2>&1 |
908                sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
909   eval ac_old_set=\$ac_cv_env_${ac_var}_set
910   eval ac_new_set=\$ac_env_${ac_var}_set
911   eval ac_old_val="\$ac_cv_env_${ac_var}_value"
912   eval ac_new_val="\$ac_env_${ac_var}_value"
913   case $ac_old_set,$ac_new_set in
914     set,)
915       { echo "$as_me:915: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
916 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
917       ac_cache_corrupted=: ;;
918     ,set)
919       { echo "$as_me:919: error: \`$ac_var' was not set in the previous run" >&5
920 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
921       ac_cache_corrupted=: ;;
922     ,);;
923     *)
924       if test "x$ac_old_val" != "x$ac_new_val"; then
925         { echo "$as_me:925: error: \`$ac_var' has changed since the previous run:" >&5
926 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
927         { echo "$as_me:927:   former value:  $ac_old_val" >&5
928 echo "$as_me:   former value:  $ac_old_val" >&2;}
929         { echo "$as_me:929:   current value: $ac_new_val" >&5
930 echo "$as_me:   current value: $ac_new_val" >&2;}
931         ac_cache_corrupted=:
932       fi;;
933   esac
934   # Pass precious variables to config.status.  It doesn't matter if
935   # we pass some twice (in addition to the command line arguments).
936   if test "$ac_new_set" = set; then
937     case $ac_new_val in
938     *" "*|*"    "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
939       ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"`
940       ac_configure_args="$ac_configure_args '$ac_arg'"
941       ;;
942     *) ac_configure_args="$ac_configure_args $ac_var=$ac_new_val"
943        ;;
944     esac
945   fi
946 done
947 if $ac_cache_corrupted; then
948   { echo "$as_me:948: error: changes in the environment can compromise the build" >&5
949 echo "$as_me: error: changes in the environment can compromise the build" >&2;}
950   { { echo "$as_me:950: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
951 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
952    { (exit 1); exit 1; }; }
953 fi
954
955 ac_ext=c
956 ac_cpp='$CPP $CPPFLAGS'
957 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
958 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
959 ac_compiler_gnu=$ac_cv_c_compiler_gnu
960 ac_main_return=return
961
962 case `echo "testing\c" 2>/dev/null; echo 1,2,3`,`echo -n testing 2>/dev/null; echo 1,2,3` in
963   *c*,-n*) ECHO_N= ECHO_C=      # newlines do not sed ;-) only broken shells would use this case anyway
964                    ECHO_T='     ' ;;
965   *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
966   *)      ECHO_N= ECHO_C='\c' ECHO_T= ;;
967 esac
968 echo "#! $SHELL" >conftest.sh
969 echo  "exit 0"   >>conftest.sh
970 chmod +x conftest.sh
971 if { (echo "$as_me:971: PATH=\".;.\"; conftest.sh") >&5
972   (PATH=".;."; conftest.sh) 2>&5
973   ac_status=$?
974   echo "$as_me:974: \$? = $ac_status" >&5
975   (exit $ac_status); }; then
976   ac_path_separator=';'
977 else
978   ac_path_separator=:
979 fi
980 PATH_SEPARATOR="$ac_path_separator"
981 rm -f conftest.sh
982
983 ac_config_headers="$ac_config_headers ncurses_cfg.h:ncurses_tst.hin"
984
985 test -f config.guess || ( test -f ../config.guess && cp ../config.guess ./ )
986
987 test -f config.sub || ( test -f ../config.sub && cp ../config.sub ./ )
988
989 ac_aux_dir=
990 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
991   if test -f $ac_dir/install-sh; then
992     ac_aux_dir=$ac_dir
993     ac_install_sh="$ac_aux_dir/install-sh -c"
994     break
995   elif test -f $ac_dir/install.sh; then
996     ac_aux_dir=$ac_dir
997     ac_install_sh="$ac_aux_dir/install.sh -c"
998     break
999   elif test -f $ac_dir/shtool; then
1000     ac_aux_dir=$ac_dir
1001     ac_install_sh="$ac_aux_dir/shtool install -c"
1002     break
1003   fi
1004 done
1005 if test -z "$ac_aux_dir"; then
1006   { { echo "$as_me:1006: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
1007 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
1008    { (exit 1); exit 1; }; }
1009 fi
1010 ac_config_guess="$SHELL $ac_aux_dir/config.guess"
1011 ac_config_sub="$SHELL $ac_aux_dir/config.sub"
1012 ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
1013
1014 # Make sure we can run config.sub.
1015 $ac_config_sub sun4 >/dev/null 2>&1 ||
1016   { { echo "$as_me:1016: error: cannot run $ac_config_sub" >&5
1017 echo "$as_me: error: cannot run $ac_config_sub" >&2;}
1018    { (exit 1); exit 1; }; }
1019
1020 echo "$as_me:1020: checking build system type" >&5
1021 echo $ECHO_N "checking build system type... $ECHO_C" >&6
1022 if test "${ac_cv_build+set}" = set; then
1023   echo $ECHO_N "(cached) $ECHO_C" >&6
1024 else
1025   ac_cv_build_alias=$build_alias
1026 test -z "$ac_cv_build_alias" &&
1027   ac_cv_build_alias=`$ac_config_guess`
1028 test -z "$ac_cv_build_alias" &&
1029   { { echo "$as_me:1029: error: cannot guess build type; you must specify one" >&5
1030 echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
1031    { (exit 1); exit 1; }; }
1032 ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
1033   { { echo "$as_me:1033: error: $ac_config_sub $ac_cv_build_alias failed." >&5
1034 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed." >&2;}
1035    { (exit 1); exit 1; }; }
1036
1037 fi
1038 echo "$as_me:1038: result: $ac_cv_build" >&5
1039 echo "${ECHO_T}$ac_cv_build" >&6
1040 build=$ac_cv_build
1041 build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1042 build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1043 build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1044
1045 if test -f $srcdir/config.guess || test -f $ac_aux_dir/config.guess ; then
1046         echo "$as_me:1046: checking host system type" >&5
1047 echo $ECHO_N "checking host system type... $ECHO_C" >&6
1048 if test "${ac_cv_host+set}" = set; then
1049   echo $ECHO_N "(cached) $ECHO_C" >&6
1050 else
1051   ac_cv_host_alias=$host_alias
1052 test -z "$ac_cv_host_alias" &&
1053   ac_cv_host_alias=$ac_cv_build_alias
1054 ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
1055   { { echo "$as_me:1055: error: $ac_config_sub $ac_cv_host_alias failed" >&5
1056 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
1057    { (exit 1); exit 1; }; }
1058
1059 fi
1060 echo "$as_me:1060: result: $ac_cv_host" >&5
1061 echo "${ECHO_T}$ac_cv_host" >&6
1062 host=$ac_cv_host
1063 host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1064 host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1065 host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1066
1067         system_name="$host_os"
1068 else
1069         system_name="`(uname -s -r) 2>/dev/null`"
1070         if test -z "$system_name" ; then
1071                 system_name="`(hostname) 2>/dev/null`"
1072         fi
1073 fi
1074 test -n "$system_name" &&
1075 cat >>confdefs.h <<EOF
1076 #define SYSTEM_NAME "$system_name"
1077 EOF
1078
1079 if test "${cf_cv_system_name+set}" = set; then
1080   echo $ECHO_N "(cached) $ECHO_C" >&6
1081 else
1082   cf_cv_system_name="$system_name"
1083 fi
1084
1085 test -z "$system_name" && system_name="$cf_cv_system_name"
1086 test -n "$cf_cv_system_name" && echo "$as_me:1086: result: Configuring for $cf_cv_system_name" >&5
1087 echo "${ECHO_T}Configuring for $cf_cv_system_name" >&6
1088
1089 if test ".$system_name" != ".$cf_cv_system_name" ; then
1090         echo "$as_me:1090: result: Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&5
1091 echo "${ECHO_T}Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&6
1092         { { echo "$as_me:1092: error: \"Please remove config.cache and try again.\"" >&5
1093 echo "$as_me: error: \"Please remove config.cache and try again.\"" >&2;}
1094    { (exit 1); exit 1; }; }
1095 fi
1096
1097 test "$program_prefix" != NONE &&
1098   program_transform_name="s,^,$program_prefix,;$program_transform_name"
1099 # Use a double $ so make ignores it.
1100 test "$program_suffix" != NONE &&
1101   program_transform_name="s,\$,$program_suffix,;$program_transform_name"
1102 # Double any \ or $.  echo might interpret backslashes.
1103 # By default was `s,x,x', remove it if useless.
1104 cat <<\_ACEOF >conftest.sed
1105 s/[\\$]/&&/g;s/;s,x,x,$//
1106 _ACEOF
1107 program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
1108 rm conftest.sed
1109
1110 echo "$as_me:1110: checking whether ${MAKE-make} sets \${MAKE}" >&5
1111 echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6
1112 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
1113 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
1114   echo $ECHO_N "(cached) $ECHO_C" >&6
1115 else
1116   cat >conftest.make <<\EOF
1117 all:
1118         @echo 'ac_maketemp="${MAKE}"'
1119 EOF
1120 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
1121 eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
1122 if test -n "$ac_maketemp"; then
1123   eval ac_cv_prog_make_${ac_make}_set=yes
1124 else
1125   eval ac_cv_prog_make_${ac_make}_set=no
1126 fi
1127 rm -f conftest.make
1128 fi
1129 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
1130   echo "$as_me:1130: result: yes" >&5
1131 echo "${ECHO_T}yes" >&6
1132   SET_MAKE=
1133 else
1134   echo "$as_me:1134: result: no" >&5
1135 echo "${ECHO_T}no" >&6
1136   SET_MAKE="MAKE=${MAKE-make}"
1137 fi
1138
1139 ac_ext=c
1140 ac_cpp='$CPP $CPPFLAGS'
1141 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1142 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1143 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1144 ac_main_return=return
1145 if test -n "$ac_tool_prefix"; then
1146   # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
1147 set dummy ${ac_tool_prefix}gcc; ac_word=$2
1148 echo "$as_me:1148: checking for $ac_word" >&5
1149 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1150 if test "${ac_cv_prog_CC+set}" = set; then
1151   echo $ECHO_N "(cached) $ECHO_C" >&6
1152 else
1153   if test -n "$CC"; then
1154   ac_cv_prog_CC="$CC" # Let the user override the test.
1155 else
1156   ac_save_IFS=$IFS; IFS=$ac_path_separator
1157 ac_dummy="$PATH"
1158 for ac_dir in $ac_dummy; do
1159   IFS=$ac_save_IFS
1160   test -z "$ac_dir" && ac_dir=.
1161   $as_executable_p "$ac_dir/$ac_word" || continue
1162 ac_cv_prog_CC="${ac_tool_prefix}gcc"
1163 echo "$as_me:1163: found $ac_dir/$ac_word" >&5
1164 break
1165 done
1166
1167 fi
1168 fi
1169 CC=$ac_cv_prog_CC
1170 if test -n "$CC"; then
1171   echo "$as_me:1171: result: $CC" >&5
1172 echo "${ECHO_T}$CC" >&6
1173 else
1174   echo "$as_me:1174: result: no" >&5
1175 echo "${ECHO_T}no" >&6
1176 fi
1177
1178 fi
1179 if test -z "$ac_cv_prog_CC"; then
1180   ac_ct_CC=$CC
1181   # Extract the first word of "gcc", so it can be a program name with args.
1182 set dummy gcc; ac_word=$2
1183 echo "$as_me:1183: checking for $ac_word" >&5
1184 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1185 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1186   echo $ECHO_N "(cached) $ECHO_C" >&6
1187 else
1188   if test -n "$ac_ct_CC"; then
1189   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1190 else
1191   ac_save_IFS=$IFS; IFS=$ac_path_separator
1192 ac_dummy="$PATH"
1193 for ac_dir in $ac_dummy; do
1194   IFS=$ac_save_IFS
1195   test -z "$ac_dir" && ac_dir=.
1196   $as_executable_p "$ac_dir/$ac_word" || continue
1197 ac_cv_prog_ac_ct_CC="gcc"
1198 echo "$as_me:1198: found $ac_dir/$ac_word" >&5
1199 break
1200 done
1201
1202 fi
1203 fi
1204 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1205 if test -n "$ac_ct_CC"; then
1206   echo "$as_me:1206: result: $ac_ct_CC" >&5
1207 echo "${ECHO_T}$ac_ct_CC" >&6
1208 else
1209   echo "$as_me:1209: result: no" >&5
1210 echo "${ECHO_T}no" >&6
1211 fi
1212
1213   CC=$ac_ct_CC
1214 else
1215   CC="$ac_cv_prog_CC"
1216 fi
1217
1218 if test -z "$CC"; then
1219   if test -n "$ac_tool_prefix"; then
1220   # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
1221 set dummy ${ac_tool_prefix}cc; ac_word=$2
1222 echo "$as_me:1222: checking for $ac_word" >&5
1223 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1224 if test "${ac_cv_prog_CC+set}" = set; then
1225   echo $ECHO_N "(cached) $ECHO_C" >&6
1226 else
1227   if test -n "$CC"; then
1228   ac_cv_prog_CC="$CC" # Let the user override the test.
1229 else
1230   ac_save_IFS=$IFS; IFS=$ac_path_separator
1231 ac_dummy="$PATH"
1232 for ac_dir in $ac_dummy; do
1233   IFS=$ac_save_IFS
1234   test -z "$ac_dir" && ac_dir=.
1235   $as_executable_p "$ac_dir/$ac_word" || continue
1236 ac_cv_prog_CC="${ac_tool_prefix}cc"
1237 echo "$as_me:1237: found $ac_dir/$ac_word" >&5
1238 break
1239 done
1240
1241 fi
1242 fi
1243 CC=$ac_cv_prog_CC
1244 if test -n "$CC"; then
1245   echo "$as_me:1245: result: $CC" >&5
1246 echo "${ECHO_T}$CC" >&6
1247 else
1248   echo "$as_me:1248: result: no" >&5
1249 echo "${ECHO_T}no" >&6
1250 fi
1251
1252 fi
1253 if test -z "$ac_cv_prog_CC"; then
1254   ac_ct_CC=$CC
1255   # Extract the first word of "cc", so it can be a program name with args.
1256 set dummy cc; ac_word=$2
1257 echo "$as_me:1257: checking for $ac_word" >&5
1258 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1259 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1260   echo $ECHO_N "(cached) $ECHO_C" >&6
1261 else
1262   if test -n "$ac_ct_CC"; then
1263   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1264 else
1265   ac_save_IFS=$IFS; IFS=$ac_path_separator
1266 ac_dummy="$PATH"
1267 for ac_dir in $ac_dummy; do
1268   IFS=$ac_save_IFS
1269   test -z "$ac_dir" && ac_dir=.
1270   $as_executable_p "$ac_dir/$ac_word" || continue
1271 ac_cv_prog_ac_ct_CC="cc"
1272 echo "$as_me:1272: found $ac_dir/$ac_word" >&5
1273 break
1274 done
1275
1276 fi
1277 fi
1278 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1279 if test -n "$ac_ct_CC"; then
1280   echo "$as_me:1280: result: $ac_ct_CC" >&5
1281 echo "${ECHO_T}$ac_ct_CC" >&6
1282 else
1283   echo "$as_me:1283: result: no" >&5
1284 echo "${ECHO_T}no" >&6
1285 fi
1286
1287   CC=$ac_ct_CC
1288 else
1289   CC="$ac_cv_prog_CC"
1290 fi
1291
1292 fi
1293 if test -z "$CC"; then
1294   # Extract the first word of "cc", so it can be a program name with args.
1295 set dummy cc; ac_word=$2
1296 echo "$as_me:1296: checking for $ac_word" >&5
1297 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1298 if test "${ac_cv_prog_CC+set}" = set; then
1299   echo $ECHO_N "(cached) $ECHO_C" >&6
1300 else
1301   if test -n "$CC"; then
1302   ac_cv_prog_CC="$CC" # Let the user override the test.
1303 else
1304   ac_prog_rejected=no
1305   ac_save_IFS=$IFS; IFS=$ac_path_separator
1306 ac_dummy="$PATH"
1307 for ac_dir in $ac_dummy; do
1308   IFS=$ac_save_IFS
1309   test -z "$ac_dir" && ac_dir=.
1310   $as_executable_p "$ac_dir/$ac_word" || continue
1311 if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1312   ac_prog_rejected=yes
1313   continue
1314 fi
1315 ac_cv_prog_CC="cc"
1316 echo "$as_me:1316: found $ac_dir/$ac_word" >&5
1317 break
1318 done
1319
1320 if test $ac_prog_rejected = yes; then
1321   # We found a bogon in the path, so make sure we never use it.
1322   set dummy $ac_cv_prog_CC
1323   shift
1324   if test $# != 0; then
1325     # We chose a different compiler from the bogus one.
1326     # However, it has the same basename, so the bogon will be chosen
1327     # first if we set CC to just the basename; use the full file name.
1328     shift
1329     set dummy "$ac_dir/$ac_word" ${1+"$@"}
1330     shift
1331     ac_cv_prog_CC="$@"
1332   fi
1333 fi
1334 fi
1335 fi
1336 CC=$ac_cv_prog_CC
1337 if test -n "$CC"; then
1338   echo "$as_me:1338: result: $CC" >&5
1339 echo "${ECHO_T}$CC" >&6
1340 else
1341   echo "$as_me:1341: result: no" >&5
1342 echo "${ECHO_T}no" >&6
1343 fi
1344
1345 fi
1346 if test -z "$CC"; then
1347   if test -n "$ac_tool_prefix"; then
1348   for ac_prog in cl
1349   do
1350     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
1351 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
1352 echo "$as_me:1352: checking for $ac_word" >&5
1353 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1354 if test "${ac_cv_prog_CC+set}" = set; then
1355   echo $ECHO_N "(cached) $ECHO_C" >&6
1356 else
1357   if test -n "$CC"; then
1358   ac_cv_prog_CC="$CC" # Let the user override the test.
1359 else
1360   ac_save_IFS=$IFS; IFS=$ac_path_separator
1361 ac_dummy="$PATH"
1362 for ac_dir in $ac_dummy; do
1363   IFS=$ac_save_IFS
1364   test -z "$ac_dir" && ac_dir=.
1365   $as_executable_p "$ac_dir/$ac_word" || continue
1366 ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
1367 echo "$as_me:1367: found $ac_dir/$ac_word" >&5
1368 break
1369 done
1370
1371 fi
1372 fi
1373 CC=$ac_cv_prog_CC
1374 if test -n "$CC"; then
1375   echo "$as_me:1375: result: $CC" >&5
1376 echo "${ECHO_T}$CC" >&6
1377 else
1378   echo "$as_me:1378: result: no" >&5
1379 echo "${ECHO_T}no" >&6
1380 fi
1381
1382     test -n "$CC" && break
1383   done
1384 fi
1385 if test -z "$CC"; then
1386   ac_ct_CC=$CC
1387   for ac_prog in cl
1388 do
1389   # Extract the first word of "$ac_prog", so it can be a program name with args.
1390 set dummy $ac_prog; ac_word=$2
1391 echo "$as_me:1391: checking for $ac_word" >&5
1392 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1393 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1394   echo $ECHO_N "(cached) $ECHO_C" >&6
1395 else
1396   if test -n "$ac_ct_CC"; then
1397   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1398 else
1399   ac_save_IFS=$IFS; IFS=$ac_path_separator
1400 ac_dummy="$PATH"
1401 for ac_dir in $ac_dummy; do
1402   IFS=$ac_save_IFS
1403   test -z "$ac_dir" && ac_dir=.
1404   $as_executable_p "$ac_dir/$ac_word" || continue
1405 ac_cv_prog_ac_ct_CC="$ac_prog"
1406 echo "$as_me:1406: found $ac_dir/$ac_word" >&5
1407 break
1408 done
1409
1410 fi
1411 fi
1412 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1413 if test -n "$ac_ct_CC"; then
1414   echo "$as_me:1414: result: $ac_ct_CC" >&5
1415 echo "${ECHO_T}$ac_ct_CC" >&6
1416 else
1417   echo "$as_me:1417: result: no" >&5
1418 echo "${ECHO_T}no" >&6
1419 fi
1420
1421   test -n "$ac_ct_CC" && break
1422 done
1423
1424   CC=$ac_ct_CC
1425 fi
1426
1427 fi
1428
1429 test -z "$CC" && { { echo "$as_me:1429: error: no acceptable cc found in \$PATH" >&5
1430 echo "$as_me: error: no acceptable cc found in \$PATH" >&2;}
1431    { (exit 1); exit 1; }; }
1432
1433 # Provide some information about the compiler.
1434 echo "$as_me:1434:" \
1435      "checking for C compiler version" >&5
1436 ac_compiler=`set X $ac_compile; echo $2`
1437 { (eval echo "$as_me:1437: \"$ac_compiler --version </dev/null >&5\"") >&5
1438   (eval $ac_compiler --version </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 { (eval echo "$as_me:1447: \"$ac_compiler -V </dev/null >&5\"") >&5
1448   (eval $ac_compiler -V </dev/null >&5) 2>&5
1449   ac_status=$?
1450   echo "$as_me:1450: \$? = $ac_status" >&5
1451   (exit $ac_status); }
1452
1453 cat >conftest.$ac_ext <<_ACEOF
1454 #line 1454 "configure"
1455 #include "confdefs.h"
1456
1457 int
1458 main (void)
1459 {
1460
1461   ;
1462   return 0;
1463 }
1464 _ACEOF
1465 ac_clean_files_save=$ac_clean_files
1466 ac_clean_files="$ac_clean_files a.out a.exe"
1467 # Try to create an executable without -o first, disregard a.out.
1468 # It will help us diagnose broken compilers, and finding out an intuition
1469 # of exeext.
1470 echo "$as_me:1470: checking for C compiler default output" >&5
1471 echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
1472 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
1473 if { (eval echo "$as_me:1473: \"$ac_link_default\"") >&5
1474   (eval $ac_link_default) 2>&5
1475   ac_status=$?
1476   echo "$as_me:1476: \$? = $ac_status" >&5
1477   (exit $ac_status); }; then
1478   # Find the output, starting from the most likely.  This scheme is
1479 # not robust to junk in `.', hence go to wildcards (a.*) only as a last
1480 # resort.
1481 for ac_file in `ls a.exe conftest.exe 2>/dev/null;
1482                 ls a.out conftest 2>/dev/null;
1483                 ls a.* conftest.* 2>/dev/null`; do
1484   case $ac_file in
1485     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1486     a.out ) # We found the default executable, but exeext='' is most
1487             # certainly right.
1488             break;;
1489     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1490           # FIXME: I believe we export ac_cv_exeext for Libtool --akim.
1491           export ac_cv_exeext
1492           break;;
1493     * ) break;;
1494   esac
1495 done
1496 else
1497   echo "$as_me: failed program was:" >&5
1498 cat conftest.$ac_ext >&5
1499 { { echo "$as_me:1499: error: C compiler cannot create executables" >&5
1500 echo "$as_me: error: C compiler cannot create executables" >&2;}
1501    { (exit 77); exit 77; }; }
1502 fi
1503
1504 ac_exeext=$ac_cv_exeext
1505 echo "$as_me:1505: result: $ac_file" >&5
1506 echo "${ECHO_T}$ac_file" >&6
1507
1508 # Check the compiler produces executables we can run.  If not, either
1509 # the compiler is broken, or we cross compile.
1510 echo "$as_me:1510: checking whether the C compiler works" >&5
1511 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
1512 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0
1513 # If not cross compiling, check that we can run a simple program.
1514 if test "$cross_compiling" != yes; then
1515   if { ac_try='./$ac_file'
1516   { (eval echo "$as_me:1516: \"$ac_try\"") >&5
1517   (eval $ac_try) 2>&5
1518   ac_status=$?
1519   echo "$as_me:1519: \$? = $ac_status" >&5
1520   (exit $ac_status); }; }; then
1521     cross_compiling=no
1522   else
1523     if test "$cross_compiling" = maybe; then
1524         cross_compiling=yes
1525     else
1526         { { echo "$as_me:1526: error: cannot run C compiled programs.
1527 If you meant to cross compile, use \`--host'." >&5
1528 echo "$as_me: error: cannot run C compiled programs.
1529 If you meant to cross compile, use \`--host'." >&2;}
1530    { (exit 1); exit 1; }; }
1531     fi
1532   fi
1533 fi
1534 echo "$as_me:1534: result: yes" >&5
1535 echo "${ECHO_T}yes" >&6
1536
1537 rm -f a.out a.exe conftest$ac_cv_exeext
1538 ac_clean_files=$ac_clean_files_save
1539 # Check the compiler produces executables we can run.  If not, either
1540 # the compiler is broken, or we cross compile.
1541 echo "$as_me:1541: checking whether we are cross compiling" >&5
1542 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
1543 echo "$as_me:1543: result: $cross_compiling" >&5
1544 echo "${ECHO_T}$cross_compiling" >&6
1545
1546 echo "$as_me:1546: checking for executable suffix" >&5
1547 echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6
1548 if { (eval echo "$as_me:1548: \"$ac_link\"") >&5
1549   (eval $ac_link) 2>&5
1550   ac_status=$?
1551   echo "$as_me:1551: \$? = $ac_status" >&5
1552   (exit $ac_status); }; then
1553   # If both `conftest.exe' and `conftest' are `present' (well, observable)
1554 # catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
1555 # work properly (i.e., refer to `conftest.exe'), while it won't with
1556 # `rm'.
1557 for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do
1558   case $ac_file in
1559     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1560     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1561           export ac_cv_exeext
1562           break;;
1563     * ) break;;
1564   esac
1565 done
1566 else
1567   { { echo "$as_me:1567: error: cannot compute EXEEXT: cannot compile and link" >&5
1568 echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;}
1569    { (exit 1); exit 1; }; }
1570 fi
1571
1572 rm -f conftest$ac_cv_exeext
1573 echo "$as_me:1573: result: $ac_cv_exeext" >&5
1574 echo "${ECHO_T}$ac_cv_exeext" >&6
1575
1576 rm -f conftest.$ac_ext
1577 EXEEXT=$ac_cv_exeext
1578 ac_exeext=$EXEEXT
1579 echo "$as_me:1579: checking for object suffix" >&5
1580 echo $ECHO_N "checking for object suffix... $ECHO_C" >&6
1581 if test "${ac_cv_objext+set}" = set; then
1582   echo $ECHO_N "(cached) $ECHO_C" >&6
1583 else
1584   cat >conftest.$ac_ext <<_ACEOF
1585 #line 1585 "configure"
1586 #include "confdefs.h"
1587
1588 int
1589 main (void)
1590 {
1591
1592   ;
1593   return 0;
1594 }
1595 _ACEOF
1596 rm -f conftest.o conftest.obj
1597 if { (eval echo "$as_me:1597: \"$ac_compile\"") >&5
1598   (eval $ac_compile) 2>&5
1599   ac_status=$?
1600   echo "$as_me:1600: \$? = $ac_status" >&5
1601   (exit $ac_status); }; then
1602   for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
1603   case $ac_file in
1604     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.map | *.inf ) ;;
1605     *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
1606        break;;
1607   esac
1608 done
1609 else
1610   echo "$as_me: failed program was:" >&5
1611 cat conftest.$ac_ext >&5
1612 { { echo "$as_me:1612: error: cannot compute OBJEXT: cannot compile" >&5
1613 echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;}
1614    { (exit 1); exit 1; }; }
1615 fi
1616
1617 rm -f conftest.$ac_cv_objext conftest.$ac_ext
1618 fi
1619 echo "$as_me:1619: result: $ac_cv_objext" >&5
1620 echo "${ECHO_T}$ac_cv_objext" >&6
1621 OBJEXT=$ac_cv_objext
1622 ac_objext=$OBJEXT
1623 echo "$as_me:1623: checking whether we are using the GNU C compiler" >&5
1624 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
1625 if test "${ac_cv_c_compiler_gnu+set}" = set; then
1626   echo $ECHO_N "(cached) $ECHO_C" >&6
1627 else
1628   cat >conftest.$ac_ext <<_ACEOF
1629 #line 1629 "configure"
1630 #include "confdefs.h"
1631
1632 int
1633 main (void)
1634 {
1635 #ifndef __GNUC__
1636        choke me
1637 #endif
1638
1639   ;
1640   return 0;
1641 }
1642 _ACEOF
1643 rm -f conftest.$ac_objext
1644 if { (eval echo "$as_me:1644: \"$ac_compile\"") >&5
1645   (eval $ac_compile) 2>&5
1646   ac_status=$?
1647   echo "$as_me:1647: \$? = $ac_status" >&5
1648   (exit $ac_status); } &&
1649          { ac_try='test -s conftest.$ac_objext'
1650   { (eval echo "$as_me:1650: \"$ac_try\"") >&5
1651   (eval $ac_try) 2>&5
1652   ac_status=$?
1653   echo "$as_me:1653: \$? = $ac_status" >&5
1654   (exit $ac_status); }; }; then
1655   ac_compiler_gnu=yes
1656 else
1657   echo "$as_me: failed program was:" >&5
1658 cat conftest.$ac_ext >&5
1659 ac_compiler_gnu=no
1660 fi
1661 rm -f conftest.$ac_objext conftest.$ac_ext
1662 ac_cv_c_compiler_gnu=$ac_compiler_gnu
1663
1664 fi
1665 echo "$as_me:1665: result: $ac_cv_c_compiler_gnu" >&5
1666 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
1667 GCC=`test $ac_compiler_gnu = yes && echo yes`
1668 ac_test_CFLAGS=${CFLAGS+set}
1669 ac_save_CFLAGS=$CFLAGS
1670 CFLAGS="-g"
1671 echo "$as_me:1671: checking whether $CC accepts -g" >&5
1672 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
1673 if test "${ac_cv_prog_cc_g+set}" = set; then
1674   echo $ECHO_N "(cached) $ECHO_C" >&6
1675 else
1676   cat >conftest.$ac_ext <<_ACEOF
1677 #line 1677 "configure"
1678 #include "confdefs.h"
1679
1680 int
1681 main (void)
1682 {
1683
1684   ;
1685   return 0;
1686 }
1687 _ACEOF
1688 rm -f conftest.$ac_objext
1689 if { (eval echo "$as_me:1689: \"$ac_compile\"") >&5
1690   (eval $ac_compile) 2>&5
1691   ac_status=$?
1692   echo "$as_me:1692: \$? = $ac_status" >&5
1693   (exit $ac_status); } &&
1694          { ac_try='test -s conftest.$ac_objext'
1695   { (eval echo "$as_me:1695: \"$ac_try\"") >&5
1696   (eval $ac_try) 2>&5
1697   ac_status=$?
1698   echo "$as_me:1698: \$? = $ac_status" >&5
1699   (exit $ac_status); }; }; then
1700   ac_cv_prog_cc_g=yes
1701 else
1702   echo "$as_me: failed program was:" >&5
1703 cat conftest.$ac_ext >&5
1704 ac_cv_prog_cc_g=no
1705 fi
1706 rm -f conftest.$ac_objext conftest.$ac_ext
1707 fi
1708 echo "$as_me:1708: result: $ac_cv_prog_cc_g" >&5
1709 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
1710 if test "$ac_test_CFLAGS" = set; then
1711   CFLAGS=$ac_save_CFLAGS
1712 elif test $ac_cv_prog_cc_g = yes; then
1713   if test "$GCC" = yes; then
1714     CFLAGS="-g -O2"
1715   else
1716     CFLAGS="-g"
1717   fi
1718 else
1719   if test "$GCC" = yes; then
1720     CFLAGS="-O2"
1721   else
1722     CFLAGS=
1723   fi
1724 fi
1725 # Some people use a C++ compiler to compile C.  Since we use `exit',
1726 # in C++ we need to declare it.  In case someone uses the same compiler
1727 # for both compiling C and C++ we need to have the C++ compiler decide
1728 # the declaration of exit, since it's the most demanding environment.
1729 cat >conftest.$ac_ext <<_ACEOF
1730 #ifndef __cplusplus
1731   choke me
1732 #endif
1733 _ACEOF
1734 rm -f conftest.$ac_objext
1735 if { (eval echo "$as_me:1735: \"$ac_compile\"") >&5
1736   (eval $ac_compile) 2>&5
1737   ac_status=$?
1738   echo "$as_me:1738: \$? = $ac_status" >&5
1739   (exit $ac_status); } &&
1740          { ac_try='test -s conftest.$ac_objext'
1741   { (eval echo "$as_me:1741: \"$ac_try\"") >&5
1742   (eval $ac_try) 2>&5
1743   ac_status=$?
1744   echo "$as_me:1744: \$? = $ac_status" >&5
1745   (exit $ac_status); }; }; then
1746   for ac_declaration in \
1747    ''\
1748    '#include <stdlib.h>' \
1749    'extern "C" void std::exit (int) throw (); using std::exit;' \
1750    'extern "C" void std::exit (int); using std::exit;' \
1751    'extern "C" void exit (int) throw ();' \
1752    'extern "C" void exit (int);' \
1753    'void exit (int);'
1754 do
1755   cat >conftest.$ac_ext <<_ACEOF
1756 #line 1756 "configure"
1757 #include "confdefs.h"
1758 #include <stdlib.h>
1759 $ac_declaration
1760 int
1761 main (void)
1762 {
1763 exit (42);
1764   ;
1765   return 0;
1766 }
1767 _ACEOF
1768 rm -f conftest.$ac_objext
1769 if { (eval echo "$as_me:1769: \"$ac_compile\"") >&5
1770   (eval $ac_compile) 2>&5
1771   ac_status=$?
1772   echo "$as_me:1772: \$? = $ac_status" >&5
1773   (exit $ac_status); } &&
1774          { ac_try='test -s conftest.$ac_objext'
1775   { (eval echo "$as_me:1775: \"$ac_try\"") >&5
1776   (eval $ac_try) 2>&5
1777   ac_status=$?
1778   echo "$as_me:1778: \$? = $ac_status" >&5
1779   (exit $ac_status); }; }; then
1780   :
1781 else
1782   echo "$as_me: failed program was:" >&5
1783 cat conftest.$ac_ext >&5
1784 continue
1785 fi
1786 rm -f conftest.$ac_objext conftest.$ac_ext
1787   cat >conftest.$ac_ext <<_ACEOF
1788 #line 1788 "configure"
1789 #include "confdefs.h"
1790 $ac_declaration
1791 int
1792 main (void)
1793 {
1794 exit (42);
1795   ;
1796   return 0;
1797 }
1798 _ACEOF
1799 rm -f conftest.$ac_objext
1800 if { (eval echo "$as_me:1800: \"$ac_compile\"") >&5
1801   (eval $ac_compile) 2>&5
1802   ac_status=$?
1803   echo "$as_me:1803: \$? = $ac_status" >&5
1804   (exit $ac_status); } &&
1805          { ac_try='test -s conftest.$ac_objext'
1806   { (eval echo "$as_me:1806: \"$ac_try\"") >&5
1807   (eval $ac_try) 2>&5
1808   ac_status=$?
1809   echo "$as_me:1809: \$? = $ac_status" >&5
1810   (exit $ac_status); }; }; then
1811   break
1812 else
1813   echo "$as_me: failed program was:" >&5
1814 cat conftest.$ac_ext >&5
1815 fi
1816 rm -f conftest.$ac_objext conftest.$ac_ext
1817 done
1818 rm -rf conftest*
1819 if test -n "$ac_declaration"; then
1820   echo '#ifdef __cplusplus' >>confdefs.h
1821   echo $ac_declaration      >>confdefs.h
1822   echo '#endif'             >>confdefs.h
1823 fi
1824
1825 else
1826   echo "$as_me: failed program was:" >&5
1827 cat conftest.$ac_ext >&5
1828 fi
1829 rm -f conftest.$ac_objext conftest.$ac_ext
1830 ac_ext=c
1831 ac_cpp='$CPP $CPPFLAGS'
1832 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1833 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1834 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1835 ac_main_return=return
1836
1837 GCC_VERSION=none
1838 if test "$GCC" = yes ; then
1839         echo "$as_me:1839: checking version of $CC" >&5
1840 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
1841         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.].*//'`"
1842         test -z "$GCC_VERSION" && GCC_VERSION=unknown
1843         echo "$as_me:1843: result: $GCC_VERSION" >&5
1844 echo "${ECHO_T}$GCC_VERSION" >&6
1845 fi
1846
1847 echo "$as_me:1847: checking for $CC option to accept ANSI C" >&5
1848 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
1849 if test "${ac_cv_prog_cc_stdc+set}" = set; then
1850   echo $ECHO_N "(cached) $ECHO_C" >&6
1851 else
1852   ac_cv_prog_cc_stdc=no
1853 ac_save_CC=$CC
1854 cat >conftest.$ac_ext <<_ACEOF
1855 #line 1855 "configure"
1856 #include "confdefs.h"
1857 #include <stdarg.h>
1858 #include <stdio.h>
1859 #include <sys/types.h>
1860 #include <sys/stat.h>
1861 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
1862 struct buf { int x; };
1863 FILE * (*rcsopen) (struct buf *, struct stat *, int);
1864 static char *e (p, i)
1865      char **p;
1866      int i;
1867 {
1868   return p[i];
1869 }
1870 static char *f (char * (*g) (char **, int), char **p, ...)
1871 {
1872   char *s;
1873   va_list v;
1874   va_start (v,p);
1875   s = g (p, va_arg (v,int));
1876   va_end (v);
1877   return s;
1878 }
1879 int test (int i, double x);
1880 struct s1 {int (*f) (int a);};
1881 struct s2 {int (*f) (double a);};
1882 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
1883 int argc;
1884 char **argv;
1885 int
1886 main (void)
1887 {
1888 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
1889   ;
1890   return 0;
1891 }
1892 _ACEOF
1893 # Don't try gcc -ansi; that turns off useful extensions and
1894 # breaks some systems' header files.
1895 # AIX                   -qlanglvl=ansi
1896 # Ultrix and OSF/1      -std1
1897 # HP-UX 10.20 and later -Ae
1898 # HP-UX older versions  -Aa -D_HPUX_SOURCE
1899 # SVR4                  -Xc -D__EXTENSIONS__
1900 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
1901 do
1902   CC="$ac_save_CC $ac_arg"
1903   rm -f conftest.$ac_objext
1904 if { (eval echo "$as_me:1904: \"$ac_compile\"") >&5
1905   (eval $ac_compile) 2>&5
1906   ac_status=$?
1907   echo "$as_me:1907: \$? = $ac_status" >&5
1908   (exit $ac_status); } &&
1909          { ac_try='test -s conftest.$ac_objext'
1910   { (eval echo "$as_me:1910: \"$ac_try\"") >&5
1911   (eval $ac_try) 2>&5
1912   ac_status=$?
1913   echo "$as_me:1913: \$? = $ac_status" >&5
1914   (exit $ac_status); }; }; then
1915   ac_cv_prog_cc_stdc=$ac_arg
1916 break
1917 else
1918   echo "$as_me: failed program was:" >&5
1919 cat conftest.$ac_ext >&5
1920 fi
1921 rm -f conftest.$ac_objext
1922 done
1923 rm -f conftest.$ac_ext conftest.$ac_objext
1924 CC=$ac_save_CC
1925
1926 fi
1927
1928 case "x$ac_cv_prog_cc_stdc" in
1929   x|xno)
1930     echo "$as_me:1930: result: none needed" >&5
1931 echo "${ECHO_T}none needed" >&6 ;;
1932   *)
1933     echo "$as_me:1933: result: $ac_cv_prog_cc_stdc" >&5
1934 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
1935     CC="$CC $ac_cv_prog_cc_stdc" ;;
1936 esac
1937
1938 # This should have been defined by AC_PROG_CC
1939 : ${CC:=cc}
1940
1941 echo "$as_me:1941: checking \$CC variable" >&5
1942 echo $ECHO_N "checking \$CC variable... $ECHO_C" >&6
1943 case "$CC" in
1944 (*[\ \  ]-*)
1945         echo "$as_me:1945: result: broken" >&5
1946 echo "${ECHO_T}broken" >&6
1947         { echo "$as_me:1947: WARNING: your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options" >&5
1948 echo "$as_me: WARNING: your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options" >&2;}
1949         # humor him...
1950         cf_prog=`echo "$CC" | sed -e 's/        / /g' -e 's/[ ]* / /g' -e 's/[ ]*[ ]-[^ ].*//'`
1951         cf_flags=`echo "$CC" | ${AWK:-awk} -v prog="$cf_prog" '{ printf("%s", substr($0,1+length(prog))); }'`
1952         CC="$cf_prog"
1953         for cf_arg in $cf_flags
1954         do
1955                 case "x$cf_arg" in
1956                 (x-[IUDfgOW]*)
1957
1958 cf_fix_cppflags=no
1959 cf_new_cflags=
1960 cf_new_cppflags=
1961 cf_new_extra_cppflags=
1962
1963 for cf_add_cflags in $cf_arg
1964 do
1965 case $cf_fix_cppflags in
1966 (no)
1967         case $cf_add_cflags in
1968         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
1969                 case $cf_add_cflags in
1970                 (-D*)
1971                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
1972
1973                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
1974                                 && test -z "${cf_tst_cflags}" \
1975                                 && cf_fix_cppflags=yes
1976
1977                         if test $cf_fix_cppflags = yes ; then
1978
1979         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
1980         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
1981
1982                                 continue
1983                         elif test "${cf_tst_cflags}" = "\"'" ; then
1984
1985         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
1986         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
1987
1988                                 continue
1989                         fi
1990                         ;;
1991                 esac
1992                 case "$CPPFLAGS" in
1993                 (*$cf_add_cflags)
1994                         ;;
1995                 (*)
1996                         case $cf_add_cflags in
1997                         (-D*)
1998                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
1999
2000 CPPFLAGS=`echo "$CPPFLAGS" | \
2001         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2002                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2003
2004                                 ;;
2005                         esac
2006
2007         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
2008         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
2009
2010                         ;;
2011                 esac
2012                 ;;
2013         (*)
2014
2015         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
2016         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
2017
2018                 ;;
2019         esac
2020         ;;
2021 (yes)
2022
2023         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2024         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2025
2026         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
2027
2028         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2029                 && test -z "${cf_tst_cflags}" \
2030                 && cf_fix_cppflags=no
2031         ;;
2032 esac
2033 done
2034
2035 if test -n "$cf_new_cflags" ; then
2036
2037         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2038         CFLAGS="${CFLAGS}$cf_new_cflags"
2039
2040 fi
2041
2042 if test -n "$cf_new_cppflags" ; then
2043
2044         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
2045         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
2046
2047 fi
2048
2049 if test -n "$cf_new_extra_cppflags" ; then
2050
2051         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
2052         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
2053
2054 fi
2055
2056                         ;;
2057                 (*)
2058                         CC="$CC $cf_arg"
2059                         ;;
2060                 esac
2061         done
2062         test -n "$verbose" && echo "    resulting CC: '$CC'" 1>&6
2063
2064 echo "${as_me:-configure}:2064: testing resulting CC: '$CC' ..." 1>&5
2065
2066         test -n "$verbose" && echo "    resulting CFLAGS: '$CFLAGS'" 1>&6
2067
2068 echo "${as_me:-configure}:2068: testing resulting CFLAGS: '$CFLAGS' ..." 1>&5
2069
2070         test -n "$verbose" && echo "    resulting CPPFLAGS: '$CPPFLAGS'" 1>&6
2071
2072 echo "${as_me:-configure}:2072: testing resulting CPPFLAGS: '$CPPFLAGS' ..." 1>&5
2073
2074         ;;
2075 (*)
2076         echo "$as_me:2076: result: ok" >&5
2077 echo "${ECHO_T}ok" >&6
2078         ;;
2079 esac
2080
2081 echo "$as_me:2081: checking for inline" >&5
2082 echo $ECHO_N "checking for inline... $ECHO_C" >&6
2083 if test "${ac_cv_c_inline+set}" = set; then
2084   echo $ECHO_N "(cached) $ECHO_C" >&6
2085 else
2086   ac_cv_c_inline=no
2087 for ac_kw in inline __inline__ __inline; do
2088   cat >conftest.$ac_ext <<_ACEOF
2089 #line 2089 "configure"
2090 #include "confdefs.h"
2091 #ifndef __cplusplus
2092 static $ac_kw int static_foo () {return 0; }
2093 $ac_kw int foo () {return 0; }
2094 #endif
2095
2096 _ACEOF
2097 rm -f conftest.$ac_objext
2098 if { (eval echo "$as_me:2098: \"$ac_compile\"") >&5
2099   (eval $ac_compile) 2>&5
2100   ac_status=$?
2101   echo "$as_me:2101: \$? = $ac_status" >&5
2102   (exit $ac_status); } &&
2103          { ac_try='test -s conftest.$ac_objext'
2104   { (eval echo "$as_me:2104: \"$ac_try\"") >&5
2105   (eval $ac_try) 2>&5
2106   ac_status=$?
2107   echo "$as_me:2107: \$? = $ac_status" >&5
2108   (exit $ac_status); }; }; then
2109   ac_cv_c_inline=$ac_kw; break
2110 else
2111   echo "$as_me: failed program was:" >&5
2112 cat conftest.$ac_ext >&5
2113 fi
2114 rm -f conftest.$ac_objext conftest.$ac_ext
2115 done
2116
2117 fi
2118 echo "$as_me:2118: result: $ac_cv_c_inline" >&5
2119 echo "${ECHO_T}$ac_cv_c_inline" >&6
2120 case $ac_cv_c_inline in
2121   inline | yes) ;;
2122   no)
2123 cat >>confdefs.h <<\EOF
2124 #define inline
2125 EOF
2126  ;;
2127   *)  cat >>confdefs.h <<EOF
2128 #define inline $ac_cv_c_inline
2129 EOF
2130  ;;
2131 esac
2132
2133 ac_ext=c
2134 ac_cpp='$CPP $CPPFLAGS'
2135 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2136 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2137 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2138 ac_main_return=return
2139 echo "$as_me:2139: checking how to run the C preprocessor" >&5
2140 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
2141 # On Suns, sometimes $CPP names a directory.
2142 if test -n "$CPP" && test -d "$CPP"; then
2143   CPP=
2144 fi
2145 if test -z "$CPP"; then
2146   if test "${ac_cv_prog_CPP+set}" = set; then
2147   echo $ECHO_N "(cached) $ECHO_C" >&6
2148 else
2149       # Double quotes because CPP needs to be expanded
2150     for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
2151     do
2152       ac_preproc_ok=false
2153 for ac_c_preproc_warn_flag in '' yes
2154 do
2155   # Use a header file that comes with gcc, so configuring glibc
2156   # with a fresh cross-compiler works.
2157   # On the NeXT, cc -E runs the code through the compiler's parser,
2158   # not just through cpp. "Syntax error" is here to catch this case.
2159   cat >conftest.$ac_ext <<_ACEOF
2160 #line 2160 "configure"
2161 #include "confdefs.h"
2162 #include <assert.h>
2163                      Syntax error
2164 _ACEOF
2165 if { (eval echo "$as_me:2165: \"$ac_cpp conftest.$ac_ext\"") >&5
2166   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2167   ac_status=$?
2168   egrep -v '^ *\+' conftest.er1 >conftest.err
2169   rm -f conftest.er1
2170   cat conftest.err >&5
2171   echo "$as_me:2171: \$? = $ac_status" >&5
2172   (exit $ac_status); } >/dev/null; then
2173   if test -s conftest.err; then
2174     ac_cpp_err=$ac_c_preproc_warn_flag
2175   else
2176     ac_cpp_err=
2177   fi
2178 else
2179   ac_cpp_err=yes
2180 fi
2181 if test -z "$ac_cpp_err"; then
2182   :
2183 else
2184   echo "$as_me: failed program was:" >&5
2185   cat conftest.$ac_ext >&5
2186   # Broken: fails on valid input.
2187 continue
2188 fi
2189 rm -f conftest.err conftest.$ac_ext
2190
2191   # OK, works on sane cases.  Now check whether non-existent headers
2192   # can be detected and how.
2193   cat >conftest.$ac_ext <<_ACEOF
2194 #line 2194 "configure"
2195 #include "confdefs.h"
2196 #include <ac_nonexistent.h>
2197 _ACEOF
2198 if { (eval echo "$as_me:2198: \"$ac_cpp conftest.$ac_ext\"") >&5
2199   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2200   ac_status=$?
2201   egrep -v '^ *\+' conftest.er1 >conftest.err
2202   rm -f conftest.er1
2203   cat conftest.err >&5
2204   echo "$as_me:2204: \$? = $ac_status" >&5
2205   (exit $ac_status); } >/dev/null; then
2206   if test -s conftest.err; then
2207     ac_cpp_err=$ac_c_preproc_warn_flag
2208   else
2209     ac_cpp_err=
2210   fi
2211 else
2212   ac_cpp_err=yes
2213 fi
2214 if test -z "$ac_cpp_err"; then
2215   # Broken: success on invalid input.
2216 continue
2217 else
2218   echo "$as_me: failed program was:" >&5
2219   cat conftest.$ac_ext >&5
2220   # Passes both tests.
2221 ac_preproc_ok=:
2222 break
2223 fi
2224 rm -f conftest.err conftest.$ac_ext
2225
2226 done
2227 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2228 rm -f conftest.err conftest.$ac_ext
2229 if $ac_preproc_ok; then
2230   break
2231 fi
2232
2233     done
2234     ac_cv_prog_CPP=$CPP
2235
2236 fi
2237   CPP=$ac_cv_prog_CPP
2238 else
2239   ac_cv_prog_CPP=$CPP
2240 fi
2241 echo "$as_me:2241: result: $CPP" >&5
2242 echo "${ECHO_T}$CPP" >&6
2243 ac_preproc_ok=false
2244 for ac_c_preproc_warn_flag in '' yes
2245 do
2246   # Use a header file that comes with gcc, so configuring glibc
2247   # with a fresh cross-compiler works.
2248   # On the NeXT, cc -E runs the code through the compiler's parser,
2249   # not just through cpp. "Syntax error" is here to catch this case.
2250   cat >conftest.$ac_ext <<_ACEOF
2251 #line 2251 "configure"
2252 #include "confdefs.h"
2253 #include <assert.h>
2254                      Syntax error
2255 _ACEOF
2256 if { (eval echo "$as_me:2256: \"$ac_cpp conftest.$ac_ext\"") >&5
2257   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2258   ac_status=$?
2259   egrep -v '^ *\+' conftest.er1 >conftest.err
2260   rm -f conftest.er1
2261   cat conftest.err >&5
2262   echo "$as_me:2262: \$? = $ac_status" >&5
2263   (exit $ac_status); } >/dev/null; then
2264   if test -s conftest.err; then
2265     ac_cpp_err=$ac_c_preproc_warn_flag
2266   else
2267     ac_cpp_err=
2268   fi
2269 else
2270   ac_cpp_err=yes
2271 fi
2272 if test -z "$ac_cpp_err"; then
2273   :
2274 else
2275   echo "$as_me: failed program was:" >&5
2276   cat conftest.$ac_ext >&5
2277   # Broken: fails on valid input.
2278 continue
2279 fi
2280 rm -f conftest.err conftest.$ac_ext
2281
2282   # OK, works on sane cases.  Now check whether non-existent headers
2283   # can be detected and how.
2284   cat >conftest.$ac_ext <<_ACEOF
2285 #line 2285 "configure"
2286 #include "confdefs.h"
2287 #include <ac_nonexistent.h>
2288 _ACEOF
2289 if { (eval echo "$as_me:2289: \"$ac_cpp conftest.$ac_ext\"") >&5
2290   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2291   ac_status=$?
2292   egrep -v '^ *\+' conftest.er1 >conftest.err
2293   rm -f conftest.er1
2294   cat conftest.err >&5
2295   echo "$as_me:2295: \$? = $ac_status" >&5
2296   (exit $ac_status); } >/dev/null; then
2297   if test -s conftest.err; then
2298     ac_cpp_err=$ac_c_preproc_warn_flag
2299   else
2300     ac_cpp_err=
2301   fi
2302 else
2303   ac_cpp_err=yes
2304 fi
2305 if test -z "$ac_cpp_err"; then
2306   # Broken: success on invalid input.
2307 continue
2308 else
2309   echo "$as_me: failed program was:" >&5
2310   cat conftest.$ac_ext >&5
2311   # Passes both tests.
2312 ac_preproc_ok=:
2313 break
2314 fi
2315 rm -f conftest.err conftest.$ac_ext
2316
2317 done
2318 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2319 rm -f conftest.err conftest.$ac_ext
2320 if $ac_preproc_ok; then
2321   :
2322 else
2323   { { echo "$as_me:2323: error: C preprocessor \"$CPP\" fails sanity check" >&5
2324 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;}
2325    { (exit 1); exit 1; }; }
2326 fi
2327
2328 ac_ext=c
2329 ac_cpp='$CPP $CPPFLAGS'
2330 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2331 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2332 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2333 ac_main_return=return
2334
2335 for ac_prog in mawk gawk nawk awk
2336 do
2337   # Extract the first word of "$ac_prog", so it can be a program name with args.
2338 set dummy $ac_prog; ac_word=$2
2339 echo "$as_me:2339: checking for $ac_word" >&5
2340 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2341 if test "${ac_cv_prog_AWK+set}" = set; then
2342   echo $ECHO_N "(cached) $ECHO_C" >&6
2343 else
2344   if test -n "$AWK"; then
2345   ac_cv_prog_AWK="$AWK" # Let the user override the test.
2346 else
2347   ac_save_IFS=$IFS; IFS=$ac_path_separator
2348 ac_dummy="$PATH"
2349 for ac_dir in $ac_dummy; do
2350   IFS=$ac_save_IFS
2351   test -z "$ac_dir" && ac_dir=.
2352   $as_executable_p "$ac_dir/$ac_word" || continue
2353 ac_cv_prog_AWK="$ac_prog"
2354 echo "$as_me:2354: found $ac_dir/$ac_word" >&5
2355 break
2356 done
2357
2358 fi
2359 fi
2360 AWK=$ac_cv_prog_AWK
2361 if test -n "$AWK"; then
2362   echo "$as_me:2362: result: $AWK" >&5
2363 echo "${ECHO_T}$AWK" >&6
2364 else
2365   echo "$as_me:2365: result: no" >&5
2366 echo "${ECHO_T}no" >&6
2367 fi
2368
2369   test -n "$AWK" && break
2370 done
2371
2372 # Find a good install program.  We prefer a C program (faster),
2373 # so one script is as good as another.  But avoid the broken or
2374 # incompatible versions:
2375 # SysV /etc/install, /usr/sbin/install
2376 # SunOS /usr/etc/install
2377 # IRIX /sbin/install
2378 # AIX /bin/install
2379 # AmigaOS /C/install, which installs bootblocks on floppy discs
2380 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2381 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2382 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2383 # ./install, which can be erroneously created by make from ./install.sh.
2384 echo "$as_me:2384: checking for a BSD compatible install" >&5
2385 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
2386 if test -z "$INSTALL"; then
2387 if test "${ac_cv_path_install+set}" = set; then
2388   echo $ECHO_N "(cached) $ECHO_C" >&6
2389 else
2390     ac_save_IFS=$IFS; IFS=$ac_path_separator
2391   for ac_dir in $PATH; do
2392     IFS=$ac_save_IFS
2393     # Account for people who put trailing slashes in PATH elements.
2394     case $ac_dir/ in
2395     / | ./ | .// | /cC/* \
2396     | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
2397     | /usr/ucb/* ) ;;
2398     *)
2399       # OSF1 and SCO ODT 3.0 have their own names for install.
2400       # Don't use installbsd from OSF since it installs stuff as root
2401       # by default.
2402       for ac_prog in ginstall scoinst install; do
2403         if $as_executable_p "$ac_dir/$ac_prog"; then
2404           if test $ac_prog = install &&
2405             grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2406             # AIX install.  It has an incompatible calling convention.
2407             :
2408           elif test $ac_prog = install &&
2409             grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2410             # program-specific install script used by HP pwplus--don't use.
2411             :
2412           else
2413             ac_cv_path_install="$ac_dir/$ac_prog -c"
2414             break 2
2415           fi
2416         fi
2417       done
2418       ;;
2419     esac
2420   done
2421
2422 fi
2423   if test "${ac_cv_path_install+set}" = set; then
2424     INSTALL=$ac_cv_path_install
2425   else
2426     # As a last resort, use the slow shell script.  We don't cache a
2427     # path for INSTALL within a source directory, because that will
2428     # break other packages using the cache if that directory is
2429     # removed, or if the path is relative.
2430     INSTALL=$ac_install_sh
2431   fi
2432 fi
2433 echo "$as_me:2433: result: $INSTALL" >&5
2434 echo "${ECHO_T}$INSTALL" >&6
2435
2436 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2437 # It thinks the first close brace ends the variable substitution.
2438 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2439
2440 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2441
2442 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2443
2444 case $INSTALL in
2445 (/*)
2446         ;;
2447 (*)
2448         cf_dir=`echo $INSTALL | sed -e 's%/[^/]*$%%'`
2449         test -z "$cf_dir" && cf_dir=.
2450         INSTALL=`cd $cf_dir && pwd`/`echo $INSTALL | sed -e 's%^.*/%%'`
2451         ;;
2452 esac
2453
2454 for ac_prog in lint cppcheck splint
2455 do
2456   # Extract the first word of "$ac_prog", so it can be a program name with args.
2457 set dummy $ac_prog; ac_word=$2
2458 echo "$as_me:2458: checking for $ac_word" >&5
2459 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2460 if test "${ac_cv_prog_LINT+set}" = set; then
2461   echo $ECHO_N "(cached) $ECHO_C" >&6
2462 else
2463   if test -n "$LINT"; then
2464   ac_cv_prog_LINT="$LINT" # Let the user override the test.
2465 else
2466   ac_save_IFS=$IFS; IFS=$ac_path_separator
2467 ac_dummy="$PATH"
2468 for ac_dir in $ac_dummy; do
2469   IFS=$ac_save_IFS
2470   test -z "$ac_dir" && ac_dir=.
2471   $as_executable_p "$ac_dir/$ac_word" || continue
2472 ac_cv_prog_LINT="$ac_prog"
2473 echo "$as_me:2473: found $ac_dir/$ac_word" >&5
2474 break
2475 done
2476
2477 fi
2478 fi
2479 LINT=$ac_cv_prog_LINT
2480 if test -n "$LINT"; then
2481   echo "$as_me:2481: result: $LINT" >&5
2482 echo "${ECHO_T}$LINT" >&6
2483 else
2484   echo "$as_me:2484: result: no" >&5
2485 echo "${ECHO_T}no" >&6
2486 fi
2487
2488   test -n "$LINT" && break
2489 done
2490
2491 echo "$as_me:2491: checking if filesystem supports mixed-case filenames" >&5
2492 echo $ECHO_N "checking if filesystem supports mixed-case filenames... $ECHO_C" >&6
2493 if test "${cf_cv_mixedcase+set}" = set; then
2494   echo $ECHO_N "(cached) $ECHO_C" >&6
2495 else
2496
2497 if test "$cross_compiling" = yes ; then
2498         case $target_alias in
2499         (*-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw*|*-uwin*)
2500                 cf_cv_mixedcase=no
2501                 ;;
2502         (*)
2503                 cf_cv_mixedcase=yes
2504                 ;;
2505         esac
2506 else
2507         rm -f conftest CONFTEST
2508         echo test >conftest
2509         if test -f CONFTEST ; then
2510                 cf_cv_mixedcase=no
2511         else
2512                 cf_cv_mixedcase=yes
2513         fi
2514         rm -f conftest CONFTEST
2515 fi
2516
2517 fi
2518 echo "$as_me:2518: result: $cf_cv_mixedcase" >&5
2519 echo "${ECHO_T}$cf_cv_mixedcase" >&6
2520 test "$cf_cv_mixedcase" = yes &&
2521 cat >>confdefs.h <<\EOF
2522 #define MIXEDCASE_FILENAMES 1
2523 EOF
2524
2525 for ac_prog in exctags ctags
2526 do
2527   # Extract the first word of "$ac_prog", so it can be a program name with args.
2528 set dummy $ac_prog; ac_word=$2
2529 echo "$as_me:2529: checking for $ac_word" >&5
2530 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2531 if test "${ac_cv_prog_CTAGS+set}" = set; then
2532   echo $ECHO_N "(cached) $ECHO_C" >&6
2533 else
2534   if test -n "$CTAGS"; then
2535   ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test.
2536 else
2537   ac_save_IFS=$IFS; IFS=$ac_path_separator
2538 ac_dummy="$PATH"
2539 for ac_dir in $ac_dummy; do
2540   IFS=$ac_save_IFS
2541   test -z "$ac_dir" && ac_dir=.
2542   $as_executable_p "$ac_dir/$ac_word" || continue
2543 ac_cv_prog_CTAGS="$ac_prog"
2544 echo "$as_me:2544: found $ac_dir/$ac_word" >&5
2545 break
2546 done
2547
2548 fi
2549 fi
2550 CTAGS=$ac_cv_prog_CTAGS
2551 if test -n "$CTAGS"; then
2552   echo "$as_me:2552: result: $CTAGS" >&5
2553 echo "${ECHO_T}$CTAGS" >&6
2554 else
2555   echo "$as_me:2555: result: no" >&5
2556 echo "${ECHO_T}no" >&6
2557 fi
2558
2559   test -n "$CTAGS" && break
2560 done
2561
2562 for ac_prog in exetags etags
2563 do
2564   # Extract the first word of "$ac_prog", so it can be a program name with args.
2565 set dummy $ac_prog; ac_word=$2
2566 echo "$as_me:2566: checking for $ac_word" >&5
2567 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2568 if test "${ac_cv_prog_ETAGS+set}" = set; then
2569   echo $ECHO_N "(cached) $ECHO_C" >&6
2570 else
2571   if test -n "$ETAGS"; then
2572   ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test.
2573 else
2574   ac_save_IFS=$IFS; IFS=$ac_path_separator
2575 ac_dummy="$PATH"
2576 for ac_dir in $ac_dummy; do
2577   IFS=$ac_save_IFS
2578   test -z "$ac_dir" && ac_dir=.
2579   $as_executable_p "$ac_dir/$ac_word" || continue
2580 ac_cv_prog_ETAGS="$ac_prog"
2581 echo "$as_me:2581: found $ac_dir/$ac_word" >&5
2582 break
2583 done
2584
2585 fi
2586 fi
2587 ETAGS=$ac_cv_prog_ETAGS
2588 if test -n "$ETAGS"; then
2589   echo "$as_me:2589: result: $ETAGS" >&5
2590 echo "${ECHO_T}$ETAGS" >&6
2591 else
2592   echo "$as_me:2592: result: no" >&5
2593 echo "${ECHO_T}no" >&6
2594 fi
2595
2596   test -n "$ETAGS" && break
2597 done
2598
2599 # Extract the first word of "${CTAGS:-ctags}", so it can be a program name with args.
2600 set dummy ${CTAGS:-ctags}; ac_word=$2
2601 echo "$as_me:2601: checking for $ac_word" >&5
2602 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2603 if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" = set; then
2604   echo $ECHO_N "(cached) $ECHO_C" >&6
2605 else
2606   if test -n "$MAKE_LOWER_TAGS"; then
2607   ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test.
2608 else
2609   ac_save_IFS=$IFS; IFS=$ac_path_separator
2610 ac_dummy="$PATH"
2611 for ac_dir in $ac_dummy; do
2612   IFS=$ac_save_IFS
2613   test -z "$ac_dir" && ac_dir=.
2614   $as_executable_p "$ac_dir/$ac_word" || continue
2615 ac_cv_prog_MAKE_LOWER_TAGS="yes"
2616 echo "$as_me:2616: found $ac_dir/$ac_word" >&5
2617 break
2618 done
2619
2620   test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no"
2621 fi
2622 fi
2623 MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS
2624 if test -n "$MAKE_LOWER_TAGS"; then
2625   echo "$as_me:2625: result: $MAKE_LOWER_TAGS" >&5
2626 echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6
2627 else
2628   echo "$as_me:2628: result: no" >&5
2629 echo "${ECHO_T}no" >&6
2630 fi
2631
2632 if test "$cf_cv_mixedcase" = yes ; then
2633         # Extract the first word of "${ETAGS:-etags}", so it can be a program name with args.
2634 set dummy ${ETAGS:-etags}; ac_word=$2
2635 echo "$as_me:2635: checking for $ac_word" >&5
2636 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2637 if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" = set; then
2638   echo $ECHO_N "(cached) $ECHO_C" >&6
2639 else
2640   if test -n "$MAKE_UPPER_TAGS"; then
2641   ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test.
2642 else
2643   ac_save_IFS=$IFS; IFS=$ac_path_separator
2644 ac_dummy="$PATH"
2645 for ac_dir in $ac_dummy; do
2646   IFS=$ac_save_IFS
2647   test -z "$ac_dir" && ac_dir=.
2648   $as_executable_p "$ac_dir/$ac_word" || continue
2649 ac_cv_prog_MAKE_UPPER_TAGS="yes"
2650 echo "$as_me:2650: found $ac_dir/$ac_word" >&5
2651 break
2652 done
2653
2654   test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no"
2655 fi
2656 fi
2657 MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS
2658 if test -n "$MAKE_UPPER_TAGS"; then
2659   echo "$as_me:2659: result: $MAKE_UPPER_TAGS" >&5
2660 echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6
2661 else
2662   echo "$as_me:2662: result: no" >&5
2663 echo "${ECHO_T}no" >&6
2664 fi
2665
2666 else
2667         MAKE_UPPER_TAGS=no
2668 fi
2669
2670 if test "$MAKE_UPPER_TAGS" = yes ; then
2671         MAKE_UPPER_TAGS=
2672 else
2673         MAKE_UPPER_TAGS="#"
2674 fi
2675
2676 if test "$MAKE_LOWER_TAGS" = yes ; then
2677         MAKE_LOWER_TAGS=
2678 else
2679         MAKE_LOWER_TAGS="#"
2680 fi
2681
2682 echo "$as_me:2682: checking if -lm needed for math functions" >&5
2683 echo $ECHO_N "checking if -lm needed for math functions... $ECHO_C" >&6
2684 if test "${cf_cv_need_libm+set}" = set; then
2685   echo $ECHO_N "(cached) $ECHO_C" >&6
2686 else
2687
2688         cat >conftest.$ac_ext <<_ACEOF
2689 #line 2689 "configure"
2690 #include "confdefs.h"
2691
2692         #include <stdio.h>
2693         #include <stdlib.h>
2694         #include <math.h>
2695
2696 int
2697 main (void)
2698 {
2699 double x = rand(); printf("result = %g\n", pow(sin(x),x))
2700   ;
2701   return 0;
2702 }
2703 _ACEOF
2704 rm -f conftest.$ac_objext conftest$ac_exeext
2705 if { (eval echo "$as_me:2705: \"$ac_link\"") >&5
2706   (eval $ac_link) 2>&5
2707   ac_status=$?
2708   echo "$as_me:2708: \$? = $ac_status" >&5
2709   (exit $ac_status); } &&
2710          { ac_try='test -s conftest$ac_exeext'
2711   { (eval echo "$as_me:2711: \"$ac_try\"") >&5
2712   (eval $ac_try) 2>&5
2713   ac_status=$?
2714   echo "$as_me:2714: \$? = $ac_status" >&5
2715   (exit $ac_status); }; }; then
2716   cf_cv_need_libm=no
2717 else
2718   echo "$as_me: failed program was:" >&5
2719 cat conftest.$ac_ext >&5
2720 cf_cv_need_libm=yes
2721 fi
2722 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
2723 fi
2724 echo "$as_me:2724: result: $cf_cv_need_libm" >&5
2725 echo "${ECHO_T}$cf_cv_need_libm" >&6
2726 if test "$cf_cv_need_libm" = yes
2727 then
2728 MATH_LIB=-lm
2729 fi
2730
2731 top_builddir=`pwd`
2732
2733 CC_G_OPT="-g"
2734 CC_SHARED_OPTS=unknown
2735 CPPFLAGS="$CPPFLAGS"
2736 DFT_DEP_SUFFIX=""
2737 DFT_OBJ_SUBDIR=`pwd|sed -e's:.*/::'`
2738 DFT_UPR_MODEL="NORMAL"
2739 LD="ld"
2740 LDFLAGS_SHARED=""
2741 LDFLAGS_STATIC=""
2742 LD_MODEL=""
2743 LD_SHARED_OPTS=""
2744 LIBTOOL=""
2745 LIBTOOL_OPTS=""
2746 LIB_CLEAN=""
2747 LIB_COMPILE=""
2748 LIB_LINK='${CC}'
2749 LINK_TESTS=""
2750 LOCAL_LDFLAGS=""
2751 PACKAGE="ncurses-examples"
2752 PTHREAD="-lm"
2753 TEST_ARGS=""
2754 TEST_DEPS=""
2755 TEST_LIBS=""
2756 TINFO_LDFLAGS=''
2757 TINFO_LIBS='$(LIBS_CURSES)'
2758 cf_cv_abi_version=""
2759 cf_cv_rel_version=""
2760 includesubdir=""
2761
2762 cf_cv_screen=curses
2763 cf_cv_libtype=
2764
2765 if test "$GCC" = yes
2766 then
2767 cat > conftest.i <<EOF
2768 #ifndef GCC_PRINTF
2769 #define GCC_PRINTF 0
2770 #endif
2771 #ifndef GCC_SCANF
2772 #define GCC_SCANF 0
2773 #endif
2774 #ifndef GCC_NORETURN
2775 #define GCC_NORETURN /* nothing */
2776 #endif
2777 #ifndef GCC_UNUSED
2778 #define GCC_UNUSED /* nothing */
2779 #endif
2780 EOF
2781 if test "$GCC" = yes
2782 then
2783         { echo "$as_me:2783: checking for $CC __attribute__ directives..." >&5
2784 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
2785 cat > conftest.$ac_ext <<EOF
2786 #line 2786 "${as_me:-configure}"
2787 #include "confdefs.h"
2788 #include "conftest.h"
2789 #include "conftest.i"
2790 #if     GCC_PRINTF
2791 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
2792 #else
2793 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
2794 #endif
2795 #if     GCC_SCANF
2796 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
2797 #else
2798 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
2799 #endif
2800 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
2801 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
2802 extern void foo(void) GCC_NORETURN;
2803 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
2804 EOF
2805         cf_printf_attribute=no
2806         cf_scanf_attribute=no
2807         for cf_attribute in scanf printf unused noreturn
2808         do
2809
2810 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
2811
2812                 cf_directive="__attribute__(($cf_attribute))"
2813                 echo "checking for $CC $cf_directive" 1>&5
2814
2815                 case $cf_attribute in
2816                 (printf)
2817                         cf_printf_attribute=yes
2818                         cat >conftest.h <<EOF
2819 #define GCC_$cf_ATTRIBUTE 1
2820 EOF
2821                         ;;
2822                 (scanf)
2823                         cf_scanf_attribute=yes
2824                         cat >conftest.h <<EOF
2825 #define GCC_$cf_ATTRIBUTE 1
2826 EOF
2827                         ;;
2828                 (*)
2829                         cat >conftest.h <<EOF
2830 #define GCC_$cf_ATTRIBUTE $cf_directive
2831 EOF
2832                         ;;
2833                 esac
2834
2835                 if { (eval echo "$as_me:2835: \"$ac_compile\"") >&5
2836   (eval $ac_compile) 2>&5
2837   ac_status=$?
2838   echo "$as_me:2838: \$? = $ac_status" >&5
2839   (exit $ac_status); }; then
2840                         test -n "$verbose" && echo "$as_me:2840: result: ... $cf_attribute" >&5
2841 echo "${ECHO_T}... $cf_attribute" >&6
2842                         cat conftest.h >>confdefs.h
2843                         case $cf_attribute in
2844                         (noreturn)
2845
2846 cat >>confdefs.h <<EOF
2847 #define GCC_NORETURN $cf_directive
2848 EOF
2849
2850                                 ;;
2851                         (printf)
2852                                 cf_value='/* nothing */'
2853                                 if test "$cf_printf_attribute" != no ; then
2854                                         cf_value='__attribute__((format(printf,fmt,var)))'
2855
2856 cat >>confdefs.h <<\EOF
2857 #define GCC_PRINTF 1
2858 EOF
2859
2860                                 fi
2861
2862 cat >>confdefs.h <<EOF
2863 #define GCC_PRINTFLIKE(fmt,var) $cf_value
2864 EOF
2865
2866                                 ;;
2867                         (scanf)
2868                                 cf_value='/* nothing */'
2869                                 if test "$cf_scanf_attribute" != no ; then
2870                                         cf_value='__attribute__((format(scanf,fmt,var)))'
2871
2872 cat >>confdefs.h <<\EOF
2873 #define GCC_SCANF 1
2874 EOF
2875
2876                                 fi
2877
2878 cat >>confdefs.h <<EOF
2879 #define GCC_SCANFLIKE(fmt,var) $cf_value
2880 EOF
2881
2882                                 ;;
2883                         (unused)
2884
2885 cat >>confdefs.h <<EOF
2886 #define GCC_UNUSED $cf_directive
2887 EOF
2888
2889                                 ;;
2890                         esac
2891                 fi
2892         done
2893 else
2894         fgrep define conftest.i >>confdefs.h
2895 fi
2896 rm -rf conftest*
2897 fi
2898
2899 echo "$as_me:2899: checking if you want to work around bogus compiler/loader warnings" >&5
2900 echo $ECHO_N "checking if you want to work around bogus compiler/loader warnings... $ECHO_C" >&6
2901
2902 # Check whether --enable-string-hacks or --disable-string-hacks was given.
2903 if test "${enable_string_hacks+set}" = set; then
2904   enableval="$enable_string_hacks"
2905   with_string_hacks=$enableval
2906 else
2907   with_string_hacks=no
2908 fi;
2909 echo "$as_me:2909: result: $with_string_hacks" >&5
2910 echo "${ECHO_T}$with_string_hacks" >&6
2911
2912 if test "x$with_string_hacks" = "xyes"; then
2913
2914 cat >>confdefs.h <<\EOF
2915 #define USE_STRING_HACKS 1
2916 EOF
2917
2918         { echo "$as_me:2918: WARNING: enabling string-hacks to work around bogus compiler/loader warnings" >&5
2919 echo "$as_me: WARNING: enabling string-hacks to work around bogus compiler/loader warnings" >&2;}
2920         echo "$as_me:2920: checking for strlcat" >&5
2921 echo $ECHO_N "checking for strlcat... $ECHO_C" >&6
2922 if test "${ac_cv_func_strlcat+set}" = set; then
2923   echo $ECHO_N "(cached) $ECHO_C" >&6
2924 else
2925   cat >conftest.$ac_ext <<_ACEOF
2926 #line 2926 "configure"
2927 #include "confdefs.h"
2928 /* System header to define __stub macros and hopefully few prototypes,
2929     which can conflict with char strlcat (); below.  */
2930 #include <assert.h>
2931 /* Override any gcc2 internal prototype to avoid an error.  */
2932 #ifdef __cplusplus
2933 extern "C"
2934 #endif
2935 /* We use char because int might match the return type of a gcc2
2936    builtin and then its argument prototype would still apply.  */
2937 char strlcat ();
2938 char (*f) ();
2939
2940 int
2941 main (void)
2942 {
2943 /* The GNU C library defines this for functions which it implements
2944     to always fail with ENOSYS.  Some functions are actually named
2945     something starting with __ and the normal name is an alias.  */
2946 #if defined (__stub_strlcat) || defined (__stub___strlcat)
2947 choke me
2948 #else
2949 f = strlcat; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
2950 #endif
2951
2952   ;
2953   return 0;
2954 }
2955 _ACEOF
2956 rm -f conftest.$ac_objext conftest$ac_exeext
2957 if { (eval echo "$as_me:2957: \"$ac_link\"") >&5
2958   (eval $ac_link) 2>&5
2959   ac_status=$?
2960   echo "$as_me:2960: \$? = $ac_status" >&5
2961   (exit $ac_status); } &&
2962          { ac_try='test -s conftest$ac_exeext'
2963   { (eval echo "$as_me:2963: \"$ac_try\"") >&5
2964   (eval $ac_try) 2>&5
2965   ac_status=$?
2966   echo "$as_me:2966: \$? = $ac_status" >&5
2967   (exit $ac_status); }; }; then
2968   ac_cv_func_strlcat=yes
2969 else
2970   echo "$as_me: failed program was:" >&5
2971 cat conftest.$ac_ext >&5
2972 ac_cv_func_strlcat=no
2973 fi
2974 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
2975 fi
2976 echo "$as_me:2976: result: $ac_cv_func_strlcat" >&5
2977 echo "${ECHO_T}$ac_cv_func_strlcat" >&6
2978 if test $ac_cv_func_strlcat = yes; then
2979
2980 cat >>confdefs.h <<\EOF
2981 #define HAVE_STRLCAT 1
2982 EOF
2983
2984 else
2985
2986                 echo "$as_me:2986: checking for strlcat in -lbsd" >&5
2987 echo $ECHO_N "checking for strlcat in -lbsd... $ECHO_C" >&6
2988 if test "${ac_cv_lib_bsd_strlcat+set}" = set; then
2989   echo $ECHO_N "(cached) $ECHO_C" >&6
2990 else
2991   ac_check_lib_save_LIBS=$LIBS
2992 LIBS="-lbsd  $LIBS"
2993 cat >conftest.$ac_ext <<_ACEOF
2994 #line 2994 "configure"
2995 #include "confdefs.h"
2996
2997 /* Override any gcc2 internal prototype to avoid an error.  */
2998 #ifdef __cplusplus
2999 extern "C"
3000 #endif
3001 /* We use char because int might match the return type of a gcc2
3002    builtin and then its argument prototype would still apply.  */
3003 char strlcat ();
3004 int
3005 main (void)
3006 {
3007 strlcat ();
3008   ;
3009   return 0;
3010 }
3011 _ACEOF
3012 rm -f conftest.$ac_objext conftest$ac_exeext
3013 if { (eval echo "$as_me:3013: \"$ac_link\"") >&5
3014   (eval $ac_link) 2>&5
3015   ac_status=$?
3016   echo "$as_me:3016: \$? = $ac_status" >&5
3017   (exit $ac_status); } &&
3018          { ac_try='test -s conftest$ac_exeext'
3019   { (eval echo "$as_me:3019: \"$ac_try\"") >&5
3020   (eval $ac_try) 2>&5
3021   ac_status=$?
3022   echo "$as_me:3022: \$? = $ac_status" >&5
3023   (exit $ac_status); }; }; then
3024   ac_cv_lib_bsd_strlcat=yes
3025 else
3026   echo "$as_me: failed program was:" >&5
3027 cat conftest.$ac_ext >&5
3028 ac_cv_lib_bsd_strlcat=no
3029 fi
3030 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
3031 LIBS=$ac_check_lib_save_LIBS
3032 fi
3033 echo "$as_me:3033: result: $ac_cv_lib_bsd_strlcat" >&5
3034 echo "${ECHO_T}$ac_cv_lib_bsd_strlcat" >&6
3035 if test $ac_cv_lib_bsd_strlcat = yes; then
3036
3037 cf_add_libs="-lbsd"
3038 # Filter out duplicates - this happens with badly-designed ".pc" files...
3039 for cf_add_1lib in $LIBS
3040 do
3041         for cf_add_2lib in $cf_add_libs
3042         do
3043                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
3044                 then
3045                         cf_add_1lib=
3046                         break
3047                 fi
3048         done
3049         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
3050 done
3051 LIBS="$cf_add_libs"
3052
3053 for ac_header in bsd/string.h
3054 do
3055 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
3056 echo "$as_me:3056: checking for $ac_header" >&5
3057 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
3058 if eval "test \"\${$as_ac_Header+set}\" = set"; then
3059   echo $ECHO_N "(cached) $ECHO_C" >&6
3060 else
3061   cat >conftest.$ac_ext <<_ACEOF
3062 #line 3062 "configure"
3063 #include "confdefs.h"
3064 #include <$ac_header>
3065 _ACEOF
3066 if { (eval echo "$as_me:3066: \"$ac_cpp conftest.$ac_ext\"") >&5
3067   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
3068   ac_status=$?
3069   egrep -v '^ *\+' conftest.er1 >conftest.err
3070   rm -f conftest.er1
3071   cat conftest.err >&5
3072   echo "$as_me:3072: \$? = $ac_status" >&5
3073   (exit $ac_status); } >/dev/null; then
3074   if test -s conftest.err; then
3075     ac_cpp_err=$ac_c_preproc_warn_flag
3076   else
3077     ac_cpp_err=
3078   fi
3079 else
3080   ac_cpp_err=yes
3081 fi
3082 if test -z "$ac_cpp_err"; then
3083   eval "$as_ac_Header=yes"
3084 else
3085   echo "$as_me: failed program was:" >&5
3086   cat conftest.$ac_ext >&5
3087   eval "$as_ac_Header=no"
3088 fi
3089 rm -f conftest.err conftest.$ac_ext
3090 fi
3091 echo "$as_me:3091: result: `eval echo '${'$as_ac_Header'}'`" >&5
3092 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
3093 if test `eval echo '${'$as_ac_Header'}'` = yes; then
3094   cat >>confdefs.h <<EOF
3095 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
3096 EOF
3097
3098 fi
3099 done
3100
3101 cat >>confdefs.h <<\EOF
3102 #define HAVE_STRLCAT 1
3103 EOF
3104
3105 fi
3106
3107 fi
3108
3109 for ac_func in strlcpy snprintf
3110 do
3111 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
3112 echo "$as_me:3112: checking for $ac_func" >&5
3113 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
3114 if eval "test \"\${$as_ac_var+set}\" = set"; then
3115   echo $ECHO_N "(cached) $ECHO_C" >&6
3116 else
3117   cat >conftest.$ac_ext <<_ACEOF
3118 #line 3118 "configure"
3119 #include "confdefs.h"
3120 /* System header to define __stub macros and hopefully few prototypes,
3121     which can conflict with char $ac_func (); below.  */
3122 #include <assert.h>
3123 /* Override any gcc2 internal prototype to avoid an error.  */
3124 #ifdef __cplusplus
3125 extern "C"
3126 #endif
3127 /* We use char because int might match the return type of a gcc2
3128    builtin and then its argument prototype would still apply.  */
3129 char $ac_func ();
3130 char (*f) ();
3131
3132 int
3133 main (void)
3134 {
3135 /* The GNU C library defines this for functions which it implements
3136     to always fail with ENOSYS.  Some functions are actually named
3137     something starting with __ and the normal name is an alias.  */
3138 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
3139 choke me
3140 #else
3141 f = $ac_func; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
3142 #endif
3143
3144   ;
3145   return 0;
3146 }
3147 _ACEOF
3148 rm -f conftest.$ac_objext conftest$ac_exeext
3149 if { (eval echo "$as_me:3149: \"$ac_link\"") >&5
3150   (eval $ac_link) 2>&5
3151   ac_status=$?
3152   echo "$as_me:3152: \$? = $ac_status" >&5
3153   (exit $ac_status); } &&
3154          { ac_try='test -s conftest$ac_exeext'
3155   { (eval echo "$as_me:3155: \"$ac_try\"") >&5
3156   (eval $ac_try) 2>&5
3157   ac_status=$?
3158   echo "$as_me:3158: \$? = $ac_status" >&5
3159   (exit $ac_status); }; }; then
3160   eval "$as_ac_var=yes"
3161 else
3162   echo "$as_me: failed program was:" >&5
3163 cat conftest.$ac_ext >&5
3164 eval "$as_ac_var=no"
3165 fi
3166 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
3167 fi
3168 echo "$as_me:3168: result: `eval echo '${'$as_ac_var'}'`" >&5
3169 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
3170 if test `eval echo '${'$as_ac_var'}'` = yes; then
3171   cat >>confdefs.h <<EOF
3172 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
3173 EOF
3174
3175 fi
3176 done
3177
3178 fi
3179
3180 cf_XOPEN_SOURCE=500
3181 cf_POSIX_C_SOURCE=199506L
3182 cf_xopen_source=
3183
3184 case $host_os in
3185 (aix[4-7]*)
3186         cf_xopen_source="-D_ALL_SOURCE"
3187         ;;
3188 (msys)
3189         cf_XOPEN_SOURCE=600
3190         ;;
3191 (darwin[0-8].*)
3192         cf_xopen_source="-D_APPLE_C_SOURCE"
3193         ;;
3194 (darwin*)
3195         cf_xopen_source="-D_DARWIN_C_SOURCE"
3196         cf_XOPEN_SOURCE=
3197         ;;
3198 (freebsd*|dragonfly*)
3199         # 5.x headers associate
3200         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
3201         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
3202         cf_POSIX_C_SOURCE=200112L
3203         cf_XOPEN_SOURCE=600
3204         cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
3205         ;;
3206 (hpux11*)
3207         cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
3208         ;;
3209 (hpux*)
3210         cf_xopen_source="-D_HPUX_SOURCE"
3211         ;;
3212 (irix[56].*)
3213         cf_xopen_source="-D_SGI_SOURCE"
3214         cf_XOPEN_SOURCE=
3215         ;;
3216 (linux*|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin)
3217
3218 echo "$as_me:3218: checking if we must define _GNU_SOURCE" >&5
3219 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
3220 if test "${cf_cv_gnu_source+set}" = set; then
3221   echo $ECHO_N "(cached) $ECHO_C" >&6
3222 else
3223
3224 cat >conftest.$ac_ext <<_ACEOF
3225 #line 3225 "configure"
3226 #include "confdefs.h"
3227 #include <sys/types.h>
3228 int
3229 main (void)
3230 {
3231
3232 #ifndef _XOPEN_SOURCE
3233 make an error
3234 #endif
3235   ;
3236   return 0;
3237 }
3238 _ACEOF
3239 rm -f conftest.$ac_objext
3240 if { (eval echo "$as_me:3240: \"$ac_compile\"") >&5
3241   (eval $ac_compile) 2>&5
3242   ac_status=$?
3243   echo "$as_me:3243: \$? = $ac_status" >&5
3244   (exit $ac_status); } &&
3245          { ac_try='test -s conftest.$ac_objext'
3246   { (eval echo "$as_me:3246: \"$ac_try\"") >&5
3247   (eval $ac_try) 2>&5
3248   ac_status=$?
3249   echo "$as_me:3249: \$? = $ac_status" >&5
3250   (exit $ac_status); }; }; then
3251   cf_cv_gnu_source=no
3252 else
3253   echo "$as_me: failed program was:" >&5
3254 cat conftest.$ac_ext >&5
3255 cf_save="$CPPFLAGS"
3256          CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
3257          cat >conftest.$ac_ext <<_ACEOF
3258 #line 3258 "configure"
3259 #include "confdefs.h"
3260 #include <sys/types.h>
3261 int
3262 main (void)
3263 {
3264
3265 #ifdef _XOPEN_SOURCE
3266 make an error
3267 #endif
3268   ;
3269   return 0;
3270 }
3271 _ACEOF
3272 rm -f conftest.$ac_objext
3273 if { (eval echo "$as_me:3273: \"$ac_compile\"") >&5
3274   (eval $ac_compile) 2>&5
3275   ac_status=$?
3276   echo "$as_me:3276: \$? = $ac_status" >&5
3277   (exit $ac_status); } &&
3278          { ac_try='test -s conftest.$ac_objext'
3279   { (eval echo "$as_me:3279: \"$ac_try\"") >&5
3280   (eval $ac_try) 2>&5
3281   ac_status=$?
3282   echo "$as_me:3282: \$? = $ac_status" >&5
3283   (exit $ac_status); }; }; then
3284   cf_cv_gnu_source=no
3285 else
3286   echo "$as_me: failed program was:" >&5
3287 cat conftest.$ac_ext >&5
3288 cf_cv_gnu_source=yes
3289 fi
3290 rm -f conftest.$ac_objext conftest.$ac_ext
3291         CPPFLAGS="$cf_save"
3292
3293 fi
3294 rm -f conftest.$ac_objext conftest.$ac_ext
3295
3296 fi
3297 echo "$as_me:3297: result: $cf_cv_gnu_source" >&5
3298 echo "${ECHO_T}$cf_cv_gnu_source" >&6
3299
3300 if test "$cf_cv_gnu_source" = yes
3301 then
3302 echo "$as_me:3302: checking if we should also define _DEFAULT_SOURCE" >&5
3303 echo $ECHO_N "checking if we should also define _DEFAULT_SOURCE... $ECHO_C" >&6
3304 if test "${cf_cv_default_source+set}" = set; then
3305   echo $ECHO_N "(cached) $ECHO_C" >&6
3306 else
3307
3308 CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
3309         cat >conftest.$ac_ext <<_ACEOF
3310 #line 3310 "configure"
3311 #include "confdefs.h"
3312 #include <sys/types.h>
3313 int
3314 main (void)
3315 {
3316
3317 #ifdef _DEFAULT_SOURCE
3318 make an error
3319 #endif
3320   ;
3321   return 0;
3322 }
3323 _ACEOF
3324 rm -f conftest.$ac_objext
3325 if { (eval echo "$as_me:3325: \"$ac_compile\"") >&5
3326   (eval $ac_compile) 2>&5
3327   ac_status=$?
3328   echo "$as_me:3328: \$? = $ac_status" >&5
3329   (exit $ac_status); } &&
3330          { ac_try='test -s conftest.$ac_objext'
3331   { (eval echo "$as_me:3331: \"$ac_try\"") >&5
3332   (eval $ac_try) 2>&5
3333   ac_status=$?
3334   echo "$as_me:3334: \$? = $ac_status" >&5
3335   (exit $ac_status); }; }; then
3336   cf_cv_default_source=no
3337 else
3338   echo "$as_me: failed program was:" >&5
3339 cat conftest.$ac_ext >&5
3340 cf_cv_default_source=yes
3341 fi
3342 rm -f conftest.$ac_objext conftest.$ac_ext
3343
3344 fi
3345 echo "$as_me:3345: result: $cf_cv_default_source" >&5
3346 echo "${ECHO_T}$cf_cv_default_source" >&6
3347 test "$cf_cv_default_source" = yes && CPPFLAGS="$CPPFLAGS -D_DEFAULT_SOURCE"
3348 fi
3349
3350         ;;
3351 (minix*)
3352         cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this...
3353         ;;
3354 (mirbsd*)
3355         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
3356         cf_XOPEN_SOURCE=
3357
3358 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
3359
3360 cf_save_CFLAGS="$CFLAGS"
3361 cf_save_CPPFLAGS="$CPPFLAGS"
3362
3363 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
3364         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
3365                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
3366
3367 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
3368         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
3369                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
3370
3371 echo "$as_me:3371: checking if we should define _POSIX_C_SOURCE" >&5
3372 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
3373 if test "${cf_cv_posix_c_source+set}" = set; then
3374   echo $ECHO_N "(cached) $ECHO_C" >&6
3375 else
3376
3377 echo "${as_me:-configure}:3377: testing if the symbol is already defined go no further ..." 1>&5
3378
3379         cat >conftest.$ac_ext <<_ACEOF
3380 #line 3380 "configure"
3381 #include "confdefs.h"
3382 #include <sys/types.h>
3383 int
3384 main (void)
3385 {
3386
3387 #ifndef _POSIX_C_SOURCE
3388 make an error
3389 #endif
3390   ;
3391   return 0;
3392 }
3393 _ACEOF
3394 rm -f conftest.$ac_objext
3395 if { (eval echo "$as_me:3395: \"$ac_compile\"") >&5
3396   (eval $ac_compile) 2>&5
3397   ac_status=$?
3398   echo "$as_me:3398: \$? = $ac_status" >&5
3399   (exit $ac_status); } &&
3400          { ac_try='test -s conftest.$ac_objext'
3401   { (eval echo "$as_me:3401: \"$ac_try\"") >&5
3402   (eval $ac_try) 2>&5
3403   ac_status=$?
3404   echo "$as_me:3404: \$? = $ac_status" >&5
3405   (exit $ac_status); }; }; then
3406   cf_cv_posix_c_source=no
3407 else
3408   echo "$as_me: failed program was:" >&5
3409 cat conftest.$ac_ext >&5
3410 cf_want_posix_source=no
3411          case .$cf_POSIX_C_SOURCE in
3412          (.[12]??*)
3413                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
3414                 ;;
3415          (.2)
3416                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
3417                 cf_want_posix_source=yes
3418                 ;;
3419          (.*)
3420                 cf_want_posix_source=yes
3421                 ;;
3422          esac
3423          if test "$cf_want_posix_source" = yes ; then
3424                 cat >conftest.$ac_ext <<_ACEOF
3425 #line 3425 "configure"
3426 #include "confdefs.h"
3427 #include <sys/types.h>
3428 int
3429 main (void)
3430 {
3431
3432 #ifdef _POSIX_SOURCE
3433 make an error
3434 #endif
3435   ;
3436   return 0;
3437 }
3438 _ACEOF
3439 rm -f conftest.$ac_objext
3440 if { (eval echo "$as_me:3440: \"$ac_compile\"") >&5
3441   (eval $ac_compile) 2>&5
3442   ac_status=$?
3443   echo "$as_me:3443: \$? = $ac_status" >&5
3444   (exit $ac_status); } &&
3445          { ac_try='test -s conftest.$ac_objext'
3446   { (eval echo "$as_me:3446: \"$ac_try\"") >&5
3447   (eval $ac_try) 2>&5
3448   ac_status=$?
3449   echo "$as_me:3449: \$? = $ac_status" >&5
3450   (exit $ac_status); }; }; then
3451   :
3452 else
3453   echo "$as_me: failed program was:" >&5
3454 cat conftest.$ac_ext >&5
3455 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
3456 fi
3457 rm -f conftest.$ac_objext conftest.$ac_ext
3458          fi
3459
3460 echo "${as_me:-configure}:3460: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
3461
3462          CFLAGS="$cf_trim_CFLAGS"
3463          CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
3464
3465 echo "${as_me:-configure}:3465: testing if the second compile does not leave our definition intact error ..." 1>&5
3466
3467          cat >conftest.$ac_ext <<_ACEOF
3468 #line 3468 "configure"
3469 #include "confdefs.h"
3470 #include <sys/types.h>
3471 int
3472 main (void)
3473 {
3474
3475 #ifndef _POSIX_C_SOURCE
3476 make an error
3477 #endif
3478   ;
3479   return 0;
3480 }
3481 _ACEOF
3482 rm -f conftest.$ac_objext
3483 if { (eval echo "$as_me:3483: \"$ac_compile\"") >&5
3484   (eval $ac_compile) 2>&5
3485   ac_status=$?
3486   echo "$as_me:3486: \$? = $ac_status" >&5
3487   (exit $ac_status); } &&
3488          { ac_try='test -s conftest.$ac_objext'
3489   { (eval echo "$as_me:3489: \"$ac_try\"") >&5
3490   (eval $ac_try) 2>&5
3491   ac_status=$?
3492   echo "$as_me:3492: \$? = $ac_status" >&5
3493   (exit $ac_status); }; }; then
3494   :
3495 else
3496   echo "$as_me: failed program was:" >&5
3497 cat conftest.$ac_ext >&5
3498 cf_cv_posix_c_source=no
3499 fi
3500 rm -f conftest.$ac_objext conftest.$ac_ext
3501          CFLAGS="$cf_save_CFLAGS"
3502          CPPFLAGS="$cf_save_CPPFLAGS"
3503
3504 fi
3505 rm -f conftest.$ac_objext conftest.$ac_ext
3506
3507 fi
3508 echo "$as_me:3508: result: $cf_cv_posix_c_source" >&5
3509 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
3510
3511 if test "$cf_cv_posix_c_source" != no ; then
3512         CFLAGS="$cf_trim_CFLAGS"
3513         CPPFLAGS="$cf_trim_CPPFLAGS"
3514
3515 cf_fix_cppflags=no
3516 cf_new_cflags=
3517 cf_new_cppflags=
3518 cf_new_extra_cppflags=
3519
3520 for cf_add_cflags in $cf_cv_posix_c_source
3521 do
3522 case $cf_fix_cppflags in
3523 (no)
3524         case $cf_add_cflags in
3525         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
3526                 case $cf_add_cflags in
3527                 (-D*)
3528                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3529
3530                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3531                                 && test -z "${cf_tst_cflags}" \
3532                                 && cf_fix_cppflags=yes
3533
3534                         if test $cf_fix_cppflags = yes ; then
3535
3536         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3537         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3538
3539                                 continue
3540                         elif test "${cf_tst_cflags}" = "\"'" ; then
3541
3542         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3543         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3544
3545                                 continue
3546                         fi
3547                         ;;
3548                 esac
3549                 case "$CPPFLAGS" in
3550                 (*$cf_add_cflags)
3551                         ;;
3552                 (*)
3553                         case $cf_add_cflags in
3554                         (-D*)
3555                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3556
3557 CPPFLAGS=`echo "$CPPFLAGS" | \
3558         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3559                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3560
3561                                 ;;
3562                         esac
3563
3564         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
3565         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
3566
3567                         ;;
3568                 esac
3569                 ;;
3570         (*)
3571
3572         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
3573         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
3574
3575                 ;;
3576         esac
3577         ;;
3578 (yes)
3579
3580         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3581         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3582
3583         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3584
3585         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3586                 && test -z "${cf_tst_cflags}" \
3587                 && cf_fix_cppflags=no
3588         ;;
3589 esac
3590 done
3591
3592 if test -n "$cf_new_cflags" ; then
3593
3594         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
3595         CFLAGS="${CFLAGS}$cf_new_cflags"
3596
3597 fi
3598
3599 if test -n "$cf_new_cppflags" ; then
3600
3601         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
3602         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
3603
3604 fi
3605
3606 if test -n "$cf_new_extra_cppflags" ; then
3607
3608         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
3609         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
3610
3611 fi
3612
3613 fi
3614
3615         ;;
3616 (netbsd*)
3617         cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
3618         ;;
3619 (openbsd[4-9]*)
3620         # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
3621         cf_xopen_source="-D_BSD_SOURCE"
3622         cf_XOPEN_SOURCE=600
3623         ;;
3624 (openbsd*)
3625         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
3626         ;;
3627 (osf[45]*)
3628         cf_xopen_source="-D_OSF_SOURCE"
3629         ;;
3630 (nto-qnx*)
3631         cf_xopen_source="-D_QNX_SOURCE"
3632         ;;
3633 (sco*)
3634         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
3635         ;;
3636 (solaris2.*)
3637         cf_xopen_source="-D__EXTENSIONS__"
3638         cf_cv_xopen_source=broken
3639         ;;
3640 (sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
3641         cf_XOPEN_SOURCE=
3642         cf_POSIX_C_SOURCE=
3643         ;;
3644 (*)
3645
3646 echo "$as_me:3646: checking if we should define _XOPEN_SOURCE" >&5
3647 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
3648 if test "${cf_cv_xopen_source+set}" = set; then
3649   echo $ECHO_N "(cached) $ECHO_C" >&6
3650 else
3651
3652         cat >conftest.$ac_ext <<_ACEOF
3653 #line 3653 "configure"
3654 #include "confdefs.h"
3655
3656 #include <stdlib.h>
3657 #include <string.h>
3658 #include <sys/types.h>
3659
3660 int
3661 main (void)
3662 {
3663
3664 #ifndef _XOPEN_SOURCE
3665 make an error
3666 #endif
3667   ;
3668   return 0;
3669 }
3670 _ACEOF
3671 rm -f conftest.$ac_objext
3672 if { (eval echo "$as_me:3672: \"$ac_compile\"") >&5
3673   (eval $ac_compile) 2>&5
3674   ac_status=$?
3675   echo "$as_me:3675: \$? = $ac_status" >&5
3676   (exit $ac_status); } &&
3677          { ac_try='test -s conftest.$ac_objext'
3678   { (eval echo "$as_me:3678: \"$ac_try\"") >&5
3679   (eval $ac_try) 2>&5
3680   ac_status=$?
3681   echo "$as_me:3681: \$? = $ac_status" >&5
3682   (exit $ac_status); }; }; then
3683   cf_cv_xopen_source=no
3684 else
3685   echo "$as_me: failed program was:" >&5
3686 cat conftest.$ac_ext >&5
3687 cf_save="$CPPFLAGS"
3688          CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
3689          cat >conftest.$ac_ext <<_ACEOF
3690 #line 3690 "configure"
3691 #include "confdefs.h"
3692
3693 #include <stdlib.h>
3694 #include <string.h>
3695 #include <sys/types.h>
3696
3697 int
3698 main (void)
3699 {
3700
3701 #ifdef _XOPEN_SOURCE
3702 make an error
3703 #endif
3704   ;
3705   return 0;
3706 }
3707 _ACEOF
3708 rm -f conftest.$ac_objext
3709 if { (eval echo "$as_me:3709: \"$ac_compile\"") >&5
3710   (eval $ac_compile) 2>&5
3711   ac_status=$?
3712   echo "$as_me:3712: \$? = $ac_status" >&5
3713   (exit $ac_status); } &&
3714          { ac_try='test -s conftest.$ac_objext'
3715   { (eval echo "$as_me:3715: \"$ac_try\"") >&5
3716   (eval $ac_try) 2>&5
3717   ac_status=$?
3718   echo "$as_me:3718: \$? = $ac_status" >&5
3719   (exit $ac_status); }; }; then
3720   cf_cv_xopen_source=no
3721 else
3722   echo "$as_me: failed program was:" >&5
3723 cat conftest.$ac_ext >&5
3724 cf_cv_xopen_source=$cf_XOPEN_SOURCE
3725 fi
3726 rm -f conftest.$ac_objext conftest.$ac_ext
3727         CPPFLAGS="$cf_save"
3728
3729 fi
3730 rm -f conftest.$ac_objext conftest.$ac_ext
3731
3732 fi
3733 echo "$as_me:3733: result: $cf_cv_xopen_source" >&5
3734 echo "${ECHO_T}$cf_cv_xopen_source" >&6
3735
3736 if test "$cf_cv_xopen_source" != no ; then
3737
3738 CFLAGS=`echo "$CFLAGS" | \
3739         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
3740                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
3741
3742 CPPFLAGS=`echo "$CPPFLAGS" | \
3743         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
3744                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
3745
3746         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
3747
3748 cf_fix_cppflags=no
3749 cf_new_cflags=
3750 cf_new_cppflags=
3751 cf_new_extra_cppflags=
3752
3753 for cf_add_cflags in $cf_temp_xopen_source
3754 do
3755 case $cf_fix_cppflags in
3756 (no)
3757         case $cf_add_cflags in
3758         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
3759                 case $cf_add_cflags in
3760                 (-D*)
3761                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3762
3763                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3764                                 && test -z "${cf_tst_cflags}" \
3765                                 && cf_fix_cppflags=yes
3766
3767                         if test $cf_fix_cppflags = yes ; then
3768
3769         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3770         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3771
3772                                 continue
3773                         elif test "${cf_tst_cflags}" = "\"'" ; then
3774
3775         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3776         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3777
3778                                 continue
3779                         fi
3780                         ;;
3781                 esac
3782                 case "$CPPFLAGS" in
3783                 (*$cf_add_cflags)
3784                         ;;
3785                 (*)
3786                         case $cf_add_cflags in
3787                         (-D*)
3788                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3789
3790 CPPFLAGS=`echo "$CPPFLAGS" | \
3791         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3792                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3793
3794                                 ;;
3795                         esac
3796
3797         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
3798         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
3799
3800                         ;;
3801                 esac
3802                 ;;
3803         (*)
3804
3805         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
3806         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
3807
3808                 ;;
3809         esac
3810         ;;
3811 (yes)
3812
3813         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3814         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3815
3816         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3817
3818         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3819                 && test -z "${cf_tst_cflags}" \
3820                 && cf_fix_cppflags=no
3821         ;;
3822 esac
3823 done
3824
3825 if test -n "$cf_new_cflags" ; then
3826
3827         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
3828         CFLAGS="${CFLAGS}$cf_new_cflags"
3829
3830 fi
3831
3832 if test -n "$cf_new_cppflags" ; then
3833
3834         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
3835         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
3836
3837 fi
3838
3839 if test -n "$cf_new_extra_cppflags" ; then
3840
3841         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
3842         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
3843
3844 fi
3845
3846 fi
3847
3848 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
3849
3850 cf_save_CFLAGS="$CFLAGS"
3851 cf_save_CPPFLAGS="$CPPFLAGS"
3852
3853 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
3854         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
3855                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
3856
3857 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
3858         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
3859                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
3860
3861 echo "$as_me:3861: checking if we should define _POSIX_C_SOURCE" >&5
3862 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
3863 if test "${cf_cv_posix_c_source+set}" = set; then
3864   echo $ECHO_N "(cached) $ECHO_C" >&6
3865 else
3866
3867 echo "${as_me:-configure}:3867: testing if the symbol is already defined go no further ..." 1>&5
3868
3869         cat >conftest.$ac_ext <<_ACEOF
3870 #line 3870 "configure"
3871 #include "confdefs.h"
3872 #include <sys/types.h>
3873 int
3874 main (void)
3875 {
3876
3877 #ifndef _POSIX_C_SOURCE
3878 make an error
3879 #endif
3880   ;
3881   return 0;
3882 }
3883 _ACEOF
3884 rm -f conftest.$ac_objext
3885 if { (eval echo "$as_me:3885: \"$ac_compile\"") >&5
3886   (eval $ac_compile) 2>&5
3887   ac_status=$?
3888   echo "$as_me:3888: \$? = $ac_status" >&5
3889   (exit $ac_status); } &&
3890          { ac_try='test -s conftest.$ac_objext'
3891   { (eval echo "$as_me:3891: \"$ac_try\"") >&5
3892   (eval $ac_try) 2>&5
3893   ac_status=$?
3894   echo "$as_me:3894: \$? = $ac_status" >&5
3895   (exit $ac_status); }; }; then
3896   cf_cv_posix_c_source=no
3897 else
3898   echo "$as_me: failed program was:" >&5
3899 cat conftest.$ac_ext >&5
3900 cf_want_posix_source=no
3901          case .$cf_POSIX_C_SOURCE in
3902          (.[12]??*)
3903                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
3904                 ;;
3905          (.2)
3906                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
3907                 cf_want_posix_source=yes
3908                 ;;
3909          (.*)
3910                 cf_want_posix_source=yes
3911                 ;;
3912          esac
3913          if test "$cf_want_posix_source" = yes ; then
3914                 cat >conftest.$ac_ext <<_ACEOF
3915 #line 3915 "configure"
3916 #include "confdefs.h"
3917 #include <sys/types.h>
3918 int
3919 main (void)
3920 {
3921
3922 #ifdef _POSIX_SOURCE
3923 make an error
3924 #endif
3925   ;
3926   return 0;
3927 }
3928 _ACEOF
3929 rm -f conftest.$ac_objext
3930 if { (eval echo "$as_me:3930: \"$ac_compile\"") >&5
3931   (eval $ac_compile) 2>&5
3932   ac_status=$?
3933   echo "$as_me:3933: \$? = $ac_status" >&5
3934   (exit $ac_status); } &&
3935          { ac_try='test -s conftest.$ac_objext'
3936   { (eval echo "$as_me:3936: \"$ac_try\"") >&5
3937   (eval $ac_try) 2>&5
3938   ac_status=$?
3939   echo "$as_me:3939: \$? = $ac_status" >&5
3940   (exit $ac_status); }; }; then
3941   :
3942 else
3943   echo "$as_me: failed program was:" >&5
3944 cat conftest.$ac_ext >&5
3945 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
3946 fi
3947 rm -f conftest.$ac_objext conftest.$ac_ext
3948          fi
3949
3950 echo "${as_me:-configure}:3950: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
3951
3952          CFLAGS="$cf_trim_CFLAGS"
3953          CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
3954
3955 echo "${as_me:-configure}:3955: testing if the second compile does not leave our definition intact error ..." 1>&5
3956
3957          cat >conftest.$ac_ext <<_ACEOF
3958 #line 3958 "configure"
3959 #include "confdefs.h"
3960 #include <sys/types.h>
3961 int
3962 main (void)
3963 {
3964
3965 #ifndef _POSIX_C_SOURCE
3966 make an error
3967 #endif
3968   ;
3969   return 0;
3970 }
3971 _ACEOF
3972 rm -f conftest.$ac_objext
3973 if { (eval echo "$as_me:3973: \"$ac_compile\"") >&5
3974   (eval $ac_compile) 2>&5
3975   ac_status=$?
3976   echo "$as_me:3976: \$? = $ac_status" >&5
3977   (exit $ac_status); } &&
3978          { ac_try='test -s conftest.$ac_objext'
3979   { (eval echo "$as_me:3979: \"$ac_try\"") >&5
3980   (eval $ac_try) 2>&5
3981   ac_status=$?
3982   echo "$as_me:3982: \$? = $ac_status" >&5
3983   (exit $ac_status); }; }; then
3984   :
3985 else
3986   echo "$as_me: failed program was:" >&5
3987 cat conftest.$ac_ext >&5
3988 cf_cv_posix_c_source=no
3989 fi
3990 rm -f conftest.$ac_objext conftest.$ac_ext
3991          CFLAGS="$cf_save_CFLAGS"
3992          CPPFLAGS="$cf_save_CPPFLAGS"
3993
3994 fi
3995 rm -f conftest.$ac_objext conftest.$ac_ext
3996
3997 fi
3998 echo "$as_me:3998: result: $cf_cv_posix_c_source" >&5
3999 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
4000
4001 if test "$cf_cv_posix_c_source" != no ; then
4002         CFLAGS="$cf_trim_CFLAGS"
4003         CPPFLAGS="$cf_trim_CPPFLAGS"
4004
4005 cf_fix_cppflags=no
4006 cf_new_cflags=
4007 cf_new_cppflags=
4008 cf_new_extra_cppflags=
4009
4010 for cf_add_cflags in $cf_cv_posix_c_source
4011 do
4012 case $cf_fix_cppflags in
4013 (no)
4014         case $cf_add_cflags in
4015         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4016                 case $cf_add_cflags in
4017                 (-D*)
4018                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4019
4020                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4021                                 && test -z "${cf_tst_cflags}" \
4022                                 && cf_fix_cppflags=yes
4023
4024                         if test $cf_fix_cppflags = yes ; then
4025
4026         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4027         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4028
4029                                 continue
4030                         elif test "${cf_tst_cflags}" = "\"'" ; then
4031
4032         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4033         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4034
4035                                 continue
4036                         fi
4037                         ;;
4038                 esac
4039                 case "$CPPFLAGS" in
4040                 (*$cf_add_cflags)
4041                         ;;
4042                 (*)
4043                         case $cf_add_cflags in
4044                         (-D*)
4045                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4046
4047 CPPFLAGS=`echo "$CPPFLAGS" | \
4048         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4049                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4050
4051                                 ;;
4052                         esac
4053
4054         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4055         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4056
4057                         ;;
4058                 esac
4059                 ;;
4060         (*)
4061
4062         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4063         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4064
4065                 ;;
4066         esac
4067         ;;
4068 (yes)
4069
4070         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4071         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4072
4073         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4074
4075         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4076                 && test -z "${cf_tst_cflags}" \
4077                 && cf_fix_cppflags=no
4078         ;;
4079 esac
4080 done
4081
4082 if test -n "$cf_new_cflags" ; then
4083
4084         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4085         CFLAGS="${CFLAGS}$cf_new_cflags"
4086
4087 fi
4088
4089 if test -n "$cf_new_cppflags" ; then
4090
4091         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4092         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4093
4094 fi
4095
4096 if test -n "$cf_new_extra_cppflags" ; then
4097
4098         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4099         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4100
4101 fi
4102
4103 fi
4104
4105         ;;
4106 esac
4107
4108 if test -n "$cf_xopen_source" ; then
4109
4110 cf_fix_cppflags=no
4111 cf_new_cflags=
4112 cf_new_cppflags=
4113 cf_new_extra_cppflags=
4114
4115 for cf_add_cflags in $cf_xopen_source
4116 do
4117 case $cf_fix_cppflags in
4118 (no)
4119         case $cf_add_cflags in
4120         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4121                 case $cf_add_cflags in
4122                 (-D*)
4123                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4124
4125                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4126                                 && test -z "${cf_tst_cflags}" \
4127                                 && cf_fix_cppflags=yes
4128
4129                         if test $cf_fix_cppflags = yes ; then
4130
4131         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4132         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4133
4134                                 continue
4135                         elif test "${cf_tst_cflags}" = "\"'" ; then
4136
4137         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4138         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4139
4140                                 continue
4141                         fi
4142                         ;;
4143                 esac
4144                 case "$CPPFLAGS" in
4145                 (*$cf_add_cflags)
4146                         ;;
4147                 (*)
4148                         case $cf_add_cflags in
4149                         (-D*)
4150                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4151
4152 CPPFLAGS=`echo "$CPPFLAGS" | \
4153         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4154                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4155
4156                                 ;;
4157                         esac
4158
4159         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4160         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4161
4162                         ;;
4163                 esac
4164                 ;;
4165         (*)
4166
4167         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4168         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4169
4170                 ;;
4171         esac
4172         ;;
4173 (yes)
4174
4175         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4176         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4177
4178         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4179
4180         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4181                 && test -z "${cf_tst_cflags}" \
4182                 && cf_fix_cppflags=no
4183         ;;
4184 esac
4185 done
4186
4187 if test -n "$cf_new_cflags" ; then
4188         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
4189
4190 echo "${as_me:-configure}:4190: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
4191
4192         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4193         CFLAGS="${CFLAGS}$cf_new_cflags"
4194
4195 fi
4196
4197 if test -n "$cf_new_cppflags" ; then
4198         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
4199
4200 echo "${as_me:-configure}:4200: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
4201
4202         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4203         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4204
4205 fi
4206
4207 if test -n "$cf_new_extra_cppflags" ; then
4208         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
4209
4210 echo "${as_me:-configure}:4210: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
4211
4212         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4213         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4214
4215 fi
4216
4217 fi
4218
4219 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
4220         echo "$as_me:4220: checking if _XOPEN_SOURCE really is set" >&5
4221 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
4222         cat >conftest.$ac_ext <<_ACEOF
4223 #line 4223 "configure"
4224 #include "confdefs.h"
4225 #include <stdlib.h>
4226 int
4227 main (void)
4228 {
4229
4230 #ifndef _XOPEN_SOURCE
4231 make an error
4232 #endif
4233   ;
4234   return 0;
4235 }
4236 _ACEOF
4237 rm -f conftest.$ac_objext
4238 if { (eval echo "$as_me:4238: \"$ac_compile\"") >&5
4239   (eval $ac_compile) 2>&5
4240   ac_status=$?
4241   echo "$as_me:4241: \$? = $ac_status" >&5
4242   (exit $ac_status); } &&
4243          { ac_try='test -s conftest.$ac_objext'
4244   { (eval echo "$as_me:4244: \"$ac_try\"") >&5
4245   (eval $ac_try) 2>&5
4246   ac_status=$?
4247   echo "$as_me:4247: \$? = $ac_status" >&5
4248   (exit $ac_status); }; }; then
4249   cf_XOPEN_SOURCE_set=yes
4250 else
4251   echo "$as_me: failed program was:" >&5
4252 cat conftest.$ac_ext >&5
4253 cf_XOPEN_SOURCE_set=no
4254 fi
4255 rm -f conftest.$ac_objext conftest.$ac_ext
4256         echo "$as_me:4256: result: $cf_XOPEN_SOURCE_set" >&5
4257 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
4258         if test $cf_XOPEN_SOURCE_set = yes
4259         then
4260                 cat >conftest.$ac_ext <<_ACEOF
4261 #line 4261 "configure"
4262 #include "confdefs.h"
4263 #include <stdlib.h>
4264 int
4265 main (void)
4266 {
4267
4268 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
4269 make an error
4270 #endif
4271   ;
4272   return 0;
4273 }
4274 _ACEOF
4275 rm -f conftest.$ac_objext
4276 if { (eval echo "$as_me:4276: \"$ac_compile\"") >&5
4277   (eval $ac_compile) 2>&5
4278   ac_status=$?
4279   echo "$as_me:4279: \$? = $ac_status" >&5
4280   (exit $ac_status); } &&
4281          { ac_try='test -s conftest.$ac_objext'
4282   { (eval echo "$as_me:4282: \"$ac_try\"") >&5
4283   (eval $ac_try) 2>&5
4284   ac_status=$?
4285   echo "$as_me:4285: \$? = $ac_status" >&5
4286   (exit $ac_status); }; }; then
4287   cf_XOPEN_SOURCE_set_ok=yes
4288 else
4289   echo "$as_me: failed program was:" >&5
4290 cat conftest.$ac_ext >&5
4291 cf_XOPEN_SOURCE_set_ok=no
4292 fi
4293 rm -f conftest.$ac_objext conftest.$ac_ext
4294                 if test $cf_XOPEN_SOURCE_set_ok = no
4295                 then
4296                         { echo "$as_me:4296: WARNING: _XOPEN_SOURCE is lower than requested" >&5
4297 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
4298                 fi
4299         else
4300
4301 echo "$as_me:4301: checking if we should define _XOPEN_SOURCE" >&5
4302 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
4303 if test "${cf_cv_xopen_source+set}" = set; then
4304   echo $ECHO_N "(cached) $ECHO_C" >&6
4305 else
4306
4307         cat >conftest.$ac_ext <<_ACEOF
4308 #line 4308 "configure"
4309 #include "confdefs.h"
4310
4311 #include <stdlib.h>
4312 #include <string.h>
4313 #include <sys/types.h>
4314
4315 int
4316 main (void)
4317 {
4318
4319 #ifndef _XOPEN_SOURCE
4320 make an error
4321 #endif
4322   ;
4323   return 0;
4324 }
4325 _ACEOF
4326 rm -f conftest.$ac_objext
4327 if { (eval echo "$as_me:4327: \"$ac_compile\"") >&5
4328   (eval $ac_compile) 2>&5
4329   ac_status=$?
4330   echo "$as_me:4330: \$? = $ac_status" >&5
4331   (exit $ac_status); } &&
4332          { ac_try='test -s conftest.$ac_objext'
4333   { (eval echo "$as_me:4333: \"$ac_try\"") >&5
4334   (eval $ac_try) 2>&5
4335   ac_status=$?
4336   echo "$as_me:4336: \$? = $ac_status" >&5
4337   (exit $ac_status); }; }; then
4338   cf_cv_xopen_source=no
4339 else
4340   echo "$as_me: failed program was:" >&5
4341 cat conftest.$ac_ext >&5
4342 cf_save="$CPPFLAGS"
4343          CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
4344          cat >conftest.$ac_ext <<_ACEOF
4345 #line 4345 "configure"
4346 #include "confdefs.h"
4347
4348 #include <stdlib.h>
4349 #include <string.h>
4350 #include <sys/types.h>
4351
4352 int
4353 main (void)
4354 {
4355
4356 #ifdef _XOPEN_SOURCE
4357 make an error
4358 #endif
4359   ;
4360   return 0;
4361 }
4362 _ACEOF
4363 rm -f conftest.$ac_objext
4364 if { (eval echo "$as_me:4364: \"$ac_compile\"") >&5
4365   (eval $ac_compile) 2>&5
4366   ac_status=$?
4367   echo "$as_me:4367: \$? = $ac_status" >&5
4368   (exit $ac_status); } &&
4369          { ac_try='test -s conftest.$ac_objext'
4370   { (eval echo "$as_me:4370: \"$ac_try\"") >&5
4371   (eval $ac_try) 2>&5
4372   ac_status=$?
4373   echo "$as_me:4373: \$? = $ac_status" >&5
4374   (exit $ac_status); }; }; then
4375   cf_cv_xopen_source=no
4376 else
4377   echo "$as_me: failed program was:" >&5
4378 cat conftest.$ac_ext >&5
4379 cf_cv_xopen_source=$cf_XOPEN_SOURCE
4380 fi
4381 rm -f conftest.$ac_objext conftest.$ac_ext
4382         CPPFLAGS="$cf_save"
4383
4384 fi
4385 rm -f conftest.$ac_objext conftest.$ac_ext
4386
4387 fi
4388 echo "$as_me:4388: result: $cf_cv_xopen_source" >&5
4389 echo "${ECHO_T}$cf_cv_xopen_source" >&6
4390
4391 if test "$cf_cv_xopen_source" != no ; then
4392
4393 CFLAGS=`echo "$CFLAGS" | \
4394         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
4395                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
4396
4397 CPPFLAGS=`echo "$CPPFLAGS" | \
4398         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
4399                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
4400
4401         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
4402
4403 cf_fix_cppflags=no
4404 cf_new_cflags=
4405 cf_new_cppflags=
4406 cf_new_extra_cppflags=
4407
4408 for cf_add_cflags in $cf_temp_xopen_source
4409 do
4410 case $cf_fix_cppflags in
4411 (no)
4412         case $cf_add_cflags in
4413         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4414                 case $cf_add_cflags in
4415                 (-D*)
4416                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4417
4418                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4419                                 && test -z "${cf_tst_cflags}" \
4420                                 && cf_fix_cppflags=yes
4421
4422                         if test $cf_fix_cppflags = yes ; then
4423
4424         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4425         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4426
4427                                 continue
4428                         elif test "${cf_tst_cflags}" = "\"'" ; then
4429
4430         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4431         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4432
4433                                 continue
4434                         fi
4435                         ;;
4436                 esac
4437                 case "$CPPFLAGS" in
4438                 (*$cf_add_cflags)
4439                         ;;
4440                 (*)
4441                         case $cf_add_cflags in
4442                         (-D*)
4443                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4444
4445 CPPFLAGS=`echo "$CPPFLAGS" | \
4446         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4447                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4448
4449                                 ;;
4450                         esac
4451
4452         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4453         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4454
4455                         ;;
4456                 esac
4457                 ;;
4458         (*)
4459
4460         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4461         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4462
4463                 ;;
4464         esac
4465         ;;
4466 (yes)
4467
4468         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4469         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4470
4471         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4472
4473         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4474                 && test -z "${cf_tst_cflags}" \
4475                 && cf_fix_cppflags=no
4476         ;;
4477 esac
4478 done
4479
4480 if test -n "$cf_new_cflags" ; then
4481
4482         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4483         CFLAGS="${CFLAGS}$cf_new_cflags"
4484
4485 fi
4486
4487 if test -n "$cf_new_cppflags" ; then
4488
4489         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4490         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4491
4492 fi
4493
4494 if test -n "$cf_new_extra_cppflags" ; then
4495
4496         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4497         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4498
4499 fi
4500
4501 fi
4502
4503         fi
4504 fi
4505
4506 echo "$as_me:4506: checking for signal global datatype" >&5
4507 echo $ECHO_N "checking for signal global datatype... $ECHO_C" >&6
4508 if test "${cf_cv_sig_atomic_t+set}" = set; then
4509   echo $ECHO_N "(cached) $ECHO_C" >&6
4510 else
4511
4512         for cf_type in \
4513                 "volatile sig_atomic_t" \
4514                 "sig_atomic_t" \
4515                 "int"
4516         do
4517         cat >conftest.$ac_ext <<_ACEOF
4518 #line 4518 "configure"
4519 #include "confdefs.h"
4520
4521 #include <sys/types.h>
4522 #include <signal.h>
4523 #include <stdio.h>
4524
4525 extern $cf_type x;
4526 $cf_type x;
4527 static void handler(int sig)
4528 {
4529         x = 5;
4530 }
4531 int
4532 main (void)
4533 {
4534 signal(SIGINT, handler);
4535                  x = 1
4536   ;
4537   return 0;
4538 }
4539 _ACEOF
4540 rm -f conftest.$ac_objext
4541 if { (eval echo "$as_me:4541: \"$ac_compile\"") >&5
4542   (eval $ac_compile) 2>&5
4543   ac_status=$?
4544   echo "$as_me:4544: \$? = $ac_status" >&5
4545   (exit $ac_status); } &&
4546          { ac_try='test -s conftest.$ac_objext'
4547   { (eval echo "$as_me:4547: \"$ac_try\"") >&5
4548   (eval $ac_try) 2>&5
4549   ac_status=$?
4550   echo "$as_me:4550: \$? = $ac_status" >&5
4551   (exit $ac_status); }; }; then
4552   cf_cv_sig_atomic_t=$cf_type
4553 else
4554   echo "$as_me: failed program was:" >&5
4555 cat conftest.$ac_ext >&5
4556 cf_cv_sig_atomic_t=no
4557 fi
4558 rm -f conftest.$ac_objext conftest.$ac_ext
4559                 test "$cf_cv_sig_atomic_t" != no && break
4560         done
4561
4562 fi
4563
4564 echo "$as_me:4564: result: $cf_cv_sig_atomic_t" >&5
4565 echo "${ECHO_T}$cf_cv_sig_atomic_t" >&6
4566 test "$cf_cv_sig_atomic_t" != no &&
4567 cat >>confdefs.h <<EOF
4568 #define SIG_ATOMIC_T $cf_cv_sig_atomic_t
4569 EOF
4570
4571 # Work around breakage on OS X
4572
4573 echo "$as_me:4573: checking if SIGWINCH is defined" >&5
4574 echo $ECHO_N "checking if SIGWINCH is defined... $ECHO_C" >&6
4575 if test "${cf_cv_define_sigwinch+set}" = set; then
4576   echo $ECHO_N "(cached) $ECHO_C" >&6
4577 else
4578
4579         cat >conftest.$ac_ext <<_ACEOF
4580 #line 4580 "configure"
4581 #include "confdefs.h"
4582
4583 #include <sys/types.h>
4584 #include <sys/signal.h>
4585
4586 int
4587 main (void)
4588 {
4589 int x = SIGWINCH
4590   ;
4591   return 0;
4592 }
4593 _ACEOF
4594 rm -f conftest.$ac_objext
4595 if { (eval echo "$as_me:4595: \"$ac_compile\"") >&5
4596   (eval $ac_compile) 2>&5
4597   ac_status=$?
4598   echo "$as_me:4598: \$? = $ac_status" >&5
4599   (exit $ac_status); } &&
4600          { ac_try='test -s conftest.$ac_objext'
4601   { (eval echo "$as_me:4601: \"$ac_try\"") >&5
4602   (eval $ac_try) 2>&5
4603   ac_status=$?
4604   echo "$as_me:4604: \$? = $ac_status" >&5
4605   (exit $ac_status); }; }; then
4606   cf_cv_define_sigwinch=yes
4607 else
4608   echo "$as_me: failed program was:" >&5
4609 cat conftest.$ac_ext >&5
4610 cat >conftest.$ac_ext <<_ACEOF
4611 #line 4611 "configure"
4612 #include "confdefs.h"
4613
4614 #undef _XOPEN_SOURCE
4615 #undef _POSIX_SOURCE
4616 #undef _POSIX_C_SOURCE
4617 #include <sys/types.h>
4618 #include <sys/signal.h>
4619
4620 int
4621 main (void)
4622 {
4623 int x = SIGWINCH
4624   ;
4625   return 0;
4626 }
4627 _ACEOF
4628 rm -f conftest.$ac_objext
4629 if { (eval echo "$as_me:4629: \"$ac_compile\"") >&5
4630   (eval $ac_compile) 2>&5
4631   ac_status=$?
4632   echo "$as_me:4632: \$? = $ac_status" >&5
4633   (exit $ac_status); } &&
4634          { ac_try='test -s conftest.$ac_objext'
4635   { (eval echo "$as_me:4635: \"$ac_try\"") >&5
4636   (eval $ac_try) 2>&5
4637   ac_status=$?
4638   echo "$as_me:4638: \$? = $ac_status" >&5
4639   (exit $ac_status); }; }; then
4640   cf_cv_define_sigwinch=maybe
4641 else
4642   echo "$as_me: failed program was:" >&5
4643 cat conftest.$ac_ext >&5
4644 cf_cv_define_sigwinch=no
4645 fi
4646 rm -f conftest.$ac_objext conftest.$ac_ext
4647
4648 fi
4649 rm -f conftest.$ac_objext conftest.$ac_ext
4650
4651 fi
4652 echo "$as_me:4652: result: $cf_cv_define_sigwinch" >&5
4653 echo "${ECHO_T}$cf_cv_define_sigwinch" >&6
4654
4655 if test "$cf_cv_define_sigwinch" = maybe ; then
4656 echo "$as_me:4656: checking for actual SIGWINCH definition" >&5
4657 echo $ECHO_N "checking for actual SIGWINCH definition... $ECHO_C" >&6
4658 if test "${cf_cv_fixup_sigwinch+set}" = set; then
4659   echo $ECHO_N "(cached) $ECHO_C" >&6
4660 else
4661
4662 cf_cv_fixup_sigwinch=unknown
4663 cf_sigwinch=32
4664 while test $cf_sigwinch != 1
4665 do
4666         cat >conftest.$ac_ext <<_ACEOF
4667 #line 4667 "configure"
4668 #include "confdefs.h"
4669
4670 #undef _XOPEN_SOURCE
4671 #undef _POSIX_SOURCE
4672 #undef _POSIX_C_SOURCE
4673 #include <sys/types.h>
4674 #include <sys/signal.h>
4675
4676 int
4677 main (void)
4678 {
4679
4680 #if SIGWINCH != $cf_sigwinch
4681 make an error
4682 #endif
4683 int x = SIGWINCH
4684   ;
4685   return 0;
4686 }
4687 _ACEOF
4688 rm -f conftest.$ac_objext
4689 if { (eval echo "$as_me:4689: \"$ac_compile\"") >&5
4690   (eval $ac_compile) 2>&5
4691   ac_status=$?
4692   echo "$as_me:4692: \$? = $ac_status" >&5
4693   (exit $ac_status); } &&
4694          { ac_try='test -s conftest.$ac_objext'
4695   { (eval echo "$as_me:4695: \"$ac_try\"") >&5
4696   (eval $ac_try) 2>&5
4697   ac_status=$?
4698   echo "$as_me:4698: \$? = $ac_status" >&5
4699   (exit $ac_status); }; }; then
4700   cf_cv_fixup_sigwinch=$cf_sigwinch
4701          break
4702 else
4703   echo "$as_me: failed program was:" >&5
4704 cat conftest.$ac_ext >&5
4705 fi
4706 rm -f conftest.$ac_objext conftest.$ac_ext
4707
4708 cf_sigwinch=`expr $cf_sigwinch - 1`
4709 done
4710
4711 fi
4712 echo "$as_me:4712: result: $cf_cv_fixup_sigwinch" >&5
4713 echo "${ECHO_T}$cf_cv_fixup_sigwinch" >&6
4714
4715         if test "$cf_cv_fixup_sigwinch" != unknown ; then
4716                 CPPFLAGS="$CPPFLAGS -DSIGWINCH=$cf_cv_fixup_sigwinch"
4717         fi
4718 fi
4719
4720 # Checks for CODESET support.
4721
4722 echo "$as_me:4722: checking for nl_langinfo and CODESET" >&5
4723 echo $ECHO_N "checking for nl_langinfo and CODESET... $ECHO_C" >&6
4724 if test "${am_cv_langinfo_codeset+set}" = set; then
4725   echo $ECHO_N "(cached) $ECHO_C" >&6
4726 else
4727   cat >conftest.$ac_ext <<_ACEOF
4728 #line 4728 "configure"
4729 #include "confdefs.h"
4730 #include <langinfo.h>
4731 int
4732 main (void)
4733 {
4734 char* cs = nl_langinfo(CODESET);
4735   ;
4736   return 0;
4737 }
4738 _ACEOF
4739 rm -f conftest.$ac_objext conftest$ac_exeext
4740 if { (eval echo "$as_me:4740: \"$ac_link\"") >&5
4741   (eval $ac_link) 2>&5
4742   ac_status=$?
4743   echo "$as_me:4743: \$? = $ac_status" >&5
4744   (exit $ac_status); } &&
4745          { ac_try='test -s conftest$ac_exeext'
4746   { (eval echo "$as_me:4746: \"$ac_try\"") >&5
4747   (eval $ac_try) 2>&5
4748   ac_status=$?
4749   echo "$as_me:4749: \$? = $ac_status" >&5
4750   (exit $ac_status); }; }; then
4751   am_cv_langinfo_codeset=yes
4752 else
4753   echo "$as_me: failed program was:" >&5
4754 cat conftest.$ac_ext >&5
4755 am_cv_langinfo_codeset=no
4756 fi
4757 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4758
4759 fi
4760 echo "$as_me:4760: result: $am_cv_langinfo_codeset" >&5
4761 echo "${ECHO_T}$am_cv_langinfo_codeset" >&6
4762         if test $am_cv_langinfo_codeset = yes; then
4763
4764 cat >>confdefs.h <<\EOF
4765 #define HAVE_LANGINFO_CODESET 1
4766 EOF
4767
4768         fi
4769
4770 echo "$as_me:4770: checking if you want to use pkg-config" >&5
4771 echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6
4772
4773 # Check whether --with-pkg-config or --without-pkg-config was given.
4774 if test "${with_pkg_config+set}" = set; then
4775   withval="$with_pkg_config"
4776   cf_pkg_config=$withval
4777 else
4778   cf_pkg_config=yes
4779 fi;
4780 echo "$as_me:4780: result: $cf_pkg_config" >&5
4781 echo "${ECHO_T}$cf_pkg_config" >&6
4782
4783 case $cf_pkg_config in
4784 (no)
4785         PKG_CONFIG=none
4786         ;;
4787 (yes)
4788
4789 if test -n "$ac_tool_prefix"; then
4790   # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
4791 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
4792 echo "$as_me:4792: checking for $ac_word" >&5
4793 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4794 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
4795   echo $ECHO_N "(cached) $ECHO_C" >&6
4796 else
4797   case $PKG_CONFIG in
4798   [\\/]* | ?:[\\/]*)
4799   ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
4800   ;;
4801   *)
4802   ac_save_IFS=$IFS; IFS=$ac_path_separator
4803 ac_dummy="$PATH"
4804 for ac_dir in $ac_dummy; do
4805   IFS=$ac_save_IFS
4806   test -z "$ac_dir" && ac_dir=.
4807   if $as_executable_p "$ac_dir/$ac_word"; then
4808    ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
4809    echo "$as_me:4809: found $ac_dir/$ac_word" >&5
4810    break
4811 fi
4812 done
4813
4814   ;;
4815 esac
4816 fi
4817 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
4818
4819 if test -n "$PKG_CONFIG"; then
4820   echo "$as_me:4820: result: $PKG_CONFIG" >&5
4821 echo "${ECHO_T}$PKG_CONFIG" >&6
4822 else
4823   echo "$as_me:4823: result: no" >&5
4824 echo "${ECHO_T}no" >&6
4825 fi
4826
4827 fi
4828 if test -z "$ac_cv_path_PKG_CONFIG"; then
4829   ac_pt_PKG_CONFIG=$PKG_CONFIG
4830   # Extract the first word of "pkg-config", so it can be a program name with args.
4831 set dummy pkg-config; ac_word=$2
4832 echo "$as_me:4832: checking for $ac_word" >&5
4833 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4834 if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
4835   echo $ECHO_N "(cached) $ECHO_C" >&6
4836 else
4837   case $ac_pt_PKG_CONFIG in
4838   [\\/]* | ?:[\\/]*)
4839   ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
4840   ;;
4841   *)
4842   ac_save_IFS=$IFS; IFS=$ac_path_separator
4843 ac_dummy="$PATH"
4844 for ac_dir in $ac_dummy; do
4845   IFS=$ac_save_IFS
4846   test -z "$ac_dir" && ac_dir=.
4847   if $as_executable_p "$ac_dir/$ac_word"; then
4848    ac_cv_path_ac_pt_PKG_CONFIG="$ac_dir/$ac_word"
4849    echo "$as_me:4849: found $ac_dir/$ac_word" >&5
4850    break
4851 fi
4852 done
4853
4854   test -z "$ac_cv_path_ac_pt_PKG_CONFIG" && ac_cv_path_ac_pt_PKG_CONFIG="none"
4855   ;;
4856 esac
4857 fi
4858 ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
4859
4860 if test -n "$ac_pt_PKG_CONFIG"; then
4861   echo "$as_me:4861: result: $ac_pt_PKG_CONFIG" >&5
4862 echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
4863 else
4864   echo "$as_me:4864: result: no" >&5
4865 echo "${ECHO_T}no" >&6
4866 fi
4867
4868   PKG_CONFIG=$ac_pt_PKG_CONFIG
4869 else
4870   PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
4871 fi
4872
4873         ;;
4874 (*)
4875         PKG_CONFIG=$withval
4876         ;;
4877 esac
4878
4879 test -z "$PKG_CONFIG" && PKG_CONFIG=none
4880 if test "$PKG_CONFIG" != none ; then
4881
4882 if test "x$prefix" != xNONE; then
4883         cf_path_syntax="$prefix"
4884 else
4885         cf_path_syntax="$ac_default_prefix"
4886 fi
4887
4888 case ".$PKG_CONFIG" in
4889 (.\$\(*\)*|.\'*\'*)
4890         ;;
4891 (..|./*|.\\*)
4892         ;;
4893 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
4894         ;;
4895 (.\${*prefix}*|.\${*dir}*)
4896         eval PKG_CONFIG="$PKG_CONFIG"
4897         case ".$PKG_CONFIG" in
4898         (.NONE/*)
4899                 PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
4900                 ;;
4901         esac
4902         ;;
4903 (.no|.NONE/*)
4904         PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
4905         ;;
4906 (*)
4907         { { echo "$as_me:4907: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
4908 echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
4909    { (exit 1); exit 1; }; }
4910         ;;
4911 esac
4912
4913 elif test "x$cf_pkg_config" != xno ; then
4914         { echo "$as_me:4914: WARNING: pkg-config is not installed" >&5
4915 echo "$as_me: WARNING: pkg-config is not installed" >&2;}
4916 fi
4917
4918 echo "$as_me:4918: checking if you want to see long compiling messages" >&5
4919 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
4920
4921 # Check whether --enable-echo or --disable-echo was given.
4922 if test "${enable_echo+set}" = set; then
4923   enableval="$enable_echo"
4924   test "$enableval" != no && enableval=yes
4925         if test "$enableval" != "yes" ; then
4926
4927         ECHO_LT='--silent'
4928         ECHO_LD='@echo linking $@;'
4929         RULE_CC='@echo compiling $<'
4930         SHOW_CC='@echo compiling $@'
4931         ECHO_CC='@'
4932
4933         else
4934
4935         ECHO_LT=''
4936         ECHO_LD=''
4937         RULE_CC=''
4938         SHOW_CC=''
4939         ECHO_CC=''
4940
4941         fi
4942 else
4943   enableval=yes
4944
4945         ECHO_LT=''
4946         ECHO_LD=''
4947         RULE_CC=''
4948         SHOW_CC=''
4949         ECHO_CC=''
4950
4951 fi;
4952 echo "$as_me:4952: result: $enableval" >&5
4953 echo "${ECHO_T}$enableval" >&6
4954
4955 echo "$as_me:4955: checking for ncurses wrap-prefix" >&5
4956 echo $ECHO_N "checking for ncurses wrap-prefix... $ECHO_C" >&6
4957
4958 # Check whether --with-ncurses-wrap-prefix or --without-ncurses-wrap-prefix was given.
4959 if test "${with_ncurses_wrap_prefix+set}" = set; then
4960   withval="$with_ncurses_wrap_prefix"
4961   NCURSES_WRAP_PREFIX=$withval
4962 else
4963   NCURSES_WRAP_PREFIX=_nc_
4964 fi;
4965 echo "$as_me:4965: result: $NCURSES_WRAP_PREFIX" >&5
4966 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
4967
4968 echo "$as_me:4968: checking if you want to check for wide-character functions" >&5
4969 echo $ECHO_N "checking if you want to check for wide-character functions... $ECHO_C" >&6
4970
4971 # Check whether --enable-widec or --disable-widec was given.
4972 if test "${enable_widec+set}" = set; then
4973   enableval="$enable_widec"
4974   test "$enableval" != no && enableval=yes
4975         if test "$enableval" != "yes" ; then
4976     cf_enable_widec=no
4977         else
4978                 cf_enable_widec=yes
4979         fi
4980 else
4981   enableval=yes
4982         cf_enable_widec=yes
4983
4984 fi;
4985 echo "$as_me:4985: result: $cf_enable_widec" >&5
4986 echo "${ECHO_T}$cf_enable_widec" >&6
4987
4988 echo "$as_me:4988: checking for specific curses-directory" >&5
4989 echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
4990
4991 # Check whether --with-curses-dir or --without-curses-dir was given.
4992 if test "${with_curses_dir+set}" = set; then
4993   withval="$with_curses_dir"
4994   cf_cv_curses_dir=$withval
4995 else
4996   cf_cv_curses_dir=no
4997 fi;
4998 echo "$as_me:4998: result: $cf_cv_curses_dir" >&5
4999 echo "${ECHO_T}$cf_cv_curses_dir" >&6
5000
5001 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
5002 then
5003
5004 if test "x$prefix" != xNONE; then
5005         cf_path_syntax="$prefix"
5006 else
5007         cf_path_syntax="$ac_default_prefix"
5008 fi
5009
5010 case ".$withval" in
5011 (.\$\(*\)*|.\'*\'*)
5012         ;;
5013 (..|./*|.\\*)
5014         ;;
5015 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
5016         ;;
5017 (.\${*prefix}*|.\${*dir}*)
5018         eval withval="$withval"
5019         case ".$withval" in
5020         (.NONE/*)
5021                 withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
5022                 ;;
5023         esac
5024         ;;
5025 (.no|.NONE/*)
5026         withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
5027         ;;
5028 (*)
5029         { { echo "$as_me:5029: error: expected a pathname, not \"$withval\"" >&5
5030 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
5031    { (exit 1); exit 1; }; }
5032         ;;
5033 esac
5034
5035         if test -d "$cf_cv_curses_dir"
5036         then
5037
5038 if test -n "$cf_cv_curses_dir/include" ; then
5039   for cf_add_incdir in $cf_cv_curses_dir/include
5040   do
5041         while test $cf_add_incdir != /usr/include
5042         do
5043           if test -d $cf_add_incdir
5044           then
5045                 cf_have_incdir=no
5046                 if test -n "$CFLAGS$CPPFLAGS" ; then
5047                   # a loop is needed to ensure we can add subdirs of existing dirs
5048                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5049                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5050                           cf_have_incdir=yes; break
5051                         fi
5052                   done
5053                 fi
5054
5055                 if test "$cf_have_incdir" = no ; then
5056                   if test "$cf_add_incdir" = /usr/local/include ; then
5057                         if test "$GCC" = yes
5058                         then
5059                           cf_save_CPPFLAGS=$CPPFLAGS
5060                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5061                           cat >conftest.$ac_ext <<_ACEOF
5062 #line 5062 "configure"
5063 #include "confdefs.h"
5064 #include <stdio.h>
5065 int
5066 main (void)
5067 {
5068 printf("Hello")
5069   ;
5070   return 0;
5071 }
5072 _ACEOF
5073 rm -f conftest.$ac_objext
5074 if { (eval echo "$as_me:5074: \"$ac_compile\"") >&5
5075   (eval $ac_compile) 2>&5
5076   ac_status=$?
5077   echo "$as_me:5077: \$? = $ac_status" >&5
5078   (exit $ac_status); } &&
5079          { ac_try='test -s conftest.$ac_objext'
5080   { (eval echo "$as_me:5080: \"$ac_try\"") >&5
5081   (eval $ac_try) 2>&5
5082   ac_status=$?
5083   echo "$as_me:5083: \$? = $ac_status" >&5
5084   (exit $ac_status); }; }; then
5085   :
5086 else
5087   echo "$as_me: failed program was:" >&5
5088 cat conftest.$ac_ext >&5
5089 cf_have_incdir=yes
5090 fi
5091 rm -f conftest.$ac_objext conftest.$ac_ext
5092                           CPPFLAGS=$cf_save_CPPFLAGS
5093                         fi
5094                   fi
5095                 fi
5096
5097                 if test "$cf_have_incdir" = no ; then
5098                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5099
5100 echo "${as_me:-configure}:5100: testing adding $cf_add_incdir to include-path ..." 1>&5
5101
5102                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5103
5104                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
5105                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5106                   cf_add_incdir="$cf_top_incdir"
5107                 else
5108                   break
5109                 fi
5110           else
5111                 break
5112           fi
5113         done
5114   done
5115 fi
5116
5117 if test -n "$cf_cv_curses_dir/lib" ; then
5118         for cf_add_libdir in $cf_cv_curses_dir/lib
5119         do
5120                 if test $cf_add_libdir = /usr/lib ; then
5121                         :
5122                 elif test -d $cf_add_libdir
5123                 then
5124                         cf_have_libdir=no
5125                         if test -n "$LDFLAGS$LIBS" ; then
5126                                 # a loop is needed to ensure we can add subdirs of existing dirs
5127                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
5128                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5129                                                 cf_have_libdir=yes; break
5130                                         fi
5131                                 done
5132                         fi
5133                         if test "$cf_have_libdir" = no ; then
5134                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5135
5136 echo "${as_me:-configure}:5136: testing adding $cf_add_libdir to library-path ..." 1>&5
5137
5138                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5139                         fi
5140                 fi
5141         done
5142 fi
5143
5144         fi
5145 fi
5146
5147 cf_cv_screen=curses
5148
5149 echo "$as_me:5149: checking for specified curses library type" >&5
5150 echo $ECHO_N "checking for specified curses library type... $ECHO_C" >&6
5151
5152 # Check whether --with-screen or --without-screen was given.
5153 if test "${with_screen+set}" = set; then
5154   withval="$with_screen"
5155   cf_cv_screen=$withval
5156 else
5157
5158 # Check whether --with-ncursesw or --without-ncursesw was given.
5159 if test "${with_ncursesw+set}" = set; then
5160   withval="$with_ncursesw"
5161   cf_cv_screen=ncursesw
5162 else
5163
5164 # Check whether --with-ncurses or --without-ncurses was given.
5165 if test "${with_ncurses+set}" = set; then
5166   withval="$with_ncurses"
5167   cf_cv_screen=ncurses
5168 else
5169
5170 # Check whether --with-pdcurses or --without-pdcurses was given.
5171 if test "${with_pdcurses+set}" = set; then
5172   withval="$with_pdcurses"
5173   cf_cv_screen=pdcurses
5174 else
5175
5176 # Check whether --with-curses-colr or --without-curses-colr was given.
5177 if test "${with_curses_colr+set}" = set; then
5178   withval="$with_curses_colr"
5179   cf_cv_screen=curses_colr
5180 else
5181
5182 # Check whether --with-curses-5lib or --without-curses-5lib was given.
5183 if test "${with_curses_5lib+set}" = set; then
5184   withval="$with_curses_5lib"
5185   cf_cv_screen=curses_5lib
5186 fi;
5187 fi;
5188 fi;
5189 fi;
5190 fi;
5191 fi;
5192
5193 echo "$as_me:5193: result: $cf_cv_screen" >&5
5194 echo "${ECHO_T}$cf_cv_screen" >&6
5195
5196 case $cf_cv_screen in
5197 (curses|curses_*)
5198
5199 echo "$as_me:5199: checking for extra include directories" >&5
5200 echo $ECHO_N "checking for extra include directories... $ECHO_C" >&6
5201 if test "${cf_cv_curses_incdir+set}" = set; then
5202   echo $ECHO_N "(cached) $ECHO_C" >&6
5203 else
5204
5205 cf_cv_curses_incdir=no
5206 case $host_os in
5207 (hpux10.*)
5208         if test "x$cf_cv_screen" = "xcurses_colr"
5209         then
5210                 test -d /usr/include/curses_colr && \
5211                 cf_cv_curses_incdir="-I/usr/include/curses_colr"
5212         fi
5213         ;;
5214 (sunos3*|sunos4*)
5215         if test "x$cf_cv_screen" = "xcurses_5lib"
5216         then
5217                 test -d /usr/5lib && \
5218                 test -d /usr/5include && \
5219                 cf_cv_curses_incdir="-I/usr/5include"
5220         fi
5221         ;;
5222 esac
5223
5224 fi
5225 echo "$as_me:5225: result: $cf_cv_curses_incdir" >&5
5226 echo "${ECHO_T}$cf_cv_curses_incdir" >&6
5227 test "$cf_cv_curses_incdir" != no && CPPFLAGS="$CPPFLAGS $cf_cv_curses_incdir"
5228
5229 echo "$as_me:5229: checking if we have identified curses headers" >&5
5230 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
5231 if test "${cf_cv_ncurses_header+set}" = set; then
5232   echo $ECHO_N "(cached) $ECHO_C" >&6
5233 else
5234
5235 cf_cv_ncurses_header=none
5236 for cf_header in \
5237         ncurses.h  \
5238         curses.h  ncurses/ncurses.h ncurses/curses.h
5239 do
5240 cat >conftest.$ac_ext <<_ACEOF
5241 #line 5241 "configure"
5242 #include "confdefs.h"
5243 #include <${cf_header}>
5244 int
5245 main (void)
5246 {
5247 initscr(); tgoto("?", 0,0)
5248   ;
5249   return 0;
5250 }
5251 _ACEOF
5252 rm -f conftest.$ac_objext
5253 if { (eval echo "$as_me:5253: \"$ac_compile\"") >&5
5254   (eval $ac_compile) 2>&5
5255   ac_status=$?
5256   echo "$as_me:5256: \$? = $ac_status" >&5
5257   (exit $ac_status); } &&
5258          { ac_try='test -s conftest.$ac_objext'
5259   { (eval echo "$as_me:5259: \"$ac_try\"") >&5
5260   (eval $ac_try) 2>&5
5261   ac_status=$?
5262   echo "$as_me:5262: \$? = $ac_status" >&5
5263   (exit $ac_status); }; }; then
5264   cf_cv_ncurses_header=$cf_header; break
5265 else
5266   echo "$as_me: failed program was:" >&5
5267 cat conftest.$ac_ext >&5
5268 fi
5269 rm -f conftest.$ac_objext conftest.$ac_ext
5270 done
5271
5272 fi
5273 echo "$as_me:5273: result: $cf_cv_ncurses_header" >&5
5274 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
5275
5276 if test "$cf_cv_ncurses_header" = none ; then
5277         { { echo "$as_me:5277: error: No curses header-files found" >&5
5278 echo "$as_me: error: No curses header-files found" >&2;}
5279    { (exit 1); exit 1; }; }
5280 fi
5281
5282 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
5283
5284 for ac_header in $cf_cv_ncurses_header
5285 do
5286 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
5287 echo "$as_me:5287: checking for $ac_header" >&5
5288 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
5289 if eval "test \"\${$as_ac_Header+set}\" = set"; then
5290   echo $ECHO_N "(cached) $ECHO_C" >&6
5291 else
5292   cat >conftest.$ac_ext <<_ACEOF
5293 #line 5293 "configure"
5294 #include "confdefs.h"
5295 #include <$ac_header>
5296 _ACEOF
5297 if { (eval echo "$as_me:5297: \"$ac_cpp conftest.$ac_ext\"") >&5
5298   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
5299   ac_status=$?
5300   egrep -v '^ *\+' conftest.er1 >conftest.err
5301   rm -f conftest.er1
5302   cat conftest.err >&5
5303   echo "$as_me:5303: \$? = $ac_status" >&5
5304   (exit $ac_status); } >/dev/null; then
5305   if test -s conftest.err; then
5306     ac_cpp_err=$ac_c_preproc_warn_flag
5307   else
5308     ac_cpp_err=
5309   fi
5310 else
5311   ac_cpp_err=yes
5312 fi
5313 if test -z "$ac_cpp_err"; then
5314   eval "$as_ac_Header=yes"
5315 else
5316   echo "$as_me: failed program was:" >&5
5317   cat conftest.$ac_ext >&5
5318   eval "$as_ac_Header=no"
5319 fi
5320 rm -f conftest.err conftest.$ac_ext
5321 fi
5322 echo "$as_me:5322: result: `eval echo '${'$as_ac_Header'}'`" >&5
5323 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
5324 if test `eval echo '${'$as_ac_Header'}'` = yes; then
5325   cat >>confdefs.h <<EOF
5326 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
5327 EOF
5328
5329 fi
5330 done
5331
5332 echo "$as_me:5332: checking for terminfo header" >&5
5333 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
5334 if test "${cf_cv_term_header+set}" = set; then
5335   echo $ECHO_N "(cached) $ECHO_C" >&6
5336 else
5337
5338 case ${cf_cv_ncurses_header} in
5339 (*/ncurses.h|*/ncursesw.h)
5340         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
5341         ;;
5342 (*)
5343         cf_term_header=term.h
5344         ;;
5345 esac
5346
5347 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
5348 do
5349 cat >conftest.$ac_ext <<_ACEOF
5350 #line 5350 "configure"
5351 #include "confdefs.h"
5352 #include <stdio.h>
5353 #include <${cf_cv_ncurses_header:-curses.h}>
5354 #include <$cf_test>
5355
5356 int
5357 main (void)
5358 {
5359 int x = auto_left_margin
5360   ;
5361   return 0;
5362 }
5363 _ACEOF
5364 rm -f conftest.$ac_objext
5365 if { (eval echo "$as_me:5365: \"$ac_compile\"") >&5
5366   (eval $ac_compile) 2>&5
5367   ac_status=$?
5368   echo "$as_me:5368: \$? = $ac_status" >&5
5369   (exit $ac_status); } &&
5370          { ac_try='test -s conftest.$ac_objext'
5371   { (eval echo "$as_me:5371: \"$ac_try\"") >&5
5372   (eval $ac_try) 2>&5
5373   ac_status=$?
5374   echo "$as_me:5374: \$? = $ac_status" >&5
5375   (exit $ac_status); }; }; then
5376
5377         cf_cv_term_header="$cf_test"
5378 else
5379   echo "$as_me: failed program was:" >&5
5380 cat conftest.$ac_ext >&5
5381
5382         cf_cv_term_header=unknown
5383
5384 fi
5385 rm -f conftest.$ac_objext conftest.$ac_ext
5386         test "$cf_cv_term_header" != unknown && break
5387 done
5388
5389 fi
5390 echo "$as_me:5390: result: $cf_cv_term_header" >&5
5391 echo "${ECHO_T}$cf_cv_term_header" >&6
5392
5393 # Set definitions to allow ifdef'ing to accommodate subdirectories
5394
5395 case $cf_cv_term_header in
5396 (*term.h)
5397
5398 cat >>confdefs.h <<\EOF
5399 #define HAVE_TERM_H 1
5400 EOF
5401
5402         ;;
5403 esac
5404
5405 case $cf_cv_term_header in
5406 (ncurses/term.h)
5407
5408 cat >>confdefs.h <<\EOF
5409 #define HAVE_NCURSES_TERM_H 1
5410 EOF
5411
5412         ;;
5413 (ncursesw/term.h)
5414
5415 cat >>confdefs.h <<\EOF
5416 #define HAVE_NCURSESW_TERM_H 1
5417 EOF
5418
5419         ;;
5420 esac
5421
5422 echo "$as_me:5422: checking for ncurses version" >&5
5423 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
5424 if test "${cf_cv_ncurses_version+set}" = set; then
5425   echo $ECHO_N "(cached) $ECHO_C" >&6
5426 else
5427
5428         cf_cv_ncurses_version=no
5429         cf_tempfile=out$$
5430         rm -f $cf_tempfile
5431         if test "$cross_compiling" = yes; then
5432
5433         # This will not work if the preprocessor splits the line after the
5434         # Autoconf token.  The 'unproto' program does that.
5435         cat > conftest.$ac_ext <<EOF
5436 #include <${cf_cv_ncurses_header:-curses.h}>
5437 #undef Autoconf
5438 #ifdef NCURSES_VERSION
5439 Autoconf NCURSES_VERSION
5440 #else
5441 #ifdef __NCURSES_H
5442 Autoconf "old"
5443 #endif
5444 ;
5445 #endif
5446 EOF
5447         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
5448         { (eval echo "$as_me:5448: \"$cf_try\"") >&5
5449   (eval $cf_try) 2>&5
5450   ac_status=$?
5451   echo "$as_me:5451: \$? = $ac_status" >&5
5452   (exit $ac_status); }
5453         if test -f conftest.out ; then
5454                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
5455                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
5456                 rm -f conftest.out
5457         fi
5458
5459 else
5460   cat >conftest.$ac_ext <<_ACEOF
5461 #line 5461 "configure"
5462 #include "confdefs.h"
5463
5464 #include <${cf_cv_ncurses_header:-curses.h}>
5465 #include <stdio.h>
5466 int main(void)
5467 {
5468         FILE *fp = fopen("$cf_tempfile", "w");
5469 #ifdef NCURSES_VERSION
5470 # ifdef NCURSES_VERSION_PATCH
5471         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
5472 # else
5473         fprintf(fp, "%s\n", NCURSES_VERSION);
5474 # endif
5475 #else
5476 # ifdef __NCURSES_H
5477         fprintf(fp, "old\n");
5478 # else
5479         make an error
5480 # endif
5481 #endif
5482         ${cf_cv_main_return:-return}(0);
5483 }
5484 _ACEOF
5485 rm -f conftest$ac_exeext
5486 if { (eval echo "$as_me:5486: \"$ac_link\"") >&5
5487   (eval $ac_link) 2>&5
5488   ac_status=$?
5489   echo "$as_me:5489: \$? = $ac_status" >&5
5490   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
5491   { (eval echo "$as_me:5491: \"$ac_try\"") >&5
5492   (eval $ac_try) 2>&5
5493   ac_status=$?
5494   echo "$as_me:5494: \$? = $ac_status" >&5
5495   (exit $ac_status); }; }; then
5496
5497         cf_cv_ncurses_version=`cat $cf_tempfile`
5498 else
5499   echo "$as_me: program exited with status $ac_status" >&5
5500 echo "$as_me: failed program was:" >&5
5501 cat conftest.$ac_ext >&5
5502 fi
5503 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
5504 fi
5505         rm -f $cf_tempfile
5506
5507 fi
5508 echo "$as_me:5508: result: $cf_cv_ncurses_version" >&5
5509 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
5510 test "$cf_cv_ncurses_version" = no ||
5511 cat >>confdefs.h <<\EOF
5512 #define NCURSES 1
5513 EOF
5514
5515 echo "$as_me:5515: checking if we have identified curses libraries" >&5
5516 echo $ECHO_N "checking if we have identified curses libraries... $ECHO_C" >&6
5517 cat >conftest.$ac_ext <<_ACEOF
5518 #line 5518 "configure"
5519 #include "confdefs.h"
5520 #include <${cf_cv_ncurses_header:-curses.h}>
5521 int
5522 main (void)
5523 {
5524 initscr(); tgoto("?", 0,0)
5525   ;
5526   return 0;
5527 }
5528 _ACEOF
5529 rm -f conftest.$ac_objext conftest$ac_exeext
5530 if { (eval echo "$as_me:5530: \"$ac_link\"") >&5
5531   (eval $ac_link) 2>&5
5532   ac_status=$?
5533   echo "$as_me:5533: \$? = $ac_status" >&5
5534   (exit $ac_status); } &&
5535          { ac_try='test -s conftest$ac_exeext'
5536   { (eval echo "$as_me:5536: \"$ac_try\"") >&5
5537   (eval $ac_try) 2>&5
5538   ac_status=$?
5539   echo "$as_me:5539: \$? = $ac_status" >&5
5540   (exit $ac_status); }; }; then
5541   cf_result=yes
5542 else
5543   echo "$as_me: failed program was:" >&5
5544 cat conftest.$ac_ext >&5
5545 cf_result=no
5546 fi
5547 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5548 echo "$as_me:5548: result: $cf_result" >&5
5549 echo "${ECHO_T}$cf_result" >&6
5550
5551 if test "$cf_result" = no ; then
5552 case $host_os in
5553 (freebsd*)
5554         echo "$as_me:5554: checking for tgoto in -lmytinfo" >&5
5555 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
5556 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
5557   echo $ECHO_N "(cached) $ECHO_C" >&6
5558 else
5559   ac_check_lib_save_LIBS=$LIBS
5560 LIBS="-lmytinfo  $LIBS"
5561 cat >conftest.$ac_ext <<_ACEOF
5562 #line 5562 "configure"
5563 #include "confdefs.h"
5564
5565 /* Override any gcc2 internal prototype to avoid an error.  */
5566 #ifdef __cplusplus
5567 extern "C"
5568 #endif
5569 /* We use char because int might match the return type of a gcc2
5570    builtin and then its argument prototype would still apply.  */
5571 char tgoto ();
5572 int
5573 main (void)
5574 {
5575 tgoto ();
5576   ;
5577   return 0;
5578 }
5579 _ACEOF
5580 rm -f conftest.$ac_objext conftest$ac_exeext
5581 if { (eval echo "$as_me:5581: \"$ac_link\"") >&5
5582   (eval $ac_link) 2>&5
5583   ac_status=$?
5584   echo "$as_me:5584: \$? = $ac_status" >&5
5585   (exit $ac_status); } &&
5586          { ac_try='test -s conftest$ac_exeext'
5587   { (eval echo "$as_me:5587: \"$ac_try\"") >&5
5588   (eval $ac_try) 2>&5
5589   ac_status=$?
5590   echo "$as_me:5590: \$? = $ac_status" >&5
5591   (exit $ac_status); }; }; then
5592   ac_cv_lib_mytinfo_tgoto=yes
5593 else
5594   echo "$as_me: failed program was:" >&5
5595 cat conftest.$ac_ext >&5
5596 ac_cv_lib_mytinfo_tgoto=no
5597 fi
5598 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5599 LIBS=$ac_check_lib_save_LIBS
5600 fi
5601 echo "$as_me:5601: result: $ac_cv_lib_mytinfo_tgoto" >&5
5602 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
5603 if test $ac_cv_lib_mytinfo_tgoto = yes; then
5604
5605 cf_add_libs="-lmytinfo"
5606 # Filter out duplicates - this happens with badly-designed ".pc" files...
5607 for cf_add_1lib in $LIBS
5608 do
5609         for cf_add_2lib in $cf_add_libs
5610         do
5611                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5612                 then
5613                         cf_add_1lib=
5614                         break
5615                 fi
5616         done
5617         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5618 done
5619 LIBS="$cf_add_libs"
5620
5621 fi
5622
5623         ;;
5624 (hpux10.*)
5625         # Looking at HPUX 10.20, the Hcurses library is the oldest (1997), cur_colr
5626         # next (1998), and xcurses "newer" (2000).  There is no header file for
5627         # Hcurses; the subdirectory curses_colr has the headers (curses.h and
5628         # term.h) for cur_colr
5629         if test "x$cf_cv_screen" = "xcurses_colr"
5630         then
5631                 echo "$as_me:5631: checking for initscr in -lcur_colr" >&5
5632 echo $ECHO_N "checking for initscr in -lcur_colr... $ECHO_C" >&6
5633 if test "${ac_cv_lib_cur_colr_initscr+set}" = set; then
5634   echo $ECHO_N "(cached) $ECHO_C" >&6
5635 else
5636   ac_check_lib_save_LIBS=$LIBS
5637 LIBS="-lcur_colr  $LIBS"
5638 cat >conftest.$ac_ext <<_ACEOF
5639 #line 5639 "configure"
5640 #include "confdefs.h"
5641
5642 /* Override any gcc2 internal prototype to avoid an error.  */
5643 #ifdef __cplusplus
5644 extern "C"
5645 #endif
5646 /* We use char because int might match the return type of a gcc2
5647    builtin and then its argument prototype would still apply.  */
5648 char initscr ();
5649 int
5650 main (void)
5651 {
5652 initscr ();
5653   ;
5654   return 0;
5655 }
5656 _ACEOF
5657 rm -f conftest.$ac_objext conftest$ac_exeext
5658 if { (eval echo "$as_me:5658: \"$ac_link\"") >&5
5659   (eval $ac_link) 2>&5
5660   ac_status=$?
5661   echo "$as_me:5661: \$? = $ac_status" >&5
5662   (exit $ac_status); } &&
5663          { ac_try='test -s conftest$ac_exeext'
5664   { (eval echo "$as_me:5664: \"$ac_try\"") >&5
5665   (eval $ac_try) 2>&5
5666   ac_status=$?
5667   echo "$as_me:5667: \$? = $ac_status" >&5
5668   (exit $ac_status); }; }; then
5669   ac_cv_lib_cur_colr_initscr=yes
5670 else
5671   echo "$as_me: failed program was:" >&5
5672 cat conftest.$ac_ext >&5
5673 ac_cv_lib_cur_colr_initscr=no
5674 fi
5675 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5676 LIBS=$ac_check_lib_save_LIBS
5677 fi
5678 echo "$as_me:5678: result: $ac_cv_lib_cur_colr_initscr" >&5
5679 echo "${ECHO_T}$ac_cv_lib_cur_colr_initscr" >&6
5680 if test $ac_cv_lib_cur_colr_initscr = yes; then
5681
5682 cf_add_libs="-lcur_colr"
5683 # Filter out duplicates - this happens with badly-designed ".pc" files...
5684 for cf_add_1lib in $LIBS
5685 do
5686         for cf_add_2lib in $cf_add_libs
5687         do
5688                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5689                 then
5690                         cf_add_1lib=
5691                         break
5692                 fi
5693         done
5694         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5695 done
5696 LIBS="$cf_add_libs"
5697
5698                         ac_cv_func_initscr=yes
5699
5700 else
5701
5702                 echo "$as_me:5702: checking for initscr in -lHcurses" >&5
5703 echo $ECHO_N "checking for initscr in -lHcurses... $ECHO_C" >&6
5704 if test "${ac_cv_lib_Hcurses_initscr+set}" = set; then
5705   echo $ECHO_N "(cached) $ECHO_C" >&6
5706 else
5707   ac_check_lib_save_LIBS=$LIBS
5708 LIBS="-lHcurses  $LIBS"
5709 cat >conftest.$ac_ext <<_ACEOF
5710 #line 5710 "configure"
5711 #include "confdefs.h"
5712
5713 /* Override any gcc2 internal prototype to avoid an error.  */
5714 #ifdef __cplusplus
5715 extern "C"
5716 #endif
5717 /* We use char because int might match the return type of a gcc2
5718    builtin and then its argument prototype would still apply.  */
5719 char initscr ();
5720 int
5721 main (void)
5722 {
5723 initscr ();
5724   ;
5725   return 0;
5726 }
5727 _ACEOF
5728 rm -f conftest.$ac_objext conftest$ac_exeext
5729 if { (eval echo "$as_me:5729: \"$ac_link\"") >&5
5730   (eval $ac_link) 2>&5
5731   ac_status=$?
5732   echo "$as_me:5732: \$? = $ac_status" >&5
5733   (exit $ac_status); } &&
5734          { ac_try='test -s conftest$ac_exeext'
5735   { (eval echo "$as_me:5735: \"$ac_try\"") >&5
5736   (eval $ac_try) 2>&5
5737   ac_status=$?
5738   echo "$as_me:5738: \$? = $ac_status" >&5
5739   (exit $ac_status); }; }; then
5740   ac_cv_lib_Hcurses_initscr=yes
5741 else
5742   echo "$as_me: failed program was:" >&5
5743 cat conftest.$ac_ext >&5
5744 ac_cv_lib_Hcurses_initscr=no
5745 fi
5746 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5747 LIBS=$ac_check_lib_save_LIBS
5748 fi
5749 echo "$as_me:5749: result: $ac_cv_lib_Hcurses_initscr" >&5
5750 echo "${ECHO_T}$ac_cv_lib_Hcurses_initscr" >&6
5751 if test $ac_cv_lib_Hcurses_initscr = yes; then
5752
5753                         # HP's header uses __HP_CURSES, but user claims _HP_CURSES.
5754
5755 cf_add_libs="-lHcurses"
5756 # Filter out duplicates - this happens with badly-designed ".pc" files...
5757 for cf_add_1lib in $LIBS
5758 do
5759         for cf_add_2lib in $cf_add_libs
5760         do
5761                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5762                 then
5763                         cf_add_1lib=
5764                         break
5765                 fi
5766         done
5767         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5768 done
5769 LIBS="$cf_add_libs"
5770
5771                         CPPFLAGS="$CPPFLAGS -D__HP_CURSES -D_HP_CURSES"
5772                         ac_cv_func_initscr=yes
5773
5774 fi
5775
5776 fi
5777
5778         fi
5779         ;;
5780 (linux*)
5781         case `arch 2>/dev/null` in
5782         (x86_64)
5783                 if test -d /lib64
5784                 then
5785
5786 if test -n "/lib64" ; then
5787         for cf_add_libdir in /lib64
5788         do
5789                 if test $cf_add_libdir = /usr/lib ; then
5790                         :
5791                 elif test -d $cf_add_libdir
5792                 then
5793                         cf_have_libdir=no
5794                         if test -n "$LDFLAGS$LIBS" ; then
5795                                 # a loop is needed to ensure we can add subdirs of existing dirs
5796                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
5797                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5798                                                 cf_have_libdir=yes; break
5799                                         fi
5800                                 done
5801                         fi
5802                         if test "$cf_have_libdir" = no ; then
5803                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5804
5805 echo "${as_me:-configure}:5805: testing adding $cf_add_libdir to library-path ..." 1>&5
5806
5807                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5808                         fi
5809                 fi
5810         done
5811 fi
5812
5813                 else
5814
5815 if test -n "/lib" ; then
5816         for cf_add_libdir in /lib
5817         do
5818                 if test $cf_add_libdir = /usr/lib ; then
5819                         :
5820                 elif test -d $cf_add_libdir
5821                 then
5822                         cf_have_libdir=no
5823                         if test -n "$LDFLAGS$LIBS" ; then
5824                                 # a loop is needed to ensure we can add subdirs of existing dirs
5825                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
5826                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5827                                                 cf_have_libdir=yes; break
5828                                         fi
5829                                 done
5830                         fi
5831                         if test "$cf_have_libdir" = no ; then
5832                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5833
5834 echo "${as_me:-configure}:5834: testing adding $cf_add_libdir to library-path ..." 1>&5
5835
5836                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5837                         fi
5838                 fi
5839         done
5840 fi
5841
5842                 fi
5843                 ;;
5844         (*)
5845
5846 if test -n "/lib" ; then
5847         for cf_add_libdir in /lib
5848         do
5849                 if test $cf_add_libdir = /usr/lib ; then
5850                         :
5851                 elif test -d $cf_add_libdir
5852                 then
5853                         cf_have_libdir=no
5854                         if test -n "$LDFLAGS$LIBS" ; then
5855                                 # a loop is needed to ensure we can add subdirs of existing dirs
5856                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
5857                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5858                                                 cf_have_libdir=yes; break
5859                                         fi
5860                                 done
5861                         fi
5862                         if test "$cf_have_libdir" = no ; then
5863                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5864
5865 echo "${as_me:-configure}:5865: testing adding $cf_add_libdir to library-path ..." 1>&5
5866
5867                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5868                         fi
5869                 fi
5870         done
5871 fi
5872
5873                 ;;
5874         esac
5875         ;;
5876 (sunos3*|sunos4*)
5877         if test "x$cf_cv_screen" = "xcurses_5lib"
5878         then
5879                 if test -d /usr/5lib ; then
5880
5881 if test -n "/usr/5lib" ; then
5882         for cf_add_libdir in /usr/5lib
5883         do
5884                 if test $cf_add_libdir = /usr/lib ; then
5885                         :
5886                 elif test -d $cf_add_libdir
5887                 then
5888                         cf_have_libdir=no
5889                         if test -n "$LDFLAGS$LIBS" ; then
5890                                 # a loop is needed to ensure we can add subdirs of existing dirs
5891                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
5892                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5893                                                 cf_have_libdir=yes; break
5894                                         fi
5895                                 done
5896                         fi
5897                         if test "$cf_have_libdir" = no ; then
5898                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5899
5900 echo "${as_me:-configure}:5900: testing adding $cf_add_libdir to library-path ..." 1>&5
5901
5902                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5903                         fi
5904                 fi
5905         done
5906 fi
5907
5908 cf_add_libs="-lcurses -ltermcap"
5909 # Filter out duplicates - this happens with badly-designed ".pc" files...
5910 for cf_add_1lib in $LIBS
5911 do
5912         for cf_add_2lib in $cf_add_libs
5913         do
5914                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5915                 then
5916                         cf_add_1lib=
5917                         break
5918                 fi
5919         done
5920         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5921 done
5922 LIBS="$cf_add_libs"
5923
5924                 fi
5925         fi
5926         ac_cv_func_initscr=yes
5927         ;;
5928 esac
5929
5930 if test ".$ac_cv_func_initscr" != .yes ; then
5931         cf_save_LIBS="$LIBS"
5932
5933         if test ".${cf_cv_ncurses_version:-no}" != .no
5934         then
5935                 cf_check_list="ncurses curses cursesX"
5936         else
5937                 cf_check_list="cursesX curses ncurses"
5938         fi
5939
5940         # Check for library containing tgoto.  Do this before curses library
5941         # because it may be needed to link the test-case for initscr.
5942         if test "x$cf_term_lib" = x
5943         then
5944                 echo "$as_me:5944: checking for tgoto" >&5
5945 echo $ECHO_N "checking for tgoto... $ECHO_C" >&6
5946 if test "${ac_cv_func_tgoto+set}" = set; then
5947   echo $ECHO_N "(cached) $ECHO_C" >&6
5948 else
5949   cat >conftest.$ac_ext <<_ACEOF
5950 #line 5950 "configure"
5951 #include "confdefs.h"
5952 /* System header to define __stub macros and hopefully few prototypes,
5953     which can conflict with char tgoto (); below.  */
5954 #include <assert.h>
5955 /* Override any gcc2 internal prototype to avoid an error.  */
5956 #ifdef __cplusplus
5957 extern "C"
5958 #endif
5959 /* We use char because int might match the return type of a gcc2
5960    builtin and then its argument prototype would still apply.  */
5961 char tgoto ();
5962 char (*f) ();
5963
5964 int
5965 main (void)
5966 {
5967 /* The GNU C library defines this for functions which it implements
5968     to always fail with ENOSYS.  Some functions are actually named
5969     something starting with __ and the normal name is an alias.  */
5970 #if defined (__stub_tgoto) || defined (__stub___tgoto)
5971 choke me
5972 #else
5973 f = tgoto; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
5974 #endif
5975
5976   ;
5977   return 0;
5978 }
5979 _ACEOF
5980 rm -f conftest.$ac_objext conftest$ac_exeext
5981 if { (eval echo "$as_me:5981: \"$ac_link\"") >&5
5982   (eval $ac_link) 2>&5
5983   ac_status=$?
5984   echo "$as_me:5984: \$? = $ac_status" >&5
5985   (exit $ac_status); } &&
5986          { ac_try='test -s conftest$ac_exeext'
5987   { (eval echo "$as_me:5987: \"$ac_try\"") >&5
5988   (eval $ac_try) 2>&5
5989   ac_status=$?
5990   echo "$as_me:5990: \$? = $ac_status" >&5
5991   (exit $ac_status); }; }; then
5992   ac_cv_func_tgoto=yes
5993 else
5994   echo "$as_me: failed program was:" >&5
5995 cat conftest.$ac_ext >&5
5996 ac_cv_func_tgoto=no
5997 fi
5998 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5999 fi
6000 echo "$as_me:6000: result: $ac_cv_func_tgoto" >&5
6001 echo "${ECHO_T}$ac_cv_func_tgoto" >&6
6002 if test $ac_cv_func_tgoto = yes; then
6003   cf_term_lib=predefined
6004 else
6005
6006                         for cf_term_lib in $cf_check_list otermcap termcap tinfo termlib unknown
6007                         do
6008                                 as_ac_Lib=`echo "ac_cv_lib_$cf_term_lib''_tgoto" | $as_tr_sh`
6009 echo "$as_me:6009: checking for tgoto in -l$cf_term_lib" >&5
6010 echo $ECHO_N "checking for tgoto in -l$cf_term_lib... $ECHO_C" >&6
6011 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
6012   echo $ECHO_N "(cached) $ECHO_C" >&6
6013 else
6014   ac_check_lib_save_LIBS=$LIBS
6015 LIBS="-l$cf_term_lib  $LIBS"
6016 cat >conftest.$ac_ext <<_ACEOF
6017 #line 6017 "configure"
6018 #include "confdefs.h"
6019
6020 /* Override any gcc2 internal prototype to avoid an error.  */
6021 #ifdef __cplusplus
6022 extern "C"
6023 #endif
6024 /* We use char because int might match the return type of a gcc2
6025    builtin and then its argument prototype would still apply.  */
6026 char tgoto ();
6027 int
6028 main (void)
6029 {
6030 tgoto ();
6031   ;
6032   return 0;
6033 }
6034 _ACEOF
6035 rm -f conftest.$ac_objext conftest$ac_exeext
6036 if { (eval echo "$as_me:6036: \"$ac_link\"") >&5
6037   (eval $ac_link) 2>&5
6038   ac_status=$?
6039   echo "$as_me:6039: \$? = $ac_status" >&5
6040   (exit $ac_status); } &&
6041          { ac_try='test -s conftest$ac_exeext'
6042   { (eval echo "$as_me:6042: \"$ac_try\"") >&5
6043   (eval $ac_try) 2>&5
6044   ac_status=$?
6045   echo "$as_me:6045: \$? = $ac_status" >&5
6046   (exit $ac_status); }; }; then
6047   eval "$as_ac_Lib=yes"
6048 else
6049   echo "$as_me: failed program was:" >&5
6050 cat conftest.$ac_ext >&5
6051 eval "$as_ac_Lib=no"
6052 fi
6053 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6054 LIBS=$ac_check_lib_save_LIBS
6055 fi
6056 echo "$as_me:6056: result: `eval echo '${'$as_ac_Lib'}'`" >&5
6057 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
6058 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
6059
6060                                         : ${cf_nculib_root:=$cf_term_lib}
6061                                         break
6062
6063 fi
6064
6065                         done
6066
6067 fi
6068
6069         fi
6070
6071         # Check for library containing initscr
6072         test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS"
6073         if test "x$cf_curs_lib" = x
6074         then
6075                 for cf_curs_lib in $cf_check_list xcurses jcurses pdcurses unknown
6076                 do
6077                         LIBS="-l$cf_curs_lib $cf_save_LIBS"
6078                         if test "$cf_term_lib" = unknown || test "$cf_term_lib" = "$cf_curs_lib" ; then
6079                                 echo "$as_me:6079: checking if we can link with $cf_curs_lib library" >&5
6080 echo $ECHO_N "checking if we can link with $cf_curs_lib library... $ECHO_C" >&6
6081                                 cat >conftest.$ac_ext <<_ACEOF
6082 #line 6082 "configure"
6083 #include "confdefs.h"
6084 #include <${cf_cv_ncurses_header:-curses.h}>
6085 int
6086 main (void)
6087 {
6088 initscr()
6089   ;
6090   return 0;
6091 }
6092 _ACEOF
6093 rm -f conftest.$ac_objext conftest$ac_exeext
6094 if { (eval echo "$as_me:6094: \"$ac_link\"") >&5
6095   (eval $ac_link) 2>&5
6096   ac_status=$?
6097   echo "$as_me:6097: \$? = $ac_status" >&5
6098   (exit $ac_status); } &&
6099          { ac_try='test -s conftest$ac_exeext'
6100   { (eval echo "$as_me:6100: \"$ac_try\"") >&5
6101   (eval $ac_try) 2>&5
6102   ac_status=$?
6103   echo "$as_me:6103: \$? = $ac_status" >&5
6104   (exit $ac_status); }; }; then
6105   cf_result=yes
6106 else
6107   echo "$as_me: failed program was:" >&5
6108 cat conftest.$ac_ext >&5
6109 cf_result=no
6110 fi
6111 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6112                                 echo "$as_me:6112: result: $cf_result" >&5
6113 echo "${ECHO_T}$cf_result" >&6
6114                                 test $cf_result = yes && break
6115                         elif test "$cf_curs_lib" = "$cf_term_lib" ; then
6116                                 cf_result=no
6117                         elif test "$cf_term_lib" != predefined ; then
6118                                 echo "$as_me:6118: checking if we need both $cf_curs_lib and $cf_term_lib libraries" >&5
6119 echo $ECHO_N "checking if we need both $cf_curs_lib and $cf_term_lib libraries... $ECHO_C" >&6
6120                                 cat >conftest.$ac_ext <<_ACEOF
6121 #line 6121 "configure"
6122 #include "confdefs.h"
6123 #include <${cf_cv_ncurses_header:-curses.h}>
6124 int
6125 main (void)
6126 {
6127 initscr(); tgoto((char *)0, 0, 0);
6128   ;
6129   return 0;
6130 }
6131 _ACEOF
6132 rm -f conftest.$ac_objext conftest$ac_exeext
6133 if { (eval echo "$as_me:6133: \"$ac_link\"") >&5
6134   (eval $ac_link) 2>&5
6135   ac_status=$?
6136   echo "$as_me:6136: \$? = $ac_status" >&5
6137   (exit $ac_status); } &&
6138          { ac_try='test -s conftest$ac_exeext'
6139   { (eval echo "$as_me:6139: \"$ac_try\"") >&5
6140   (eval $ac_try) 2>&5
6141   ac_status=$?
6142   echo "$as_me:6142: \$? = $ac_status" >&5
6143   (exit $ac_status); }; }; then
6144   cf_result=no
6145 else
6146   echo "$as_me: failed program was:" >&5
6147 cat conftest.$ac_ext >&5
6148
6149                                         LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
6150                                         cat >conftest.$ac_ext <<_ACEOF
6151 #line 6151 "configure"
6152 #include "confdefs.h"
6153 #include <${cf_cv_ncurses_header:-curses.h}>
6154 int
6155 main (void)
6156 {
6157 initscr()
6158   ;
6159   return 0;
6160 }
6161 _ACEOF
6162 rm -f conftest.$ac_objext conftest$ac_exeext
6163 if { (eval echo "$as_me:6163: \"$ac_link\"") >&5
6164   (eval $ac_link) 2>&5
6165   ac_status=$?
6166   echo "$as_me:6166: \$? = $ac_status" >&5
6167   (exit $ac_status); } &&
6168          { ac_try='test -s conftest$ac_exeext'
6169   { (eval echo "$as_me:6169: \"$ac_try\"") >&5
6170   (eval $ac_try) 2>&5
6171   ac_status=$?
6172   echo "$as_me:6172: \$? = $ac_status" >&5
6173   (exit $ac_status); }; }; then
6174   cf_result=yes
6175 else
6176   echo "$as_me: failed program was:" >&5
6177 cat conftest.$ac_ext >&5
6178 cf_result=error
6179 fi
6180 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6181
6182 fi
6183 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6184                                 echo "$as_me:6184: result: $cf_result" >&5
6185 echo "${ECHO_T}$cf_result" >&6
6186                                 test $cf_result != error && break
6187                         fi
6188                 done
6189         fi
6190         test $cf_curs_lib = unknown && { { echo "$as_me:6190: error: no curses library found" >&5
6191 echo "$as_me: error: no curses library found" >&2;}
6192    { (exit 1); exit 1; }; }
6193 fi
6194 fi
6195
6196         ;;
6197 (ncursesw*)
6198
6199 echo "$as_me:6199: checking for multibyte character support" >&5
6200 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
6201 if test "${cf_cv_utf8_lib+set}" = set; then
6202   echo $ECHO_N "(cached) $ECHO_C" >&6
6203 else
6204
6205         cf_save_LIBS="$LIBS"
6206         cat >conftest.$ac_ext <<_ACEOF
6207 #line 6207 "configure"
6208 #include "confdefs.h"
6209
6210 #include <stdlib.h>
6211 int
6212 main (void)
6213 {
6214 putwc(0,0);
6215   ;
6216   return 0;
6217 }
6218 _ACEOF
6219 rm -f conftest.$ac_objext conftest$ac_exeext
6220 if { (eval echo "$as_me:6220: \"$ac_link\"") >&5
6221   (eval $ac_link) 2>&5
6222   ac_status=$?
6223   echo "$as_me:6223: \$? = $ac_status" >&5
6224   (exit $ac_status); } &&
6225          { ac_try='test -s conftest$ac_exeext'
6226   { (eval echo "$as_me:6226: \"$ac_try\"") >&5
6227   (eval $ac_try) 2>&5
6228   ac_status=$?
6229   echo "$as_me:6229: \$? = $ac_status" >&5
6230   (exit $ac_status); }; }; then
6231   cf_cv_utf8_lib=yes
6232 else
6233   echo "$as_me: failed program was:" >&5
6234 cat conftest.$ac_ext >&5
6235
6236 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
6237 # will be set on completion of the AC_TRY_LINK below.
6238 cf_cv_header_path_utf8=
6239 cf_cv_library_path_utf8=
6240
6241 echo "${as_me:-configure}:6241: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
6242
6243 cf_save_LIBS="$LIBS"
6244
6245 cat >conftest.$ac_ext <<_ACEOF
6246 #line 6246 "configure"
6247 #include "confdefs.h"
6248
6249 #include <libutf8.h>
6250 int
6251 main (void)
6252 {
6253 putwc(0,0);
6254   ;
6255   return 0;
6256 }
6257 _ACEOF
6258 rm -f conftest.$ac_objext conftest$ac_exeext
6259 if { (eval echo "$as_me:6259: \"$ac_link\"") >&5
6260   (eval $ac_link) 2>&5
6261   ac_status=$?
6262   echo "$as_me:6262: \$? = $ac_status" >&5
6263   (exit $ac_status); } &&
6264          { ac_try='test -s conftest$ac_exeext'
6265   { (eval echo "$as_me:6265: \"$ac_try\"") >&5
6266   (eval $ac_try) 2>&5
6267   ac_status=$?
6268   echo "$as_me:6268: \$? = $ac_status" >&5
6269   (exit $ac_status); }; }; then
6270
6271         cf_cv_find_linkage_utf8=yes
6272         cf_cv_header_path_utf8=/usr/include
6273         cf_cv_library_path_utf8=/usr/lib
6274
6275 else
6276   echo "$as_me: failed program was:" >&5
6277 cat conftest.$ac_ext >&5
6278
6279 LIBS="-lutf8  $cf_save_LIBS"
6280
6281 cat >conftest.$ac_ext <<_ACEOF
6282 #line 6282 "configure"
6283 #include "confdefs.h"
6284
6285 #include <libutf8.h>
6286 int
6287 main (void)
6288 {
6289 putwc(0,0);
6290   ;
6291   return 0;
6292 }
6293 _ACEOF
6294 rm -f conftest.$ac_objext conftest$ac_exeext
6295 if { (eval echo "$as_me:6295: \"$ac_link\"") >&5
6296   (eval $ac_link) 2>&5
6297   ac_status=$?
6298   echo "$as_me:6298: \$? = $ac_status" >&5
6299   (exit $ac_status); } &&
6300          { ac_try='test -s conftest$ac_exeext'
6301   { (eval echo "$as_me:6301: \"$ac_try\"") >&5
6302   (eval $ac_try) 2>&5
6303   ac_status=$?
6304   echo "$as_me:6304: \$? = $ac_status" >&5
6305   (exit $ac_status); }; }; then
6306
6307         cf_cv_find_linkage_utf8=yes
6308         cf_cv_header_path_utf8=/usr/include
6309         cf_cv_library_path_utf8=/usr/lib
6310         cf_cv_library_file_utf8="-lutf8"
6311
6312 else
6313   echo "$as_me: failed program was:" >&5
6314 cat conftest.$ac_ext >&5
6315
6316         cf_cv_find_linkage_utf8=no
6317         LIBS="$cf_save_LIBS"
6318
6319         test -n "$verbose" && echo "    find linkage for utf8 library" 1>&6
6320
6321 echo "${as_me:-configure}:6321: testing find linkage for utf8 library ..." 1>&5
6322
6323 echo "${as_me:-configure}:6323: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
6324
6325         cf_save_CPPFLAGS="$CPPFLAGS"
6326         cf_test_CPPFLAGS="$CPPFLAGS"
6327
6328 cf_search=
6329
6330 # collect the current set of include-directories from compiler flags
6331 cf_header_path_list=""
6332 if test -n "${CFLAGS}${CPPFLAGS}" ; then
6333         for cf_header_path in $CPPFLAGS $CFLAGS
6334         do
6335                 case $cf_header_path in
6336                 (-I*)
6337                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
6338
6339 test "x$cf_header_path" != "xNONE" && \
6340 test -d "$cf_header_path" && \
6341  {
6342         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
6343         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
6344         test -d $cf_header_path/include/utf8 &&       cf_search="$cf_search $cf_header_path/include/utf8"
6345         test -d $cf_header_path/include/utf8/include &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
6346         test -d $cf_header_path/utf8/include &&       cf_search="$cf_search $cf_header_path/utf8/include"
6347         test -d $cf_header_path/utf8/include/utf8 &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
6348 }
6349
6350                         cf_header_path_list="$cf_header_path_list $cf_search"
6351                         ;;
6352                 esac
6353         done
6354 fi
6355
6356 # add the variations for the package we are looking for
6357
6358 cf_search=
6359
6360 test "x$prefix" != "xNONE" && \
6361 test -d "$prefix" && \
6362  {
6363         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
6364         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
6365         test -d $prefix/include/utf8 &&       cf_search="$cf_search $prefix/include/utf8"
6366         test -d $prefix/include/utf8/include &&    cf_search="$cf_search $prefix/include/utf8/include"
6367         test -d $prefix/utf8/include &&       cf_search="$cf_search $prefix/utf8/include"
6368         test -d $prefix/utf8/include/utf8 &&    cf_search="$cf_search $prefix/utf8/include/utf8"
6369 }
6370
6371 for cf_subdir_prefix in \
6372         /usr \
6373         /usr/local \
6374         /usr/pkg \
6375         /opt \
6376         /opt/local \
6377         $HOME
6378 do
6379
6380 test "x$cf_subdir_prefix" != "x$prefix" && \
6381 test -d "$cf_subdir_prefix" && \
6382 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
6383         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
6384         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
6385         test -d $cf_subdir_prefix/include/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/include/utf8"
6386         test -d $cf_subdir_prefix/include/utf8/include &&    cf_search="$cf_search $cf_subdir_prefix/include/utf8/include"
6387         test -d $cf_subdir_prefix/utf8/include &&       cf_search="$cf_search $cf_subdir_prefix/utf8/include"
6388         test -d $cf_subdir_prefix/utf8/include/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/include/utf8"
6389 }
6390
6391 done
6392
6393 test "$includedir" != NONE && \
6394 test "$includedir" != "/usr/include" && \
6395 test -d "$includedir" && {
6396         test -d $includedir &&    cf_search="$cf_search $includedir"
6397         test -d $includedir/utf8 && cf_search="$cf_search $includedir/utf8"
6398 }
6399
6400 test "$oldincludedir" != NONE && \
6401 test "$oldincludedir" != "/usr/include" && \
6402 test -d "$oldincludedir" && {
6403         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
6404         test -d $oldincludedir/utf8 && cf_search="$cf_search $oldincludedir/utf8"
6405 }
6406
6407 cf_search="$cf_search $cf_header_path_list"
6408
6409         for cf_cv_header_path_utf8 in $cf_search
6410         do
6411                 if test -d $cf_cv_header_path_utf8 ; then
6412                         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
6413
6414 echo "${as_me:-configure}:6414: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
6415
6416                         CPPFLAGS="$cf_save_CPPFLAGS -I$cf_cv_header_path_utf8"
6417                         cat >conftest.$ac_ext <<_ACEOF
6418 #line 6418 "configure"
6419 #include "confdefs.h"
6420
6421 #include <libutf8.h>
6422 int
6423 main (void)
6424 {
6425 putwc(0,0);
6426   ;
6427   return 0;
6428 }
6429 _ACEOF
6430 rm -f conftest.$ac_objext
6431 if { (eval echo "$as_me:6431: \"$ac_compile\"") >&5
6432   (eval $ac_compile) 2>&5
6433   ac_status=$?
6434   echo "$as_me:6434: \$? = $ac_status" >&5
6435   (exit $ac_status); } &&
6436          { ac_try='test -s conftest.$ac_objext'
6437   { (eval echo "$as_me:6437: \"$ac_try\"") >&5
6438   (eval $ac_try) 2>&5
6439   ac_status=$?
6440   echo "$as_me:6440: \$? = $ac_status" >&5
6441   (exit $ac_status); }; }; then
6442
6443                                 test -n "$verbose" && echo "    ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
6444
6445 echo "${as_me:-configure}:6445: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
6446
6447                                 cf_cv_find_linkage_utf8=maybe
6448                                 cf_test_CPPFLAGS="$CPPFLAGS"
6449                                 break
6450 else
6451   echo "$as_me: failed program was:" >&5
6452 cat conftest.$ac_ext >&5
6453
6454                                 CPPFLAGS="$cf_save_CPPFLAGS"
6455
6456 fi
6457 rm -f conftest.$ac_objext conftest.$ac_ext
6458                 fi
6459         done
6460
6461         if test "$cf_cv_find_linkage_utf8" = maybe ; then
6462
6463 echo "${as_me:-configure}:6463: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
6464
6465                 cf_save_LIBS="$LIBS"
6466                 cf_save_LDFLAGS="$LDFLAGS"
6467
6468                 if test "$cf_cv_find_linkage_utf8" != yes ; then
6469
6470 cf_search=
6471 cf_library_path_list=""
6472 if test -n "${LDFLAGS}${LIBS}" ; then
6473         for cf_library_path in $LDFLAGS $LIBS
6474         do
6475                 case $cf_library_path in
6476                 (-L*)
6477                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
6478
6479 test "x$cf_library_path" != "xNONE" && \
6480 test -d "$cf_library_path" && \
6481  {
6482         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
6483         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
6484         test -d $cf_library_path/lib/utf8 &&       cf_search="$cf_search $cf_library_path/lib/utf8"
6485         test -d $cf_library_path/lib/utf8/lib &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
6486         test -d $cf_library_path/utf8/lib &&       cf_search="$cf_search $cf_library_path/utf8/lib"
6487         test -d $cf_library_path/utf8/lib/utf8 &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
6488 }
6489
6490                         cf_library_path_list="$cf_library_path_list $cf_search"
6491                         ;;
6492                 esac
6493         done
6494 fi
6495
6496 cf_search=
6497
6498 test "x$prefix" != "xNONE" && \
6499 test -d "$prefix" && \
6500  {
6501         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
6502         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
6503         test -d $prefix/lib/utf8 &&       cf_search="$cf_search $prefix/lib/utf8"
6504         test -d $prefix/lib/utf8/lib &&    cf_search="$cf_search $prefix/lib/utf8/lib"
6505         test -d $prefix/utf8/lib &&       cf_search="$cf_search $prefix/utf8/lib"
6506         test -d $prefix/utf8/lib/utf8 &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
6507 }
6508
6509 for cf_subdir_prefix in \
6510         /usr \
6511         /usr/local \
6512         /usr/pkg \
6513         /opt \
6514         /opt/local \
6515         $HOME
6516 do
6517
6518 test "x$cf_subdir_prefix" != "x$prefix" && \
6519 test -d "$cf_subdir_prefix" && \
6520 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
6521         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
6522         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
6523         test -d $cf_subdir_prefix/lib/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/lib/utf8"
6524         test -d $cf_subdir_prefix/lib/utf8/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/utf8/lib"
6525         test -d $cf_subdir_prefix/utf8/lib &&       cf_search="$cf_search $cf_subdir_prefix/utf8/lib"
6526         test -d $cf_subdir_prefix/utf8/lib/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/lib/utf8"
6527 }
6528
6529 done
6530
6531 cf_search="$cf_library_path_list $cf_search"
6532
6533                         for cf_cv_library_path_utf8 in $cf_search
6534                         do
6535                                 if test -d $cf_cv_library_path_utf8 ; then
6536                                         test -n "$verbose" && echo "    ... testing $cf_cv_library_path_utf8" 1>&6
6537
6538 echo "${as_me:-configure}:6538: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
6539
6540                                         CPPFLAGS="$cf_test_CPPFLAGS"
6541                                         LIBS="-lutf8  $cf_save_LIBS"
6542                                         LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
6543                                         cat >conftest.$ac_ext <<_ACEOF
6544 #line 6544 "configure"
6545 #include "confdefs.h"
6546
6547 #include <libutf8.h>
6548 int
6549 main (void)
6550 {
6551 putwc(0,0);
6552   ;
6553   return 0;
6554 }
6555 _ACEOF
6556 rm -f conftest.$ac_objext conftest$ac_exeext
6557 if { (eval echo "$as_me:6557: \"$ac_link\"") >&5
6558   (eval $ac_link) 2>&5
6559   ac_status=$?
6560   echo "$as_me:6560: \$? = $ac_status" >&5
6561   (exit $ac_status); } &&
6562          { ac_try='test -s conftest$ac_exeext'
6563   { (eval echo "$as_me:6563: \"$ac_try\"") >&5
6564   (eval $ac_try) 2>&5
6565   ac_status=$?
6566   echo "$as_me:6566: \$? = $ac_status" >&5
6567   (exit $ac_status); }; }; then
6568
6569                                         test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
6570
6571 echo "${as_me:-configure}:6571: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
6572
6573                                         cf_cv_find_linkage_utf8=yes
6574                                         cf_cv_library_file_utf8="-lutf8"
6575                                         break
6576 else
6577   echo "$as_me: failed program was:" >&5
6578 cat conftest.$ac_ext >&5
6579
6580                                         CPPFLAGS="$cf_save_CPPFLAGS"
6581                                         LIBS="$cf_save_LIBS"
6582                                         LDFLAGS="$cf_save_LDFLAGS"
6583
6584 fi
6585 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6586                                 fi
6587                         done
6588                         CPPFLAGS="$cf_save_CPPFLAGS"
6589                         LDFLAGS="$cf_save_LDFLAGS"
6590                 fi
6591
6592         else
6593                 cf_cv_find_linkage_utf8=no
6594         fi
6595
6596 fi
6597 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6598
6599 fi
6600 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6601
6602 LIBS="$cf_save_LIBS"
6603
6604 if test "$cf_cv_find_linkage_utf8" = yes ; then
6605 cf_cv_utf8_lib=add-on
6606 else
6607 cf_cv_utf8_lib=no
6608 fi
6609
6610 fi
6611 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6612 fi
6613 echo "$as_me:6613: result: $cf_cv_utf8_lib" >&5
6614 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
6615
6616 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
6617 # ncurses/ncursesw:
6618 if test "$cf_cv_utf8_lib" = "add-on" ; then
6619
6620 cat >>confdefs.h <<\EOF
6621 #define HAVE_LIBUTF8_H 1
6622 EOF
6623
6624 if test -n "$cf_cv_header_path_utf8" ; then
6625   for cf_add_incdir in $cf_cv_header_path_utf8
6626   do
6627         while test $cf_add_incdir != /usr/include
6628         do
6629           if test -d $cf_add_incdir
6630           then
6631                 cf_have_incdir=no
6632                 if test -n "$CFLAGS$CPPFLAGS" ; then
6633                   # a loop is needed to ensure we can add subdirs of existing dirs
6634                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6635                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6636                           cf_have_incdir=yes; break
6637                         fi
6638                   done
6639                 fi
6640
6641                 if test "$cf_have_incdir" = no ; then
6642                   if test "$cf_add_incdir" = /usr/local/include ; then
6643                         if test "$GCC" = yes
6644                         then
6645                           cf_save_CPPFLAGS=$CPPFLAGS
6646                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6647                           cat >conftest.$ac_ext <<_ACEOF
6648 #line 6648 "configure"
6649 #include "confdefs.h"
6650 #include <stdio.h>
6651 int
6652 main (void)
6653 {
6654 printf("Hello")
6655   ;
6656   return 0;
6657 }
6658 _ACEOF
6659 rm -f conftest.$ac_objext
6660 if { (eval echo "$as_me:6660: \"$ac_compile\"") >&5
6661   (eval $ac_compile) 2>&5
6662   ac_status=$?
6663   echo "$as_me:6663: \$? = $ac_status" >&5
6664   (exit $ac_status); } &&
6665          { ac_try='test -s conftest.$ac_objext'
6666   { (eval echo "$as_me:6666: \"$ac_try\"") >&5
6667   (eval $ac_try) 2>&5
6668   ac_status=$?
6669   echo "$as_me:6669: \$? = $ac_status" >&5
6670   (exit $ac_status); }; }; then
6671   :
6672 else
6673   echo "$as_me: failed program was:" >&5
6674 cat conftest.$ac_ext >&5
6675 cf_have_incdir=yes
6676 fi
6677 rm -f conftest.$ac_objext conftest.$ac_ext
6678                           CPPFLAGS=$cf_save_CPPFLAGS
6679                         fi
6680                   fi
6681                 fi
6682
6683                 if test "$cf_have_incdir" = no ; then
6684                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6685
6686 echo "${as_me:-configure}:6686: testing adding $cf_add_incdir to include-path ..." 1>&5
6687
6688                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6689
6690                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6691                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6692                   cf_add_incdir="$cf_top_incdir"
6693                 else
6694                   break
6695                 fi
6696           else
6697                 break
6698           fi
6699         done
6700   done
6701 fi
6702
6703 if test -n "$cf_cv_library_path_utf8" ; then
6704         for cf_add_libdir in $cf_cv_library_path_utf8
6705         do
6706                 if test $cf_add_libdir = /usr/lib ; then
6707                         :
6708                 elif test -d $cf_add_libdir
6709                 then
6710                         cf_have_libdir=no
6711                         if test -n "$LDFLAGS$LIBS" ; then
6712                                 # a loop is needed to ensure we can add subdirs of existing dirs
6713                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6714                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6715                                                 cf_have_libdir=yes; break
6716                                         fi
6717                                 done
6718                         fi
6719                         if test "$cf_have_libdir" = no ; then
6720                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6721
6722 echo "${as_me:-configure}:6722: testing adding $cf_add_libdir to library-path ..." 1>&5
6723
6724                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6725                         fi
6726                 fi
6727         done
6728 fi
6729
6730 cf_add_libs="$cf_cv_library_file_utf8"
6731 # Filter out duplicates - this happens with badly-designed ".pc" files...
6732 for cf_add_1lib in $LIBS
6733 do
6734         for cf_add_2lib in $cf_add_libs
6735         do
6736                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6737                 then
6738                         cf_add_1lib=
6739                         break
6740                 fi
6741         done
6742         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6743 done
6744 LIBS="$cf_add_libs"
6745
6746 fi
6747
6748 cf_ncuconfig_root=$cf_cv_screen
6749 cf_have_ncuconfig=no
6750
6751 if test "x${PKG_CONFIG:=none}" != xnone; then
6752         echo "$as_me:6752: checking pkg-config for $cf_ncuconfig_root" >&5
6753 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
6754         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
6755                 echo "$as_me:6755: result: yes" >&5
6756 echo "${ECHO_T}yes" >&6
6757
6758                 echo "$as_me:6758: checking if the $cf_ncuconfig_root package files work" >&5
6759 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
6760                 cf_have_ncuconfig=unknown
6761
6762                 cf_save_CPPFLAGS="$CPPFLAGS"
6763                 cf_save_LIBS="$LIBS"
6764
6765                 CPPFLAGS="$CPPFLAGS `$PKG_CONFIG --cflags $cf_ncuconfig_root`"
6766
6767 cf_add_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
6768 # Filter out duplicates - this happens with badly-designed ".pc" files...
6769 for cf_add_1lib in $LIBS
6770 do
6771         for cf_add_2lib in $cf_add_libs
6772         do
6773                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6774                 then
6775                         cf_add_1lib=
6776                         break
6777                 fi
6778         done
6779         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6780 done
6781 LIBS="$cf_add_libs"
6782
6783                 cat >conftest.$ac_ext <<_ACEOF
6784 #line 6784 "configure"
6785 #include "confdefs.h"
6786 #include <${cf_cv_ncurses_header:-curses.h}>
6787 int
6788 main (void)
6789 {
6790 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
6791   ;
6792   return 0;
6793 }
6794 _ACEOF
6795 rm -f conftest.$ac_objext conftest$ac_exeext
6796 if { (eval echo "$as_me:6796: \"$ac_link\"") >&5
6797   (eval $ac_link) 2>&5
6798   ac_status=$?
6799   echo "$as_me:6799: \$? = $ac_status" >&5
6800   (exit $ac_status); } &&
6801          { ac_try='test -s conftest$ac_exeext'
6802   { (eval echo "$as_me:6802: \"$ac_try\"") >&5
6803   (eval $ac_try) 2>&5
6804   ac_status=$?
6805   echo "$as_me:6805: \$? = $ac_status" >&5
6806   (exit $ac_status); }; }; then
6807   if test "$cross_compiling" = yes; then
6808   cf_have_ncuconfig=maybe
6809 else
6810   cat >conftest.$ac_ext <<_ACEOF
6811 #line 6811 "configure"
6812 #include "confdefs.h"
6813 #include <${cf_cv_ncurses_header:-curses.h}>
6814                                 int main(void)
6815                                 { char *xx = curses_version(); return (xx == 0); }
6816 _ACEOF
6817 rm -f conftest$ac_exeext
6818 if { (eval echo "$as_me:6818: \"$ac_link\"") >&5
6819   (eval $ac_link) 2>&5
6820   ac_status=$?
6821   echo "$as_me:6821: \$? = $ac_status" >&5
6822   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
6823   { (eval echo "$as_me:6823: \"$ac_try\"") >&5
6824   (eval $ac_try) 2>&5
6825   ac_status=$?
6826   echo "$as_me:6826: \$? = $ac_status" >&5
6827   (exit $ac_status); }; }; then
6828   cf_have_ncuconfig=yes
6829 else
6830   echo "$as_me: program exited with status $ac_status" >&5
6831 echo "$as_me: failed program was:" >&5
6832 cat conftest.$ac_ext >&5
6833 cf_have_ncuconfig=no
6834 fi
6835 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
6836 fi
6837 else
6838   echo "$as_me: failed program was:" >&5
6839 cat conftest.$ac_ext >&5
6840 cf_have_ncuconfig=no
6841 fi
6842 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6843                 echo "$as_me:6843: result: $cf_have_ncuconfig" >&5
6844 echo "${ECHO_T}$cf_have_ncuconfig" >&6
6845                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
6846                 if test "$cf_have_ncuconfig" != "yes"
6847                 then
6848                         CPPFLAGS="$cf_save_CPPFLAGS"
6849                         LIBS="$cf_save_LIBS"
6850                         NCURSES_CONFIG_PKG=none
6851                 else
6852
6853 cat >>confdefs.h <<\EOF
6854 #define NCURSES 1
6855 EOF
6856
6857                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
6858
6859 echo "$as_me:6859: checking for terminfo header" >&5
6860 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
6861 if test "${cf_cv_term_header+set}" = set; then
6862   echo $ECHO_N "(cached) $ECHO_C" >&6
6863 else
6864
6865 case ${cf_cv_ncurses_header} in
6866 (*/ncurses.h|*/ncursesw.h)
6867         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
6868         ;;
6869 (*)
6870         cf_term_header=term.h
6871         ;;
6872 esac
6873
6874 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
6875 do
6876 cat >conftest.$ac_ext <<_ACEOF
6877 #line 6877 "configure"
6878 #include "confdefs.h"
6879 #include <stdio.h>
6880 #include <${cf_cv_ncurses_header:-curses.h}>
6881 #include <$cf_test>
6882
6883 int
6884 main (void)
6885 {
6886 int x = auto_left_margin
6887   ;
6888   return 0;
6889 }
6890 _ACEOF
6891 rm -f conftest.$ac_objext
6892 if { (eval echo "$as_me:6892: \"$ac_compile\"") >&5
6893   (eval $ac_compile) 2>&5
6894   ac_status=$?
6895   echo "$as_me:6895: \$? = $ac_status" >&5
6896   (exit $ac_status); } &&
6897          { ac_try='test -s conftest.$ac_objext'
6898   { (eval echo "$as_me:6898: \"$ac_try\"") >&5
6899   (eval $ac_try) 2>&5
6900   ac_status=$?
6901   echo "$as_me:6901: \$? = $ac_status" >&5
6902   (exit $ac_status); }; }; then
6903
6904         cf_cv_term_header="$cf_test"
6905 else
6906   echo "$as_me: failed program was:" >&5
6907 cat conftest.$ac_ext >&5
6908
6909         cf_cv_term_header=unknown
6910
6911 fi
6912 rm -f conftest.$ac_objext conftest.$ac_ext
6913         test "$cf_cv_term_header" != unknown && break
6914 done
6915
6916 fi
6917 echo "$as_me:6917: result: $cf_cv_term_header" >&5
6918 echo "${ECHO_T}$cf_cv_term_header" >&6
6919
6920 # Set definitions to allow ifdef'ing to accommodate subdirectories
6921
6922 case $cf_cv_term_header in
6923 (*term.h)
6924
6925 cat >>confdefs.h <<\EOF
6926 #define HAVE_TERM_H 1
6927 EOF
6928
6929         ;;
6930 esac
6931
6932 case $cf_cv_term_header in
6933 (ncurses/term.h)
6934
6935 cat >>confdefs.h <<\EOF
6936 #define HAVE_NCURSES_TERM_H 1
6937 EOF
6938
6939         ;;
6940 (ncursesw/term.h)
6941
6942 cat >>confdefs.h <<\EOF
6943 #define HAVE_NCURSESW_TERM_H 1
6944 EOF
6945
6946         ;;
6947 esac
6948
6949                 fi
6950
6951         else
6952                 echo "$as_me:6952: result: no" >&5
6953 echo "${ECHO_T}no" >&6
6954                 NCURSES_CONFIG_PKG=none
6955         fi
6956 else
6957         NCURSES_CONFIG_PKG=none
6958 fi
6959
6960 if test "x$cf_have_ncuconfig" = "xno"; then
6961         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
6962
6963 if test -n "$ac_tool_prefix"; then
6964   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
6965   do
6966     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
6967 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
6968 echo "$as_me:6968: checking for $ac_word" >&5
6969 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
6970 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
6971   echo $ECHO_N "(cached) $ECHO_C" >&6
6972 else
6973   if test -n "$NCURSES_CONFIG"; then
6974   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
6975 else
6976   ac_save_IFS=$IFS; IFS=$ac_path_separator
6977 ac_dummy="$PATH"
6978 for ac_dir in $ac_dummy; do
6979   IFS=$ac_save_IFS
6980   test -z "$ac_dir" && ac_dir=.
6981   $as_executable_p "$ac_dir/$ac_word" || continue
6982 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
6983 echo "$as_me:6983: found $ac_dir/$ac_word" >&5
6984 break
6985 done
6986
6987 fi
6988 fi
6989 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
6990 if test -n "$NCURSES_CONFIG"; then
6991   echo "$as_me:6991: result: $NCURSES_CONFIG" >&5
6992 echo "${ECHO_T}$NCURSES_CONFIG" >&6
6993 else
6994   echo "$as_me:6994: result: no" >&5
6995 echo "${ECHO_T}no" >&6
6996 fi
6997
6998     test -n "$NCURSES_CONFIG" && break
6999   done
7000 fi
7001 if test -z "$NCURSES_CONFIG"; then
7002   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
7003   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7004 do
7005   # Extract the first word of "$ac_prog", so it can be a program name with args.
7006 set dummy $ac_prog; ac_word=$2
7007 echo "$as_me:7007: checking for $ac_word" >&5
7008 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7009 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
7010   echo $ECHO_N "(cached) $ECHO_C" >&6
7011 else
7012   if test -n "$ac_ct_NCURSES_CONFIG"; then
7013   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
7014 else
7015   ac_save_IFS=$IFS; IFS=$ac_path_separator
7016 ac_dummy="$PATH"
7017 for ac_dir in $ac_dummy; do
7018   IFS=$ac_save_IFS
7019   test -z "$ac_dir" && ac_dir=.
7020   $as_executable_p "$ac_dir/$ac_word" || continue
7021 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
7022 echo "$as_me:7022: found $ac_dir/$ac_word" >&5
7023 break
7024 done
7025
7026 fi
7027 fi
7028 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
7029 if test -n "$ac_ct_NCURSES_CONFIG"; then
7030   echo "$as_me:7030: result: $ac_ct_NCURSES_CONFIG" >&5
7031 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
7032 else
7033   echo "$as_me:7033: result: no" >&5
7034 echo "${ECHO_T}no" >&6
7035 fi
7036
7037   test -n "$ac_ct_NCURSES_CONFIG" && break
7038 done
7039 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
7040
7041   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
7042 fi
7043
7044         if test "$NCURSES_CONFIG" != none ; then
7045
7046                 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
7047
7048 cf_add_libs="`$NCURSES_CONFIG --libs`"
7049 # Filter out duplicates - this happens with badly-designed ".pc" files...
7050 for cf_add_1lib in $LIBS
7051 do
7052         for cf_add_2lib in $cf_add_libs
7053         do
7054                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7055                 then
7056                         cf_add_1lib=
7057                         break
7058                 fi
7059         done
7060         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7061 done
7062 LIBS="$cf_add_libs"
7063
7064                 # even with config script, some packages use no-override for curses.h
7065
7066 echo "$as_me:7066: checking if we have identified curses headers" >&5
7067 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
7068 if test "${cf_cv_ncurses_header+set}" = set; then
7069   echo $ECHO_N "(cached) $ECHO_C" >&6
7070 else
7071
7072 cf_cv_ncurses_header=none
7073 for cf_header in \
7074         ncurses.h $cf_cv_screen/ncurses.h \
7075         curses.h $cf_cv_screen/curses.h
7076 do
7077 cat >conftest.$ac_ext <<_ACEOF
7078 #line 7078 "configure"
7079 #include "confdefs.h"
7080 #include <${cf_header}>
7081 int
7082 main (void)
7083 {
7084 initscr(); tgoto("?", 0,0)
7085   ;
7086   return 0;
7087 }
7088 _ACEOF
7089 rm -f conftest.$ac_objext
7090 if { (eval echo "$as_me:7090: \"$ac_compile\"") >&5
7091   (eval $ac_compile) 2>&5
7092   ac_status=$?
7093   echo "$as_me:7093: \$? = $ac_status" >&5
7094   (exit $ac_status); } &&
7095          { ac_try='test -s conftest.$ac_objext'
7096   { (eval echo "$as_me:7096: \"$ac_try\"") >&5
7097   (eval $ac_try) 2>&5
7098   ac_status=$?
7099   echo "$as_me:7099: \$? = $ac_status" >&5
7100   (exit $ac_status); }; }; then
7101   cf_cv_ncurses_header=$cf_header; break
7102 else
7103   echo "$as_me: failed program was:" >&5
7104 cat conftest.$ac_ext >&5
7105 fi
7106 rm -f conftest.$ac_objext conftest.$ac_ext
7107 done
7108
7109 fi
7110 echo "$as_me:7110: result: $cf_cv_ncurses_header" >&5
7111 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
7112
7113 if test "$cf_cv_ncurses_header" = none ; then
7114         { { echo "$as_me:7114: error: No curses header-files found" >&5
7115 echo "$as_me: error: No curses header-files found" >&2;}
7116    { (exit 1); exit 1; }; }
7117 fi
7118
7119 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
7120
7121 for ac_header in $cf_cv_ncurses_header
7122 do
7123 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
7124 echo "$as_me:7124: checking for $ac_header" >&5
7125 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
7126 if eval "test \"\${$as_ac_Header+set}\" = set"; then
7127   echo $ECHO_N "(cached) $ECHO_C" >&6
7128 else
7129   cat >conftest.$ac_ext <<_ACEOF
7130 #line 7130 "configure"
7131 #include "confdefs.h"
7132 #include <$ac_header>
7133 _ACEOF
7134 if { (eval echo "$as_me:7134: \"$ac_cpp conftest.$ac_ext\"") >&5
7135   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
7136   ac_status=$?
7137   egrep -v '^ *\+' conftest.er1 >conftest.err
7138   rm -f conftest.er1
7139   cat conftest.err >&5
7140   echo "$as_me:7140: \$? = $ac_status" >&5
7141   (exit $ac_status); } >/dev/null; then
7142   if test -s conftest.err; then
7143     ac_cpp_err=$ac_c_preproc_warn_flag
7144   else
7145     ac_cpp_err=
7146   fi
7147 else
7148   ac_cpp_err=yes
7149 fi
7150 if test -z "$ac_cpp_err"; then
7151   eval "$as_ac_Header=yes"
7152 else
7153   echo "$as_me: failed program was:" >&5
7154   cat conftest.$ac_ext >&5
7155   eval "$as_ac_Header=no"
7156 fi
7157 rm -f conftest.err conftest.$ac_ext
7158 fi
7159 echo "$as_me:7159: result: `eval echo '${'$as_ac_Header'}'`" >&5
7160 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
7161 if test `eval echo '${'$as_ac_Header'}'` = yes; then
7162   cat >>confdefs.h <<EOF
7163 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
7164 EOF
7165
7166 fi
7167 done
7168
7169 cat >>confdefs.h <<\EOF
7170 #define NCURSES 1
7171 EOF
7172
7173 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
7174
7175                 cat >>confdefs.h <<EOF
7176 #define $cf_nculib_ROOT 1
7177 EOF
7178
7179                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
7180
7181         else
7182
7183 cf_ncuhdr_root=$cf_cv_screen
7184
7185 test -n "$cf_cv_curses_dir" && \
7186 test "$cf_cv_curses_dir" != "no" && { \
7187
7188 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
7189   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
7190   do
7191         while test $cf_add_incdir != /usr/include
7192         do
7193           if test -d $cf_add_incdir
7194           then
7195                 cf_have_incdir=no
7196                 if test -n "$CFLAGS$CPPFLAGS" ; then
7197                   # a loop is needed to ensure we can add subdirs of existing dirs
7198                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7199                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7200                           cf_have_incdir=yes; break
7201                         fi
7202                   done
7203                 fi
7204
7205                 if test "$cf_have_incdir" = no ; then
7206                   if test "$cf_add_incdir" = /usr/local/include ; then
7207                         if test "$GCC" = yes
7208                         then
7209                           cf_save_CPPFLAGS=$CPPFLAGS
7210                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7211                           cat >conftest.$ac_ext <<_ACEOF
7212 #line 7212 "configure"
7213 #include "confdefs.h"
7214 #include <stdio.h>
7215 int
7216 main (void)
7217 {
7218 printf("Hello")
7219   ;
7220   return 0;
7221 }
7222 _ACEOF
7223 rm -f conftest.$ac_objext
7224 if { (eval echo "$as_me:7224: \"$ac_compile\"") >&5
7225   (eval $ac_compile) 2>&5
7226   ac_status=$?
7227   echo "$as_me:7227: \$? = $ac_status" >&5
7228   (exit $ac_status); } &&
7229          { ac_try='test -s conftest.$ac_objext'
7230   { (eval echo "$as_me:7230: \"$ac_try\"") >&5
7231   (eval $ac_try) 2>&5
7232   ac_status=$?
7233   echo "$as_me:7233: \$? = $ac_status" >&5
7234   (exit $ac_status); }; }; then
7235   :
7236 else
7237   echo "$as_me: failed program was:" >&5
7238 cat conftest.$ac_ext >&5
7239 cf_have_incdir=yes
7240 fi
7241 rm -f conftest.$ac_objext conftest.$ac_ext
7242                           CPPFLAGS=$cf_save_CPPFLAGS
7243                         fi
7244                   fi
7245                 fi
7246
7247                 if test "$cf_have_incdir" = no ; then
7248                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7249
7250 echo "${as_me:-configure}:7250: testing adding $cf_add_incdir to include-path ..." 1>&5
7251
7252                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7253
7254                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7255                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7256                   cf_add_incdir="$cf_top_incdir"
7257                 else
7258                   break
7259                 fi
7260           else
7261                 break
7262           fi
7263         done
7264   done
7265 fi
7266
7267 }
7268
7269 echo "$as_me:7269: checking for $cf_ncuhdr_root header in include-path" >&5
7270 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
7271 if test "${cf_cv_ncurses_h+set}" = set; then
7272   echo $ECHO_N "(cached) $ECHO_C" >&6
7273 else
7274
7275         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
7276         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
7277         for cf_header in $cf_header_list
7278         do
7279
7280         cat >conftest.$ac_ext <<_ACEOF
7281 #line 7281 "configure"
7282 #include "confdefs.h"
7283
7284 #include <$cf_header>
7285 int
7286 main (void)
7287 {
7288
7289 #ifdef NCURSES_VERSION
7290
7291 printf("%s\n", NCURSES_VERSION);
7292 #else
7293 #ifdef __NCURSES_H
7294 printf("old\n");
7295 #else
7296         make an error
7297 #endif
7298 #endif
7299
7300   ;
7301   return 0;
7302 }
7303 _ACEOF
7304 rm -f conftest.$ac_objext
7305 if { (eval echo "$as_me:7305: \"$ac_compile\"") >&5
7306   (eval $ac_compile) 2>&5
7307   ac_status=$?
7308   echo "$as_me:7308: \$? = $ac_status" >&5
7309   (exit $ac_status); } &&
7310          { ac_try='test -s conftest.$ac_objext'
7311   { (eval echo "$as_me:7311: \"$ac_try\"") >&5
7312   (eval $ac_try) 2>&5
7313   ac_status=$?
7314   echo "$as_me:7314: \$? = $ac_status" >&5
7315   (exit $ac_status); }; }; then
7316   cf_cv_ncurses_h=$cf_header
7317
7318 else
7319   echo "$as_me: failed program was:" >&5
7320 cat conftest.$ac_ext >&5
7321 cf_cv_ncurses_h=no
7322 fi
7323 rm -f conftest.$ac_objext conftest.$ac_ext
7324
7325                 test "$cf_cv_ncurses_h" != no && break
7326         done
7327
7328 fi
7329 echo "$as_me:7329: result: $cf_cv_ncurses_h" >&5
7330 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
7331
7332 if test "$cf_cv_ncurses_h" != no ; then
7333         cf_cv_ncurses_header=$cf_cv_ncurses_h
7334 else
7335
7336 echo "$as_me:7336: checking for $cf_ncuhdr_root include-path" >&5
7337 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
7338 if test "${cf_cv_ncurses_h2+set}" = set; then
7339   echo $ECHO_N "(cached) $ECHO_C" >&6
7340 else
7341
7342         test -n "$verbose" && echo
7343
7344 cf_search=
7345
7346 # collect the current set of include-directories from compiler flags
7347 cf_header_path_list=""
7348 if test -n "${CFLAGS}${CPPFLAGS}" ; then
7349         for cf_header_path in $CPPFLAGS $CFLAGS
7350         do
7351                 case $cf_header_path in
7352                 (-I*)
7353                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
7354
7355 test "x$cf_header_path" != "xNONE" && \
7356 test -d "$cf_header_path" && \
7357  {
7358         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
7359         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
7360         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
7361         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
7362         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
7363         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"
7364 }
7365
7366                         cf_header_path_list="$cf_header_path_list $cf_search"
7367                         ;;
7368                 esac
7369         done
7370 fi
7371
7372 # add the variations for the package we are looking for
7373
7374 cf_search=
7375
7376 test "x$prefix" != "xNONE" && \
7377 test -d "$prefix" && \
7378  {
7379         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
7380         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
7381         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
7382         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
7383         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
7384         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
7385 }
7386
7387 for cf_subdir_prefix in \
7388         /usr \
7389         /usr/local \
7390         /usr/pkg \
7391         /opt \
7392         /opt/local \
7393         $HOME
7394 do
7395
7396 test "x$cf_subdir_prefix" != "x$prefix" && \
7397 test -d "$cf_subdir_prefix" && \
7398 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
7399         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
7400         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
7401         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
7402         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
7403         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
7404         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"
7405 }
7406
7407 done
7408
7409 test "$includedir" != NONE && \
7410 test "$includedir" != "/usr/include" && \
7411 test -d "$includedir" && {
7412         test -d $includedir &&    cf_search="$cf_search $includedir"
7413         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
7414 }
7415
7416 test "$oldincludedir" != NONE && \
7417 test "$oldincludedir" != "/usr/include" && \
7418 test -d "$oldincludedir" && {
7419         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
7420         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
7421 }
7422
7423 cf_search="$cf_search $cf_header_path_list"
7424
7425         test -n "$verbose" && echo search path $cf_search
7426         cf_save2_CPPFLAGS="$CPPFLAGS"
7427         for cf_incdir in $cf_search
7428         do
7429
7430 if test -n "$cf_incdir" ; then
7431   for cf_add_incdir in $cf_incdir
7432   do
7433         while test $cf_add_incdir != /usr/include
7434         do
7435           if test -d $cf_add_incdir
7436           then
7437                 cf_have_incdir=no
7438                 if test -n "$CFLAGS$CPPFLAGS" ; then
7439                   # a loop is needed to ensure we can add subdirs of existing dirs
7440                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7441                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7442                           cf_have_incdir=yes; break
7443                         fi
7444                   done
7445                 fi
7446
7447                 if test "$cf_have_incdir" = no ; then
7448                   if test "$cf_add_incdir" = /usr/local/include ; then
7449                         if test "$GCC" = yes
7450                         then
7451                           cf_save_CPPFLAGS=$CPPFLAGS
7452                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7453                           cat >conftest.$ac_ext <<_ACEOF
7454 #line 7454 "configure"
7455 #include "confdefs.h"
7456 #include <stdio.h>
7457 int
7458 main (void)
7459 {
7460 printf("Hello")
7461   ;
7462   return 0;
7463 }
7464 _ACEOF
7465 rm -f conftest.$ac_objext
7466 if { (eval echo "$as_me:7466: \"$ac_compile\"") >&5
7467   (eval $ac_compile) 2>&5
7468   ac_status=$?
7469   echo "$as_me:7469: \$? = $ac_status" >&5
7470   (exit $ac_status); } &&
7471          { ac_try='test -s conftest.$ac_objext'
7472   { (eval echo "$as_me:7472: \"$ac_try\"") >&5
7473   (eval $ac_try) 2>&5
7474   ac_status=$?
7475   echo "$as_me:7475: \$? = $ac_status" >&5
7476   (exit $ac_status); }; }; then
7477   :
7478 else
7479   echo "$as_me: failed program was:" >&5
7480 cat conftest.$ac_ext >&5
7481 cf_have_incdir=yes
7482 fi
7483 rm -f conftest.$ac_objext conftest.$ac_ext
7484                           CPPFLAGS=$cf_save_CPPFLAGS
7485                         fi
7486                   fi
7487                 fi
7488
7489                 if test "$cf_have_incdir" = no ; then
7490                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7491
7492 echo "${as_me:-configure}:7492: testing adding $cf_add_incdir to include-path ..." 1>&5
7493
7494                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7495
7496                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7497                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7498                   cf_add_incdir="$cf_top_incdir"
7499                 else
7500                   break
7501                 fi
7502           else
7503                 break
7504           fi
7505         done
7506   done
7507 fi
7508
7509                 for cf_header in \
7510                         ncurses.h \
7511                         curses.h
7512                 do
7513
7514         cat >conftest.$ac_ext <<_ACEOF
7515 #line 7515 "configure"
7516 #include "confdefs.h"
7517
7518 #include <$cf_header>
7519 int
7520 main (void)
7521 {
7522
7523 #ifdef NCURSES_VERSION
7524
7525 printf("%s\n", NCURSES_VERSION);
7526 #else
7527 #ifdef __NCURSES_H
7528 printf("old\n");
7529 #else
7530         make an error
7531 #endif
7532 #endif
7533
7534   ;
7535   return 0;
7536 }
7537 _ACEOF
7538 rm -f conftest.$ac_objext
7539 if { (eval echo "$as_me:7539: \"$ac_compile\"") >&5
7540   (eval $ac_compile) 2>&5
7541   ac_status=$?
7542   echo "$as_me:7542: \$? = $ac_status" >&5
7543   (exit $ac_status); } &&
7544          { ac_try='test -s conftest.$ac_objext'
7545   { (eval echo "$as_me:7545: \"$ac_try\"") >&5
7546   (eval $ac_try) 2>&5
7547   ac_status=$?
7548   echo "$as_me:7548: \$? = $ac_status" >&5
7549   (exit $ac_status); }; }; then
7550   cf_cv_ncurses_h2=$cf_header
7551
7552 else
7553   echo "$as_me: failed program was:" >&5
7554 cat conftest.$ac_ext >&5
7555 cf_cv_ncurses_h2=no
7556 fi
7557 rm -f conftest.$ac_objext conftest.$ac_ext
7558
7559                         if test "$cf_cv_ncurses_h2" != no ; then
7560                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
7561                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
7562                                 break
7563                         fi
7564                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
7565                 done
7566                 CPPFLAGS="$cf_save2_CPPFLAGS"
7567                 test "$cf_cv_ncurses_h2" != no && break
7568         done
7569         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:7569: error: not found" >&5
7570 echo "$as_me: error: not found" >&2;}
7571    { (exit 1); exit 1; }; }
7572
7573 fi
7574 echo "$as_me:7574: result: $cf_cv_ncurses_h2" >&5
7575 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
7576
7577         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
7578         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
7579         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
7580                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
7581         fi
7582
7583 if test -n "$cf_1st_incdir" ; then
7584   for cf_add_incdir in $cf_1st_incdir
7585   do
7586         while test $cf_add_incdir != /usr/include
7587         do
7588           if test -d $cf_add_incdir
7589           then
7590                 cf_have_incdir=no
7591                 if test -n "$CFLAGS$CPPFLAGS" ; then
7592                   # a loop is needed to ensure we can add subdirs of existing dirs
7593                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7594                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7595                           cf_have_incdir=yes; break
7596                         fi
7597                   done
7598                 fi
7599
7600                 if test "$cf_have_incdir" = no ; then
7601                   if test "$cf_add_incdir" = /usr/local/include ; then
7602                         if test "$GCC" = yes
7603                         then
7604                           cf_save_CPPFLAGS=$CPPFLAGS
7605                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7606                           cat >conftest.$ac_ext <<_ACEOF
7607 #line 7607 "configure"
7608 #include "confdefs.h"
7609 #include <stdio.h>
7610 int
7611 main (void)
7612 {
7613 printf("Hello")
7614   ;
7615   return 0;
7616 }
7617 _ACEOF
7618 rm -f conftest.$ac_objext
7619 if { (eval echo "$as_me:7619: \"$ac_compile\"") >&5
7620   (eval $ac_compile) 2>&5
7621   ac_status=$?
7622   echo "$as_me:7622: \$? = $ac_status" >&5
7623   (exit $ac_status); } &&
7624          { ac_try='test -s conftest.$ac_objext'
7625   { (eval echo "$as_me:7625: \"$ac_try\"") >&5
7626   (eval $ac_try) 2>&5
7627   ac_status=$?
7628   echo "$as_me:7628: \$? = $ac_status" >&5
7629   (exit $ac_status); }; }; then
7630   :
7631 else
7632   echo "$as_me: failed program was:" >&5
7633 cat conftest.$ac_ext >&5
7634 cf_have_incdir=yes
7635 fi
7636 rm -f conftest.$ac_objext conftest.$ac_ext
7637                           CPPFLAGS=$cf_save_CPPFLAGS
7638                         fi
7639                   fi
7640                 fi
7641
7642                 if test "$cf_have_incdir" = no ; then
7643                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7644
7645 echo "${as_me:-configure}:7645: testing adding $cf_add_incdir to include-path ..." 1>&5
7646
7647                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7648
7649                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7650                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7651                   cf_add_incdir="$cf_top_incdir"
7652                 else
7653                   break
7654                 fi
7655           else
7656                 break
7657           fi
7658         done
7659   done
7660 fi
7661
7662 fi
7663
7664 # Set definitions to allow ifdef'ing for ncurses.h
7665
7666 case $cf_cv_ncurses_header in
7667 (*ncurses.h)
7668
7669 cat >>confdefs.h <<\EOF
7670 #define HAVE_NCURSES_H 1
7671 EOF
7672
7673         ;;
7674 esac
7675
7676 case $cf_cv_ncurses_header in
7677 (ncurses/curses.h|ncurses/ncurses.h)
7678
7679 cat >>confdefs.h <<\EOF
7680 #define HAVE_NCURSES_NCURSES_H 1
7681 EOF
7682
7683         ;;
7684 (ncursesw/curses.h|ncursesw/ncurses.h)
7685
7686 cat >>confdefs.h <<\EOF
7687 #define HAVE_NCURSESW_NCURSES_H 1
7688 EOF
7689
7690         ;;
7691 esac
7692
7693 echo "$as_me:7693: checking for terminfo header" >&5
7694 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
7695 if test "${cf_cv_term_header+set}" = set; then
7696   echo $ECHO_N "(cached) $ECHO_C" >&6
7697 else
7698
7699 case ${cf_cv_ncurses_header} in
7700 (*/ncurses.h|*/ncursesw.h)
7701         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
7702         ;;
7703 (*)
7704         cf_term_header=term.h
7705         ;;
7706 esac
7707
7708 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
7709 do
7710 cat >conftest.$ac_ext <<_ACEOF
7711 #line 7711 "configure"
7712 #include "confdefs.h"
7713 #include <stdio.h>
7714 #include <${cf_cv_ncurses_header:-curses.h}>
7715 #include <$cf_test>
7716
7717 int
7718 main (void)
7719 {
7720 int x = auto_left_margin
7721   ;
7722   return 0;
7723 }
7724 _ACEOF
7725 rm -f conftest.$ac_objext
7726 if { (eval echo "$as_me:7726: \"$ac_compile\"") >&5
7727   (eval $ac_compile) 2>&5
7728   ac_status=$?
7729   echo "$as_me:7729: \$? = $ac_status" >&5
7730   (exit $ac_status); } &&
7731          { ac_try='test -s conftest.$ac_objext'
7732   { (eval echo "$as_me:7732: \"$ac_try\"") >&5
7733   (eval $ac_try) 2>&5
7734   ac_status=$?
7735   echo "$as_me:7735: \$? = $ac_status" >&5
7736   (exit $ac_status); }; }; then
7737
7738         cf_cv_term_header="$cf_test"
7739 else
7740   echo "$as_me: failed program was:" >&5
7741 cat conftest.$ac_ext >&5
7742
7743         cf_cv_term_header=unknown
7744
7745 fi
7746 rm -f conftest.$ac_objext conftest.$ac_ext
7747         test "$cf_cv_term_header" != unknown && break
7748 done
7749
7750 fi
7751 echo "$as_me:7751: result: $cf_cv_term_header" >&5
7752 echo "${ECHO_T}$cf_cv_term_header" >&6
7753
7754 # Set definitions to allow ifdef'ing to accommodate subdirectories
7755
7756 case $cf_cv_term_header in
7757 (*term.h)
7758
7759 cat >>confdefs.h <<\EOF
7760 #define HAVE_TERM_H 1
7761 EOF
7762
7763         ;;
7764 esac
7765
7766 case $cf_cv_term_header in
7767 (ncurses/term.h)
7768
7769 cat >>confdefs.h <<\EOF
7770 #define HAVE_NCURSES_TERM_H 1
7771 EOF
7772
7773         ;;
7774 (ncursesw/term.h)
7775
7776 cat >>confdefs.h <<\EOF
7777 #define HAVE_NCURSESW_TERM_H 1
7778 EOF
7779
7780         ;;
7781 esac
7782
7783 # some applications need this, but should check for NCURSES_VERSION
7784
7785 cat >>confdefs.h <<\EOF
7786 #define NCURSES 1
7787 EOF
7788
7789 echo "$as_me:7789: checking for ncurses version" >&5
7790 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
7791 if test "${cf_cv_ncurses_version+set}" = set; then
7792   echo $ECHO_N "(cached) $ECHO_C" >&6
7793 else
7794
7795         cf_cv_ncurses_version=no
7796         cf_tempfile=out$$
7797         rm -f $cf_tempfile
7798         if test "$cross_compiling" = yes; then
7799
7800         # This will not work if the preprocessor splits the line after the
7801         # Autoconf token.  The 'unproto' program does that.
7802         cat > conftest.$ac_ext <<EOF
7803 #include <${cf_cv_ncurses_header:-curses.h}>
7804 #undef Autoconf
7805 #ifdef NCURSES_VERSION
7806 Autoconf NCURSES_VERSION
7807 #else
7808 #ifdef __NCURSES_H
7809 Autoconf "old"
7810 #endif
7811 ;
7812 #endif
7813 EOF
7814         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
7815         { (eval echo "$as_me:7815: \"$cf_try\"") >&5
7816   (eval $cf_try) 2>&5
7817   ac_status=$?
7818   echo "$as_me:7818: \$? = $ac_status" >&5
7819   (exit $ac_status); }
7820         if test -f conftest.out ; then
7821                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
7822                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
7823                 rm -f conftest.out
7824         fi
7825
7826 else
7827   cat >conftest.$ac_ext <<_ACEOF
7828 #line 7828 "configure"
7829 #include "confdefs.h"
7830
7831 #include <${cf_cv_ncurses_header:-curses.h}>
7832 #include <stdio.h>
7833 int main(void)
7834 {
7835         FILE *fp = fopen("$cf_tempfile", "w");
7836 #ifdef NCURSES_VERSION
7837 # ifdef NCURSES_VERSION_PATCH
7838         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
7839 # else
7840         fprintf(fp, "%s\n", NCURSES_VERSION);
7841 # endif
7842 #else
7843 # ifdef __NCURSES_H
7844         fprintf(fp, "old\n");
7845 # else
7846         make an error
7847 # endif
7848 #endif
7849         ${cf_cv_main_return:-return}(0);
7850 }
7851 _ACEOF
7852 rm -f conftest$ac_exeext
7853 if { (eval echo "$as_me:7853: \"$ac_link\"") >&5
7854   (eval $ac_link) 2>&5
7855   ac_status=$?
7856   echo "$as_me:7856: \$? = $ac_status" >&5
7857   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
7858   { (eval echo "$as_me:7858: \"$ac_try\"") >&5
7859   (eval $ac_try) 2>&5
7860   ac_status=$?
7861   echo "$as_me:7861: \$? = $ac_status" >&5
7862   (exit $ac_status); }; }; then
7863
7864         cf_cv_ncurses_version=`cat $cf_tempfile`
7865 else
7866   echo "$as_me: program exited with status $ac_status" >&5
7867 echo "$as_me: failed program was:" >&5
7868 cat conftest.$ac_ext >&5
7869 fi
7870 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
7871 fi
7872         rm -f $cf_tempfile
7873
7874 fi
7875 echo "$as_me:7875: result: $cf_cv_ncurses_version" >&5
7876 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
7877 test "$cf_cv_ncurses_version" = no ||
7878 cat >>confdefs.h <<\EOF
7879 #define NCURSES 1
7880 EOF
7881
7882 cf_nculib_root=$cf_cv_screen
7883         # This works, except for the special case where we find gpm, but
7884         # ncurses is in a nonstandard location via $LIBS, and we really want
7885         # to link gpm.
7886 cf_ncurses_LIBS=""
7887 cf_ncurses_SAVE="$LIBS"
7888 echo "$as_me:7888: checking for Gpm_Open in -lgpm" >&5
7889 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
7890 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
7891   echo $ECHO_N "(cached) $ECHO_C" >&6
7892 else
7893   ac_check_lib_save_LIBS=$LIBS
7894 LIBS="-lgpm  $LIBS"
7895 cat >conftest.$ac_ext <<_ACEOF
7896 #line 7896 "configure"
7897 #include "confdefs.h"
7898
7899 /* Override any gcc2 internal prototype to avoid an error.  */
7900 #ifdef __cplusplus
7901 extern "C"
7902 #endif
7903 /* We use char because int might match the return type of a gcc2
7904    builtin and then its argument prototype would still apply.  */
7905 char Gpm_Open ();
7906 int
7907 main (void)
7908 {
7909 Gpm_Open ();
7910   ;
7911   return 0;
7912 }
7913 _ACEOF
7914 rm -f conftest.$ac_objext conftest$ac_exeext
7915 if { (eval echo "$as_me:7915: \"$ac_link\"") >&5
7916   (eval $ac_link) 2>&5
7917   ac_status=$?
7918   echo "$as_me:7918: \$? = $ac_status" >&5
7919   (exit $ac_status); } &&
7920          { ac_try='test -s conftest$ac_exeext'
7921   { (eval echo "$as_me:7921: \"$ac_try\"") >&5
7922   (eval $ac_try) 2>&5
7923   ac_status=$?
7924   echo "$as_me:7924: \$? = $ac_status" >&5
7925   (exit $ac_status); }; }; then
7926   ac_cv_lib_gpm_Gpm_Open=yes
7927 else
7928   echo "$as_me: failed program was:" >&5
7929 cat conftest.$ac_ext >&5
7930 ac_cv_lib_gpm_Gpm_Open=no
7931 fi
7932 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7933 LIBS=$ac_check_lib_save_LIBS
7934 fi
7935 echo "$as_me:7935: result: $ac_cv_lib_gpm_Gpm_Open" >&5
7936 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
7937 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
7938   echo "$as_me:7938: checking for initscr in -lgpm" >&5
7939 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
7940 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
7941   echo $ECHO_N "(cached) $ECHO_C" >&6
7942 else
7943   ac_check_lib_save_LIBS=$LIBS
7944 LIBS="-lgpm  $LIBS"
7945 cat >conftest.$ac_ext <<_ACEOF
7946 #line 7946 "configure"
7947 #include "confdefs.h"
7948
7949 /* Override any gcc2 internal prototype to avoid an error.  */
7950 #ifdef __cplusplus
7951 extern "C"
7952 #endif
7953 /* We use char because int might match the return type of a gcc2
7954    builtin and then its argument prototype would still apply.  */
7955 char initscr ();
7956 int
7957 main (void)
7958 {
7959 initscr ();
7960   ;
7961   return 0;
7962 }
7963 _ACEOF
7964 rm -f conftest.$ac_objext conftest$ac_exeext
7965 if { (eval echo "$as_me:7965: \"$ac_link\"") >&5
7966   (eval $ac_link) 2>&5
7967   ac_status=$?
7968   echo "$as_me:7968: \$? = $ac_status" >&5
7969   (exit $ac_status); } &&
7970          { ac_try='test -s conftest$ac_exeext'
7971   { (eval echo "$as_me:7971: \"$ac_try\"") >&5
7972   (eval $ac_try) 2>&5
7973   ac_status=$?
7974   echo "$as_me:7974: \$? = $ac_status" >&5
7975   (exit $ac_status); }; }; then
7976   ac_cv_lib_gpm_initscr=yes
7977 else
7978   echo "$as_me: failed program was:" >&5
7979 cat conftest.$ac_ext >&5
7980 ac_cv_lib_gpm_initscr=no
7981 fi
7982 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7983 LIBS=$ac_check_lib_save_LIBS
7984 fi
7985 echo "$as_me:7985: result: $ac_cv_lib_gpm_initscr" >&5
7986 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
7987 if test $ac_cv_lib_gpm_initscr = yes; then
7988   LIBS="$cf_ncurses_SAVE"
7989 else
7990   cf_ncurses_LIBS="-lgpm"
7991 fi
7992
7993 fi
7994
7995 case $host_os in
7996 (freebsd*)
7997         # This is only necessary if you are linking against an obsolete
7998         # version of ncurses (but it should do no harm, since it's static).
7999         if test "$cf_nculib_root" = ncurses ; then
8000                 echo "$as_me:8000: checking for tgoto in -lmytinfo" >&5
8001 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
8002 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
8003   echo $ECHO_N "(cached) $ECHO_C" >&6
8004 else
8005   ac_check_lib_save_LIBS=$LIBS
8006 LIBS="-lmytinfo  $LIBS"
8007 cat >conftest.$ac_ext <<_ACEOF
8008 #line 8008 "configure"
8009 #include "confdefs.h"
8010
8011 /* Override any gcc2 internal prototype to avoid an error.  */
8012 #ifdef __cplusplus
8013 extern "C"
8014 #endif
8015 /* We use char because int might match the return type of a gcc2
8016    builtin and then its argument prototype would still apply.  */
8017 char tgoto ();
8018 int
8019 main (void)
8020 {
8021 tgoto ();
8022   ;
8023   return 0;
8024 }
8025 _ACEOF
8026 rm -f conftest.$ac_objext conftest$ac_exeext
8027 if { (eval echo "$as_me:8027: \"$ac_link\"") >&5
8028   (eval $ac_link) 2>&5
8029   ac_status=$?
8030   echo "$as_me:8030: \$? = $ac_status" >&5
8031   (exit $ac_status); } &&
8032          { ac_try='test -s conftest$ac_exeext'
8033   { (eval echo "$as_me:8033: \"$ac_try\"") >&5
8034   (eval $ac_try) 2>&5
8035   ac_status=$?
8036   echo "$as_me:8036: \$? = $ac_status" >&5
8037   (exit $ac_status); }; }; then
8038   ac_cv_lib_mytinfo_tgoto=yes
8039 else
8040   echo "$as_me: failed program was:" >&5
8041 cat conftest.$ac_ext >&5
8042 ac_cv_lib_mytinfo_tgoto=no
8043 fi
8044 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8045 LIBS=$ac_check_lib_save_LIBS
8046 fi
8047 echo "$as_me:8047: result: $ac_cv_lib_mytinfo_tgoto" >&5
8048 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
8049 if test $ac_cv_lib_mytinfo_tgoto = yes; then
8050   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
8051 fi
8052
8053         fi
8054         ;;
8055 esac
8056
8057 cf_add_libs="$cf_ncurses_LIBS"
8058 # Filter out duplicates - this happens with badly-designed ".pc" files...
8059 for cf_add_1lib in $LIBS
8060 do
8061         for cf_add_2lib in $cf_add_libs
8062         do
8063                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
8064                 then
8065                         cf_add_1lib=
8066                         break
8067                 fi
8068         done
8069         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
8070 done
8071 LIBS="$cf_add_libs"
8072
8073 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
8074 then
8075
8076 cf_add_libs="-l$cf_nculib_root"
8077 # Filter out duplicates - this happens with badly-designed ".pc" files...
8078 for cf_add_1lib in $LIBS
8079 do
8080         for cf_add_2lib in $cf_add_libs
8081         do
8082                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
8083                 then
8084                         cf_add_1lib=
8085                         break
8086                 fi
8087         done
8088         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
8089 done
8090 LIBS="$cf_add_libs"
8091
8092 else
8093
8094         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
8095         cf_libdir=""
8096         echo "$as_me:8096: checking for initscr" >&5
8097 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
8098 if test "${ac_cv_func_initscr+set}" = set; then
8099   echo $ECHO_N "(cached) $ECHO_C" >&6
8100 else
8101   cat >conftest.$ac_ext <<_ACEOF
8102 #line 8102 "configure"
8103 #include "confdefs.h"
8104 /* System header to define __stub macros and hopefully few prototypes,
8105     which can conflict with char initscr (); below.  */
8106 #include <assert.h>
8107 /* Override any gcc2 internal prototype to avoid an error.  */
8108 #ifdef __cplusplus
8109 extern "C"
8110 #endif
8111 /* We use char because int might match the return type of a gcc2
8112    builtin and then its argument prototype would still apply.  */
8113 char initscr ();
8114 char (*f) ();
8115
8116 int
8117 main (void)
8118 {
8119 /* The GNU C library defines this for functions which it implements
8120     to always fail with ENOSYS.  Some functions are actually named
8121     something starting with __ and the normal name is an alias.  */
8122 #if defined (__stub_initscr) || defined (__stub___initscr)
8123 choke me
8124 #else
8125 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
8126 #endif
8127
8128   ;
8129   return 0;
8130 }
8131 _ACEOF
8132 rm -f conftest.$ac_objext conftest$ac_exeext
8133 if { (eval echo "$as_me:8133: \"$ac_link\"") >&5
8134   (eval $ac_link) 2>&5
8135   ac_status=$?
8136   echo "$as_me:8136: \$? = $ac_status" >&5
8137   (exit $ac_status); } &&
8138          { ac_try='test -s conftest$ac_exeext'
8139   { (eval echo "$as_me:8139: \"$ac_try\"") >&5
8140   (eval $ac_try) 2>&5
8141   ac_status=$?
8142   echo "$as_me:8142: \$? = $ac_status" >&5
8143   (exit $ac_status); }; }; then
8144   ac_cv_func_initscr=yes
8145 else
8146   echo "$as_me: failed program was:" >&5
8147 cat conftest.$ac_ext >&5
8148 ac_cv_func_initscr=no
8149 fi
8150 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8151 fi
8152 echo "$as_me:8152: result: $ac_cv_func_initscr" >&5
8153 echo "${ECHO_T}$ac_cv_func_initscr" >&6
8154 if test $ac_cv_func_initscr = yes; then
8155   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8156 else
8157
8158                 cf_save_LIBS="$LIBS"
8159                 echo "$as_me:8159: checking for initscr in -l$cf_nculib_root" >&5
8160 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
8161                 LIBS="-l$cf_nculib_root $LIBS"
8162                 cat >conftest.$ac_ext <<_ACEOF
8163 #line 8163 "configure"
8164 #include "confdefs.h"
8165 #include <${cf_cv_ncurses_header:-curses.h}>
8166 int
8167 main (void)
8168 {
8169 initscr()
8170   ;
8171   return 0;
8172 }
8173 _ACEOF
8174 rm -f conftest.$ac_objext conftest$ac_exeext
8175 if { (eval echo "$as_me:8175: \"$ac_link\"") >&5
8176   (eval $ac_link) 2>&5
8177   ac_status=$?
8178   echo "$as_me:8178: \$? = $ac_status" >&5
8179   (exit $ac_status); } &&
8180          { ac_try='test -s conftest$ac_exeext'
8181   { (eval echo "$as_me:8181: \"$ac_try\"") >&5
8182   (eval $ac_try) 2>&5
8183   ac_status=$?
8184   echo "$as_me:8184: \$? = $ac_status" >&5
8185   (exit $ac_status); }; }; then
8186   echo "$as_me:8186: result: yes" >&5
8187 echo "${ECHO_T}yes" >&6
8188                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8189
8190 else
8191   echo "$as_me: failed program was:" >&5
8192 cat conftest.$ac_ext >&5
8193 echo "$as_me:8193: result: no" >&5
8194 echo "${ECHO_T}no" >&6
8195
8196 cf_search=
8197 cf_library_path_list=""
8198 if test -n "${LDFLAGS}${LIBS}" ; then
8199         for cf_library_path in $LDFLAGS $LIBS
8200         do
8201                 case $cf_library_path in
8202                 (-L*)
8203                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
8204
8205 test "x$cf_library_path" != "xNONE" && \
8206 test -d "$cf_library_path" && \
8207  {
8208         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
8209         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
8210         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
8211         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
8212         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
8213         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"
8214 }
8215
8216                         cf_library_path_list="$cf_library_path_list $cf_search"
8217                         ;;
8218                 esac
8219         done
8220 fi
8221
8222 cf_search=
8223
8224 test "x$prefix" != "xNONE" && \
8225 test -d "$prefix" && \
8226  {
8227         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
8228         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
8229         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
8230         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
8231         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
8232         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
8233 }
8234
8235 for cf_subdir_prefix in \
8236         /usr \
8237         /usr/local \
8238         /usr/pkg \
8239         /opt \
8240         /opt/local \
8241         $HOME
8242 do
8243
8244 test "x$cf_subdir_prefix" != "x$prefix" && \
8245 test -d "$cf_subdir_prefix" && \
8246 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
8247         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
8248         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
8249         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
8250         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
8251         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
8252         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"
8253 }
8254
8255 done
8256
8257 cf_search="$cf_library_path_list $cf_search"
8258
8259                         for cf_libdir in $cf_search
8260                         do
8261                                 echo "$as_me:8261: checking for -l$cf_nculib_root in $cf_libdir" >&5
8262 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
8263                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
8264                                 cat >conftest.$ac_ext <<_ACEOF
8265 #line 8265 "configure"
8266 #include "confdefs.h"
8267 #include <${cf_cv_ncurses_header:-curses.h}>
8268 int
8269 main (void)
8270 {
8271 initscr()
8272   ;
8273   return 0;
8274 }
8275 _ACEOF
8276 rm -f conftest.$ac_objext conftest$ac_exeext
8277 if { (eval echo "$as_me:8277: \"$ac_link\"") >&5
8278   (eval $ac_link) 2>&5
8279   ac_status=$?
8280   echo "$as_me:8280: \$? = $ac_status" >&5
8281   (exit $ac_status); } &&
8282          { ac_try='test -s conftest$ac_exeext'
8283   { (eval echo "$as_me:8283: \"$ac_try\"") >&5
8284   (eval $ac_try) 2>&5
8285   ac_status=$?
8286   echo "$as_me:8286: \$? = $ac_status" >&5
8287   (exit $ac_status); }; }; then
8288   echo "$as_me:8288: result: yes" >&5
8289 echo "${ECHO_T}yes" >&6
8290                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8291                                          break
8292 else
8293   echo "$as_me: failed program was:" >&5
8294 cat conftest.$ac_ext >&5
8295 echo "$as_me:8295: result: no" >&5
8296 echo "${ECHO_T}no" >&6
8297                                          LIBS="$cf_save_LIBS"
8298 fi
8299 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8300                         done
8301
8302 fi
8303 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8304
8305 fi
8306
8307 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
8308
8309 if test $cf_found_library = no ; then
8310         { { echo "$as_me:8310: error: Cannot link $cf_nculib_root library" >&5
8311 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
8312    { (exit 1); exit 1; }; }
8313 fi
8314
8315 fi
8316
8317 if test -n "$cf_ncurses_LIBS" ; then
8318         echo "$as_me:8318: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
8319 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
8320         cf_ncurses_SAVE="$LIBS"
8321         for p in $cf_ncurses_LIBS ; do
8322                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
8323                 if test "$q" != "$LIBS" ; then
8324                         LIBS="$q"
8325                 fi
8326         done
8327         cat >conftest.$ac_ext <<_ACEOF
8328 #line 8328 "configure"
8329 #include "confdefs.h"
8330 #include <${cf_cv_ncurses_header:-curses.h}>
8331 int
8332 main (void)
8333 {
8334 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
8335   ;
8336   return 0;
8337 }
8338 _ACEOF
8339 rm -f conftest.$ac_objext conftest$ac_exeext
8340 if { (eval echo "$as_me:8340: \"$ac_link\"") >&5
8341   (eval $ac_link) 2>&5
8342   ac_status=$?
8343   echo "$as_me:8343: \$? = $ac_status" >&5
8344   (exit $ac_status); } &&
8345          { ac_try='test -s conftest$ac_exeext'
8346   { (eval echo "$as_me:8346: \"$ac_try\"") >&5
8347   (eval $ac_try) 2>&5
8348   ac_status=$?
8349   echo "$as_me:8349: \$? = $ac_status" >&5
8350   (exit $ac_status); }; }; then
8351   echo "$as_me:8351: result: yes" >&5
8352 echo "${ECHO_T}yes" >&6
8353 else
8354   echo "$as_me: failed program was:" >&5
8355 cat conftest.$ac_ext >&5
8356 echo "$as_me:8356: result: no" >&5
8357 echo "${ECHO_T}no" >&6
8358                  LIBS="$cf_ncurses_SAVE"
8359 fi
8360 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8361 fi
8362
8363 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
8364
8365 cat >>confdefs.h <<EOF
8366 #define $cf_nculib_ROOT 1
8367 EOF
8368
8369         fi
8370 else
8371         NCURSES_CONFIG=none
8372 fi
8373
8374         ;;
8375 (ncurses*)
8376
8377 cf_ncuconfig_root=$cf_cv_screen
8378 cf_have_ncuconfig=no
8379
8380 if test "x${PKG_CONFIG:=none}" != xnone; then
8381         echo "$as_me:8381: checking pkg-config for $cf_ncuconfig_root" >&5
8382 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
8383         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
8384                 echo "$as_me:8384: result: yes" >&5
8385 echo "${ECHO_T}yes" >&6
8386
8387                 echo "$as_me:8387: checking if the $cf_ncuconfig_root package files work" >&5
8388 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
8389                 cf_have_ncuconfig=unknown
8390
8391                 cf_save_CPPFLAGS="$CPPFLAGS"
8392                 cf_save_LIBS="$LIBS"
8393
8394                 CPPFLAGS="$CPPFLAGS `$PKG_CONFIG --cflags $cf_ncuconfig_root`"
8395
8396 cf_add_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
8397 # Filter out duplicates - this happens with badly-designed ".pc" files...
8398 for cf_add_1lib in $LIBS
8399 do
8400         for cf_add_2lib in $cf_add_libs
8401         do
8402                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
8403                 then
8404                         cf_add_1lib=
8405                         break
8406                 fi
8407         done
8408         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
8409 done
8410 LIBS="$cf_add_libs"
8411
8412                 cat >conftest.$ac_ext <<_ACEOF
8413 #line 8413 "configure"
8414 #include "confdefs.h"
8415 #include <${cf_cv_ncurses_header:-curses.h}>
8416 int
8417 main (void)
8418 {
8419 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
8420   ;
8421   return 0;
8422 }
8423 _ACEOF
8424 rm -f conftest.$ac_objext conftest$ac_exeext
8425 if { (eval echo "$as_me:8425: \"$ac_link\"") >&5
8426   (eval $ac_link) 2>&5
8427   ac_status=$?
8428   echo "$as_me:8428: \$? = $ac_status" >&5
8429   (exit $ac_status); } &&
8430          { ac_try='test -s conftest$ac_exeext'
8431   { (eval echo "$as_me:8431: \"$ac_try\"") >&5
8432   (eval $ac_try) 2>&5
8433   ac_status=$?
8434   echo "$as_me:8434: \$? = $ac_status" >&5
8435   (exit $ac_status); }; }; then
8436   if test "$cross_compiling" = yes; then
8437   cf_have_ncuconfig=maybe
8438 else
8439   cat >conftest.$ac_ext <<_ACEOF
8440 #line 8440 "configure"
8441 #include "confdefs.h"
8442 #include <${cf_cv_ncurses_header:-curses.h}>
8443                                 int main(void)
8444                                 { char *xx = curses_version(); return (xx == 0); }
8445 _ACEOF
8446 rm -f conftest$ac_exeext
8447 if { (eval echo "$as_me:8447: \"$ac_link\"") >&5
8448   (eval $ac_link) 2>&5
8449   ac_status=$?
8450   echo "$as_me:8450: \$? = $ac_status" >&5
8451   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
8452   { (eval echo "$as_me:8452: \"$ac_try\"") >&5
8453   (eval $ac_try) 2>&5
8454   ac_status=$?
8455   echo "$as_me:8455: \$? = $ac_status" >&5
8456   (exit $ac_status); }; }; then
8457   cf_have_ncuconfig=yes
8458 else
8459   echo "$as_me: program exited with status $ac_status" >&5
8460 echo "$as_me: failed program was:" >&5
8461 cat conftest.$ac_ext >&5
8462 cf_have_ncuconfig=no
8463 fi
8464 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
8465 fi
8466 else
8467   echo "$as_me: failed program was:" >&5
8468 cat conftest.$ac_ext >&5
8469 cf_have_ncuconfig=no
8470 fi
8471 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8472                 echo "$as_me:8472: result: $cf_have_ncuconfig" >&5
8473 echo "${ECHO_T}$cf_have_ncuconfig" >&6
8474                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
8475                 if test "$cf_have_ncuconfig" != "yes"
8476                 then
8477                         CPPFLAGS="$cf_save_CPPFLAGS"
8478                         LIBS="$cf_save_LIBS"
8479                         NCURSES_CONFIG_PKG=none
8480                 else
8481
8482 cat >>confdefs.h <<\EOF
8483 #define NCURSES 1
8484 EOF
8485
8486                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
8487
8488 echo "$as_me:8488: checking for terminfo header" >&5
8489 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
8490 if test "${cf_cv_term_header+set}" = set; then
8491   echo $ECHO_N "(cached) $ECHO_C" >&6
8492 else
8493
8494 case ${cf_cv_ncurses_header} in
8495 (*/ncurses.h|*/ncursesw.h)
8496         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
8497         ;;
8498 (*)
8499         cf_term_header=term.h
8500         ;;
8501 esac
8502
8503 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
8504 do
8505 cat >conftest.$ac_ext <<_ACEOF
8506 #line 8506 "configure"
8507 #include "confdefs.h"
8508 #include <stdio.h>
8509 #include <${cf_cv_ncurses_header:-curses.h}>
8510 #include <$cf_test>
8511
8512 int
8513 main (void)
8514 {
8515 int x = auto_left_margin
8516   ;
8517   return 0;
8518 }
8519 _ACEOF
8520 rm -f conftest.$ac_objext
8521 if { (eval echo "$as_me:8521: \"$ac_compile\"") >&5
8522   (eval $ac_compile) 2>&5
8523   ac_status=$?
8524   echo "$as_me:8524: \$? = $ac_status" >&5
8525   (exit $ac_status); } &&
8526          { ac_try='test -s conftest.$ac_objext'
8527   { (eval echo "$as_me:8527: \"$ac_try\"") >&5
8528   (eval $ac_try) 2>&5
8529   ac_status=$?
8530   echo "$as_me:8530: \$? = $ac_status" >&5
8531   (exit $ac_status); }; }; then
8532
8533         cf_cv_term_header="$cf_test"
8534 else
8535   echo "$as_me: failed program was:" >&5
8536 cat conftest.$ac_ext >&5
8537
8538         cf_cv_term_header=unknown
8539
8540 fi
8541 rm -f conftest.$ac_objext conftest.$ac_ext
8542         test "$cf_cv_term_header" != unknown && break
8543 done
8544
8545 fi
8546 echo "$as_me:8546: result: $cf_cv_term_header" >&5
8547 echo "${ECHO_T}$cf_cv_term_header" >&6
8548
8549 # Set definitions to allow ifdef'ing to accommodate subdirectories
8550
8551 case $cf_cv_term_header in
8552 (*term.h)
8553
8554 cat >>confdefs.h <<\EOF
8555 #define HAVE_TERM_H 1
8556 EOF
8557
8558         ;;
8559 esac
8560
8561 case $cf_cv_term_header in
8562 (ncurses/term.h)
8563
8564 cat >>confdefs.h <<\EOF
8565 #define HAVE_NCURSES_TERM_H 1
8566 EOF
8567
8568         ;;
8569 (ncursesw/term.h)
8570
8571 cat >>confdefs.h <<\EOF
8572 #define HAVE_NCURSESW_TERM_H 1
8573 EOF
8574
8575         ;;
8576 esac
8577
8578                 fi
8579
8580         else
8581                 echo "$as_me:8581: result: no" >&5
8582 echo "${ECHO_T}no" >&6
8583                 NCURSES_CONFIG_PKG=none
8584         fi
8585 else
8586         NCURSES_CONFIG_PKG=none
8587 fi
8588
8589 if test "x$cf_have_ncuconfig" = "xno"; then
8590         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
8591
8592 if test -n "$ac_tool_prefix"; then
8593   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
8594   do
8595     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
8596 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
8597 echo "$as_me:8597: checking for $ac_word" >&5
8598 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
8599 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
8600   echo $ECHO_N "(cached) $ECHO_C" >&6
8601 else
8602   if test -n "$NCURSES_CONFIG"; then
8603   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
8604 else
8605   ac_save_IFS=$IFS; IFS=$ac_path_separator
8606 ac_dummy="$PATH"
8607 for ac_dir in $ac_dummy; do
8608   IFS=$ac_save_IFS
8609   test -z "$ac_dir" && ac_dir=.
8610   $as_executable_p "$ac_dir/$ac_word" || continue
8611 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
8612 echo "$as_me:8612: found $ac_dir/$ac_word" >&5
8613 break
8614 done
8615
8616 fi
8617 fi
8618 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
8619 if test -n "$NCURSES_CONFIG"; then
8620   echo "$as_me:8620: result: $NCURSES_CONFIG" >&5
8621 echo "${ECHO_T}$NCURSES_CONFIG" >&6
8622 else
8623   echo "$as_me:8623: result: no" >&5
8624 echo "${ECHO_T}no" >&6
8625 fi
8626
8627     test -n "$NCURSES_CONFIG" && break
8628   done
8629 fi
8630 if test -z "$NCURSES_CONFIG"; then
8631   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
8632   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
8633 do
8634   # Extract the first word of "$ac_prog", so it can be a program name with args.
8635 set dummy $ac_prog; ac_word=$2
8636 echo "$as_me:8636: checking for $ac_word" >&5
8637 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
8638 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
8639   echo $ECHO_N "(cached) $ECHO_C" >&6
8640 else
8641   if test -n "$ac_ct_NCURSES_CONFIG"; then
8642   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
8643 else
8644   ac_save_IFS=$IFS; IFS=$ac_path_separator
8645 ac_dummy="$PATH"
8646 for ac_dir in $ac_dummy; do
8647   IFS=$ac_save_IFS
8648   test -z "$ac_dir" && ac_dir=.
8649   $as_executable_p "$ac_dir/$ac_word" || continue
8650 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
8651 echo "$as_me:8651: found $ac_dir/$ac_word" >&5
8652 break
8653 done
8654
8655 fi
8656 fi
8657 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
8658 if test -n "$ac_ct_NCURSES_CONFIG"; then
8659   echo "$as_me:8659: result: $ac_ct_NCURSES_CONFIG" >&5
8660 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
8661 else
8662   echo "$as_me:8662: result: no" >&5
8663 echo "${ECHO_T}no" >&6
8664 fi
8665
8666   test -n "$ac_ct_NCURSES_CONFIG" && break
8667 done
8668 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
8669
8670   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
8671 fi
8672
8673         if test "$NCURSES_CONFIG" != none ; then
8674
8675                 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
8676
8677 cf_add_libs="`$NCURSES_CONFIG --libs`"
8678 # Filter out duplicates - this happens with badly-designed ".pc" files...
8679 for cf_add_1lib in $LIBS
8680 do
8681         for cf_add_2lib in $cf_add_libs
8682         do
8683                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
8684                 then
8685                         cf_add_1lib=
8686                         break
8687                 fi
8688         done
8689         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
8690 done
8691 LIBS="$cf_add_libs"
8692
8693                 # even with config script, some packages use no-override for curses.h
8694
8695 echo "$as_me:8695: checking if we have identified curses headers" >&5
8696 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
8697 if test "${cf_cv_ncurses_header+set}" = set; then
8698   echo $ECHO_N "(cached) $ECHO_C" >&6
8699 else
8700
8701 cf_cv_ncurses_header=none
8702 for cf_header in \
8703         ncurses.h $cf_cv_screen/ncurses.h \
8704         curses.h $cf_cv_screen/curses.h
8705 do
8706 cat >conftest.$ac_ext <<_ACEOF
8707 #line 8707 "configure"
8708 #include "confdefs.h"
8709 #include <${cf_header}>
8710 int
8711 main (void)
8712 {
8713 initscr(); tgoto("?", 0,0)
8714   ;
8715   return 0;
8716 }
8717 _ACEOF
8718 rm -f conftest.$ac_objext
8719 if { (eval echo "$as_me:8719: \"$ac_compile\"") >&5
8720   (eval $ac_compile) 2>&5
8721   ac_status=$?
8722   echo "$as_me:8722: \$? = $ac_status" >&5
8723   (exit $ac_status); } &&
8724          { ac_try='test -s conftest.$ac_objext'
8725   { (eval echo "$as_me:8725: \"$ac_try\"") >&5
8726   (eval $ac_try) 2>&5
8727   ac_status=$?
8728   echo "$as_me:8728: \$? = $ac_status" >&5
8729   (exit $ac_status); }; }; then
8730   cf_cv_ncurses_header=$cf_header; break
8731 else
8732   echo "$as_me: failed program was:" >&5
8733 cat conftest.$ac_ext >&5
8734 fi
8735 rm -f conftest.$ac_objext conftest.$ac_ext
8736 done
8737
8738 fi
8739 echo "$as_me:8739: result: $cf_cv_ncurses_header" >&5
8740 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
8741
8742 if test "$cf_cv_ncurses_header" = none ; then
8743         { { echo "$as_me:8743: error: No curses header-files found" >&5
8744 echo "$as_me: error: No curses header-files found" >&2;}
8745    { (exit 1); exit 1; }; }
8746 fi
8747
8748 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
8749
8750 for ac_header in $cf_cv_ncurses_header
8751 do
8752 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
8753 echo "$as_me:8753: checking for $ac_header" >&5
8754 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
8755 if eval "test \"\${$as_ac_Header+set}\" = set"; then
8756   echo $ECHO_N "(cached) $ECHO_C" >&6
8757 else
8758   cat >conftest.$ac_ext <<_ACEOF
8759 #line 8759 "configure"
8760 #include "confdefs.h"
8761 #include <$ac_header>
8762 _ACEOF
8763 if { (eval echo "$as_me:8763: \"$ac_cpp conftest.$ac_ext\"") >&5
8764   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
8765   ac_status=$?
8766   egrep -v '^ *\+' conftest.er1 >conftest.err
8767   rm -f conftest.er1
8768   cat conftest.err >&5
8769   echo "$as_me:8769: \$? = $ac_status" >&5
8770   (exit $ac_status); } >/dev/null; then
8771   if test -s conftest.err; then
8772     ac_cpp_err=$ac_c_preproc_warn_flag
8773   else
8774     ac_cpp_err=
8775   fi
8776 else
8777   ac_cpp_err=yes
8778 fi
8779 if test -z "$ac_cpp_err"; then
8780   eval "$as_ac_Header=yes"
8781 else
8782   echo "$as_me: failed program was:" >&5
8783   cat conftest.$ac_ext >&5
8784   eval "$as_ac_Header=no"
8785 fi
8786 rm -f conftest.err conftest.$ac_ext
8787 fi
8788 echo "$as_me:8788: result: `eval echo '${'$as_ac_Header'}'`" >&5
8789 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
8790 if test `eval echo '${'$as_ac_Header'}'` = yes; then
8791   cat >>confdefs.h <<EOF
8792 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
8793 EOF
8794
8795 fi
8796 done
8797
8798 cat >>confdefs.h <<\EOF
8799 #define NCURSES 1
8800 EOF
8801
8802 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
8803
8804                 cat >>confdefs.h <<EOF
8805 #define $cf_nculib_ROOT 1
8806 EOF
8807
8808                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
8809
8810         else
8811
8812 cf_ncuhdr_root=$cf_cv_screen
8813
8814 test -n "$cf_cv_curses_dir" && \
8815 test "$cf_cv_curses_dir" != "no" && { \
8816
8817 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
8818   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
8819   do
8820         while test $cf_add_incdir != /usr/include
8821         do
8822           if test -d $cf_add_incdir
8823           then
8824                 cf_have_incdir=no
8825                 if test -n "$CFLAGS$CPPFLAGS" ; then
8826                   # a loop is needed to ensure we can add subdirs of existing dirs
8827                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8828                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8829                           cf_have_incdir=yes; break
8830                         fi
8831                   done
8832                 fi
8833
8834                 if test "$cf_have_incdir" = no ; then
8835                   if test "$cf_add_incdir" = /usr/local/include ; then
8836                         if test "$GCC" = yes
8837                         then
8838                           cf_save_CPPFLAGS=$CPPFLAGS
8839                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8840                           cat >conftest.$ac_ext <<_ACEOF
8841 #line 8841 "configure"
8842 #include "confdefs.h"
8843 #include <stdio.h>
8844 int
8845 main (void)
8846 {
8847 printf("Hello")
8848   ;
8849   return 0;
8850 }
8851 _ACEOF
8852 rm -f conftest.$ac_objext
8853 if { (eval echo "$as_me:8853: \"$ac_compile\"") >&5
8854   (eval $ac_compile) 2>&5
8855   ac_status=$?
8856   echo "$as_me:8856: \$? = $ac_status" >&5
8857   (exit $ac_status); } &&
8858          { ac_try='test -s conftest.$ac_objext'
8859   { (eval echo "$as_me:8859: \"$ac_try\"") >&5
8860   (eval $ac_try) 2>&5
8861   ac_status=$?
8862   echo "$as_me:8862: \$? = $ac_status" >&5
8863   (exit $ac_status); }; }; then
8864   :
8865 else
8866   echo "$as_me: failed program was:" >&5
8867 cat conftest.$ac_ext >&5
8868 cf_have_incdir=yes
8869 fi
8870 rm -f conftest.$ac_objext conftest.$ac_ext
8871                           CPPFLAGS=$cf_save_CPPFLAGS
8872                         fi
8873                   fi
8874                 fi
8875
8876                 if test "$cf_have_incdir" = no ; then
8877                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8878
8879 echo "${as_me:-configure}:8879: testing adding $cf_add_incdir to include-path ..." 1>&5
8880
8881                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8882
8883                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8884                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8885                   cf_add_incdir="$cf_top_incdir"
8886                 else
8887                   break
8888                 fi
8889           else
8890                 break
8891           fi
8892         done
8893   done
8894 fi
8895
8896 }
8897
8898 echo "$as_me:8898: checking for $cf_ncuhdr_root header in include-path" >&5
8899 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
8900 if test "${cf_cv_ncurses_h+set}" = set; then
8901   echo $ECHO_N "(cached) $ECHO_C" >&6
8902 else
8903
8904         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
8905         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
8906         for cf_header in $cf_header_list
8907         do
8908
8909         cat >conftest.$ac_ext <<_ACEOF
8910 #line 8910 "configure"
8911 #include "confdefs.h"
8912
8913 #include <$cf_header>
8914 int
8915 main (void)
8916 {
8917
8918 #ifdef NCURSES_VERSION
8919
8920 printf("%s\n", NCURSES_VERSION);
8921 #else
8922 #ifdef __NCURSES_H
8923 printf("old\n");
8924 #else
8925         make an error
8926 #endif
8927 #endif
8928
8929   ;
8930   return 0;
8931 }
8932 _ACEOF
8933 rm -f conftest.$ac_objext
8934 if { (eval echo "$as_me:8934: \"$ac_compile\"") >&5
8935   (eval $ac_compile) 2>&5
8936   ac_status=$?
8937   echo "$as_me:8937: \$? = $ac_status" >&5
8938   (exit $ac_status); } &&
8939          { ac_try='test -s conftest.$ac_objext'
8940   { (eval echo "$as_me:8940: \"$ac_try\"") >&5
8941   (eval $ac_try) 2>&5
8942   ac_status=$?
8943   echo "$as_me:8943: \$? = $ac_status" >&5
8944   (exit $ac_status); }; }; then
8945   cf_cv_ncurses_h=$cf_header
8946
8947 else
8948   echo "$as_me: failed program was:" >&5
8949 cat conftest.$ac_ext >&5
8950 cf_cv_ncurses_h=no
8951 fi
8952 rm -f conftest.$ac_objext conftest.$ac_ext
8953
8954                 test "$cf_cv_ncurses_h" != no && break
8955         done
8956
8957 fi
8958 echo "$as_me:8958: result: $cf_cv_ncurses_h" >&5
8959 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
8960
8961 if test "$cf_cv_ncurses_h" != no ; then
8962         cf_cv_ncurses_header=$cf_cv_ncurses_h
8963 else
8964
8965 echo "$as_me:8965: checking for $cf_ncuhdr_root include-path" >&5
8966 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
8967 if test "${cf_cv_ncurses_h2+set}" = set; then
8968   echo $ECHO_N "(cached) $ECHO_C" >&6
8969 else
8970
8971         test -n "$verbose" && echo
8972
8973 cf_search=
8974
8975 # collect the current set of include-directories from compiler flags
8976 cf_header_path_list=""
8977 if test -n "${CFLAGS}${CPPFLAGS}" ; then
8978         for cf_header_path in $CPPFLAGS $CFLAGS
8979         do
8980                 case $cf_header_path in
8981                 (-I*)
8982                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
8983
8984 test "x$cf_header_path" != "xNONE" && \
8985 test -d "$cf_header_path" && \
8986  {
8987         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
8988         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
8989         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
8990         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
8991         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
8992         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"
8993 }
8994
8995                         cf_header_path_list="$cf_header_path_list $cf_search"
8996                         ;;
8997                 esac
8998         done
8999 fi
9000
9001 # add the variations for the package we are looking for
9002
9003 cf_search=
9004
9005 test "x$prefix" != "xNONE" && \
9006 test -d "$prefix" && \
9007  {
9008         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
9009         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
9010         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
9011         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
9012         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
9013         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
9014 }
9015
9016 for cf_subdir_prefix in \
9017         /usr \
9018         /usr/local \
9019         /usr/pkg \
9020         /opt \
9021         /opt/local \
9022         $HOME
9023 do
9024
9025 test "x$cf_subdir_prefix" != "x$prefix" && \
9026 test -d "$cf_subdir_prefix" && \
9027 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
9028         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
9029         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
9030         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
9031         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
9032         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
9033         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"
9034 }
9035
9036 done
9037
9038 test "$includedir" != NONE && \
9039 test "$includedir" != "/usr/include" && \
9040 test -d "$includedir" && {
9041         test -d $includedir &&    cf_search="$cf_search $includedir"
9042         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
9043 }
9044
9045 test "$oldincludedir" != NONE && \
9046 test "$oldincludedir" != "/usr/include" && \
9047 test -d "$oldincludedir" && {
9048         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
9049         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
9050 }
9051
9052 cf_search="$cf_search $cf_header_path_list"
9053
9054         test -n "$verbose" && echo search path $cf_search
9055         cf_save2_CPPFLAGS="$CPPFLAGS"
9056         for cf_incdir in $cf_search
9057         do
9058
9059 if test -n "$cf_incdir" ; then
9060   for cf_add_incdir in $cf_incdir
9061   do
9062         while test $cf_add_incdir != /usr/include
9063         do
9064           if test -d $cf_add_incdir
9065           then
9066                 cf_have_incdir=no
9067                 if test -n "$CFLAGS$CPPFLAGS" ; then
9068                   # a loop is needed to ensure we can add subdirs of existing dirs
9069                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
9070                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
9071                           cf_have_incdir=yes; break
9072                         fi
9073                   done
9074                 fi
9075
9076                 if test "$cf_have_incdir" = no ; then
9077                   if test "$cf_add_incdir" = /usr/local/include ; then
9078                         if test "$GCC" = yes
9079                         then
9080                           cf_save_CPPFLAGS=$CPPFLAGS
9081                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9082                           cat >conftest.$ac_ext <<_ACEOF
9083 #line 9083 "configure"
9084 #include "confdefs.h"
9085 #include <stdio.h>
9086 int
9087 main (void)
9088 {
9089 printf("Hello")
9090   ;
9091   return 0;
9092 }
9093 _ACEOF
9094 rm -f conftest.$ac_objext
9095 if { (eval echo "$as_me:9095: \"$ac_compile\"") >&5
9096   (eval $ac_compile) 2>&5
9097   ac_status=$?
9098   echo "$as_me:9098: \$? = $ac_status" >&5
9099   (exit $ac_status); } &&
9100          { ac_try='test -s conftest.$ac_objext'
9101   { (eval echo "$as_me:9101: \"$ac_try\"") >&5
9102   (eval $ac_try) 2>&5
9103   ac_status=$?
9104   echo "$as_me:9104: \$? = $ac_status" >&5
9105   (exit $ac_status); }; }; then
9106   :
9107 else
9108   echo "$as_me: failed program was:" >&5
9109 cat conftest.$ac_ext >&5
9110 cf_have_incdir=yes
9111 fi
9112 rm -f conftest.$ac_objext conftest.$ac_ext
9113                           CPPFLAGS=$cf_save_CPPFLAGS
9114                         fi
9115                   fi
9116                 fi
9117
9118                 if test "$cf_have_incdir" = no ; then
9119                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
9120
9121 echo "${as_me:-configure}:9121: testing adding $cf_add_incdir to include-path ..." 1>&5
9122
9123                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9124
9125                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
9126                   test "$cf_top_incdir" = "$cf_add_incdir" && break
9127                   cf_add_incdir="$cf_top_incdir"
9128                 else
9129                   break
9130                 fi
9131           else
9132                 break
9133           fi
9134         done
9135   done
9136 fi
9137
9138                 for cf_header in \
9139                         ncurses.h \
9140                         curses.h
9141                 do
9142
9143         cat >conftest.$ac_ext <<_ACEOF
9144 #line 9144 "configure"
9145 #include "confdefs.h"
9146
9147 #include <$cf_header>
9148 int
9149 main (void)
9150 {
9151
9152 #ifdef NCURSES_VERSION
9153
9154 printf("%s\n", NCURSES_VERSION);
9155 #else
9156 #ifdef __NCURSES_H
9157 printf("old\n");
9158 #else
9159         make an error
9160 #endif
9161 #endif
9162
9163   ;
9164   return 0;
9165 }
9166 _ACEOF
9167 rm -f conftest.$ac_objext
9168 if { (eval echo "$as_me:9168: \"$ac_compile\"") >&5
9169   (eval $ac_compile) 2>&5
9170   ac_status=$?
9171   echo "$as_me:9171: \$? = $ac_status" >&5
9172   (exit $ac_status); } &&
9173          { ac_try='test -s conftest.$ac_objext'
9174   { (eval echo "$as_me:9174: \"$ac_try\"") >&5
9175   (eval $ac_try) 2>&5
9176   ac_status=$?
9177   echo "$as_me:9177: \$? = $ac_status" >&5
9178   (exit $ac_status); }; }; then
9179   cf_cv_ncurses_h2=$cf_header
9180
9181 else
9182   echo "$as_me: failed program was:" >&5
9183 cat conftest.$ac_ext >&5
9184 cf_cv_ncurses_h2=no
9185 fi
9186 rm -f conftest.$ac_objext conftest.$ac_ext
9187
9188                         if test "$cf_cv_ncurses_h2" != no ; then
9189                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
9190                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
9191                                 break
9192                         fi
9193                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
9194                 done
9195                 CPPFLAGS="$cf_save2_CPPFLAGS"
9196                 test "$cf_cv_ncurses_h2" != no && break
9197         done
9198         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:9198: error: not found" >&5
9199 echo "$as_me: error: not found" >&2;}
9200    { (exit 1); exit 1; }; }
9201
9202 fi
9203 echo "$as_me:9203: result: $cf_cv_ncurses_h2" >&5
9204 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
9205
9206         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
9207         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
9208         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
9209                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
9210         fi
9211
9212 if test -n "$cf_1st_incdir" ; then
9213   for cf_add_incdir in $cf_1st_incdir
9214   do
9215         while test $cf_add_incdir != /usr/include
9216         do
9217           if test -d $cf_add_incdir
9218           then
9219                 cf_have_incdir=no
9220                 if test -n "$CFLAGS$CPPFLAGS" ; then
9221                   # a loop is needed to ensure we can add subdirs of existing dirs
9222                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
9223                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
9224                           cf_have_incdir=yes; break
9225                         fi
9226                   done
9227                 fi
9228
9229                 if test "$cf_have_incdir" = no ; then
9230                   if test "$cf_add_incdir" = /usr/local/include ; then
9231                         if test "$GCC" = yes
9232                         then
9233                           cf_save_CPPFLAGS=$CPPFLAGS
9234                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9235                           cat >conftest.$ac_ext <<_ACEOF
9236 #line 9236 "configure"
9237 #include "confdefs.h"
9238 #include <stdio.h>
9239 int
9240 main (void)
9241 {
9242 printf("Hello")
9243   ;
9244   return 0;
9245 }
9246 _ACEOF
9247 rm -f conftest.$ac_objext
9248 if { (eval echo "$as_me:9248: \"$ac_compile\"") >&5
9249   (eval $ac_compile) 2>&5
9250   ac_status=$?
9251   echo "$as_me:9251: \$? = $ac_status" >&5
9252   (exit $ac_status); } &&
9253          { ac_try='test -s conftest.$ac_objext'
9254   { (eval echo "$as_me:9254: \"$ac_try\"") >&5
9255   (eval $ac_try) 2>&5
9256   ac_status=$?
9257   echo "$as_me:9257: \$? = $ac_status" >&5
9258   (exit $ac_status); }; }; then
9259   :
9260 else
9261   echo "$as_me: failed program was:" >&5
9262 cat conftest.$ac_ext >&5
9263 cf_have_incdir=yes
9264 fi
9265 rm -f conftest.$ac_objext conftest.$ac_ext
9266                           CPPFLAGS=$cf_save_CPPFLAGS
9267                         fi
9268                   fi
9269                 fi
9270
9271                 if test "$cf_have_incdir" = no ; then
9272                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
9273
9274 echo "${as_me:-configure}:9274: testing adding $cf_add_incdir to include-path ..." 1>&5
9275
9276                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9277
9278                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
9279                   test "$cf_top_incdir" = "$cf_add_incdir" && break
9280                   cf_add_incdir="$cf_top_incdir"
9281                 else
9282                   break
9283                 fi
9284           else
9285                 break
9286           fi
9287         done
9288   done
9289 fi
9290
9291 fi
9292
9293 # Set definitions to allow ifdef'ing for ncurses.h
9294
9295 case $cf_cv_ncurses_header in
9296 (*ncurses.h)
9297
9298 cat >>confdefs.h <<\EOF
9299 #define HAVE_NCURSES_H 1
9300 EOF
9301
9302         ;;
9303 esac
9304
9305 case $cf_cv_ncurses_header in
9306 (ncurses/curses.h|ncurses/ncurses.h)
9307
9308 cat >>confdefs.h <<\EOF
9309 #define HAVE_NCURSES_NCURSES_H 1
9310 EOF
9311
9312         ;;
9313 (ncursesw/curses.h|ncursesw/ncurses.h)
9314
9315 cat >>confdefs.h <<\EOF
9316 #define HAVE_NCURSESW_NCURSES_H 1
9317 EOF
9318
9319         ;;
9320 esac
9321
9322 echo "$as_me:9322: checking for terminfo header" >&5
9323 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
9324 if test "${cf_cv_term_header+set}" = set; then
9325   echo $ECHO_N "(cached) $ECHO_C" >&6
9326 else
9327
9328 case ${cf_cv_ncurses_header} in
9329 (*/ncurses.h|*/ncursesw.h)
9330         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
9331         ;;
9332 (*)
9333         cf_term_header=term.h
9334         ;;
9335 esac
9336
9337 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
9338 do
9339 cat >conftest.$ac_ext <<_ACEOF
9340 #line 9340 "configure"
9341 #include "confdefs.h"
9342 #include <stdio.h>
9343 #include <${cf_cv_ncurses_header:-curses.h}>
9344 #include <$cf_test>
9345
9346 int
9347 main (void)
9348 {
9349 int x = auto_left_margin
9350   ;
9351   return 0;
9352 }
9353 _ACEOF
9354 rm -f conftest.$ac_objext
9355 if { (eval echo "$as_me:9355: \"$ac_compile\"") >&5
9356   (eval $ac_compile) 2>&5
9357   ac_status=$?
9358   echo "$as_me:9358: \$? = $ac_status" >&5
9359   (exit $ac_status); } &&
9360          { ac_try='test -s conftest.$ac_objext'
9361   { (eval echo "$as_me:9361: \"$ac_try\"") >&5
9362   (eval $ac_try) 2>&5
9363   ac_status=$?
9364   echo "$as_me:9364: \$? = $ac_status" >&5
9365   (exit $ac_status); }; }; then
9366
9367         cf_cv_term_header="$cf_test"
9368 else
9369   echo "$as_me: failed program was:" >&5
9370 cat conftest.$ac_ext >&5
9371
9372         cf_cv_term_header=unknown
9373
9374 fi
9375 rm -f conftest.$ac_objext conftest.$ac_ext
9376         test "$cf_cv_term_header" != unknown && break
9377 done
9378
9379 fi
9380 echo "$as_me:9380: result: $cf_cv_term_header" >&5
9381 echo "${ECHO_T}$cf_cv_term_header" >&6
9382
9383 # Set definitions to allow ifdef'ing to accommodate subdirectories
9384
9385 case $cf_cv_term_header in
9386 (*term.h)
9387
9388 cat >>confdefs.h <<\EOF
9389 #define HAVE_TERM_H 1
9390 EOF
9391
9392         ;;
9393 esac
9394
9395 case $cf_cv_term_header in
9396 (ncurses/term.h)
9397
9398 cat >>confdefs.h <<\EOF
9399 #define HAVE_NCURSES_TERM_H 1
9400 EOF
9401
9402         ;;
9403 (ncursesw/term.h)
9404
9405 cat >>confdefs.h <<\EOF
9406 #define HAVE_NCURSESW_TERM_H 1
9407 EOF
9408
9409         ;;
9410 esac
9411
9412 # some applications need this, but should check for NCURSES_VERSION
9413
9414 cat >>confdefs.h <<\EOF
9415 #define NCURSES 1
9416 EOF
9417
9418 echo "$as_me:9418: checking for ncurses version" >&5
9419 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
9420 if test "${cf_cv_ncurses_version+set}" = set; then
9421   echo $ECHO_N "(cached) $ECHO_C" >&6
9422 else
9423
9424         cf_cv_ncurses_version=no
9425         cf_tempfile=out$$
9426         rm -f $cf_tempfile
9427         if test "$cross_compiling" = yes; then
9428
9429         # This will not work if the preprocessor splits the line after the
9430         # Autoconf token.  The 'unproto' program does that.
9431         cat > conftest.$ac_ext <<EOF
9432 #include <${cf_cv_ncurses_header:-curses.h}>
9433 #undef Autoconf
9434 #ifdef NCURSES_VERSION
9435 Autoconf NCURSES_VERSION
9436 #else
9437 #ifdef __NCURSES_H
9438 Autoconf "old"
9439 #endif
9440 ;
9441 #endif
9442 EOF
9443         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
9444         { (eval echo "$as_me:9444: \"$cf_try\"") >&5
9445   (eval $cf_try) 2>&5
9446   ac_status=$?
9447   echo "$as_me:9447: \$? = $ac_status" >&5
9448   (exit $ac_status); }
9449         if test -f conftest.out ; then
9450                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
9451                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
9452                 rm -f conftest.out
9453         fi
9454
9455 else
9456   cat >conftest.$ac_ext <<_ACEOF
9457 #line 9457 "configure"
9458 #include "confdefs.h"
9459
9460 #include <${cf_cv_ncurses_header:-curses.h}>
9461 #include <stdio.h>
9462 int main(void)
9463 {
9464         FILE *fp = fopen("$cf_tempfile", "w");
9465 #ifdef NCURSES_VERSION
9466 # ifdef NCURSES_VERSION_PATCH
9467         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
9468 # else
9469         fprintf(fp, "%s\n", NCURSES_VERSION);
9470 # endif
9471 #else
9472 # ifdef __NCURSES_H
9473         fprintf(fp, "old\n");
9474 # else
9475         make an error
9476 # endif
9477 #endif
9478         ${cf_cv_main_return:-return}(0);
9479 }
9480 _ACEOF
9481 rm -f conftest$ac_exeext
9482 if { (eval echo "$as_me:9482: \"$ac_link\"") >&5
9483   (eval $ac_link) 2>&5
9484   ac_status=$?
9485   echo "$as_me:9485: \$? = $ac_status" >&5
9486   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
9487   { (eval echo "$as_me:9487: \"$ac_try\"") >&5
9488   (eval $ac_try) 2>&5
9489   ac_status=$?
9490   echo "$as_me:9490: \$? = $ac_status" >&5
9491   (exit $ac_status); }; }; then
9492
9493         cf_cv_ncurses_version=`cat $cf_tempfile`
9494 else
9495   echo "$as_me: program exited with status $ac_status" >&5
9496 echo "$as_me: failed program was:" >&5
9497 cat conftest.$ac_ext >&5
9498 fi
9499 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
9500 fi
9501         rm -f $cf_tempfile
9502
9503 fi
9504 echo "$as_me:9504: result: $cf_cv_ncurses_version" >&5
9505 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
9506 test "$cf_cv_ncurses_version" = no ||
9507 cat >>confdefs.h <<\EOF
9508 #define NCURSES 1
9509 EOF
9510
9511 cf_nculib_root=$cf_cv_screen
9512         # This works, except for the special case where we find gpm, but
9513         # ncurses is in a nonstandard location via $LIBS, and we really want
9514         # to link gpm.
9515 cf_ncurses_LIBS=""
9516 cf_ncurses_SAVE="$LIBS"
9517 echo "$as_me:9517: checking for Gpm_Open in -lgpm" >&5
9518 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
9519 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
9520   echo $ECHO_N "(cached) $ECHO_C" >&6
9521 else
9522   ac_check_lib_save_LIBS=$LIBS
9523 LIBS="-lgpm  $LIBS"
9524 cat >conftest.$ac_ext <<_ACEOF
9525 #line 9525 "configure"
9526 #include "confdefs.h"
9527
9528 /* Override any gcc2 internal prototype to avoid an error.  */
9529 #ifdef __cplusplus
9530 extern "C"
9531 #endif
9532 /* We use char because int might match the return type of a gcc2
9533    builtin and then its argument prototype would still apply.  */
9534 char Gpm_Open ();
9535 int
9536 main (void)
9537 {
9538 Gpm_Open ();
9539   ;
9540   return 0;
9541 }
9542 _ACEOF
9543 rm -f conftest.$ac_objext conftest$ac_exeext
9544 if { (eval echo "$as_me:9544: \"$ac_link\"") >&5
9545   (eval $ac_link) 2>&5
9546   ac_status=$?
9547   echo "$as_me:9547: \$? = $ac_status" >&5
9548   (exit $ac_status); } &&
9549          { ac_try='test -s conftest$ac_exeext'
9550   { (eval echo "$as_me:9550: \"$ac_try\"") >&5
9551   (eval $ac_try) 2>&5
9552   ac_status=$?
9553   echo "$as_me:9553: \$? = $ac_status" >&5
9554   (exit $ac_status); }; }; then
9555   ac_cv_lib_gpm_Gpm_Open=yes
9556 else
9557   echo "$as_me: failed program was:" >&5
9558 cat conftest.$ac_ext >&5
9559 ac_cv_lib_gpm_Gpm_Open=no
9560 fi
9561 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9562 LIBS=$ac_check_lib_save_LIBS
9563 fi
9564 echo "$as_me:9564: result: $ac_cv_lib_gpm_Gpm_Open" >&5
9565 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
9566 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
9567   echo "$as_me:9567: checking for initscr in -lgpm" >&5
9568 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
9569 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
9570   echo $ECHO_N "(cached) $ECHO_C" >&6
9571 else
9572   ac_check_lib_save_LIBS=$LIBS
9573 LIBS="-lgpm  $LIBS"
9574 cat >conftest.$ac_ext <<_ACEOF
9575 #line 9575 "configure"
9576 #include "confdefs.h"
9577
9578 /* Override any gcc2 internal prototype to avoid an error.  */
9579 #ifdef __cplusplus
9580 extern "C"
9581 #endif
9582 /* We use char because int might match the return type of a gcc2
9583    builtin and then its argument prototype would still apply.  */
9584 char initscr ();
9585 int
9586 main (void)
9587 {
9588 initscr ();
9589   ;
9590   return 0;
9591 }
9592 _ACEOF
9593 rm -f conftest.$ac_objext conftest$ac_exeext
9594 if { (eval echo "$as_me:9594: \"$ac_link\"") >&5
9595   (eval $ac_link) 2>&5
9596   ac_status=$?
9597   echo "$as_me:9597: \$? = $ac_status" >&5
9598   (exit $ac_status); } &&
9599          { ac_try='test -s conftest$ac_exeext'
9600   { (eval echo "$as_me:9600: \"$ac_try\"") >&5
9601   (eval $ac_try) 2>&5
9602   ac_status=$?
9603   echo "$as_me:9603: \$? = $ac_status" >&5
9604   (exit $ac_status); }; }; then
9605   ac_cv_lib_gpm_initscr=yes
9606 else
9607   echo "$as_me: failed program was:" >&5
9608 cat conftest.$ac_ext >&5
9609 ac_cv_lib_gpm_initscr=no
9610 fi
9611 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9612 LIBS=$ac_check_lib_save_LIBS
9613 fi
9614 echo "$as_me:9614: result: $ac_cv_lib_gpm_initscr" >&5
9615 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
9616 if test $ac_cv_lib_gpm_initscr = yes; then
9617   LIBS="$cf_ncurses_SAVE"
9618 else
9619   cf_ncurses_LIBS="-lgpm"
9620 fi
9621
9622 fi
9623
9624 case $host_os in
9625 (freebsd*)
9626         # This is only necessary if you are linking against an obsolete
9627         # version of ncurses (but it should do no harm, since it's static).
9628         if test "$cf_nculib_root" = ncurses ; then
9629                 echo "$as_me:9629: checking for tgoto in -lmytinfo" >&5
9630 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
9631 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
9632   echo $ECHO_N "(cached) $ECHO_C" >&6
9633 else
9634   ac_check_lib_save_LIBS=$LIBS
9635 LIBS="-lmytinfo  $LIBS"
9636 cat >conftest.$ac_ext <<_ACEOF
9637 #line 9637 "configure"
9638 #include "confdefs.h"
9639
9640 /* Override any gcc2 internal prototype to avoid an error.  */
9641 #ifdef __cplusplus
9642 extern "C"
9643 #endif
9644 /* We use char because int might match the return type of a gcc2
9645    builtin and then its argument prototype would still apply.  */
9646 char tgoto ();
9647 int
9648 main (void)
9649 {
9650 tgoto ();
9651   ;
9652   return 0;
9653 }
9654 _ACEOF
9655 rm -f conftest.$ac_objext conftest$ac_exeext
9656 if { (eval echo "$as_me:9656: \"$ac_link\"") >&5
9657   (eval $ac_link) 2>&5
9658   ac_status=$?
9659   echo "$as_me:9659: \$? = $ac_status" >&5
9660   (exit $ac_status); } &&
9661          { ac_try='test -s conftest$ac_exeext'
9662   { (eval echo "$as_me:9662: \"$ac_try\"") >&5
9663   (eval $ac_try) 2>&5
9664   ac_status=$?
9665   echo "$as_me:9665: \$? = $ac_status" >&5
9666   (exit $ac_status); }; }; then
9667   ac_cv_lib_mytinfo_tgoto=yes
9668 else
9669   echo "$as_me: failed program was:" >&5
9670 cat conftest.$ac_ext >&5
9671 ac_cv_lib_mytinfo_tgoto=no
9672 fi
9673 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9674 LIBS=$ac_check_lib_save_LIBS
9675 fi
9676 echo "$as_me:9676: result: $ac_cv_lib_mytinfo_tgoto" >&5
9677 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
9678 if test $ac_cv_lib_mytinfo_tgoto = yes; then
9679   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
9680 fi
9681
9682         fi
9683         ;;
9684 esac
9685
9686 cf_add_libs="$cf_ncurses_LIBS"
9687 # Filter out duplicates - this happens with badly-designed ".pc" files...
9688 for cf_add_1lib in $LIBS
9689 do
9690         for cf_add_2lib in $cf_add_libs
9691         do
9692                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
9693                 then
9694                         cf_add_1lib=
9695                         break
9696                 fi
9697         done
9698         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
9699 done
9700 LIBS="$cf_add_libs"
9701
9702 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
9703 then
9704
9705 cf_add_libs="-l$cf_nculib_root"
9706 # Filter out duplicates - this happens with badly-designed ".pc" files...
9707 for cf_add_1lib in $LIBS
9708 do
9709         for cf_add_2lib in $cf_add_libs
9710         do
9711                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
9712                 then
9713                         cf_add_1lib=
9714                         break
9715                 fi
9716         done
9717         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
9718 done
9719 LIBS="$cf_add_libs"
9720
9721 else
9722
9723         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
9724         cf_libdir=""
9725         echo "$as_me:9725: checking for initscr" >&5
9726 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
9727 if test "${ac_cv_func_initscr+set}" = set; then
9728   echo $ECHO_N "(cached) $ECHO_C" >&6
9729 else
9730   cat >conftest.$ac_ext <<_ACEOF
9731 #line 9731 "configure"
9732 #include "confdefs.h"
9733 /* System header to define __stub macros and hopefully few prototypes,
9734     which can conflict with char initscr (); below.  */
9735 #include <assert.h>
9736 /* Override any gcc2 internal prototype to avoid an error.  */
9737 #ifdef __cplusplus
9738 extern "C"
9739 #endif
9740 /* We use char because int might match the return type of a gcc2
9741    builtin and then its argument prototype would still apply.  */
9742 char initscr ();
9743 char (*f) ();
9744
9745 int
9746 main (void)
9747 {
9748 /* The GNU C library defines this for functions which it implements
9749     to always fail with ENOSYS.  Some functions are actually named
9750     something starting with __ and the normal name is an alias.  */
9751 #if defined (__stub_initscr) || defined (__stub___initscr)
9752 choke me
9753 #else
9754 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
9755 #endif
9756
9757   ;
9758   return 0;
9759 }
9760 _ACEOF
9761 rm -f conftest.$ac_objext conftest$ac_exeext
9762 if { (eval echo "$as_me:9762: \"$ac_link\"") >&5
9763   (eval $ac_link) 2>&5
9764   ac_status=$?
9765   echo "$as_me:9765: \$? = $ac_status" >&5
9766   (exit $ac_status); } &&
9767          { ac_try='test -s conftest$ac_exeext'
9768   { (eval echo "$as_me:9768: \"$ac_try\"") >&5
9769   (eval $ac_try) 2>&5
9770   ac_status=$?
9771   echo "$as_me:9771: \$? = $ac_status" >&5
9772   (exit $ac_status); }; }; then
9773   ac_cv_func_initscr=yes
9774 else
9775   echo "$as_me: failed program was:" >&5
9776 cat conftest.$ac_ext >&5
9777 ac_cv_func_initscr=no
9778 fi
9779 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9780 fi
9781 echo "$as_me:9781: result: $ac_cv_func_initscr" >&5
9782 echo "${ECHO_T}$ac_cv_func_initscr" >&6
9783 if test $ac_cv_func_initscr = yes; then
9784   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9785 else
9786
9787                 cf_save_LIBS="$LIBS"
9788                 echo "$as_me:9788: checking for initscr in -l$cf_nculib_root" >&5
9789 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
9790                 LIBS="-l$cf_nculib_root $LIBS"
9791                 cat >conftest.$ac_ext <<_ACEOF
9792 #line 9792 "configure"
9793 #include "confdefs.h"
9794 #include <${cf_cv_ncurses_header:-curses.h}>
9795 int
9796 main (void)
9797 {
9798 initscr()
9799   ;
9800   return 0;
9801 }
9802 _ACEOF
9803 rm -f conftest.$ac_objext conftest$ac_exeext
9804 if { (eval echo "$as_me:9804: \"$ac_link\"") >&5
9805   (eval $ac_link) 2>&5
9806   ac_status=$?
9807   echo "$as_me:9807: \$? = $ac_status" >&5
9808   (exit $ac_status); } &&
9809          { ac_try='test -s conftest$ac_exeext'
9810   { (eval echo "$as_me:9810: \"$ac_try\"") >&5
9811   (eval $ac_try) 2>&5
9812   ac_status=$?
9813   echo "$as_me:9813: \$? = $ac_status" >&5
9814   (exit $ac_status); }; }; then
9815   echo "$as_me:9815: result: yes" >&5
9816 echo "${ECHO_T}yes" >&6
9817                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9818
9819 else
9820   echo "$as_me: failed program was:" >&5
9821 cat conftest.$ac_ext >&5
9822 echo "$as_me:9822: result: no" >&5
9823 echo "${ECHO_T}no" >&6
9824
9825 cf_search=
9826 cf_library_path_list=""
9827 if test -n "${LDFLAGS}${LIBS}" ; then
9828         for cf_library_path in $LDFLAGS $LIBS
9829         do
9830                 case $cf_library_path in
9831                 (-L*)
9832                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
9833
9834 test "x$cf_library_path" != "xNONE" && \
9835 test -d "$cf_library_path" && \
9836  {
9837         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
9838         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
9839         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
9840         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
9841         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
9842         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"
9843 }
9844
9845                         cf_library_path_list="$cf_library_path_list $cf_search"
9846                         ;;
9847                 esac
9848         done
9849 fi
9850
9851 cf_search=
9852
9853 test "x$prefix" != "xNONE" && \
9854 test -d "$prefix" && \
9855  {
9856         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
9857         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
9858         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
9859         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
9860         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
9861         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
9862 }
9863
9864 for cf_subdir_prefix in \
9865         /usr \
9866         /usr/local \
9867         /usr/pkg \
9868         /opt \
9869         /opt/local \
9870         $HOME
9871 do
9872
9873 test "x$cf_subdir_prefix" != "x$prefix" && \
9874 test -d "$cf_subdir_prefix" && \
9875 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
9876         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
9877         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
9878         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
9879         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
9880         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
9881         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"
9882 }
9883
9884 done
9885
9886 cf_search="$cf_library_path_list $cf_search"
9887
9888                         for cf_libdir in $cf_search
9889                         do
9890                                 echo "$as_me:9890: checking for -l$cf_nculib_root in $cf_libdir" >&5
9891 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
9892                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
9893                                 cat >conftest.$ac_ext <<_ACEOF
9894 #line 9894 "configure"
9895 #include "confdefs.h"
9896 #include <${cf_cv_ncurses_header:-curses.h}>
9897 int
9898 main (void)
9899 {
9900 initscr()
9901   ;
9902   return 0;
9903 }
9904 _ACEOF
9905 rm -f conftest.$ac_objext conftest$ac_exeext
9906 if { (eval echo "$as_me:9906: \"$ac_link\"") >&5
9907   (eval $ac_link) 2>&5
9908   ac_status=$?
9909   echo "$as_me:9909: \$? = $ac_status" >&5
9910   (exit $ac_status); } &&
9911          { ac_try='test -s conftest$ac_exeext'
9912   { (eval echo "$as_me:9912: \"$ac_try\"") >&5
9913   (eval $ac_try) 2>&5
9914   ac_status=$?
9915   echo "$as_me:9915: \$? = $ac_status" >&5
9916   (exit $ac_status); }; }; then
9917   echo "$as_me:9917: result: yes" >&5
9918 echo "${ECHO_T}yes" >&6
9919                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9920                                          break
9921 else
9922   echo "$as_me: failed program was:" >&5
9923 cat conftest.$ac_ext >&5
9924 echo "$as_me:9924: result: no" >&5
9925 echo "${ECHO_T}no" >&6
9926                                          LIBS="$cf_save_LIBS"
9927 fi
9928 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9929                         done
9930
9931 fi
9932 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9933
9934 fi
9935
9936 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
9937
9938 if test $cf_found_library = no ; then
9939         { { echo "$as_me:9939: error: Cannot link $cf_nculib_root library" >&5
9940 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
9941    { (exit 1); exit 1; }; }
9942 fi
9943
9944 fi
9945
9946 if test -n "$cf_ncurses_LIBS" ; then
9947         echo "$as_me:9947: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
9948 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
9949         cf_ncurses_SAVE="$LIBS"
9950         for p in $cf_ncurses_LIBS ; do
9951                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
9952                 if test "$q" != "$LIBS" ; then
9953                         LIBS="$q"
9954                 fi
9955         done
9956         cat >conftest.$ac_ext <<_ACEOF
9957 #line 9957 "configure"
9958 #include "confdefs.h"
9959 #include <${cf_cv_ncurses_header:-curses.h}>
9960 int
9961 main (void)
9962 {
9963 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
9964   ;
9965   return 0;
9966 }
9967 _ACEOF
9968 rm -f conftest.$ac_objext conftest$ac_exeext
9969 if { (eval echo "$as_me:9969: \"$ac_link\"") >&5
9970   (eval $ac_link) 2>&5
9971   ac_status=$?
9972   echo "$as_me:9972: \$? = $ac_status" >&5
9973   (exit $ac_status); } &&
9974          { ac_try='test -s conftest$ac_exeext'
9975   { (eval echo "$as_me:9975: \"$ac_try\"") >&5
9976   (eval $ac_try) 2>&5
9977   ac_status=$?
9978   echo "$as_me:9978: \$? = $ac_status" >&5
9979   (exit $ac_status); }; }; then
9980   echo "$as_me:9980: result: yes" >&5
9981 echo "${ECHO_T}yes" >&6
9982 else
9983   echo "$as_me: failed program was:" >&5
9984 cat conftest.$ac_ext >&5
9985 echo "$as_me:9985: result: no" >&5
9986 echo "${ECHO_T}no" >&6
9987                  LIBS="$cf_ncurses_SAVE"
9988 fi
9989 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9990 fi
9991
9992 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9993
9994 cat >>confdefs.h <<EOF
9995 #define $cf_nculib_ROOT 1
9996 EOF
9997
9998         fi
9999 else
10000         NCURSES_CONFIG=none
10001 fi
10002
10003         ;;
10004 (pdcurses)
10005         echo "$as_me:10005: checking for X" >&5
10006 echo $ECHO_N "checking for X... $ECHO_C" >&6
10007
10008 # Check whether --with-x or --without-x was given.
10009 if test "${with_x+set}" = set; then
10010   withval="$with_x"
10011
10012 fi;
10013 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
10014 if test "x$with_x" = xno; then
10015   # The user explicitly disabled X.
10016   have_x=disabled
10017 else
10018   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
10019     # Both variables are already set.
10020     have_x=yes
10021   else
10022     if test "${ac_cv_have_x+set}" = set; then
10023   echo $ECHO_N "(cached) $ECHO_C" >&6
10024 else
10025   # One or both of the vars are not set, and there is no cached value.
10026 ac_x_includes=no ac_x_libraries=no
10027 rm -fr conftest.dir
10028 if mkdir conftest.dir; then
10029   cd conftest.dir
10030   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
10031   cat >Imakefile <<'EOF'
10032 acfindx:
10033         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
10034 EOF
10035   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
10036     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
10037     eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
10038     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
10039     for ac_extension in a so sl dylib dll; do
10040       if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
10041          test -f $ac_im_libdir/libX11.$ac_extension; then
10042         ac_im_usrlibdir=$ac_im_libdir; break
10043       fi
10044     done
10045     # Screen out bogus values from the imake configuration.  They are
10046     # bogus both because they are the default anyway, and because
10047     # using them would break gcc on systems where it needs fixed includes.
10048     case $ac_im_incroot in
10049         /usr/include) ;;
10050         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
10051     esac
10052     case $ac_im_usrlibdir in
10053         /usr/lib | /lib) ;;
10054         *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
10055     esac
10056   fi
10057   cd ..
10058   rm -fr conftest.dir
10059 fi
10060
10061 # Standard set of common directories for X headers.
10062 # Check X11 before X11Rn because it is often a symlink to the current release.
10063 ac_x_header_dirs='
10064 /usr/X11/include
10065 /usr/X11R6/include
10066 /usr/X11R5/include
10067 /usr/X11R4/include
10068
10069 /usr/include/X11
10070 /usr/include/X11R6
10071 /usr/include/X11R5
10072 /usr/include/X11R4
10073
10074 /usr/local/X11/include
10075 /usr/local/X11R6/include
10076 /usr/local/X11R5/include
10077 /usr/local/X11R4/include
10078
10079 /usr/local/include/X11
10080 /usr/local/include/X11R6
10081 /usr/local/include/X11R5
10082 /usr/local/include/X11R4
10083
10084 /usr/X386/include
10085 /usr/x386/include
10086 /usr/XFree86/include/X11
10087
10088 /usr/include
10089 /usr/local/include
10090 /usr/unsupported/include
10091 /usr/athena/include
10092 /usr/local/x11r5/include
10093 /usr/lpp/Xamples/include
10094
10095 /usr/openwin/include
10096 /usr/openwin/share/include'
10097
10098 if test "$ac_x_includes" = no; then
10099   # Guess where to find include files, by looking for Intrinsic.h.
10100   # First, try using that file with no special directory specified.
10101   cat >conftest.$ac_ext <<_ACEOF
10102 #line 10102 "configure"
10103 #include "confdefs.h"
10104 #include <X11/Intrinsic.h>
10105 _ACEOF
10106 if { (eval echo "$as_me:10106: \"$ac_cpp conftest.$ac_ext\"") >&5
10107   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
10108   ac_status=$?
10109   egrep -v '^ *\+' conftest.er1 >conftest.err
10110   rm -f conftest.er1
10111   cat conftest.err >&5
10112   echo "$as_me:10112: \$? = $ac_status" >&5
10113   (exit $ac_status); } >/dev/null; then
10114   if test -s conftest.err; then
10115     ac_cpp_err=$ac_c_preproc_warn_flag
10116   else
10117     ac_cpp_err=
10118   fi
10119 else
10120   ac_cpp_err=yes
10121 fi
10122 if test -z "$ac_cpp_err"; then
10123   # We can compile using X headers with no special include directory.
10124 ac_x_includes=
10125 else
10126   echo "$as_me: failed program was:" >&5
10127   cat conftest.$ac_ext >&5
10128   for ac_dir in $ac_x_header_dirs; do
10129   if test -r "$ac_dir/X11/Intrinsic.h"; then
10130     ac_x_includes=$ac_dir
10131     break
10132   fi
10133 done
10134 fi
10135 rm -f conftest.err conftest.$ac_ext
10136 fi # $ac_x_includes = no
10137
10138 if test "$ac_x_libraries" = no; then
10139   # Check for the libraries.
10140   # See if we find them without any special options.
10141   # Don't add to $LIBS permanently.
10142   ac_save_LIBS=$LIBS
10143   LIBS="-lXt $LIBS"
10144   cat >conftest.$ac_ext <<_ACEOF
10145 #line 10145 "configure"
10146 #include "confdefs.h"
10147 #include <X11/Intrinsic.h>
10148 int
10149 main (void)
10150 {
10151 XtMalloc (0)
10152   ;
10153   return 0;
10154 }
10155 _ACEOF
10156 rm -f conftest.$ac_objext conftest$ac_exeext
10157 if { (eval echo "$as_me:10157: \"$ac_link\"") >&5
10158   (eval $ac_link) 2>&5
10159   ac_status=$?
10160   echo "$as_me:10160: \$? = $ac_status" >&5
10161   (exit $ac_status); } &&
10162          { ac_try='test -s conftest$ac_exeext'
10163   { (eval echo "$as_me:10163: \"$ac_try\"") >&5
10164   (eval $ac_try) 2>&5
10165   ac_status=$?
10166   echo "$as_me:10166: \$? = $ac_status" >&5
10167   (exit $ac_status); }; }; then
10168   LIBS=$ac_save_LIBS
10169 # We can link X programs with no special library path.
10170 ac_x_libraries=
10171 else
10172   echo "$as_me: failed program was:" >&5
10173 cat conftest.$ac_ext >&5
10174 LIBS=$ac_save_LIBS
10175 for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
10176 do
10177   # Don't even attempt the hair of trying to link an X program!
10178   for ac_extension in a so sl dylib dll; do
10179     if test -r $ac_dir/libXt.$ac_extension; then
10180       ac_x_libraries=$ac_dir
10181       break 2
10182     fi
10183   done
10184 done
10185 fi
10186 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10187 fi # $ac_x_libraries = no
10188
10189 if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then
10190   # Didn't find X anywhere.  Cache the known absence of X.
10191   ac_cv_have_x="have_x=no"
10192 else
10193   # Record where we found X for the cache.
10194   ac_cv_have_x="have_x=yes \
10195                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
10196 fi
10197 fi
10198
10199   fi
10200   eval "$ac_cv_have_x"
10201 fi # $with_x != no
10202
10203 if test "$have_x" != yes; then
10204   echo "$as_me:10204: result: $have_x" >&5
10205 echo "${ECHO_T}$have_x" >&6
10206   no_x=yes
10207 else
10208   # If each of the values was on the command line, it overrides each guess.
10209   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
10210   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
10211   # Update the cache value to reflect the command line values.
10212   ac_cv_have_x="have_x=yes \
10213                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
10214   echo "$as_me:10214: result: libraries $x_libraries, headers $x_includes" >&5
10215 echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6
10216 fi
10217
10218 if test "$no_x" = yes; then
10219   # Not all programs may use this symbol, but it does not hurt to define it.
10220
10221 cat >>confdefs.h <<\EOF
10222 #define X_DISPLAY_MISSING 1
10223 EOF
10224
10225   X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
10226 else
10227   if test -n "$x_includes"; then
10228     X_CFLAGS="$X_CFLAGS -I$x_includes"
10229   fi
10230
10231   # It would also be nice to do this for all -L options, not just this one.
10232   if test -n "$x_libraries"; then
10233     X_LIBS="$X_LIBS -L$x_libraries"
10234     # For Solaris; some versions of Sun CC require a space after -R and
10235     # others require no space.  Words are not sufficient . . . .
10236     case `(uname -sr) 2>/dev/null` in
10237     "SunOS 5"*)
10238       echo "$as_me:10238: checking whether -R must be followed by a space" >&5
10239 echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6
10240       ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
10241       cat >conftest.$ac_ext <<_ACEOF
10242 #line 10242 "configure"
10243 #include "confdefs.h"
10244
10245 int
10246 main (void)
10247 {
10248
10249   ;
10250   return 0;
10251 }
10252 _ACEOF
10253 rm -f conftest.$ac_objext conftest$ac_exeext
10254 if { (eval echo "$as_me:10254: \"$ac_link\"") >&5
10255   (eval $ac_link) 2>&5
10256   ac_status=$?
10257   echo "$as_me:10257: \$? = $ac_status" >&5
10258   (exit $ac_status); } &&
10259          { ac_try='test -s conftest$ac_exeext'
10260   { (eval echo "$as_me:10260: \"$ac_try\"") >&5
10261   (eval $ac_try) 2>&5
10262   ac_status=$?
10263   echo "$as_me:10263: \$? = $ac_status" >&5
10264   (exit $ac_status); }; }; then
10265   ac_R_nospace=yes
10266 else
10267   echo "$as_me: failed program was:" >&5
10268 cat conftest.$ac_ext >&5
10269 ac_R_nospace=no
10270 fi
10271 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10272       if test $ac_R_nospace = yes; then
10273         echo "$as_me:10273: result: no" >&5
10274 echo "${ECHO_T}no" >&6
10275         X_LIBS="$X_LIBS -R$x_libraries"
10276       else
10277         LIBS="$ac_xsave_LIBS -R $x_libraries"
10278         cat >conftest.$ac_ext <<_ACEOF
10279 #line 10279 "configure"
10280 #include "confdefs.h"
10281
10282 int
10283 main (void)
10284 {
10285
10286   ;
10287   return 0;
10288 }
10289 _ACEOF
10290 rm -f conftest.$ac_objext conftest$ac_exeext
10291 if { (eval echo "$as_me:10291: \"$ac_link\"") >&5
10292   (eval $ac_link) 2>&5
10293   ac_status=$?
10294   echo "$as_me:10294: \$? = $ac_status" >&5
10295   (exit $ac_status); } &&
10296          { ac_try='test -s conftest$ac_exeext'
10297   { (eval echo "$as_me:10297: \"$ac_try\"") >&5
10298   (eval $ac_try) 2>&5
10299   ac_status=$?
10300   echo "$as_me:10300: \$? = $ac_status" >&5
10301   (exit $ac_status); }; }; then
10302   ac_R_space=yes
10303 else
10304   echo "$as_me: failed program was:" >&5
10305 cat conftest.$ac_ext >&5
10306 ac_R_space=no
10307 fi
10308 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10309         if test $ac_R_space = yes; then
10310           echo "$as_me:10310: result: yes" >&5
10311 echo "${ECHO_T}yes" >&6
10312           X_LIBS="$X_LIBS -R $x_libraries"
10313         else
10314           echo "$as_me:10314: result: neither works" >&5
10315 echo "${ECHO_T}neither works" >&6
10316         fi
10317       fi
10318       LIBS=$ac_xsave_LIBS
10319     esac
10320   fi
10321
10322   # Check for system-dependent libraries X programs must link with.
10323   # Do this before checking for the system-independent R6 libraries
10324   # (-lICE), since we may need -lsocket or whatever for X linking.
10325
10326   if test "$ISC" = yes; then
10327     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
10328   else
10329     # Martyn Johnson says this is needed for Ultrix, if the X
10330     # libraries were built with DECnet support.  And Karl Berry says
10331     # the Alpha needs dnet_stub (dnet does not exist).
10332     ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
10333     cat >conftest.$ac_ext <<_ACEOF
10334 #line 10334 "configure"
10335 #include "confdefs.h"
10336
10337 /* Override any gcc2 internal prototype to avoid an error.  */
10338 #ifdef __cplusplus
10339 extern "C"
10340 #endif
10341 /* We use char because int might match the return type of a gcc2
10342    builtin and then its argument prototype would still apply.  */
10343 char XOpenDisplay ();
10344 int
10345 main (void)
10346 {
10347 XOpenDisplay ();
10348   ;
10349   return 0;
10350 }
10351 _ACEOF
10352 rm -f conftest.$ac_objext conftest$ac_exeext
10353 if { (eval echo "$as_me:10353: \"$ac_link\"") >&5
10354   (eval $ac_link) 2>&5
10355   ac_status=$?
10356   echo "$as_me:10356: \$? = $ac_status" >&5
10357   (exit $ac_status); } &&
10358          { ac_try='test -s conftest$ac_exeext'
10359   { (eval echo "$as_me:10359: \"$ac_try\"") >&5
10360   (eval $ac_try) 2>&5
10361   ac_status=$?
10362   echo "$as_me:10362: \$? = $ac_status" >&5
10363   (exit $ac_status); }; }; then
10364   :
10365 else
10366   echo "$as_me: failed program was:" >&5
10367 cat conftest.$ac_ext >&5
10368 echo "$as_me:10368: checking for dnet_ntoa in -ldnet" >&5
10369 echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6
10370 if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then
10371   echo $ECHO_N "(cached) $ECHO_C" >&6
10372 else
10373   ac_check_lib_save_LIBS=$LIBS
10374 LIBS="-ldnet  $LIBS"
10375 cat >conftest.$ac_ext <<_ACEOF
10376 #line 10376 "configure"
10377 #include "confdefs.h"
10378
10379 /* Override any gcc2 internal prototype to avoid an error.  */
10380 #ifdef __cplusplus
10381 extern "C"
10382 #endif
10383 /* We use char because int might match the return type of a gcc2
10384    builtin and then its argument prototype would still apply.  */
10385 char dnet_ntoa ();
10386 int
10387 main (void)
10388 {
10389 dnet_ntoa ();
10390   ;
10391   return 0;
10392 }
10393 _ACEOF
10394 rm -f conftest.$ac_objext conftest$ac_exeext
10395 if { (eval echo "$as_me:10395: \"$ac_link\"") >&5
10396   (eval $ac_link) 2>&5
10397   ac_status=$?
10398   echo "$as_me:10398: \$? = $ac_status" >&5
10399   (exit $ac_status); } &&
10400          { ac_try='test -s conftest$ac_exeext'
10401   { (eval echo "$as_me:10401: \"$ac_try\"") >&5
10402   (eval $ac_try) 2>&5
10403   ac_status=$?
10404   echo "$as_me:10404: \$? = $ac_status" >&5
10405   (exit $ac_status); }; }; then
10406   ac_cv_lib_dnet_dnet_ntoa=yes
10407 else
10408   echo "$as_me: failed program was:" >&5
10409 cat conftest.$ac_ext >&5
10410 ac_cv_lib_dnet_dnet_ntoa=no
10411 fi
10412 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10413 LIBS=$ac_check_lib_save_LIBS
10414 fi
10415 echo "$as_me:10415: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
10416 echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6
10417 if test $ac_cv_lib_dnet_dnet_ntoa = yes; then
10418   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
10419 fi
10420
10421     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
10422       echo "$as_me:10422: checking for dnet_ntoa in -ldnet_stub" >&5
10423 echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6
10424 if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then
10425   echo $ECHO_N "(cached) $ECHO_C" >&6
10426 else
10427   ac_check_lib_save_LIBS=$LIBS
10428 LIBS="-ldnet_stub  $LIBS"
10429 cat >conftest.$ac_ext <<_ACEOF
10430 #line 10430 "configure"
10431 #include "confdefs.h"
10432
10433 /* Override any gcc2 internal prototype to avoid an error.  */
10434 #ifdef __cplusplus
10435 extern "C"
10436 #endif
10437 /* We use char because int might match the return type of a gcc2
10438    builtin and then its argument prototype would still apply.  */
10439 char dnet_ntoa ();
10440 int
10441 main (void)
10442 {
10443 dnet_ntoa ();
10444   ;
10445   return 0;
10446 }
10447 _ACEOF
10448 rm -f conftest.$ac_objext conftest$ac_exeext
10449 if { (eval echo "$as_me:10449: \"$ac_link\"") >&5
10450   (eval $ac_link) 2>&5
10451   ac_status=$?
10452   echo "$as_me:10452: \$? = $ac_status" >&5
10453   (exit $ac_status); } &&
10454          { ac_try='test -s conftest$ac_exeext'
10455   { (eval echo "$as_me:10455: \"$ac_try\"") >&5
10456   (eval $ac_try) 2>&5
10457   ac_status=$?
10458   echo "$as_me:10458: \$? = $ac_status" >&5
10459   (exit $ac_status); }; }; then
10460   ac_cv_lib_dnet_stub_dnet_ntoa=yes
10461 else
10462   echo "$as_me: failed program was:" >&5
10463 cat conftest.$ac_ext >&5
10464 ac_cv_lib_dnet_stub_dnet_ntoa=no
10465 fi
10466 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10467 LIBS=$ac_check_lib_save_LIBS
10468 fi
10469 echo "$as_me:10469: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
10470 echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6
10471 if test $ac_cv_lib_dnet_stub_dnet_ntoa = yes; then
10472   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
10473 fi
10474
10475     fi
10476 fi
10477 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10478     LIBS="$ac_xsave_LIBS"
10479
10480     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
10481     # to get the SysV transport functions.
10482     # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4)
10483     # needs -lnsl.
10484     # The nsl library prevents programs from opening the X display
10485     # on Irix 5.2, according to T.E. Dickey.
10486     # The functions gethostbyname, getservbyname, and inet_addr are
10487     # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
10488     echo "$as_me:10488: checking for gethostbyname" >&5
10489 echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6
10490 if test "${ac_cv_func_gethostbyname+set}" = set; then
10491   echo $ECHO_N "(cached) $ECHO_C" >&6
10492 else
10493   cat >conftest.$ac_ext <<_ACEOF
10494 #line 10494 "configure"
10495 #include "confdefs.h"
10496 /* System header to define __stub macros and hopefully few prototypes,
10497     which can conflict with char gethostbyname (); below.  */
10498 #include <assert.h>
10499 /* Override any gcc2 internal prototype to avoid an error.  */
10500 #ifdef __cplusplus
10501 extern "C"
10502 #endif
10503 /* We use char because int might match the return type of a gcc2
10504    builtin and then its argument prototype would still apply.  */
10505 char gethostbyname ();
10506 char (*f) ();
10507
10508 int
10509 main (void)
10510 {
10511 /* The GNU C library defines this for functions which it implements
10512     to always fail with ENOSYS.  Some functions are actually named
10513     something starting with __ and the normal name is an alias.  */
10514 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
10515 choke me
10516 #else
10517 f = gethostbyname; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
10518 #endif
10519
10520   ;
10521   return 0;
10522 }
10523 _ACEOF
10524 rm -f conftest.$ac_objext conftest$ac_exeext
10525 if { (eval echo "$as_me:10525: \"$ac_link\"") >&5
10526   (eval $ac_link) 2>&5
10527   ac_status=$?
10528   echo "$as_me:10528: \$? = $ac_status" >&5
10529   (exit $ac_status); } &&
10530          { ac_try='test -s conftest$ac_exeext'
10531   { (eval echo "$as_me:10531: \"$ac_try\"") >&5
10532   (eval $ac_try) 2>&5
10533   ac_status=$?
10534   echo "$as_me:10534: \$? = $ac_status" >&5
10535   (exit $ac_status); }; }; then
10536   ac_cv_func_gethostbyname=yes
10537 else
10538   echo "$as_me: failed program was:" >&5
10539 cat conftest.$ac_ext >&5
10540 ac_cv_func_gethostbyname=no
10541 fi
10542 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10543 fi
10544 echo "$as_me:10544: result: $ac_cv_func_gethostbyname" >&5
10545 echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6
10546
10547     if test $ac_cv_func_gethostbyname = no; then
10548       echo "$as_me:10548: checking for gethostbyname in -lnsl" >&5
10549 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6
10550 if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
10551   echo $ECHO_N "(cached) $ECHO_C" >&6
10552 else
10553   ac_check_lib_save_LIBS=$LIBS
10554 LIBS="-lnsl  $LIBS"
10555 cat >conftest.$ac_ext <<_ACEOF
10556 #line 10556 "configure"
10557 #include "confdefs.h"
10558
10559 /* Override any gcc2 internal prototype to avoid an error.  */
10560 #ifdef __cplusplus
10561 extern "C"
10562 #endif
10563 /* We use char because int might match the return type of a gcc2
10564    builtin and then its argument prototype would still apply.  */
10565 char gethostbyname ();
10566 int
10567 main (void)
10568 {
10569 gethostbyname ();
10570   ;
10571   return 0;
10572 }
10573 _ACEOF
10574 rm -f conftest.$ac_objext conftest$ac_exeext
10575 if { (eval echo "$as_me:10575: \"$ac_link\"") >&5
10576   (eval $ac_link) 2>&5
10577   ac_status=$?
10578   echo "$as_me:10578: \$? = $ac_status" >&5
10579   (exit $ac_status); } &&
10580          { ac_try='test -s conftest$ac_exeext'
10581   { (eval echo "$as_me:10581: \"$ac_try\"") >&5
10582   (eval $ac_try) 2>&5
10583   ac_status=$?
10584   echo "$as_me:10584: \$? = $ac_status" >&5
10585   (exit $ac_status); }; }; then
10586   ac_cv_lib_nsl_gethostbyname=yes
10587 else
10588   echo "$as_me: failed program was:" >&5
10589 cat conftest.$ac_ext >&5
10590 ac_cv_lib_nsl_gethostbyname=no
10591 fi
10592 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10593 LIBS=$ac_check_lib_save_LIBS
10594 fi
10595 echo "$as_me:10595: result: $ac_cv_lib_nsl_gethostbyname" >&5
10596 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6
10597 if test $ac_cv_lib_nsl_gethostbyname = yes; then
10598   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
10599 fi
10600
10601       if test $ac_cv_lib_nsl_gethostbyname = no; then
10602         echo "$as_me:10602: checking for gethostbyname in -lbsd" >&5
10603 echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6
10604 if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then
10605   echo $ECHO_N "(cached) $ECHO_C" >&6
10606 else
10607   ac_check_lib_save_LIBS=$LIBS
10608 LIBS="-lbsd  $LIBS"
10609 cat >conftest.$ac_ext <<_ACEOF
10610 #line 10610 "configure"
10611 #include "confdefs.h"
10612
10613 /* Override any gcc2 internal prototype to avoid an error.  */
10614 #ifdef __cplusplus
10615 extern "C"
10616 #endif
10617 /* We use char because int might match the return type of a gcc2
10618    builtin and then its argument prototype would still apply.  */
10619 char gethostbyname ();
10620 int
10621 main (void)
10622 {
10623 gethostbyname ();
10624   ;
10625   return 0;
10626 }
10627 _ACEOF
10628 rm -f conftest.$ac_objext conftest$ac_exeext
10629 if { (eval echo "$as_me:10629: \"$ac_link\"") >&5
10630   (eval $ac_link) 2>&5
10631   ac_status=$?
10632   echo "$as_me:10632: \$? = $ac_status" >&5
10633   (exit $ac_status); } &&
10634          { ac_try='test -s conftest$ac_exeext'
10635   { (eval echo "$as_me:10635: \"$ac_try\"") >&5
10636   (eval $ac_try) 2>&5
10637   ac_status=$?
10638   echo "$as_me:10638: \$? = $ac_status" >&5
10639   (exit $ac_status); }; }; then
10640   ac_cv_lib_bsd_gethostbyname=yes
10641 else
10642   echo "$as_me: failed program was:" >&5
10643 cat conftest.$ac_ext >&5
10644 ac_cv_lib_bsd_gethostbyname=no
10645 fi
10646 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10647 LIBS=$ac_check_lib_save_LIBS
10648 fi
10649 echo "$as_me:10649: result: $ac_cv_lib_bsd_gethostbyname" >&5
10650 echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6
10651 if test $ac_cv_lib_bsd_gethostbyname = yes; then
10652   X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
10653 fi
10654
10655       fi
10656     fi
10657
10658     # lieder@skyler.mavd.honeywell.com says without -lsocket,
10659     # socket/setsockopt and other routines are undefined under SCO ODT
10660     # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
10661     # on later versions), says Simon Leinen: it contains gethostby*
10662     # variants that don't use the nameserver (or something).  -lsocket
10663     # must be given before -lnsl if both are needed.  We assume that
10664     # if connect needs -lnsl, so does gethostbyname.
10665     echo "$as_me:10665: checking for connect" >&5
10666 echo $ECHO_N "checking for connect... $ECHO_C" >&6
10667 if test "${ac_cv_func_connect+set}" = set; then
10668   echo $ECHO_N "(cached) $ECHO_C" >&6
10669 else
10670   cat >conftest.$ac_ext <<_ACEOF
10671 #line 10671 "configure"
10672 #include "confdefs.h"
10673 /* System header to define __stub macros and hopefully few prototypes,
10674     which can conflict with char connect (); below.  */
10675 #include <assert.h>
10676 /* Override any gcc2 internal prototype to avoid an error.  */
10677 #ifdef __cplusplus
10678 extern "C"
10679 #endif
10680 /* We use char because int might match the return type of a gcc2
10681    builtin and then its argument prototype would still apply.  */
10682 char connect ();
10683 char (*f) ();
10684
10685 int
10686 main (void)
10687 {
10688 /* The GNU C library defines this for functions which it implements
10689     to always fail with ENOSYS.  Some functions are actually named
10690     something starting with __ and the normal name is an alias.  */
10691 #if defined (__stub_connect) || defined (__stub___connect)
10692 choke me
10693 #else
10694 f = connect; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
10695 #endif
10696
10697   ;
10698   return 0;
10699 }
10700 _ACEOF
10701 rm -f conftest.$ac_objext conftest$ac_exeext
10702 if { (eval echo "$as_me:10702: \"$ac_link\"") >&5
10703   (eval $ac_link) 2>&5
10704   ac_status=$?
10705   echo "$as_me:10705: \$? = $ac_status" >&5
10706   (exit $ac_status); } &&
10707          { ac_try='test -s conftest$ac_exeext'
10708   { (eval echo "$as_me:10708: \"$ac_try\"") >&5
10709   (eval $ac_try) 2>&5
10710   ac_status=$?
10711   echo "$as_me:10711: \$? = $ac_status" >&5
10712   (exit $ac_status); }; }; then
10713   ac_cv_func_connect=yes
10714 else
10715   echo "$as_me: failed program was:" >&5
10716 cat conftest.$ac_ext >&5
10717 ac_cv_func_connect=no
10718 fi
10719 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10720 fi
10721 echo "$as_me:10721: result: $ac_cv_func_connect" >&5
10722 echo "${ECHO_T}$ac_cv_func_connect" >&6
10723
10724     if test $ac_cv_func_connect = no; then
10725       echo "$as_me:10725: checking for connect in -lsocket" >&5
10726 echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6
10727 if test "${ac_cv_lib_socket_connect+set}" = set; then
10728   echo $ECHO_N "(cached) $ECHO_C" >&6
10729 else
10730   ac_check_lib_save_LIBS=$LIBS
10731 LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
10732 cat >conftest.$ac_ext <<_ACEOF
10733 #line 10733 "configure"
10734 #include "confdefs.h"
10735
10736 /* Override any gcc2 internal prototype to avoid an error.  */
10737 #ifdef __cplusplus
10738 extern "C"
10739 #endif
10740 /* We use char because int might match the return type of a gcc2
10741    builtin and then its argument prototype would still apply.  */
10742 char connect ();
10743 int
10744 main (void)
10745 {
10746 connect ();
10747   ;
10748   return 0;
10749 }
10750 _ACEOF
10751 rm -f conftest.$ac_objext conftest$ac_exeext
10752 if { (eval echo "$as_me:10752: \"$ac_link\"") >&5
10753   (eval $ac_link) 2>&5
10754   ac_status=$?
10755   echo "$as_me:10755: \$? = $ac_status" >&5
10756   (exit $ac_status); } &&
10757          { ac_try='test -s conftest$ac_exeext'
10758   { (eval echo "$as_me:10758: \"$ac_try\"") >&5
10759   (eval $ac_try) 2>&5
10760   ac_status=$?
10761   echo "$as_me:10761: \$? = $ac_status" >&5
10762   (exit $ac_status); }; }; then
10763   ac_cv_lib_socket_connect=yes
10764 else
10765   echo "$as_me: failed program was:" >&5
10766 cat conftest.$ac_ext >&5
10767 ac_cv_lib_socket_connect=no
10768 fi
10769 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10770 LIBS=$ac_check_lib_save_LIBS
10771 fi
10772 echo "$as_me:10772: result: $ac_cv_lib_socket_connect" >&5
10773 echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6
10774 if test $ac_cv_lib_socket_connect = yes; then
10775   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
10776 fi
10777
10778     fi
10779
10780     # Guillermo Gomez says -lposix is necessary on A/UX.
10781     echo "$as_me:10781: checking for remove" >&5
10782 echo $ECHO_N "checking for remove... $ECHO_C" >&6
10783 if test "${ac_cv_func_remove+set}" = set; then
10784   echo $ECHO_N "(cached) $ECHO_C" >&6
10785 else
10786   cat >conftest.$ac_ext <<_ACEOF
10787 #line 10787 "configure"
10788 #include "confdefs.h"
10789 /* System header to define __stub macros and hopefully few prototypes,
10790     which can conflict with char remove (); below.  */
10791 #include <assert.h>
10792 /* Override any gcc2 internal prototype to avoid an error.  */
10793 #ifdef __cplusplus
10794 extern "C"
10795 #endif
10796 /* We use char because int might match the return type of a gcc2
10797    builtin and then its argument prototype would still apply.  */
10798 char remove ();
10799 char (*f) ();
10800
10801 int
10802 main (void)
10803 {
10804 /* The GNU C library defines this for functions which it implements
10805     to always fail with ENOSYS.  Some functions are actually named
10806     something starting with __ and the normal name is an alias.  */
10807 #if defined (__stub_remove) || defined (__stub___remove)
10808 choke me
10809 #else
10810 f = remove; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
10811 #endif
10812
10813   ;
10814   return 0;
10815 }
10816 _ACEOF
10817 rm -f conftest.$ac_objext conftest$ac_exeext
10818 if { (eval echo "$as_me:10818: \"$ac_link\"") >&5
10819   (eval $ac_link) 2>&5
10820   ac_status=$?
10821   echo "$as_me:10821: \$? = $ac_status" >&5
10822   (exit $ac_status); } &&
10823          { ac_try='test -s conftest$ac_exeext'
10824   { (eval echo "$as_me:10824: \"$ac_try\"") >&5
10825   (eval $ac_try) 2>&5
10826   ac_status=$?
10827   echo "$as_me:10827: \$? = $ac_status" >&5
10828   (exit $ac_status); }; }; then
10829   ac_cv_func_remove=yes
10830 else
10831   echo "$as_me: failed program was:" >&5
10832 cat conftest.$ac_ext >&5
10833 ac_cv_func_remove=no
10834 fi
10835 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10836 fi
10837 echo "$as_me:10837: result: $ac_cv_func_remove" >&5
10838 echo "${ECHO_T}$ac_cv_func_remove" >&6
10839
10840     if test $ac_cv_func_remove = no; then
10841       echo "$as_me:10841: checking for remove in -lposix" >&5
10842 echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6
10843 if test "${ac_cv_lib_posix_remove+set}" = set; then
10844   echo $ECHO_N "(cached) $ECHO_C" >&6
10845 else
10846   ac_check_lib_save_LIBS=$LIBS
10847 LIBS="-lposix  $LIBS"
10848 cat >conftest.$ac_ext <<_ACEOF
10849 #line 10849 "configure"
10850 #include "confdefs.h"
10851
10852 /* Override any gcc2 internal prototype to avoid an error.  */
10853 #ifdef __cplusplus
10854 extern "C"
10855 #endif
10856 /* We use char because int might match the return type of a gcc2
10857    builtin and then its argument prototype would still apply.  */
10858 char remove ();
10859 int
10860 main (void)
10861 {
10862 remove ();
10863   ;
10864   return 0;
10865 }
10866 _ACEOF
10867 rm -f conftest.$ac_objext conftest$ac_exeext
10868 if { (eval echo "$as_me:10868: \"$ac_link\"") >&5
10869   (eval $ac_link) 2>&5
10870   ac_status=$?
10871   echo "$as_me:10871: \$? = $ac_status" >&5
10872   (exit $ac_status); } &&
10873          { ac_try='test -s conftest$ac_exeext'
10874   { (eval echo "$as_me:10874: \"$ac_try\"") >&5
10875   (eval $ac_try) 2>&5
10876   ac_status=$?
10877   echo "$as_me:10877: \$? = $ac_status" >&5
10878   (exit $ac_status); }; }; then
10879   ac_cv_lib_posix_remove=yes
10880 else
10881   echo "$as_me: failed program was:" >&5
10882 cat conftest.$ac_ext >&5
10883 ac_cv_lib_posix_remove=no
10884 fi
10885 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10886 LIBS=$ac_check_lib_save_LIBS
10887 fi
10888 echo "$as_me:10888: result: $ac_cv_lib_posix_remove" >&5
10889 echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6
10890 if test $ac_cv_lib_posix_remove = yes; then
10891   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
10892 fi
10893
10894     fi
10895
10896     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
10897     echo "$as_me:10897: checking for shmat" >&5
10898 echo $ECHO_N "checking for shmat... $ECHO_C" >&6
10899 if test "${ac_cv_func_shmat+set}" = set; then
10900   echo $ECHO_N "(cached) $ECHO_C" >&6
10901 else
10902   cat >conftest.$ac_ext <<_ACEOF
10903 #line 10903 "configure"
10904 #include "confdefs.h"
10905 /* System header to define __stub macros and hopefully few prototypes,
10906     which can conflict with char shmat (); below.  */
10907 #include <assert.h>
10908 /* Override any gcc2 internal prototype to avoid an error.  */
10909 #ifdef __cplusplus
10910 extern "C"
10911 #endif
10912 /* We use char because int might match the return type of a gcc2
10913    builtin and then its argument prototype would still apply.  */
10914 char shmat ();
10915 char (*f) ();
10916
10917 int
10918 main (void)
10919 {
10920 /* The GNU C library defines this for functions which it implements
10921     to always fail with ENOSYS.  Some functions are actually named
10922     something starting with __ and the normal name is an alias.  */
10923 #if defined (__stub_shmat) || defined (__stub___shmat)
10924 choke me
10925 #else
10926 f = shmat; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
10927 #endif
10928
10929   ;
10930   return 0;
10931 }
10932 _ACEOF
10933 rm -f conftest.$ac_objext conftest$ac_exeext
10934 if { (eval echo "$as_me:10934: \"$ac_link\"") >&5
10935   (eval $ac_link) 2>&5
10936   ac_status=$?
10937   echo "$as_me:10937: \$? = $ac_status" >&5
10938   (exit $ac_status); } &&
10939          { ac_try='test -s conftest$ac_exeext'
10940   { (eval echo "$as_me:10940: \"$ac_try\"") >&5
10941   (eval $ac_try) 2>&5
10942   ac_status=$?
10943   echo "$as_me:10943: \$? = $ac_status" >&5
10944   (exit $ac_status); }; }; then
10945   ac_cv_func_shmat=yes
10946 else
10947   echo "$as_me: failed program was:" >&5
10948 cat conftest.$ac_ext >&5
10949 ac_cv_func_shmat=no
10950 fi
10951 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10952 fi
10953 echo "$as_me:10953: result: $ac_cv_func_shmat" >&5
10954 echo "${ECHO_T}$ac_cv_func_shmat" >&6
10955
10956     if test $ac_cv_func_shmat = no; then
10957       echo "$as_me:10957: checking for shmat in -lipc" >&5
10958 echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6
10959 if test "${ac_cv_lib_ipc_shmat+set}" = set; then
10960   echo $ECHO_N "(cached) $ECHO_C" >&6
10961 else
10962   ac_check_lib_save_LIBS=$LIBS
10963 LIBS="-lipc  $LIBS"
10964 cat >conftest.$ac_ext <<_ACEOF
10965 #line 10965 "configure"
10966 #include "confdefs.h"
10967
10968 /* Override any gcc2 internal prototype to avoid an error.  */
10969 #ifdef __cplusplus
10970 extern "C"
10971 #endif
10972 /* We use char because int might match the return type of a gcc2
10973    builtin and then its argument prototype would still apply.  */
10974 char shmat ();
10975 int
10976 main (void)
10977 {
10978 shmat ();
10979   ;
10980   return 0;
10981 }
10982 _ACEOF
10983 rm -f conftest.$ac_objext conftest$ac_exeext
10984 if { (eval echo "$as_me:10984: \"$ac_link\"") >&5
10985   (eval $ac_link) 2>&5
10986   ac_status=$?
10987   echo "$as_me:10987: \$? = $ac_status" >&5
10988   (exit $ac_status); } &&
10989          { ac_try='test -s conftest$ac_exeext'
10990   { (eval echo "$as_me:10990: \"$ac_try\"") >&5
10991   (eval $ac_try) 2>&5
10992   ac_status=$?
10993   echo "$as_me:10993: \$? = $ac_status" >&5
10994   (exit $ac_status); }; }; then
10995   ac_cv_lib_ipc_shmat=yes
10996 else
10997   echo "$as_me: failed program was:" >&5
10998 cat conftest.$ac_ext >&5
10999 ac_cv_lib_ipc_shmat=no
11000 fi
11001 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11002 LIBS=$ac_check_lib_save_LIBS
11003 fi
11004 echo "$as_me:11004: result: $ac_cv_lib_ipc_shmat" >&5
11005 echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6
11006 if test $ac_cv_lib_ipc_shmat = yes; then
11007   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
11008 fi
11009
11010     fi
11011   fi
11012
11013   # Check for libraries that X11R6 Xt/Xaw programs need.
11014   ac_save_LDFLAGS=$LDFLAGS
11015   test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
11016   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
11017   # check for ICE first), but we must link in the order -lSM -lICE or
11018   # we get undefined symbols.  So assume we have SM if we have ICE.
11019   # These have to be linked with before -lX11, unlike the other
11020   # libraries we check for below, so use a different variable.
11021   # John Interrante, Karl Berry
11022   echo "$as_me:11022: checking for IceConnectionNumber in -lICE" >&5
11023 echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6
11024 if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then
11025   echo $ECHO_N "(cached) $ECHO_C" >&6
11026 else
11027   ac_check_lib_save_LIBS=$LIBS
11028 LIBS="-lICE $X_EXTRA_LIBS $LIBS"
11029 cat >conftest.$ac_ext <<_ACEOF
11030 #line 11030 "configure"
11031 #include "confdefs.h"
11032
11033 /* Override any gcc2 internal prototype to avoid an error.  */
11034 #ifdef __cplusplus
11035 extern "C"
11036 #endif
11037 /* We use char because int might match the return type of a gcc2
11038    builtin and then its argument prototype would still apply.  */
11039 char IceConnectionNumber ();
11040 int
11041 main (void)
11042 {
11043 IceConnectionNumber ();
11044   ;
11045   return 0;
11046 }
11047 _ACEOF
11048 rm -f conftest.$ac_objext conftest$ac_exeext
11049 if { (eval echo "$as_me:11049: \"$ac_link\"") >&5
11050   (eval $ac_link) 2>&5
11051   ac_status=$?
11052   echo "$as_me:11052: \$? = $ac_status" >&5
11053   (exit $ac_status); } &&
11054          { ac_try='test -s conftest$ac_exeext'
11055   { (eval echo "$as_me:11055: \"$ac_try\"") >&5
11056   (eval $ac_try) 2>&5
11057   ac_status=$?
11058   echo "$as_me:11058: \$? = $ac_status" >&5
11059   (exit $ac_status); }; }; then
11060   ac_cv_lib_ICE_IceConnectionNumber=yes
11061 else
11062   echo "$as_me: failed program was:" >&5
11063 cat conftest.$ac_ext >&5
11064 ac_cv_lib_ICE_IceConnectionNumber=no
11065 fi
11066 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11067 LIBS=$ac_check_lib_save_LIBS
11068 fi
11069 echo "$as_me:11069: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
11070 echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6
11071 if test $ac_cv_lib_ICE_IceConnectionNumber = yes; then
11072   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
11073 fi
11074
11075   LDFLAGS=$ac_save_LDFLAGS
11076
11077 fi
11078
11079 cf_x_athena=${cf_x_athena:-Xaw}
11080
11081 echo "$as_me:11081: checking if you want to link with Xaw 3d library" >&5
11082 echo $ECHO_N "checking if you want to link with Xaw 3d library... $ECHO_C" >&6
11083 withval=
11084
11085 # Check whether --with-Xaw3d or --without-Xaw3d was given.
11086 if test "${with_Xaw3d+set}" = set; then
11087   withval="$with_Xaw3d"
11088
11089 fi;
11090 if test "$withval" = yes ; then
11091         cf_x_athena=Xaw3d
11092         echo "$as_me:11092: result: yes" >&5
11093 echo "${ECHO_T}yes" >&6
11094 else
11095         echo "$as_me:11095: result: no" >&5
11096 echo "${ECHO_T}no" >&6
11097 fi
11098
11099 echo "$as_me:11099: checking if you want to link with Xaw 3d xft library" >&5
11100 echo $ECHO_N "checking if you want to link with Xaw 3d xft library... $ECHO_C" >&6
11101 withval=
11102
11103 # Check whether --with-Xaw3dxft or --without-Xaw3dxft was given.
11104 if test "${with_Xaw3dxft+set}" = set; then
11105   withval="$with_Xaw3dxft"
11106
11107 fi;
11108 if test "$withval" = yes ; then
11109         cf_x_athena=Xaw3dxft
11110         echo "$as_me:11110: result: yes" >&5
11111 echo "${ECHO_T}yes" >&6
11112 else
11113         echo "$as_me:11113: result: no" >&5
11114 echo "${ECHO_T}no" >&6
11115 fi
11116
11117 echo "$as_me:11117: checking if you want to link with neXT Athena library" >&5
11118 echo $ECHO_N "checking if you want to link with neXT Athena library... $ECHO_C" >&6
11119 withval=
11120
11121 # Check whether --with-neXtaw or --without-neXtaw was given.
11122 if test "${with_neXtaw+set}" = set; then
11123   withval="$with_neXtaw"
11124
11125 fi;
11126 if test "$withval" = yes ; then
11127         cf_x_athena=neXtaw
11128         echo "$as_me:11128: result: yes" >&5
11129 echo "${ECHO_T}yes" >&6
11130 else
11131         echo "$as_me:11131: result: no" >&5
11132 echo "${ECHO_T}no" >&6
11133 fi
11134
11135 echo "$as_me:11135: checking if you want to link with Athena-Plus library" >&5
11136 echo $ECHO_N "checking if you want to link with Athena-Plus library... $ECHO_C" >&6
11137 withval=
11138
11139 # Check whether --with-XawPlus or --without-XawPlus was given.
11140 if test "${with_XawPlus+set}" = set; then
11141   withval="$with_XawPlus"
11142
11143 fi;
11144 if test "$withval" = yes ; then
11145         cf_x_athena=XawPlus
11146         echo "$as_me:11146: result: yes" >&5
11147 echo "${ECHO_T}yes" >&6
11148 else
11149         echo "$as_me:11149: result: no" >&5
11150 echo "${ECHO_T}no" >&6
11151 fi
11152
11153 cf_x_athena_lib=""
11154
11155 if test "$PKG_CONFIG" != none ; then
11156         cf_athena_list=
11157         test "$cf_x_athena" = Xaw && cf_athena_list="xaw8 xaw7 xaw6"
11158         for cf_athena_pkg in \
11159                 $cf_athena_list \
11160                 ${cf_x_athena} \
11161                 ${cf_x_athena}-devel \
11162                 lib${cf_x_athena} \
11163                 lib${cf_x_athena}-devel
11164         do
11165
11166 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists $cf_athena_pkg; then
11167         test -n "$verbose" && echo "    found package $cf_athena_pkg" 1>&6
11168
11169 echo "${as_me:-configure}:11169: testing found package $cf_athena_pkg ..." 1>&5
11170
11171         cf_pkgconfig_incs="`$PKG_CONFIG --cflags $cf_athena_pkg 2>/dev/null`"
11172         cf_pkgconfig_libs="`$PKG_CONFIG --libs   $cf_athena_pkg 2>/dev/null`"
11173         test -n "$verbose" && echo "    package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs" 1>&6
11174
11175 echo "${as_me:-configure}:11175: testing package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11176
11177         test -n "$verbose" && echo "    package $cf_athena_pkg LIBS: $cf_pkgconfig_libs" 1>&6
11178
11179 echo "${as_me:-configure}:11179: testing package $cf_athena_pkg LIBS: $cf_pkgconfig_libs ..." 1>&5
11180
11181 cf_fix_cppflags=no
11182 cf_new_cflags=
11183 cf_new_cppflags=
11184 cf_new_extra_cppflags=
11185
11186 for cf_add_cflags in $cf_pkgconfig_incs
11187 do
11188 case $cf_fix_cppflags in
11189 (no)
11190         case $cf_add_cflags in
11191         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11192                 case $cf_add_cflags in
11193                 (-D*)
11194                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11195
11196                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11197                                 && test -z "${cf_tst_cflags}" \
11198                                 && cf_fix_cppflags=yes
11199
11200                         if test $cf_fix_cppflags = yes ; then
11201
11202         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11203         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11204
11205                                 continue
11206                         elif test "${cf_tst_cflags}" = "\"'" ; then
11207
11208         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11209         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11210
11211                                 continue
11212                         fi
11213                         ;;
11214                 esac
11215                 case "$CPPFLAGS" in
11216                 (*$cf_add_cflags)
11217                         ;;
11218                 (*)
11219                         case $cf_add_cflags in
11220                         (-D*)
11221                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11222
11223 CPPFLAGS=`echo "$CPPFLAGS" | \
11224         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11225                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11226
11227                                 ;;
11228                         esac
11229
11230         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
11231         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
11232
11233                         ;;
11234                 esac
11235                 ;;
11236         (*)
11237
11238         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
11239         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
11240
11241                 ;;
11242         esac
11243         ;;
11244 (yes)
11245
11246         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11247         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11248
11249         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11250
11251         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11252                 && test -z "${cf_tst_cflags}" \
11253                 && cf_fix_cppflags=no
11254         ;;
11255 esac
11256 done
11257
11258 if test -n "$cf_new_cflags" ; then
11259
11260         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
11261         CFLAGS="${CFLAGS}$cf_new_cflags"
11262
11263 fi
11264
11265 if test -n "$cf_new_cppflags" ; then
11266
11267         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11268         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
11269
11270 fi
11271
11272 if test -n "$cf_new_extra_cppflags" ; then
11273
11274         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
11275         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
11276
11277 fi
11278
11279 cf_add_libs="$cf_pkgconfig_libs"
11280 # Filter out duplicates - this happens with badly-designed ".pc" files...
11281 for cf_add_1lib in $LIBS
11282 do
11283         for cf_add_2lib in $cf_add_libs
11284         do
11285                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11286                 then
11287                         cf_add_1lib=
11288                         break
11289                 fi
11290         done
11291         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11292 done
11293 LIBS="$cf_add_libs"
11294
11295                         cf_x_athena_lib="$cf_pkgconfig_libs"
11296
11297 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
11298
11299                         cat >>confdefs.h <<EOF
11300 #define $cf_x_athena_LIBS 1
11301 EOF
11302
11303         for cf_trim_lib in Xmu Xt X11
11304         do
11305                 case "$LIBS" in
11306                 (*-l$cf_trim_lib\ *-l$cf_trim_lib*)
11307                         LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
11308                         test -n "$verbose" && echo "    ..trimmed $LIBS" 1>&6
11309
11310 echo "${as_me:-configure}:11310: testing ..trimmed $LIBS ..." 1>&5
11311
11312                         ;;
11313                 esac
11314         done
11315
11316 echo "$as_me:11316: checking for usable $cf_x_athena/Xmu package" >&5
11317 echo $ECHO_N "checking for usable $cf_x_athena/Xmu package... $ECHO_C" >&6
11318 if test "${cf_cv_xaw_compat+set}" = set; then
11319   echo $ECHO_N "(cached) $ECHO_C" >&6
11320 else
11321
11322 cat >conftest.$ac_ext <<_ACEOF
11323 #line 11323 "configure"
11324 #include "confdefs.h"
11325
11326 #include <X11/Xmu/CharSet.h>
11327
11328 int
11329 main (void)
11330 {
11331
11332 int check = XmuCompareISOLatin1("big", "small")
11333
11334   ;
11335   return 0;
11336 }
11337 _ACEOF
11338 rm -f conftest.$ac_objext conftest$ac_exeext
11339 if { (eval echo "$as_me:11339: \"$ac_link\"") >&5
11340   (eval $ac_link) 2>&5
11341   ac_status=$?
11342   echo "$as_me:11342: \$? = $ac_status" >&5
11343   (exit $ac_status); } &&
11344          { ac_try='test -s conftest$ac_exeext'
11345   { (eval echo "$as_me:11345: \"$ac_try\"") >&5
11346   (eval $ac_try) 2>&5
11347   ac_status=$?
11348   echo "$as_me:11348: \$? = $ac_status" >&5
11349   (exit $ac_status); }; }; then
11350   cf_cv_xaw_compat=yes
11351 else
11352   echo "$as_me: failed program was:" >&5
11353 cat conftest.$ac_ext >&5
11354 cf_cv_xaw_compat=no
11355 fi
11356 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11357 fi
11358 echo "$as_me:11358: result: $cf_cv_xaw_compat" >&5
11359 echo "${ECHO_T}$cf_cv_xaw_compat" >&6
11360
11361                         if test "$cf_cv_xaw_compat" = no
11362                         then
11363                                 # workaround for broken ".pc" files...
11364                                 case "$cf_x_athena_lib" in
11365                                 (*-lXmu*)
11366                                         ;;
11367                                 (*)
11368                                         test -n "$verbose" && echo "    work around broken package" 1>&6
11369
11370 echo "${as_me:-configure}:11370: testing work around broken package ..." 1>&5
11371
11372                                         cf_save_xmu="$LIBS"
11373                                         cf_first_lib=`echo "$cf_save_xmu" | sed -e 's/^  *//' -e 's/ .*//'`
11374
11375 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xmu; then
11376         test -n "$verbose" && echo "    found package xmu" 1>&6
11377
11378 echo "${as_me:-configure}:11378: testing found package xmu ..." 1>&5
11379
11380         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xmu 2>/dev/null`"
11381         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xmu 2>/dev/null`"
11382         test -n "$verbose" && echo "    package xmu CFLAGS: $cf_pkgconfig_incs" 1>&6
11383
11384 echo "${as_me:-configure}:11384: testing package xmu CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11385
11386         test -n "$verbose" && echo "    package xmu LIBS: $cf_pkgconfig_libs" 1>&6
11387
11388 echo "${as_me:-configure}:11388: testing package xmu LIBS: $cf_pkgconfig_libs ..." 1>&5
11389
11390 cf_fix_cppflags=no
11391 cf_new_cflags=
11392 cf_new_cppflags=
11393 cf_new_extra_cppflags=
11394
11395 for cf_add_cflags in $cf_pkgconfig_incs
11396 do
11397 case $cf_fix_cppflags in
11398 (no)
11399         case $cf_add_cflags in
11400         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11401                 case $cf_add_cflags in
11402                 (-D*)
11403                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11404
11405                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11406                                 && test -z "${cf_tst_cflags}" \
11407                                 && cf_fix_cppflags=yes
11408
11409                         if test $cf_fix_cppflags = yes ; then
11410
11411         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11412         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11413
11414                                 continue
11415                         elif test "${cf_tst_cflags}" = "\"'" ; then
11416
11417         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11418         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11419
11420                                 continue
11421                         fi
11422                         ;;
11423                 esac
11424                 case "$CPPFLAGS" in
11425                 (*$cf_add_cflags)
11426                         ;;
11427                 (*)
11428                         case $cf_add_cflags in
11429                         (-D*)
11430                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11431
11432 CPPFLAGS=`echo "$CPPFLAGS" | \
11433         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11434                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11435
11436                                 ;;
11437                         esac
11438
11439         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
11440         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
11441
11442                         ;;
11443                 esac
11444                 ;;
11445         (*)
11446
11447         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
11448         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
11449
11450                 ;;
11451         esac
11452         ;;
11453 (yes)
11454
11455         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11456         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11457
11458         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11459
11460         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11461                 && test -z "${cf_tst_cflags}" \
11462                 && cf_fix_cppflags=no
11463         ;;
11464 esac
11465 done
11466
11467 if test -n "$cf_new_cflags" ; then
11468
11469         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
11470         CFLAGS="${CFLAGS}$cf_new_cflags"
11471
11472 fi
11473
11474 if test -n "$cf_new_cppflags" ; then
11475
11476         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11477         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
11478
11479 fi
11480
11481 if test -n "$cf_new_extra_cppflags" ; then
11482
11483         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
11484         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
11485
11486 fi
11487
11488 cf_add_libs="$cf_pkgconfig_libs"
11489 # Filter out duplicates - this happens with badly-designed ".pc" files...
11490 for cf_add_1lib in $LIBS
11491 do
11492         for cf_add_2lib in $cf_add_libs
11493         do
11494                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11495                 then
11496                         cf_add_1lib=
11497                         break
11498                 fi
11499         done
11500         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11501 done
11502 LIBS="$cf_add_libs"
11503
11504                                                         LIBS="$cf_save_xmu"
11505
11506 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
11507
11508 echo "${as_me:-configure}:11508: testing ...before $LIBS ..." 1>&5
11509
11510 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib $cf_pkgconfig_libs %" -e 's%  % %g'`
11511 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
11512
11513 echo "${as_me:-configure}:11513: testing ...after  $LIBS ..." 1>&5
11514
11515 else
11516         cf_pkgconfig_incs=
11517         cf_pkgconfig_libs=
11518
11519 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
11520
11521 echo "${as_me:-configure}:11521: testing ...before $LIBS ..." 1>&5
11522
11523 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib -lXmu %" -e 's%  % %g'`
11524 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
11525
11526 echo "${as_me:-configure}:11526: testing ...after  $LIBS ..." 1>&5
11527
11528 fi
11529
11530         for cf_trim_lib in Xmu Xt X11
11531         do
11532                 case "$LIBS" in
11533                 (*-l$cf_trim_lib\ *-l$cf_trim_lib*)
11534                         LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
11535                         test -n "$verbose" && echo "    ..trimmed $LIBS" 1>&6
11536
11537 echo "${as_me:-configure}:11537: testing ..trimmed $LIBS ..." 1>&5
11538
11539                         ;;
11540                 esac
11541         done
11542
11543                                         ;;
11544                                 esac
11545                         fi
11546
11547                         break
11548 else
11549         cf_pkgconfig_incs=
11550         cf_pkgconfig_libs=
11551         :
11552 fi
11553
11554         done
11555 fi
11556
11557 if test -z "$cf_x_athena_lib" ; then
11558
11559 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists Xext; then
11560         test -n "$verbose" && echo "    found package Xext" 1>&6
11561
11562 echo "${as_me:-configure}:11562: testing found package Xext ..." 1>&5
11563
11564         cf_pkgconfig_incs="`$PKG_CONFIG --cflags Xext 2>/dev/null`"
11565         cf_pkgconfig_libs="`$PKG_CONFIG --libs   Xext 2>/dev/null`"
11566         test -n "$verbose" && echo "    package Xext CFLAGS: $cf_pkgconfig_incs" 1>&6
11567
11568 echo "${as_me:-configure}:11568: testing package Xext CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11569
11570         test -n "$verbose" && echo "    package Xext LIBS: $cf_pkgconfig_libs" 1>&6
11571
11572 echo "${as_me:-configure}:11572: testing package Xext LIBS: $cf_pkgconfig_libs ..." 1>&5
11573
11574 cf_fix_cppflags=no
11575 cf_new_cflags=
11576 cf_new_cppflags=
11577 cf_new_extra_cppflags=
11578
11579 for cf_add_cflags in $cf_pkgconfig_incs
11580 do
11581 case $cf_fix_cppflags in
11582 (no)
11583         case $cf_add_cflags in
11584         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11585                 case $cf_add_cflags in
11586                 (-D*)
11587                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11588
11589                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11590                                 && test -z "${cf_tst_cflags}" \
11591                                 && cf_fix_cppflags=yes
11592
11593                         if test $cf_fix_cppflags = yes ; then
11594
11595         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11596         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11597
11598                                 continue
11599                         elif test "${cf_tst_cflags}" = "\"'" ; then
11600
11601         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11602         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11603
11604                                 continue
11605                         fi
11606                         ;;
11607                 esac
11608                 case "$CPPFLAGS" in
11609                 (*$cf_add_cflags)
11610                         ;;
11611                 (*)
11612                         case $cf_add_cflags in
11613                         (-D*)
11614                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11615
11616 CPPFLAGS=`echo "$CPPFLAGS" | \
11617         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11618                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11619
11620                                 ;;
11621                         esac
11622
11623         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
11624         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
11625
11626                         ;;
11627                 esac
11628                 ;;
11629         (*)
11630
11631         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
11632         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
11633
11634                 ;;
11635         esac
11636         ;;
11637 (yes)
11638
11639         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11640         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11641
11642         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11643
11644         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11645                 && test -z "${cf_tst_cflags}" \
11646                 && cf_fix_cppflags=no
11647         ;;
11648 esac
11649 done
11650
11651 if test -n "$cf_new_cflags" ; then
11652
11653         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
11654         CFLAGS="${CFLAGS}$cf_new_cflags"
11655
11656 fi
11657
11658 if test -n "$cf_new_cppflags" ; then
11659
11660         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11661         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
11662
11663 fi
11664
11665 if test -n "$cf_new_extra_cppflags" ; then
11666
11667         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
11668         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
11669
11670 fi
11671
11672 cf_add_libs="$cf_pkgconfig_libs"
11673 # Filter out duplicates - this happens with badly-designed ".pc" files...
11674 for cf_add_1lib in $LIBS
11675 do
11676         for cf_add_2lib in $cf_add_libs
11677         do
11678                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11679                 then
11680                         cf_add_1lib=
11681                         break
11682                 fi
11683         done
11684         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11685 done
11686 LIBS="$cf_add_libs"
11687
11688         :
11689 else
11690         cf_pkgconfig_incs=
11691         cf_pkgconfig_libs=
11692
11693         echo "$as_me:11693: checking for XextCreateExtension in -lXext" >&5
11694 echo $ECHO_N "checking for XextCreateExtension in -lXext... $ECHO_C" >&6
11695 if test "${ac_cv_lib_Xext_XextCreateExtension+set}" = set; then
11696   echo $ECHO_N "(cached) $ECHO_C" >&6
11697 else
11698   ac_check_lib_save_LIBS=$LIBS
11699 LIBS="-lXext  $LIBS"
11700 cat >conftest.$ac_ext <<_ACEOF
11701 #line 11701 "configure"
11702 #include "confdefs.h"
11703
11704 /* Override any gcc2 internal prototype to avoid an error.  */
11705 #ifdef __cplusplus
11706 extern "C"
11707 #endif
11708 /* We use char because int might match the return type of a gcc2
11709    builtin and then its argument prototype would still apply.  */
11710 char XextCreateExtension ();
11711 int
11712 main (void)
11713 {
11714 XextCreateExtension ();
11715   ;
11716   return 0;
11717 }
11718 _ACEOF
11719 rm -f conftest.$ac_objext conftest$ac_exeext
11720 if { (eval echo "$as_me:11720: \"$ac_link\"") >&5
11721   (eval $ac_link) 2>&5
11722   ac_status=$?
11723   echo "$as_me:11723: \$? = $ac_status" >&5
11724   (exit $ac_status); } &&
11725          { ac_try='test -s conftest$ac_exeext'
11726   { (eval echo "$as_me:11726: \"$ac_try\"") >&5
11727   (eval $ac_try) 2>&5
11728   ac_status=$?
11729   echo "$as_me:11729: \$? = $ac_status" >&5
11730   (exit $ac_status); }; }; then
11731   ac_cv_lib_Xext_XextCreateExtension=yes
11732 else
11733   echo "$as_me: failed program was:" >&5
11734 cat conftest.$ac_ext >&5
11735 ac_cv_lib_Xext_XextCreateExtension=no
11736 fi
11737 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11738 LIBS=$ac_check_lib_save_LIBS
11739 fi
11740 echo "$as_me:11740: result: $ac_cv_lib_Xext_XextCreateExtension" >&5
11741 echo "${ECHO_T}$ac_cv_lib_Xext_XextCreateExtension" >&6
11742 if test $ac_cv_lib_Xext_XextCreateExtension = yes; then
11743
11744 cf_add_libs="-lXext"
11745 # Filter out duplicates - this happens with badly-designed ".pc" files...
11746 for cf_add_1lib in $LIBS
11747 do
11748         for cf_add_2lib in $cf_add_libs
11749         do
11750                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11751                 then
11752                         cf_add_1lib=
11753                         break
11754                 fi
11755         done
11756         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11757 done
11758 LIBS="$cf_add_libs"
11759
11760 fi
11761
11762 fi
11763
11764 # OSX is schizoid about who owns /usr/X11 (old) versus /opt/X11 (new), and (and
11765 # in some cases has installed dummy files in the former, other cases replaced
11766 # it with a link to the new location).  This complicates the configure script.
11767 # Check for that pitfall, and recover using pkg-config
11768 #
11769 # If none of these are set, the configuration is almost certainly broken.
11770 if test -z "${X_CFLAGS}${X_PRE_LIBS}${X_LIBS}${X_EXTRA_LIBS}"
11771 then
11772
11773 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists x11; then
11774         test -n "$verbose" && echo "    found package x11" 1>&6
11775
11776 echo "${as_me:-configure}:11776: testing found package x11 ..." 1>&5
11777
11778         cf_pkgconfig_incs="`$PKG_CONFIG --cflags x11 2>/dev/null`"
11779         cf_pkgconfig_libs="`$PKG_CONFIG --libs   x11 2>/dev/null`"
11780         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
11781
11782 echo "${as_me:-configure}:11782: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11783
11784         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
11785
11786 echo "${as_me:-configure}:11786: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
11787
11788 cf_fix_cppflags=no
11789 cf_new_cflags=
11790 cf_new_cppflags=
11791 cf_new_extra_cppflags=
11792
11793 for cf_add_cflags in $cf_pkgconfig_incs
11794 do
11795 case $cf_fix_cppflags in
11796 (no)
11797         case $cf_add_cflags in
11798         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11799                 case $cf_add_cflags in
11800                 (-D*)
11801                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11802
11803                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11804                                 && test -z "${cf_tst_cflags}" \
11805                                 && cf_fix_cppflags=yes
11806
11807                         if test $cf_fix_cppflags = yes ; then
11808
11809         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11810         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11811
11812                                 continue
11813                         elif test "${cf_tst_cflags}" = "\"'" ; then
11814
11815         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11816         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11817
11818                                 continue
11819                         fi
11820                         ;;
11821                 esac
11822                 case "$CPPFLAGS" in
11823                 (*$cf_add_cflags)
11824                         ;;
11825                 (*)
11826                         case $cf_add_cflags in
11827                         (-D*)
11828                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11829
11830 CPPFLAGS=`echo "$CPPFLAGS" | \
11831         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11832                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11833
11834                                 ;;
11835                         esac
11836
11837         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
11838         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
11839
11840                         ;;
11841                 esac
11842                 ;;
11843         (*)
11844
11845         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
11846         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
11847
11848                 ;;
11849         esac
11850         ;;
11851 (yes)
11852
11853         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11854         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11855
11856         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11857
11858         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11859                 && test -z "${cf_tst_cflags}" \
11860                 && cf_fix_cppflags=no
11861         ;;
11862 esac
11863 done
11864
11865 if test -n "$cf_new_cflags" ; then
11866
11867         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
11868         CFLAGS="${CFLAGS}$cf_new_cflags"
11869
11870 fi
11871
11872 if test -n "$cf_new_cppflags" ; then
11873
11874         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11875         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
11876
11877 fi
11878
11879 if test -n "$cf_new_extra_cppflags" ; then
11880
11881         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
11882         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
11883
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         { echo "$as_me:11906: WARNING: unable to find X11 library" >&5
11907 echo "$as_me: WARNING: unable to find X11 library" >&2;}
11908 fi
11909
11910 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists ice; then
11911         test -n "$verbose" && echo "    found package ice" 1>&6
11912
11913 echo "${as_me:-configure}:11913: testing found package ice ..." 1>&5
11914
11915         cf_pkgconfig_incs="`$PKG_CONFIG --cflags ice 2>/dev/null`"
11916         cf_pkgconfig_libs="`$PKG_CONFIG --libs   ice 2>/dev/null`"
11917         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
11918
11919 echo "${as_me:-configure}:11919: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11920
11921         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
11922
11923 echo "${as_me:-configure}:11923: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
11924
11925 cf_fix_cppflags=no
11926 cf_new_cflags=
11927 cf_new_cppflags=
11928 cf_new_extra_cppflags=
11929
11930 for cf_add_cflags in $cf_pkgconfig_incs
11931 do
11932 case $cf_fix_cppflags in
11933 (no)
11934         case $cf_add_cflags in
11935         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11936                 case $cf_add_cflags in
11937                 (-D*)
11938                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11939
11940                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11941                                 && test -z "${cf_tst_cflags}" \
11942                                 && cf_fix_cppflags=yes
11943
11944                         if test $cf_fix_cppflags = yes ; then
11945
11946         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11947         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11948
11949                                 continue
11950                         elif test "${cf_tst_cflags}" = "\"'" ; then
11951
11952         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11953         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11954
11955                                 continue
11956                         fi
11957                         ;;
11958                 esac
11959                 case "$CPPFLAGS" in
11960                 (*$cf_add_cflags)
11961                         ;;
11962                 (*)
11963                         case $cf_add_cflags in
11964                         (-D*)
11965                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11966
11967 CPPFLAGS=`echo "$CPPFLAGS" | \
11968         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11969                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11970
11971                                 ;;
11972                         esac
11973
11974         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
11975         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
11976
11977                         ;;
11978                 esac
11979                 ;;
11980         (*)
11981
11982         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
11983         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
11984
11985                 ;;
11986         esac
11987         ;;
11988 (yes)
11989
11990         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11991         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11992
11993         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11994
11995         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11996                 && test -z "${cf_tst_cflags}" \
11997                 && cf_fix_cppflags=no
11998         ;;
11999 esac
12000 done
12001
12002 if test -n "$cf_new_cflags" ; then
12003
12004         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12005         CFLAGS="${CFLAGS}$cf_new_cflags"
12006
12007 fi
12008
12009 if test -n "$cf_new_cppflags" ; then
12010
12011         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12012         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12013
12014 fi
12015
12016 if test -n "$cf_new_extra_cppflags" ; then
12017
12018         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12019         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12020
12021 fi
12022
12023 cf_add_libs="$cf_pkgconfig_libs"
12024 # Filter out duplicates - this happens with badly-designed ".pc" files...
12025 for cf_add_1lib in $LIBS
12026 do
12027         for cf_add_2lib in $cf_add_libs
12028         do
12029                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12030                 then
12031                         cf_add_1lib=
12032                         break
12033                 fi
12034         done
12035         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12036 done
12037 LIBS="$cf_add_libs"
12038
12039         :
12040 else
12041         cf_pkgconfig_incs=
12042         cf_pkgconfig_libs=
12043         { echo "$as_me:12043: WARNING: unable to find ICE library" >&5
12044 echo "$as_me: WARNING: unable to find ICE library" >&2;}
12045 fi
12046
12047 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists sm; then
12048         test -n "$verbose" && echo "    found package sm" 1>&6
12049
12050 echo "${as_me:-configure}:12050: testing found package sm ..." 1>&5
12051
12052         cf_pkgconfig_incs="`$PKG_CONFIG --cflags sm 2>/dev/null`"
12053         cf_pkgconfig_libs="`$PKG_CONFIG --libs   sm 2>/dev/null`"
12054         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
12055
12056 echo "${as_me:-configure}:12056: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12057
12058         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
12059
12060 echo "${as_me:-configure}:12060: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
12061
12062 cf_fix_cppflags=no
12063 cf_new_cflags=
12064 cf_new_cppflags=
12065 cf_new_extra_cppflags=
12066
12067 for cf_add_cflags in $cf_pkgconfig_incs
12068 do
12069 case $cf_fix_cppflags in
12070 (no)
12071         case $cf_add_cflags in
12072         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12073                 case $cf_add_cflags in
12074                 (-D*)
12075                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12076
12077                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12078                                 && test -z "${cf_tst_cflags}" \
12079                                 && cf_fix_cppflags=yes
12080
12081                         if test $cf_fix_cppflags = yes ; then
12082
12083         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12084         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12085
12086                                 continue
12087                         elif test "${cf_tst_cflags}" = "\"'" ; then
12088
12089         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12090         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12091
12092                                 continue
12093                         fi
12094                         ;;
12095                 esac
12096                 case "$CPPFLAGS" in
12097                 (*$cf_add_cflags)
12098                         ;;
12099                 (*)
12100                         case $cf_add_cflags in
12101                         (-D*)
12102                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12103
12104 CPPFLAGS=`echo "$CPPFLAGS" | \
12105         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12106                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12107
12108                                 ;;
12109                         esac
12110
12111         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12112         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12113
12114                         ;;
12115                 esac
12116                 ;;
12117         (*)
12118
12119         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12120         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12121
12122                 ;;
12123         esac
12124         ;;
12125 (yes)
12126
12127         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12128         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12129
12130         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12131
12132         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12133                 && test -z "${cf_tst_cflags}" \
12134                 && cf_fix_cppflags=no
12135         ;;
12136 esac
12137 done
12138
12139 if test -n "$cf_new_cflags" ; then
12140
12141         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12142         CFLAGS="${CFLAGS}$cf_new_cflags"
12143
12144 fi
12145
12146 if test -n "$cf_new_cppflags" ; then
12147
12148         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12149         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12150
12151 fi
12152
12153 if test -n "$cf_new_extra_cppflags" ; then
12154
12155         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12156         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12157
12158 fi
12159
12160 cf_add_libs="$cf_pkgconfig_libs"
12161 # Filter out duplicates - this happens with badly-designed ".pc" files...
12162 for cf_add_1lib in $LIBS
12163 do
12164         for cf_add_2lib in $cf_add_libs
12165         do
12166                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12167                 then
12168                         cf_add_1lib=
12169                         break
12170                 fi
12171         done
12172         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12173 done
12174 LIBS="$cf_add_libs"
12175
12176         :
12177 else
12178         cf_pkgconfig_incs=
12179         cf_pkgconfig_libs=
12180         { echo "$as_me:12180: WARNING: unable to find SM library" >&5
12181 echo "$as_me: WARNING: unable to find SM library" >&2;}
12182 fi
12183
12184 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xt; then
12185         test -n "$verbose" && echo "    found package xt" 1>&6
12186
12187 echo "${as_me:-configure}:12187: testing found package xt ..." 1>&5
12188
12189         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xt 2>/dev/null`"
12190         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xt 2>/dev/null`"
12191         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
12192
12193 echo "${as_me:-configure}:12193: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12194
12195         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
12196
12197 echo "${as_me:-configure}:12197: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
12198
12199 cf_fix_cppflags=no
12200 cf_new_cflags=
12201 cf_new_cppflags=
12202 cf_new_extra_cppflags=
12203
12204 for cf_add_cflags in $cf_pkgconfig_incs
12205 do
12206 case $cf_fix_cppflags in
12207 (no)
12208         case $cf_add_cflags in
12209         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12210                 case $cf_add_cflags in
12211                 (-D*)
12212                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12213
12214                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12215                                 && test -z "${cf_tst_cflags}" \
12216                                 && cf_fix_cppflags=yes
12217
12218                         if test $cf_fix_cppflags = yes ; then
12219
12220         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12221         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12222
12223                                 continue
12224                         elif test "${cf_tst_cflags}" = "\"'" ; then
12225
12226         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12227         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12228
12229                                 continue
12230                         fi
12231                         ;;
12232                 esac
12233                 case "$CPPFLAGS" in
12234                 (*$cf_add_cflags)
12235                         ;;
12236                 (*)
12237                         case $cf_add_cflags in
12238                         (-D*)
12239                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12240
12241 CPPFLAGS=`echo "$CPPFLAGS" | \
12242         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12243                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12244
12245                                 ;;
12246                         esac
12247
12248         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12249         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12250
12251                         ;;
12252                 esac
12253                 ;;
12254         (*)
12255
12256         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12257         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12258
12259                 ;;
12260         esac
12261         ;;
12262 (yes)
12263
12264         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12265         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12266
12267         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12268
12269         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12270                 && test -z "${cf_tst_cflags}" \
12271                 && cf_fix_cppflags=no
12272         ;;
12273 esac
12274 done
12275
12276 if test -n "$cf_new_cflags" ; then
12277
12278         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12279         CFLAGS="${CFLAGS}$cf_new_cflags"
12280
12281 fi
12282
12283 if test -n "$cf_new_cppflags" ; then
12284
12285         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12286         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12287
12288 fi
12289
12290 if test -n "$cf_new_extra_cppflags" ; then
12291
12292         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12293         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12294
12295 fi
12296
12297 cf_add_libs="$cf_pkgconfig_libs"
12298 # Filter out duplicates - this happens with badly-designed ".pc" files...
12299 for cf_add_1lib in $LIBS
12300 do
12301         for cf_add_2lib in $cf_add_libs
12302         do
12303                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12304                 then
12305                         cf_add_1lib=
12306                         break
12307                 fi
12308         done
12309         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12310 done
12311 LIBS="$cf_add_libs"
12312
12313         :
12314 else
12315         cf_pkgconfig_incs=
12316         cf_pkgconfig_libs=
12317         { echo "$as_me:12317: WARNING: unable to find Xt library" >&5
12318 echo "$as_me: WARNING: unable to find Xt library" >&2;}
12319 fi
12320
12321 fi
12322
12323 cf_have_X_LIBS=no
12324
12325 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xt; then
12326         test -n "$verbose" && echo "    found package xt" 1>&6
12327
12328 echo "${as_me:-configure}:12328: testing found package xt ..." 1>&5
12329
12330         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xt 2>/dev/null`"
12331         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xt 2>/dev/null`"
12332         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
12333
12334 echo "${as_me:-configure}:12334: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12335
12336         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
12337
12338 echo "${as_me:-configure}:12338: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
12339
12340 cf_fix_cppflags=no
12341 cf_new_cflags=
12342 cf_new_cppflags=
12343 cf_new_extra_cppflags=
12344
12345 for cf_add_cflags in $cf_pkgconfig_incs
12346 do
12347 case $cf_fix_cppflags in
12348 (no)
12349         case $cf_add_cflags in
12350         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12351                 case $cf_add_cflags in
12352                 (-D*)
12353                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12354
12355                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12356                                 && test -z "${cf_tst_cflags}" \
12357                                 && cf_fix_cppflags=yes
12358
12359                         if test $cf_fix_cppflags = yes ; then
12360
12361         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12362         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12363
12364                                 continue
12365                         elif test "${cf_tst_cflags}" = "\"'" ; then
12366
12367         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12368         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12369
12370                                 continue
12371                         fi
12372                         ;;
12373                 esac
12374                 case "$CPPFLAGS" in
12375                 (*$cf_add_cflags)
12376                         ;;
12377                 (*)
12378                         case $cf_add_cflags in
12379                         (-D*)
12380                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12381
12382 CPPFLAGS=`echo "$CPPFLAGS" | \
12383         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12384                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12385
12386                                 ;;
12387                         esac
12388
12389         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12390         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12391
12392                         ;;
12393                 esac
12394                 ;;
12395         (*)
12396
12397         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12398         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12399
12400                 ;;
12401         esac
12402         ;;
12403 (yes)
12404
12405         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12406         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12407
12408         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12409
12410         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12411                 && test -z "${cf_tst_cflags}" \
12412                 && cf_fix_cppflags=no
12413         ;;
12414 esac
12415 done
12416
12417 if test -n "$cf_new_cflags" ; then
12418
12419         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12420         CFLAGS="${CFLAGS}$cf_new_cflags"
12421
12422 fi
12423
12424 if test -n "$cf_new_cppflags" ; then
12425
12426         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12427         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12428
12429 fi
12430
12431 if test -n "$cf_new_extra_cppflags" ; then
12432
12433         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12434         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12435
12436 fi
12437
12438 cf_add_libs="$cf_pkgconfig_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         case "x$LIBS" in
12455         (*-lX11*)
12456                 ;;
12457         (*)
12458 # we have an "xt" package, but it may omit Xt's dependency on X11
12459 echo "$as_me:12459: checking for usable X dependency" >&5
12460 echo $ECHO_N "checking for usable X dependency... $ECHO_C" >&6
12461 if test "${cf_cv_xt_x11_compat+set}" = set; then
12462   echo $ECHO_N "(cached) $ECHO_C" >&6
12463 else
12464
12465 cat >conftest.$ac_ext <<_ACEOF
12466 #line 12466 "configure"
12467 #include "confdefs.h"
12468
12469 #include <X11/Xlib.h>
12470
12471 int
12472 main (void)
12473 {
12474
12475         int rc1 = XDrawLine((Display*) 0, (Drawable) 0, (GC) 0, 0, 0, 0, 0);
12476         int rc2 = XClearWindow((Display*) 0, (Window) 0);
12477         int rc3 = XMoveWindow((Display*) 0, (Window) 0, 0, 0);
12478         int rc4 = XMoveResizeWindow((Display*)0, (Window)0, 0, 0, 0, 0);
12479
12480   ;
12481   return 0;
12482 }
12483 _ACEOF
12484 rm -f conftest.$ac_objext conftest$ac_exeext
12485 if { (eval echo "$as_me:12485: \"$ac_link\"") >&5
12486   (eval $ac_link) 2>&5
12487   ac_status=$?
12488   echo "$as_me:12488: \$? = $ac_status" >&5
12489   (exit $ac_status); } &&
12490          { ac_try='test -s conftest$ac_exeext'
12491   { (eval echo "$as_me:12491: \"$ac_try\"") >&5
12492   (eval $ac_try) 2>&5
12493   ac_status=$?
12494   echo "$as_me:12494: \$? = $ac_status" >&5
12495   (exit $ac_status); }; }; then
12496   cf_cv_xt_x11_compat=yes
12497 else
12498   echo "$as_me: failed program was:" >&5
12499 cat conftest.$ac_ext >&5
12500 cf_cv_xt_x11_compat=no
12501 fi
12502 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12503 fi
12504 echo "$as_me:12504: result: $cf_cv_xt_x11_compat" >&5
12505 echo "${ECHO_T}$cf_cv_xt_x11_compat" >&6
12506                 if test "$cf_cv_xt_x11_compat" = no
12507                 then
12508                         test -n "$verbose" && echo "    work around broken X11 dependency" 1>&6
12509
12510 echo "${as_me:-configure}:12510: testing work around broken X11 dependency ..." 1>&5
12511
12512                         # 2010/11/19 - good enough until a working Xt on Xcb is delivered.
12513
12514 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists x11; then
12515         test -n "$verbose" && echo "    found package x11" 1>&6
12516
12517 echo "${as_me:-configure}:12517: testing found package x11 ..." 1>&5
12518
12519         cf_pkgconfig_incs="`$PKG_CONFIG --cflags x11 2>/dev/null`"
12520         cf_pkgconfig_libs="`$PKG_CONFIG --libs   x11 2>/dev/null`"
12521         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
12522
12523 echo "${as_me:-configure}:12523: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12524
12525         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
12526
12527 echo "${as_me:-configure}:12527: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
12528
12529 cf_fix_cppflags=no
12530 cf_new_cflags=
12531 cf_new_cppflags=
12532 cf_new_extra_cppflags=
12533
12534 for cf_add_cflags in $cf_pkgconfig_incs
12535 do
12536 case $cf_fix_cppflags in
12537 (no)
12538         case $cf_add_cflags in
12539         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12540                 case $cf_add_cflags in
12541                 (-D*)
12542                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12543
12544                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12545                                 && test -z "${cf_tst_cflags}" \
12546                                 && cf_fix_cppflags=yes
12547
12548                         if test $cf_fix_cppflags = yes ; then
12549
12550         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12551         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12552
12553                                 continue
12554                         elif test "${cf_tst_cflags}" = "\"'" ; then
12555
12556         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12557         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12558
12559                                 continue
12560                         fi
12561                         ;;
12562                 esac
12563                 case "$CPPFLAGS" in
12564                 (*$cf_add_cflags)
12565                         ;;
12566                 (*)
12567                         case $cf_add_cflags in
12568                         (-D*)
12569                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12570
12571 CPPFLAGS=`echo "$CPPFLAGS" | \
12572         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12573                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12574
12575                                 ;;
12576                         esac
12577
12578         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12579         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12580
12581                         ;;
12582                 esac
12583                 ;;
12584         (*)
12585
12586         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12587         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12588
12589                 ;;
12590         esac
12591         ;;
12592 (yes)
12593
12594         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12595         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12596
12597         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12598
12599         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12600                 && test -z "${cf_tst_cflags}" \
12601                 && cf_fix_cppflags=no
12602         ;;
12603 esac
12604 done
12605
12606 if test -n "$cf_new_cflags" ; then
12607
12608         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12609         CFLAGS="${CFLAGS}$cf_new_cflags"
12610
12611 fi
12612
12613 if test -n "$cf_new_cppflags" ; then
12614
12615         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12616         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12617
12618 fi
12619
12620 if test -n "$cf_new_extra_cppflags" ; then
12621
12622         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12623         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12624
12625 fi
12626
12627 cf_add_libs="$cf_pkgconfig_libs"
12628 # Filter out duplicates - this happens with badly-designed ".pc" files...
12629 for cf_add_1lib in $LIBS
12630 do
12631         for cf_add_2lib in $cf_add_libs
12632         do
12633                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12634                 then
12635                         cf_add_1lib=
12636                         break
12637                 fi
12638         done
12639         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12640 done
12641 LIBS="$cf_add_libs"
12642
12643         :
12644 else
12645         cf_pkgconfig_incs=
12646         cf_pkgconfig_libs=
12647
12648 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
12649
12650 echo "${as_me:-configure}:12650: testing ...before $LIBS ..." 1>&5
12651
12652 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%-lXt %-lXt -lX11 %" -e 's%  % %g'`
12653 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
12654
12655 echo "${as_me:-configure}:12655: testing ...after  $LIBS ..." 1>&5
12656
12657 fi
12658
12659                 fi
12660                 ;;
12661         esac
12662
12663 echo "$as_me:12663: checking for usable X Toolkit package" >&5
12664 echo $ECHO_N "checking for usable X Toolkit package... $ECHO_C" >&6
12665 if test "${cf_cv_xt_ice_compat+set}" = set; then
12666   echo $ECHO_N "(cached) $ECHO_C" >&6
12667 else
12668
12669 cat >conftest.$ac_ext <<_ACEOF
12670 #line 12670 "configure"
12671 #include "confdefs.h"
12672
12673 #include <X11/Shell.h>
12674
12675 int
12676 main (void)
12677 {
12678 int num = IceConnectionNumber(0)
12679
12680   ;
12681   return 0;
12682 }
12683 _ACEOF
12684 rm -f conftest.$ac_objext conftest$ac_exeext
12685 if { (eval echo "$as_me:12685: \"$ac_link\"") >&5
12686   (eval $ac_link) 2>&5
12687   ac_status=$?
12688   echo "$as_me:12688: \$? = $ac_status" >&5
12689   (exit $ac_status); } &&
12690          { ac_try='test -s conftest$ac_exeext'
12691   { (eval echo "$as_me:12691: \"$ac_try\"") >&5
12692   (eval $ac_try) 2>&5
12693   ac_status=$?
12694   echo "$as_me:12694: \$? = $ac_status" >&5
12695   (exit $ac_status); }; }; then
12696   cf_cv_xt_ice_compat=yes
12697 else
12698   echo "$as_me: failed program was:" >&5
12699 cat conftest.$ac_ext >&5
12700 cf_cv_xt_ice_compat=no
12701 fi
12702 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12703 fi
12704 echo "$as_me:12704: result: $cf_cv_xt_ice_compat" >&5
12705 echo "${ECHO_T}$cf_cv_xt_ice_compat" >&6
12706
12707         if test "$cf_cv_xt_ice_compat" = no
12708         then
12709                 # workaround for broken ".pc" files used for X Toolkit.
12710                 case "x$X_PRE_LIBS" in
12711                 (*-lICE*)
12712                         case "x$LIBS" in
12713                         (*-lICE*)
12714                                 ;;
12715                         (*)
12716                                 test -n "$verbose" && echo "    work around broken ICE dependency" 1>&6
12717
12718 echo "${as_me:-configure}:12718: testing work around broken ICE dependency ..." 1>&5
12719
12720 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists ice; then
12721         test -n "$verbose" && echo "    found package ice" 1>&6
12722
12723 echo "${as_me:-configure}:12723: testing found package ice ..." 1>&5
12724
12725         cf_pkgconfig_incs="`$PKG_CONFIG --cflags ice 2>/dev/null`"
12726         cf_pkgconfig_libs="`$PKG_CONFIG --libs   ice 2>/dev/null`"
12727         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
12728
12729 echo "${as_me:-configure}:12729: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12730
12731         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
12732
12733 echo "${as_me:-configure}:12733: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
12734
12735 cf_fix_cppflags=no
12736 cf_new_cflags=
12737 cf_new_cppflags=
12738 cf_new_extra_cppflags=
12739
12740 for cf_add_cflags in $cf_pkgconfig_incs
12741 do
12742 case $cf_fix_cppflags in
12743 (no)
12744         case $cf_add_cflags in
12745         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12746                 case $cf_add_cflags in
12747                 (-D*)
12748                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12749
12750                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12751                                 && test -z "${cf_tst_cflags}" \
12752                                 && cf_fix_cppflags=yes
12753
12754                         if test $cf_fix_cppflags = yes ; then
12755
12756         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12757         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12758
12759                                 continue
12760                         elif test "${cf_tst_cflags}" = "\"'" ; then
12761
12762         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12763         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12764
12765                                 continue
12766                         fi
12767                         ;;
12768                 esac
12769                 case "$CPPFLAGS" in
12770                 (*$cf_add_cflags)
12771                         ;;
12772                 (*)
12773                         case $cf_add_cflags in
12774                         (-D*)
12775                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12776
12777 CPPFLAGS=`echo "$CPPFLAGS" | \
12778         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12779                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12780
12781                                 ;;
12782                         esac
12783
12784         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12785         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12786
12787                         ;;
12788                 esac
12789                 ;;
12790         (*)
12791
12792         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12793         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12794
12795                 ;;
12796         esac
12797         ;;
12798 (yes)
12799
12800         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12801         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12802
12803         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12804
12805         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12806                 && test -z "${cf_tst_cflags}" \
12807                 && cf_fix_cppflags=no
12808         ;;
12809 esac
12810 done
12811
12812 if test -n "$cf_new_cflags" ; then
12813
12814         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12815         CFLAGS="${CFLAGS}$cf_new_cflags"
12816
12817 fi
12818
12819 if test -n "$cf_new_cppflags" ; then
12820
12821         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12822         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12823
12824 fi
12825
12826 if test -n "$cf_new_extra_cppflags" ; then
12827
12828         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12829         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12830
12831 fi
12832
12833 cf_add_libs="$cf_pkgconfig_libs"
12834 # Filter out duplicates - this happens with badly-designed ".pc" files...
12835 for cf_add_1lib in $LIBS
12836 do
12837         for cf_add_2lib in $cf_add_libs
12838         do
12839                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12840                 then
12841                         cf_add_1lib=
12842                         break
12843                 fi
12844         done
12845         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12846 done
12847 LIBS="$cf_add_libs"
12848
12849 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists sm; then
12850         test -n "$verbose" && echo "    found package sm" 1>&6
12851
12852 echo "${as_me:-configure}:12852: testing found package sm ..." 1>&5
12853
12854         cf_pkgconfig_incs="`$PKG_CONFIG --cflags sm 2>/dev/null`"
12855         cf_pkgconfig_libs="`$PKG_CONFIG --libs   sm 2>/dev/null`"
12856         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
12857
12858 echo "${as_me:-configure}:12858: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12859
12860         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
12861
12862 echo "${as_me:-configure}:12862: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
12863
12864 cf_fix_cppflags=no
12865 cf_new_cflags=
12866 cf_new_cppflags=
12867 cf_new_extra_cppflags=
12868
12869 for cf_add_cflags in $cf_pkgconfig_incs
12870 do
12871 case $cf_fix_cppflags in
12872 (no)
12873         case $cf_add_cflags in
12874         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12875                 case $cf_add_cflags in
12876                 (-D*)
12877                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12878
12879                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12880                                 && test -z "${cf_tst_cflags}" \
12881                                 && cf_fix_cppflags=yes
12882
12883                         if test $cf_fix_cppflags = yes ; then
12884
12885         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12886         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12887
12888                                 continue
12889                         elif test "${cf_tst_cflags}" = "\"'" ; then
12890
12891         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12892         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12893
12894                                 continue
12895                         fi
12896                         ;;
12897                 esac
12898                 case "$CPPFLAGS" in
12899                 (*$cf_add_cflags)
12900                         ;;
12901                 (*)
12902                         case $cf_add_cflags in
12903                         (-D*)
12904                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12905
12906 CPPFLAGS=`echo "$CPPFLAGS" | \
12907         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12908                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12909
12910                                 ;;
12911                         esac
12912
12913         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12914         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12915
12916                         ;;
12917                 esac
12918                 ;;
12919         (*)
12920
12921         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12922         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12923
12924                 ;;
12925         esac
12926         ;;
12927 (yes)
12928
12929         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12930         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12931
12932         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12933
12934         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12935                 && test -z "${cf_tst_cflags}" \
12936                 && cf_fix_cppflags=no
12937         ;;
12938 esac
12939 done
12940
12941 if test -n "$cf_new_cflags" ; then
12942
12943         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12944         CFLAGS="${CFLAGS}$cf_new_cflags"
12945
12946 fi
12947
12948 if test -n "$cf_new_cppflags" ; then
12949
12950         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12951         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12952
12953 fi
12954
12955 if test -n "$cf_new_extra_cppflags" ; then
12956
12957         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12958         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12959
12960 fi
12961
12962 cf_add_libs="$cf_pkgconfig_libs"
12963 # Filter out duplicates - this happens with badly-designed ".pc" files...
12964 for cf_add_1lib in $LIBS
12965 do
12966         for cf_add_2lib in $cf_add_libs
12967         do
12968                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12969                 then
12970                         cf_add_1lib=
12971                         break
12972                 fi
12973         done
12974         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12975 done
12976 LIBS="$cf_add_libs"
12977
12978         :
12979 else
12980         cf_pkgconfig_incs=
12981         cf_pkgconfig_libs=
12982         :
12983 fi
12984
12985 else
12986         cf_pkgconfig_incs=
12987         cf_pkgconfig_libs=
12988
12989 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
12990
12991 echo "${as_me:-configure}:12991: testing ...before $LIBS ..." 1>&5
12992
12993 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%-lXt %-lXt $X_PRE_LIBS %" -e 's%  % %g'`
12994 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
12995
12996 echo "${as_me:-configure}:12996: testing ...after  $LIBS ..." 1>&5
12997
12998 fi
12999
13000                                 ;;
13001                         esac
13002                         ;;
13003                 esac
13004         fi
13005
13006         cf_have_X_LIBS=yes
13007
13008 else
13009         cf_pkgconfig_incs=
13010         cf_pkgconfig_libs=
13011
13012         LDFLAGS="$X_LIBS $LDFLAGS"
13013
13014 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
13015
13016 echo "${as_me:-configure}:13016: testing checking additions to CFLAGS ..." 1>&5
13017
13018 cf_check_cflags="$CFLAGS"
13019 cf_check_cppflags="$CPPFLAGS"
13020
13021 cf_fix_cppflags=no
13022 cf_new_cflags=
13023 cf_new_cppflags=
13024 cf_new_extra_cppflags=
13025
13026 for cf_add_cflags in $X_CFLAGS
13027 do
13028 case $cf_fix_cppflags in
13029 (no)
13030         case $cf_add_cflags in
13031         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13032                 case $cf_add_cflags in
13033                 (-D*)
13034                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13035
13036                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13037                                 && test -z "${cf_tst_cflags}" \
13038                                 && cf_fix_cppflags=yes
13039
13040                         if test $cf_fix_cppflags = yes ; then
13041
13042         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13043         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13044
13045                                 continue
13046                         elif test "${cf_tst_cflags}" = "\"'" ; then
13047
13048         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13049         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13050
13051                                 continue
13052                         fi
13053                         ;;
13054                 esac
13055                 case "$CPPFLAGS" in
13056                 (*$cf_add_cflags)
13057                         ;;
13058                 (*)
13059                         case $cf_add_cflags in
13060                         (-D*)
13061                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13062
13063 CPPFLAGS=`echo "$CPPFLAGS" | \
13064         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13065                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13066
13067                                 ;;
13068                         esac
13069
13070         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13071         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13072
13073                         ;;
13074                 esac
13075                 ;;
13076         (*)
13077
13078         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13079         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13080
13081                 ;;
13082         esac
13083         ;;
13084 (yes)
13085
13086         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13087         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13088
13089         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13090
13091         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13092                 && test -z "${cf_tst_cflags}" \
13093                 && cf_fix_cppflags=no
13094         ;;
13095 esac
13096 done
13097
13098 if test -n "$cf_new_cflags" ; then
13099         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
13100
13101 echo "${as_me:-configure}:13101: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
13102
13103         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13104         CFLAGS="${CFLAGS}$cf_new_cflags"
13105
13106 fi
13107
13108 if test -n "$cf_new_cppflags" ; then
13109         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
13110
13111 echo "${as_me:-configure}:13111: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
13112
13113         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13114         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13115
13116 fi
13117
13118 if test -n "$cf_new_extra_cppflags" ; then
13119         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
13120
13121 echo "${as_me:-configure}:13121: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
13122
13123         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13124         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13125
13126 fi
13127
13128 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
13129 cat >conftest.$ac_ext <<_ACEOF
13130 #line 13130 "configure"
13131 #include "confdefs.h"
13132 #include <stdio.h>
13133 int
13134 main (void)
13135 {
13136 printf("Hello world");
13137   ;
13138   return 0;
13139 }
13140 _ACEOF
13141 rm -f conftest.$ac_objext conftest$ac_exeext
13142 if { (eval echo "$as_me:13142: \"$ac_link\"") >&5
13143   (eval $ac_link) 2>&5
13144   ac_status=$?
13145   echo "$as_me:13145: \$? = $ac_status" >&5
13146   (exit $ac_status); } &&
13147          { ac_try='test -s conftest$ac_exeext'
13148   { (eval echo "$as_me:13148: \"$ac_try\"") >&5
13149   (eval $ac_try) 2>&5
13150   ac_status=$?
13151   echo "$as_me:13151: \$? = $ac_status" >&5
13152   (exit $ac_status); }; }; then
13153   :
13154 else
13155   echo "$as_me: failed program was:" >&5
13156 cat conftest.$ac_ext >&5
13157 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
13158
13159 echo "${as_me:-configure}:13159: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
13160
13161          if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
13162                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
13163
13164 echo "${as_me:-configure}:13164: testing but keeping change to \$CPPFLAGS ..." 1>&5
13165
13166          fi
13167          CFLAGS="$cf_check_flags"
13168 fi
13169 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13170 fi
13171
13172         echo "$as_me:13172: checking for XOpenDisplay" >&5
13173 echo $ECHO_N "checking for XOpenDisplay... $ECHO_C" >&6
13174 if test "${ac_cv_func_XOpenDisplay+set}" = set; then
13175   echo $ECHO_N "(cached) $ECHO_C" >&6
13176 else
13177   cat >conftest.$ac_ext <<_ACEOF
13178 #line 13178 "configure"
13179 #include "confdefs.h"
13180 /* System header to define __stub macros and hopefully few prototypes,
13181     which can conflict with char XOpenDisplay (); below.  */
13182 #include <assert.h>
13183 /* Override any gcc2 internal prototype to avoid an error.  */
13184 #ifdef __cplusplus
13185 extern "C"
13186 #endif
13187 /* We use char because int might match the return type of a gcc2
13188    builtin and then its argument prototype would still apply.  */
13189 char XOpenDisplay ();
13190 char (*f) ();
13191
13192 int
13193 main (void)
13194 {
13195 /* The GNU C library defines this for functions which it implements
13196     to always fail with ENOSYS.  Some functions are actually named
13197     something starting with __ and the normal name is an alias.  */
13198 #if defined (__stub_XOpenDisplay) || defined (__stub___XOpenDisplay)
13199 choke me
13200 #else
13201 f = XOpenDisplay; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
13202 #endif
13203
13204   ;
13205   return 0;
13206 }
13207 _ACEOF
13208 rm -f conftest.$ac_objext conftest$ac_exeext
13209 if { (eval echo "$as_me:13209: \"$ac_link\"") >&5
13210   (eval $ac_link) 2>&5
13211   ac_status=$?
13212   echo "$as_me:13212: \$? = $ac_status" >&5
13213   (exit $ac_status); } &&
13214          { ac_try='test -s conftest$ac_exeext'
13215   { (eval echo "$as_me:13215: \"$ac_try\"") >&5
13216   (eval $ac_try) 2>&5
13217   ac_status=$?
13218   echo "$as_me:13218: \$? = $ac_status" >&5
13219   (exit $ac_status); }; }; then
13220   ac_cv_func_XOpenDisplay=yes
13221 else
13222   echo "$as_me: failed program was:" >&5
13223 cat conftest.$ac_ext >&5
13224 ac_cv_func_XOpenDisplay=no
13225 fi
13226 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13227 fi
13228 echo "$as_me:13228: result: $ac_cv_func_XOpenDisplay" >&5
13229 echo "${ECHO_T}$ac_cv_func_XOpenDisplay" >&6
13230 if test $ac_cv_func_XOpenDisplay = yes; then
13231   :
13232 else
13233
13234         echo "$as_me:13234: checking for XOpenDisplay in -lX11" >&5
13235 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
13236 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
13237   echo $ECHO_N "(cached) $ECHO_C" >&6
13238 else
13239   ac_check_lib_save_LIBS=$LIBS
13240 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
13241 cat >conftest.$ac_ext <<_ACEOF
13242 #line 13242 "configure"
13243 #include "confdefs.h"
13244
13245 /* Override any gcc2 internal prototype to avoid an error.  */
13246 #ifdef __cplusplus
13247 extern "C"
13248 #endif
13249 /* We use char because int might match the return type of a gcc2
13250    builtin and then its argument prototype would still apply.  */
13251 char XOpenDisplay ();
13252 int
13253 main (void)
13254 {
13255 XOpenDisplay ();
13256   ;
13257   return 0;
13258 }
13259 _ACEOF
13260 rm -f conftest.$ac_objext conftest$ac_exeext
13261 if { (eval echo "$as_me:13261: \"$ac_link\"") >&5
13262   (eval $ac_link) 2>&5
13263   ac_status=$?
13264   echo "$as_me:13264: \$? = $ac_status" >&5
13265   (exit $ac_status); } &&
13266          { ac_try='test -s conftest$ac_exeext'
13267   { (eval echo "$as_me:13267: \"$ac_try\"") >&5
13268   (eval $ac_try) 2>&5
13269   ac_status=$?
13270   echo "$as_me:13270: \$? = $ac_status" >&5
13271   (exit $ac_status); }; }; then
13272   ac_cv_lib_X11_XOpenDisplay=yes
13273 else
13274   echo "$as_me: failed program was:" >&5
13275 cat conftest.$ac_ext >&5
13276 ac_cv_lib_X11_XOpenDisplay=no
13277 fi
13278 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13279 LIBS=$ac_check_lib_save_LIBS
13280 fi
13281 echo "$as_me:13281: result: $ac_cv_lib_X11_XOpenDisplay" >&5
13282 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
13283 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
13284
13285 cf_add_libs="-lX11"
13286 # Filter out duplicates - this happens with badly-designed ".pc" files...
13287 for cf_add_1lib in $LIBS
13288 do
13289         for cf_add_2lib in $cf_add_libs
13290         do
13291                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13292                 then
13293                         cf_add_1lib=
13294                         break
13295                 fi
13296         done
13297         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13298 done
13299 LIBS="$cf_add_libs"
13300
13301 fi
13302
13303 fi
13304
13305         echo "$as_me:13305: checking for XtAppInitialize" >&5
13306 echo $ECHO_N "checking for XtAppInitialize... $ECHO_C" >&6
13307 if test "${ac_cv_func_XtAppInitialize+set}" = set; then
13308   echo $ECHO_N "(cached) $ECHO_C" >&6
13309 else
13310   cat >conftest.$ac_ext <<_ACEOF
13311 #line 13311 "configure"
13312 #include "confdefs.h"
13313 /* System header to define __stub macros and hopefully few prototypes,
13314     which can conflict with char XtAppInitialize (); below.  */
13315 #include <assert.h>
13316 /* Override any gcc2 internal prototype to avoid an error.  */
13317 #ifdef __cplusplus
13318 extern "C"
13319 #endif
13320 /* We use char because int might match the return type of a gcc2
13321    builtin and then its argument prototype would still apply.  */
13322 char XtAppInitialize ();
13323 char (*f) ();
13324
13325 int
13326 main (void)
13327 {
13328 /* The GNU C library defines this for functions which it implements
13329     to always fail with ENOSYS.  Some functions are actually named
13330     something starting with __ and the normal name is an alias.  */
13331 #if defined (__stub_XtAppInitialize) || defined (__stub___XtAppInitialize)
13332 choke me
13333 #else
13334 f = XtAppInitialize; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
13335 #endif
13336
13337   ;
13338   return 0;
13339 }
13340 _ACEOF
13341 rm -f conftest.$ac_objext conftest$ac_exeext
13342 if { (eval echo "$as_me:13342: \"$ac_link\"") >&5
13343   (eval $ac_link) 2>&5
13344   ac_status=$?
13345   echo "$as_me:13345: \$? = $ac_status" >&5
13346   (exit $ac_status); } &&
13347          { ac_try='test -s conftest$ac_exeext'
13348   { (eval echo "$as_me:13348: \"$ac_try\"") >&5
13349   (eval $ac_try) 2>&5
13350   ac_status=$?
13351   echo "$as_me:13351: \$? = $ac_status" >&5
13352   (exit $ac_status); }; }; then
13353   ac_cv_func_XtAppInitialize=yes
13354 else
13355   echo "$as_me: failed program was:" >&5
13356 cat conftest.$ac_ext >&5
13357 ac_cv_func_XtAppInitialize=no
13358 fi
13359 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13360 fi
13361 echo "$as_me:13361: result: $ac_cv_func_XtAppInitialize" >&5
13362 echo "${ECHO_T}$ac_cv_func_XtAppInitialize" >&6
13363 if test $ac_cv_func_XtAppInitialize = yes; then
13364   :
13365 else
13366
13367         echo "$as_me:13367: checking for XtAppInitialize in -lXt" >&5
13368 echo $ECHO_N "checking for XtAppInitialize in -lXt... $ECHO_C" >&6
13369 if test "${ac_cv_lib_Xt_XtAppInitialize+set}" = set; then
13370   echo $ECHO_N "(cached) $ECHO_C" >&6
13371 else
13372   ac_check_lib_save_LIBS=$LIBS
13373 LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
13374 cat >conftest.$ac_ext <<_ACEOF
13375 #line 13375 "configure"
13376 #include "confdefs.h"
13377
13378 /* Override any gcc2 internal prototype to avoid an error.  */
13379 #ifdef __cplusplus
13380 extern "C"
13381 #endif
13382 /* We use char because int might match the return type of a gcc2
13383    builtin and then its argument prototype would still apply.  */
13384 char XtAppInitialize ();
13385 int
13386 main (void)
13387 {
13388 XtAppInitialize ();
13389   ;
13390   return 0;
13391 }
13392 _ACEOF
13393 rm -f conftest.$ac_objext conftest$ac_exeext
13394 if { (eval echo "$as_me:13394: \"$ac_link\"") >&5
13395   (eval $ac_link) 2>&5
13396   ac_status=$?
13397   echo "$as_me:13397: \$? = $ac_status" >&5
13398   (exit $ac_status); } &&
13399          { ac_try='test -s conftest$ac_exeext'
13400   { (eval echo "$as_me:13400: \"$ac_try\"") >&5
13401   (eval $ac_try) 2>&5
13402   ac_status=$?
13403   echo "$as_me:13403: \$? = $ac_status" >&5
13404   (exit $ac_status); }; }; then
13405   ac_cv_lib_Xt_XtAppInitialize=yes
13406 else
13407   echo "$as_me: failed program was:" >&5
13408 cat conftest.$ac_ext >&5
13409 ac_cv_lib_Xt_XtAppInitialize=no
13410 fi
13411 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13412 LIBS=$ac_check_lib_save_LIBS
13413 fi
13414 echo "$as_me:13414: result: $ac_cv_lib_Xt_XtAppInitialize" >&5
13415 echo "${ECHO_T}$ac_cv_lib_Xt_XtAppInitialize" >&6
13416 if test $ac_cv_lib_Xt_XtAppInitialize = yes; then
13417
13418 cat >>confdefs.h <<\EOF
13419 #define HAVE_LIBXT 1
13420 EOF
13421
13422                  cf_have_X_LIBS=Xt
13423                  LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS"
13424 fi
13425
13426 fi
13427
13428 fi
13429
13430 if test $cf_have_X_LIBS = no ; then
13431         { echo "$as_me:13431: WARNING: Unable to successfully link X Toolkit library (-lXt) with
13432 test program.  You will have to check and add the proper libraries by hand
13433 to makefile." >&5
13434 echo "$as_me: WARNING: Unable to successfully link X Toolkit library (-lXt) with
13435 test program.  You will have to check and add the proper libraries by hand
13436 to makefile." >&2;}
13437 fi
13438
13439 cf_x_athena_root=$cf_x_athena
13440 cf_x_athena_inc=""
13441
13442 for cf_path in default \
13443         /usr/contrib/X11R6 \
13444         /usr/contrib/X11R5 \
13445         /usr/lib/X11R5 \
13446         /usr/local
13447 do
13448         if test -z "$cf_x_athena_inc" ; then
13449                 cf_save="$CPPFLAGS"
13450                 cf_test=X11/$cf_x_athena_root/SimpleMenu.h
13451                 if test $cf_path != default ; then
13452                         CPPFLAGS="$cf_save -I$cf_path/include"
13453                         echo "$as_me:13453: checking for $cf_test in $cf_path" >&5
13454 echo $ECHO_N "checking for $cf_test in $cf_path... $ECHO_C" >&6
13455                 else
13456                         echo "$as_me:13456: checking for $cf_test" >&5
13457 echo $ECHO_N "checking for $cf_test... $ECHO_C" >&6
13458                 fi
13459                 cat >conftest.$ac_ext <<_ACEOF
13460 #line 13460 "configure"
13461 #include "confdefs.h"
13462
13463 #include <X11/Intrinsic.h>
13464 #include <$cf_test>
13465 int
13466 main (void)
13467 {
13468
13469   ;
13470   return 0;
13471 }
13472 _ACEOF
13473 rm -f conftest.$ac_objext
13474 if { (eval echo "$as_me:13474: \"$ac_compile\"") >&5
13475   (eval $ac_compile) 2>&5
13476   ac_status=$?
13477   echo "$as_me:13477: \$? = $ac_status" >&5
13478   (exit $ac_status); } &&
13479          { ac_try='test -s conftest.$ac_objext'
13480   { (eval echo "$as_me:13480: \"$ac_try\"") >&5
13481   (eval $ac_try) 2>&5
13482   ac_status=$?
13483   echo "$as_me:13483: \$? = $ac_status" >&5
13484   (exit $ac_status); }; }; then
13485   cf_result=yes
13486 else
13487   echo "$as_me: failed program was:" >&5
13488 cat conftest.$ac_ext >&5
13489 cf_result=no
13490 fi
13491 rm -f conftest.$ac_objext conftest.$ac_ext
13492                 echo "$as_me:13492: result: $cf_result" >&5
13493 echo "${ECHO_T}$cf_result" >&6
13494                 if test "$cf_result" = yes ; then
13495                         cf_x_athena_inc=$cf_path
13496                         break
13497                 else
13498                         CPPFLAGS="$cf_save"
13499                 fi
13500         fi
13501 done
13502
13503 if test -z "$cf_x_athena_inc" ; then
13504         { echo "$as_me:13504: WARNING: Unable to successfully find Athena header files with test program" >&5
13505 echo "$as_me: WARNING: Unable to successfully find Athena header files with test program" >&2;}
13506 elif test "$cf_x_athena_inc" != default ; then
13507         CPPFLAGS="$CPPFLAGS -I$cf_x_athena_inc"
13508 fi
13509
13510 cf_x_athena_root=$cf_x_athena
13511 cf_x_athena_lib=""
13512
13513 for cf_path in default \
13514         /usr/contrib/X11R6 \
13515         /usr/contrib/X11R5 \
13516         /usr/lib/X11R5 \
13517         /usr/local
13518 do
13519         for cf_lib in \
13520                 ${cf_x_athena_root} \
13521                 ${cf_x_athena_root}7 \
13522                 ${cf_x_athena_root}6
13523         do
13524         for cf_libs in \
13525                 "-l$cf_lib -lXmu" \
13526                 "-l$cf_lib -lXpm -lXmu" \
13527                 "-l${cf_lib}_s -lXmu_s"
13528         do
13529                 if test -z "$cf_x_athena_lib" ; then
13530                         cf_save="$LIBS"
13531                         cf_test=XawSimpleMenuAddGlobalActions
13532                         if test $cf_path != default ; then
13533
13534 cf_add_libs="-L$cf_path/lib $cf_libs"
13535 # Filter out duplicates - this happens with badly-designed ".pc" files...
13536 for cf_add_1lib in $LIBS
13537 do
13538         for cf_add_2lib in $cf_add_libs
13539         do
13540                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13541                 then
13542                         cf_add_1lib=
13543                         break
13544                 fi
13545         done
13546         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13547 done
13548 LIBS="$cf_add_libs"
13549
13550                                 echo "$as_me:13550: checking for $cf_libs in $cf_path" >&5
13551 echo $ECHO_N "checking for $cf_libs in $cf_path... $ECHO_C" >&6
13552                         else
13553
13554 cf_add_libs="$cf_libs"
13555 # Filter out duplicates - this happens with badly-designed ".pc" files...
13556 for cf_add_1lib in $LIBS
13557 do
13558         for cf_add_2lib in $cf_add_libs
13559         do
13560                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13561                 then
13562                         cf_add_1lib=
13563                         break
13564                 fi
13565         done
13566         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13567 done
13568 LIBS="$cf_add_libs"
13569
13570                                 echo "$as_me:13570: checking for $cf_test in $cf_libs" >&5
13571 echo $ECHO_N "checking for $cf_test in $cf_libs... $ECHO_C" >&6
13572                         fi
13573                         cat >conftest.$ac_ext <<_ACEOF
13574 #line 13574 "configure"
13575 #include "confdefs.h"
13576
13577 #include <X11/Intrinsic.h>
13578 #include <X11/$cf_x_athena_root/SimpleMenu.h>
13579
13580 int
13581 main (void)
13582 {
13583
13584 $cf_test((XtAppContext) 0)
13585   ;
13586   return 0;
13587 }
13588 _ACEOF
13589 rm -f conftest.$ac_objext conftest$ac_exeext
13590 if { (eval echo "$as_me:13590: \"$ac_link\"") >&5
13591   (eval $ac_link) 2>&5
13592   ac_status=$?
13593   echo "$as_me:13593: \$? = $ac_status" >&5
13594   (exit $ac_status); } &&
13595          { ac_try='test -s conftest$ac_exeext'
13596   { (eval echo "$as_me:13596: \"$ac_try\"") >&5
13597   (eval $ac_try) 2>&5
13598   ac_status=$?
13599   echo "$as_me:13599: \$? = $ac_status" >&5
13600   (exit $ac_status); }; }; then
13601   cf_result=yes
13602 else
13603   echo "$as_me: failed program was:" >&5
13604 cat conftest.$ac_ext >&5
13605 cf_result=no
13606 fi
13607 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13608                         echo "$as_me:13608: result: $cf_result" >&5
13609 echo "${ECHO_T}$cf_result" >&6
13610                         if test "$cf_result" = yes ; then
13611                                 cf_x_athena_lib="$cf_libs"
13612                                 break
13613                         fi
13614                         LIBS="$cf_save"
13615                 fi
13616         done # cf_libs
13617                 test -n "$cf_x_athena_lib" && break
13618         done # cf_lib
13619 done
13620
13621 if test -z "$cf_x_athena_lib" ; then
13622         { { echo "$as_me:13622: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&5
13623 echo "$as_me: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&2;}
13624    { (exit 1); exit 1; }; }
13625 fi
13626
13627 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
13628
13629 cat >>confdefs.h <<EOF
13630 #define $cf_x_athena_LIBS 1
13631 EOF
13632
13633 fi
13634
13635 if test -n "$ac_tool_prefix"; then
13636   for ac_prog in xcurses-config
13637   do
13638     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
13639 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
13640 echo "$as_me:13640: checking for $ac_word" >&5
13641 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
13642 if test "${ac_cv_prog_XCURSES_CONFIG+set}" = set; then
13643   echo $ECHO_N "(cached) $ECHO_C" >&6
13644 else
13645   if test -n "$XCURSES_CONFIG"; then
13646   ac_cv_prog_XCURSES_CONFIG="$XCURSES_CONFIG" # Let the user override the test.
13647 else
13648   ac_save_IFS=$IFS; IFS=$ac_path_separator
13649 ac_dummy="$PATH"
13650 for ac_dir in $ac_dummy; do
13651   IFS=$ac_save_IFS
13652   test -z "$ac_dir" && ac_dir=.
13653   $as_executable_p "$ac_dir/$ac_word" || continue
13654 ac_cv_prog_XCURSES_CONFIG="$ac_tool_prefix$ac_prog"
13655 echo "$as_me:13655: found $ac_dir/$ac_word" >&5
13656 break
13657 done
13658
13659 fi
13660 fi
13661 XCURSES_CONFIG=$ac_cv_prog_XCURSES_CONFIG
13662 if test -n "$XCURSES_CONFIG"; then
13663   echo "$as_me:13663: result: $XCURSES_CONFIG" >&5
13664 echo "${ECHO_T}$XCURSES_CONFIG" >&6
13665 else
13666   echo "$as_me:13666: result: no" >&5
13667 echo "${ECHO_T}no" >&6
13668 fi
13669
13670     test -n "$XCURSES_CONFIG" && break
13671   done
13672 fi
13673 if test -z "$XCURSES_CONFIG"; then
13674   ac_ct_XCURSES_CONFIG=$XCURSES_CONFIG
13675   for ac_prog in xcurses-config
13676 do
13677   # Extract the first word of "$ac_prog", so it can be a program name with args.
13678 set dummy $ac_prog; ac_word=$2
13679 echo "$as_me:13679: checking for $ac_word" >&5
13680 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
13681 if test "${ac_cv_prog_ac_ct_XCURSES_CONFIG+set}" = set; then
13682   echo $ECHO_N "(cached) $ECHO_C" >&6
13683 else
13684   if test -n "$ac_ct_XCURSES_CONFIG"; then
13685   ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_ct_XCURSES_CONFIG" # Let the user override the test.
13686 else
13687   ac_save_IFS=$IFS; IFS=$ac_path_separator
13688 ac_dummy="$PATH"
13689 for ac_dir in $ac_dummy; do
13690   IFS=$ac_save_IFS
13691   test -z "$ac_dir" && ac_dir=.
13692   $as_executable_p "$ac_dir/$ac_word" || continue
13693 ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_prog"
13694 echo "$as_me:13694: found $ac_dir/$ac_word" >&5
13695 break
13696 done
13697
13698 fi
13699 fi
13700 ac_ct_XCURSES_CONFIG=$ac_cv_prog_ac_ct_XCURSES_CONFIG
13701 if test -n "$ac_ct_XCURSES_CONFIG"; then
13702   echo "$as_me:13702: result: $ac_ct_XCURSES_CONFIG" >&5
13703 echo "${ECHO_T}$ac_ct_XCURSES_CONFIG" >&6
13704 else
13705   echo "$as_me:13705: result: no" >&5
13706 echo "${ECHO_T}no" >&6
13707 fi
13708
13709   test -n "$ac_ct_XCURSES_CONFIG" && break
13710 done
13711 test -n "$ac_ct_XCURSES_CONFIG" || ac_ct_XCURSES_CONFIG="none"
13712
13713   XCURSES_CONFIG=$ac_ct_XCURSES_CONFIG
13714 fi
13715
13716 if test "$XCURSES_CONFIG" != none ; then
13717
13718 CPPFLAGS="$CPPFLAGS `$XCURSES_CONFIG --cflags`"
13719
13720 cf_add_libs="`$XCURSES_CONFIG --libs`"
13721 # Filter out duplicates - this happens with badly-designed ".pc" files...
13722 for cf_add_1lib in $LIBS
13723 do
13724         for cf_add_2lib in $cf_add_libs
13725         do
13726                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13727                 then
13728                         cf_add_1lib=
13729                         break
13730                 fi
13731         done
13732         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13733 done
13734 LIBS="$cf_add_libs"
13735
13736 cf_cv_lib_XCurses=yes
13737
13738 else
13739
13740 LDFLAGS="$LDFLAGS $X_LIBS"
13741
13742 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
13743
13744 echo "${as_me:-configure}:13744: testing checking additions to CFLAGS ..." 1>&5
13745
13746 cf_check_cflags="$CFLAGS"
13747 cf_check_cppflags="$CPPFLAGS"
13748
13749 cf_fix_cppflags=no
13750 cf_new_cflags=
13751 cf_new_cppflags=
13752 cf_new_extra_cppflags=
13753
13754 for cf_add_cflags in $X_CFLAGS
13755 do
13756 case $cf_fix_cppflags in
13757 (no)
13758         case $cf_add_cflags in
13759         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13760                 case $cf_add_cflags in
13761                 (-D*)
13762                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13763
13764                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13765                                 && test -z "${cf_tst_cflags}" \
13766                                 && cf_fix_cppflags=yes
13767
13768                         if test $cf_fix_cppflags = yes ; then
13769
13770         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13771         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13772
13773                                 continue
13774                         elif test "${cf_tst_cflags}" = "\"'" ; then
13775
13776         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13777         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13778
13779                                 continue
13780                         fi
13781                         ;;
13782                 esac
13783                 case "$CPPFLAGS" in
13784                 (*$cf_add_cflags)
13785                         ;;
13786                 (*)
13787                         case $cf_add_cflags in
13788                         (-D*)
13789                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13790
13791 CPPFLAGS=`echo "$CPPFLAGS" | \
13792         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13793                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13794
13795                                 ;;
13796                         esac
13797
13798         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13799         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13800
13801                         ;;
13802                 esac
13803                 ;;
13804         (*)
13805
13806         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13807         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13808
13809                 ;;
13810         esac
13811         ;;
13812 (yes)
13813
13814         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13815         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13816
13817         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13818
13819         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13820                 && test -z "${cf_tst_cflags}" \
13821                 && cf_fix_cppflags=no
13822         ;;
13823 esac
13824 done
13825
13826 if test -n "$cf_new_cflags" ; then
13827         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
13828
13829 echo "${as_me:-configure}:13829: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
13830
13831         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13832         CFLAGS="${CFLAGS}$cf_new_cflags"
13833
13834 fi
13835
13836 if test -n "$cf_new_cppflags" ; then
13837         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
13838
13839 echo "${as_me:-configure}:13839: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
13840
13841         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13842         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13843
13844 fi
13845
13846 if test -n "$cf_new_extra_cppflags" ; then
13847         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
13848
13849 echo "${as_me:-configure}:13849: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
13850
13851         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13852         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13853
13854 fi
13855
13856 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
13857 cat >conftest.$ac_ext <<_ACEOF
13858 #line 13858 "configure"
13859 #include "confdefs.h"
13860 #include <stdio.h>
13861 int
13862 main (void)
13863 {
13864 printf("Hello world");
13865   ;
13866   return 0;
13867 }
13868 _ACEOF
13869 rm -f conftest.$ac_objext conftest$ac_exeext
13870 if { (eval echo "$as_me:13870: \"$ac_link\"") >&5
13871   (eval $ac_link) 2>&5
13872   ac_status=$?
13873   echo "$as_me:13873: \$? = $ac_status" >&5
13874   (exit $ac_status); } &&
13875          { ac_try='test -s conftest$ac_exeext'
13876   { (eval echo "$as_me:13876: \"$ac_try\"") >&5
13877   (eval $ac_try) 2>&5
13878   ac_status=$?
13879   echo "$as_me:13879: \$? = $ac_status" >&5
13880   (exit $ac_status); }; }; then
13881   :
13882 else
13883   echo "$as_me: failed program was:" >&5
13884 cat conftest.$ac_ext >&5
13885 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
13886
13887 echo "${as_me:-configure}:13887: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
13888
13889          if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
13890                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
13891
13892 echo "${as_me:-configure}:13892: testing but keeping change to \$CPPFLAGS ..." 1>&5
13893
13894          fi
13895          CFLAGS="$cf_check_flags"
13896 fi
13897 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13898 fi
13899
13900 echo "$as_me:13900: checking for XOpenDisplay in -lX11" >&5
13901 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
13902 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
13903   echo $ECHO_N "(cached) $ECHO_C" >&6
13904 else
13905   ac_check_lib_save_LIBS=$LIBS
13906 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
13907 cat >conftest.$ac_ext <<_ACEOF
13908 #line 13908 "configure"
13909 #include "confdefs.h"
13910
13911 /* Override any gcc2 internal prototype to avoid an error.  */
13912 #ifdef __cplusplus
13913 extern "C"
13914 #endif
13915 /* We use char because int might match the return type of a gcc2
13916    builtin and then its argument prototype would still apply.  */
13917 char XOpenDisplay ();
13918 int
13919 main (void)
13920 {
13921 XOpenDisplay ();
13922   ;
13923   return 0;
13924 }
13925 _ACEOF
13926 rm -f conftest.$ac_objext conftest$ac_exeext
13927 if { (eval echo "$as_me:13927: \"$ac_link\"") >&5
13928   (eval $ac_link) 2>&5
13929   ac_status=$?
13930   echo "$as_me:13930: \$? = $ac_status" >&5
13931   (exit $ac_status); } &&
13932          { ac_try='test -s conftest$ac_exeext'
13933   { (eval echo "$as_me:13933: \"$ac_try\"") >&5
13934   (eval $ac_try) 2>&5
13935   ac_status=$?
13936   echo "$as_me:13936: \$? = $ac_status" >&5
13937   (exit $ac_status); }; }; then
13938   ac_cv_lib_X11_XOpenDisplay=yes
13939 else
13940   echo "$as_me: failed program was:" >&5
13941 cat conftest.$ac_ext >&5
13942 ac_cv_lib_X11_XOpenDisplay=no
13943 fi
13944 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13945 LIBS=$ac_check_lib_save_LIBS
13946 fi
13947 echo "$as_me:13947: result: $ac_cv_lib_X11_XOpenDisplay" >&5
13948 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
13949 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
13950
13951 cf_add_libs="-lX11"
13952 # Filter out duplicates - this happens with badly-designed ".pc" files...
13953 for cf_add_1lib in $LIBS
13954 do
13955         for cf_add_2lib in $cf_add_libs
13956         do
13957                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13958                 then
13959                         cf_add_1lib=
13960                         break
13961                 fi
13962         done
13963         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13964 done
13965 LIBS="$cf_add_libs"
13966
13967 fi
13968
13969 echo "$as_me:13969: checking for XCurses library" >&5
13970 echo $ECHO_N "checking for XCurses library... $ECHO_C" >&6
13971 if test "${cf_cv_lib_XCurses+set}" = set; then
13972   echo $ECHO_N "(cached) $ECHO_C" >&6
13973 else
13974
13975 cf_add_libs="-lXCurses"
13976 # Filter out duplicates - this happens with badly-designed ".pc" files...
13977 for cf_add_1lib in $LIBS
13978 do
13979         for cf_add_2lib in $cf_add_libs
13980         do
13981                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13982                 then
13983                         cf_add_1lib=
13984                         break
13985                 fi
13986         done
13987         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13988 done
13989 LIBS="$cf_add_libs"
13990
13991 cat >conftest.$ac_ext <<_ACEOF
13992 #line 13992 "configure"
13993 #include "confdefs.h"
13994
13995 #include <xcurses.h>
13996 char *XCursesProgramName = "test";
13997
13998 int
13999 main (void)
14000 {
14001 XCursesExit();
14002   ;
14003   return 0;
14004 }
14005 _ACEOF
14006 rm -f conftest.$ac_objext conftest$ac_exeext
14007 if { (eval echo "$as_me:14007: \"$ac_link\"") >&5
14008   (eval $ac_link) 2>&5
14009   ac_status=$?
14010   echo "$as_me:14010: \$? = $ac_status" >&5
14011   (exit $ac_status); } &&
14012          { ac_try='test -s conftest$ac_exeext'
14013   { (eval echo "$as_me:14013: \"$ac_try\"") >&5
14014   (eval $ac_try) 2>&5
14015   ac_status=$?
14016   echo "$as_me:14016: \$? = $ac_status" >&5
14017   (exit $ac_status); }; }; then
14018   cf_cv_lib_XCurses=yes
14019 else
14020   echo "$as_me: failed program was:" >&5
14021 cat conftest.$ac_ext >&5
14022 cf_cv_lib_XCurses=no
14023 fi
14024 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14025
14026 fi
14027 echo "$as_me:14027: result: $cf_cv_lib_XCurses" >&5
14028 echo "${ECHO_T}$cf_cv_lib_XCurses" >&6
14029
14030 fi
14031
14032 if test $cf_cv_lib_XCurses = yes ; then
14033
14034 cat >>confdefs.h <<\EOF
14035 #define UNIX 1
14036 EOF
14037
14038 cat >>confdefs.h <<\EOF
14039 #define XCURSES 1
14040 EOF
14041
14042         echo "$as_me:14042: checking for xcurses.h" >&5
14043 echo $ECHO_N "checking for xcurses.h... $ECHO_C" >&6
14044 if test "${ac_cv_header_xcurses_h+set}" = set; then
14045   echo $ECHO_N "(cached) $ECHO_C" >&6
14046 else
14047   cat >conftest.$ac_ext <<_ACEOF
14048 #line 14048 "configure"
14049 #include "confdefs.h"
14050 #include <xcurses.h>
14051 _ACEOF
14052 if { (eval echo "$as_me:14052: \"$ac_cpp conftest.$ac_ext\"") >&5
14053   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
14054   ac_status=$?
14055   egrep -v '^ *\+' conftest.er1 >conftest.err
14056   rm -f conftest.er1
14057   cat conftest.err >&5
14058   echo "$as_me:14058: \$? = $ac_status" >&5
14059   (exit $ac_status); } >/dev/null; then
14060   if test -s conftest.err; then
14061     ac_cpp_err=$ac_c_preproc_warn_flag
14062   else
14063     ac_cpp_err=
14064   fi
14065 else
14066   ac_cpp_err=yes
14067 fi
14068 if test -z "$ac_cpp_err"; then
14069   ac_cv_header_xcurses_h=yes
14070 else
14071   echo "$as_me: failed program was:" >&5
14072   cat conftest.$ac_ext >&5
14073   ac_cv_header_xcurses_h=no
14074 fi
14075 rm -f conftest.err conftest.$ac_ext
14076 fi
14077 echo "$as_me:14077: result: $ac_cv_header_xcurses_h" >&5
14078 echo "${ECHO_T}$ac_cv_header_xcurses_h" >&6
14079 if test $ac_cv_header_xcurses_h = yes; then
14080
14081 cat >>confdefs.h <<\EOF
14082 #define HAVE_XCURSES 1
14083 EOF
14084
14085 fi
14086
14087 else
14088         { { echo "$as_me:14088: error: Cannot link with XCurses" >&5
14089 echo "$as_me: error: Cannot link with XCurses" >&2;}
14090    { (exit 1); exit 1; }; }
14091 fi
14092
14093         ;;
14094 (*)
14095         { { echo "$as_me:14095: error: unexpected screen-value: $cf_cv_screen" >&5
14096 echo "$as_me: error: unexpected screen-value: $cf_cv_screen" >&2;}
14097    { (exit 1); exit 1; }; }
14098         ;;
14099 esac
14100
14101 : ${cf_nculib_root:=$cf_cv_screen}
14102 as_ac_Lib=`echo "ac_cv_lib_$cf_nculib_root''__nc_init_pthreads" | $as_tr_sh`
14103 echo "$as_me:14103: checking for _nc_init_pthreads in -l$cf_nculib_root" >&5
14104 echo $ECHO_N "checking for _nc_init_pthreads in -l$cf_nculib_root... $ECHO_C" >&6
14105 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
14106   echo $ECHO_N "(cached) $ECHO_C" >&6
14107 else
14108   ac_check_lib_save_LIBS=$LIBS
14109 LIBS="-l$cf_nculib_root  $LIBS"
14110 cat >conftest.$ac_ext <<_ACEOF
14111 #line 14111 "configure"
14112 #include "confdefs.h"
14113
14114 /* Override any gcc2 internal prototype to avoid an error.  */
14115 #ifdef __cplusplus
14116 extern "C"
14117 #endif
14118 /* We use char because int might match the return type of a gcc2
14119    builtin and then its argument prototype would still apply.  */
14120 char _nc_init_pthreads ();
14121 int
14122 main (void)
14123 {
14124 _nc_init_pthreads ();
14125   ;
14126   return 0;
14127 }
14128 _ACEOF
14129 rm -f conftest.$ac_objext conftest$ac_exeext
14130 if { (eval echo "$as_me:14130: \"$ac_link\"") >&5
14131   (eval $ac_link) 2>&5
14132   ac_status=$?
14133   echo "$as_me:14133: \$? = $ac_status" >&5
14134   (exit $ac_status); } &&
14135          { ac_try='test -s conftest$ac_exeext'
14136   { (eval echo "$as_me:14136: \"$ac_try\"") >&5
14137   (eval $ac_try) 2>&5
14138   ac_status=$?
14139   echo "$as_me:14139: \$? = $ac_status" >&5
14140   (exit $ac_status); }; }; then
14141   eval "$as_ac_Lib=yes"
14142 else
14143   echo "$as_me: failed program was:" >&5
14144 cat conftest.$ac_ext >&5
14145 eval "$as_ac_Lib=no"
14146 fi
14147 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14148 LIBS=$ac_check_lib_save_LIBS
14149 fi
14150 echo "$as_me:14150: result: `eval echo '${'$as_ac_Lib'}'`" >&5
14151 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
14152 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
14153   cf_cv_ncurses_pthreads=yes
14154 else
14155   cf_cv_ncurses_pthreads=no
14156 fi
14157
14158 if test "$cf_cv_ncurses_pthreads" = yes
14159 then
14160
14161 cf_add_libs="-lpthread"
14162 # Filter out duplicates - this happens with badly-designed ".pc" files...
14163 for cf_add_1lib in $LIBS
14164 do
14165         for cf_add_2lib in $cf_add_libs
14166         do
14167                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
14168                 then
14169                         cf_add_1lib=
14170                         break
14171                 fi
14172         done
14173         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
14174 done
14175 LIBS="$cf_add_libs"
14176
14177 fi
14178
14179 case $cf_cv_screen in
14180 (ncurses*)
14181         cf_cv_libtype=`echo "$cf_cv_screen" | sed -e 's/^ncurses//'`
14182         ;;
14183 esac
14184
14185 echo "$as_me:14185: checking for X11 rgb file" >&5
14186 echo $ECHO_N "checking for X11 rgb file... $ECHO_C" >&6
14187
14188 # Check whether --with-x11-rgb or --without-x11-rgb was given.
14189 if test "${with_x11_rgb+set}" = set; then
14190   withval="$with_x11_rgb"
14191   RGB_PATH=$withval
14192 else
14193   RGB_PATH=auto
14194 fi;
14195
14196 if test "x$RGB_PATH" = xauto
14197 then
14198         RGB_PATH='${exec_prefix}/lib/X11/rgb.txt'
14199         for cf_path in \
14200                 /opt/local/share/X11/rgb.txt \
14201                 /opt/X11/share/X11/rgb.txt \
14202                 /usr/share/X11/rgb.txt \
14203                 /usr/X11/share/X11/rgb.txt \
14204                 /usr/X11/lib/X11/rgb.txt \
14205                 /usr/lib/X11/rgb.txt \
14206                 /etc/X11/rgb.txt \
14207                 /usr/pkg/lib/X11/rgb.txt \
14208                 /usr/X11R7/lib/X11/rgb.txt \
14209                 /usr/X11R6/lib/X11/rgb.txt \
14210                 /usr/X11R5/lib/X11/rgb.txt \
14211                 /usr/X11R4/lib/X11/rgb.txt \
14212                 /usr/local/lib/X11/rgb.txt \
14213                 /usr/local/share/X11/rgb.txt \
14214                 /usr/lib64/X11/rgb.txt
14215         do
14216                 if test -f "$cf_path" ; then
14217                         RGB_PATH="$cf_path"
14218                         break
14219                 fi
14220         done
14221 else
14222         cf_path=$RGB_PATH
14223
14224 if test "x$prefix" != xNONE; then
14225         cf_path_syntax="$prefix"
14226 else
14227         cf_path_syntax="$ac_default_prefix"
14228 fi
14229
14230 case ".$cf_path" in
14231 (.\$\(*\)*|.\'*\'*)
14232         ;;
14233 (..|./*|.\\*)
14234         ;;
14235 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
14236         ;;
14237 (.\${*prefix}*|.\${*dir}*)
14238         eval cf_path="$cf_path"
14239         case ".$cf_path" in
14240         (.NONE/*)
14241                 cf_path=`echo $cf_path | sed -e s%NONE%$cf_path_syntax%`
14242                 ;;
14243         esac
14244         ;;
14245 (.no|.NONE/*)
14246         cf_path=`echo $cf_path | sed -e s%NONE%$cf_path_syntax%`
14247         ;;
14248 (*)
14249         { { echo "$as_me:14249: error: expected a pathname, not \"$cf_path\"" >&5
14250 echo "$as_me: error: expected a pathname, not \"$cf_path\"" >&2;}
14251    { (exit 1); exit 1; }; }
14252         ;;
14253 esac
14254
14255 fi
14256
14257 echo "$as_me:14257: result: $RGB_PATH" >&5
14258 echo "${ECHO_T}$RGB_PATH" >&6
14259
14260 cat >>confdefs.h <<EOF
14261 #define RGB_PATH "$cf_path"
14262 EOF
14263
14264 no_x11_rgb=
14265 if test "$RGB_PATH" = no
14266 then
14267         no_x11_rgb="#"
14268 fi
14269
14270 cf_curses_headers=
14271
14272 case $cf_cv_screen in
14273 (pdcurses)
14274         cf_default_panel=no
14275         cf_default_form=no
14276         cf_default_menu=no
14277         cf_default_tinfo=no
14278         ;;
14279 (xcurses|bsdcurses)
14280         cf_default_panel=no
14281         cf_default_form=no
14282         cf_default_menu=no
14283         cf_default_tinfo=yes
14284         ;;
14285 (*)
14286         cf_default_panel=yes
14287         cf_default_form=yes
14288         cf_default_menu=yes
14289         cf_default_tinfo=yes
14290         case $cf_cv_screen in
14291         (ncurses*)
14292                 cf_curses_headers="nc_alloc.h nomacros.h term_entry.h"
14293                 ;;
14294         esac
14295         ;;
14296 esac
14297
14298 echo "$as_me:14298: checking if you want to check for panel functions" >&5
14299 echo $ECHO_N "checking if you want to check for panel functions... $ECHO_C" >&6
14300
14301 # Check whether --enable-panel or --disable-panel was given.
14302 if test "${enable_panel+set}" = set; then
14303   enableval="$enable_panel"
14304   test "$enableval" != no && enableval=yes
14305         if test "$enableval" != "yes" ; then
14306     cf_enable_panel=no
14307         else
14308                 cf_enable_panel=$cf_default_panel
14309         fi
14310 else
14311   enableval=yes
14312         cf_enable_panel=$cf_default_panel
14313
14314 fi;
14315 echo "$as_me:14315: result: $cf_enable_panel" >&5
14316 echo "${ECHO_T}$cf_enable_panel" >&6
14317 if test $cf_enable_panel = yes
14318 then
14319
14320 cf_have_curses_lib=no
14321
14322 : ${NCURSES_CONFIG_PKG:=none}
14323 if test "x${NCURSES_CONFIG_PKG}" = xnone; then
14324         :
14325 elif test "x${PKG_CONFIG:=none}" != xnone; then
14326         echo "$as_me:14326: checking pkg-config for panel$cf_cv_libtype" >&5
14327 echo $ECHO_N "checking pkg-config for panel$cf_cv_libtype... $ECHO_C" >&6
14328         if "$PKG_CONFIG" --exists panel$cf_cv_libtype ; then
14329                 echo "$as_me:14329: result: yes" >&5
14330 echo "${ECHO_T}yes" >&6
14331
14332                 echo "$as_me:14332: checking if the panel$cf_cv_libtype package files work" >&5
14333 echo $ECHO_N "checking if the panel$cf_cv_libtype package files work... $ECHO_C" >&6
14334
14335                 cf_save_CPPFLAGS="$CPPFLAGS"
14336                 cf_save_LIBS="$LIBS"
14337
14338 cf_fix_cppflags=no
14339 cf_new_cflags=
14340 cf_new_cppflags=
14341 cf_new_extra_cppflags=
14342
14343 for cf_add_cflags in `$PKG_CONFIG --cflags panel$cf_cv_libtype`
14344 do
14345 case $cf_fix_cppflags in
14346 (no)
14347         case $cf_add_cflags in
14348         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14349                 case $cf_add_cflags in
14350                 (-D*)
14351                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14352
14353                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14354                                 && test -z "${cf_tst_cflags}" \
14355                                 && cf_fix_cppflags=yes
14356
14357                         if test $cf_fix_cppflags = yes ; then
14358
14359         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14360         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14361
14362                                 continue
14363                         elif test "${cf_tst_cflags}" = "\"'" ; then
14364
14365         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14366         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14367
14368                                 continue
14369                         fi
14370                         ;;
14371                 esac
14372                 case "$CPPFLAGS" in
14373                 (*$cf_add_cflags)
14374                         ;;
14375                 (*)
14376                         case $cf_add_cflags in
14377                         (-D*)
14378                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14379
14380 CPPFLAGS=`echo "$CPPFLAGS" | \
14381         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14382                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14383
14384                                 ;;
14385                         esac
14386
14387         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14388         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14389
14390                         ;;
14391                 esac
14392                 ;;
14393         (*)
14394
14395         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14396         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14397
14398                 ;;
14399         esac
14400         ;;
14401 (yes)
14402
14403         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14404         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14405
14406         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
14407
14408         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14409                 && test -z "${cf_tst_cflags}" \
14410                 && cf_fix_cppflags=no
14411         ;;
14412 esac
14413 done
14414
14415 if test -n "$cf_new_cflags" ; then
14416
14417         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14418         CFLAGS="${CFLAGS}$cf_new_cflags"
14419
14420 fi
14421
14422 if test -n "$cf_new_cppflags" ; then
14423
14424         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14425         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14426
14427 fi
14428
14429 if test -n "$cf_new_extra_cppflags" ; then
14430
14431         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14432         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14433
14434 fi
14435
14436 cf_add_libs="`$PKG_CONFIG --libs panel$cf_cv_libtype`"
14437 # Filter out duplicates - this happens with badly-designed ".pc" files...
14438 for cf_add_1lib in $LIBS
14439 do
14440         for cf_add_2lib in $cf_add_libs
14441         do
14442                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
14443                 then
14444                         cf_add_1lib=
14445                         break
14446                 fi
14447         done
14448         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
14449 done
14450 LIBS="$cf_add_libs"
14451
14452                 cat >conftest.$ac_ext <<_ACEOF
14453 #line 14453 "configure"
14454 #include "confdefs.h"
14455 #include <panel.h>
14456 int
14457 main (void)
14458 {
14459 (void) new_panel ( 0 );
14460   ;
14461   return 0;
14462 }
14463 _ACEOF
14464 rm -f conftest.$ac_objext conftest$ac_exeext
14465 if { (eval echo "$as_me:14465: \"$ac_link\"") >&5
14466   (eval $ac_link) 2>&5
14467   ac_status=$?
14468   echo "$as_me:14468: \$? = $ac_status" >&5
14469   (exit $ac_status); } &&
14470          { ac_try='test -s conftest$ac_exeext'
14471   { (eval echo "$as_me:14471: \"$ac_try\"") >&5
14472   (eval $ac_try) 2>&5
14473   ac_status=$?
14474   echo "$as_me:14474: \$? = $ac_status" >&5
14475   (exit $ac_status); }; }; then
14476   if test "$cross_compiling" = yes; then
14477   cf_have_curses_lib=maybe
14478 else
14479   cat >conftest.$ac_ext <<_ACEOF
14480 #line 14480 "configure"
14481 #include "confdefs.h"
14482 #include <panel.h>
14483                                 int main(void)
14484                                 { (void) new_panel ( 0 ); return 0; }
14485 _ACEOF
14486 rm -f conftest$ac_exeext
14487 if { (eval echo "$as_me:14487: \"$ac_link\"") >&5
14488   (eval $ac_link) 2>&5
14489   ac_status=$?
14490   echo "$as_me:14490: \$? = $ac_status" >&5
14491   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
14492   { (eval echo "$as_me:14492: \"$ac_try\"") >&5
14493   (eval $ac_try) 2>&5
14494   ac_status=$?
14495   echo "$as_me:14495: \$? = $ac_status" >&5
14496   (exit $ac_status); }; }; then
14497   cf_have_curses_lib=yes
14498 else
14499   echo "$as_me: program exited with status $ac_status" >&5
14500 echo "$as_me: failed program was:" >&5
14501 cat conftest.$ac_ext >&5
14502 cf_have_curses_lib=no
14503 fi
14504 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
14505 fi
14506 else
14507   echo "$as_me: failed program was:" >&5
14508 cat conftest.$ac_ext >&5
14509 cf_have_curses_lib=no
14510 fi
14511 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14512                 echo "$as_me:14512: result: $cf_have_curses_lib" >&5
14513 echo "${ECHO_T}$cf_have_curses_lib" >&6
14514                 test "$cf_have_curses_lib" = maybe && cf_have_curses_lib=yes
14515                 if test "$cf_have_curses_lib" != "yes"
14516                 then
14517                         CPPFLAGS="$cf_save_CPPFLAGS"
14518                         LIBS="$cf_save_LIBS"
14519                 else
14520
14521 cf_upper=`echo "have_libpanel" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14522
14523                         cat >>confdefs.h <<EOF
14524 #define $cf_upper 1
14525 EOF
14526
14527                 fi
14528         fi
14529 fi
14530 if test "$cf_have_curses_lib" = no; then
14531         as_ac_Lib=`echo "ac_cv_lib_panel$cf_cv_libtype''_new_panel" | $as_tr_sh`
14532 echo "$as_me:14532: checking for new_panel in -lpanel$cf_cv_libtype" >&5
14533 echo $ECHO_N "checking for new_panel in -lpanel$cf_cv_libtype... $ECHO_C" >&6
14534 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
14535   echo $ECHO_N "(cached) $ECHO_C" >&6
14536 else
14537   ac_check_lib_save_LIBS=$LIBS
14538 LIBS="-lpanel$cf_cv_libtype  $LIBS"
14539 cat >conftest.$ac_ext <<_ACEOF
14540 #line 14540 "configure"
14541 #include "confdefs.h"
14542
14543 /* Override any gcc2 internal prototype to avoid an error.  */
14544 #ifdef __cplusplus
14545 extern "C"
14546 #endif
14547 /* We use char because int might match the return type of a gcc2
14548    builtin and then its argument prototype would still apply.  */
14549 char new_panel ();
14550 int
14551 main (void)
14552 {
14553 new_panel ();
14554   ;
14555   return 0;
14556 }
14557 _ACEOF
14558 rm -f conftest.$ac_objext conftest$ac_exeext
14559 if { (eval echo "$as_me:14559: \"$ac_link\"") >&5
14560   (eval $ac_link) 2>&5
14561   ac_status=$?
14562   echo "$as_me:14562: \$? = $ac_status" >&5
14563   (exit $ac_status); } &&
14564          { ac_try='test -s conftest$ac_exeext'
14565   { (eval echo "$as_me:14565: \"$ac_try\"") >&5
14566   (eval $ac_try) 2>&5
14567   ac_status=$?
14568   echo "$as_me:14568: \$? = $ac_status" >&5
14569   (exit $ac_status); }; }; then
14570   eval "$as_ac_Lib=yes"
14571 else
14572   echo "$as_me: failed program was:" >&5
14573 cat conftest.$ac_ext >&5
14574 eval "$as_ac_Lib=no"
14575 fi
14576 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14577 LIBS=$ac_check_lib_save_LIBS
14578 fi
14579 echo "$as_me:14579: result: `eval echo '${'$as_ac_Lib'}'`" >&5
14580 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
14581 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
14582
14583 cf_upper=`echo "have_libpanel" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14584
14585 cf_add_libs="-lpanel$cf_cv_libtype"
14586 # Filter out duplicates - this happens with badly-designed ".pc" files...
14587 for cf_add_1lib in $LIBS
14588 do
14589         for cf_add_2lib in $cf_add_libs
14590         do
14591                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
14592                 then
14593                         cf_add_1lib=
14594                         break
14595                 fi
14596         done
14597         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
14598 done
14599 LIBS="$cf_add_libs"
14600
14601                 cat >>confdefs.h <<EOF
14602 #define $cf_upper 1
14603 EOF
14604
14605 fi
14606
14607 fi
14608
14609         cf_curses_headers="$cf_curses_headers panel.h"
14610 fi
14611
14612 echo "$as_me:14612: checking if you want to check for menu functions" >&5
14613 echo $ECHO_N "checking if you want to check for menu functions... $ECHO_C" >&6
14614
14615 # Check whether --enable-menu or --disable-menu was given.
14616 if test "${enable_menu+set}" = set; then
14617   enableval="$enable_menu"
14618   test "$enableval" != no && enableval=yes
14619         if test "$enableval" != "yes" ; then
14620     cf_enable_menu=no
14621         else
14622                 cf_enable_menu=$cf_default_menu
14623         fi
14624 else
14625   enableval=yes
14626         cf_enable_menu=$cf_default_menu
14627
14628 fi;
14629 echo "$as_me:14629: result: $cf_enable_menu" >&5
14630 echo "${ECHO_T}$cf_enable_menu" >&6
14631 if test $cf_enable_menu = yes
14632 then
14633         case $cf_cv_screen in
14634         (ncurses*)
14635                 ;;
14636         (curses*)
14637
14638 echo "$as_me:14638: checking for NetBSD menu.h" >&5
14639 echo $ECHO_N "checking for NetBSD menu.h... $ECHO_C" >&6
14640 if test "${cf_cv_netbsd_menu_h+set}" = set; then
14641   echo $ECHO_N "(cached) $ECHO_C" >&6
14642 else
14643
14644 cat >conftest.$ac_ext <<_ACEOF
14645 #line 14645 "configure"
14646 #include "confdefs.h"
14647
14648 #include <${cf_cv_ncurses_header:-curses.h}>
14649 #include <menu.h>
14650
14651 int
14652 main (void)
14653 {
14654
14655         MENU *menu;
14656         int y = menu->max_item_width;
14657
14658   ;
14659   return 0;
14660 }
14661 _ACEOF
14662 rm -f conftest.$ac_objext
14663 if { (eval echo "$as_me:14663: \"$ac_compile\"") >&5
14664   (eval $ac_compile) 2>&5
14665   ac_status=$?
14666   echo "$as_me:14666: \$? = $ac_status" >&5
14667   (exit $ac_status); } &&
14668          { ac_try='test -s conftest.$ac_objext'
14669   { (eval echo "$as_me:14669: \"$ac_try\"") >&5
14670   (eval $ac_try) 2>&5
14671   ac_status=$?
14672   echo "$as_me:14672: \$? = $ac_status" >&5
14673   (exit $ac_status); }; }; then
14674   cf_cv_netbsd_menu_h=yes
14675
14676 else
14677   echo "$as_me: failed program was:" >&5
14678 cat conftest.$ac_ext >&5
14679 cf_cv_netbsd_menu_h=no
14680 fi
14681 rm -f conftest.$ac_objext conftest.$ac_ext
14682
14683 fi
14684 echo "$as_me:14684: result: $cf_cv_netbsd_menu_h" >&5
14685 echo "${ECHO_T}$cf_cv_netbsd_menu_h" >&6
14686
14687 test "$cf_cv_netbsd_menu_h" = yes &&
14688 cat >>confdefs.h <<\EOF
14689 #define HAVE_NETBSD_MENU_H 1
14690 EOF
14691
14692                 ;;
14693         esac
14694
14695 cf_have_curses_lib=no
14696
14697 : ${NCURSES_CONFIG_PKG:=none}
14698 if test "x${NCURSES_CONFIG_PKG}" = xnone; then
14699         :
14700 elif test "x${PKG_CONFIG:=none}" != xnone; then
14701         echo "$as_me:14701: checking pkg-config for menu$cf_cv_libtype" >&5
14702 echo $ECHO_N "checking pkg-config for menu$cf_cv_libtype... $ECHO_C" >&6
14703         if "$PKG_CONFIG" --exists menu$cf_cv_libtype ; then
14704                 echo "$as_me:14704: result: yes" >&5
14705 echo "${ECHO_T}yes" >&6
14706
14707                 echo "$as_me:14707: checking if the menu$cf_cv_libtype package files work" >&5
14708 echo $ECHO_N "checking if the menu$cf_cv_libtype package files work... $ECHO_C" >&6
14709
14710                 cf_save_CPPFLAGS="$CPPFLAGS"
14711                 cf_save_LIBS="$LIBS"
14712
14713 cf_fix_cppflags=no
14714 cf_new_cflags=
14715 cf_new_cppflags=
14716 cf_new_extra_cppflags=
14717
14718 for cf_add_cflags in `$PKG_CONFIG --cflags menu$cf_cv_libtype`
14719 do
14720 case $cf_fix_cppflags in
14721 (no)
14722         case $cf_add_cflags in
14723         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14724                 case $cf_add_cflags in
14725                 (-D*)
14726                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14727
14728                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14729                                 && test -z "${cf_tst_cflags}" \
14730                                 && cf_fix_cppflags=yes
14731
14732                         if test $cf_fix_cppflags = yes ; then
14733
14734         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14735         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14736
14737                                 continue
14738                         elif test "${cf_tst_cflags}" = "\"'" ; then
14739
14740         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14741         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14742
14743                                 continue
14744                         fi
14745                         ;;
14746                 esac
14747                 case "$CPPFLAGS" in
14748                 (*$cf_add_cflags)
14749                         ;;
14750                 (*)
14751                         case $cf_add_cflags in
14752                         (-D*)
14753                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14754
14755 CPPFLAGS=`echo "$CPPFLAGS" | \
14756         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14757                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14758
14759                                 ;;
14760                         esac
14761
14762         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14763         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14764
14765                         ;;
14766                 esac
14767                 ;;
14768         (*)
14769
14770         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14771         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14772
14773                 ;;
14774         esac
14775         ;;
14776 (yes)
14777
14778         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14779         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14780
14781         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
14782
14783         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14784                 && test -z "${cf_tst_cflags}" \
14785                 && cf_fix_cppflags=no
14786         ;;
14787 esac
14788 done
14789
14790 if test -n "$cf_new_cflags" ; then
14791
14792         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14793         CFLAGS="${CFLAGS}$cf_new_cflags"
14794
14795 fi
14796
14797 if test -n "$cf_new_cppflags" ; then
14798
14799         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14800         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14801
14802 fi
14803
14804 if test -n "$cf_new_extra_cppflags" ; then
14805
14806         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14807         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14808
14809 fi
14810
14811 cf_add_libs="`$PKG_CONFIG --libs menu$cf_cv_libtype`"
14812 # Filter out duplicates - this happens with badly-designed ".pc" files...
14813 for cf_add_1lib in $LIBS
14814 do
14815         for cf_add_2lib in $cf_add_libs
14816         do
14817                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
14818                 then
14819                         cf_add_1lib=
14820                         break
14821                 fi
14822         done
14823         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
14824 done
14825 LIBS="$cf_add_libs"
14826
14827                 cat >conftest.$ac_ext <<_ACEOF
14828 #line 14828 "configure"
14829 #include "confdefs.h"
14830 #include <menu.h>
14831 int
14832 main (void)
14833 {
14834 (void) menu_driver ( 0,0 );
14835   ;
14836   return 0;
14837 }
14838 _ACEOF
14839 rm -f conftest.$ac_objext conftest$ac_exeext
14840 if { (eval echo "$as_me:14840: \"$ac_link\"") >&5
14841   (eval $ac_link) 2>&5
14842   ac_status=$?
14843   echo "$as_me:14843: \$? = $ac_status" >&5
14844   (exit $ac_status); } &&
14845          { ac_try='test -s conftest$ac_exeext'
14846   { (eval echo "$as_me:14846: \"$ac_try\"") >&5
14847   (eval $ac_try) 2>&5
14848   ac_status=$?
14849   echo "$as_me:14849: \$? = $ac_status" >&5
14850   (exit $ac_status); }; }; then
14851   if test "$cross_compiling" = yes; then
14852   cf_have_curses_lib=maybe
14853 else
14854   cat >conftest.$ac_ext <<_ACEOF
14855 #line 14855 "configure"
14856 #include "confdefs.h"
14857 #include <menu.h>
14858                                 int main(void)
14859                                 { (void) menu_driver ( 0,0 ); return 0; }
14860 _ACEOF
14861 rm -f conftest$ac_exeext
14862 if { (eval echo "$as_me:14862: \"$ac_link\"") >&5
14863   (eval $ac_link) 2>&5
14864   ac_status=$?
14865   echo "$as_me:14865: \$? = $ac_status" >&5
14866   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
14867   { (eval echo "$as_me:14867: \"$ac_try\"") >&5
14868   (eval $ac_try) 2>&5
14869   ac_status=$?
14870   echo "$as_me:14870: \$? = $ac_status" >&5
14871   (exit $ac_status); }; }; then
14872   cf_have_curses_lib=yes
14873 else
14874   echo "$as_me: program exited with status $ac_status" >&5
14875 echo "$as_me: failed program was:" >&5
14876 cat conftest.$ac_ext >&5
14877 cf_have_curses_lib=no
14878 fi
14879 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
14880 fi
14881 else
14882   echo "$as_me: failed program was:" >&5
14883 cat conftest.$ac_ext >&5
14884 cf_have_curses_lib=no
14885 fi
14886 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14887                 echo "$as_me:14887: result: $cf_have_curses_lib" >&5
14888 echo "${ECHO_T}$cf_have_curses_lib" >&6
14889                 test "$cf_have_curses_lib" = maybe && cf_have_curses_lib=yes
14890                 if test "$cf_have_curses_lib" != "yes"
14891                 then
14892                         CPPFLAGS="$cf_save_CPPFLAGS"
14893                         LIBS="$cf_save_LIBS"
14894                 else
14895
14896 cf_upper=`echo "have_libmenu" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14897
14898                         cat >>confdefs.h <<EOF
14899 #define $cf_upper 1
14900 EOF
14901
14902                 fi
14903         fi
14904 fi
14905 if test "$cf_have_curses_lib" = no; then
14906         as_ac_Lib=`echo "ac_cv_lib_menu$cf_cv_libtype''_menu_driver" | $as_tr_sh`
14907 echo "$as_me:14907: checking for menu_driver in -lmenu$cf_cv_libtype" >&5
14908 echo $ECHO_N "checking for menu_driver in -lmenu$cf_cv_libtype... $ECHO_C" >&6
14909 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
14910   echo $ECHO_N "(cached) $ECHO_C" >&6
14911 else
14912   ac_check_lib_save_LIBS=$LIBS
14913 LIBS="-lmenu$cf_cv_libtype  $LIBS"
14914 cat >conftest.$ac_ext <<_ACEOF
14915 #line 14915 "configure"
14916 #include "confdefs.h"
14917
14918 /* Override any gcc2 internal prototype to avoid an error.  */
14919 #ifdef __cplusplus
14920 extern "C"
14921 #endif
14922 /* We use char because int might match the return type of a gcc2
14923    builtin and then its argument prototype would still apply.  */
14924 char menu_driver ();
14925 int
14926 main (void)
14927 {
14928 menu_driver ();
14929   ;
14930   return 0;
14931 }
14932 _ACEOF
14933 rm -f conftest.$ac_objext conftest$ac_exeext
14934 if { (eval echo "$as_me:14934: \"$ac_link\"") >&5
14935   (eval $ac_link) 2>&5
14936   ac_status=$?
14937   echo "$as_me:14937: \$? = $ac_status" >&5
14938   (exit $ac_status); } &&
14939          { ac_try='test -s conftest$ac_exeext'
14940   { (eval echo "$as_me:14940: \"$ac_try\"") >&5
14941   (eval $ac_try) 2>&5
14942   ac_status=$?
14943   echo "$as_me:14943: \$? = $ac_status" >&5
14944   (exit $ac_status); }; }; then
14945   eval "$as_ac_Lib=yes"
14946 else
14947   echo "$as_me: failed program was:" >&5
14948 cat conftest.$ac_ext >&5
14949 eval "$as_ac_Lib=no"
14950 fi
14951 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14952 LIBS=$ac_check_lib_save_LIBS
14953 fi
14954 echo "$as_me:14954: result: `eval echo '${'$as_ac_Lib'}'`" >&5
14955 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
14956 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
14957
14958 cf_upper=`echo "have_libmenu" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14959
14960 cf_add_libs="-lmenu$cf_cv_libtype"
14961 # Filter out duplicates - this happens with badly-designed ".pc" files...
14962 for cf_add_1lib in $LIBS
14963 do
14964         for cf_add_2lib in $cf_add_libs
14965         do
14966                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
14967                 then
14968                         cf_add_1lib=
14969                         break
14970                 fi
14971         done
14972         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
14973 done
14974 LIBS="$cf_add_libs"
14975
14976                 cat >>confdefs.h <<EOF
14977 #define $cf_upper 1
14978 EOF
14979
14980 fi
14981
14982 fi
14983
14984         cf_curses_headers="$cf_curses_headers menu.h"
14985 fi
14986
14987 echo "$as_me:14987: checking if you want to check for form functions" >&5
14988 echo $ECHO_N "checking if you want to check for form functions... $ECHO_C" >&6
14989
14990 # Check whether --enable-form or --disable-form was given.
14991 if test "${enable_form+set}" = set; then
14992   enableval="$enable_form"
14993   test "$enableval" != no && enableval=yes
14994         if test "$enableval" != "yes" ; then
14995     cf_enable_form=no
14996         else
14997                 cf_enable_form=$cf_default_form
14998         fi
14999 else
15000   enableval=yes
15001         cf_enable_form=$cf_default_form
15002
15003 fi;
15004 echo "$as_me:15004: result: $cf_enable_form" >&5
15005 echo "${ECHO_T}$cf_enable_form" >&6
15006 if test $cf_enable_form = yes
15007 then
15008         case $cf_cv_screen in
15009         (ncurses*)
15010                 ;;
15011         (curses*)
15012
15013 echo "$as_me:15013: checking for NetBSD form.h" >&5
15014 echo $ECHO_N "checking for NetBSD form.h... $ECHO_C" >&6
15015 if test "${cf_cv_netbsd_form_h+set}" = set; then
15016   echo $ECHO_N "(cached) $ECHO_C" >&6
15017 else
15018
15019 cat >conftest.$ac_ext <<_ACEOF
15020 #line 15020 "configure"
15021 #include "confdefs.h"
15022
15023 #include <${cf_cv_ncurses_header:-curses.h}>
15024 #include <form.h>
15025
15026 int
15027 main (void)
15028 {
15029
15030         FORM *form;
15031         int y = current_field(form)->cursor_ypos;
15032         int x = current_field(form)->cursor_xpos;
15033
15034   ;
15035   return 0;
15036 }
15037 _ACEOF
15038 rm -f conftest.$ac_objext
15039 if { (eval echo "$as_me:15039: \"$ac_compile\"") >&5
15040   (eval $ac_compile) 2>&5
15041   ac_status=$?
15042   echo "$as_me:15042: \$? = $ac_status" >&5
15043   (exit $ac_status); } &&
15044          { ac_try='test -s conftest.$ac_objext'
15045   { (eval echo "$as_me:15045: \"$ac_try\"") >&5
15046   (eval $ac_try) 2>&5
15047   ac_status=$?
15048   echo "$as_me:15048: \$? = $ac_status" >&5
15049   (exit $ac_status); }; }; then
15050   cf_cv_netbsd_form_h=yes
15051
15052 else
15053   echo "$as_me: failed program was:" >&5
15054 cat conftest.$ac_ext >&5
15055 cf_cv_netbsd_form_h=no
15056 fi
15057 rm -f conftest.$ac_objext conftest.$ac_ext
15058
15059 fi
15060 echo "$as_me:15060: result: $cf_cv_netbsd_form_h" >&5
15061 echo "${ECHO_T}$cf_cv_netbsd_form_h" >&6
15062
15063 test "$cf_cv_netbsd_form_h" = yes &&
15064 cat >>confdefs.h <<\EOF
15065 #define HAVE_NETBSD_FORM_H 1
15066 EOF
15067
15068                 ;;
15069         esac
15070
15071 cf_have_curses_lib=no
15072
15073 : ${NCURSES_CONFIG_PKG:=none}
15074 if test "x${NCURSES_CONFIG_PKG}" = xnone; then
15075         :
15076 elif test "x${PKG_CONFIG:=none}" != xnone; then
15077         echo "$as_me:15077: checking pkg-config for form$cf_cv_libtype" >&5
15078 echo $ECHO_N "checking pkg-config for form$cf_cv_libtype... $ECHO_C" >&6
15079         if "$PKG_CONFIG" --exists form$cf_cv_libtype ; then
15080                 echo "$as_me:15080: result: yes" >&5
15081 echo "${ECHO_T}yes" >&6
15082
15083                 echo "$as_me:15083: checking if the form$cf_cv_libtype package files work" >&5
15084 echo $ECHO_N "checking if the form$cf_cv_libtype package files work... $ECHO_C" >&6
15085
15086                 cf_save_CPPFLAGS="$CPPFLAGS"
15087                 cf_save_LIBS="$LIBS"
15088
15089 cf_fix_cppflags=no
15090 cf_new_cflags=
15091 cf_new_cppflags=
15092 cf_new_extra_cppflags=
15093
15094 for cf_add_cflags in `$PKG_CONFIG --cflags form$cf_cv_libtype`
15095 do
15096 case $cf_fix_cppflags in
15097 (no)
15098         case $cf_add_cflags in
15099         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
15100                 case $cf_add_cflags in
15101                 (-D*)
15102                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
15103
15104                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15105                                 && test -z "${cf_tst_cflags}" \
15106                                 && cf_fix_cppflags=yes
15107
15108                         if test $cf_fix_cppflags = yes ; then
15109
15110         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15111         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15112
15113                                 continue
15114                         elif test "${cf_tst_cflags}" = "\"'" ; then
15115
15116         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15117         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15118
15119                                 continue
15120                         fi
15121                         ;;
15122                 esac
15123                 case "$CPPFLAGS" in
15124                 (*$cf_add_cflags)
15125                         ;;
15126                 (*)
15127                         case $cf_add_cflags in
15128                         (-D*)
15129                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
15130
15131 CPPFLAGS=`echo "$CPPFLAGS" | \
15132         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
15133                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
15134
15135                                 ;;
15136                         esac
15137
15138         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
15139         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
15140
15141                         ;;
15142                 esac
15143                 ;;
15144         (*)
15145
15146         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
15147         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
15148
15149                 ;;
15150         esac
15151         ;;
15152 (yes)
15153
15154         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15155         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15156
15157         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
15158
15159         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15160                 && test -z "${cf_tst_cflags}" \
15161                 && cf_fix_cppflags=no
15162         ;;
15163 esac
15164 done
15165
15166 if test -n "$cf_new_cflags" ; then
15167
15168         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
15169         CFLAGS="${CFLAGS}$cf_new_cflags"
15170
15171 fi
15172
15173 if test -n "$cf_new_cppflags" ; then
15174
15175         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15176         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
15177
15178 fi
15179
15180 if test -n "$cf_new_extra_cppflags" ; then
15181
15182         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
15183         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
15184
15185 fi
15186
15187 cf_add_libs="`$PKG_CONFIG --libs form$cf_cv_libtype`"
15188 # Filter out duplicates - this happens with badly-designed ".pc" files...
15189 for cf_add_1lib in $LIBS
15190 do
15191         for cf_add_2lib in $cf_add_libs
15192         do
15193                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
15194                 then
15195                         cf_add_1lib=
15196                         break
15197                 fi
15198         done
15199         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
15200 done
15201 LIBS="$cf_add_libs"
15202
15203                 cat >conftest.$ac_ext <<_ACEOF
15204 #line 15204 "configure"
15205 #include "confdefs.h"
15206 #include <form.h>
15207 int
15208 main (void)
15209 {
15210 (void) form_driver ( 0,0 );
15211   ;
15212   return 0;
15213 }
15214 _ACEOF
15215 rm -f conftest.$ac_objext conftest$ac_exeext
15216 if { (eval echo "$as_me:15216: \"$ac_link\"") >&5
15217   (eval $ac_link) 2>&5
15218   ac_status=$?
15219   echo "$as_me:15219: \$? = $ac_status" >&5
15220   (exit $ac_status); } &&
15221          { ac_try='test -s conftest$ac_exeext'
15222   { (eval echo "$as_me:15222: \"$ac_try\"") >&5
15223   (eval $ac_try) 2>&5
15224   ac_status=$?
15225   echo "$as_me:15225: \$? = $ac_status" >&5
15226   (exit $ac_status); }; }; then
15227   if test "$cross_compiling" = yes; then
15228   cf_have_curses_lib=maybe
15229 else
15230   cat >conftest.$ac_ext <<_ACEOF
15231 #line 15231 "configure"
15232 #include "confdefs.h"
15233 #include <form.h>
15234                                 int main(void)
15235                                 { (void) form_driver ( 0,0 ); return 0; }
15236 _ACEOF
15237 rm -f conftest$ac_exeext
15238 if { (eval echo "$as_me:15238: \"$ac_link\"") >&5
15239   (eval $ac_link) 2>&5
15240   ac_status=$?
15241   echo "$as_me:15241: \$? = $ac_status" >&5
15242   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
15243   { (eval echo "$as_me:15243: \"$ac_try\"") >&5
15244   (eval $ac_try) 2>&5
15245   ac_status=$?
15246   echo "$as_me:15246: \$? = $ac_status" >&5
15247   (exit $ac_status); }; }; then
15248   cf_have_curses_lib=yes
15249 else
15250   echo "$as_me: program exited with status $ac_status" >&5
15251 echo "$as_me: failed program was:" >&5
15252 cat conftest.$ac_ext >&5
15253 cf_have_curses_lib=no
15254 fi
15255 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
15256 fi
15257 else
15258   echo "$as_me: failed program was:" >&5
15259 cat conftest.$ac_ext >&5
15260 cf_have_curses_lib=no
15261 fi
15262 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15263                 echo "$as_me:15263: result: $cf_have_curses_lib" >&5
15264 echo "${ECHO_T}$cf_have_curses_lib" >&6
15265                 test "$cf_have_curses_lib" = maybe && cf_have_curses_lib=yes
15266                 if test "$cf_have_curses_lib" != "yes"
15267                 then
15268                         CPPFLAGS="$cf_save_CPPFLAGS"
15269                         LIBS="$cf_save_LIBS"
15270                 else
15271
15272 cf_upper=`echo "have_libform" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15273
15274                         cat >>confdefs.h <<EOF
15275 #define $cf_upper 1
15276 EOF
15277
15278                 fi
15279         fi
15280 fi
15281 if test "$cf_have_curses_lib" = no; then
15282         as_ac_Lib=`echo "ac_cv_lib_form$cf_cv_libtype''_form_driver" | $as_tr_sh`
15283 echo "$as_me:15283: checking for form_driver in -lform$cf_cv_libtype" >&5
15284 echo $ECHO_N "checking for form_driver in -lform$cf_cv_libtype... $ECHO_C" >&6
15285 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
15286   echo $ECHO_N "(cached) $ECHO_C" >&6
15287 else
15288   ac_check_lib_save_LIBS=$LIBS
15289 LIBS="-lform$cf_cv_libtype  $LIBS"
15290 cat >conftest.$ac_ext <<_ACEOF
15291 #line 15291 "configure"
15292 #include "confdefs.h"
15293
15294 /* Override any gcc2 internal prototype to avoid an error.  */
15295 #ifdef __cplusplus
15296 extern "C"
15297 #endif
15298 /* We use char because int might match the return type of a gcc2
15299    builtin and then its argument prototype would still apply.  */
15300 char form_driver ();
15301 int
15302 main (void)
15303 {
15304 form_driver ();
15305   ;
15306   return 0;
15307 }
15308 _ACEOF
15309 rm -f conftest.$ac_objext conftest$ac_exeext
15310 if { (eval echo "$as_me:15310: \"$ac_link\"") >&5
15311   (eval $ac_link) 2>&5
15312   ac_status=$?
15313   echo "$as_me:15313: \$? = $ac_status" >&5
15314   (exit $ac_status); } &&
15315          { ac_try='test -s conftest$ac_exeext'
15316   { (eval echo "$as_me:15316: \"$ac_try\"") >&5
15317   (eval $ac_try) 2>&5
15318   ac_status=$?
15319   echo "$as_me:15319: \$? = $ac_status" >&5
15320   (exit $ac_status); }; }; then
15321   eval "$as_ac_Lib=yes"
15322 else
15323   echo "$as_me: failed program was:" >&5
15324 cat conftest.$ac_ext >&5
15325 eval "$as_ac_Lib=no"
15326 fi
15327 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15328 LIBS=$ac_check_lib_save_LIBS
15329 fi
15330 echo "$as_me:15330: result: `eval echo '${'$as_ac_Lib'}'`" >&5
15331 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
15332 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
15333
15334 cf_upper=`echo "have_libform" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15335
15336 cf_add_libs="-lform$cf_cv_libtype"
15337 # Filter out duplicates - this happens with badly-designed ".pc" files...
15338 for cf_add_1lib in $LIBS
15339 do
15340         for cf_add_2lib in $cf_add_libs
15341         do
15342                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
15343                 then
15344                         cf_add_1lib=
15345                         break
15346                 fi
15347         done
15348         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
15349 done
15350 LIBS="$cf_add_libs"
15351
15352                 cat >>confdefs.h <<EOF
15353 #define $cf_upper 1
15354 EOF
15355
15356 fi
15357
15358 fi
15359
15360         cf_curses_headers="$cf_curses_headers form.h"
15361 fi
15362
15363 # look for curses-related headers
15364
15365 for ac_header in $cf_curses_headers
15366 do
15367 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
15368 echo "$as_me:15368: checking for $ac_header" >&5
15369 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
15370 if eval "test \"\${$as_ac_Header+set}\" = set"; then
15371   echo $ECHO_N "(cached) $ECHO_C" >&6
15372 else
15373   cat >conftest.$ac_ext <<_ACEOF
15374 #line 15374 "configure"
15375 #include "confdefs.h"
15376 #include <$ac_header>
15377 _ACEOF
15378 if { (eval echo "$as_me:15378: \"$ac_cpp conftest.$ac_ext\"") >&5
15379   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
15380   ac_status=$?
15381   egrep -v '^ *\+' conftest.er1 >conftest.err
15382   rm -f conftest.er1
15383   cat conftest.err >&5
15384   echo "$as_me:15384: \$? = $ac_status" >&5
15385   (exit $ac_status); } >/dev/null; then
15386   if test -s conftest.err; then
15387     ac_cpp_err=$ac_c_preproc_warn_flag
15388   else
15389     ac_cpp_err=
15390   fi
15391 else
15392   ac_cpp_err=yes
15393 fi
15394 if test -z "$ac_cpp_err"; then
15395   eval "$as_ac_Header=yes"
15396 else
15397   echo "$as_me: failed program was:" >&5
15398   cat conftest.$ac_ext >&5
15399   eval "$as_ac_Header=no"
15400 fi
15401 rm -f conftest.err conftest.$ac_ext
15402 fi
15403 echo "$as_me:15403: result: `eval echo '${'$as_ac_Header'}'`" >&5
15404 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
15405 if test `eval echo '${'$as_ac_Header'}'` = yes; then
15406   cat >>confdefs.h <<EOF
15407 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
15408 EOF
15409
15410 fi
15411 done
15412
15413 echo "$as_me:15413: checking for ANSI C header files" >&5
15414 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
15415 if test "${ac_cv_header_stdc+set}" = set; then
15416   echo $ECHO_N "(cached) $ECHO_C" >&6
15417 else
15418   cat >conftest.$ac_ext <<_ACEOF
15419 #line 15419 "configure"
15420 #include "confdefs.h"
15421 #include <stdlib.h>
15422 #include <stdarg.h>
15423 #include <string.h>
15424 #include <float.h>
15425
15426 _ACEOF
15427 if { (eval echo "$as_me:15427: \"$ac_cpp conftest.$ac_ext\"") >&5
15428   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
15429   ac_status=$?
15430   egrep -v '^ *\+' conftest.er1 >conftest.err
15431   rm -f conftest.er1
15432   cat conftest.err >&5
15433   echo "$as_me:15433: \$? = $ac_status" >&5
15434   (exit $ac_status); } >/dev/null; then
15435   if test -s conftest.err; then
15436     ac_cpp_err=$ac_c_preproc_warn_flag
15437   else
15438     ac_cpp_err=
15439   fi
15440 else
15441   ac_cpp_err=yes
15442 fi
15443 if test -z "$ac_cpp_err"; then
15444   ac_cv_header_stdc=yes
15445 else
15446   echo "$as_me: failed program was:" >&5
15447   cat conftest.$ac_ext >&5
15448   ac_cv_header_stdc=no
15449 fi
15450 rm -f conftest.err conftest.$ac_ext
15451
15452 if test $ac_cv_header_stdc = yes; then
15453   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
15454   cat >conftest.$ac_ext <<_ACEOF
15455 #line 15455 "configure"
15456 #include "confdefs.h"
15457 #include <string.h>
15458
15459 _ACEOF
15460 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15461   egrep "memchr" >/dev/null 2>&1; then
15462   :
15463 else
15464   ac_cv_header_stdc=no
15465 fi
15466 rm -rf conftest*
15467
15468 fi
15469
15470 if test $ac_cv_header_stdc = yes; then
15471   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
15472   cat >conftest.$ac_ext <<_ACEOF
15473 #line 15473 "configure"
15474 #include "confdefs.h"
15475 #include <stdlib.h>
15476
15477 _ACEOF
15478 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15479   egrep "free" >/dev/null 2>&1; then
15480   :
15481 else
15482   ac_cv_header_stdc=no
15483 fi
15484 rm -rf conftest*
15485
15486 fi
15487
15488 if test $ac_cv_header_stdc = yes; then
15489   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
15490   if test "$cross_compiling" = yes; then
15491   :
15492 else
15493   cat >conftest.$ac_ext <<_ACEOF
15494 #line 15494 "configure"
15495 #include "confdefs.h"
15496 #include <ctype.h>
15497 #if ((' ' & 0x0FF) == 0x020)
15498 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
15499 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
15500 #else
15501 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
15502                      || ('j' <= (c) && (c) <= 'r') \
15503                      || ('s' <= (c) && (c) <= 'z'))
15504 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
15505 #endif
15506
15507 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
15508 int
15509 main (void)
15510 {
15511   int i;
15512   for (i = 0; i < 256; i++)
15513     if (XOR (islower (i), ISLOWER (i))
15514         || toupper (i) != TOUPPER (i))
15515       $ac_main_return(2);
15516   $ac_main_return (0);
15517 }
15518 _ACEOF
15519 rm -f conftest$ac_exeext
15520 if { (eval echo "$as_me:15520: \"$ac_link\"") >&5
15521   (eval $ac_link) 2>&5
15522   ac_status=$?
15523   echo "$as_me:15523: \$? = $ac_status" >&5
15524   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
15525   { (eval echo "$as_me:15525: \"$ac_try\"") >&5
15526   (eval $ac_try) 2>&5
15527   ac_status=$?
15528   echo "$as_me:15528: \$? = $ac_status" >&5
15529   (exit $ac_status); }; }; then
15530   :
15531 else
15532   echo "$as_me: program exited with status $ac_status" >&5
15533 echo "$as_me: failed program was:" >&5
15534 cat conftest.$ac_ext >&5
15535 ac_cv_header_stdc=no
15536 fi
15537 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
15538 fi
15539 fi
15540 fi
15541 echo "$as_me:15541: result: $ac_cv_header_stdc" >&5
15542 echo "${ECHO_T}$ac_cv_header_stdc" >&6
15543 if test $ac_cv_header_stdc = yes; then
15544
15545 cat >>confdefs.h <<\EOF
15546 #define STDC_HEADERS 1
15547 EOF
15548
15549 fi
15550
15551 echo "$as_me:15551: checking whether time.h and sys/time.h may both be included" >&5
15552 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
15553 if test "${ac_cv_header_time+set}" = set; then
15554   echo $ECHO_N "(cached) $ECHO_C" >&6
15555 else
15556   cat >conftest.$ac_ext <<_ACEOF
15557 #line 15557 "configure"
15558 #include "confdefs.h"
15559 #include <sys/types.h>
15560 #include <sys/time.h>
15561 #include <time.h>
15562
15563 int
15564 main (void)
15565 {
15566 if ((struct tm *) 0)
15567 return 0;
15568   ;
15569   return 0;
15570 }
15571 _ACEOF
15572 rm -f conftest.$ac_objext
15573 if { (eval echo "$as_me:15573: \"$ac_compile\"") >&5
15574   (eval $ac_compile) 2>&5
15575   ac_status=$?
15576   echo "$as_me:15576: \$? = $ac_status" >&5
15577   (exit $ac_status); } &&
15578          { ac_try='test -s conftest.$ac_objext'
15579   { (eval echo "$as_me:15579: \"$ac_try\"") >&5
15580   (eval $ac_try) 2>&5
15581   ac_status=$?
15582   echo "$as_me:15582: \$? = $ac_status" >&5
15583   (exit $ac_status); }; }; then
15584   ac_cv_header_time=yes
15585 else
15586   echo "$as_me: failed program was:" >&5
15587 cat conftest.$ac_ext >&5
15588 ac_cv_header_time=no
15589 fi
15590 rm -f conftest.$ac_objext conftest.$ac_ext
15591 fi
15592 echo "$as_me:15592: result: $ac_cv_header_time" >&5
15593 echo "${ECHO_T}$ac_cv_header_time" >&6
15594 if test $ac_cv_header_time = yes; then
15595
15596 cat >>confdefs.h <<\EOF
15597 #define TIME_WITH_SYS_TIME 1
15598 EOF
15599
15600 fi
15601
15602 for ac_header in \
15603 getopt.h \
15604 locale.h \
15605 math.h \
15606 stdarg.h \
15607 stdint.h \
15608 sys/ioctl.h \
15609 sys/select.h \
15610 sys/time.h \
15611 termios.h \
15612 unistd.h \
15613
15614 do
15615 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
15616 echo "$as_me:15616: checking for $ac_header" >&5
15617 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
15618 if eval "test \"\${$as_ac_Header+set}\" = set"; then
15619   echo $ECHO_N "(cached) $ECHO_C" >&6
15620 else
15621   cat >conftest.$ac_ext <<_ACEOF
15622 #line 15622 "configure"
15623 #include "confdefs.h"
15624 #include <$ac_header>
15625 _ACEOF
15626 if { (eval echo "$as_me:15626: \"$ac_cpp conftest.$ac_ext\"") >&5
15627   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
15628   ac_status=$?
15629   egrep -v '^ *\+' conftest.er1 >conftest.err
15630   rm -f conftest.er1
15631   cat conftest.err >&5
15632   echo "$as_me:15632: \$? = $ac_status" >&5
15633   (exit $ac_status); } >/dev/null; then
15634   if test -s conftest.err; then
15635     ac_cpp_err=$ac_c_preproc_warn_flag
15636   else
15637     ac_cpp_err=
15638   fi
15639 else
15640   ac_cpp_err=yes
15641 fi
15642 if test -z "$ac_cpp_err"; then
15643   eval "$as_ac_Header=yes"
15644 else
15645   echo "$as_me: failed program was:" >&5
15646   cat conftest.$ac_ext >&5
15647   eval "$as_ac_Header=no"
15648 fi
15649 rm -f conftest.err conftest.$ac_ext
15650 fi
15651 echo "$as_me:15651: result: `eval echo '${'$as_ac_Header'}'`" >&5
15652 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
15653 if test `eval echo '${'$as_ac_Header'}'` = yes; then
15654   cat >>confdefs.h <<EOF
15655 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
15656 EOF
15657
15658 fi
15659 done
15660
15661 for ac_header in unistd.h getopt.h
15662 do
15663 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
15664 echo "$as_me:15664: checking for $ac_header" >&5
15665 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
15666 if eval "test \"\${$as_ac_Header+set}\" = set"; then
15667   echo $ECHO_N "(cached) $ECHO_C" >&6
15668 else
15669   cat >conftest.$ac_ext <<_ACEOF
15670 #line 15670 "configure"
15671 #include "confdefs.h"
15672 #include <$ac_header>
15673 _ACEOF
15674 if { (eval echo "$as_me:15674: \"$ac_cpp conftest.$ac_ext\"") >&5
15675   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
15676   ac_status=$?
15677   egrep -v '^ *\+' conftest.er1 >conftest.err
15678   rm -f conftest.er1
15679   cat conftest.err >&5
15680   echo "$as_me:15680: \$? = $ac_status" >&5
15681   (exit $ac_status); } >/dev/null; then
15682   if test -s conftest.err; then
15683     ac_cpp_err=$ac_c_preproc_warn_flag
15684   else
15685     ac_cpp_err=
15686   fi
15687 else
15688   ac_cpp_err=yes
15689 fi
15690 if test -z "$ac_cpp_err"; then
15691   eval "$as_ac_Header=yes"
15692 else
15693   echo "$as_me: failed program was:" >&5
15694   cat conftest.$ac_ext >&5
15695   eval "$as_ac_Header=no"
15696 fi
15697 rm -f conftest.err conftest.$ac_ext
15698 fi
15699 echo "$as_me:15699: result: `eval echo '${'$as_ac_Header'}'`" >&5
15700 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
15701 if test `eval echo '${'$as_ac_Header'}'` = yes; then
15702   cat >>confdefs.h <<EOF
15703 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
15704 EOF
15705
15706 fi
15707 done
15708
15709 echo "$as_me:15709: checking for header declaring getopt variables" >&5
15710 echo $ECHO_N "checking for header declaring getopt variables... $ECHO_C" >&6
15711 if test "${cf_cv_getopt_header+set}" = set; then
15712   echo $ECHO_N "(cached) $ECHO_C" >&6
15713 else
15714
15715 cf_cv_getopt_header=none
15716 for cf_header in stdio.h stdlib.h unistd.h getopt.h
15717 do
15718 cat >conftest.$ac_ext <<_ACEOF
15719 #line 15719 "configure"
15720 #include "confdefs.h"
15721
15722 #include <$cf_header>
15723 int
15724 main (void)
15725 {
15726 int x = optind; char *y = optarg
15727   ;
15728   return 0;
15729 }
15730 _ACEOF
15731 rm -f conftest.$ac_objext
15732 if { (eval echo "$as_me:15732: \"$ac_compile\"") >&5
15733   (eval $ac_compile) 2>&5
15734   ac_status=$?
15735   echo "$as_me:15735: \$? = $ac_status" >&5
15736   (exit $ac_status); } &&
15737          { ac_try='test -s conftest.$ac_objext'
15738   { (eval echo "$as_me:15738: \"$ac_try\"") >&5
15739   (eval $ac_try) 2>&5
15740   ac_status=$?
15741   echo "$as_me:15741: \$? = $ac_status" >&5
15742   (exit $ac_status); }; }; then
15743   cf_cv_getopt_header=$cf_header
15744  break
15745 else
15746   echo "$as_me: failed program was:" >&5
15747 cat conftest.$ac_ext >&5
15748 fi
15749 rm -f conftest.$ac_objext conftest.$ac_ext
15750 done
15751
15752 fi
15753 echo "$as_me:15753: result: $cf_cv_getopt_header" >&5
15754 echo "${ECHO_T}$cf_cv_getopt_header" >&6
15755 if test $cf_cv_getopt_header != none ; then
15756
15757 cat >>confdefs.h <<\EOF
15758 #define HAVE_GETOPT_HEADER 1
15759 EOF
15760
15761 fi
15762 if test $cf_cv_getopt_header = getopt.h ; then
15763
15764 cat >>confdefs.h <<\EOF
15765 #define NEED_GETOPT_H 1
15766 EOF
15767
15768 fi
15769
15770 for ac_func in \
15771 getopt \
15772 gettimeofday \
15773 tdestroy \
15774 tsearch \
15775
15776 do
15777 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
15778 echo "$as_me:15778: checking for $ac_func" >&5
15779 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
15780 if eval "test \"\${$as_ac_var+set}\" = set"; then
15781   echo $ECHO_N "(cached) $ECHO_C" >&6
15782 else
15783   cat >conftest.$ac_ext <<_ACEOF
15784 #line 15784 "configure"
15785 #include "confdefs.h"
15786 /* System header to define __stub macros and hopefully few prototypes,
15787     which can conflict with char $ac_func (); below.  */
15788 #include <assert.h>
15789 /* Override any gcc2 internal prototype to avoid an error.  */
15790 #ifdef __cplusplus
15791 extern "C"
15792 #endif
15793 /* We use char because int might match the return type of a gcc2
15794    builtin and then its argument prototype would still apply.  */
15795 char $ac_func ();
15796 char (*f) ();
15797
15798 int
15799 main (void)
15800 {
15801 /* The GNU C library defines this for functions which it implements
15802     to always fail with ENOSYS.  Some functions are actually named
15803     something starting with __ and the normal name is an alias.  */
15804 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
15805 choke me
15806 #else
15807 f = $ac_func; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
15808 #endif
15809
15810   ;
15811   return 0;
15812 }
15813 _ACEOF
15814 rm -f conftest.$ac_objext conftest$ac_exeext
15815 if { (eval echo "$as_me:15815: \"$ac_link\"") >&5
15816   (eval $ac_link) 2>&5
15817   ac_status=$?
15818   echo "$as_me:15818: \$? = $ac_status" >&5
15819   (exit $ac_status); } &&
15820          { ac_try='test -s conftest$ac_exeext'
15821   { (eval echo "$as_me:15821: \"$ac_try\"") >&5
15822   (eval $ac_try) 2>&5
15823   ac_status=$?
15824   echo "$as_me:15824: \$? = $ac_status" >&5
15825   (exit $ac_status); }; }; then
15826   eval "$as_ac_var=yes"
15827 else
15828   echo "$as_me: failed program was:" >&5
15829 cat conftest.$ac_ext >&5
15830 eval "$as_ac_var=no"
15831 fi
15832 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15833 fi
15834 echo "$as_me:15834: result: `eval echo '${'$as_ac_var'}'`" >&5
15835 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
15836 if test `eval echo '${'$as_ac_var'}'` = yes; then
15837   cat >>confdefs.h <<EOF
15838 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
15839 EOF
15840
15841 fi
15842 done
15843
15844 # use a compile-check to work with ncurses*-config and subdirectory includes
15845 echo "$as_me:15845: checking if we can use termcap.h" >&5
15846 echo $ECHO_N "checking if we can use termcap.h... $ECHO_C" >&6
15847 if test "${cf_cv_have_termcap_h+set}" = set; then
15848   echo $ECHO_N "(cached) $ECHO_C" >&6
15849 else
15850
15851         cat >conftest.$ac_ext <<_ACEOF
15852 #line 15852 "configure"
15853 #include "confdefs.h"
15854
15855 #include <curses.h>
15856 #include <termcap.h>
15857
15858 int
15859 main (void)
15860 {
15861 return 0;
15862   ;
15863   return 0;
15864 }
15865 _ACEOF
15866 rm -f conftest.$ac_objext
15867 if { (eval echo "$as_me:15867: \"$ac_compile\"") >&5
15868   (eval $ac_compile) 2>&5
15869   ac_status=$?
15870   echo "$as_me:15870: \$? = $ac_status" >&5
15871   (exit $ac_status); } &&
15872          { ac_try='test -s conftest.$ac_objext'
15873   { (eval echo "$as_me:15873: \"$ac_try\"") >&5
15874   (eval $ac_try) 2>&5
15875   ac_status=$?
15876   echo "$as_me:15876: \$? = $ac_status" >&5
15877   (exit $ac_status); }; }; then
15878   cf_cv_have_termcap_h=yes
15879 else
15880   echo "$as_me: failed program was:" >&5
15881 cat conftest.$ac_ext >&5
15882 cf_cv_have_termcap_h=no
15883 fi
15884 rm -f conftest.$ac_objext conftest.$ac_ext
15885 fi
15886 echo "$as_me:15886: result: $cf_cv_have_termcap_h" >&5
15887 echo "${ECHO_T}$cf_cv_have_termcap_h" >&6
15888 test "x$cf_cv_have_termcap_h" = xyes && cat >>confdefs.h <<\EOF
15889 #define HAVE_TERMCAP_H 1
15890 EOF
15891
15892 if test "x$ac_cv_func_getopt" = xno; then
15893         { { echo "$as_me:15893: error: getopt is required for building programs" >&5
15894 echo "$as_me: error: getopt is required for building programs" >&2;}
15895    { (exit 1); exit 1; }; }
15896 fi
15897
15898 if test "$cf_enable_widec" = yes; then
15899
15900 for ac_func in \
15901 mblen \
15902 mbrlen \
15903 mbrtowc \
15904 mbsrtowcs \
15905 mbstowcs \
15906 mbtowc \
15907 wcsrtombs \
15908 wcstombs \
15909
15910 do
15911 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
15912 echo "$as_me:15912: checking for $ac_func" >&5
15913 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
15914 if eval "test \"\${$as_ac_var+set}\" = set"; then
15915   echo $ECHO_N "(cached) $ECHO_C" >&6
15916 else
15917   cat >conftest.$ac_ext <<_ACEOF
15918 #line 15918 "configure"
15919 #include "confdefs.h"
15920 /* System header to define __stub macros and hopefully few prototypes,
15921     which can conflict with char $ac_func (); below.  */
15922 #include <assert.h>
15923 /* Override any gcc2 internal prototype to avoid an error.  */
15924 #ifdef __cplusplus
15925 extern "C"
15926 #endif
15927 /* We use char because int might match the return type of a gcc2
15928    builtin and then its argument prototype would still apply.  */
15929 char $ac_func ();
15930 char (*f) ();
15931
15932 int
15933 main (void)
15934 {
15935 /* The GNU C library defines this for functions which it implements
15936     to always fail with ENOSYS.  Some functions are actually named
15937     something starting with __ and the normal name is an alias.  */
15938 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
15939 choke me
15940 #else
15941 f = $ac_func; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
15942 #endif
15943
15944   ;
15945   return 0;
15946 }
15947 _ACEOF
15948 rm -f conftest.$ac_objext conftest$ac_exeext
15949 if { (eval echo "$as_me:15949: \"$ac_link\"") >&5
15950   (eval $ac_link) 2>&5
15951   ac_status=$?
15952   echo "$as_me:15952: \$? = $ac_status" >&5
15953   (exit $ac_status); } &&
15954          { ac_try='test -s conftest$ac_exeext'
15955   { (eval echo "$as_me:15955: \"$ac_try\"") >&5
15956   (eval $ac_try) 2>&5
15957   ac_status=$?
15958   echo "$as_me:15958: \$? = $ac_status" >&5
15959   (exit $ac_status); }; }; then
15960   eval "$as_ac_var=yes"
15961 else
15962   echo "$as_me: failed program was:" >&5
15963 cat conftest.$ac_ext >&5
15964 eval "$as_ac_var=no"
15965 fi
15966 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15967 fi
15968 echo "$as_me:15968: result: `eval echo '${'$as_ac_var'}'`" >&5
15969 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
15970 if test `eval echo '${'$as_ac_var'}'` = yes; then
15971   cat >>confdefs.h <<EOF
15972 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
15973 EOF
15974
15975 fi
15976 done
15977
15978 fi
15979
15980 echo "$as_me:15980: checking definition to turn on extended curses functions" >&5
15981 echo $ECHO_N "checking definition to turn on extended curses functions... $ECHO_C" >&6
15982 if test "${cf_cv_need_xopen_extension+set}" = set; then
15983   echo $ECHO_N "(cached) $ECHO_C" >&6
15984 else
15985
15986 cf_cv_need_xopen_extension=unknown
15987 cat >conftest.$ac_ext <<_ACEOF
15988 #line 15988 "configure"
15989 #include "confdefs.h"
15990
15991 #include <stdlib.h>
15992 #include <${cf_cv_ncurses_header:-curses.h}>
15993 int
15994 main (void)
15995 {
15996
15997 #if defined(NCURSES_VERSION_PATCH)
15998 #if (NCURSES_VERSION_PATCH < 20100501) && (NCURSES_VERSION_PATCH >= 20100403)
15999         make an error
16000 #endif
16001 #endif
16002 #ifdef NCURSES_VERSION
16003         cchar_t check;
16004         int check2 = curs_set((int)sizeof(check));
16005 #endif
16006         long x = winnstr(stdscr, "", 0);
16007         int x1, y1;
16008         getbegyx(stdscr, y1, x1)
16009   ;
16010   return 0;
16011 }
16012 _ACEOF
16013 rm -f conftest.$ac_objext conftest$ac_exeext
16014 if { (eval echo "$as_me:16014: \"$ac_link\"") >&5
16015   (eval $ac_link) 2>&5
16016   ac_status=$?
16017   echo "$as_me:16017: \$? = $ac_status" >&5
16018   (exit $ac_status); } &&
16019          { ac_try='test -s conftest$ac_exeext'
16020   { (eval echo "$as_me:16020: \"$ac_try\"") >&5
16021   (eval $ac_try) 2>&5
16022   ac_status=$?
16023   echo "$as_me:16023: \$? = $ac_status" >&5
16024   (exit $ac_status); }; }; then
16025   cf_cv_need_xopen_extension=none
16026 else
16027   echo "$as_me: failed program was:" >&5
16028 cat conftest.$ac_ext >&5
16029
16030         for cf_try_xopen_extension in _XOPEN_SOURCE_EXTENDED NCURSES_WIDECHAR
16031         do
16032                 cat >conftest.$ac_ext <<_ACEOF
16033 #line 16033 "configure"
16034 #include "confdefs.h"
16035
16036 #define $cf_try_xopen_extension 1
16037 #include <stdlib.h>
16038 #include <${cf_cv_ncurses_header:-curses.h}>
16039 int
16040 main (void)
16041 {
16042
16043 #ifdef NCURSES_VERSION
16044                 cchar_t check;
16045                 int check2 = curs_set((int)sizeof(check));
16046 #endif
16047                 long x = winnstr(stdscr, "", 0);
16048                 int x1, y1;
16049                 getbegyx(stdscr, y1, x1)
16050   ;
16051   return 0;
16052 }
16053 _ACEOF
16054 rm -f conftest.$ac_objext conftest$ac_exeext
16055 if { (eval echo "$as_me:16055: \"$ac_link\"") >&5
16056   (eval $ac_link) 2>&5
16057   ac_status=$?
16058   echo "$as_me:16058: \$? = $ac_status" >&5
16059   (exit $ac_status); } &&
16060          { ac_try='test -s conftest$ac_exeext'
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_cv_need_xopen_extension=$cf_try_xopen_extension; break
16067 else
16068   echo "$as_me: failed program was:" >&5
16069 cat conftest.$ac_ext >&5
16070 fi
16071 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16072         done
16073
16074 fi
16075 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16076
16077 fi
16078 echo "$as_me:16078: result: $cf_cv_need_xopen_extension" >&5
16079 echo "${ECHO_T}$cf_cv_need_xopen_extension" >&6
16080
16081 case $cf_cv_need_xopen_extension in
16082 (*_*)
16083         CPPFLAGS="$CPPFLAGS -D$cf_cv_need_xopen_extension"
16084         ;;
16085 esac
16086
16087 echo "$as_me:16087: checking for term.h" >&5
16088 echo $ECHO_N "checking for term.h... $ECHO_C" >&6
16089 if test "${cf_cv_term_header+set}" = set; then
16090   echo $ECHO_N "(cached) $ECHO_C" >&6
16091 else
16092
16093 # If we found <ncurses/curses.h>, look for <ncurses/term.h>, but always look
16094 # for <term.h> if we do not find the variant.
16095
16096 cf_header_list="term.h ncurses/term.h ncursesw/term.h"
16097
16098 case ${cf_cv_ncurses_header:-curses.h} in
16099 (*/*)
16100         cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`term.h
16101         cf_header_list="$cf_header_item $cf_header_list"
16102         ;;
16103 esac
16104
16105 for cf_header in $cf_header_list
16106 do
16107         cat >conftest.$ac_ext <<_ACEOF
16108 #line 16108 "configure"
16109 #include "confdefs.h"
16110
16111 #include <${cf_cv_ncurses_header:-curses.h}>
16112 #include <${cf_header}>
16113 int
16114 main (void)
16115 {
16116 WINDOW *x
16117   ;
16118   return 0;
16119 }
16120 _ACEOF
16121 rm -f conftest.$ac_objext
16122 if { (eval echo "$as_me:16122: \"$ac_compile\"") >&5
16123   (eval $ac_compile) 2>&5
16124   ac_status=$?
16125   echo "$as_me:16125: \$? = $ac_status" >&5
16126   (exit $ac_status); } &&
16127          { ac_try='test -s conftest.$ac_objext'
16128   { (eval echo "$as_me:16128: \"$ac_try\"") >&5
16129   (eval $ac_try) 2>&5
16130   ac_status=$?
16131   echo "$as_me:16131: \$? = $ac_status" >&5
16132   (exit $ac_status); }; }; then
16133   cf_cv_term_header=$cf_header
16134          break
16135 else
16136   echo "$as_me: failed program was:" >&5
16137 cat conftest.$ac_ext >&5
16138 cf_cv_term_header=no
16139 fi
16140 rm -f conftest.$ac_objext conftest.$ac_ext
16141 done
16142
16143 case $cf_cv_term_header in
16144 (no)
16145         # If curses is ncurses, some packagers still mess it up by trying to make
16146         # us use GNU termcap.  This handles the most common case.
16147         for cf_header in ncurses/term.h ncursesw/term.h
16148         do
16149                 cat >conftest.$ac_ext <<_ACEOF
16150 #line 16150 "configure"
16151 #include "confdefs.h"
16152
16153 #include <${cf_cv_ncurses_header:-curses.h}>
16154 #ifdef NCURSES_VERSION
16155 #include <${cf_header}>
16156 #else
16157 make an error
16158 #endif
16159 int
16160 main (void)
16161 {
16162 WINDOW *x
16163   ;
16164   return 0;
16165 }
16166 _ACEOF
16167 rm -f conftest.$ac_objext
16168 if { (eval echo "$as_me:16168: \"$ac_compile\"") >&5
16169   (eval $ac_compile) 2>&5
16170   ac_status=$?
16171   echo "$as_me:16171: \$? = $ac_status" >&5
16172   (exit $ac_status); } &&
16173          { ac_try='test -s conftest.$ac_objext'
16174   { (eval echo "$as_me:16174: \"$ac_try\"") >&5
16175   (eval $ac_try) 2>&5
16176   ac_status=$?
16177   echo "$as_me:16177: \$? = $ac_status" >&5
16178   (exit $ac_status); }; }; then
16179   cf_cv_term_header=$cf_header
16180                          break
16181 else
16182   echo "$as_me: failed program was:" >&5
16183 cat conftest.$ac_ext >&5
16184 cf_cv_term_header=no
16185 fi
16186 rm -f conftest.$ac_objext conftest.$ac_ext
16187         done
16188         ;;
16189 esac
16190
16191 fi
16192 echo "$as_me:16192: result: $cf_cv_term_header" >&5
16193 echo "${ECHO_T}$cf_cv_term_header" >&6
16194
16195 case $cf_cv_term_header in
16196 (term.h)
16197
16198 cat >>confdefs.h <<\EOF
16199 #define HAVE_TERM_H 1
16200 EOF
16201
16202         ;;
16203 (ncurses/term.h)
16204
16205 cat >>confdefs.h <<\EOF
16206 #define HAVE_NCURSES_TERM_H 1
16207 EOF
16208
16209         ;;
16210 (ncursesw/term.h)
16211
16212 cat >>confdefs.h <<\EOF
16213 #define HAVE_NCURSESW_TERM_H 1
16214 EOF
16215
16216         ;;
16217 esac
16218
16219 echo "$as_me:16219: checking for unctrl.h" >&5
16220 echo $ECHO_N "checking for unctrl.h... $ECHO_C" >&6
16221 if test "${cf_cv_unctrl_header+set}" = set; then
16222   echo $ECHO_N "(cached) $ECHO_C" >&6
16223 else
16224
16225 # If we found <ncurses/curses.h>, look for <ncurses/unctrl.h>, but always look
16226 # for <unctrl.h> if we do not find the variant.
16227
16228 cf_header_list="unctrl.h ncurses/unctrl.h ncursesw/unctrl.h"
16229
16230 case ${cf_cv_ncurses_header:-curses.h} in
16231 (*/*)
16232         cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`unctrl.h
16233         cf_header_list="$cf_header_item $cf_header_list"
16234         ;;
16235 esac
16236
16237 for cf_header in $cf_header_list
16238 do
16239         cat >conftest.$ac_ext <<_ACEOF
16240 #line 16240 "configure"
16241 #include "confdefs.h"
16242
16243 #include <${cf_cv_ncurses_header:-curses.h}>
16244 #include <${cf_header}>
16245 int
16246 main (void)
16247 {
16248 WINDOW *x
16249   ;
16250   return 0;
16251 }
16252 _ACEOF
16253 rm -f conftest.$ac_objext
16254 if { (eval echo "$as_me:16254: \"$ac_compile\"") >&5
16255   (eval $ac_compile) 2>&5
16256   ac_status=$?
16257   echo "$as_me:16257: \$? = $ac_status" >&5
16258   (exit $ac_status); } &&
16259          { ac_try='test -s conftest.$ac_objext'
16260   { (eval echo "$as_me:16260: \"$ac_try\"") >&5
16261   (eval $ac_try) 2>&5
16262   ac_status=$?
16263   echo "$as_me:16263: \$? = $ac_status" >&5
16264   (exit $ac_status); }; }; then
16265   cf_cv_unctrl_header=$cf_header
16266          break
16267 else
16268   echo "$as_me: failed program was:" >&5
16269 cat conftest.$ac_ext >&5
16270 cf_cv_unctrl_header=no
16271 fi
16272 rm -f conftest.$ac_objext conftest.$ac_ext
16273 done
16274
16275 fi
16276 echo "$as_me:16276: result: $cf_cv_unctrl_header" >&5
16277 echo "${ECHO_T}$cf_cv_unctrl_header" >&6
16278
16279 case $cf_cv_unctrl_header in
16280 (no)
16281         { echo "$as_me:16281: WARNING: unctrl.h header not found" >&5
16282 echo "$as_me: WARNING: unctrl.h header not found" >&2;}
16283         ;;
16284 esac
16285
16286 case $cf_cv_unctrl_header in
16287 (unctrl.h)
16288
16289 cat >>confdefs.h <<\EOF
16290 #define HAVE_UNCTRL_H 1
16291 EOF
16292
16293         ;;
16294 (ncurses/unctrl.h)
16295
16296 cat >>confdefs.h <<\EOF
16297 #define HAVE_NCURSES_UNCTRL_H 1
16298 EOF
16299
16300         ;;
16301 (ncursesw/unctrl.h)
16302
16303 cat >>confdefs.h <<\EOF
16304 #define HAVE_NCURSESW_UNCTRL_H 1
16305 EOF
16306
16307         ;;
16308 esac
16309
16310 for cf_func in \
16311 alloc_pair \
16312 assume_default_colors \
16313 chgat \
16314 color_content \
16315 color_set \
16316 copywin \
16317 delscreen \
16318 dupwin \
16319 filter \
16320 getbegx \
16321 getcurx \
16322 getmaxx \
16323 getnstr \
16324 getparx \
16325 getwin \
16326 halfdelay \
16327 init_extended_color \
16328 mvderwin \
16329 mvvline \
16330 mvwin \
16331 mvwvline \
16332 napms \
16333 newpad \
16334 putwin \
16335 reset_color_pairs \
16336 resize_term \
16337 resizeterm \
16338 restartterm \
16339 ripoffline \
16340 scr_dump \
16341 setupterm \
16342 slk_color \
16343 slk_init \
16344 termattrs \
16345 tgetent \
16346 tigetnum \
16347 tigetstr \
16348 tputs_sp \
16349 typeahead \
16350 use_default_colors \
16351 use_env \
16352 use_extended_names \
16353 use_screen \
16354 use_window \
16355 vid_puts \
16356 vidputs \
16357 vsscanf \
16358 vw_printw \
16359 wchgat \
16360 winsdelln \
16361 winsstr \
16362 wresize \
16363 wsyncdown \
16364 _tracef \
16365
16366 do
16367
16368 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16369
16370         echo "$as_me:16370: checking for ${cf_func}" >&5
16371 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
16372
16373 echo "${as_me:-configure}:16373: testing ${cf_func} ..." 1>&5
16374
16375         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
16376   echo $ECHO_N "(cached) $ECHO_C" >&6
16377 else
16378
16379                 eval cf_result='$ac_cv_func_'$cf_func
16380                 if test ".$cf_result" != ".no"; then
16381                         cat >conftest.$ac_ext <<_ACEOF
16382 #line 16382 "configure"
16383 #include "confdefs.h"
16384
16385 #ifdef HAVE_XCURSES
16386 #include <xcurses.h>
16387 char * XCursesProgramName = "test";
16388 #else
16389 #include <${cf_cv_ncurses_header:-curses.h}>
16390 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16391 #include <ncursesw/term.h>
16392 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16393 #include <ncurses/term.h>
16394 #elif defined(HAVE_TERM_H)
16395 #include <term.h>
16396 #endif
16397 #endif
16398
16399 int
16400 main (void)
16401 {
16402
16403 #ifndef ${cf_func}
16404 long foo = (long)(&${cf_func});
16405 fprintf(stderr, "testing linkage of $cf_func:%p\n", (void *)foo);
16406 if (foo + 1234L > 5678L)
16407         ${cf_cv_main_return:-return}(foo != 0);
16408 #endif
16409
16410   ;
16411   return 0;
16412 }
16413 _ACEOF
16414 rm -f conftest.$ac_objext conftest$ac_exeext
16415 if { (eval echo "$as_me:16415: \"$ac_link\"") >&5
16416   (eval $ac_link) 2>&5
16417   ac_status=$?
16418   echo "$as_me:16418: \$? = $ac_status" >&5
16419   (exit $ac_status); } &&
16420          { ac_try='test -s conftest$ac_exeext'
16421   { (eval echo "$as_me:16421: \"$ac_try\"") >&5
16422   (eval $ac_try) 2>&5
16423   ac_status=$?
16424   echo "$as_me:16424: \$? = $ac_status" >&5
16425   (exit $ac_status); }; }; then
16426   cf_result=yes
16427 else
16428   echo "$as_me: failed program was:" >&5
16429 cat conftest.$ac_ext >&5
16430 cf_result=no
16431 fi
16432 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16433                 fi
16434                 eval 'cf_cv_func_'$cf_func'=$cf_result'
16435
16436 fi
16437
16438         # use the computed/retrieved cache-value:
16439         eval 'cf_result=$cf_cv_func_'$cf_func
16440         echo "$as_me:16440: result: $cf_result" >&5
16441 echo "${ECHO_T}$cf_result" >&6
16442         if test $cf_result != no; then
16443                 cat >>confdefs.h <<EOF
16444 #define HAVE_${cf_tr_func} 1
16445 EOF
16446
16447         fi
16448 done
16449
16450 for cf_func in tputs
16451 do
16452
16453 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16454
16455         echo "$as_me:16455: checking for ${cf_func}" >&5
16456 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
16457
16458 echo "${as_me:-configure}:16458: testing ${cf_func} ..." 1>&5
16459
16460         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
16461   echo $ECHO_N "(cached) $ECHO_C" >&6
16462 else
16463
16464                 eval cf_result='$ac_cv_func_'$cf_func
16465                 if test ".$cf_result" != ".no"; then
16466                         cat >conftest.$ac_ext <<_ACEOF
16467 #line 16467 "configure"
16468 #include "confdefs.h"
16469
16470 #ifdef HAVE_XCURSES
16471 #include <xcurses.h>
16472 char * XCursesProgramName = "test";
16473 #else
16474 #include <${cf_cv_ncurses_header:-curses.h}>
16475 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16476 #include <ncursesw/term.h>
16477 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16478 #include <ncurses/term.h>
16479 #elif defined(HAVE_TERM_H)
16480 #include <term.h>
16481 #endif
16482 #endif
16483
16484 int
16485 main (void)
16486 {
16487
16488 #ifndef ${cf_func}
16489 long foo = (long)(&${cf_func});
16490 fprintf(stderr, "testing linkage of $cf_func:%p\n", (void *)foo);
16491 if (foo + 1234L > 5678L)
16492         ${cf_cv_main_return:-return}(foo != 0);
16493 #endif
16494
16495   ;
16496   return 0;
16497 }
16498 _ACEOF
16499 rm -f conftest.$ac_objext conftest$ac_exeext
16500 if { (eval echo "$as_me:16500: \"$ac_link\"") >&5
16501   (eval $ac_link) 2>&5
16502   ac_status=$?
16503   echo "$as_me:16503: \$? = $ac_status" >&5
16504   (exit $ac_status); } &&
16505          { ac_try='test -s conftest$ac_exeext'
16506   { (eval echo "$as_me:16506: \"$ac_try\"") >&5
16507   (eval $ac_try) 2>&5
16508   ac_status=$?
16509   echo "$as_me:16509: \$? = $ac_status" >&5
16510   (exit $ac_status); }; }; then
16511   cf_result=yes
16512 else
16513   echo "$as_me: failed program was:" >&5
16514 cat conftest.$ac_ext >&5
16515 cf_result=no
16516 fi
16517 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16518                 fi
16519                 eval 'cf_cv_func_'$cf_func'=$cf_result'
16520
16521 fi
16522
16523         # use the computed/retrieved cache-value:
16524         eval 'cf_result=$cf_cv_func_'$cf_func
16525         echo "$as_me:16525: result: $cf_result" >&5
16526 echo "${ECHO_T}$cf_result" >&6
16527         if test $cf_result != no; then
16528                 cat >>confdefs.h <<EOF
16529 #define HAVE_${cf_tr_func} 1
16530 EOF
16531
16532         fi
16533 done
16534
16535 if test x$cf_cv_func_tputs = xyes
16536 then
16537         cf_done=no
16538         for cf_arg in int char
16539         do
16540                 for cf_ret in int void
16541                 do
16542                         if test $cf_ret = void
16543                         then
16544                                 cf_return="/* nothing */"
16545                         else
16546                                 cf_return="return value"
16547                         fi
16548                         cat >conftest.$ac_ext <<_ACEOF
16549 #line 16549 "configure"
16550 #include "confdefs.h"
16551
16552 #include <${cf_cv_ncurses_header:-curses.h}>
16553 #include <$cf_cv_term_header>
16554
16555 static $cf_ret outc($cf_arg value) { $cf_return; }
16556
16557 int
16558 main (void)
16559 {
16560
16561         tputs("hello", 0, outc);
16562         ${cf_cv_main_return:-return}(0);
16563
16564   ;
16565   return 0;
16566 }
16567 _ACEOF
16568 rm -f conftest.$ac_objext
16569 if { (eval echo "$as_me:16569: \"$ac_compile\"") >&5
16570   (eval $ac_compile) 2>&5
16571   ac_status=$?
16572   echo "$as_me:16572: \$? = $ac_status" >&5
16573   (exit $ac_status); } &&
16574          { ac_try='test -s conftest.$ac_objext'
16575   { (eval echo "$as_me:16575: \"$ac_try\"") >&5
16576   (eval $ac_try) 2>&5
16577   ac_status=$?
16578   echo "$as_me:16578: \$? = $ac_status" >&5
16579   (exit $ac_status); }; }; then
16580
16581                 test -n "$verbose" && echo "    prototype $cf_ret func($cf_arg value)" 1>&6
16582
16583 echo "${as_me:-configure}:16583: testing prototype $cf_ret func($cf_arg value) ..." 1>&5
16584
16585                 cat >>confdefs.h <<EOF
16586 #define TPUTS_ARG               $cf_arg
16587 #define TPUTS_PROTO(func,value) $cf_ret func(TPUTS_ARG value)
16588 #define TPUTS_RETURN(value)     $cf_return
16589 EOF
16590                 cf_done=yes
16591                 break
16592
16593 else
16594   echo "$as_me: failed program was:" >&5
16595 cat conftest.$ac_ext >&5
16596 fi
16597 rm -f conftest.$ac_objext conftest.$ac_ext
16598                 done
16599                 test $cf_done = yes && break
16600         done
16601 fi
16602
16603 echo "$as_me:16603: checking for ncurses extended functions" >&5
16604 echo $ECHO_N "checking for ncurses extended functions... $ECHO_C" >&6
16605 if test "${cf_cv_ncurses_ext_funcs+set}" = set; then
16606   echo $ECHO_N "(cached) $ECHO_C" >&6
16607 else
16608
16609 cat >conftest.$ac_ext <<_ACEOF
16610 #line 16610 "configure"
16611 #include "confdefs.h"
16612
16613 #include <${cf_cv_ncurses_header:-curses.h}>
16614 int
16615 main (void)
16616 {
16617
16618 int x = NCURSES_EXT_FUNCS
16619
16620   ;
16621   return 0;
16622 }
16623 _ACEOF
16624 rm -f conftest.$ac_objext
16625 if { (eval echo "$as_me:16625: \"$ac_compile\"") >&5
16626   (eval $ac_compile) 2>&5
16627   ac_status=$?
16628   echo "$as_me:16628: \$? = $ac_status" >&5
16629   (exit $ac_status); } &&
16630          { ac_try='test -s conftest.$ac_objext'
16631   { (eval echo "$as_me:16631: \"$ac_try\"") >&5
16632   (eval $ac_try) 2>&5
16633   ac_status=$?
16634   echo "$as_me:16634: \$? = $ac_status" >&5
16635   (exit $ac_status); }; }; then
16636   cf_cv_ncurses_ext_funcs=defined
16637 else
16638   echo "$as_me: failed program was:" >&5
16639 cat conftest.$ac_ext >&5
16640
16641 cat >conftest.$ac_ext <<_ACEOF
16642 #line 16642 "configure"
16643 #include "confdefs.h"
16644
16645 #include <${cf_cv_ncurses_header:-curses.h}>
16646 int
16647 main (void)
16648 {
16649
16650         (void) assume_default_colors (0, 0);
16651         (void) curses_version ();
16652         (void) define_key (0, 0);
16653         (void) is_term_resized (0, 0);
16654         (void) key_defined (0);
16655         (void) keybound (0, 0);
16656         (void) keyok (0, 0);
16657         (void) resize_term (0, 0);
16658         (void) resizeterm (0, 0);
16659         (void) use_default_colors ();
16660         (void) use_extended_names (0);
16661         (void) wresize (0, 0, 0);
16662   ;
16663   return 0;
16664 }
16665 _ACEOF
16666 rm -f conftest.$ac_objext conftest$ac_exeext
16667 if { (eval echo "$as_me:16667: \"$ac_link\"") >&5
16668   (eval $ac_link) 2>&5
16669   ac_status=$?
16670   echo "$as_me:16670: \$? = $ac_status" >&5
16671   (exit $ac_status); } &&
16672          { ac_try='test -s conftest$ac_exeext'
16673   { (eval echo "$as_me:16673: \"$ac_try\"") >&5
16674   (eval $ac_try) 2>&5
16675   ac_status=$?
16676   echo "$as_me:16676: \$? = $ac_status" >&5
16677   (exit $ac_status); }; }; then
16678   cf_cv_ncurses_ext_funcs=yes
16679 else
16680   echo "$as_me: failed program was:" >&5
16681 cat conftest.$ac_ext >&5
16682 cf_cv_ncurses_ext_funcs=no
16683 fi
16684 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16685
16686 fi
16687 rm -f conftest.$ac_objext conftest.$ac_ext
16688
16689 fi
16690 echo "$as_me:16690: result: $cf_cv_ncurses_ext_funcs" >&5
16691 echo "${ECHO_T}$cf_cv_ncurses_ext_funcs" >&6
16692 test "$cf_cv_ncurses_ext_funcs" = yes &&
16693 cat >>confdefs.h <<\EOF
16694 #define NCURSES_EXT_FUNCS 1
16695 EOF
16696
16697 if test "$cf_enable_widec" = yes
16698 then
16699         # workaround for systems with ncurses before 20111029, due to change of
16700         # feature test macro from _XPG5 to _XOPEN_SOURCE
16701         if test -n "$cf_cv_ncurses_version" && test "x$cf_cv_ncurses_version" != xno
16702         then
16703                 cf_define_xpg5=no
16704                 echo "$as_me:16704: checking if _XPG5 should be defined to enable wide-characters" >&5
16705 echo $ECHO_N "checking if _XPG5 should be defined to enable wide-characters... $ECHO_C" >&6
16706
16707                 cat >conftest.$ac_ext <<_ACEOF
16708 #line 16708 "configure"
16709 #include "confdefs.h"
16710
16711 #include <${cf_cv_ncurses_header:-curses.h}>
16712 int
16713 main (void)
16714 {
16715 int x = _XPG5
16716   ;
16717   return 0;
16718 }
16719 _ACEOF
16720 rm -f conftest.$ac_objext
16721 if { (eval echo "$as_me:16721: \"$ac_compile\"") >&5
16722   (eval $ac_compile) 2>&5
16723   ac_status=$?
16724   echo "$as_me:16724: \$? = $ac_status" >&5
16725   (exit $ac_status); } &&
16726          { ac_try='test -s conftest.$ac_objext'
16727   { (eval echo "$as_me:16727: \"$ac_try\"") >&5
16728   (eval $ac_try) 2>&5
16729   ac_status=$?
16730   echo "$as_me:16730: \$? = $ac_status" >&5
16731   (exit $ac_status); }; }; then
16732   :
16733 else
16734   echo "$as_me: failed program was:" >&5
16735 cat conftest.$ac_ext >&5
16736 cf_save_cppflags="$CPPFLAGS"
16737                          CPPFLAGS="$CPPFLAGS -D_XPG5"
16738                          cat >conftest.$ac_ext <<_ACEOF
16739 #line 16739 "configure"
16740 #include "confdefs.h"
16741
16742 #include <${cf_cv_ncurses_header:-curses.h}>
16743 int
16744 main (void)
16745 {
16746 int x = _XPG5
16747   ;
16748   return 0;
16749 }
16750 _ACEOF
16751 rm -f conftest.$ac_objext
16752 if { (eval echo "$as_me:16752: \"$ac_compile\"") >&5
16753   (eval $ac_compile) 2>&5
16754   ac_status=$?
16755   echo "$as_me:16755: \$? = $ac_status" >&5
16756   (exit $ac_status); } &&
16757          { ac_try='test -s conftest.$ac_objext'
16758   { (eval echo "$as_me:16758: \"$ac_try\"") >&5
16759   (eval $ac_try) 2>&5
16760   ac_status=$?
16761   echo "$as_me:16761: \$? = $ac_status" >&5
16762   (exit $ac_status); }; }; then
16763   cf_define_xpg5=yes
16764 else
16765   echo "$as_me: failed program was:" >&5
16766 cat conftest.$ac_ext >&5
16767 fi
16768 rm -f conftest.$ac_objext conftest.$ac_ext
16769                          CPPFLAGS="$cf_save_cppflags"
16770 fi
16771 rm -f conftest.$ac_objext conftest.$ac_ext
16772                 echo "$as_me:16772: result: $cf_define_xpg5" >&5
16773 echo "${ECHO_T}$cf_define_xpg5" >&6
16774
16775                 if test "$cf_define_xpg5" = yes
16776                 then
16777                         CPPFLAGS="$CPPFLAGS -D_XPG5"
16778                 fi
16779         fi
16780
16781         echo "$as_me:16781: checking for wide-character functions" >&5
16782 echo $ECHO_N "checking for wide-character functions... $ECHO_C" >&6
16783 if test "${cf_cv_widechar_funcs+set}" = set; then
16784   echo $ECHO_N "(cached) $ECHO_C" >&6
16785 else
16786
16787         cat >conftest.$ac_ext <<_ACEOF
16788 #line 16788 "configure"
16789 #include "confdefs.h"
16790
16791 #include <${cf_cv_ncurses_header:-curses.h}>
16792 int
16793 main (void)
16794 {
16795
16796                 static wchar_t src_wchar[2];
16797                 static cchar_t dst_cchar;
16798                 setcchar(&dst_cchar, src_wchar, A_NORMAL, 0, (void *) 0);
16799
16800   ;
16801   return 0;
16802 }
16803 _ACEOF
16804 rm -f conftest.$ac_objext conftest$ac_exeext
16805 if { (eval echo "$as_me:16805: \"$ac_link\"") >&5
16806   (eval $ac_link) 2>&5
16807   ac_status=$?
16808   echo "$as_me:16808: \$? = $ac_status" >&5
16809   (exit $ac_status); } &&
16810          { ac_try='test -s conftest$ac_exeext'
16811   { (eval echo "$as_me:16811: \"$ac_try\"") >&5
16812   (eval $ac_try) 2>&5
16813   ac_status=$?
16814   echo "$as_me:16814: \$? = $ac_status" >&5
16815   (exit $ac_status); }; }; then
16816   cf_cv_widechar_funcs=yes
16817 else
16818   echo "$as_me: failed program was:" >&5
16819 cat conftest.$ac_ext >&5
16820 cf_cv_widechar_funcs=no
16821 fi
16822 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16823
16824 fi
16825 echo "$as_me:16825: result: $cf_cv_widechar_funcs" >&5
16826 echo "${ECHO_T}$cf_cv_widechar_funcs" >&6
16827         if test "$cf_cv_widechar_funcs" != no ; then
16828
16829 cat >>confdefs.h <<\EOF
16830 #define USE_WIDEC_SUPPORT 1
16831 EOF
16832
16833         else
16834                 cat >>confdefs.h <<\EOF
16835 #define USE_WIDEC_SUPPORT 0
16836 EOF
16837
16838         fi
16839 else
16840         cat >>confdefs.h <<\EOF
16841 #define USE_WIDEC_SUPPORT 0
16842 EOF
16843
16844 fi
16845
16846 echo "$as_me:16846: checking if $cf_cv_screen library uses pthreads" >&5
16847 echo $ECHO_N "checking if $cf_cv_screen library uses pthreads... $ECHO_C" >&6
16848 if test "${cf_cv_use_pthreads+set}" = set; then
16849   echo $ECHO_N "(cached) $ECHO_C" >&6
16850 else
16851
16852 cat >conftest.$ac_ext <<_ACEOF
16853 #line 16853 "configure"
16854 #include "confdefs.h"
16855
16856 #include <${cf_cv_ncurses_header:-curses.h}>
16857 extern void _nc_init_pthreads(void);
16858
16859 int
16860 main (void)
16861 {
16862
16863         initscr();
16864         _nc_init_pthreads();
16865
16866   ;
16867   return 0;
16868 }
16869 _ACEOF
16870 rm -f conftest.$ac_objext conftest$ac_exeext
16871 if { (eval echo "$as_me:16871: \"$ac_link\"") >&5
16872   (eval $ac_link) 2>&5
16873   ac_status=$?
16874   echo "$as_me:16874: \$? = $ac_status" >&5
16875   (exit $ac_status); } &&
16876          { ac_try='test -s conftest$ac_exeext'
16877   { (eval echo "$as_me:16877: \"$ac_try\"") >&5
16878   (eval $ac_try) 2>&5
16879   ac_status=$?
16880   echo "$as_me:16880: \$? = $ac_status" >&5
16881   (exit $ac_status); }; }; then
16882   cf_cv_use_pthreads=yes
16883 else
16884   echo "$as_me: failed program was:" >&5
16885 cat conftest.$ac_ext >&5
16886 cf_cv_use_pthreads=no
16887 fi
16888 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16889
16890 fi
16891 echo "$as_me:16891: result: $cf_cv_use_pthreads" >&5
16892 echo "${ECHO_T}$cf_cv_use_pthreads" >&6
16893 test $cf_cv_use_pthreads = yes && cat >>confdefs.h <<\EOF
16894 #define USE_PTHREADS 1
16895 EOF
16896
16897 echo "$as_me:16897: checking if sys/time.h works with sys/select.h" >&5
16898 echo $ECHO_N "checking if sys/time.h works with sys/select.h... $ECHO_C" >&6
16899 if test "${cf_cv_sys_time_select+set}" = set; then
16900   echo $ECHO_N "(cached) $ECHO_C" >&6
16901 else
16902
16903 cat >conftest.$ac_ext <<_ACEOF
16904 #line 16904 "configure"
16905 #include "confdefs.h"
16906
16907 #include <sys/types.h>
16908 #ifdef HAVE_SYS_TIME_H
16909 #include <sys/time.h>
16910 #endif
16911 #ifdef HAVE_SYS_SELECT_H
16912 #include <sys/select.h>
16913 #endif
16914
16915 int
16916 main (void)
16917 {
16918
16919   ;
16920   return 0;
16921 }
16922 _ACEOF
16923 rm -f conftest.$ac_objext
16924 if { (eval echo "$as_me:16924: \"$ac_compile\"") >&5
16925   (eval $ac_compile) 2>&5
16926   ac_status=$?
16927   echo "$as_me:16927: \$? = $ac_status" >&5
16928   (exit $ac_status); } &&
16929          { ac_try='test -s conftest.$ac_objext'
16930   { (eval echo "$as_me:16930: \"$ac_try\"") >&5
16931   (eval $ac_try) 2>&5
16932   ac_status=$?
16933   echo "$as_me:16933: \$? = $ac_status" >&5
16934   (exit $ac_status); }; }; then
16935   cf_cv_sys_time_select=yes
16936 else
16937   echo "$as_me: failed program was:" >&5
16938 cat conftest.$ac_ext >&5
16939 cf_cv_sys_time_select=no
16940 fi
16941 rm -f conftest.$ac_objext conftest.$ac_ext
16942
16943 fi
16944
16945 echo "$as_me:16945: result: $cf_cv_sys_time_select" >&5
16946 echo "${ECHO_T}$cf_cv_sys_time_select" >&6
16947 test "$cf_cv_sys_time_select" = yes &&
16948 cat >>confdefs.h <<\EOF
16949 #define HAVE_SYS_TIME_SELECT 1
16950 EOF
16951
16952 # special check for test/ditto.c
16953
16954 echo "$as_me:16954: checking for openpty in -lutil" >&5
16955 echo $ECHO_N "checking for openpty in -lutil... $ECHO_C" >&6
16956 if test "${ac_cv_lib_util_openpty+set}" = set; then
16957   echo $ECHO_N "(cached) $ECHO_C" >&6
16958 else
16959   ac_check_lib_save_LIBS=$LIBS
16960 LIBS="-lutil  $LIBS"
16961 cat >conftest.$ac_ext <<_ACEOF
16962 #line 16962 "configure"
16963 #include "confdefs.h"
16964
16965 /* Override any gcc2 internal prototype to avoid an error.  */
16966 #ifdef __cplusplus
16967 extern "C"
16968 #endif
16969 /* We use char because int might match the return type of a gcc2
16970    builtin and then its argument prototype would still apply.  */
16971 char openpty ();
16972 int
16973 main (void)
16974 {
16975 openpty ();
16976   ;
16977   return 0;
16978 }
16979 _ACEOF
16980 rm -f conftest.$ac_objext conftest$ac_exeext
16981 if { (eval echo "$as_me:16981: \"$ac_link\"") >&5
16982   (eval $ac_link) 2>&5
16983   ac_status=$?
16984   echo "$as_me:16984: \$? = $ac_status" >&5
16985   (exit $ac_status); } &&
16986          { ac_try='test -s conftest$ac_exeext'
16987   { (eval echo "$as_me:16987: \"$ac_try\"") >&5
16988   (eval $ac_try) 2>&5
16989   ac_status=$?
16990   echo "$as_me:16990: \$? = $ac_status" >&5
16991   (exit $ac_status); }; }; then
16992   ac_cv_lib_util_openpty=yes
16993 else
16994   echo "$as_me: failed program was:" >&5
16995 cat conftest.$ac_ext >&5
16996 ac_cv_lib_util_openpty=no
16997 fi
16998 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16999 LIBS=$ac_check_lib_save_LIBS
17000 fi
17001 echo "$as_me:17001: result: $ac_cv_lib_util_openpty" >&5
17002 echo "${ECHO_T}$ac_cv_lib_util_openpty" >&6
17003 if test $ac_cv_lib_util_openpty = yes; then
17004   cf_cv_lib_util=yes
17005 else
17006   cf_cv_lib_util=no
17007 fi
17008
17009 echo "$as_me:17009: checking for openpty header" >&5
17010 echo $ECHO_N "checking for openpty header... $ECHO_C" >&6
17011 if test "${cf_cv_func_openpty+set}" = set; then
17012   echo $ECHO_N "(cached) $ECHO_C" >&6
17013 else
17014
17015         cf_save_LIBS="$LIBS"
17016         test $cf_cv_lib_util = yes && {
17017 cf_add_libs="-lutil"
17018 # Filter out duplicates - this happens with badly-designed ".pc" files...
17019 for cf_add_1lib in $LIBS
17020 do
17021         for cf_add_2lib in $cf_add_libs
17022         do
17023                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
17024                 then
17025                         cf_add_1lib=
17026                         break
17027                 fi
17028         done
17029         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
17030 done
17031 LIBS="$cf_add_libs"
17032  }
17033         for cf_header in pty.h libutil.h util.h
17034         do
17035         cat >conftest.$ac_ext <<_ACEOF
17036 #line 17036 "configure"
17037 #include "confdefs.h"
17038
17039 #include <$cf_header>
17040
17041 int
17042 main (void)
17043 {
17044
17045         int x = openpty((int *)0, (int *)0, (char *)0,
17046                                    (struct termios *)0, (struct winsize *)0);
17047
17048   ;
17049   return 0;
17050 }
17051 _ACEOF
17052 rm -f conftest.$ac_objext conftest$ac_exeext
17053 if { (eval echo "$as_me:17053: \"$ac_link\"") >&5
17054   (eval $ac_link) 2>&5
17055   ac_status=$?
17056   echo "$as_me:17056: \$? = $ac_status" >&5
17057   (exit $ac_status); } &&
17058          { ac_try='test -s conftest$ac_exeext'
17059   { (eval echo "$as_me:17059: \"$ac_try\"") >&5
17060   (eval $ac_try) 2>&5
17061   ac_status=$?
17062   echo "$as_me:17062: \$? = $ac_status" >&5
17063   (exit $ac_status); }; }; then
17064
17065                 cf_cv_func_openpty=$cf_header
17066                 break
17067
17068 else
17069   echo "$as_me: failed program was:" >&5
17070 cat conftest.$ac_ext >&5
17071
17072                 cf_cv_func_openpty=no
17073
17074 fi
17075 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17076         done
17077         LIBS="$cf_save_LIBS"
17078
17079 fi
17080 echo "$as_me:17080: result: $cf_cv_func_openpty" >&5
17081 echo "${ECHO_T}$cf_cv_func_openpty" >&6
17082
17083 if test "$cf_cv_func_openpty" != no ; then
17084
17085 cat >>confdefs.h <<EOF
17086 #define USE_OPENPTY_HEADER <$cf_cv_func_openpty>
17087 EOF
17088
17089 cat >>confdefs.h <<\EOF
17090 #define USE_XTERM_PTY 1
17091 EOF
17092
17093         if test "x$cf_cv_lib_util" = xyes ; then
17094
17095 cf_add_libs="-lutil"
17096 # Filter out duplicates - this happens with badly-designed ".pc" files...
17097 for cf_add_1lib in $TEST_LIBS
17098 do
17099         for cf_add_2lib in $cf_add_libs
17100         do
17101                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
17102                 then
17103                         cf_add_1lib=
17104                         break
17105                 fi
17106         done
17107         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
17108 done
17109 TEST_LIBS="$cf_add_libs"
17110
17111         fi
17112 fi
17113
17114 echo "$as_me:17114: checking for function curses_version" >&5
17115 echo $ECHO_N "checking for function curses_version... $ECHO_C" >&6
17116 if test "${cf_cv_func_curses_version+set}" = set; then
17117   echo $ECHO_N "(cached) $ECHO_C" >&6
17118 else
17119
17120 if test "$cross_compiling" = yes; then
17121   cf_cv_func_curses_version=unknown
17122 else
17123   cat >conftest.$ac_ext <<_ACEOF
17124 #line 17124 "configure"
17125 #include "confdefs.h"
17126
17127 #include <${cf_cv_ncurses_header:-curses.h}>
17128 int main(void)
17129 {
17130         char temp[1024];
17131         sprintf(temp, "%s\n", curses_version());
17132         ${cf_cv_main_return:-return}(0);
17133 }
17134
17135 _ACEOF
17136 rm -f conftest$ac_exeext
17137 if { (eval echo "$as_me:17137: \"$ac_link\"") >&5
17138   (eval $ac_link) 2>&5
17139   ac_status=$?
17140   echo "$as_me:17140: \$? = $ac_status" >&5
17141   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
17142   { (eval echo "$as_me:17142: \"$ac_try\"") >&5
17143   (eval $ac_try) 2>&5
17144   ac_status=$?
17145   echo "$as_me:17145: \$? = $ac_status" >&5
17146   (exit $ac_status); }; }; then
17147   cf_cv_func_curses_version=yes
17148
17149 else
17150   echo "$as_me: program exited with status $ac_status" >&5
17151 echo "$as_me: failed program was:" >&5
17152 cat conftest.$ac_ext >&5
17153 cf_cv_func_curses_version=no
17154
17155 fi
17156 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
17157 fi
17158 rm -f core
17159 fi
17160 echo "$as_me:17160: result: $cf_cv_func_curses_version" >&5
17161 echo "${ECHO_T}$cf_cv_func_curses_version" >&6
17162 test "$cf_cv_func_curses_version" = yes &&
17163 cat >>confdefs.h <<\EOF
17164 #define HAVE_CURSES_VERSION 1
17165 EOF
17166
17167 echo "$as_me:17167: checking for alternate character set array" >&5
17168 echo $ECHO_N "checking for alternate character set array... $ECHO_C" >&6
17169 if test "${cf_cv_curses_acs_map+set}" = set; then
17170   echo $ECHO_N "(cached) $ECHO_C" >&6
17171 else
17172
17173 cf_cv_curses_acs_map=unknown
17174 for name in acs_map _acs_map __acs_map ${NCURSES_WRAP_PREFIX}acs_map
17175 do
17176 cat >conftest.$ac_ext <<_ACEOF
17177 #line 17177 "configure"
17178 #include "confdefs.h"
17179
17180 #include <${cf_cv_ncurses_header:-curses.h}>
17181
17182 int
17183 main (void)
17184 {
17185
17186 $name['k'] = ACS_PLUS
17187
17188   ;
17189   return 0;
17190 }
17191 _ACEOF
17192 rm -f conftest.$ac_objext conftest$ac_exeext
17193 if { (eval echo "$as_me:17193: \"$ac_link\"") >&5
17194   (eval $ac_link) 2>&5
17195   ac_status=$?
17196   echo "$as_me:17196: \$? = $ac_status" >&5
17197   (exit $ac_status); } &&
17198          { ac_try='test -s conftest$ac_exeext'
17199   { (eval echo "$as_me:17199: \"$ac_try\"") >&5
17200   (eval $ac_try) 2>&5
17201   ac_status=$?
17202   echo "$as_me:17202: \$? = $ac_status" >&5
17203   (exit $ac_status); }; }; then
17204   cf_cv_curses_acs_map=$name; break
17205 else
17206   echo "$as_me: failed program was:" >&5
17207 cat conftest.$ac_ext >&5
17208 fi
17209 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17210 done
17211
17212 fi
17213 echo "$as_me:17213: result: $cf_cv_curses_acs_map" >&5
17214 echo "${ECHO_T}$cf_cv_curses_acs_map" >&6
17215
17216 test "$cf_cv_curses_acs_map" != unknown &&
17217 cat >>confdefs.h <<EOF
17218 #define CURSES_ACS_ARRAY $cf_cv_curses_acs_map
17219 EOF
17220
17221 if test "$cf_enable_widec" = yes; then
17222
17223 echo "$as_me:17223: checking for wide alternate character set array" >&5
17224 echo $ECHO_N "checking for wide alternate character set array... $ECHO_C" >&6
17225 if test "${cf_cv_curses_wacs_map+set}" = set; then
17226   echo $ECHO_N "(cached) $ECHO_C" >&6
17227 else
17228
17229         cf_cv_curses_wacs_map=unknown
17230         for name in wacs_map _wacs_map __wacs_map _nc_wacs _wacs_char
17231         do
17232         cat >conftest.$ac_ext <<_ACEOF
17233 #line 17233 "configure"
17234 #include "confdefs.h"
17235
17236 #ifndef _XOPEN_SOURCE_EXTENDED
17237 #define _XOPEN_SOURCE_EXTENDED
17238 #endif
17239 #include <${cf_cv_ncurses_header:-curses.h}>
17240 int
17241 main (void)
17242 {
17243 void *foo = &($name['k'])
17244   ;
17245   return 0;
17246 }
17247 _ACEOF
17248 rm -f conftest.$ac_objext conftest$ac_exeext
17249 if { (eval echo "$as_me:17249: \"$ac_link\"") >&5
17250   (eval $ac_link) 2>&5
17251   ac_status=$?
17252   echo "$as_me:17252: \$? = $ac_status" >&5
17253   (exit $ac_status); } &&
17254          { ac_try='test -s conftest$ac_exeext'
17255   { (eval echo "$as_me:17255: \"$ac_try\"") >&5
17256   (eval $ac_try) 2>&5
17257   ac_status=$?
17258   echo "$as_me:17258: \$? = $ac_status" >&5
17259   (exit $ac_status); }; }; then
17260   cf_cv_curses_wacs_map=$name
17261          break
17262 else
17263   echo "$as_me: failed program was:" >&5
17264 cat conftest.$ac_ext >&5
17265 fi
17266 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17267         done
17268 fi
17269 echo "$as_me:17269: result: $cf_cv_curses_wacs_map" >&5
17270 echo "${ECHO_T}$cf_cv_curses_wacs_map" >&6
17271
17272 test "$cf_cv_curses_wacs_map" != unknown &&
17273 cat >>confdefs.h <<EOF
17274 #define CURSES_WACS_ARRAY $cf_cv_curses_wacs_map
17275 EOF
17276
17277 echo "$as_me:17277: checking for wide alternate character constants" >&5
17278 echo $ECHO_N "checking for wide alternate character constants... $ECHO_C" >&6
17279 if test "${cf_cv_curses_wacs_symbols+set}" = set; then
17280   echo $ECHO_N "(cached) $ECHO_C" >&6
17281 else
17282
17283 cf_cv_curses_wacs_symbols=no
17284 if test "$cf_cv_curses_wacs_map" != unknown
17285 then
17286         cat >conftest.$ac_ext <<_ACEOF
17287 #line 17287 "configure"
17288 #include "confdefs.h"
17289
17290 #ifndef _XOPEN_SOURCE_EXTENDED
17291 #define _XOPEN_SOURCE_EXTENDED
17292 #endif
17293 #include <${cf_cv_ncurses_header:-curses.h}>
17294 int
17295 main (void)
17296 {
17297 cchar_t *foo = WACS_PLUS;
17298          $cf_cv_curses_wacs_map['k'] = *WACS_PLUS
17299   ;
17300   return 0;
17301 }
17302 _ACEOF
17303 rm -f conftest.$ac_objext conftest$ac_exeext
17304 if { (eval echo "$as_me:17304: \"$ac_link\"") >&5
17305   (eval $ac_link) 2>&5
17306   ac_status=$?
17307   echo "$as_me:17307: \$? = $ac_status" >&5
17308   (exit $ac_status); } &&
17309          { ac_try='test -s conftest$ac_exeext'
17310   { (eval echo "$as_me:17310: \"$ac_try\"") >&5
17311   (eval $ac_try) 2>&5
17312   ac_status=$?
17313   echo "$as_me:17313: \$? = $ac_status" >&5
17314   (exit $ac_status); }; }; then
17315   cf_cv_curses_wacs_symbols=yes
17316 else
17317   echo "$as_me: failed program was:" >&5
17318 cat conftest.$ac_ext >&5
17319 fi
17320 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17321 else
17322         cat >conftest.$ac_ext <<_ACEOF
17323 #line 17323 "configure"
17324 #include "confdefs.h"
17325
17326 #ifndef _XOPEN_SOURCE_EXTENDED
17327 #define _XOPEN_SOURCE_EXTENDED
17328 #endif
17329 #include <${cf_cv_ncurses_header:-curses.h}>
17330 int
17331 main (void)
17332 {
17333 cchar_t *foo = WACS_PLUS
17334   ;
17335   return 0;
17336 }
17337 _ACEOF
17338 rm -f conftest.$ac_objext conftest$ac_exeext
17339 if { (eval echo "$as_me:17339: \"$ac_link\"") >&5
17340   (eval $ac_link) 2>&5
17341   ac_status=$?
17342   echo "$as_me:17342: \$? = $ac_status" >&5
17343   (exit $ac_status); } &&
17344          { ac_try='test -s conftest$ac_exeext'
17345   { (eval echo "$as_me:17345: \"$ac_try\"") >&5
17346   (eval $ac_try) 2>&5
17347   ac_status=$?
17348   echo "$as_me:17348: \$? = $ac_status" >&5
17349   (exit $ac_status); }; }; then
17350   cf_cv_curses_wacs_symbols=yes
17351 else
17352   echo "$as_me: failed program was:" >&5
17353 cat conftest.$ac_ext >&5
17354 fi
17355 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17356 fi
17357
17358 fi
17359 echo "$as_me:17359: result: $cf_cv_curses_wacs_symbols" >&5
17360 echo "${ECHO_T}$cf_cv_curses_wacs_symbols" >&6
17361
17362 test "$cf_cv_curses_wacs_symbols" != no &&
17363 cat >>confdefs.h <<\EOF
17364 #define CURSES_WACS_SYMBOLS 1
17365 EOF
17366
17367 fi
17368
17369 echo "$as_me:17369: checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}" >&5
17370 echo $ECHO_N "checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
17371 cat >conftest.$ac_ext <<_ACEOF
17372 #line 17372 "configure"
17373 #include "confdefs.h"
17374
17375 #ifndef _XOPEN_SOURCE_EXTENDED
17376 #define _XOPEN_SOURCE_EXTENDED
17377 #endif
17378 #include <${cf_cv_ncurses_header:-curses.h}>
17379 int
17380 main (void)
17381 {
17382
17383 attr_t foo
17384
17385   ;
17386   return 0;
17387 }
17388 _ACEOF
17389 rm -f conftest.$ac_objext
17390 if { (eval echo "$as_me:17390: \"$ac_compile\"") >&5
17391   (eval $ac_compile) 2>&5
17392   ac_status=$?
17393   echo "$as_me:17393: \$? = $ac_status" >&5
17394   (exit $ac_status); } &&
17395          { ac_try='test -s conftest.$ac_objext'
17396   { (eval echo "$as_me:17396: \"$ac_try\"") >&5
17397   (eval $ac_try) 2>&5
17398   ac_status=$?
17399   echo "$as_me:17399: \$? = $ac_status" >&5
17400   (exit $ac_status); }; }; then
17401   cf_result=yes
17402 else
17403   echo "$as_me: failed program was:" >&5
17404 cat conftest.$ac_ext >&5
17405 cf_result=no
17406 fi
17407 rm -f conftest.$ac_objext conftest.$ac_ext
17408 echo "$as_me:17408: result: $cf_result" >&5
17409 echo "${ECHO_T}$cf_result" >&6
17410 if test $cf_result = yes ; then
17411
17412 cf_result=`echo "have_type_attr_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17413
17414 cat >>confdefs.h <<EOF
17415 #define $cf_result 1
17416 EOF
17417
17418 else
17419
17420 cat >>confdefs.h <<EOF
17421 #define attr_t long
17422 EOF
17423
17424 fi
17425
17426 if test "$cf_enable_widec" = yes; then
17427
17428 # This is needed on Tru64 5.0 to declare mbstate_t
17429 echo "$as_me:17429: checking if we must include wchar.h to declare mbstate_t" >&5
17430 echo $ECHO_N "checking if we must include wchar.h to declare mbstate_t... $ECHO_C" >&6
17431 if test "${cf_cv_mbstate_t+set}" = set; then
17432   echo $ECHO_N "(cached) $ECHO_C" >&6
17433 else
17434
17435 cat >conftest.$ac_ext <<_ACEOF
17436 #line 17436 "configure"
17437 #include "confdefs.h"
17438
17439 #include <stdlib.h>
17440 #include <stdarg.h>
17441 #include <stdio.h>
17442 #ifdef HAVE_LIBUTF8_H
17443 #include <libutf8.h>
17444 #endif
17445 int
17446 main (void)
17447 {
17448 mbstate_t state
17449   ;
17450   return 0;
17451 }
17452 _ACEOF
17453 rm -f conftest.$ac_objext
17454 if { (eval echo "$as_me:17454: \"$ac_compile\"") >&5
17455   (eval $ac_compile) 2>&5
17456   ac_status=$?
17457   echo "$as_me:17457: \$? = $ac_status" >&5
17458   (exit $ac_status); } &&
17459          { ac_try='test -s conftest.$ac_objext'
17460   { (eval echo "$as_me:17460: \"$ac_try\"") >&5
17461   (eval $ac_try) 2>&5
17462   ac_status=$?
17463   echo "$as_me:17463: \$? = $ac_status" >&5
17464   (exit $ac_status); }; }; then
17465   cf_cv_mbstate_t=no
17466 else
17467   echo "$as_me: failed program was:" >&5
17468 cat conftest.$ac_ext >&5
17469 cat >conftest.$ac_ext <<_ACEOF
17470 #line 17470 "configure"
17471 #include "confdefs.h"
17472
17473 #include <stdlib.h>
17474 #include <stdarg.h>
17475 #include <stdio.h>
17476 #include <wchar.h>
17477 #ifdef HAVE_LIBUTF8_H
17478 #include <libutf8.h>
17479 #endif
17480 int
17481 main (void)
17482 {
17483 mbstate_t value
17484   ;
17485   return 0;
17486 }
17487 _ACEOF
17488 rm -f conftest.$ac_objext
17489 if { (eval echo "$as_me:17489: \"$ac_compile\"") >&5
17490   (eval $ac_compile) 2>&5
17491   ac_status=$?
17492   echo "$as_me:17492: \$? = $ac_status" >&5
17493   (exit $ac_status); } &&
17494          { ac_try='test -s conftest.$ac_objext'
17495   { (eval echo "$as_me:17495: \"$ac_try\"") >&5
17496   (eval $ac_try) 2>&5
17497   ac_status=$?
17498   echo "$as_me:17498: \$? = $ac_status" >&5
17499   (exit $ac_status); }; }; then
17500   cf_cv_mbstate_t=yes
17501 else
17502   echo "$as_me: failed program was:" >&5
17503 cat conftest.$ac_ext >&5
17504 cf_cv_mbstate_t=unknown
17505 fi
17506 rm -f conftest.$ac_objext conftest.$ac_ext
17507 fi
17508 rm -f conftest.$ac_objext conftest.$ac_ext
17509 fi
17510 echo "$as_me:17510: result: $cf_cv_mbstate_t" >&5
17511 echo "${ECHO_T}$cf_cv_mbstate_t" >&6
17512
17513 if test "$cf_cv_mbstate_t" = yes ; then
17514
17515 cat >>confdefs.h <<\EOF
17516 #define NEED_WCHAR_H 1
17517 EOF
17518
17519         NEED_WCHAR_H=1
17520 fi
17521
17522 # if we do not find mbstate_t in either place, use substitution to provide a fallback.
17523 if test "$cf_cv_mbstate_t" = unknown ; then
17524         NCURSES_MBSTATE_T=1
17525 fi
17526
17527 # if we find mbstate_t in either place, use substitution to provide a fallback.
17528 if test "$cf_cv_mbstate_t" != unknown ; then
17529         NCURSES_OK_MBSTATE_T=1
17530 fi
17531
17532 # This is needed on Tru64 5.0 to declare wchar_t
17533 echo "$as_me:17533: checking if we must include wchar.h to declare wchar_t" >&5
17534 echo $ECHO_N "checking if we must include wchar.h to declare wchar_t... $ECHO_C" >&6
17535 if test "${cf_cv_wchar_t+set}" = set; then
17536   echo $ECHO_N "(cached) $ECHO_C" >&6
17537 else
17538
17539 cat >conftest.$ac_ext <<_ACEOF
17540 #line 17540 "configure"
17541 #include "confdefs.h"
17542
17543 #include <stdlib.h>
17544 #include <stdarg.h>
17545 #include <stdio.h>
17546 #ifdef HAVE_LIBUTF8_H
17547 #include <libutf8.h>
17548 #endif
17549 int
17550 main (void)
17551 {
17552 wchar_t state
17553   ;
17554   return 0;
17555 }
17556 _ACEOF
17557 rm -f conftest.$ac_objext
17558 if { (eval echo "$as_me:17558: \"$ac_compile\"") >&5
17559   (eval $ac_compile) 2>&5
17560   ac_status=$?
17561   echo "$as_me:17561: \$? = $ac_status" >&5
17562   (exit $ac_status); } &&
17563          { ac_try='test -s conftest.$ac_objext'
17564   { (eval echo "$as_me:17564: \"$ac_try\"") >&5
17565   (eval $ac_try) 2>&5
17566   ac_status=$?
17567   echo "$as_me:17567: \$? = $ac_status" >&5
17568   (exit $ac_status); }; }; then
17569   cf_cv_wchar_t=no
17570 else
17571   echo "$as_me: failed program was:" >&5
17572 cat conftest.$ac_ext >&5
17573 cat >conftest.$ac_ext <<_ACEOF
17574 #line 17574 "configure"
17575 #include "confdefs.h"
17576
17577 #include <stdlib.h>
17578 #include <stdarg.h>
17579 #include <stdio.h>
17580 #include <wchar.h>
17581 #ifdef HAVE_LIBUTF8_H
17582 #include <libutf8.h>
17583 #endif
17584 int
17585 main (void)
17586 {
17587 wchar_t value
17588   ;
17589   return 0;
17590 }
17591 _ACEOF
17592 rm -f conftest.$ac_objext
17593 if { (eval echo "$as_me:17593: \"$ac_compile\"") >&5
17594   (eval $ac_compile) 2>&5
17595   ac_status=$?
17596   echo "$as_me:17596: \$? = $ac_status" >&5
17597   (exit $ac_status); } &&
17598          { ac_try='test -s conftest.$ac_objext'
17599   { (eval echo "$as_me:17599: \"$ac_try\"") >&5
17600   (eval $ac_try) 2>&5
17601   ac_status=$?
17602   echo "$as_me:17602: \$? = $ac_status" >&5
17603   (exit $ac_status); }; }; then
17604   cf_cv_wchar_t=yes
17605 else
17606   echo "$as_me: failed program was:" >&5
17607 cat conftest.$ac_ext >&5
17608 cf_cv_wchar_t=unknown
17609 fi
17610 rm -f conftest.$ac_objext conftest.$ac_ext
17611 fi
17612 rm -f conftest.$ac_objext conftest.$ac_ext
17613 fi
17614 echo "$as_me:17614: result: $cf_cv_wchar_t" >&5
17615 echo "${ECHO_T}$cf_cv_wchar_t" >&6
17616
17617 if test "$cf_cv_wchar_t" = yes ; then
17618
17619 cat >>confdefs.h <<\EOF
17620 #define NEED_WCHAR_H 1
17621 EOF
17622
17623         NEED_WCHAR_H=1
17624 fi
17625
17626 # if we do not find wchar_t in either place, use substitution to provide a fallback.
17627 if test "$cf_cv_wchar_t" = unknown ; then
17628         NCURSES_WCHAR_T=1
17629 fi
17630
17631 # if we find wchar_t in either place, use substitution to provide a fallback.
17632 if test "$cf_cv_wchar_t" != unknown ; then
17633         NCURSES_OK_WCHAR_T=1
17634 fi
17635
17636 # This is needed on Tru64 5.0 to declare wint_t
17637 echo "$as_me:17637: checking if we must include wchar.h to declare wint_t" >&5
17638 echo $ECHO_N "checking if we must include wchar.h to declare wint_t... $ECHO_C" >&6
17639 if test "${cf_cv_wint_t+set}" = set; then
17640   echo $ECHO_N "(cached) $ECHO_C" >&6
17641 else
17642
17643 cat >conftest.$ac_ext <<_ACEOF
17644 #line 17644 "configure"
17645 #include "confdefs.h"
17646
17647 #include <stdlib.h>
17648 #include <stdarg.h>
17649 #include <stdio.h>
17650 #ifdef HAVE_LIBUTF8_H
17651 #include <libutf8.h>
17652 #endif
17653 int
17654 main (void)
17655 {
17656 wint_t state
17657   ;
17658   return 0;
17659 }
17660 _ACEOF
17661 rm -f conftest.$ac_objext
17662 if { (eval echo "$as_me:17662: \"$ac_compile\"") >&5
17663   (eval $ac_compile) 2>&5
17664   ac_status=$?
17665   echo "$as_me:17665: \$? = $ac_status" >&5
17666   (exit $ac_status); } &&
17667          { ac_try='test -s conftest.$ac_objext'
17668   { (eval echo "$as_me:17668: \"$ac_try\"") >&5
17669   (eval $ac_try) 2>&5
17670   ac_status=$?
17671   echo "$as_me:17671: \$? = $ac_status" >&5
17672   (exit $ac_status); }; }; then
17673   cf_cv_wint_t=no
17674 else
17675   echo "$as_me: failed program was:" >&5
17676 cat conftest.$ac_ext >&5
17677 cat >conftest.$ac_ext <<_ACEOF
17678 #line 17678 "configure"
17679 #include "confdefs.h"
17680
17681 #include <stdlib.h>
17682 #include <stdarg.h>
17683 #include <stdio.h>
17684 #include <wchar.h>
17685 #ifdef HAVE_LIBUTF8_H
17686 #include <libutf8.h>
17687 #endif
17688 int
17689 main (void)
17690 {
17691 wint_t value
17692   ;
17693   return 0;
17694 }
17695 _ACEOF
17696 rm -f conftest.$ac_objext
17697 if { (eval echo "$as_me:17697: \"$ac_compile\"") >&5
17698   (eval $ac_compile) 2>&5
17699   ac_status=$?
17700   echo "$as_me:17700: \$? = $ac_status" >&5
17701   (exit $ac_status); } &&
17702          { ac_try='test -s conftest.$ac_objext'
17703   { (eval echo "$as_me:17703: \"$ac_try\"") >&5
17704   (eval $ac_try) 2>&5
17705   ac_status=$?
17706   echo "$as_me:17706: \$? = $ac_status" >&5
17707   (exit $ac_status); }; }; then
17708   cf_cv_wint_t=yes
17709 else
17710   echo "$as_me: failed program was:" >&5
17711 cat conftest.$ac_ext >&5
17712 cf_cv_wint_t=unknown
17713 fi
17714 rm -f conftest.$ac_objext conftest.$ac_ext
17715 fi
17716 rm -f conftest.$ac_objext conftest.$ac_ext
17717 fi
17718 echo "$as_me:17718: result: $cf_cv_wint_t" >&5
17719 echo "${ECHO_T}$cf_cv_wint_t" >&6
17720
17721 if test "$cf_cv_wint_t" = yes ; then
17722
17723 cat >>confdefs.h <<\EOF
17724 #define NEED_WCHAR_H 1
17725 EOF
17726
17727         NEED_WCHAR_H=1
17728 fi
17729
17730 # if we do not find wint_t in either place, use substitution to provide a fallback.
17731 if test "$cf_cv_wint_t" = unknown ; then
17732         NCURSES_WINT_T=1
17733 fi
17734
17735 # if we find wint_t in either place, use substitution to provide a fallback.
17736 if test "$cf_cv_wint_t" != unknown ; then
17737         NCURSES_OK_WINT_T=1
17738 fi
17739
17740         if test "$NCURSES_OK_MBSTATE_T" = 0 ; then
17741
17742 echo "$as_me:17742: checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}" >&5
17743 echo $ECHO_N "checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
17744 cat >conftest.$ac_ext <<_ACEOF
17745 #line 17745 "configure"
17746 #include "confdefs.h"
17747
17748 #ifndef _XOPEN_SOURCE_EXTENDED
17749 #define _XOPEN_SOURCE_EXTENDED
17750 #endif
17751 #include <${cf_cv_ncurses_header:-curses.h}>
17752 int
17753 main (void)
17754 {
17755
17756 mbstate_t foo
17757
17758   ;
17759   return 0;
17760 }
17761 _ACEOF
17762 rm -f conftest.$ac_objext
17763 if { (eval echo "$as_me:17763: \"$ac_compile\"") >&5
17764   (eval $ac_compile) 2>&5
17765   ac_status=$?
17766   echo "$as_me:17766: \$? = $ac_status" >&5
17767   (exit $ac_status); } &&
17768          { ac_try='test -s conftest.$ac_objext'
17769   { (eval echo "$as_me:17769: \"$ac_try\"") >&5
17770   (eval $ac_try) 2>&5
17771   ac_status=$?
17772   echo "$as_me:17772: \$? = $ac_status" >&5
17773   (exit $ac_status); }; }; then
17774   cf_result=yes
17775 else
17776   echo "$as_me: failed program was:" >&5
17777 cat conftest.$ac_ext >&5
17778 cf_result=no
17779 fi
17780 rm -f conftest.$ac_objext conftest.$ac_ext
17781 echo "$as_me:17781: result: $cf_result" >&5
17782 echo "${ECHO_T}$cf_result" >&6
17783 if test $cf_result = yes ; then
17784
17785 cf_result=`echo "have_type_mbstate_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17786
17787 cat >>confdefs.h <<EOF
17788 #define $cf_result 1
17789 EOF
17790
17791 else
17792
17793 cat >>confdefs.h <<EOF
17794 #define mbstate_t long
17795 EOF
17796
17797 fi
17798
17799         fi
17800
17801         if test "$NCURSES_OK_WCHAR_T" = 0 ; then
17802
17803 echo "$as_me:17803: checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}" >&5
17804 echo $ECHO_N "checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
17805 cat >conftest.$ac_ext <<_ACEOF
17806 #line 17806 "configure"
17807 #include "confdefs.h"
17808
17809 #ifndef _XOPEN_SOURCE_EXTENDED
17810 #define _XOPEN_SOURCE_EXTENDED
17811 #endif
17812 #include <${cf_cv_ncurses_header:-curses.h}>
17813 int
17814 main (void)
17815 {
17816
17817 wchar_t foo
17818
17819   ;
17820   return 0;
17821 }
17822 _ACEOF
17823 rm -f conftest.$ac_objext
17824 if { (eval echo "$as_me:17824: \"$ac_compile\"") >&5
17825   (eval $ac_compile) 2>&5
17826   ac_status=$?
17827   echo "$as_me:17827: \$? = $ac_status" >&5
17828   (exit $ac_status); } &&
17829          { ac_try='test -s conftest.$ac_objext'
17830   { (eval echo "$as_me:17830: \"$ac_try\"") >&5
17831   (eval $ac_try) 2>&5
17832   ac_status=$?
17833   echo "$as_me:17833: \$? = $ac_status" >&5
17834   (exit $ac_status); }; }; then
17835   cf_result=yes
17836 else
17837   echo "$as_me: failed program was:" >&5
17838 cat conftest.$ac_ext >&5
17839 cf_result=no
17840 fi
17841 rm -f conftest.$ac_objext conftest.$ac_ext
17842 echo "$as_me:17842: result: $cf_result" >&5
17843 echo "${ECHO_T}$cf_result" >&6
17844 if test $cf_result = yes ; then
17845
17846 cf_result=`echo "have_type_wchar_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17847
17848 cat >>confdefs.h <<EOF
17849 #define $cf_result 1
17850 EOF
17851
17852 else
17853
17854 cat >>confdefs.h <<EOF
17855 #define wchar_t long
17856 EOF
17857
17858 fi
17859
17860         fi
17861
17862         if test "$NCURSES_OK_WINT_T" = 0 ; then
17863
17864 echo "$as_me:17864: checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}" >&5
17865 echo $ECHO_N "checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
17866 cat >conftest.$ac_ext <<_ACEOF
17867 #line 17867 "configure"
17868 #include "confdefs.h"
17869
17870 #ifndef _XOPEN_SOURCE_EXTENDED
17871 #define _XOPEN_SOURCE_EXTENDED
17872 #endif
17873 #include <${cf_cv_ncurses_header:-curses.h}>
17874 int
17875 main (void)
17876 {
17877
17878 wint_t foo
17879
17880   ;
17881   return 0;
17882 }
17883 _ACEOF
17884 rm -f conftest.$ac_objext
17885 if { (eval echo "$as_me:17885: \"$ac_compile\"") >&5
17886   (eval $ac_compile) 2>&5
17887   ac_status=$?
17888   echo "$as_me:17888: \$? = $ac_status" >&5
17889   (exit $ac_status); } &&
17890          { ac_try='test -s conftest.$ac_objext'
17891   { (eval echo "$as_me:17891: \"$ac_try\"") >&5
17892   (eval $ac_try) 2>&5
17893   ac_status=$?
17894   echo "$as_me:17894: \$? = $ac_status" >&5
17895   (exit $ac_status); }; }; then
17896   cf_result=yes
17897 else
17898   echo "$as_me: failed program was:" >&5
17899 cat conftest.$ac_ext >&5
17900 cf_result=no
17901 fi
17902 rm -f conftest.$ac_objext conftest.$ac_ext
17903 echo "$as_me:17903: result: $cf_result" >&5
17904 echo "${ECHO_T}$cf_result" >&6
17905 if test $cf_result = yes ; then
17906
17907 cf_result=`echo "have_type_wint_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17908
17909 cat >>confdefs.h <<EOF
17910 #define $cf_result 1
17911 EOF
17912
17913 else
17914
17915 cat >>confdefs.h <<EOF
17916 #define wint_t long
17917 EOF
17918
17919 fi
17920
17921         fi
17922 fi
17923
17924 for cf_data in \
17925 curscr \
17926 ospeed \
17927 boolnames \
17928 boolfnames \
17929 ttytype
17930 do
17931 echo "$as_me:17931: checking for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
17932 echo $ECHO_N "checking for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
17933
17934 cat >conftest.$ac_ext <<_ACEOF
17935 #line 17935 "configure"
17936 #include "confdefs.h"
17937
17938 #ifdef HAVE_XCURSES
17939 #include <xcurses.h>
17940 char * XCursesProgramName = "test";
17941 #else
17942 #include <${cf_cv_ncurses_header:-curses.h}>
17943 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
17944 #include <ncursesw/term.h>
17945 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
17946 #include <ncurses/term.h>
17947 #elif defined(HAVE_TERM_H)
17948 #include <term.h>
17949 #endif
17950 #endif
17951
17952 int
17953 main (void)
17954 {
17955
17956 void *foo = &($cf_data)
17957
17958   ;
17959   return 0;
17960 }
17961 _ACEOF
17962 rm -f conftest.$ac_objext
17963 if { (eval echo "$as_me:17963: \"$ac_compile\"") >&5
17964   (eval $ac_compile) 2>&5
17965   ac_status=$?
17966   echo "$as_me:17966: \$? = $ac_status" >&5
17967   (exit $ac_status); } &&
17968          { ac_try='test -s conftest.$ac_objext'
17969   { (eval echo "$as_me:17969: \"$ac_try\"") >&5
17970   (eval $ac_try) 2>&5
17971   ac_status=$?
17972   echo "$as_me:17972: \$? = $ac_status" >&5
17973   (exit $ac_status); }; }; then
17974   cf_result=yes
17975
17976 else
17977   echo "$as_me: failed program was:" >&5
17978 cat conftest.$ac_ext >&5
17979 cf_result=no
17980 fi
17981 rm -f conftest.$ac_objext conftest.$ac_ext
17982 echo "$as_me:17982: result: $cf_result" >&5
17983 echo "${ECHO_T}$cf_result" >&6
17984
17985 if test $cf_result = yes ; then
17986
17987 cf_result=`echo "have_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17988
17989         cat >>confdefs.h <<EOF
17990 #define $cf_result 1
17991 EOF
17992
17993 else
17994         echo "$as_me:17994: checking for data $cf_data in library" >&5
17995 echo $ECHO_N "checking for data $cf_data in library... $ECHO_C" >&6
17996         # BSD linkers insist on making weak linkage, but resolve at runtime.
17997         if test "$cross_compiling" = yes; then
17998
17999         # cross-compiling
18000         cat >conftest.$ac_ext <<_ACEOF
18001 #line 18001 "configure"
18002 #include "confdefs.h"
18003
18004 #ifdef HAVE_XCURSES
18005 #include <xcurses.h>
18006 char * XCursesProgramName = "test";
18007 #else
18008 #include <${cf_cv_ncurses_header:-curses.h}>
18009 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
18010 #include <ncursesw/term.h>
18011 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
18012 #include <ncurses/term.h>
18013 #elif defined(HAVE_TERM_H)
18014 #include <term.h>
18015 #endif
18016 #endif
18017
18018 extern char $cf_data;
18019 int
18020 main (void)
18021 {
18022
18023         do {
18024                 void *foo = &($cf_data);
18025                 fprintf(stderr, "testing linkage of $cf_data:%p\n", (void *)foo);
18026                 ${cf_cv_main_return:-return}(foo == 0);
18027         } while (0)
18028
18029   ;
18030   return 0;
18031 }
18032 _ACEOF
18033 rm -f conftest.$ac_objext conftest$ac_exeext
18034 if { (eval echo "$as_me:18034: \"$ac_link\"") >&5
18035   (eval $ac_link) 2>&5
18036   ac_status=$?
18037   echo "$as_me:18037: \$? = $ac_status" >&5
18038   (exit $ac_status); } &&
18039          { ac_try='test -s conftest$ac_exeext'
18040   { (eval echo "$as_me:18040: \"$ac_try\"") >&5
18041   (eval $ac_try) 2>&5
18042   ac_status=$?
18043   echo "$as_me:18043: \$? = $ac_status" >&5
18044   (exit $ac_status); }; }; then
18045   cf_result=yes
18046 else
18047   echo "$as_me: failed program was:" >&5
18048 cat conftest.$ac_ext >&5
18049 cf_result=no
18050 fi
18051 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18052
18053 else
18054   cat >conftest.$ac_ext <<_ACEOF
18055 #line 18055 "configure"
18056 #include "confdefs.h"
18057
18058 #ifdef HAVE_XCURSES
18059 #include <xcurses.h>
18060 char * XCursesProgramName = "test";
18061 #else
18062 #include <${cf_cv_ncurses_header:-curses.h}>
18063 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
18064 #include <ncursesw/term.h>
18065 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
18066 #include <ncurses/term.h>
18067 #elif defined(HAVE_TERM_H)
18068 #include <term.h>
18069 #endif
18070 #endif
18071
18072 extern char $cf_data;
18073 int main(void)
18074 {
18075         void *foo = &($cf_data);
18076         fprintf(stderr, "testing linkage of $cf_data:%p\n", (void *)foo);
18077         ${cf_cv_main_return:-return}(foo == 0);
18078 }
18079 _ACEOF
18080 rm -f conftest$ac_exeext
18081 if { (eval echo "$as_me:18081: \"$ac_link\"") >&5
18082   (eval $ac_link) 2>&5
18083   ac_status=$?
18084   echo "$as_me:18084: \$? = $ac_status" >&5
18085   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
18086   { (eval echo "$as_me:18086: \"$ac_try\"") >&5
18087   (eval $ac_try) 2>&5
18088   ac_status=$?
18089   echo "$as_me:18089: \$? = $ac_status" >&5
18090   (exit $ac_status); }; }; then
18091   cf_result=yes
18092
18093 else
18094   echo "$as_me: program exited with status $ac_status" >&5
18095 echo "$as_me: failed program was:" >&5
18096 cat conftest.$ac_ext >&5
18097 cf_result=no
18098 fi
18099 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
18100 fi
18101         echo "$as_me:18101: result: $cf_result" >&5
18102 echo "${ECHO_T}$cf_result" >&6
18103         if test $cf_result = yes ; then
18104
18105 cf_result=`echo "decl_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
18106
18107                 cat >>confdefs.h <<EOF
18108 #define $cf_result 1
18109 EOF
18110
18111                 # do not exit loop here, since we prefer system's declarations
18112         fi
18113 fi
18114 done
18115
18116 if ( test "$GCC" = yes || test "$GXX" = yes )
18117 then
18118 echo "$as_me:18118: checking if you want to turn on gcc warnings" >&5
18119 echo $ECHO_N "checking if you want to turn on gcc warnings... $ECHO_C" >&6
18120
18121 # Check whether --enable-warnings or --disable-warnings was given.
18122 if test "${enable_warnings+set}" = set; then
18123   enableval="$enable_warnings"
18124   test "$enableval" != yes && enableval=no
18125         if test "$enableval" != "no" ; then
18126     with_warnings=yes
18127         else
18128                 with_warnings=no
18129         fi
18130 else
18131   enableval=no
18132         with_warnings=no
18133
18134 fi;
18135 echo "$as_me:18135: result: $with_warnings" >&5
18136 echo "${ECHO_T}$with_warnings" >&6
18137 if test "$with_warnings" = "yes"
18138 then
18139
18140 if test "$GCC" = yes
18141 then
18142 cat > conftest.i <<EOF
18143 #ifndef GCC_PRINTF
18144 #define GCC_PRINTF 0
18145 #endif
18146 #ifndef GCC_SCANF
18147 #define GCC_SCANF 0
18148 #endif
18149 #ifndef GCC_NORETURN
18150 #define GCC_NORETURN /* nothing */
18151 #endif
18152 #ifndef GCC_UNUSED
18153 #define GCC_UNUSED /* nothing */
18154 #endif
18155 EOF
18156 if test "$GCC" = yes
18157 then
18158         { echo "$as_me:18158: checking for $CC __attribute__ directives..." >&5
18159 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
18160 cat > conftest.$ac_ext <<EOF
18161 #line 18161 "${as_me:-configure}"
18162 #include "confdefs.h"
18163 #include "conftest.h"
18164 #include "conftest.i"
18165 #if     GCC_PRINTF
18166 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
18167 #else
18168 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
18169 #endif
18170 #if     GCC_SCANF
18171 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
18172 #else
18173 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
18174 #endif
18175 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
18176 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
18177 extern void foo(void) GCC_NORETURN;
18178 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
18179 EOF
18180         cf_printf_attribute=no
18181         cf_scanf_attribute=no
18182         for cf_attribute in scanf printf unused noreturn
18183         do
18184
18185 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
18186
18187                 cf_directive="__attribute__(($cf_attribute))"
18188                 echo "checking for $CC $cf_directive" 1>&5
18189
18190                 case $cf_attribute in
18191                 (printf)
18192                         cf_printf_attribute=yes
18193                         cat >conftest.h <<EOF
18194 #define GCC_$cf_ATTRIBUTE 1
18195 EOF
18196                         ;;
18197                 (scanf)
18198                         cf_scanf_attribute=yes
18199                         cat >conftest.h <<EOF
18200 #define GCC_$cf_ATTRIBUTE 1
18201 EOF
18202                         ;;
18203                 (*)
18204                         cat >conftest.h <<EOF
18205 #define GCC_$cf_ATTRIBUTE $cf_directive
18206 EOF
18207                         ;;
18208                 esac
18209
18210                 if { (eval echo "$as_me:18210: \"$ac_compile\"") >&5
18211   (eval $ac_compile) 2>&5
18212   ac_status=$?
18213   echo "$as_me:18213: \$? = $ac_status" >&5
18214   (exit $ac_status); }; then
18215                         test -n "$verbose" && echo "$as_me:18215: result: ... $cf_attribute" >&5
18216 echo "${ECHO_T}... $cf_attribute" >&6
18217                         cat conftest.h >>confdefs.h
18218                         case $cf_attribute in
18219                         (noreturn)
18220
18221 cat >>confdefs.h <<EOF
18222 #define GCC_NORETURN $cf_directive
18223 EOF
18224
18225                                 ;;
18226                         (printf)
18227                                 cf_value='/* nothing */'
18228                                 if test "$cf_printf_attribute" != no ; then
18229                                         cf_value='__attribute__((format(printf,fmt,var)))'
18230
18231 cat >>confdefs.h <<\EOF
18232 #define GCC_PRINTF 1
18233 EOF
18234
18235                                 fi
18236
18237 cat >>confdefs.h <<EOF
18238 #define GCC_PRINTFLIKE(fmt,var) $cf_value
18239 EOF
18240
18241                                 ;;
18242                         (scanf)
18243                                 cf_value='/* nothing */'
18244                                 if test "$cf_scanf_attribute" != no ; then
18245                                         cf_value='__attribute__((format(scanf,fmt,var)))'
18246
18247 cat >>confdefs.h <<\EOF
18248 #define GCC_SCANF 1
18249 EOF
18250
18251                                 fi
18252
18253 cat >>confdefs.h <<EOF
18254 #define GCC_SCANFLIKE(fmt,var) $cf_value
18255 EOF
18256
18257                                 ;;
18258                         (unused)
18259
18260 cat >>confdefs.h <<EOF
18261 #define GCC_UNUSED $cf_directive
18262 EOF
18263
18264                                 ;;
18265                         esac
18266                 fi
18267         done
18268 else
18269         fgrep define conftest.i >>confdefs.h
18270 fi
18271 rm -rf conftest*
18272 fi
18273
18274 INTEL_COMPILER=no
18275
18276 if test "$GCC" = yes ; then
18277         case $host_os in
18278         (linux*|gnu*)
18279                 echo "$as_me:18279: checking if this is really Intel C compiler" >&5
18280 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
18281                 cf_save_CFLAGS="$CFLAGS"
18282                 CFLAGS="$CFLAGS -no-gcc"
18283                 cat >conftest.$ac_ext <<_ACEOF
18284 #line 18284 "configure"
18285 #include "confdefs.h"
18286
18287 int
18288 main (void)
18289 {
18290
18291 #ifdef __INTEL_COMPILER
18292 #else
18293 make an error
18294 #endif
18295
18296   ;
18297   return 0;
18298 }
18299 _ACEOF
18300 rm -f conftest.$ac_objext
18301 if { (eval echo "$as_me:18301: \"$ac_compile\"") >&5
18302   (eval $ac_compile) 2>&5
18303   ac_status=$?
18304   echo "$as_me:18304: \$? = $ac_status" >&5
18305   (exit $ac_status); } &&
18306          { ac_try='test -s conftest.$ac_objext'
18307   { (eval echo "$as_me:18307: \"$ac_try\"") >&5
18308   (eval $ac_try) 2>&5
18309   ac_status=$?
18310   echo "$as_me:18310: \$? = $ac_status" >&5
18311   (exit $ac_status); }; }; then
18312   INTEL_COMPILER=yes
18313 cf_save_CFLAGS="$cf_save_CFLAGS -we147"
18314
18315 else
18316   echo "$as_me: failed program was:" >&5
18317 cat conftest.$ac_ext >&5
18318 fi
18319 rm -f conftest.$ac_objext conftest.$ac_ext
18320                 CFLAGS="$cf_save_CFLAGS"
18321                 echo "$as_me:18321: result: $INTEL_COMPILER" >&5
18322 echo "${ECHO_T}$INTEL_COMPILER" >&6
18323                 ;;
18324         esac
18325 fi
18326
18327 CLANG_COMPILER=no
18328
18329 if test "$GCC" = yes ; then
18330         echo "$as_me:18330: checking if this is really Clang C compiler" >&5
18331 echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6
18332         cf_save_CFLAGS="$CFLAGS"
18333         CFLAGS="$CFLAGS -Qunused-arguments"
18334         cat >conftest.$ac_ext <<_ACEOF
18335 #line 18335 "configure"
18336 #include "confdefs.h"
18337
18338 int
18339 main (void)
18340 {
18341
18342 #ifdef __clang__
18343 #else
18344 make an error
18345 #endif
18346
18347   ;
18348   return 0;
18349 }
18350 _ACEOF
18351 rm -f conftest.$ac_objext
18352 if { (eval echo "$as_me:18352: \"$ac_compile\"") >&5
18353   (eval $ac_compile) 2>&5
18354   ac_status=$?
18355   echo "$as_me:18355: \$? = $ac_status" >&5
18356   (exit $ac_status); } &&
18357          { ac_try='test -s conftest.$ac_objext'
18358   { (eval echo "$as_me:18358: \"$ac_try\"") >&5
18359   (eval $ac_try) 2>&5
18360   ac_status=$?
18361   echo "$as_me:18361: \$? = $ac_status" >&5
18362   (exit $ac_status); }; }; then
18363   CLANG_COMPILER=yes
18364 cf_save_CFLAGS="$cf_save_CFLAGS -Qunused-arguments"
18365
18366 else
18367   echo "$as_me: failed program was:" >&5
18368 cat conftest.$ac_ext >&5
18369 fi
18370 rm -f conftest.$ac_objext conftest.$ac_ext
18371         CFLAGS="$cf_save_CFLAGS"
18372         echo "$as_me:18372: result: $CLANG_COMPILER" >&5
18373 echo "${ECHO_T}$CLANG_COMPILER" >&6
18374 fi
18375
18376 cat > conftest.$ac_ext <<EOF
18377 #line 18377 "${as_me:-configure}"
18378 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
18379 EOF
18380
18381 if test "$INTEL_COMPILER" = yes
18382 then
18383 # The "-wdXXX" options suppress warnings:
18384 # remark #1419: external declaration in primary source file
18385 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
18386 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
18387 # remark #193: zero used for undefined preprocessing identifier
18388 # remark #593: variable "curs_sb_left_arrow" was set but never used
18389 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
18390 # remark #869: parameter "tw" was never referenced
18391 # remark #981: operands are evaluated in unspecified order
18392 # warning #279: controlling expression is constant
18393
18394         { echo "$as_me:18394: checking for $CC warning options..." >&5
18395 echo "$as_me: checking for $CC warning options..." >&6;}
18396         cf_save_CFLAGS="$CFLAGS"
18397         EXTRA_CFLAGS="-Wall"
18398         for cf_opt in \
18399                 wd1419 \
18400                 wd1683 \
18401                 wd1684 \
18402                 wd193 \
18403                 wd593 \
18404                 wd279 \
18405                 wd810 \
18406                 wd869 \
18407                 wd981
18408         do
18409                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
18410                 if { (eval echo "$as_me:18410: \"$ac_compile\"") >&5
18411   (eval $ac_compile) 2>&5
18412   ac_status=$?
18413   echo "$as_me:18413: \$? = $ac_status" >&5
18414   (exit $ac_status); }; then
18415                         test -n "$verbose" && echo "$as_me:18415: result: ... -$cf_opt" >&5
18416 echo "${ECHO_T}... -$cf_opt" >&6
18417                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
18418                 fi
18419         done
18420         CFLAGS="$cf_save_CFLAGS"
18421
18422 elif test "$GCC" = yes
18423 then
18424         { echo "$as_me:18424: checking for $CC warning options..." >&5
18425 echo "$as_me: checking for $CC warning options..." >&6;}
18426         cf_save_CFLAGS="$CFLAGS"
18427         EXTRA_CFLAGS=
18428         cf_warn_CONST=""
18429         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
18430         cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
18431         test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
18432         for cf_opt in W Wall \
18433                 Wbad-function-cast \
18434                 Wcast-align \
18435                 Wcast-qual \
18436                 Wdeclaration-after-statement \
18437                 Wextra \
18438                 Winline \
18439                 Wmissing-declarations \
18440                 Wmissing-prototypes \
18441                 Wnested-externs \
18442                 Wpointer-arith \
18443                 Wshadow \
18444                 Wstrict-prototypes \
18445                 Wundef $cf_gcc_warnings $cf_warn_CONST Wno-unknown-pragmas
18446         do
18447                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
18448                 if { (eval echo "$as_me:18448: \"$ac_compile\"") >&5
18449   (eval $ac_compile) 2>&5
18450   ac_status=$?
18451   echo "$as_me:18451: \$? = $ac_status" >&5
18452   (exit $ac_status); }; then
18453                         test -n "$verbose" && echo "$as_me:18453: result: ... -$cf_opt" >&5
18454 echo "${ECHO_T}... -$cf_opt" >&6
18455                         case $cf_opt in
18456                         (Wcast-qual)
18457                                 CPPFLAGS="$CPPFLAGS -DXTSTRINGDEFINES"
18458                                 ;;
18459                         (Winline)
18460                                 case $GCC_VERSION in
18461                                 ([34].*)
18462                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
18463
18464 echo "${as_me:-configure}:18464: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
18465
18466                                         continue;;
18467                                 esac
18468                                 ;;
18469                         (Wpointer-arith)
18470                                 case $GCC_VERSION in
18471                                 ([12].*)
18472                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
18473
18474 echo "${as_me:-configure}:18474: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
18475
18476                                         continue;;
18477                                 esac
18478                                 ;;
18479                         esac
18480                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
18481                 fi
18482         done
18483         CFLAGS="$cf_save_CFLAGS"
18484 fi
18485 rm -rf conftest*
18486
18487 fi
18488 fi
18489
18490 echo "$as_me:18490: checking if you want to use dmalloc for testing" >&5
18491 echo $ECHO_N "checking if you want to use dmalloc for testing... $ECHO_C" >&6
18492
18493 # Check whether --with-dmalloc or --without-dmalloc was given.
18494 if test "${with_dmalloc+set}" = set; then
18495   withval="$with_dmalloc"
18496
18497 cat >>confdefs.h <<EOF
18498 #define USE_DMALLOC 1
18499 EOF
18500
18501         : ${with_cflags:=-g}
18502         : ${with_no_leaks:=yes}
18503          with_dmalloc=yes
18504 else
18505   with_dmalloc=
18506 fi;
18507 echo "$as_me:18507: result: ${with_dmalloc:-no}" >&5
18508 echo "${ECHO_T}${with_dmalloc:-no}" >&6
18509
18510 case .$with_cflags in
18511 (.*-g*)
18512         case .$CFLAGS in
18513         (.*-g*)
18514                 ;;
18515         (*)
18516
18517 cf_fix_cppflags=no
18518 cf_new_cflags=
18519 cf_new_cppflags=
18520 cf_new_extra_cppflags=
18521
18522 for cf_add_cflags in -g
18523 do
18524 case $cf_fix_cppflags in
18525 (no)
18526         case $cf_add_cflags in
18527         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
18528                 case $cf_add_cflags in
18529                 (-D*)
18530                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
18531
18532                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
18533                                 && test -z "${cf_tst_cflags}" \
18534                                 && cf_fix_cppflags=yes
18535
18536                         if test $cf_fix_cppflags = yes ; then
18537
18538         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
18539         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
18540
18541                                 continue
18542                         elif test "${cf_tst_cflags}" = "\"'" ; then
18543
18544         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
18545         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
18546
18547                                 continue
18548                         fi
18549                         ;;
18550                 esac
18551                 case "$CPPFLAGS" in
18552                 (*$cf_add_cflags)
18553                         ;;
18554                 (*)
18555                         case $cf_add_cflags in
18556                         (-D*)
18557                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
18558
18559 CPPFLAGS=`echo "$CPPFLAGS" | \
18560         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
18561                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
18562
18563                                 ;;
18564                         esac
18565
18566         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
18567         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
18568
18569                         ;;
18570                 esac
18571                 ;;
18572         (*)
18573
18574         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
18575         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
18576
18577                 ;;
18578         esac
18579         ;;
18580 (yes)
18581
18582         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
18583         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
18584
18585         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
18586
18587         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
18588                 && test -z "${cf_tst_cflags}" \
18589                 && cf_fix_cppflags=no
18590         ;;
18591 esac
18592 done
18593
18594 if test -n "$cf_new_cflags" ; then
18595
18596         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
18597         CFLAGS="${CFLAGS}$cf_new_cflags"
18598
18599 fi
18600
18601 if test -n "$cf_new_cppflags" ; then
18602
18603         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
18604         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
18605
18606 fi
18607
18608 if test -n "$cf_new_extra_cppflags" ; then
18609
18610         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
18611         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
18612
18613 fi
18614
18615                 ;;
18616         esac
18617         ;;
18618 esac
18619
18620 if test "$with_dmalloc" = yes ; then
18621         echo "$as_me:18621: checking for dmalloc.h" >&5
18622 echo $ECHO_N "checking for dmalloc.h... $ECHO_C" >&6
18623 if test "${ac_cv_header_dmalloc_h+set}" = set; then
18624   echo $ECHO_N "(cached) $ECHO_C" >&6
18625 else
18626   cat >conftest.$ac_ext <<_ACEOF
18627 #line 18627 "configure"
18628 #include "confdefs.h"
18629 #include <dmalloc.h>
18630 _ACEOF
18631 if { (eval echo "$as_me:18631: \"$ac_cpp conftest.$ac_ext\"") >&5
18632   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
18633   ac_status=$?
18634   egrep -v '^ *\+' conftest.er1 >conftest.err
18635   rm -f conftest.er1
18636   cat conftest.err >&5
18637   echo "$as_me:18637: \$? = $ac_status" >&5
18638   (exit $ac_status); } >/dev/null; then
18639   if test -s conftest.err; then
18640     ac_cpp_err=$ac_c_preproc_warn_flag
18641   else
18642     ac_cpp_err=
18643   fi
18644 else
18645   ac_cpp_err=yes
18646 fi
18647 if test -z "$ac_cpp_err"; then
18648   ac_cv_header_dmalloc_h=yes
18649 else
18650   echo "$as_me: failed program was:" >&5
18651   cat conftest.$ac_ext >&5
18652   ac_cv_header_dmalloc_h=no
18653 fi
18654 rm -f conftest.err conftest.$ac_ext
18655 fi
18656 echo "$as_me:18656: result: $ac_cv_header_dmalloc_h" >&5
18657 echo "${ECHO_T}$ac_cv_header_dmalloc_h" >&6
18658 if test $ac_cv_header_dmalloc_h = yes; then
18659
18660 echo "$as_me:18660: checking for dmalloc_debug in -ldmalloc" >&5
18661 echo $ECHO_N "checking for dmalloc_debug in -ldmalloc... $ECHO_C" >&6
18662 if test "${ac_cv_lib_dmalloc_dmalloc_debug+set}" = set; then
18663   echo $ECHO_N "(cached) $ECHO_C" >&6
18664 else
18665   ac_check_lib_save_LIBS=$LIBS
18666 LIBS="-ldmalloc  $LIBS"
18667 cat >conftest.$ac_ext <<_ACEOF
18668 #line 18668 "configure"
18669 #include "confdefs.h"
18670
18671 /* Override any gcc2 internal prototype to avoid an error.  */
18672 #ifdef __cplusplus
18673 extern "C"
18674 #endif
18675 /* We use char because int might match the return type of a gcc2
18676    builtin and then its argument prototype would still apply.  */
18677 char dmalloc_debug ();
18678 int
18679 main (void)
18680 {
18681 dmalloc_debug ();
18682   ;
18683   return 0;
18684 }
18685 _ACEOF
18686 rm -f conftest.$ac_objext conftest$ac_exeext
18687 if { (eval echo "$as_me:18687: \"$ac_link\"") >&5
18688   (eval $ac_link) 2>&5
18689   ac_status=$?
18690   echo "$as_me:18690: \$? = $ac_status" >&5
18691   (exit $ac_status); } &&
18692          { ac_try='test -s conftest$ac_exeext'
18693   { (eval echo "$as_me:18693: \"$ac_try\"") >&5
18694   (eval $ac_try) 2>&5
18695   ac_status=$?
18696   echo "$as_me:18696: \$? = $ac_status" >&5
18697   (exit $ac_status); }; }; then
18698   ac_cv_lib_dmalloc_dmalloc_debug=yes
18699 else
18700   echo "$as_me: failed program was:" >&5
18701 cat conftest.$ac_ext >&5
18702 ac_cv_lib_dmalloc_dmalloc_debug=no
18703 fi
18704 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18705 LIBS=$ac_check_lib_save_LIBS
18706 fi
18707 echo "$as_me:18707: result: $ac_cv_lib_dmalloc_dmalloc_debug" >&5
18708 echo "${ECHO_T}$ac_cv_lib_dmalloc_dmalloc_debug" >&6
18709 if test $ac_cv_lib_dmalloc_dmalloc_debug = yes; then
18710   cat >>confdefs.h <<EOF
18711 #define HAVE_LIBDMALLOC 1
18712 EOF
18713
18714   LIBS="-ldmalloc $LIBS"
18715
18716 fi
18717
18718 fi
18719
18720 fi
18721
18722 echo "$as_me:18722: checking if you want to use dbmalloc for testing" >&5
18723 echo $ECHO_N "checking if you want to use dbmalloc for testing... $ECHO_C" >&6
18724
18725 # Check whether --with-dbmalloc or --without-dbmalloc was given.
18726 if test "${with_dbmalloc+set}" = set; then
18727   withval="$with_dbmalloc"
18728
18729 cat >>confdefs.h <<EOF
18730 #define USE_DBMALLOC 1
18731 EOF
18732
18733         : ${with_cflags:=-g}
18734         : ${with_no_leaks:=yes}
18735          with_dbmalloc=yes
18736 else
18737   with_dbmalloc=
18738 fi;
18739 echo "$as_me:18739: result: ${with_dbmalloc:-no}" >&5
18740 echo "${ECHO_T}${with_dbmalloc:-no}" >&6
18741
18742 case .$with_cflags in
18743 (.*-g*)
18744         case .$CFLAGS in
18745         (.*-g*)
18746                 ;;
18747         (*)
18748
18749 cf_fix_cppflags=no
18750 cf_new_cflags=
18751 cf_new_cppflags=
18752 cf_new_extra_cppflags=
18753
18754 for cf_add_cflags in -g
18755 do
18756 case $cf_fix_cppflags in
18757 (no)
18758         case $cf_add_cflags in
18759         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
18760                 case $cf_add_cflags in
18761                 (-D*)
18762                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
18763
18764                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
18765                                 && test -z "${cf_tst_cflags}" \
18766                                 && cf_fix_cppflags=yes
18767
18768                         if test $cf_fix_cppflags = yes ; then
18769
18770         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
18771         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
18772
18773                                 continue
18774                         elif test "${cf_tst_cflags}" = "\"'" ; then
18775
18776         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
18777         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
18778
18779                                 continue
18780                         fi
18781                         ;;
18782                 esac
18783                 case "$CPPFLAGS" in
18784                 (*$cf_add_cflags)
18785                         ;;
18786                 (*)
18787                         case $cf_add_cflags in
18788                         (-D*)
18789                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
18790
18791 CPPFLAGS=`echo "$CPPFLAGS" | \
18792         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
18793                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
18794
18795                                 ;;
18796                         esac
18797
18798         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
18799         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
18800
18801                         ;;
18802                 esac
18803                 ;;
18804         (*)
18805
18806         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
18807         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
18808
18809                 ;;
18810         esac
18811         ;;
18812 (yes)
18813
18814         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
18815         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
18816
18817         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
18818
18819         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
18820                 && test -z "${cf_tst_cflags}" \
18821                 && cf_fix_cppflags=no
18822         ;;
18823 esac
18824 done
18825
18826 if test -n "$cf_new_cflags" ; then
18827
18828         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
18829         CFLAGS="${CFLAGS}$cf_new_cflags"
18830
18831 fi
18832
18833 if test -n "$cf_new_cppflags" ; then
18834
18835         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
18836         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
18837
18838 fi
18839
18840 if test -n "$cf_new_extra_cppflags" ; then
18841
18842         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
18843         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
18844
18845 fi
18846
18847                 ;;
18848         esac
18849         ;;
18850 esac
18851
18852 if test "$with_dbmalloc" = yes ; then
18853         echo "$as_me:18853: checking for dbmalloc.h" >&5
18854 echo $ECHO_N "checking for dbmalloc.h... $ECHO_C" >&6
18855 if test "${ac_cv_header_dbmalloc_h+set}" = set; then
18856   echo $ECHO_N "(cached) $ECHO_C" >&6
18857 else
18858   cat >conftest.$ac_ext <<_ACEOF
18859 #line 18859 "configure"
18860 #include "confdefs.h"
18861 #include <dbmalloc.h>
18862 _ACEOF
18863 if { (eval echo "$as_me:18863: \"$ac_cpp conftest.$ac_ext\"") >&5
18864   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
18865   ac_status=$?
18866   egrep -v '^ *\+' conftest.er1 >conftest.err
18867   rm -f conftest.er1
18868   cat conftest.err >&5
18869   echo "$as_me:18869: \$? = $ac_status" >&5
18870   (exit $ac_status); } >/dev/null; then
18871   if test -s conftest.err; then
18872     ac_cpp_err=$ac_c_preproc_warn_flag
18873   else
18874     ac_cpp_err=
18875   fi
18876 else
18877   ac_cpp_err=yes
18878 fi
18879 if test -z "$ac_cpp_err"; then
18880   ac_cv_header_dbmalloc_h=yes
18881 else
18882   echo "$as_me: failed program was:" >&5
18883   cat conftest.$ac_ext >&5
18884   ac_cv_header_dbmalloc_h=no
18885 fi
18886 rm -f conftest.err conftest.$ac_ext
18887 fi
18888 echo "$as_me:18888: result: $ac_cv_header_dbmalloc_h" >&5
18889 echo "${ECHO_T}$ac_cv_header_dbmalloc_h" >&6
18890 if test $ac_cv_header_dbmalloc_h = yes; then
18891
18892 echo "$as_me:18892: checking for debug_malloc in -ldbmalloc" >&5
18893 echo $ECHO_N "checking for debug_malloc in -ldbmalloc... $ECHO_C" >&6
18894 if test "${ac_cv_lib_dbmalloc_debug_malloc+set}" = set; then
18895   echo $ECHO_N "(cached) $ECHO_C" >&6
18896 else
18897   ac_check_lib_save_LIBS=$LIBS
18898 LIBS="-ldbmalloc  $LIBS"
18899 cat >conftest.$ac_ext <<_ACEOF
18900 #line 18900 "configure"
18901 #include "confdefs.h"
18902
18903 /* Override any gcc2 internal prototype to avoid an error.  */
18904 #ifdef __cplusplus
18905 extern "C"
18906 #endif
18907 /* We use char because int might match the return type of a gcc2
18908    builtin and then its argument prototype would still apply.  */
18909 char debug_malloc ();
18910 int
18911 main (void)
18912 {
18913 debug_malloc ();
18914   ;
18915   return 0;
18916 }
18917 _ACEOF
18918 rm -f conftest.$ac_objext conftest$ac_exeext
18919 if { (eval echo "$as_me:18919: \"$ac_link\"") >&5
18920   (eval $ac_link) 2>&5
18921   ac_status=$?
18922   echo "$as_me:18922: \$? = $ac_status" >&5
18923   (exit $ac_status); } &&
18924          { ac_try='test -s conftest$ac_exeext'
18925   { (eval echo "$as_me:18925: \"$ac_try\"") >&5
18926   (eval $ac_try) 2>&5
18927   ac_status=$?
18928   echo "$as_me:18928: \$? = $ac_status" >&5
18929   (exit $ac_status); }; }; then
18930   ac_cv_lib_dbmalloc_debug_malloc=yes
18931 else
18932   echo "$as_me: failed program was:" >&5
18933 cat conftest.$ac_ext >&5
18934 ac_cv_lib_dbmalloc_debug_malloc=no
18935 fi
18936 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18937 LIBS=$ac_check_lib_save_LIBS
18938 fi
18939 echo "$as_me:18939: result: $ac_cv_lib_dbmalloc_debug_malloc" >&5
18940 echo "${ECHO_T}$ac_cv_lib_dbmalloc_debug_malloc" >&6
18941 if test $ac_cv_lib_dbmalloc_debug_malloc = yes; then
18942   cat >>confdefs.h <<EOF
18943 #define HAVE_LIBDBMALLOC 1
18944 EOF
18945
18946   LIBS="-ldbmalloc $LIBS"
18947
18948 fi
18949
18950 fi
18951
18952 fi
18953
18954 echo "$as_me:18954: checking if you want to use valgrind for testing" >&5
18955 echo $ECHO_N "checking if you want to use valgrind for testing... $ECHO_C" >&6
18956
18957 # Check whether --with-valgrind or --without-valgrind was given.
18958 if test "${with_valgrind+set}" = set; then
18959   withval="$with_valgrind"
18960
18961 cat >>confdefs.h <<EOF
18962 #define USE_VALGRIND 1
18963 EOF
18964
18965         : ${with_cflags:=-g}
18966         : ${with_no_leaks:=yes}
18967          with_valgrind=yes
18968 else
18969   with_valgrind=
18970 fi;
18971 echo "$as_me:18971: result: ${with_valgrind:-no}" >&5
18972 echo "${ECHO_T}${with_valgrind:-no}" >&6
18973
18974 case .$with_cflags in
18975 (.*-g*)
18976         case .$CFLAGS in
18977         (.*-g*)
18978                 ;;
18979         (*)
18980
18981 cf_fix_cppflags=no
18982 cf_new_cflags=
18983 cf_new_cppflags=
18984 cf_new_extra_cppflags=
18985
18986 for cf_add_cflags in -g
18987 do
18988 case $cf_fix_cppflags in
18989 (no)
18990         case $cf_add_cflags in
18991         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
18992                 case $cf_add_cflags in
18993                 (-D*)
18994                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
18995
18996                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
18997                                 && test -z "${cf_tst_cflags}" \
18998                                 && cf_fix_cppflags=yes
18999
19000                         if test $cf_fix_cppflags = yes ; then
19001
19002         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
19003         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
19004
19005                                 continue
19006                         elif test "${cf_tst_cflags}" = "\"'" ; then
19007
19008         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
19009         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
19010
19011                                 continue
19012                         fi
19013                         ;;
19014                 esac
19015                 case "$CPPFLAGS" in
19016                 (*$cf_add_cflags)
19017                         ;;
19018                 (*)
19019                         case $cf_add_cflags in
19020                         (-D*)
19021                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
19022
19023 CPPFLAGS=`echo "$CPPFLAGS" | \
19024         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
19025                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
19026
19027                                 ;;
19028                         esac
19029
19030         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
19031         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
19032
19033                         ;;
19034                 esac
19035                 ;;
19036         (*)
19037
19038         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
19039         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
19040
19041                 ;;
19042         esac
19043         ;;
19044 (yes)
19045
19046         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
19047         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
19048
19049         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
19050
19051         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
19052                 && test -z "${cf_tst_cflags}" \
19053                 && cf_fix_cppflags=no
19054         ;;
19055 esac
19056 done
19057
19058 if test -n "$cf_new_cflags" ; then
19059
19060         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
19061         CFLAGS="${CFLAGS}$cf_new_cflags"
19062
19063 fi
19064
19065 if test -n "$cf_new_cppflags" ; then
19066
19067         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
19068         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
19069
19070 fi
19071
19072 if test -n "$cf_new_extra_cppflags" ; then
19073
19074         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
19075         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
19076
19077 fi
19078
19079                 ;;
19080         esac
19081         ;;
19082 esac
19083
19084 echo "$as_me:19084: checking if you want to perform memory-leak testing" >&5
19085 echo $ECHO_N "checking if you want to perform memory-leak testing... $ECHO_C" >&6
19086
19087 # Check whether --enable-leaks or --disable-leaks was given.
19088 if test "${enable_leaks+set}" = set; then
19089   enableval="$enable_leaks"
19090   if test "x$enableval" = xno; then with_no_leaks=yes; else with_no_leaks=no; fi
19091 else
19092   : ${with_no_leaks:=no}
19093 fi;
19094 echo "$as_me:19094: result: $with_no_leaks" >&5
19095 echo "${ECHO_T}$with_no_leaks" >&6
19096
19097 if test "$with_no_leaks" = yes ; then
19098
19099 cat >>confdefs.h <<\EOF
19100 #define NO_LEAKS 1
19101 EOF
19102
19103 cat >>confdefs.h <<\EOF
19104 #define YY_NO_LEAKS 1
19105 EOF
19106
19107 fi
19108
19109 LD_RPATH_OPT=
19110 echo "$as_me:19110: checking for an rpath option" >&5
19111 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
19112 case $cf_cv_system_name in
19113 (irix*)
19114         if test "$GCC" = yes; then
19115                 LD_RPATH_OPT="-Wl,-rpath,"
19116         else
19117                 LD_RPATH_OPT="-rpath "
19118         fi
19119         ;;
19120 (linux*|gnu*|k*bsd*-gnu|freebsd*)
19121         LD_RPATH_OPT="-Wl,-rpath,"
19122         ;;
19123 (openbsd[2-9].*|mirbsd*)
19124         LD_RPATH_OPT="-Wl,-rpath,"
19125         ;;
19126 (dragonfly*)
19127         LD_RPATH_OPT="-rpath "
19128         ;;
19129 (netbsd*)
19130         LD_RPATH_OPT="-Wl,-rpath,"
19131         ;;
19132 (osf*|mls+*)
19133         LD_RPATH_OPT="-rpath "
19134         ;;
19135 (solaris2*)
19136         LD_RPATH_OPT="-R"
19137         ;;
19138 (*)
19139         ;;
19140 esac
19141 echo "$as_me:19141: result: $LD_RPATH_OPT" >&5
19142 echo "${ECHO_T}$LD_RPATH_OPT" >&6
19143
19144 case "x$LD_RPATH_OPT" in
19145 (x-R*)
19146         echo "$as_me:19146: checking if we need a space after rpath option" >&5
19147 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
19148         cf_save_LIBS="$LIBS"
19149
19150 cf_add_libs="${LD_RPATH_OPT}$libdir"
19151 # Filter out duplicates - this happens with badly-designed ".pc" files...
19152 for cf_add_1lib in $LIBS
19153 do
19154         for cf_add_2lib in $cf_add_libs
19155         do
19156                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
19157                 then
19158                         cf_add_1lib=
19159                         break
19160                 fi
19161         done
19162         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
19163 done
19164 LIBS="$cf_add_libs"
19165
19166         cat >conftest.$ac_ext <<_ACEOF
19167 #line 19167 "configure"
19168 #include "confdefs.h"
19169
19170 int
19171 main (void)
19172 {
19173
19174   ;
19175   return 0;
19176 }
19177 _ACEOF
19178 rm -f conftest.$ac_objext conftest$ac_exeext
19179 if { (eval echo "$as_me:19179: \"$ac_link\"") >&5
19180   (eval $ac_link) 2>&5
19181   ac_status=$?
19182   echo "$as_me:19182: \$? = $ac_status" >&5
19183   (exit $ac_status); } &&
19184          { ac_try='test -s conftest$ac_exeext'
19185   { (eval echo "$as_me:19185: \"$ac_try\"") >&5
19186   (eval $ac_try) 2>&5
19187   ac_status=$?
19188   echo "$as_me:19188: \$? = $ac_status" >&5
19189   (exit $ac_status); }; }; then
19190   cf_rpath_space=no
19191 else
19192   echo "$as_me: failed program was:" >&5
19193 cat conftest.$ac_ext >&5
19194 cf_rpath_space=yes
19195 fi
19196 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
19197         LIBS="$cf_save_LIBS"
19198         echo "$as_me:19198: result: $cf_rpath_space" >&5
19199 echo "${ECHO_T}$cf_rpath_space" >&6
19200         test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
19201         ;;
19202 esac
19203
19204 echo "$as_me:19204: checking if rpath-hack should be disabled" >&5
19205 echo $ECHO_N "checking if rpath-hack should be disabled... $ECHO_C" >&6
19206
19207 # Check whether --enable-rpath-hack or --disable-rpath-hack was given.
19208 if test "${enable_rpath_hack+set}" = set; then
19209   enableval="$enable_rpath_hack"
19210   test "$enableval" != no && enableval=yes
19211         if test "$enableval" != "yes" ; then
19212     cf_disable_rpath_hack=yes
19213         else
19214                 cf_disable_rpath_hack=no
19215         fi
19216 else
19217   enableval=yes
19218         cf_disable_rpath_hack=no
19219
19220 fi;
19221 echo "$as_me:19221: result: $cf_disable_rpath_hack" >&5
19222 echo "${ECHO_T}$cf_disable_rpath_hack" >&6
19223 if test "$cf_disable_rpath_hack" = no ; then
19224
19225 echo "$as_me:19225: checking for updated LDFLAGS" >&5
19226 echo $ECHO_N "checking for updated LDFLAGS... $ECHO_C" >&6
19227 if test -n "$LD_RPATH_OPT" ; then
19228         echo "$as_me:19228: result: maybe" >&5
19229 echo "${ECHO_T}maybe" >&6
19230
19231         for ac_prog in ldd
19232 do
19233   # Extract the first word of "$ac_prog", so it can be a program name with args.
19234 set dummy $ac_prog; ac_word=$2
19235 echo "$as_me:19235: checking for $ac_word" >&5
19236 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
19237 if test "${ac_cv_prog_cf_ldd_prog+set}" = set; then
19238   echo $ECHO_N "(cached) $ECHO_C" >&6
19239 else
19240   if test -n "$cf_ldd_prog"; then
19241   ac_cv_prog_cf_ldd_prog="$cf_ldd_prog" # Let the user override the test.
19242 else
19243   ac_save_IFS=$IFS; IFS=$ac_path_separator
19244 ac_dummy="$PATH"
19245 for ac_dir in $ac_dummy; do
19246   IFS=$ac_save_IFS
19247   test -z "$ac_dir" && ac_dir=.
19248   $as_executable_p "$ac_dir/$ac_word" || continue
19249 ac_cv_prog_cf_ldd_prog="$ac_prog"
19250 echo "$as_me:19250: found $ac_dir/$ac_word" >&5
19251 break
19252 done
19253
19254 fi
19255 fi
19256 cf_ldd_prog=$ac_cv_prog_cf_ldd_prog
19257 if test -n "$cf_ldd_prog"; then
19258   echo "$as_me:19258: result: $cf_ldd_prog" >&5
19259 echo "${ECHO_T}$cf_ldd_prog" >&6
19260 else
19261   echo "$as_me:19261: result: no" >&5
19262 echo "${ECHO_T}no" >&6
19263 fi
19264
19265   test -n "$cf_ldd_prog" && break
19266 done
19267 test -n "$cf_ldd_prog" || cf_ldd_prog="no"
19268
19269         cf_rpath_list="/usr/lib /lib"
19270         if test "$cf_ldd_prog" != no
19271         then
19272                 cf_rpath_oops=
19273
19274 cat >conftest.$ac_ext <<_ACEOF
19275 #line 19275 "configure"
19276 #include "confdefs.h"
19277 #include <stdio.h>
19278 int
19279 main (void)
19280 {
19281 printf("Hello");
19282   ;
19283   return 0;
19284 }
19285 _ACEOF
19286 rm -f conftest.$ac_objext conftest$ac_exeext
19287 if { (eval echo "$as_me:19287: \"$ac_link\"") >&5
19288   (eval $ac_link) 2>&5
19289   ac_status=$?
19290   echo "$as_me:19290: \$? = $ac_status" >&5
19291   (exit $ac_status); } &&
19292          { ac_try='test -s conftest$ac_exeext'
19293   { (eval echo "$as_me:19293: \"$ac_try\"") >&5
19294   (eval $ac_try) 2>&5
19295   ac_status=$?
19296   echo "$as_me:19296: \$? = $ac_status" >&5
19297   (exit $ac_status); }; }; then
19298   cf_rpath_oops=`$cf_ldd_prog conftest$ac_exeext | fgrep ' not found' | sed -e 's% =>.*$%%' |sort | uniq`
19299                  cf_rpath_list=`$cf_ldd_prog conftest$ac_exeext | fgrep / | sed -e 's%^.*[      ]/%/%' -e 's%/[^/][^/]*$%%' |sort | uniq`
19300 else
19301   echo "$as_me: failed program was:" >&5
19302 cat conftest.$ac_ext >&5
19303 fi
19304 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
19305
19306                 # If we passed the link-test, but get a "not found" on a given library,
19307                 # this could be due to inept reconfiguration of gcc to make it only
19308                 # partly honor /usr/local/lib (or whatever).  Sometimes this behavior
19309                 # is intentional, e.g., installing gcc in /usr/bin and suppressing the
19310                 # /usr/local libraries.
19311                 if test -n "$cf_rpath_oops"
19312                 then
19313                         for cf_rpath_src in $cf_rpath_oops
19314                         do
19315                                 for cf_rpath_dir in \
19316                                         /usr/local \
19317                                         /usr/pkg \
19318                                         /opt/sfw
19319                                 do
19320                                         if test -f $cf_rpath_dir/lib/$cf_rpath_src
19321                                         then
19322                                                 test -n "$verbose" && echo "    ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src" 1>&6
19323
19324 echo "${as_me:-configure}:19324: testing ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src ..." 1>&5
19325
19326                                                 LDFLAGS="$LDFLAGS -L$cf_rpath_dir/lib"
19327                                                 break
19328                                         fi
19329                                 done
19330                         done
19331                 fi
19332         fi
19333
19334         test -n "$verbose" && echo "    ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
19335
19336 echo "${as_me:-configure}:19336: testing ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
19337
19338 test -n "$verbose" && echo "    ...checking LDFLAGS $LDFLAGS" 1>&6
19339
19340 echo "${as_me:-configure}:19340: testing ...checking LDFLAGS $LDFLAGS ..." 1>&5
19341
19342 cf_rpath_dst=
19343 for cf_rpath_src in $LDFLAGS
19344 do
19345         case $cf_rpath_src in
19346         (-L*)
19347
19348                 # check if this refers to a directory which we will ignore
19349                 cf_rpath_skip=no
19350                 if test -n "$cf_rpath_list"
19351                 then
19352                         for cf_rpath_item in $cf_rpath_list
19353                         do
19354                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
19355                                 then
19356                                         cf_rpath_skip=yes
19357                                         break
19358                                 fi
19359                         done
19360                 fi
19361
19362                 if test "$cf_rpath_skip" = no
19363                 then
19364                         # transform the option
19365                         if test "$LD_RPATH_OPT" = "-R " ; then
19366                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
19367                         else
19368                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
19369                         fi
19370
19371                         # if we have not already added this, add it now
19372                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
19373                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
19374                         then
19375                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
19376
19377 echo "${as_me:-configure}:19377: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
19378
19379                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
19380                         fi
19381                 fi
19382                 ;;
19383         esac
19384         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
19385 done
19386 LDFLAGS=$cf_rpath_dst
19387
19388 test -n "$verbose" && echo "    ...checked LDFLAGS $LDFLAGS" 1>&6
19389
19390 echo "${as_me:-configure}:19390: testing ...checked LDFLAGS $LDFLAGS ..." 1>&5
19391
19392 test -n "$verbose" && echo "    ...checking LIBS $LIBS" 1>&6
19393
19394 echo "${as_me:-configure}:19394: testing ...checking LIBS $LIBS ..." 1>&5
19395
19396 cf_rpath_dst=
19397 for cf_rpath_src in $LIBS
19398 do
19399         case $cf_rpath_src in
19400         (-L*)
19401
19402                 # check if this refers to a directory which we will ignore
19403                 cf_rpath_skip=no
19404                 if test -n "$cf_rpath_list"
19405                 then
19406                         for cf_rpath_item in $cf_rpath_list
19407                         do
19408                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
19409                                 then
19410                                         cf_rpath_skip=yes
19411                                         break
19412                                 fi
19413                         done
19414                 fi
19415
19416                 if test "$cf_rpath_skip" = no
19417                 then
19418                         # transform the option
19419                         if test "$LD_RPATH_OPT" = "-R " ; then
19420                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
19421                         else
19422                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
19423                         fi
19424
19425                         # if we have not already added this, add it now
19426                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
19427                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
19428                         then
19429                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
19430
19431 echo "${as_me:-configure}:19431: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
19432
19433                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
19434                         fi
19435                 fi
19436                 ;;
19437         esac
19438         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
19439 done
19440 LIBS=$cf_rpath_dst
19441
19442 test -n "$verbose" && echo "    ...checked LIBS $LIBS" 1>&6
19443
19444 echo "${as_me:-configure}:19444: testing ...checked LIBS $LIBS ..." 1>&5
19445
19446         test -n "$verbose" && echo "    ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
19447
19448 echo "${as_me:-configure}:19448: testing ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
19449
19450 else
19451         echo "$as_me:19451: result: no" >&5
19452 echo "${ECHO_T}no" >&6
19453 fi
19454
19455 fi
19456
19457 TEST_ARGS="$LIBS"
19458 LIBS=
19459
19460 ac_config_files="$ac_config_files Makefile"
19461 ac_config_commands="$ac_config_commands default"
19462 cat >confcache <<\_ACEOF
19463 # This file is a shell script that caches the results of configure
19464 # tests run on this system so they can be shared between configure
19465 # scripts and configure runs, see configure's option --config-cache.
19466 # It is not useful on other systems.  If it contains results you don't
19467 # want to keep, you may remove or edit it.
19468 #
19469 # config.status only pays attention to the cache file if you give it
19470 # the --recheck option to rerun configure.
19471 #
19472 # `ac_cv_env_foo' variables (set or unset) will be overriden when
19473 # loading this file, other *unset* `ac_cv_foo' will be assigned the
19474 # following values.
19475
19476 _ACEOF
19477
19478 # The following way of writing the cache mishandles newlines in values,
19479 # but we know of no workaround that is simple, portable, and efficient.
19480 # So, don't put newlines in cache variables' values.
19481 # Ultrix sh set writes to stderr and can't be redirected directly,
19482 # and sets the high bit in the cache file unless we assign to the vars.
19483 {
19484   (set) 2>&1 |
19485     case `(ac_space=' '; set | grep ac_space) 2>&1` in
19486     *ac_space=\ *)
19487       # `set' does not quote correctly, so add quotes (double-quote
19488       # substitution turns \\\\ into \\, and sed turns \\ into \).
19489       sed -n \
19490         "s/'/'\\\\''/g;
19491           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
19492       ;;
19493     *)
19494       # `set' quotes correctly as required by POSIX, so do not add quotes.
19495       sed -n \
19496         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
19497       ;;
19498     esac;
19499 } |
19500   sed '
19501      t clear
19502      : clear
19503      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
19504      t end
19505      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
19506      : end' >>confcache
19507 if cmp -s $cache_file confcache; then :; else
19508   if test -w $cache_file; then
19509     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
19510     cat confcache >$cache_file
19511   else
19512     echo "not updating unwritable cache $cache_file"
19513   fi
19514 fi
19515 rm -f confcache
19516
19517 test "x$prefix" = xNONE && prefix=$ac_default_prefix
19518 # Let make expand exec_prefix.
19519 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
19520
19521 # VPATH may cause trouble with some makes, so we remove $(srcdir),
19522 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
19523 # trailing colons and then remove the whole line if VPATH becomes empty
19524 # (actually we leave an empty line to preserve line numbers).
19525 if test "x$srcdir" = x.; then
19526   ac_vpsub='/^[         ]*VPATH[        ]*=/{
19527 s/:*\$(srcdir):*/:/;
19528 s/:*\${srcdir}:*/:/;
19529 s/:*@srcdir@:*/:/;
19530 s/^\([^=]*=[    ]*\):*/\1/;
19531 s/:*$//;
19532 s/^[^=]*=[      ]*$//;
19533 }'
19534 fi
19535
19536 DEFS=-DHAVE_CONFIG_H
19537
19538 : ${CONFIG_STATUS=./config.status}
19539 ac_clean_files_save=$ac_clean_files
19540 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
19541 { echo "$as_me:19541: creating $CONFIG_STATUS" >&5
19542 echo "$as_me: creating $CONFIG_STATUS" >&6;}
19543 cat >$CONFIG_STATUS <<_ACEOF
19544 #! $SHELL
19545 # Generated automatically by configure.
19546 # Run this file to recreate the current configuration.
19547 # Compiler output produced by configure, useful for debugging
19548 # configure, is in config.log if it exists.
19549
19550 debug=false
19551 SHELL=\${CONFIG_SHELL-$SHELL}
19552 ac_cs_invocation="\$0 \$@"
19553
19554 _ACEOF
19555
19556 cat >>$CONFIG_STATUS <<\_ACEOF
19557 # Be Bourne compatible
19558 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
19559   emulate sh
19560   NULLCMD=:
19561 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
19562   set -o posix
19563 fi
19564
19565 # Name of the executable.
19566 as_me=`echo "$0" |sed 's,.*[\\/],,'`
19567
19568 if expr a : '\(a\)' >/dev/null 2>&1; then
19569   as_expr=expr
19570 else
19571   as_expr=false
19572 fi
19573
19574 rm -f conf$$ conf$$.exe conf$$.file
19575 echo >conf$$.file
19576 if ln -s conf$$.file conf$$ 2>/dev/null; then
19577   # We could just check for DJGPP; but this test a) works b) is more generic
19578   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
19579   if test -f conf$$.exe; then
19580     # Don't use ln at all; we don't have any links
19581     as_ln_s='cp -p'
19582   else
19583     as_ln_s='ln -s'
19584   fi
19585 elif ln conf$$.file conf$$ 2>/dev/null; then
19586   as_ln_s=ln
19587 else
19588   as_ln_s='cp -p'
19589 fi
19590 rm -f conf$$ conf$$.exe conf$$.file
19591
19592 as_executable_p="test -f"
19593
19594 # Support unset when possible.
19595 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
19596   as_unset=unset
19597 else
19598   as_unset=false
19599 fi
19600
19601 # NLS nuisances.
19602 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
19603 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
19604 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
19605 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
19606 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
19607 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
19608 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
19609 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
19610
19611 # IFS
19612 # We need space, tab and new line, in precisely that order.
19613 as_nl='
19614 '
19615 IFS="   $as_nl"
19616
19617 # CDPATH.
19618 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
19619
19620 exec 6>&1
19621
19622 _ACEOF
19623
19624 # Files that config.status was made for.
19625 if test -n "$ac_config_files"; then
19626   echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
19627 fi
19628
19629 if test -n "$ac_config_headers"; then
19630   echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
19631 fi
19632
19633 if test -n "$ac_config_links"; then
19634   echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
19635 fi
19636
19637 if test -n "$ac_config_commands"; then
19638   echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
19639 fi
19640
19641 cat >>$CONFIG_STATUS <<\EOF
19642
19643 ac_cs_usage="\
19644 \`$as_me' instantiates files from templates according to the
19645 current configuration.
19646
19647 Usage: $0 [OPTIONS] [FILE]...
19648
19649   -h, --help       print this help, then exit
19650   -V, --version    print version number, then exit
19651   -d, --debug      don't remove temporary files
19652       --recheck    update $as_me by reconfiguring in the same conditions
19653   --file=FILE[:TEMPLATE]
19654                    instantiate the configuration file FILE
19655   --header=FILE[:TEMPLATE]
19656                    instantiate the configuration header FILE
19657
19658 Configuration files:
19659 $config_files
19660
19661 Configuration headers:
19662 $config_headers
19663
19664 Configuration commands:
19665 $config_commands
19666
19667 Report bugs to <dickey@invisible-island.net>."
19668 EOF
19669
19670 cat >>$CONFIG_STATUS <<EOF
19671 ac_cs_version="\\
19672 config.status
19673 configured by $0, generated by GNU Autoconf 2.52.20170501,
19674   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
19675
19676 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
19677 Free Software Foundation, Inc.
19678 This config.status script is free software; the Free Software Foundation
19679 gives unlimited permission to copy, distribute and modify it."
19680 srcdir=$srcdir
19681 INSTALL="$INSTALL"
19682 EOF
19683
19684 cat >>$CONFIG_STATUS <<\EOF
19685 # If no file are specified by the user, then we need to provide default
19686 # value.  By we need to know if files were specified by the user.
19687 ac_need_defaults=:
19688 while test $# != 0
19689 do
19690   case $1 in
19691   --*=*)
19692     ac_option=`expr "x$1" : 'x\([^=]*\)='`
19693     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
19694     shift
19695     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
19696     shift
19697     ;;
19698   -*);;
19699   *) # This is not an option, so the user has probably given explicit
19700      # arguments.
19701      ac_need_defaults=false;;
19702   esac
19703
19704   case $1 in
19705   # Handling of the options.
19706 EOF
19707 cat >>$CONFIG_STATUS <<EOF
19708   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
19709     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
19710     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
19711 EOF
19712 cat >>$CONFIG_STATUS <<\EOF
19713   --version | --vers* | -V )
19714     echo "$ac_cs_version"; exit 0 ;;
19715   --he | --h)
19716     # Conflict between --help and --header
19717     { { echo "$as_me:19717: error: ambiguous option: $1
19718 Try \`$0 --help' for more information." >&5
19719 echo "$as_me: error: ambiguous option: $1
19720 Try \`$0 --help' for more information." >&2;}
19721    { (exit 1); exit 1; }; };;
19722   --help | --hel | -h )
19723     echo "$ac_cs_usage"; exit 0 ;;
19724   --debug | --d* | -d )
19725     debug=: ;;
19726   --file | --fil | --fi | --f )
19727     shift
19728     CONFIG_FILES="$CONFIG_FILES $1"
19729     ac_need_defaults=false;;
19730   --header | --heade | --head | --hea )
19731     shift
19732     CONFIG_HEADERS="$CONFIG_HEADERS $1"
19733     ac_need_defaults=false;;
19734
19735   # This is an error.
19736   -*) { { echo "$as_me:19736: error: unrecognized option: $1
19737 Try \`$0 --help' for more information." >&5
19738 echo "$as_me: error: unrecognized option: $1
19739 Try \`$0 --help' for more information." >&2;}
19740    { (exit 1); exit 1; }; } ;;
19741
19742   *) ac_config_targets="$ac_config_targets $1" ;;
19743
19744   esac
19745   shift
19746 done
19747
19748 exec 5>>config.log
19749 cat >&5 << _ACEOF
19750
19751 ## ----------------------- ##
19752 ## Running config.status.  ##
19753 ## ----------------------- ##
19754
19755 This file was extended by $as_me 2.52.20170501, executed with
19756   CONFIG_FILES    = $CONFIG_FILES
19757   CONFIG_HEADERS  = $CONFIG_HEADERS
19758   CONFIG_LINKS    = $CONFIG_LINKS
19759   CONFIG_COMMANDS = $CONFIG_COMMANDS
19760   > $ac_cs_invocation
19761 on `(hostname || uname -n) 2>/dev/null | sed 1q`
19762
19763 _ACEOF
19764 EOF
19765
19766 cat >>$CONFIG_STATUS <<EOF
19767 #
19768 # INIT-COMMANDS section.
19769 #
19770
19771 AWK="$AWK"
19772 ECHO_CC="$ECHO_CC"
19773 ECHO_LD="$ECHO_LD"
19774 SHOW_CC="$SHOW_LD"
19775
19776 EOF
19777
19778 cat >>$CONFIG_STATUS <<\EOF
19779 for ac_config_target in $ac_config_targets
19780 do
19781   case "$ac_config_target" in
19782   # Handling of arguments.
19783   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
19784   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
19785   "ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS ncurses_cfg.h:ncurses_tst.hin" ;;
19786   *) { { echo "$as_me:19786: error: invalid argument: $ac_config_target" >&5
19787 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
19788    { (exit 1); exit 1; }; };;
19789   esac
19790 done
19791
19792 # If the user did not use the arguments to specify the items to instantiate,
19793 # then the envvar interface is used.  Set only those that are not.
19794 # We use the long form for the default assignment because of an extremely
19795 # bizarre bug on SunOS 4.1.3.
19796 if $ac_need_defaults; then
19797   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
19798   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
19799   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
19800 fi
19801
19802 # Create a temporary directory, and hook for its removal unless debugging.
19803 $debug ||
19804 {
19805   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
19806   trap '{ (exit 1); exit 1; }' 1 2 13 15
19807 }
19808
19809 # Create a (secure) tmp directory for tmp files.
19810 : ${TMPDIR=/tmp}
19811 {
19812   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
19813   test -n "$tmp" && test -d "$tmp"
19814 }  ||
19815 {
19816   tmp=$TMPDIR/cs$$-$RANDOM
19817   (umask 077 && mkdir $tmp)
19818 } ||
19819 {
19820    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
19821    { (exit 1); exit 1; }
19822 }
19823
19824 EOF
19825
19826 cat >>$CONFIG_STATUS <<EOF
19827
19828 #
19829 # CONFIG_FILES section.
19830 #
19831
19832 # No need to generate the scripts if there are no CONFIG_FILES.
19833 # This happens for instance when ./config.status config.h
19834 if test -n "\$CONFIG_FILES"; then
19835   # Protect against being on the right side of a sed subst in config.status.
19836   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
19837    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
19838 s,@SHELL@,$SHELL,;t t
19839 s,@exec_prefix@,$exec_prefix,;t t
19840 s,@prefix@,$prefix,;t t
19841 s,@program_transform_name@,$program_transform_name,;t t
19842 s,@bindir@,$bindir,;t t
19843 s,@sbindir@,$sbindir,;t t
19844 s,@libexecdir@,$libexecdir,;t t
19845 s,@datarootdir@,$datarootdir,;t t
19846 s,@datadir@,$datadir,;t t
19847 s,@sysconfdir@,$sysconfdir,;t t
19848 s,@sharedstatedir@,$sharedstatedir,;t t
19849 s,@localstatedir@,$localstatedir,;t t
19850 s,@libdir@,$libdir,;t t
19851 s,@includedir@,$includedir,;t t
19852 s,@oldincludedir@,$oldincludedir,;t t
19853 s,@infodir@,$infodir,;t t
19854 s,@mandir@,$mandir,;t t
19855 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
19856 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
19857 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
19858 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
19859 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
19860 s,@build_alias@,$build_alias,;t t
19861 s,@host_alias@,$host_alias,;t t
19862 s,@target_alias@,$target_alias,;t t
19863 s,@ECHO_C@,$ECHO_C,;t t
19864 s,@ECHO_N@,$ECHO_N,;t t
19865 s,@ECHO_T@,$ECHO_T,;t t
19866 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
19867 s,@DEFS@,$DEFS,;t t
19868 s,@LIBS@,$LIBS,;t t
19869 s,@build@,$build,;t t
19870 s,@build_cpu@,$build_cpu,;t t
19871 s,@build_vendor@,$build_vendor,;t t
19872 s,@build_os@,$build_os,;t t
19873 s,@host@,$host,;t t
19874 s,@host_cpu@,$host_cpu,;t t
19875 s,@host_vendor@,$host_vendor,;t t
19876 s,@host_os@,$host_os,;t t
19877 s,@SET_MAKE@,$SET_MAKE,;t t
19878 s,@CC@,$CC,;t t
19879 s,@CFLAGS@,$CFLAGS,;t t
19880 s,@LDFLAGS@,$LDFLAGS,;t t
19881 s,@CPPFLAGS@,$CPPFLAGS,;t t
19882 s,@ac_ct_CC@,$ac_ct_CC,;t t
19883 s,@EXEEXT@,$EXEEXT,;t t
19884 s,@OBJEXT@,$OBJEXT,;t t
19885 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
19886 s,@CPP@,$CPP,;t t
19887 s,@AWK@,$AWK,;t t
19888 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
19889 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
19890 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
19891 s,@LINT@,$LINT,;t t
19892 s,@LINT_OPTS@,$LINT_OPTS,;t t
19893 s,@CTAGS@,$CTAGS,;t t
19894 s,@ETAGS@,$ETAGS,;t t
19895 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
19896 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
19897 s,@MATH_LIB@,$MATH_LIB,;t t
19898 s,@top_builddir@,$top_builddir,;t t
19899 s,@CC_G_OPT@,$CC_G_OPT,;t t
19900 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
19901 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
19902 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
19903 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
19904 s,@LD@,$LD,;t t
19905 s,@LDFLAGS_SHARED@,$LDFLAGS_SHARED,;t t
19906 s,@LDFLAGS_STATIC@,$LDFLAGS_STATIC,;t t
19907 s,@LD_MODEL@,$LD_MODEL,;t t
19908 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
19909 s,@LIBTOOL@,$LIBTOOL,;t t
19910 s,@LIBTOOL_OPTS@,$LIBTOOL_OPTS,;t t
19911 s,@LIB_CLEAN@,$LIB_CLEAN,;t t
19912 s,@LIB_COMPILE@,$LIB_COMPILE,;t t
19913 s,@LIB_LINK@,$LIB_LINK,;t t
19914 s,@LINK_TESTS@,$LINK_TESTS,;t t
19915 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
19916 s,@PACKAGE@,$PACKAGE,;t t
19917 s,@PTHREAD@,$PTHREAD,;t t
19918 s,@TEST_ARGS@,$TEST_ARGS,;t t
19919 s,@TEST_DEPS@,$TEST_DEPS,;t t
19920 s,@TEST_LIBS@,$TEST_LIBS,;t t
19921 s,@TINFO_LDFLAGS@,$TINFO_LDFLAGS,;t t
19922 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
19923 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
19924 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
19925 s,@includesubdir@,$includesubdir,;t t
19926 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
19927 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
19928 s,@ECHO_LT@,$ECHO_LT,;t t
19929 s,@ECHO_LD@,$ECHO_LD,;t t
19930 s,@RULE_CC@,$RULE_CC,;t t
19931 s,@SHOW_CC@,$SHOW_CC,;t t
19932 s,@ECHO_CC@,$ECHO_CC,;t t
19933 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
19934 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
19935 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
19936 s,@X_CFLAGS@,$X_CFLAGS,;t t
19937 s,@X_PRE_LIBS@,$X_PRE_LIBS,;t t
19938 s,@X_LIBS@,$X_LIBS,;t t
19939 s,@X_EXTRA_LIBS@,$X_EXTRA_LIBS,;t t
19940 s,@XCURSES_CONFIG@,$XCURSES_CONFIG,;t t
19941 s,@ac_ct_XCURSES_CONFIG@,$ac_ct_XCURSES_CONFIG,;t t
19942 s,@RGB_PATH@,$RGB_PATH,;t t
19943 s,@no_x11_rgb@,$no_x11_rgb,;t t
19944 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
19945 s,@cf_ldd_prog@,$cf_ldd_prog,;t t
19946 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
19947 CEOF
19948
19949 EOF
19950
19951   cat >>$CONFIG_STATUS <<\EOF
19952   # Split the substitutions into bite-sized pieces for seds with
19953   # small command number limits, like on Digital OSF/1 and HP-UX.
19954   ac_max_sed_lines=48
19955   ac_sed_frag=1 # Number of current file.
19956   ac_beg=1 # First line for current file.
19957   ac_end=$ac_max_sed_lines # Line after last line for current file.
19958   ac_more_lines=:
19959   ac_sed_cmds=
19960   while $ac_more_lines; do
19961     if test $ac_beg -gt 1; then
19962       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
19963     else
19964       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
19965     fi
19966     if test ! -s $tmp/subs.frag; then
19967       ac_more_lines=false
19968     else
19969       # The purpose of the label and of the branching condition is to
19970       # speed up the sed processing (if there are no `@' at all, there
19971       # is no need to browse any of the substitutions).
19972       # These are the two extra sed commands mentioned above.
19973       (echo ':t
19974   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
19975       # It is possible to make a multiline substitution using escaped newlines.
19976       # Ensure that we do not split the substitution between script fragments.
19977       ac_BEG=$ac_end
19978       ac_END=`expr $ac_end + $ac_max_sed_lines`
19979       sed "1,${ac_BEG}d; ${ac_END}p; q" $tmp/subs.sed >$tmp/subs.next
19980       if test -s $tmp/subs.next; then
19981         grep '^s,@[^@,][^@,]*@,.*\\$' $tmp/subs.next >$tmp/subs.edit
19982         if test ! -s $tmp/subs.edit; then
19983           grep "^s,@[^@,][^@,]*@,.*,;t t$" $tmp/subs.next >$tmp/subs.edit
19984           if test ! -s $tmp/subs.edit; then
19985             if test $ac_beg -gt 1; then
19986               ac_end=`expr $ac_end - 1`
19987               continue
19988             fi
19989           fi
19990         fi
19991       fi
19992
19993       if test -z "$ac_sed_cmds"; then
19994         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
19995       else
19996         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
19997       fi
19998       ac_sed_frag=`expr $ac_sed_frag + 1`
19999       ac_beg=$ac_end
20000       ac_end=`expr $ac_end + $ac_max_sed_lines`
20001     fi
20002   done
20003   if test -z "$ac_sed_cmds"; then
20004     ac_sed_cmds=cat
20005   fi
20006 fi # test -n "$CONFIG_FILES"
20007
20008 EOF
20009 cat >>$CONFIG_STATUS <<\EOF
20010 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
20011   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
20012   case $ac_file in
20013   - | *:- | *:-:* ) # input from stdin
20014         cat >$tmp/stdin
20015         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
20016         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
20017   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
20018         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
20019   * )   ac_file_in=$ac_file.in ;;
20020   esac
20021
20022   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
20023   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
20024          X"$ac_file" : 'X\(//\)[^/]' \| \
20025          X"$ac_file" : 'X\(//\)$' \| \
20026          X"$ac_file" : 'X\(/\)' \| \
20027          .     : '\(.\)' 2>/dev/null ||
20028 echo X"$ac_file" |
20029     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
20030           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
20031           /^X\(\/\/\)$/{ s//\1/; q; }
20032           /^X\(\/\).*/{ s//\1/; q; }
20033           s/.*/./; q'`
20034   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
20035     { case "$ac_dir" in
20036   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
20037   *)                      as_incr_dir=.;;
20038 esac
20039 as_dummy="$ac_dir"
20040 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
20041   case $as_mkdir_dir in
20042     # Skip DOS drivespec
20043     ?:) as_incr_dir=$as_mkdir_dir ;;
20044     *)
20045       as_incr_dir=$as_incr_dir/$as_mkdir_dir
20046       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
20047     ;;
20048   esac
20049 done; }
20050
20051     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
20052     # A "../" for each directory in $ac_dir_suffix.
20053     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
20054   else
20055     ac_dir_suffix= ac_dots=
20056   fi
20057
20058   case $srcdir in
20059   .)  ac_srcdir=.
20060       if test -z "$ac_dots"; then
20061          ac_top_srcdir=.
20062       else
20063          ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'`
20064       fi ;;
20065   [\\/]* | ?:[\\/]* )
20066       ac_srcdir=$srcdir$ac_dir_suffix;
20067       ac_top_srcdir=$srcdir ;;
20068   *) # Relative path.
20069     ac_srcdir=$ac_dots$srcdir$ac_dir_suffix
20070     ac_top_srcdir=$ac_dots$srcdir ;;
20071   esac
20072
20073   case $INSTALL in
20074   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
20075   *) ac_INSTALL=$ac_dots$INSTALL ;;
20076   esac
20077
20078   if test x"$ac_file" != x-; then
20079     { echo "$as_me:20079: creating $ac_file" >&5
20080 echo "$as_me: creating $ac_file" >&6;}
20081     rm -f "$ac_file"
20082   fi
20083   # Let's still pretend it is `configure' which instantiates (i.e., don't
20084   # use $as_me), people would be surprised to read:
20085   #    /* config.h.  Generated automatically by config.status.  */
20086   configure_input="Generated automatically from `echo $ac_file_in |
20087                                                  sed 's,.*/,,'` by configure."
20088
20089   # First look for the input files in the build tree, otherwise in the
20090   # src tree.
20091   ac_file_inputs=`IFS=:
20092     for f in $ac_file_in; do
20093       case $f in
20094       -) echo $tmp/stdin ;;
20095       [\\/$]*)
20096          # Absolute (can't be DOS-style, as IFS=:)
20097          test -f "$f" || { { echo "$as_me:20097: error: cannot find input file: $f" >&5
20098 echo "$as_me: error: cannot find input file: $f" >&2;}
20099    { (exit 1); exit 1; }; }
20100          echo $f;;
20101       *) # Relative
20102          if test -f "$f"; then
20103            # Build tree
20104            echo $f
20105          elif test -f "$srcdir/$f"; then
20106            # Source tree
20107            echo $srcdir/$f
20108          else
20109            # /dev/null tree
20110            { { echo "$as_me:20110: error: cannot find input file: $f" >&5
20111 echo "$as_me: error: cannot find input file: $f" >&2;}
20112    { (exit 1); exit 1; }; }
20113          fi;;
20114       esac
20115     done` || { (exit 1); exit 1; }
20116 EOF
20117 cat >>$CONFIG_STATUS <<\EOF
20118   ac_warn_datarootdir=no
20119   if test x"$ac_file" != x-; then
20120     for ac_item in $ac_file_inputs
20121     do
20122       ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' $ac_item`
20123       if test -n "$ac_seen"; then
20124         ac_used=`grep '@datarootdir@' $ac_item`
20125         if test -z "$ac_used"; then
20126           { echo "$as_me:20126: WARNING: datarootdir was used implicitly but not set:
20127 $ac_seen" >&5
20128 echo "$as_me: WARNING: datarootdir was used implicitly but not set:
20129 $ac_seen" >&2;}
20130           ac_warn_datarootdir=yes
20131         fi
20132       fi
20133       ac_seen=`grep '${datarootdir}' $ac_item`
20134       if test -n "$ac_seen"; then
20135         { echo "$as_me:20135: WARNING: datarootdir was used explicitly but not set:
20136 $ac_seen" >&5
20137 echo "$as_me: WARNING: datarootdir was used explicitly but not set:
20138 $ac_seen" >&2;}
20139         ac_warn_datarootdir=yes
20140       fi
20141     done
20142   fi
20143
20144 if test "x$ac_warn_datarootdir" = xyes; then
20145   ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
20146 fi
20147
20148 EOF
20149 cat >>$CONFIG_STATUS <<EOF
20150   sed "$ac_vpsub
20151 $extrasub
20152 EOF
20153 cat >>$CONFIG_STATUS <<\EOF
20154 :t
20155 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
20156 s,@configure_input@,$configure_input,;t t
20157 s,@srcdir@,$ac_srcdir,;t t
20158 s,@top_srcdir@,$ac_top_srcdir,;t t
20159 s,@INSTALL@,$ac_INSTALL,;t t
20160 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
20161   rm -f $tmp/stdin
20162   if test x"$ac_file" != x-; then
20163     cp $tmp/out $ac_file
20164
20165     for ac_name in prefix exec_prefix datarootdir
20166     do
20167         ac_seen=`fgrep -n '${'$ac_name'[:=].*}' $ac_file`
20168         if test -n "$ac_seen"; then
20169             ac_init=`egrep '[   ]*'$ac_name'[   ]*=' $ac_file`
20170             if test -z "$ac_init"; then
20171               ac_seen=`echo "$ac_seen" |sed -e 's,^,'$ac_file':,'`
20172               { echo "$as_me:20172: WARNING: Variable $ac_name is used but was not set:
20173 $ac_seen" >&5
20174 echo "$as_me: WARNING: Variable $ac_name is used but was not set:
20175 $ac_seen" >&2;}
20176             fi
20177         fi
20178     done
20179     egrep -n '@[a-z_][a-z_0-9]+@' $ac_file >$tmp/out
20180     egrep -n '@[A-Z_][A-Z_0-9]+@' $ac_file >>$tmp/out
20181     if test -s $tmp/out; then
20182       ac_seen=`sed -e 's,^,'$ac_file':,' < $tmp/out`
20183       { echo "$as_me:20183: WARNING: Some variables may not be substituted:
20184 $ac_seen" >&5
20185 echo "$as_me: WARNING: Some variables may not be substituted:
20186 $ac_seen" >&2;}
20187     fi
20188   else
20189     cat $tmp/out
20190   fi
20191   rm -f $tmp/out
20192
20193 done
20194 EOF
20195 cat >>$CONFIG_STATUS <<\EOF
20196
20197 #
20198 # CONFIG_HEADER section.
20199 #
20200
20201 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
20202 # NAME is the cpp macro being defined and VALUE is the value it is being given.
20203 #
20204 # ac_d sets the value in "#define NAME VALUE" lines.
20205 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
20206 ac_dB='[        ].*$,\1#\2'
20207 ac_dC=' '
20208 ac_dD=',;t'
20209 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
20210 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
20211 ac_iB='\([      ]\),\1#\2define\3'
20212 ac_iC=' '
20213 ac_iD='\4,;t'
20214 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
20215 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
20216 ac_uB='$,\1#\2define\3'
20217 ac_uC=' '
20218 ac_uD=',;t'
20219
20220 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
20221   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
20222   case $ac_file in
20223   - | *:- | *:-:* ) # input from stdin
20224         cat >$tmp/stdin
20225         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
20226         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
20227   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
20228         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
20229   * )   ac_file_in=$ac_file.in ;;
20230   esac
20231
20232   test x"$ac_file" != x- && { echo "$as_me:20232: creating $ac_file" >&5
20233 echo "$as_me: creating $ac_file" >&6;}
20234
20235   # First look for the input files in the build tree, otherwise in the
20236   # src tree.
20237   ac_file_inputs=`IFS=:
20238     for f in $ac_file_in; do
20239       case $f in
20240       -) echo $tmp/stdin ;;
20241       [\\/$]*)
20242          # Absolute (can't be DOS-style, as IFS=:)
20243          test -f "$f" || { { echo "$as_me:20243: error: cannot find input file: $f" >&5
20244 echo "$as_me: error: cannot find input file: $f" >&2;}
20245    { (exit 1); exit 1; }; }
20246          echo $f;;
20247       *) # Relative
20248          if test -f "$f"; then
20249            # Build tree
20250            echo $f
20251          elif test -f "$srcdir/$f"; then
20252            # Source tree
20253            echo $srcdir/$f
20254          else
20255            # /dev/null tree
20256            { { echo "$as_me:20256: error: cannot find input file: $f" >&5
20257 echo "$as_me: error: cannot find input file: $f" >&2;}
20258    { (exit 1); exit 1; }; }
20259          fi;;
20260       esac
20261     done` || { (exit 1); exit 1; }
20262   # Remove the trailing spaces.
20263   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
20264
20265 EOF
20266
20267 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
20268 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
20269 # be either 'cat' or 'sort'.
20270 cat confdefs.h | uniq >conftest.vals
20271
20272 # Break up conftest.vals because some shells have a limit on
20273 # the size of here documents, and old seds have small limits too.
20274
20275 rm -f conftest.tail
20276 echo '  rm -f conftest.frag' >> $CONFIG_STATUS
20277 while grep . conftest.vals >/dev/null
20278 do
20279   # Write chunks of a limited-size here document to conftest.frag.
20280   echo '  cat >> conftest.frag <<CEOF' >> $CONFIG_STATUS
20281   sed ${ac_max_here_lines}q conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> $CONFIG_STATUS
20282   echo 'CEOF' >> $CONFIG_STATUS
20283   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
20284   rm -f conftest.vals
20285   mv conftest.tail conftest.vals
20286 done
20287 rm -f conftest.vals
20288
20289 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
20290 # marker @DEFS@.
20291 echo '  cat >> conftest.edit <<CEOF
20292 /@DEFS@/r conftest.frag
20293 /@DEFS@/d
20294 CEOF
20295 sed -f conftest.edit $tmp/in > $tmp/out
20296 rm -f $tmp/in
20297 mv $tmp/out $tmp/in
20298 rm -f conftest.edit conftest.frag
20299 ' >> $CONFIG_STATUS
20300
20301 cat >>$CONFIG_STATUS <<\EOF
20302   # Let's still pretend it is `configure' which instantiates (i.e., don't
20303   # use $as_me), people would be surprised to read:
20304   #    /* config.h.  Generated automatically by config.status.  */
20305   if test x"$ac_file" = x-; then
20306     echo "/* Generated automatically by configure.  */" >$tmp/config.h
20307   else
20308     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
20309   fi
20310   cat $tmp/in >>$tmp/config.h
20311   rm -f $tmp/in
20312   if test x"$ac_file" != x-; then
20313     if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
20314       { echo "$as_me:20314: $ac_file is unchanged" >&5
20315 echo "$as_me: $ac_file is unchanged" >&6;}
20316     else
20317       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
20318          X"$ac_file" : 'X\(//\)[^/]' \| \
20319          X"$ac_file" : 'X\(//\)$' \| \
20320          X"$ac_file" : 'X\(/\)' \| \
20321          .     : '\(.\)' 2>/dev/null ||
20322 echo X"$ac_file" |
20323     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
20324           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
20325           /^X\(\/\/\)$/{ s//\1/; q; }
20326           /^X\(\/\).*/{ s//\1/; q; }
20327           s/.*/./; q'`
20328       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
20329         { case "$ac_dir" in
20330   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
20331   *)                      as_incr_dir=.;;
20332 esac
20333 as_dummy="$ac_dir"
20334 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
20335   case $as_mkdir_dir in
20336     # Skip DOS drivespec
20337     ?:) as_incr_dir=$as_mkdir_dir ;;
20338     *)
20339       as_incr_dir=$as_incr_dir/$as_mkdir_dir
20340       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
20341     ;;
20342   esac
20343 done; }
20344
20345       fi
20346       rm -f $ac_file
20347       mv $tmp/config.h $ac_file
20348     fi
20349   else
20350     cat $tmp/config.h
20351     rm -f $tmp/config.h
20352   fi
20353 done
20354 EOF
20355 cat >>$CONFIG_STATUS <<\EOF
20356 #
20357 # CONFIG_COMMANDS section.
20358 #
20359 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
20360   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
20361   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
20362
20363   case $ac_dest in
20364     default )
20365
20366 for cf_dir in .
20367 do
20368         if test ! -d $srcdir/$cf_dir; then
20369                 continue
20370         elif test -f $srcdir/$cf_dir/programs; then
20371                 $AWK -f $srcdir/mk-test.awk INSTALL=yes ECHO_LINK="$ECHO_LD" $srcdir/$cf_dir/programs >>$cf_dir/Makefile
20372         fi
20373 done
20374
20375         cat >>Makefile <<TEST_EOF
20376
20377 # These rules are generated so we do not rely on suffix rules, which do not
20378 # work consistently for different make-programs (the '\$(MODEL)/' confuses
20379 # some, and the '\$x' confuses others).
20380 TEST_EOF
20381
20382 LIST=`sed -e 's/[       ].*//' -e '/^[#@]/d' $srcdir/modules`
20383 for N in $LIST
20384 do
20385         cat >>Makefile <<TEST_EOF
20386
20387 \$(MODEL)/$N.o : \$(srcdir)/$N.c \\
20388         \$(srcdir)/test.priv.h \\
20389         ncurses_cfg.h
20390         $SHOW_CC
20391         $ECHO_CC\$(CC) -c \$(CFLAGS_DEFAULT) -DMODULE_NAME="$N" \$(srcdir)/$N.c
20392 TEST_EOF
20393 done
20394
20395 if test -f ../config.guess && test -f ../config.sub
20396 then
20397         cat >>Makefile <<TEST_EOF
20398
20399 # if we used CF_INHERIT for getting these files, we can remove them
20400 distclean::
20401         rm -f config.guess config.sub
20402 TEST_EOF
20403 fi
20404  ;;
20405   esac
20406 done
20407 EOF
20408
20409 cat >>$CONFIG_STATUS <<\EOF
20410
20411 { (exit 0); exit 0; }
20412 EOF
20413 chmod +x $CONFIG_STATUS
20414 ac_clean_files=$ac_clean_files_save
20415
20416 # configure is writing to config.log, and then calls config.status.
20417 # config.status does its own redirection, appending to config.log.
20418 # Unfortunately, on DOS this fails, as config.log is still kept open
20419 # by configure, so config.status won't be able to write to it; its
20420 # output is simply discarded.  So we exec the FD to /dev/null,
20421 # effectively closing config.log, so it can be properly (re)opened and
20422 # appended to by config.status.  When coming back to configure, we
20423 # need to make the FD available again.
20424 if test "$no_create" != yes; then
20425   ac_cs_success=:
20426   exec 5>/dev/null
20427   $SHELL $CONFIG_STATUS || ac_cs_success=false
20428   exec 5>>config.log
20429   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
20430   # would make configure fail if this is the last instruction.
20431   $ac_cs_success || { (exit 1); exit 1; }
20432 fi
20433