]> ncurses.scripts.mit.edu Git - ncurses.git/blob - test/configure
ncurses 6.0 - patch 20171230
[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   break
6060 fi
6061
6062                         done
6063
6064 fi
6065
6066         fi
6067
6068         # Check for library containing initscr
6069         test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS"
6070         if test "x$cf_curs_lib" = x
6071         then
6072                 for cf_curs_lib in $cf_check_list xcurses jcurses pdcurses unknown
6073                 do
6074                         LIBS="-l$cf_curs_lib $cf_save_LIBS"
6075                         if test "$cf_term_lib" = unknown || test "$cf_term_lib" = "$cf_curs_lib" ; then
6076                                 echo "$as_me:6076: checking if we can link with $cf_curs_lib library" >&5
6077 echo $ECHO_N "checking if we can link with $cf_curs_lib library... $ECHO_C" >&6
6078                                 cat >conftest.$ac_ext <<_ACEOF
6079 #line 6079 "configure"
6080 #include "confdefs.h"
6081 #include <${cf_cv_ncurses_header:-curses.h}>
6082 int
6083 main (void)
6084 {
6085 initscr()
6086   ;
6087   return 0;
6088 }
6089 _ACEOF
6090 rm -f conftest.$ac_objext conftest$ac_exeext
6091 if { (eval echo "$as_me:6091: \"$ac_link\"") >&5
6092   (eval $ac_link) 2>&5
6093   ac_status=$?
6094   echo "$as_me:6094: \$? = $ac_status" >&5
6095   (exit $ac_status); } &&
6096          { ac_try='test -s conftest$ac_exeext'
6097   { (eval echo "$as_me:6097: \"$ac_try\"") >&5
6098   (eval $ac_try) 2>&5
6099   ac_status=$?
6100   echo "$as_me:6100: \$? = $ac_status" >&5
6101   (exit $ac_status); }; }; then
6102   cf_result=yes
6103 else
6104   echo "$as_me: failed program was:" >&5
6105 cat conftest.$ac_ext >&5
6106 cf_result=no
6107 fi
6108 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6109                                 echo "$as_me:6109: result: $cf_result" >&5
6110 echo "${ECHO_T}$cf_result" >&6
6111                                 test $cf_result = yes && break
6112                         elif test "$cf_curs_lib" = "$cf_term_lib" ; then
6113                                 cf_result=no
6114                         elif test "$cf_term_lib" != predefined ; then
6115                                 echo "$as_me:6115: checking if we need both $cf_curs_lib and $cf_term_lib libraries" >&5
6116 echo $ECHO_N "checking if we need both $cf_curs_lib and $cf_term_lib libraries... $ECHO_C" >&6
6117                                 cat >conftest.$ac_ext <<_ACEOF
6118 #line 6118 "configure"
6119 #include "confdefs.h"
6120 #include <${cf_cv_ncurses_header:-curses.h}>
6121 int
6122 main (void)
6123 {
6124 initscr(); tgoto((char *)0, 0, 0);
6125   ;
6126   return 0;
6127 }
6128 _ACEOF
6129 rm -f conftest.$ac_objext conftest$ac_exeext
6130 if { (eval echo "$as_me:6130: \"$ac_link\"") >&5
6131   (eval $ac_link) 2>&5
6132   ac_status=$?
6133   echo "$as_me:6133: \$? = $ac_status" >&5
6134   (exit $ac_status); } &&
6135          { ac_try='test -s conftest$ac_exeext'
6136   { (eval echo "$as_me:6136: \"$ac_try\"") >&5
6137   (eval $ac_try) 2>&5
6138   ac_status=$?
6139   echo "$as_me:6139: \$? = $ac_status" >&5
6140   (exit $ac_status); }; }; then
6141   cf_result=no
6142 else
6143   echo "$as_me: failed program was:" >&5
6144 cat conftest.$ac_ext >&5
6145
6146                                         LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
6147                                         cat >conftest.$ac_ext <<_ACEOF
6148 #line 6148 "configure"
6149 #include "confdefs.h"
6150 #include <${cf_cv_ncurses_header:-curses.h}>
6151 int
6152 main (void)
6153 {
6154 initscr()
6155   ;
6156   return 0;
6157 }
6158 _ACEOF
6159 rm -f conftest.$ac_objext conftest$ac_exeext
6160 if { (eval echo "$as_me:6160: \"$ac_link\"") >&5
6161   (eval $ac_link) 2>&5
6162   ac_status=$?
6163   echo "$as_me:6163: \$? = $ac_status" >&5
6164   (exit $ac_status); } &&
6165          { ac_try='test -s conftest$ac_exeext'
6166   { (eval echo "$as_me:6166: \"$ac_try\"") >&5
6167   (eval $ac_try) 2>&5
6168   ac_status=$?
6169   echo "$as_me:6169: \$? = $ac_status" >&5
6170   (exit $ac_status); }; }; then
6171   cf_result=yes
6172 else
6173   echo "$as_me: failed program was:" >&5
6174 cat conftest.$ac_ext >&5
6175 cf_result=error
6176 fi
6177 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6178
6179 fi
6180 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6181                                 echo "$as_me:6181: result: $cf_result" >&5
6182 echo "${ECHO_T}$cf_result" >&6
6183                                 test $cf_result != error && break
6184                         fi
6185                 done
6186         fi
6187         test $cf_curs_lib = unknown && { { echo "$as_me:6187: error: no curses library found" >&5
6188 echo "$as_me: error: no curses library found" >&2;}
6189    { (exit 1); exit 1; }; }
6190 fi
6191 fi
6192
6193         ;;
6194 (ncursesw*)
6195
6196 echo "$as_me:6196: checking for multibyte character support" >&5
6197 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
6198 if test "${cf_cv_utf8_lib+set}" = set; then
6199   echo $ECHO_N "(cached) $ECHO_C" >&6
6200 else
6201
6202         cf_save_LIBS="$LIBS"
6203         cat >conftest.$ac_ext <<_ACEOF
6204 #line 6204 "configure"
6205 #include "confdefs.h"
6206
6207 #include <stdlib.h>
6208 int
6209 main (void)
6210 {
6211 putwc(0,0);
6212   ;
6213   return 0;
6214 }
6215 _ACEOF
6216 rm -f conftest.$ac_objext conftest$ac_exeext
6217 if { (eval echo "$as_me:6217: \"$ac_link\"") >&5
6218   (eval $ac_link) 2>&5
6219   ac_status=$?
6220   echo "$as_me:6220: \$? = $ac_status" >&5
6221   (exit $ac_status); } &&
6222          { ac_try='test -s conftest$ac_exeext'
6223   { (eval echo "$as_me:6223: \"$ac_try\"") >&5
6224   (eval $ac_try) 2>&5
6225   ac_status=$?
6226   echo "$as_me:6226: \$? = $ac_status" >&5
6227   (exit $ac_status); }; }; then
6228   cf_cv_utf8_lib=yes
6229 else
6230   echo "$as_me: failed program was:" >&5
6231 cat conftest.$ac_ext >&5
6232
6233 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
6234 # will be set on completion of the AC_TRY_LINK below.
6235 cf_cv_header_path_utf8=
6236 cf_cv_library_path_utf8=
6237
6238 echo "${as_me:-configure}:6238: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
6239
6240 cf_save_LIBS="$LIBS"
6241
6242 cat >conftest.$ac_ext <<_ACEOF
6243 #line 6243 "configure"
6244 #include "confdefs.h"
6245
6246 #include <libutf8.h>
6247 int
6248 main (void)
6249 {
6250 putwc(0,0);
6251   ;
6252   return 0;
6253 }
6254 _ACEOF
6255 rm -f conftest.$ac_objext conftest$ac_exeext
6256 if { (eval echo "$as_me:6256: \"$ac_link\"") >&5
6257   (eval $ac_link) 2>&5
6258   ac_status=$?
6259   echo "$as_me:6259: \$? = $ac_status" >&5
6260   (exit $ac_status); } &&
6261          { ac_try='test -s conftest$ac_exeext'
6262   { (eval echo "$as_me:6262: \"$ac_try\"") >&5
6263   (eval $ac_try) 2>&5
6264   ac_status=$?
6265   echo "$as_me:6265: \$? = $ac_status" >&5
6266   (exit $ac_status); }; }; then
6267
6268         cf_cv_find_linkage_utf8=yes
6269         cf_cv_header_path_utf8=/usr/include
6270         cf_cv_library_path_utf8=/usr/lib
6271
6272 else
6273   echo "$as_me: failed program was:" >&5
6274 cat conftest.$ac_ext >&5
6275
6276 LIBS="-lutf8  $cf_save_LIBS"
6277
6278 cat >conftest.$ac_ext <<_ACEOF
6279 #line 6279 "configure"
6280 #include "confdefs.h"
6281
6282 #include <libutf8.h>
6283 int
6284 main (void)
6285 {
6286 putwc(0,0);
6287   ;
6288   return 0;
6289 }
6290 _ACEOF
6291 rm -f conftest.$ac_objext conftest$ac_exeext
6292 if { (eval echo "$as_me:6292: \"$ac_link\"") >&5
6293   (eval $ac_link) 2>&5
6294   ac_status=$?
6295   echo "$as_me:6295: \$? = $ac_status" >&5
6296   (exit $ac_status); } &&
6297          { ac_try='test -s conftest$ac_exeext'
6298   { (eval echo "$as_me:6298: \"$ac_try\"") >&5
6299   (eval $ac_try) 2>&5
6300   ac_status=$?
6301   echo "$as_me:6301: \$? = $ac_status" >&5
6302   (exit $ac_status); }; }; then
6303
6304         cf_cv_find_linkage_utf8=yes
6305         cf_cv_header_path_utf8=/usr/include
6306         cf_cv_library_path_utf8=/usr/lib
6307         cf_cv_library_file_utf8="-lutf8"
6308
6309 else
6310   echo "$as_me: failed program was:" >&5
6311 cat conftest.$ac_ext >&5
6312
6313         cf_cv_find_linkage_utf8=no
6314         LIBS="$cf_save_LIBS"
6315
6316         test -n "$verbose" && echo "    find linkage for utf8 library" 1>&6
6317
6318 echo "${as_me:-configure}:6318: testing find linkage for utf8 library ..." 1>&5
6319
6320 echo "${as_me:-configure}:6320: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
6321
6322         cf_save_CPPFLAGS="$CPPFLAGS"
6323         cf_test_CPPFLAGS="$CPPFLAGS"
6324
6325 cf_search=
6326
6327 # collect the current set of include-directories from compiler flags
6328 cf_header_path_list=""
6329 if test -n "${CFLAGS}${CPPFLAGS}" ; then
6330         for cf_header_path in $CPPFLAGS $CFLAGS
6331         do
6332                 case $cf_header_path in
6333                 (-I*)
6334                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
6335
6336 test "x$cf_header_path" != "xNONE" && \
6337 test -d "$cf_header_path" && \
6338  {
6339         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
6340         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
6341         test -d $cf_header_path/include/utf8 &&       cf_search="$cf_search $cf_header_path/include/utf8"
6342         test -d $cf_header_path/include/utf8/include &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
6343         test -d $cf_header_path/utf8/include &&       cf_search="$cf_search $cf_header_path/utf8/include"
6344         test -d $cf_header_path/utf8/include/utf8 &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
6345 }
6346
6347                         cf_header_path_list="$cf_header_path_list $cf_search"
6348                         ;;
6349                 esac
6350         done
6351 fi
6352
6353 # add the variations for the package we are looking for
6354
6355 cf_search=
6356
6357 test "x$prefix" != "xNONE" && \
6358 test -d "$prefix" && \
6359  {
6360         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
6361         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
6362         test -d $prefix/include/utf8 &&       cf_search="$cf_search $prefix/include/utf8"
6363         test -d $prefix/include/utf8/include &&    cf_search="$cf_search $prefix/include/utf8/include"
6364         test -d $prefix/utf8/include &&       cf_search="$cf_search $prefix/utf8/include"
6365         test -d $prefix/utf8/include/utf8 &&    cf_search="$cf_search $prefix/utf8/include/utf8"
6366 }
6367
6368 for cf_subdir_prefix in \
6369         /usr \
6370         /usr/local \
6371         /usr/pkg \
6372         /opt \
6373         /opt/local \
6374         $HOME
6375 do
6376
6377 test "x$cf_subdir_prefix" != "x$prefix" && \
6378 test -d "$cf_subdir_prefix" && \
6379 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
6380         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
6381         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
6382         test -d $cf_subdir_prefix/include/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/include/utf8"
6383         test -d $cf_subdir_prefix/include/utf8/include &&    cf_search="$cf_search $cf_subdir_prefix/include/utf8/include"
6384         test -d $cf_subdir_prefix/utf8/include &&       cf_search="$cf_search $cf_subdir_prefix/utf8/include"
6385         test -d $cf_subdir_prefix/utf8/include/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/include/utf8"
6386 }
6387
6388 done
6389
6390 test "$includedir" != NONE && \
6391 test "$includedir" != "/usr/include" && \
6392 test -d "$includedir" && {
6393         test -d $includedir &&    cf_search="$cf_search $includedir"
6394         test -d $includedir/utf8 && cf_search="$cf_search $includedir/utf8"
6395 }
6396
6397 test "$oldincludedir" != NONE && \
6398 test "$oldincludedir" != "/usr/include" && \
6399 test -d "$oldincludedir" && {
6400         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
6401         test -d $oldincludedir/utf8 && cf_search="$cf_search $oldincludedir/utf8"
6402 }
6403
6404 cf_search="$cf_search $cf_header_path_list"
6405
6406         for cf_cv_header_path_utf8 in $cf_search
6407         do
6408                 if test -d $cf_cv_header_path_utf8 ; then
6409                         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
6410
6411 echo "${as_me:-configure}:6411: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
6412
6413                         CPPFLAGS="$cf_save_CPPFLAGS -I$cf_cv_header_path_utf8"
6414                         cat >conftest.$ac_ext <<_ACEOF
6415 #line 6415 "configure"
6416 #include "confdefs.h"
6417
6418 #include <libutf8.h>
6419 int
6420 main (void)
6421 {
6422 putwc(0,0);
6423   ;
6424   return 0;
6425 }
6426 _ACEOF
6427 rm -f conftest.$ac_objext
6428 if { (eval echo "$as_me:6428: \"$ac_compile\"") >&5
6429   (eval $ac_compile) 2>&5
6430   ac_status=$?
6431   echo "$as_me:6431: \$? = $ac_status" >&5
6432   (exit $ac_status); } &&
6433          { ac_try='test -s conftest.$ac_objext'
6434   { (eval echo "$as_me:6434: \"$ac_try\"") >&5
6435   (eval $ac_try) 2>&5
6436   ac_status=$?
6437   echo "$as_me:6437: \$? = $ac_status" >&5
6438   (exit $ac_status); }; }; then
6439
6440                                 test -n "$verbose" && echo "    ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
6441
6442 echo "${as_me:-configure}:6442: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
6443
6444                                 cf_cv_find_linkage_utf8=maybe
6445                                 cf_test_CPPFLAGS="$CPPFLAGS"
6446                                 break
6447 else
6448   echo "$as_me: failed program was:" >&5
6449 cat conftest.$ac_ext >&5
6450
6451                                 CPPFLAGS="$cf_save_CPPFLAGS"
6452
6453 fi
6454 rm -f conftest.$ac_objext conftest.$ac_ext
6455                 fi
6456         done
6457
6458         if test "$cf_cv_find_linkage_utf8" = maybe ; then
6459
6460 echo "${as_me:-configure}:6460: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
6461
6462                 cf_save_LIBS="$LIBS"
6463                 cf_save_LDFLAGS="$LDFLAGS"
6464
6465                 if test "$cf_cv_find_linkage_utf8" != yes ; then
6466
6467 cf_search=
6468 cf_library_path_list=""
6469 if test -n "${LDFLAGS}${LIBS}" ; then
6470         for cf_library_path in $LDFLAGS $LIBS
6471         do
6472                 case $cf_library_path in
6473                 (-L*)
6474                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
6475
6476 test "x$cf_library_path" != "xNONE" && \
6477 test -d "$cf_library_path" && \
6478  {
6479         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
6480         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
6481         test -d $cf_library_path/lib/utf8 &&       cf_search="$cf_search $cf_library_path/lib/utf8"
6482         test -d $cf_library_path/lib/utf8/lib &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
6483         test -d $cf_library_path/utf8/lib &&       cf_search="$cf_search $cf_library_path/utf8/lib"
6484         test -d $cf_library_path/utf8/lib/utf8 &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
6485 }
6486
6487                         cf_library_path_list="$cf_library_path_list $cf_search"
6488                         ;;
6489                 esac
6490         done
6491 fi
6492
6493 cf_search=
6494
6495 test "x$prefix" != "xNONE" && \
6496 test -d "$prefix" && \
6497  {
6498         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
6499         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
6500         test -d $prefix/lib/utf8 &&       cf_search="$cf_search $prefix/lib/utf8"
6501         test -d $prefix/lib/utf8/lib &&    cf_search="$cf_search $prefix/lib/utf8/lib"
6502         test -d $prefix/utf8/lib &&       cf_search="$cf_search $prefix/utf8/lib"
6503         test -d $prefix/utf8/lib/utf8 &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
6504 }
6505
6506 for cf_subdir_prefix in \
6507         /usr \
6508         /usr/local \
6509         /usr/pkg \
6510         /opt \
6511         /opt/local \
6512         $HOME
6513 do
6514
6515 test "x$cf_subdir_prefix" != "x$prefix" && \
6516 test -d "$cf_subdir_prefix" && \
6517 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
6518         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
6519         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
6520         test -d $cf_subdir_prefix/lib/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/lib/utf8"
6521         test -d $cf_subdir_prefix/lib/utf8/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/utf8/lib"
6522         test -d $cf_subdir_prefix/utf8/lib &&       cf_search="$cf_search $cf_subdir_prefix/utf8/lib"
6523         test -d $cf_subdir_prefix/utf8/lib/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/lib/utf8"
6524 }
6525
6526 done
6527
6528 cf_search="$cf_library_path_list $cf_search"
6529
6530                         for cf_cv_library_path_utf8 in $cf_search
6531                         do
6532                                 if test -d $cf_cv_library_path_utf8 ; then
6533                                         test -n "$verbose" && echo "    ... testing $cf_cv_library_path_utf8" 1>&6
6534
6535 echo "${as_me:-configure}:6535: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
6536
6537                                         CPPFLAGS="$cf_test_CPPFLAGS"
6538                                         LIBS="-lutf8  $cf_save_LIBS"
6539                                         LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
6540                                         cat >conftest.$ac_ext <<_ACEOF
6541 #line 6541 "configure"
6542 #include "confdefs.h"
6543
6544 #include <libutf8.h>
6545 int
6546 main (void)
6547 {
6548 putwc(0,0);
6549   ;
6550   return 0;
6551 }
6552 _ACEOF
6553 rm -f conftest.$ac_objext conftest$ac_exeext
6554 if { (eval echo "$as_me:6554: \"$ac_link\"") >&5
6555   (eval $ac_link) 2>&5
6556   ac_status=$?
6557   echo "$as_me:6557: \$? = $ac_status" >&5
6558   (exit $ac_status); } &&
6559          { ac_try='test -s conftest$ac_exeext'
6560   { (eval echo "$as_me:6560: \"$ac_try\"") >&5
6561   (eval $ac_try) 2>&5
6562   ac_status=$?
6563   echo "$as_me:6563: \$? = $ac_status" >&5
6564   (exit $ac_status); }; }; then
6565
6566                                         test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
6567
6568 echo "${as_me:-configure}:6568: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
6569
6570                                         cf_cv_find_linkage_utf8=yes
6571                                         cf_cv_library_file_utf8="-lutf8"
6572                                         break
6573 else
6574   echo "$as_me: failed program was:" >&5
6575 cat conftest.$ac_ext >&5
6576
6577                                         CPPFLAGS="$cf_save_CPPFLAGS"
6578                                         LIBS="$cf_save_LIBS"
6579                                         LDFLAGS="$cf_save_LDFLAGS"
6580
6581 fi
6582 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6583                                 fi
6584                         done
6585                         CPPFLAGS="$cf_save_CPPFLAGS"
6586                         LDFLAGS="$cf_save_LDFLAGS"
6587                 fi
6588
6589         else
6590                 cf_cv_find_linkage_utf8=no
6591         fi
6592
6593 fi
6594 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6595
6596 fi
6597 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6598
6599 LIBS="$cf_save_LIBS"
6600
6601 if test "$cf_cv_find_linkage_utf8" = yes ; then
6602 cf_cv_utf8_lib=add-on
6603 else
6604 cf_cv_utf8_lib=no
6605 fi
6606
6607 fi
6608 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6609 fi
6610 echo "$as_me:6610: result: $cf_cv_utf8_lib" >&5
6611 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
6612
6613 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
6614 # ncurses/ncursesw:
6615 if test "$cf_cv_utf8_lib" = "add-on" ; then
6616
6617 cat >>confdefs.h <<\EOF
6618 #define HAVE_LIBUTF8_H 1
6619 EOF
6620
6621 if test -n "$cf_cv_header_path_utf8" ; then
6622   for cf_add_incdir in $cf_cv_header_path_utf8
6623   do
6624         while test $cf_add_incdir != /usr/include
6625         do
6626           if test -d $cf_add_incdir
6627           then
6628                 cf_have_incdir=no
6629                 if test -n "$CFLAGS$CPPFLAGS" ; then
6630                   # a loop is needed to ensure we can add subdirs of existing dirs
6631                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6632                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6633                           cf_have_incdir=yes; break
6634                         fi
6635                   done
6636                 fi
6637
6638                 if test "$cf_have_incdir" = no ; then
6639                   if test "$cf_add_incdir" = /usr/local/include ; then
6640                         if test "$GCC" = yes
6641                         then
6642                           cf_save_CPPFLAGS=$CPPFLAGS
6643                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6644                           cat >conftest.$ac_ext <<_ACEOF
6645 #line 6645 "configure"
6646 #include "confdefs.h"
6647 #include <stdio.h>
6648 int
6649 main (void)
6650 {
6651 printf("Hello")
6652   ;
6653   return 0;
6654 }
6655 _ACEOF
6656 rm -f conftest.$ac_objext
6657 if { (eval echo "$as_me:6657: \"$ac_compile\"") >&5
6658   (eval $ac_compile) 2>&5
6659   ac_status=$?
6660   echo "$as_me:6660: \$? = $ac_status" >&5
6661   (exit $ac_status); } &&
6662          { ac_try='test -s conftest.$ac_objext'
6663   { (eval echo "$as_me:6663: \"$ac_try\"") >&5
6664   (eval $ac_try) 2>&5
6665   ac_status=$?
6666   echo "$as_me:6666: \$? = $ac_status" >&5
6667   (exit $ac_status); }; }; then
6668   :
6669 else
6670   echo "$as_me: failed program was:" >&5
6671 cat conftest.$ac_ext >&5
6672 cf_have_incdir=yes
6673 fi
6674 rm -f conftest.$ac_objext conftest.$ac_ext
6675                           CPPFLAGS=$cf_save_CPPFLAGS
6676                         fi
6677                   fi
6678                 fi
6679
6680                 if test "$cf_have_incdir" = no ; then
6681                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6682
6683 echo "${as_me:-configure}:6683: testing adding $cf_add_incdir to include-path ..." 1>&5
6684
6685                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6686
6687                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6688                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6689                   cf_add_incdir="$cf_top_incdir"
6690                 else
6691                   break
6692                 fi
6693           else
6694                 break
6695           fi
6696         done
6697   done
6698 fi
6699
6700 if test -n "$cf_cv_library_path_utf8" ; then
6701         for cf_add_libdir in $cf_cv_library_path_utf8
6702         do
6703                 if test $cf_add_libdir = /usr/lib ; then
6704                         :
6705                 elif test -d $cf_add_libdir
6706                 then
6707                         cf_have_libdir=no
6708                         if test -n "$LDFLAGS$LIBS" ; then
6709                                 # a loop is needed to ensure we can add subdirs of existing dirs
6710                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6711                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6712                                                 cf_have_libdir=yes; break
6713                                         fi
6714                                 done
6715                         fi
6716                         if test "$cf_have_libdir" = no ; then
6717                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6718
6719 echo "${as_me:-configure}:6719: testing adding $cf_add_libdir to library-path ..." 1>&5
6720
6721                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6722                         fi
6723                 fi
6724         done
6725 fi
6726
6727 cf_add_libs="$cf_cv_library_file_utf8"
6728 # Filter out duplicates - this happens with badly-designed ".pc" files...
6729 for cf_add_1lib in $LIBS
6730 do
6731         for cf_add_2lib in $cf_add_libs
6732         do
6733                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6734                 then
6735                         cf_add_1lib=
6736                         break
6737                 fi
6738         done
6739         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6740 done
6741 LIBS="$cf_add_libs"
6742
6743 fi
6744
6745 cf_ncuconfig_root=$cf_cv_screen
6746 cf_have_ncuconfig=no
6747
6748 if test "x${PKG_CONFIG:=none}" != xnone; then
6749         echo "$as_me:6749: checking pkg-config for $cf_ncuconfig_root" >&5
6750 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
6751         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
6752                 echo "$as_me:6752: result: yes" >&5
6753 echo "${ECHO_T}yes" >&6
6754
6755                 echo "$as_me:6755: checking if the $cf_ncuconfig_root package files work" >&5
6756 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
6757                 cf_have_ncuconfig=unknown
6758
6759                 cf_save_CPPFLAGS="$CPPFLAGS"
6760                 cf_save_LIBS="$LIBS"
6761
6762                 CPPFLAGS="$CPPFLAGS `$PKG_CONFIG --cflags $cf_ncuconfig_root`"
6763
6764 cf_add_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
6765 # Filter out duplicates - this happens with badly-designed ".pc" files...
6766 for cf_add_1lib in $LIBS
6767 do
6768         for cf_add_2lib in $cf_add_libs
6769         do
6770                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6771                 then
6772                         cf_add_1lib=
6773                         break
6774                 fi
6775         done
6776         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6777 done
6778 LIBS="$cf_add_libs"
6779
6780                 cat >conftest.$ac_ext <<_ACEOF
6781 #line 6781 "configure"
6782 #include "confdefs.h"
6783 #include <${cf_cv_ncurses_header:-curses.h}>
6784 int
6785 main (void)
6786 {
6787 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
6788   ;
6789   return 0;
6790 }
6791 _ACEOF
6792 rm -f conftest.$ac_objext conftest$ac_exeext
6793 if { (eval echo "$as_me:6793: \"$ac_link\"") >&5
6794   (eval $ac_link) 2>&5
6795   ac_status=$?
6796   echo "$as_me:6796: \$? = $ac_status" >&5
6797   (exit $ac_status); } &&
6798          { ac_try='test -s conftest$ac_exeext'
6799   { (eval echo "$as_me:6799: \"$ac_try\"") >&5
6800   (eval $ac_try) 2>&5
6801   ac_status=$?
6802   echo "$as_me:6802: \$? = $ac_status" >&5
6803   (exit $ac_status); }; }; then
6804   if test "$cross_compiling" = yes; then
6805   cf_have_ncuconfig=maybe
6806 else
6807   cat >conftest.$ac_ext <<_ACEOF
6808 #line 6808 "configure"
6809 #include "confdefs.h"
6810 #include <${cf_cv_ncurses_header:-curses.h}>
6811                                 int main(void)
6812                                 { char *xx = curses_version(); return (xx == 0); }
6813 _ACEOF
6814 rm -f conftest$ac_exeext
6815 if { (eval echo "$as_me:6815: \"$ac_link\"") >&5
6816   (eval $ac_link) 2>&5
6817   ac_status=$?
6818   echo "$as_me:6818: \$? = $ac_status" >&5
6819   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
6820   { (eval echo "$as_me:6820: \"$ac_try\"") >&5
6821   (eval $ac_try) 2>&5
6822   ac_status=$?
6823   echo "$as_me:6823: \$? = $ac_status" >&5
6824   (exit $ac_status); }; }; then
6825   cf_have_ncuconfig=yes
6826 else
6827   echo "$as_me: program exited with status $ac_status" >&5
6828 echo "$as_me: failed program was:" >&5
6829 cat conftest.$ac_ext >&5
6830 cf_have_ncuconfig=no
6831 fi
6832 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
6833 fi
6834 else
6835   echo "$as_me: failed program was:" >&5
6836 cat conftest.$ac_ext >&5
6837 cf_have_ncuconfig=no
6838 fi
6839 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6840                 echo "$as_me:6840: result: $cf_have_ncuconfig" >&5
6841 echo "${ECHO_T}$cf_have_ncuconfig" >&6
6842                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
6843                 if test "$cf_have_ncuconfig" != "yes"
6844                 then
6845                         CPPFLAGS="$cf_save_CPPFLAGS"
6846                         LIBS="$cf_save_LIBS"
6847                         NCURSES_CONFIG_PKG=none
6848                 else
6849
6850 cat >>confdefs.h <<\EOF
6851 #define NCURSES 1
6852 EOF
6853
6854                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
6855                 fi
6856
6857 echo "$as_me:6857: checking for terminfo header" >&5
6858 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
6859 if test "${cf_cv_term_header+set}" = set; then
6860   echo $ECHO_N "(cached) $ECHO_C" >&6
6861 else
6862
6863 case ${cf_cv_ncurses_header} in
6864 (*/ncurses.h|*/ncursesw.h)
6865         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
6866         ;;
6867 (*)
6868         cf_term_header=term.h
6869         ;;
6870 esac
6871
6872 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
6873 do
6874 cat >conftest.$ac_ext <<_ACEOF
6875 #line 6875 "configure"
6876 #include "confdefs.h"
6877 #include <stdio.h>
6878 #include <${cf_cv_ncurses_header:-curses.h}>
6879 #include <$cf_test>
6880
6881 int
6882 main (void)
6883 {
6884 int x = auto_left_margin
6885   ;
6886   return 0;
6887 }
6888 _ACEOF
6889 rm -f conftest.$ac_objext
6890 if { (eval echo "$as_me:6890: \"$ac_compile\"") >&5
6891   (eval $ac_compile) 2>&5
6892   ac_status=$?
6893   echo "$as_me:6893: \$? = $ac_status" >&5
6894   (exit $ac_status); } &&
6895          { ac_try='test -s conftest.$ac_objext'
6896   { (eval echo "$as_me:6896: \"$ac_try\"") >&5
6897   (eval $ac_try) 2>&5
6898   ac_status=$?
6899   echo "$as_me:6899: \$? = $ac_status" >&5
6900   (exit $ac_status); }; }; then
6901
6902         cf_cv_term_header="$cf_test"
6903 else
6904   echo "$as_me: failed program was:" >&5
6905 cat conftest.$ac_ext >&5
6906
6907         cf_cv_term_header=unknown
6908
6909 fi
6910 rm -f conftest.$ac_objext conftest.$ac_ext
6911         test "$cf_cv_term_header" != unknown && break
6912 done
6913
6914 fi
6915 echo "$as_me:6915: result: $cf_cv_term_header" >&5
6916 echo "${ECHO_T}$cf_cv_term_header" >&6
6917
6918 # Set definitions to allow ifdef'ing to accommodate subdirectories
6919
6920 case $cf_cv_term_header in
6921 (*term.h)
6922
6923 cat >>confdefs.h <<\EOF
6924 #define HAVE_TERM_H 1
6925 EOF
6926
6927         ;;
6928 esac
6929
6930 case $cf_cv_term_header in
6931 (ncurses/term.h)
6932
6933 cat >>confdefs.h <<\EOF
6934 #define HAVE_NCURSES_TERM_H 1
6935 EOF
6936
6937         ;;
6938 (ncursesw/term.h)
6939
6940 cat >>confdefs.h <<\EOF
6941 #define HAVE_NCURSESW_TERM_H 1
6942 EOF
6943
6944         ;;
6945 esac
6946
6947         else
6948                 echo "$as_me:6948: result: no" >&5
6949 echo "${ECHO_T}no" >&6
6950                 NCURSES_CONFIG_PKG=none
6951         fi
6952 else
6953         NCURSES_CONFIG_PKG=none
6954 fi
6955
6956 if test "x$cf_have_ncuconfig" = "xno"; then
6957         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
6958
6959 if test -n "$ac_tool_prefix"; then
6960   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
6961   do
6962     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
6963 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
6964 echo "$as_me:6964: checking for $ac_word" >&5
6965 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
6966 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
6967   echo $ECHO_N "(cached) $ECHO_C" >&6
6968 else
6969   if test -n "$NCURSES_CONFIG"; then
6970   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
6971 else
6972   ac_save_IFS=$IFS; IFS=$ac_path_separator
6973 ac_dummy="$PATH"
6974 for ac_dir in $ac_dummy; do
6975   IFS=$ac_save_IFS
6976   test -z "$ac_dir" && ac_dir=.
6977   $as_executable_p "$ac_dir/$ac_word" || continue
6978 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
6979 echo "$as_me:6979: found $ac_dir/$ac_word" >&5
6980 break
6981 done
6982
6983 fi
6984 fi
6985 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
6986 if test -n "$NCURSES_CONFIG"; then
6987   echo "$as_me:6987: result: $NCURSES_CONFIG" >&5
6988 echo "${ECHO_T}$NCURSES_CONFIG" >&6
6989 else
6990   echo "$as_me:6990: result: no" >&5
6991 echo "${ECHO_T}no" >&6
6992 fi
6993
6994     test -n "$NCURSES_CONFIG" && break
6995   done
6996 fi
6997 if test -z "$NCURSES_CONFIG"; then
6998   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
6999   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7000 do
7001   # Extract the first word of "$ac_prog", so it can be a program name with args.
7002 set dummy $ac_prog; ac_word=$2
7003 echo "$as_me:7003: checking for $ac_word" >&5
7004 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7005 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
7006   echo $ECHO_N "(cached) $ECHO_C" >&6
7007 else
7008   if test -n "$ac_ct_NCURSES_CONFIG"; then
7009   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
7010 else
7011   ac_save_IFS=$IFS; IFS=$ac_path_separator
7012 ac_dummy="$PATH"
7013 for ac_dir in $ac_dummy; do
7014   IFS=$ac_save_IFS
7015   test -z "$ac_dir" && ac_dir=.
7016   $as_executable_p "$ac_dir/$ac_word" || continue
7017 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
7018 echo "$as_me:7018: found $ac_dir/$ac_word" >&5
7019 break
7020 done
7021
7022 fi
7023 fi
7024 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
7025 if test -n "$ac_ct_NCURSES_CONFIG"; then
7026   echo "$as_me:7026: result: $ac_ct_NCURSES_CONFIG" >&5
7027 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
7028 else
7029   echo "$as_me:7029: result: no" >&5
7030 echo "${ECHO_T}no" >&6
7031 fi
7032
7033   test -n "$ac_ct_NCURSES_CONFIG" && break
7034 done
7035 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
7036
7037   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
7038 fi
7039
7040         if test "$NCURSES_CONFIG" != none ; then
7041
7042                 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
7043
7044 cf_add_libs="`$NCURSES_CONFIG --libs`"
7045 # Filter out duplicates - this happens with badly-designed ".pc" files...
7046 for cf_add_1lib in $LIBS
7047 do
7048         for cf_add_2lib in $cf_add_libs
7049         do
7050                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7051                 then
7052                         cf_add_1lib=
7053                         break
7054                 fi
7055         done
7056         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7057 done
7058 LIBS="$cf_add_libs"
7059
7060                 # even with config script, some packages use no-override for curses.h
7061
7062 echo "$as_me:7062: checking if we have identified curses headers" >&5
7063 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
7064 if test "${cf_cv_ncurses_header+set}" = set; then
7065   echo $ECHO_N "(cached) $ECHO_C" >&6
7066 else
7067
7068 cf_cv_ncurses_header=none
7069 for cf_header in \
7070         ncurses.h $cf_cv_screen/ncurses.h \
7071         curses.h $cf_cv_screen/curses.h
7072 do
7073 cat >conftest.$ac_ext <<_ACEOF
7074 #line 7074 "configure"
7075 #include "confdefs.h"
7076 #include <${cf_header}>
7077 int
7078 main (void)
7079 {
7080 initscr(); tgoto("?", 0,0)
7081   ;
7082   return 0;
7083 }
7084 _ACEOF
7085 rm -f conftest.$ac_objext
7086 if { (eval echo "$as_me:7086: \"$ac_compile\"") >&5
7087   (eval $ac_compile) 2>&5
7088   ac_status=$?
7089   echo "$as_me:7089: \$? = $ac_status" >&5
7090   (exit $ac_status); } &&
7091          { ac_try='test -s conftest.$ac_objext'
7092   { (eval echo "$as_me:7092: \"$ac_try\"") >&5
7093   (eval $ac_try) 2>&5
7094   ac_status=$?
7095   echo "$as_me:7095: \$? = $ac_status" >&5
7096   (exit $ac_status); }; }; then
7097   cf_cv_ncurses_header=$cf_header; break
7098 else
7099   echo "$as_me: failed program was:" >&5
7100 cat conftest.$ac_ext >&5
7101 fi
7102 rm -f conftest.$ac_objext conftest.$ac_ext
7103 done
7104
7105 fi
7106 echo "$as_me:7106: result: $cf_cv_ncurses_header" >&5
7107 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
7108
7109 if test "$cf_cv_ncurses_header" = none ; then
7110         { { echo "$as_me:7110: error: No curses header-files found" >&5
7111 echo "$as_me: error: No curses header-files found" >&2;}
7112    { (exit 1); exit 1; }; }
7113 fi
7114
7115 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
7116
7117 for ac_header in $cf_cv_ncurses_header
7118 do
7119 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
7120 echo "$as_me:7120: checking for $ac_header" >&5
7121 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
7122 if eval "test \"\${$as_ac_Header+set}\" = set"; then
7123   echo $ECHO_N "(cached) $ECHO_C" >&6
7124 else
7125   cat >conftest.$ac_ext <<_ACEOF
7126 #line 7126 "configure"
7127 #include "confdefs.h"
7128 #include <$ac_header>
7129 _ACEOF
7130 if { (eval echo "$as_me:7130: \"$ac_cpp conftest.$ac_ext\"") >&5
7131   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
7132   ac_status=$?
7133   egrep -v '^ *\+' conftest.er1 >conftest.err
7134   rm -f conftest.er1
7135   cat conftest.err >&5
7136   echo "$as_me:7136: \$? = $ac_status" >&5
7137   (exit $ac_status); } >/dev/null; then
7138   if test -s conftest.err; then
7139     ac_cpp_err=$ac_c_preproc_warn_flag
7140   else
7141     ac_cpp_err=
7142   fi
7143 else
7144   ac_cpp_err=yes
7145 fi
7146 if test -z "$ac_cpp_err"; then
7147   eval "$as_ac_Header=yes"
7148 else
7149   echo "$as_me: failed program was:" >&5
7150   cat conftest.$ac_ext >&5
7151   eval "$as_ac_Header=no"
7152 fi
7153 rm -f conftest.err conftest.$ac_ext
7154 fi
7155 echo "$as_me:7155: result: `eval echo '${'$as_ac_Header'}'`" >&5
7156 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
7157 if test `eval echo '${'$as_ac_Header'}'` = yes; then
7158   cat >>confdefs.h <<EOF
7159 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
7160 EOF
7161
7162 fi
7163 done
7164
7165 cat >>confdefs.h <<\EOF
7166 #define NCURSES 1
7167 EOF
7168
7169 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
7170
7171                 cat >>confdefs.h <<EOF
7172 #define $cf_nculib_ROOT 1
7173 EOF
7174
7175                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
7176
7177         else
7178
7179 cf_ncuhdr_root=$cf_cv_screen
7180
7181 test -n "$cf_cv_curses_dir" && \
7182 test "$cf_cv_curses_dir" != "no" && { \
7183
7184 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
7185   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
7186   do
7187         while test $cf_add_incdir != /usr/include
7188         do
7189           if test -d $cf_add_incdir
7190           then
7191                 cf_have_incdir=no
7192                 if test -n "$CFLAGS$CPPFLAGS" ; then
7193                   # a loop is needed to ensure we can add subdirs of existing dirs
7194                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7195                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7196                           cf_have_incdir=yes; break
7197                         fi
7198                   done
7199                 fi
7200
7201                 if test "$cf_have_incdir" = no ; then
7202                   if test "$cf_add_incdir" = /usr/local/include ; then
7203                         if test "$GCC" = yes
7204                         then
7205                           cf_save_CPPFLAGS=$CPPFLAGS
7206                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7207                           cat >conftest.$ac_ext <<_ACEOF
7208 #line 7208 "configure"
7209 #include "confdefs.h"
7210 #include <stdio.h>
7211 int
7212 main (void)
7213 {
7214 printf("Hello")
7215   ;
7216   return 0;
7217 }
7218 _ACEOF
7219 rm -f conftest.$ac_objext
7220 if { (eval echo "$as_me:7220: \"$ac_compile\"") >&5
7221   (eval $ac_compile) 2>&5
7222   ac_status=$?
7223   echo "$as_me:7223: \$? = $ac_status" >&5
7224   (exit $ac_status); } &&
7225          { ac_try='test -s conftest.$ac_objext'
7226   { (eval echo "$as_me:7226: \"$ac_try\"") >&5
7227   (eval $ac_try) 2>&5
7228   ac_status=$?
7229   echo "$as_me:7229: \$? = $ac_status" >&5
7230   (exit $ac_status); }; }; then
7231   :
7232 else
7233   echo "$as_me: failed program was:" >&5
7234 cat conftest.$ac_ext >&5
7235 cf_have_incdir=yes
7236 fi
7237 rm -f conftest.$ac_objext conftest.$ac_ext
7238                           CPPFLAGS=$cf_save_CPPFLAGS
7239                         fi
7240                   fi
7241                 fi
7242
7243                 if test "$cf_have_incdir" = no ; then
7244                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7245
7246 echo "${as_me:-configure}:7246: testing adding $cf_add_incdir to include-path ..." 1>&5
7247
7248                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7249
7250                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7251                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7252                   cf_add_incdir="$cf_top_incdir"
7253                 else
7254                   break
7255                 fi
7256           else
7257                 break
7258           fi
7259         done
7260   done
7261 fi
7262
7263 }
7264
7265 echo "$as_me:7265: checking for $cf_ncuhdr_root header in include-path" >&5
7266 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
7267 if test "${cf_cv_ncurses_h+set}" = set; then
7268   echo $ECHO_N "(cached) $ECHO_C" >&6
7269 else
7270
7271         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
7272         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
7273         for cf_header in $cf_header_list
7274         do
7275
7276         cat >conftest.$ac_ext <<_ACEOF
7277 #line 7277 "configure"
7278 #include "confdefs.h"
7279
7280 #include <$cf_header>
7281 int
7282 main (void)
7283 {
7284
7285 #ifdef NCURSES_VERSION
7286
7287 printf("%s\n", NCURSES_VERSION);
7288 #else
7289 #ifdef __NCURSES_H
7290 printf("old\n");
7291 #else
7292         make an error
7293 #endif
7294 #endif
7295
7296   ;
7297   return 0;
7298 }
7299 _ACEOF
7300 rm -f conftest.$ac_objext
7301 if { (eval echo "$as_me:7301: \"$ac_compile\"") >&5
7302   (eval $ac_compile) 2>&5
7303   ac_status=$?
7304   echo "$as_me:7304: \$? = $ac_status" >&5
7305   (exit $ac_status); } &&
7306          { ac_try='test -s conftest.$ac_objext'
7307   { (eval echo "$as_me:7307: \"$ac_try\"") >&5
7308   (eval $ac_try) 2>&5
7309   ac_status=$?
7310   echo "$as_me:7310: \$? = $ac_status" >&5
7311   (exit $ac_status); }; }; then
7312   cf_cv_ncurses_h=$cf_header
7313
7314 else
7315   echo "$as_me: failed program was:" >&5
7316 cat conftest.$ac_ext >&5
7317 cf_cv_ncurses_h=no
7318 fi
7319 rm -f conftest.$ac_objext conftest.$ac_ext
7320
7321                 test "$cf_cv_ncurses_h" != no && break
7322         done
7323
7324 fi
7325 echo "$as_me:7325: result: $cf_cv_ncurses_h" >&5
7326 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
7327
7328 if test "$cf_cv_ncurses_h" != no ; then
7329         cf_cv_ncurses_header=$cf_cv_ncurses_h
7330 else
7331
7332 echo "$as_me:7332: checking for $cf_ncuhdr_root include-path" >&5
7333 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
7334 if test "${cf_cv_ncurses_h2+set}" = set; then
7335   echo $ECHO_N "(cached) $ECHO_C" >&6
7336 else
7337
7338         test -n "$verbose" && echo
7339
7340 cf_search=
7341
7342 # collect the current set of include-directories from compiler flags
7343 cf_header_path_list=""
7344 if test -n "${CFLAGS}${CPPFLAGS}" ; then
7345         for cf_header_path in $CPPFLAGS $CFLAGS
7346         do
7347                 case $cf_header_path in
7348                 (-I*)
7349                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
7350
7351 test "x$cf_header_path" != "xNONE" && \
7352 test -d "$cf_header_path" && \
7353  {
7354         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
7355         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
7356         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
7357         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
7358         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
7359         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"
7360 }
7361
7362                         cf_header_path_list="$cf_header_path_list $cf_search"
7363                         ;;
7364                 esac
7365         done
7366 fi
7367
7368 # add the variations for the package we are looking for
7369
7370 cf_search=
7371
7372 test "x$prefix" != "xNONE" && \
7373 test -d "$prefix" && \
7374  {
7375         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
7376         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
7377         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
7378         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
7379         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
7380         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
7381 }
7382
7383 for cf_subdir_prefix in \
7384         /usr \
7385         /usr/local \
7386         /usr/pkg \
7387         /opt \
7388         /opt/local \
7389         $HOME
7390 do
7391
7392 test "x$cf_subdir_prefix" != "x$prefix" && \
7393 test -d "$cf_subdir_prefix" && \
7394 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
7395         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
7396         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
7397         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
7398         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
7399         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
7400         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"
7401 }
7402
7403 done
7404
7405 test "$includedir" != NONE && \
7406 test "$includedir" != "/usr/include" && \
7407 test -d "$includedir" && {
7408         test -d $includedir &&    cf_search="$cf_search $includedir"
7409         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
7410 }
7411
7412 test "$oldincludedir" != NONE && \
7413 test "$oldincludedir" != "/usr/include" && \
7414 test -d "$oldincludedir" && {
7415         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
7416         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
7417 }
7418
7419 cf_search="$cf_search $cf_header_path_list"
7420
7421         test -n "$verbose" && echo search path $cf_search
7422         cf_save2_CPPFLAGS="$CPPFLAGS"
7423         for cf_incdir in $cf_search
7424         do
7425
7426 if test -n "$cf_incdir" ; then
7427   for cf_add_incdir in $cf_incdir
7428   do
7429         while test $cf_add_incdir != /usr/include
7430         do
7431           if test -d $cf_add_incdir
7432           then
7433                 cf_have_incdir=no
7434                 if test -n "$CFLAGS$CPPFLAGS" ; then
7435                   # a loop is needed to ensure we can add subdirs of existing dirs
7436                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7437                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7438                           cf_have_incdir=yes; break
7439                         fi
7440                   done
7441                 fi
7442
7443                 if test "$cf_have_incdir" = no ; then
7444                   if test "$cf_add_incdir" = /usr/local/include ; then
7445                         if test "$GCC" = yes
7446                         then
7447                           cf_save_CPPFLAGS=$CPPFLAGS
7448                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7449                           cat >conftest.$ac_ext <<_ACEOF
7450 #line 7450 "configure"
7451 #include "confdefs.h"
7452 #include <stdio.h>
7453 int
7454 main (void)
7455 {
7456 printf("Hello")
7457   ;
7458   return 0;
7459 }
7460 _ACEOF
7461 rm -f conftest.$ac_objext
7462 if { (eval echo "$as_me:7462: \"$ac_compile\"") >&5
7463   (eval $ac_compile) 2>&5
7464   ac_status=$?
7465   echo "$as_me:7465: \$? = $ac_status" >&5
7466   (exit $ac_status); } &&
7467          { ac_try='test -s conftest.$ac_objext'
7468   { (eval echo "$as_me:7468: \"$ac_try\"") >&5
7469   (eval $ac_try) 2>&5
7470   ac_status=$?
7471   echo "$as_me:7471: \$? = $ac_status" >&5
7472   (exit $ac_status); }; }; then
7473   :
7474 else
7475   echo "$as_me: failed program was:" >&5
7476 cat conftest.$ac_ext >&5
7477 cf_have_incdir=yes
7478 fi
7479 rm -f conftest.$ac_objext conftest.$ac_ext
7480                           CPPFLAGS=$cf_save_CPPFLAGS
7481                         fi
7482                   fi
7483                 fi
7484
7485                 if test "$cf_have_incdir" = no ; then
7486                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7487
7488 echo "${as_me:-configure}:7488: testing adding $cf_add_incdir to include-path ..." 1>&5
7489
7490                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7491
7492                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7493                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7494                   cf_add_incdir="$cf_top_incdir"
7495                 else
7496                   break
7497                 fi
7498           else
7499                 break
7500           fi
7501         done
7502   done
7503 fi
7504
7505                 for cf_header in \
7506                         ncurses.h \
7507                         curses.h
7508                 do
7509
7510         cat >conftest.$ac_ext <<_ACEOF
7511 #line 7511 "configure"
7512 #include "confdefs.h"
7513
7514 #include <$cf_header>
7515 int
7516 main (void)
7517 {
7518
7519 #ifdef NCURSES_VERSION
7520
7521 printf("%s\n", NCURSES_VERSION);
7522 #else
7523 #ifdef __NCURSES_H
7524 printf("old\n");
7525 #else
7526         make an error
7527 #endif
7528 #endif
7529
7530   ;
7531   return 0;
7532 }
7533 _ACEOF
7534 rm -f conftest.$ac_objext
7535 if { (eval echo "$as_me:7535: \"$ac_compile\"") >&5
7536   (eval $ac_compile) 2>&5
7537   ac_status=$?
7538   echo "$as_me:7538: \$? = $ac_status" >&5
7539   (exit $ac_status); } &&
7540          { ac_try='test -s conftest.$ac_objext'
7541   { (eval echo "$as_me:7541: \"$ac_try\"") >&5
7542   (eval $ac_try) 2>&5
7543   ac_status=$?
7544   echo "$as_me:7544: \$? = $ac_status" >&5
7545   (exit $ac_status); }; }; then
7546   cf_cv_ncurses_h2=$cf_header
7547
7548 else
7549   echo "$as_me: failed program was:" >&5
7550 cat conftest.$ac_ext >&5
7551 cf_cv_ncurses_h2=no
7552 fi
7553 rm -f conftest.$ac_objext conftest.$ac_ext
7554
7555                         if test "$cf_cv_ncurses_h2" != no ; then
7556                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
7557                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
7558                                 break
7559                         fi
7560                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
7561                 done
7562                 CPPFLAGS="$cf_save2_CPPFLAGS"
7563                 test "$cf_cv_ncurses_h2" != no && break
7564         done
7565         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:7565: error: not found" >&5
7566 echo "$as_me: error: not found" >&2;}
7567    { (exit 1); exit 1; }; }
7568
7569 fi
7570 echo "$as_me:7570: result: $cf_cv_ncurses_h2" >&5
7571 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
7572
7573         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
7574         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
7575         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
7576                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
7577         fi
7578
7579 if test -n "$cf_1st_incdir" ; then
7580   for cf_add_incdir in $cf_1st_incdir
7581   do
7582         while test $cf_add_incdir != /usr/include
7583         do
7584           if test -d $cf_add_incdir
7585           then
7586                 cf_have_incdir=no
7587                 if test -n "$CFLAGS$CPPFLAGS" ; then
7588                   # a loop is needed to ensure we can add subdirs of existing dirs
7589                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7590                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7591                           cf_have_incdir=yes; break
7592                         fi
7593                   done
7594                 fi
7595
7596                 if test "$cf_have_incdir" = no ; then
7597                   if test "$cf_add_incdir" = /usr/local/include ; then
7598                         if test "$GCC" = yes
7599                         then
7600                           cf_save_CPPFLAGS=$CPPFLAGS
7601                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7602                           cat >conftest.$ac_ext <<_ACEOF
7603 #line 7603 "configure"
7604 #include "confdefs.h"
7605 #include <stdio.h>
7606 int
7607 main (void)
7608 {
7609 printf("Hello")
7610   ;
7611   return 0;
7612 }
7613 _ACEOF
7614 rm -f conftest.$ac_objext
7615 if { (eval echo "$as_me:7615: \"$ac_compile\"") >&5
7616   (eval $ac_compile) 2>&5
7617   ac_status=$?
7618   echo "$as_me:7618: \$? = $ac_status" >&5
7619   (exit $ac_status); } &&
7620          { ac_try='test -s conftest.$ac_objext'
7621   { (eval echo "$as_me:7621: \"$ac_try\"") >&5
7622   (eval $ac_try) 2>&5
7623   ac_status=$?
7624   echo "$as_me:7624: \$? = $ac_status" >&5
7625   (exit $ac_status); }; }; then
7626   :
7627 else
7628   echo "$as_me: failed program was:" >&5
7629 cat conftest.$ac_ext >&5
7630 cf_have_incdir=yes
7631 fi
7632 rm -f conftest.$ac_objext conftest.$ac_ext
7633                           CPPFLAGS=$cf_save_CPPFLAGS
7634                         fi
7635                   fi
7636                 fi
7637
7638                 if test "$cf_have_incdir" = no ; then
7639                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7640
7641 echo "${as_me:-configure}:7641: testing adding $cf_add_incdir to include-path ..." 1>&5
7642
7643                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7644
7645                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7646                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7647                   cf_add_incdir="$cf_top_incdir"
7648                 else
7649                   break
7650                 fi
7651           else
7652                 break
7653           fi
7654         done
7655   done
7656 fi
7657
7658 fi
7659
7660 # Set definitions to allow ifdef'ing for ncurses.h
7661
7662 case $cf_cv_ncurses_header in
7663 (*ncurses.h)
7664
7665 cat >>confdefs.h <<\EOF
7666 #define HAVE_NCURSES_H 1
7667 EOF
7668
7669         ;;
7670 esac
7671
7672 case $cf_cv_ncurses_header in
7673 (ncurses/curses.h|ncurses/ncurses.h)
7674
7675 cat >>confdefs.h <<\EOF
7676 #define HAVE_NCURSES_NCURSES_H 1
7677 EOF
7678
7679         ;;
7680 (ncursesw/curses.h|ncursesw/ncurses.h)
7681
7682 cat >>confdefs.h <<\EOF
7683 #define HAVE_NCURSESW_NCURSES_H 1
7684 EOF
7685
7686         ;;
7687 esac
7688
7689 echo "$as_me:7689: checking for terminfo header" >&5
7690 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
7691 if test "${cf_cv_term_header+set}" = set; then
7692   echo $ECHO_N "(cached) $ECHO_C" >&6
7693 else
7694
7695 case ${cf_cv_ncurses_header} in
7696 (*/ncurses.h|*/ncursesw.h)
7697         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
7698         ;;
7699 (*)
7700         cf_term_header=term.h
7701         ;;
7702 esac
7703
7704 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
7705 do
7706 cat >conftest.$ac_ext <<_ACEOF
7707 #line 7707 "configure"
7708 #include "confdefs.h"
7709 #include <stdio.h>
7710 #include <${cf_cv_ncurses_header:-curses.h}>
7711 #include <$cf_test>
7712
7713 int
7714 main (void)
7715 {
7716 int x = auto_left_margin
7717   ;
7718   return 0;
7719 }
7720 _ACEOF
7721 rm -f conftest.$ac_objext
7722 if { (eval echo "$as_me:7722: \"$ac_compile\"") >&5
7723   (eval $ac_compile) 2>&5
7724   ac_status=$?
7725   echo "$as_me:7725: \$? = $ac_status" >&5
7726   (exit $ac_status); } &&
7727          { ac_try='test -s conftest.$ac_objext'
7728   { (eval echo "$as_me:7728: \"$ac_try\"") >&5
7729   (eval $ac_try) 2>&5
7730   ac_status=$?
7731   echo "$as_me:7731: \$? = $ac_status" >&5
7732   (exit $ac_status); }; }; then
7733
7734         cf_cv_term_header="$cf_test"
7735 else
7736   echo "$as_me: failed program was:" >&5
7737 cat conftest.$ac_ext >&5
7738
7739         cf_cv_term_header=unknown
7740
7741 fi
7742 rm -f conftest.$ac_objext conftest.$ac_ext
7743         test "$cf_cv_term_header" != unknown && break
7744 done
7745
7746 fi
7747 echo "$as_me:7747: result: $cf_cv_term_header" >&5
7748 echo "${ECHO_T}$cf_cv_term_header" >&6
7749
7750 # Set definitions to allow ifdef'ing to accommodate subdirectories
7751
7752 case $cf_cv_term_header in
7753 (*term.h)
7754
7755 cat >>confdefs.h <<\EOF
7756 #define HAVE_TERM_H 1
7757 EOF
7758
7759         ;;
7760 esac
7761
7762 case $cf_cv_term_header in
7763 (ncurses/term.h)
7764
7765 cat >>confdefs.h <<\EOF
7766 #define HAVE_NCURSES_TERM_H 1
7767 EOF
7768
7769         ;;
7770 (ncursesw/term.h)
7771
7772 cat >>confdefs.h <<\EOF
7773 #define HAVE_NCURSESW_TERM_H 1
7774 EOF
7775
7776         ;;
7777 esac
7778
7779 # some applications need this, but should check for NCURSES_VERSION
7780
7781 cat >>confdefs.h <<\EOF
7782 #define NCURSES 1
7783 EOF
7784
7785 echo "$as_me:7785: checking for ncurses version" >&5
7786 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
7787 if test "${cf_cv_ncurses_version+set}" = set; then
7788   echo $ECHO_N "(cached) $ECHO_C" >&6
7789 else
7790
7791         cf_cv_ncurses_version=no
7792         cf_tempfile=out$$
7793         rm -f $cf_tempfile
7794         if test "$cross_compiling" = yes; then
7795
7796         # This will not work if the preprocessor splits the line after the
7797         # Autoconf token.  The 'unproto' program does that.
7798         cat > conftest.$ac_ext <<EOF
7799 #include <${cf_cv_ncurses_header:-curses.h}>
7800 #undef Autoconf
7801 #ifdef NCURSES_VERSION
7802 Autoconf NCURSES_VERSION
7803 #else
7804 #ifdef __NCURSES_H
7805 Autoconf "old"
7806 #endif
7807 ;
7808 #endif
7809 EOF
7810         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
7811         { (eval echo "$as_me:7811: \"$cf_try\"") >&5
7812   (eval $cf_try) 2>&5
7813   ac_status=$?
7814   echo "$as_me:7814: \$? = $ac_status" >&5
7815   (exit $ac_status); }
7816         if test -f conftest.out ; then
7817                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
7818                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
7819                 rm -f conftest.out
7820         fi
7821
7822 else
7823   cat >conftest.$ac_ext <<_ACEOF
7824 #line 7824 "configure"
7825 #include "confdefs.h"
7826
7827 #include <${cf_cv_ncurses_header:-curses.h}>
7828 #include <stdio.h>
7829 int main(void)
7830 {
7831         FILE *fp = fopen("$cf_tempfile", "w");
7832 #ifdef NCURSES_VERSION
7833 # ifdef NCURSES_VERSION_PATCH
7834         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
7835 # else
7836         fprintf(fp, "%s\n", NCURSES_VERSION);
7837 # endif
7838 #else
7839 # ifdef __NCURSES_H
7840         fprintf(fp, "old\n");
7841 # else
7842         make an error
7843 # endif
7844 #endif
7845         ${cf_cv_main_return:-return}(0);
7846 }
7847 _ACEOF
7848 rm -f conftest$ac_exeext
7849 if { (eval echo "$as_me:7849: \"$ac_link\"") >&5
7850   (eval $ac_link) 2>&5
7851   ac_status=$?
7852   echo "$as_me:7852: \$? = $ac_status" >&5
7853   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
7854   { (eval echo "$as_me:7854: \"$ac_try\"") >&5
7855   (eval $ac_try) 2>&5
7856   ac_status=$?
7857   echo "$as_me:7857: \$? = $ac_status" >&5
7858   (exit $ac_status); }; }; then
7859
7860         cf_cv_ncurses_version=`cat $cf_tempfile`
7861 else
7862   echo "$as_me: program exited with status $ac_status" >&5
7863 echo "$as_me: failed program was:" >&5
7864 cat conftest.$ac_ext >&5
7865 fi
7866 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
7867 fi
7868         rm -f $cf_tempfile
7869
7870 fi
7871 echo "$as_me:7871: result: $cf_cv_ncurses_version" >&5
7872 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
7873 test "$cf_cv_ncurses_version" = no ||
7874 cat >>confdefs.h <<\EOF
7875 #define NCURSES 1
7876 EOF
7877
7878 cf_nculib_root=$cf_cv_screen
7879         # This works, except for the special case where we find gpm, but
7880         # ncurses is in a nonstandard location via $LIBS, and we really want
7881         # to link gpm.
7882 cf_ncurses_LIBS=""
7883 cf_ncurses_SAVE="$LIBS"
7884 echo "$as_me:7884: checking for Gpm_Open in -lgpm" >&5
7885 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
7886 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
7887   echo $ECHO_N "(cached) $ECHO_C" >&6
7888 else
7889   ac_check_lib_save_LIBS=$LIBS
7890 LIBS="-lgpm  $LIBS"
7891 cat >conftest.$ac_ext <<_ACEOF
7892 #line 7892 "configure"
7893 #include "confdefs.h"
7894
7895 /* Override any gcc2 internal prototype to avoid an error.  */
7896 #ifdef __cplusplus
7897 extern "C"
7898 #endif
7899 /* We use char because int might match the return type of a gcc2
7900    builtin and then its argument prototype would still apply.  */
7901 char Gpm_Open ();
7902 int
7903 main (void)
7904 {
7905 Gpm_Open ();
7906   ;
7907   return 0;
7908 }
7909 _ACEOF
7910 rm -f conftest.$ac_objext conftest$ac_exeext
7911 if { (eval echo "$as_me:7911: \"$ac_link\"") >&5
7912   (eval $ac_link) 2>&5
7913   ac_status=$?
7914   echo "$as_me:7914: \$? = $ac_status" >&5
7915   (exit $ac_status); } &&
7916          { ac_try='test -s conftest$ac_exeext'
7917   { (eval echo "$as_me:7917: \"$ac_try\"") >&5
7918   (eval $ac_try) 2>&5
7919   ac_status=$?
7920   echo "$as_me:7920: \$? = $ac_status" >&5
7921   (exit $ac_status); }; }; then
7922   ac_cv_lib_gpm_Gpm_Open=yes
7923 else
7924   echo "$as_me: failed program was:" >&5
7925 cat conftest.$ac_ext >&5
7926 ac_cv_lib_gpm_Gpm_Open=no
7927 fi
7928 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7929 LIBS=$ac_check_lib_save_LIBS
7930 fi
7931 echo "$as_me:7931: result: $ac_cv_lib_gpm_Gpm_Open" >&5
7932 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
7933 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
7934   echo "$as_me:7934: checking for initscr in -lgpm" >&5
7935 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
7936 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
7937   echo $ECHO_N "(cached) $ECHO_C" >&6
7938 else
7939   ac_check_lib_save_LIBS=$LIBS
7940 LIBS="-lgpm  $LIBS"
7941 cat >conftest.$ac_ext <<_ACEOF
7942 #line 7942 "configure"
7943 #include "confdefs.h"
7944
7945 /* Override any gcc2 internal prototype to avoid an error.  */
7946 #ifdef __cplusplus
7947 extern "C"
7948 #endif
7949 /* We use char because int might match the return type of a gcc2
7950    builtin and then its argument prototype would still apply.  */
7951 char initscr ();
7952 int
7953 main (void)
7954 {
7955 initscr ();
7956   ;
7957   return 0;
7958 }
7959 _ACEOF
7960 rm -f conftest.$ac_objext conftest$ac_exeext
7961 if { (eval echo "$as_me:7961: \"$ac_link\"") >&5
7962   (eval $ac_link) 2>&5
7963   ac_status=$?
7964   echo "$as_me:7964: \$? = $ac_status" >&5
7965   (exit $ac_status); } &&
7966          { ac_try='test -s conftest$ac_exeext'
7967   { (eval echo "$as_me:7967: \"$ac_try\"") >&5
7968   (eval $ac_try) 2>&5
7969   ac_status=$?
7970   echo "$as_me:7970: \$? = $ac_status" >&5
7971   (exit $ac_status); }; }; then
7972   ac_cv_lib_gpm_initscr=yes
7973 else
7974   echo "$as_me: failed program was:" >&5
7975 cat conftest.$ac_ext >&5
7976 ac_cv_lib_gpm_initscr=no
7977 fi
7978 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7979 LIBS=$ac_check_lib_save_LIBS
7980 fi
7981 echo "$as_me:7981: result: $ac_cv_lib_gpm_initscr" >&5
7982 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
7983 if test $ac_cv_lib_gpm_initscr = yes; then
7984   LIBS="$cf_ncurses_SAVE"
7985 else
7986   cf_ncurses_LIBS="-lgpm"
7987 fi
7988
7989 fi
7990
7991 case $host_os in
7992 (freebsd*)
7993         # This is only necessary if you are linking against an obsolete
7994         # version of ncurses (but it should do no harm, since it's static).
7995         if test "$cf_nculib_root" = ncurses ; then
7996                 echo "$as_me:7996: checking for tgoto in -lmytinfo" >&5
7997 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
7998 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
7999   echo $ECHO_N "(cached) $ECHO_C" >&6
8000 else
8001   ac_check_lib_save_LIBS=$LIBS
8002 LIBS="-lmytinfo  $LIBS"
8003 cat >conftest.$ac_ext <<_ACEOF
8004 #line 8004 "configure"
8005 #include "confdefs.h"
8006
8007 /* Override any gcc2 internal prototype to avoid an error.  */
8008 #ifdef __cplusplus
8009 extern "C"
8010 #endif
8011 /* We use char because int might match the return type of a gcc2
8012    builtin and then its argument prototype would still apply.  */
8013 char tgoto ();
8014 int
8015 main (void)
8016 {
8017 tgoto ();
8018   ;
8019   return 0;
8020 }
8021 _ACEOF
8022 rm -f conftest.$ac_objext conftest$ac_exeext
8023 if { (eval echo "$as_me:8023: \"$ac_link\"") >&5
8024   (eval $ac_link) 2>&5
8025   ac_status=$?
8026   echo "$as_me:8026: \$? = $ac_status" >&5
8027   (exit $ac_status); } &&
8028          { ac_try='test -s conftest$ac_exeext'
8029   { (eval echo "$as_me:8029: \"$ac_try\"") >&5
8030   (eval $ac_try) 2>&5
8031   ac_status=$?
8032   echo "$as_me:8032: \$? = $ac_status" >&5
8033   (exit $ac_status); }; }; then
8034   ac_cv_lib_mytinfo_tgoto=yes
8035 else
8036   echo "$as_me: failed program was:" >&5
8037 cat conftest.$ac_ext >&5
8038 ac_cv_lib_mytinfo_tgoto=no
8039 fi
8040 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8041 LIBS=$ac_check_lib_save_LIBS
8042 fi
8043 echo "$as_me:8043: result: $ac_cv_lib_mytinfo_tgoto" >&5
8044 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
8045 if test $ac_cv_lib_mytinfo_tgoto = yes; then
8046   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
8047 fi
8048
8049         fi
8050         ;;
8051 esac
8052
8053 cf_add_libs="$cf_ncurses_LIBS"
8054 # Filter out duplicates - this happens with badly-designed ".pc" files...
8055 for cf_add_1lib in $LIBS
8056 do
8057         for cf_add_2lib in $cf_add_libs
8058         do
8059                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
8060                 then
8061                         cf_add_1lib=
8062                         break
8063                 fi
8064         done
8065         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
8066 done
8067 LIBS="$cf_add_libs"
8068
8069 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
8070 then
8071
8072 cf_add_libs="-l$cf_nculib_root"
8073 # Filter out duplicates - this happens with badly-designed ".pc" files...
8074 for cf_add_1lib in $LIBS
8075 do
8076         for cf_add_2lib in $cf_add_libs
8077         do
8078                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
8079                 then
8080                         cf_add_1lib=
8081                         break
8082                 fi
8083         done
8084         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
8085 done
8086 LIBS="$cf_add_libs"
8087
8088 else
8089
8090         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
8091         cf_libdir=""
8092         echo "$as_me:8092: checking for initscr" >&5
8093 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
8094 if test "${ac_cv_func_initscr+set}" = set; then
8095   echo $ECHO_N "(cached) $ECHO_C" >&6
8096 else
8097   cat >conftest.$ac_ext <<_ACEOF
8098 #line 8098 "configure"
8099 #include "confdefs.h"
8100 /* System header to define __stub macros and hopefully few prototypes,
8101     which can conflict with char initscr (); below.  */
8102 #include <assert.h>
8103 /* Override any gcc2 internal prototype to avoid an error.  */
8104 #ifdef __cplusplus
8105 extern "C"
8106 #endif
8107 /* We use char because int might match the return type of a gcc2
8108    builtin and then its argument prototype would still apply.  */
8109 char initscr ();
8110 char (*f) ();
8111
8112 int
8113 main (void)
8114 {
8115 /* The GNU C library defines this for functions which it implements
8116     to always fail with ENOSYS.  Some functions are actually named
8117     something starting with __ and the normal name is an alias.  */
8118 #if defined (__stub_initscr) || defined (__stub___initscr)
8119 choke me
8120 #else
8121 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
8122 #endif
8123
8124   ;
8125   return 0;
8126 }
8127 _ACEOF
8128 rm -f conftest.$ac_objext conftest$ac_exeext
8129 if { (eval echo "$as_me:8129: \"$ac_link\"") >&5
8130   (eval $ac_link) 2>&5
8131   ac_status=$?
8132   echo "$as_me:8132: \$? = $ac_status" >&5
8133   (exit $ac_status); } &&
8134          { ac_try='test -s conftest$ac_exeext'
8135   { (eval echo "$as_me:8135: \"$ac_try\"") >&5
8136   (eval $ac_try) 2>&5
8137   ac_status=$?
8138   echo "$as_me:8138: \$? = $ac_status" >&5
8139   (exit $ac_status); }; }; then
8140   ac_cv_func_initscr=yes
8141 else
8142   echo "$as_me: failed program was:" >&5
8143 cat conftest.$ac_ext >&5
8144 ac_cv_func_initscr=no
8145 fi
8146 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8147 fi
8148 echo "$as_me:8148: result: $ac_cv_func_initscr" >&5
8149 echo "${ECHO_T}$ac_cv_func_initscr" >&6
8150 if test $ac_cv_func_initscr = yes; then
8151   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8152 else
8153
8154                 cf_save_LIBS="$LIBS"
8155                 echo "$as_me:8155: checking for initscr in -l$cf_nculib_root" >&5
8156 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
8157                 LIBS="-l$cf_nculib_root $LIBS"
8158                 cat >conftest.$ac_ext <<_ACEOF
8159 #line 8159 "configure"
8160 #include "confdefs.h"
8161 #include <${cf_cv_ncurses_header:-curses.h}>
8162 int
8163 main (void)
8164 {
8165 initscr()
8166   ;
8167   return 0;
8168 }
8169 _ACEOF
8170 rm -f conftest.$ac_objext conftest$ac_exeext
8171 if { (eval echo "$as_me:8171: \"$ac_link\"") >&5
8172   (eval $ac_link) 2>&5
8173   ac_status=$?
8174   echo "$as_me:8174: \$? = $ac_status" >&5
8175   (exit $ac_status); } &&
8176          { ac_try='test -s conftest$ac_exeext'
8177   { (eval echo "$as_me:8177: \"$ac_try\"") >&5
8178   (eval $ac_try) 2>&5
8179   ac_status=$?
8180   echo "$as_me:8180: \$? = $ac_status" >&5
8181   (exit $ac_status); }; }; then
8182   echo "$as_me:8182: result: yes" >&5
8183 echo "${ECHO_T}yes" >&6
8184                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8185
8186 else
8187   echo "$as_me: failed program was:" >&5
8188 cat conftest.$ac_ext >&5
8189 echo "$as_me:8189: result: no" >&5
8190 echo "${ECHO_T}no" >&6
8191
8192 cf_search=
8193 cf_library_path_list=""
8194 if test -n "${LDFLAGS}${LIBS}" ; then
8195         for cf_library_path in $LDFLAGS $LIBS
8196         do
8197                 case $cf_library_path in
8198                 (-L*)
8199                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
8200
8201 test "x$cf_library_path" != "xNONE" && \
8202 test -d "$cf_library_path" && \
8203  {
8204         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
8205         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
8206         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
8207         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
8208         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
8209         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"
8210 }
8211
8212                         cf_library_path_list="$cf_library_path_list $cf_search"
8213                         ;;
8214                 esac
8215         done
8216 fi
8217
8218 cf_search=
8219
8220 test "x$prefix" != "xNONE" && \
8221 test -d "$prefix" && \
8222  {
8223         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
8224         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
8225         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
8226         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
8227         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
8228         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
8229 }
8230
8231 for cf_subdir_prefix in \
8232         /usr \
8233         /usr/local \
8234         /usr/pkg \
8235         /opt \
8236         /opt/local \
8237         $HOME
8238 do
8239
8240 test "x$cf_subdir_prefix" != "x$prefix" && \
8241 test -d "$cf_subdir_prefix" && \
8242 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
8243         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
8244         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
8245         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
8246         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
8247         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
8248         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"
8249 }
8250
8251 done
8252
8253 cf_search="$cf_library_path_list $cf_search"
8254
8255                         for cf_libdir in $cf_search
8256                         do
8257                                 echo "$as_me:8257: checking for -l$cf_nculib_root in $cf_libdir" >&5
8258 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
8259                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
8260                                 cat >conftest.$ac_ext <<_ACEOF
8261 #line 8261 "configure"
8262 #include "confdefs.h"
8263 #include <${cf_cv_ncurses_header:-curses.h}>
8264 int
8265 main (void)
8266 {
8267 initscr()
8268   ;
8269   return 0;
8270 }
8271 _ACEOF
8272 rm -f conftest.$ac_objext conftest$ac_exeext
8273 if { (eval echo "$as_me:8273: \"$ac_link\"") >&5
8274   (eval $ac_link) 2>&5
8275   ac_status=$?
8276   echo "$as_me:8276: \$? = $ac_status" >&5
8277   (exit $ac_status); } &&
8278          { ac_try='test -s conftest$ac_exeext'
8279   { (eval echo "$as_me:8279: \"$ac_try\"") >&5
8280   (eval $ac_try) 2>&5
8281   ac_status=$?
8282   echo "$as_me:8282: \$? = $ac_status" >&5
8283   (exit $ac_status); }; }; then
8284   echo "$as_me:8284: result: yes" >&5
8285 echo "${ECHO_T}yes" >&6
8286                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8287                                          break
8288 else
8289   echo "$as_me: failed program was:" >&5
8290 cat conftest.$ac_ext >&5
8291 echo "$as_me:8291: result: no" >&5
8292 echo "${ECHO_T}no" >&6
8293                                          LIBS="$cf_save_LIBS"
8294 fi
8295 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8296                         done
8297
8298 fi
8299 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8300
8301 fi
8302
8303 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
8304
8305 if test $cf_found_library = no ; then
8306         { { echo "$as_me:8306: error: Cannot link $cf_nculib_root library" >&5
8307 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
8308    { (exit 1); exit 1; }; }
8309 fi
8310
8311 fi
8312
8313 if test -n "$cf_ncurses_LIBS" ; then
8314         echo "$as_me:8314: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
8315 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
8316         cf_ncurses_SAVE="$LIBS"
8317         for p in $cf_ncurses_LIBS ; do
8318                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
8319                 if test "$q" != "$LIBS" ; then
8320                         LIBS="$q"
8321                 fi
8322         done
8323         cat >conftest.$ac_ext <<_ACEOF
8324 #line 8324 "configure"
8325 #include "confdefs.h"
8326 #include <${cf_cv_ncurses_header:-curses.h}>
8327 int
8328 main (void)
8329 {
8330 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
8331   ;
8332   return 0;
8333 }
8334 _ACEOF
8335 rm -f conftest.$ac_objext conftest$ac_exeext
8336 if { (eval echo "$as_me:8336: \"$ac_link\"") >&5
8337   (eval $ac_link) 2>&5
8338   ac_status=$?
8339   echo "$as_me:8339: \$? = $ac_status" >&5
8340   (exit $ac_status); } &&
8341          { ac_try='test -s conftest$ac_exeext'
8342   { (eval echo "$as_me:8342: \"$ac_try\"") >&5
8343   (eval $ac_try) 2>&5
8344   ac_status=$?
8345   echo "$as_me:8345: \$? = $ac_status" >&5
8346   (exit $ac_status); }; }; then
8347   echo "$as_me:8347: result: yes" >&5
8348 echo "${ECHO_T}yes" >&6
8349 else
8350   echo "$as_me: failed program was:" >&5
8351 cat conftest.$ac_ext >&5
8352 echo "$as_me:8352: result: no" >&5
8353 echo "${ECHO_T}no" >&6
8354                  LIBS="$cf_ncurses_SAVE"
8355 fi
8356 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8357 fi
8358
8359 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
8360
8361 cat >>confdefs.h <<EOF
8362 #define $cf_nculib_ROOT 1
8363 EOF
8364
8365         fi
8366 else
8367         NCURSES_CONFIG=none
8368 fi
8369
8370         ;;
8371 (ncurses*)
8372
8373 cf_ncuconfig_root=$cf_cv_screen
8374 cf_have_ncuconfig=no
8375
8376 if test "x${PKG_CONFIG:=none}" != xnone; then
8377         echo "$as_me:8377: checking pkg-config for $cf_ncuconfig_root" >&5
8378 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
8379         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
8380                 echo "$as_me:8380: result: yes" >&5
8381 echo "${ECHO_T}yes" >&6
8382
8383                 echo "$as_me:8383: checking if the $cf_ncuconfig_root package files work" >&5
8384 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
8385                 cf_have_ncuconfig=unknown
8386
8387                 cf_save_CPPFLAGS="$CPPFLAGS"
8388                 cf_save_LIBS="$LIBS"
8389
8390                 CPPFLAGS="$CPPFLAGS `$PKG_CONFIG --cflags $cf_ncuconfig_root`"
8391
8392 cf_add_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
8393 # Filter out duplicates - this happens with badly-designed ".pc" files...
8394 for cf_add_1lib in $LIBS
8395 do
8396         for cf_add_2lib in $cf_add_libs
8397         do
8398                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
8399                 then
8400                         cf_add_1lib=
8401                         break
8402                 fi
8403         done
8404         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
8405 done
8406 LIBS="$cf_add_libs"
8407
8408                 cat >conftest.$ac_ext <<_ACEOF
8409 #line 8409 "configure"
8410 #include "confdefs.h"
8411 #include <${cf_cv_ncurses_header:-curses.h}>
8412 int
8413 main (void)
8414 {
8415 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
8416   ;
8417   return 0;
8418 }
8419 _ACEOF
8420 rm -f conftest.$ac_objext conftest$ac_exeext
8421 if { (eval echo "$as_me:8421: \"$ac_link\"") >&5
8422   (eval $ac_link) 2>&5
8423   ac_status=$?
8424   echo "$as_me:8424: \$? = $ac_status" >&5
8425   (exit $ac_status); } &&
8426          { ac_try='test -s conftest$ac_exeext'
8427   { (eval echo "$as_me:8427: \"$ac_try\"") >&5
8428   (eval $ac_try) 2>&5
8429   ac_status=$?
8430   echo "$as_me:8430: \$? = $ac_status" >&5
8431   (exit $ac_status); }; }; then
8432   if test "$cross_compiling" = yes; then
8433   cf_have_ncuconfig=maybe
8434 else
8435   cat >conftest.$ac_ext <<_ACEOF
8436 #line 8436 "configure"
8437 #include "confdefs.h"
8438 #include <${cf_cv_ncurses_header:-curses.h}>
8439                                 int main(void)
8440                                 { char *xx = curses_version(); return (xx == 0); }
8441 _ACEOF
8442 rm -f conftest$ac_exeext
8443 if { (eval echo "$as_me:8443: \"$ac_link\"") >&5
8444   (eval $ac_link) 2>&5
8445   ac_status=$?
8446   echo "$as_me:8446: \$? = $ac_status" >&5
8447   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
8448   { (eval echo "$as_me:8448: \"$ac_try\"") >&5
8449   (eval $ac_try) 2>&5
8450   ac_status=$?
8451   echo "$as_me:8451: \$? = $ac_status" >&5
8452   (exit $ac_status); }; }; then
8453   cf_have_ncuconfig=yes
8454 else
8455   echo "$as_me: program exited with status $ac_status" >&5
8456 echo "$as_me: failed program was:" >&5
8457 cat conftest.$ac_ext >&5
8458 cf_have_ncuconfig=no
8459 fi
8460 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
8461 fi
8462 else
8463   echo "$as_me: failed program was:" >&5
8464 cat conftest.$ac_ext >&5
8465 cf_have_ncuconfig=no
8466 fi
8467 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8468                 echo "$as_me:8468: result: $cf_have_ncuconfig" >&5
8469 echo "${ECHO_T}$cf_have_ncuconfig" >&6
8470                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
8471                 if test "$cf_have_ncuconfig" != "yes"
8472                 then
8473                         CPPFLAGS="$cf_save_CPPFLAGS"
8474                         LIBS="$cf_save_LIBS"
8475                         NCURSES_CONFIG_PKG=none
8476                 else
8477
8478 cat >>confdefs.h <<\EOF
8479 #define NCURSES 1
8480 EOF
8481
8482                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
8483                 fi
8484
8485 echo "$as_me:8485: checking for terminfo header" >&5
8486 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
8487 if test "${cf_cv_term_header+set}" = set; then
8488   echo $ECHO_N "(cached) $ECHO_C" >&6
8489 else
8490
8491 case ${cf_cv_ncurses_header} in
8492 (*/ncurses.h|*/ncursesw.h)
8493         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
8494         ;;
8495 (*)
8496         cf_term_header=term.h
8497         ;;
8498 esac
8499
8500 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
8501 do
8502 cat >conftest.$ac_ext <<_ACEOF
8503 #line 8503 "configure"
8504 #include "confdefs.h"
8505 #include <stdio.h>
8506 #include <${cf_cv_ncurses_header:-curses.h}>
8507 #include <$cf_test>
8508
8509 int
8510 main (void)
8511 {
8512 int x = auto_left_margin
8513   ;
8514   return 0;
8515 }
8516 _ACEOF
8517 rm -f conftest.$ac_objext
8518 if { (eval echo "$as_me:8518: \"$ac_compile\"") >&5
8519   (eval $ac_compile) 2>&5
8520   ac_status=$?
8521   echo "$as_me:8521: \$? = $ac_status" >&5
8522   (exit $ac_status); } &&
8523          { ac_try='test -s conftest.$ac_objext'
8524   { (eval echo "$as_me:8524: \"$ac_try\"") >&5
8525   (eval $ac_try) 2>&5
8526   ac_status=$?
8527   echo "$as_me:8527: \$? = $ac_status" >&5
8528   (exit $ac_status); }; }; then
8529
8530         cf_cv_term_header="$cf_test"
8531 else
8532   echo "$as_me: failed program was:" >&5
8533 cat conftest.$ac_ext >&5
8534
8535         cf_cv_term_header=unknown
8536
8537 fi
8538 rm -f conftest.$ac_objext conftest.$ac_ext
8539         test "$cf_cv_term_header" != unknown && break
8540 done
8541
8542 fi
8543 echo "$as_me:8543: result: $cf_cv_term_header" >&5
8544 echo "${ECHO_T}$cf_cv_term_header" >&6
8545
8546 # Set definitions to allow ifdef'ing to accommodate subdirectories
8547
8548 case $cf_cv_term_header in
8549 (*term.h)
8550
8551 cat >>confdefs.h <<\EOF
8552 #define HAVE_TERM_H 1
8553 EOF
8554
8555         ;;
8556 esac
8557
8558 case $cf_cv_term_header in
8559 (ncurses/term.h)
8560
8561 cat >>confdefs.h <<\EOF
8562 #define HAVE_NCURSES_TERM_H 1
8563 EOF
8564
8565         ;;
8566 (ncursesw/term.h)
8567
8568 cat >>confdefs.h <<\EOF
8569 #define HAVE_NCURSESW_TERM_H 1
8570 EOF
8571
8572         ;;
8573 esac
8574
8575         else
8576                 echo "$as_me:8576: result: no" >&5
8577 echo "${ECHO_T}no" >&6
8578                 NCURSES_CONFIG_PKG=none
8579         fi
8580 else
8581         NCURSES_CONFIG_PKG=none
8582 fi
8583
8584 if test "x$cf_have_ncuconfig" = "xno"; then
8585         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
8586
8587 if test -n "$ac_tool_prefix"; then
8588   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
8589   do
8590     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
8591 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
8592 echo "$as_me:8592: checking for $ac_word" >&5
8593 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
8594 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
8595   echo $ECHO_N "(cached) $ECHO_C" >&6
8596 else
8597   if test -n "$NCURSES_CONFIG"; then
8598   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
8599 else
8600   ac_save_IFS=$IFS; IFS=$ac_path_separator
8601 ac_dummy="$PATH"
8602 for ac_dir in $ac_dummy; do
8603   IFS=$ac_save_IFS
8604   test -z "$ac_dir" && ac_dir=.
8605   $as_executable_p "$ac_dir/$ac_word" || continue
8606 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
8607 echo "$as_me:8607: found $ac_dir/$ac_word" >&5
8608 break
8609 done
8610
8611 fi
8612 fi
8613 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
8614 if test -n "$NCURSES_CONFIG"; then
8615   echo "$as_me:8615: result: $NCURSES_CONFIG" >&5
8616 echo "${ECHO_T}$NCURSES_CONFIG" >&6
8617 else
8618   echo "$as_me:8618: result: no" >&5
8619 echo "${ECHO_T}no" >&6
8620 fi
8621
8622     test -n "$NCURSES_CONFIG" && break
8623   done
8624 fi
8625 if test -z "$NCURSES_CONFIG"; then
8626   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
8627   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
8628 do
8629   # Extract the first word of "$ac_prog", so it can be a program name with args.
8630 set dummy $ac_prog; ac_word=$2
8631 echo "$as_me:8631: checking for $ac_word" >&5
8632 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
8633 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
8634   echo $ECHO_N "(cached) $ECHO_C" >&6
8635 else
8636   if test -n "$ac_ct_NCURSES_CONFIG"; then
8637   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
8638 else
8639   ac_save_IFS=$IFS; IFS=$ac_path_separator
8640 ac_dummy="$PATH"
8641 for ac_dir in $ac_dummy; do
8642   IFS=$ac_save_IFS
8643   test -z "$ac_dir" && ac_dir=.
8644   $as_executable_p "$ac_dir/$ac_word" || continue
8645 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
8646 echo "$as_me:8646: found $ac_dir/$ac_word" >&5
8647 break
8648 done
8649
8650 fi
8651 fi
8652 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
8653 if test -n "$ac_ct_NCURSES_CONFIG"; then
8654   echo "$as_me:8654: result: $ac_ct_NCURSES_CONFIG" >&5
8655 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
8656 else
8657   echo "$as_me:8657: result: no" >&5
8658 echo "${ECHO_T}no" >&6
8659 fi
8660
8661   test -n "$ac_ct_NCURSES_CONFIG" && break
8662 done
8663 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
8664
8665   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
8666 fi
8667
8668         if test "$NCURSES_CONFIG" != none ; then
8669
8670                 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
8671
8672 cf_add_libs="`$NCURSES_CONFIG --libs`"
8673 # Filter out duplicates - this happens with badly-designed ".pc" files...
8674 for cf_add_1lib in $LIBS
8675 do
8676         for cf_add_2lib in $cf_add_libs
8677         do
8678                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
8679                 then
8680                         cf_add_1lib=
8681                         break
8682                 fi
8683         done
8684         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
8685 done
8686 LIBS="$cf_add_libs"
8687
8688                 # even with config script, some packages use no-override for curses.h
8689
8690 echo "$as_me:8690: checking if we have identified curses headers" >&5
8691 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
8692 if test "${cf_cv_ncurses_header+set}" = set; then
8693   echo $ECHO_N "(cached) $ECHO_C" >&6
8694 else
8695
8696 cf_cv_ncurses_header=none
8697 for cf_header in \
8698         ncurses.h $cf_cv_screen/ncurses.h \
8699         curses.h $cf_cv_screen/curses.h
8700 do
8701 cat >conftest.$ac_ext <<_ACEOF
8702 #line 8702 "configure"
8703 #include "confdefs.h"
8704 #include <${cf_header}>
8705 int
8706 main (void)
8707 {
8708 initscr(); tgoto("?", 0,0)
8709   ;
8710   return 0;
8711 }
8712 _ACEOF
8713 rm -f conftest.$ac_objext
8714 if { (eval echo "$as_me:8714: \"$ac_compile\"") >&5
8715   (eval $ac_compile) 2>&5
8716   ac_status=$?
8717   echo "$as_me:8717: \$? = $ac_status" >&5
8718   (exit $ac_status); } &&
8719          { ac_try='test -s conftest.$ac_objext'
8720   { (eval echo "$as_me:8720: \"$ac_try\"") >&5
8721   (eval $ac_try) 2>&5
8722   ac_status=$?
8723   echo "$as_me:8723: \$? = $ac_status" >&5
8724   (exit $ac_status); }; }; then
8725   cf_cv_ncurses_header=$cf_header; break
8726 else
8727   echo "$as_me: failed program was:" >&5
8728 cat conftest.$ac_ext >&5
8729 fi
8730 rm -f conftest.$ac_objext conftest.$ac_ext
8731 done
8732
8733 fi
8734 echo "$as_me:8734: result: $cf_cv_ncurses_header" >&5
8735 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
8736
8737 if test "$cf_cv_ncurses_header" = none ; then
8738         { { echo "$as_me:8738: error: No curses header-files found" >&5
8739 echo "$as_me: error: No curses header-files found" >&2;}
8740    { (exit 1); exit 1; }; }
8741 fi
8742
8743 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
8744
8745 for ac_header in $cf_cv_ncurses_header
8746 do
8747 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
8748 echo "$as_me:8748: checking for $ac_header" >&5
8749 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
8750 if eval "test \"\${$as_ac_Header+set}\" = set"; then
8751   echo $ECHO_N "(cached) $ECHO_C" >&6
8752 else
8753   cat >conftest.$ac_ext <<_ACEOF
8754 #line 8754 "configure"
8755 #include "confdefs.h"
8756 #include <$ac_header>
8757 _ACEOF
8758 if { (eval echo "$as_me:8758: \"$ac_cpp conftest.$ac_ext\"") >&5
8759   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
8760   ac_status=$?
8761   egrep -v '^ *\+' conftest.er1 >conftest.err
8762   rm -f conftest.er1
8763   cat conftest.err >&5
8764   echo "$as_me:8764: \$? = $ac_status" >&5
8765   (exit $ac_status); } >/dev/null; then
8766   if test -s conftest.err; then
8767     ac_cpp_err=$ac_c_preproc_warn_flag
8768   else
8769     ac_cpp_err=
8770   fi
8771 else
8772   ac_cpp_err=yes
8773 fi
8774 if test -z "$ac_cpp_err"; then
8775   eval "$as_ac_Header=yes"
8776 else
8777   echo "$as_me: failed program was:" >&5
8778   cat conftest.$ac_ext >&5
8779   eval "$as_ac_Header=no"
8780 fi
8781 rm -f conftest.err conftest.$ac_ext
8782 fi
8783 echo "$as_me:8783: result: `eval echo '${'$as_ac_Header'}'`" >&5
8784 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
8785 if test `eval echo '${'$as_ac_Header'}'` = yes; then
8786   cat >>confdefs.h <<EOF
8787 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
8788 EOF
8789
8790 fi
8791 done
8792
8793 cat >>confdefs.h <<\EOF
8794 #define NCURSES 1
8795 EOF
8796
8797 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
8798
8799                 cat >>confdefs.h <<EOF
8800 #define $cf_nculib_ROOT 1
8801 EOF
8802
8803                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
8804
8805         else
8806
8807 cf_ncuhdr_root=$cf_cv_screen
8808
8809 test -n "$cf_cv_curses_dir" && \
8810 test "$cf_cv_curses_dir" != "no" && { \
8811
8812 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
8813   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
8814   do
8815         while test $cf_add_incdir != /usr/include
8816         do
8817           if test -d $cf_add_incdir
8818           then
8819                 cf_have_incdir=no
8820                 if test -n "$CFLAGS$CPPFLAGS" ; then
8821                   # a loop is needed to ensure we can add subdirs of existing dirs
8822                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8823                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8824                           cf_have_incdir=yes; break
8825                         fi
8826                   done
8827                 fi
8828
8829                 if test "$cf_have_incdir" = no ; then
8830                   if test "$cf_add_incdir" = /usr/local/include ; then
8831                         if test "$GCC" = yes
8832                         then
8833                           cf_save_CPPFLAGS=$CPPFLAGS
8834                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8835                           cat >conftest.$ac_ext <<_ACEOF
8836 #line 8836 "configure"
8837 #include "confdefs.h"
8838 #include <stdio.h>
8839 int
8840 main (void)
8841 {
8842 printf("Hello")
8843   ;
8844   return 0;
8845 }
8846 _ACEOF
8847 rm -f conftest.$ac_objext
8848 if { (eval echo "$as_me:8848: \"$ac_compile\"") >&5
8849   (eval $ac_compile) 2>&5
8850   ac_status=$?
8851   echo "$as_me:8851: \$? = $ac_status" >&5
8852   (exit $ac_status); } &&
8853          { ac_try='test -s conftest.$ac_objext'
8854   { (eval echo "$as_me:8854: \"$ac_try\"") >&5
8855   (eval $ac_try) 2>&5
8856   ac_status=$?
8857   echo "$as_me:8857: \$? = $ac_status" >&5
8858   (exit $ac_status); }; }; then
8859   :
8860 else
8861   echo "$as_me: failed program was:" >&5
8862 cat conftest.$ac_ext >&5
8863 cf_have_incdir=yes
8864 fi
8865 rm -f conftest.$ac_objext conftest.$ac_ext
8866                           CPPFLAGS=$cf_save_CPPFLAGS
8867                         fi
8868                   fi
8869                 fi
8870
8871                 if test "$cf_have_incdir" = no ; then
8872                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8873
8874 echo "${as_me:-configure}:8874: testing adding $cf_add_incdir to include-path ..." 1>&5
8875
8876                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8877
8878                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8879                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8880                   cf_add_incdir="$cf_top_incdir"
8881                 else
8882                   break
8883                 fi
8884           else
8885                 break
8886           fi
8887         done
8888   done
8889 fi
8890
8891 }
8892
8893 echo "$as_me:8893: checking for $cf_ncuhdr_root header in include-path" >&5
8894 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
8895 if test "${cf_cv_ncurses_h+set}" = set; then
8896   echo $ECHO_N "(cached) $ECHO_C" >&6
8897 else
8898
8899         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
8900         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
8901         for cf_header in $cf_header_list
8902         do
8903
8904         cat >conftest.$ac_ext <<_ACEOF
8905 #line 8905 "configure"
8906 #include "confdefs.h"
8907
8908 #include <$cf_header>
8909 int
8910 main (void)
8911 {
8912
8913 #ifdef NCURSES_VERSION
8914
8915 printf("%s\n", NCURSES_VERSION);
8916 #else
8917 #ifdef __NCURSES_H
8918 printf("old\n");
8919 #else
8920         make an error
8921 #endif
8922 #endif
8923
8924   ;
8925   return 0;
8926 }
8927 _ACEOF
8928 rm -f conftest.$ac_objext
8929 if { (eval echo "$as_me:8929: \"$ac_compile\"") >&5
8930   (eval $ac_compile) 2>&5
8931   ac_status=$?
8932   echo "$as_me:8932: \$? = $ac_status" >&5
8933   (exit $ac_status); } &&
8934          { ac_try='test -s conftest.$ac_objext'
8935   { (eval echo "$as_me:8935: \"$ac_try\"") >&5
8936   (eval $ac_try) 2>&5
8937   ac_status=$?
8938   echo "$as_me:8938: \$? = $ac_status" >&5
8939   (exit $ac_status); }; }; then
8940   cf_cv_ncurses_h=$cf_header
8941
8942 else
8943   echo "$as_me: failed program was:" >&5
8944 cat conftest.$ac_ext >&5
8945 cf_cv_ncurses_h=no
8946 fi
8947 rm -f conftest.$ac_objext conftest.$ac_ext
8948
8949                 test "$cf_cv_ncurses_h" != no && break
8950         done
8951
8952 fi
8953 echo "$as_me:8953: result: $cf_cv_ncurses_h" >&5
8954 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
8955
8956 if test "$cf_cv_ncurses_h" != no ; then
8957         cf_cv_ncurses_header=$cf_cv_ncurses_h
8958 else
8959
8960 echo "$as_me:8960: checking for $cf_ncuhdr_root include-path" >&5
8961 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
8962 if test "${cf_cv_ncurses_h2+set}" = set; then
8963   echo $ECHO_N "(cached) $ECHO_C" >&6
8964 else
8965
8966         test -n "$verbose" && echo
8967
8968 cf_search=
8969
8970 # collect the current set of include-directories from compiler flags
8971 cf_header_path_list=""
8972 if test -n "${CFLAGS}${CPPFLAGS}" ; then
8973         for cf_header_path in $CPPFLAGS $CFLAGS
8974         do
8975                 case $cf_header_path in
8976                 (-I*)
8977                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
8978
8979 test "x$cf_header_path" != "xNONE" && \
8980 test -d "$cf_header_path" && \
8981  {
8982         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
8983         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
8984         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
8985         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
8986         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
8987         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"
8988 }
8989
8990                         cf_header_path_list="$cf_header_path_list $cf_search"
8991                         ;;
8992                 esac
8993         done
8994 fi
8995
8996 # add the variations for the package we are looking for
8997
8998 cf_search=
8999
9000 test "x$prefix" != "xNONE" && \
9001 test -d "$prefix" && \
9002  {
9003         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
9004         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
9005         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
9006         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
9007         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
9008         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
9009 }
9010
9011 for cf_subdir_prefix in \
9012         /usr \
9013         /usr/local \
9014         /usr/pkg \
9015         /opt \
9016         /opt/local \
9017         $HOME
9018 do
9019
9020 test "x$cf_subdir_prefix" != "x$prefix" && \
9021 test -d "$cf_subdir_prefix" && \
9022 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
9023         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
9024         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
9025         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
9026         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
9027         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
9028         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"
9029 }
9030
9031 done
9032
9033 test "$includedir" != NONE && \
9034 test "$includedir" != "/usr/include" && \
9035 test -d "$includedir" && {
9036         test -d $includedir &&    cf_search="$cf_search $includedir"
9037         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
9038 }
9039
9040 test "$oldincludedir" != NONE && \
9041 test "$oldincludedir" != "/usr/include" && \
9042 test -d "$oldincludedir" && {
9043         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
9044         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
9045 }
9046
9047 cf_search="$cf_search $cf_header_path_list"
9048
9049         test -n "$verbose" && echo search path $cf_search
9050         cf_save2_CPPFLAGS="$CPPFLAGS"
9051         for cf_incdir in $cf_search
9052         do
9053
9054 if test -n "$cf_incdir" ; then
9055   for cf_add_incdir in $cf_incdir
9056   do
9057         while test $cf_add_incdir != /usr/include
9058         do
9059           if test -d $cf_add_incdir
9060           then
9061                 cf_have_incdir=no
9062                 if test -n "$CFLAGS$CPPFLAGS" ; then
9063                   # a loop is needed to ensure we can add subdirs of existing dirs
9064                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
9065                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
9066                           cf_have_incdir=yes; break
9067                         fi
9068                   done
9069                 fi
9070
9071                 if test "$cf_have_incdir" = no ; then
9072                   if test "$cf_add_incdir" = /usr/local/include ; then
9073                         if test "$GCC" = yes
9074                         then
9075                           cf_save_CPPFLAGS=$CPPFLAGS
9076                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9077                           cat >conftest.$ac_ext <<_ACEOF
9078 #line 9078 "configure"
9079 #include "confdefs.h"
9080 #include <stdio.h>
9081 int
9082 main (void)
9083 {
9084 printf("Hello")
9085   ;
9086   return 0;
9087 }
9088 _ACEOF
9089 rm -f conftest.$ac_objext
9090 if { (eval echo "$as_me:9090: \"$ac_compile\"") >&5
9091   (eval $ac_compile) 2>&5
9092   ac_status=$?
9093   echo "$as_me:9093: \$? = $ac_status" >&5
9094   (exit $ac_status); } &&
9095          { ac_try='test -s conftest.$ac_objext'
9096   { (eval echo "$as_me:9096: \"$ac_try\"") >&5
9097   (eval $ac_try) 2>&5
9098   ac_status=$?
9099   echo "$as_me:9099: \$? = $ac_status" >&5
9100   (exit $ac_status); }; }; then
9101   :
9102 else
9103   echo "$as_me: failed program was:" >&5
9104 cat conftest.$ac_ext >&5
9105 cf_have_incdir=yes
9106 fi
9107 rm -f conftest.$ac_objext conftest.$ac_ext
9108                           CPPFLAGS=$cf_save_CPPFLAGS
9109                         fi
9110                   fi
9111                 fi
9112
9113                 if test "$cf_have_incdir" = no ; then
9114                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
9115
9116 echo "${as_me:-configure}:9116: testing adding $cf_add_incdir to include-path ..." 1>&5
9117
9118                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9119
9120                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
9121                   test "$cf_top_incdir" = "$cf_add_incdir" && break
9122                   cf_add_incdir="$cf_top_incdir"
9123                 else
9124                   break
9125                 fi
9126           else
9127                 break
9128           fi
9129         done
9130   done
9131 fi
9132
9133                 for cf_header in \
9134                         ncurses.h \
9135                         curses.h
9136                 do
9137
9138         cat >conftest.$ac_ext <<_ACEOF
9139 #line 9139 "configure"
9140 #include "confdefs.h"
9141
9142 #include <$cf_header>
9143 int
9144 main (void)
9145 {
9146
9147 #ifdef NCURSES_VERSION
9148
9149 printf("%s\n", NCURSES_VERSION);
9150 #else
9151 #ifdef __NCURSES_H
9152 printf("old\n");
9153 #else
9154         make an error
9155 #endif
9156 #endif
9157
9158   ;
9159   return 0;
9160 }
9161 _ACEOF
9162 rm -f conftest.$ac_objext
9163 if { (eval echo "$as_me:9163: \"$ac_compile\"") >&5
9164   (eval $ac_compile) 2>&5
9165   ac_status=$?
9166   echo "$as_me:9166: \$? = $ac_status" >&5
9167   (exit $ac_status); } &&
9168          { ac_try='test -s conftest.$ac_objext'
9169   { (eval echo "$as_me:9169: \"$ac_try\"") >&5
9170   (eval $ac_try) 2>&5
9171   ac_status=$?
9172   echo "$as_me:9172: \$? = $ac_status" >&5
9173   (exit $ac_status); }; }; then
9174   cf_cv_ncurses_h2=$cf_header
9175
9176 else
9177   echo "$as_me: failed program was:" >&5
9178 cat conftest.$ac_ext >&5
9179 cf_cv_ncurses_h2=no
9180 fi
9181 rm -f conftest.$ac_objext conftest.$ac_ext
9182
9183                         if test "$cf_cv_ncurses_h2" != no ; then
9184                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
9185                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
9186                                 break
9187                         fi
9188                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
9189                 done
9190                 CPPFLAGS="$cf_save2_CPPFLAGS"
9191                 test "$cf_cv_ncurses_h2" != no && break
9192         done
9193         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:9193: error: not found" >&5
9194 echo "$as_me: error: not found" >&2;}
9195    { (exit 1); exit 1; }; }
9196
9197 fi
9198 echo "$as_me:9198: result: $cf_cv_ncurses_h2" >&5
9199 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
9200
9201         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
9202         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
9203         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
9204                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
9205         fi
9206
9207 if test -n "$cf_1st_incdir" ; then
9208   for cf_add_incdir in $cf_1st_incdir
9209   do
9210         while test $cf_add_incdir != /usr/include
9211         do
9212           if test -d $cf_add_incdir
9213           then
9214                 cf_have_incdir=no
9215                 if test -n "$CFLAGS$CPPFLAGS" ; then
9216                   # a loop is needed to ensure we can add subdirs of existing dirs
9217                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
9218                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
9219                           cf_have_incdir=yes; break
9220                         fi
9221                   done
9222                 fi
9223
9224                 if test "$cf_have_incdir" = no ; then
9225                   if test "$cf_add_incdir" = /usr/local/include ; then
9226                         if test "$GCC" = yes
9227                         then
9228                           cf_save_CPPFLAGS=$CPPFLAGS
9229                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9230                           cat >conftest.$ac_ext <<_ACEOF
9231 #line 9231 "configure"
9232 #include "confdefs.h"
9233 #include <stdio.h>
9234 int
9235 main (void)
9236 {
9237 printf("Hello")
9238   ;
9239   return 0;
9240 }
9241 _ACEOF
9242 rm -f conftest.$ac_objext
9243 if { (eval echo "$as_me:9243: \"$ac_compile\"") >&5
9244   (eval $ac_compile) 2>&5
9245   ac_status=$?
9246   echo "$as_me:9246: \$? = $ac_status" >&5
9247   (exit $ac_status); } &&
9248          { ac_try='test -s conftest.$ac_objext'
9249   { (eval echo "$as_me:9249: \"$ac_try\"") >&5
9250   (eval $ac_try) 2>&5
9251   ac_status=$?
9252   echo "$as_me:9252: \$? = $ac_status" >&5
9253   (exit $ac_status); }; }; then
9254   :
9255 else
9256   echo "$as_me: failed program was:" >&5
9257 cat conftest.$ac_ext >&5
9258 cf_have_incdir=yes
9259 fi
9260 rm -f conftest.$ac_objext conftest.$ac_ext
9261                           CPPFLAGS=$cf_save_CPPFLAGS
9262                         fi
9263                   fi
9264                 fi
9265
9266                 if test "$cf_have_incdir" = no ; then
9267                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
9268
9269 echo "${as_me:-configure}:9269: testing adding $cf_add_incdir to include-path ..." 1>&5
9270
9271                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9272
9273                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
9274                   test "$cf_top_incdir" = "$cf_add_incdir" && break
9275                   cf_add_incdir="$cf_top_incdir"
9276                 else
9277                   break
9278                 fi
9279           else
9280                 break
9281           fi
9282         done
9283   done
9284 fi
9285
9286 fi
9287
9288 # Set definitions to allow ifdef'ing for ncurses.h
9289
9290 case $cf_cv_ncurses_header in
9291 (*ncurses.h)
9292
9293 cat >>confdefs.h <<\EOF
9294 #define HAVE_NCURSES_H 1
9295 EOF
9296
9297         ;;
9298 esac
9299
9300 case $cf_cv_ncurses_header in
9301 (ncurses/curses.h|ncurses/ncurses.h)
9302
9303 cat >>confdefs.h <<\EOF
9304 #define HAVE_NCURSES_NCURSES_H 1
9305 EOF
9306
9307         ;;
9308 (ncursesw/curses.h|ncursesw/ncurses.h)
9309
9310 cat >>confdefs.h <<\EOF
9311 #define HAVE_NCURSESW_NCURSES_H 1
9312 EOF
9313
9314         ;;
9315 esac
9316
9317 echo "$as_me:9317: checking for terminfo header" >&5
9318 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
9319 if test "${cf_cv_term_header+set}" = set; then
9320   echo $ECHO_N "(cached) $ECHO_C" >&6
9321 else
9322
9323 case ${cf_cv_ncurses_header} in
9324 (*/ncurses.h|*/ncursesw.h)
9325         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
9326         ;;
9327 (*)
9328         cf_term_header=term.h
9329         ;;
9330 esac
9331
9332 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
9333 do
9334 cat >conftest.$ac_ext <<_ACEOF
9335 #line 9335 "configure"
9336 #include "confdefs.h"
9337 #include <stdio.h>
9338 #include <${cf_cv_ncurses_header:-curses.h}>
9339 #include <$cf_test>
9340
9341 int
9342 main (void)
9343 {
9344 int x = auto_left_margin
9345   ;
9346   return 0;
9347 }
9348 _ACEOF
9349 rm -f conftest.$ac_objext
9350 if { (eval echo "$as_me:9350: \"$ac_compile\"") >&5
9351   (eval $ac_compile) 2>&5
9352   ac_status=$?
9353   echo "$as_me:9353: \$? = $ac_status" >&5
9354   (exit $ac_status); } &&
9355          { ac_try='test -s conftest.$ac_objext'
9356   { (eval echo "$as_me:9356: \"$ac_try\"") >&5
9357   (eval $ac_try) 2>&5
9358   ac_status=$?
9359   echo "$as_me:9359: \$? = $ac_status" >&5
9360   (exit $ac_status); }; }; then
9361
9362         cf_cv_term_header="$cf_test"
9363 else
9364   echo "$as_me: failed program was:" >&5
9365 cat conftest.$ac_ext >&5
9366
9367         cf_cv_term_header=unknown
9368
9369 fi
9370 rm -f conftest.$ac_objext conftest.$ac_ext
9371         test "$cf_cv_term_header" != unknown && break
9372 done
9373
9374 fi
9375 echo "$as_me:9375: result: $cf_cv_term_header" >&5
9376 echo "${ECHO_T}$cf_cv_term_header" >&6
9377
9378 # Set definitions to allow ifdef'ing to accommodate subdirectories
9379
9380 case $cf_cv_term_header in
9381 (*term.h)
9382
9383 cat >>confdefs.h <<\EOF
9384 #define HAVE_TERM_H 1
9385 EOF
9386
9387         ;;
9388 esac
9389
9390 case $cf_cv_term_header in
9391 (ncurses/term.h)
9392
9393 cat >>confdefs.h <<\EOF
9394 #define HAVE_NCURSES_TERM_H 1
9395 EOF
9396
9397         ;;
9398 (ncursesw/term.h)
9399
9400 cat >>confdefs.h <<\EOF
9401 #define HAVE_NCURSESW_TERM_H 1
9402 EOF
9403
9404         ;;
9405 esac
9406
9407 # some applications need this, but should check for NCURSES_VERSION
9408
9409 cat >>confdefs.h <<\EOF
9410 #define NCURSES 1
9411 EOF
9412
9413 echo "$as_me:9413: checking for ncurses version" >&5
9414 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
9415 if test "${cf_cv_ncurses_version+set}" = set; then
9416   echo $ECHO_N "(cached) $ECHO_C" >&6
9417 else
9418
9419         cf_cv_ncurses_version=no
9420         cf_tempfile=out$$
9421         rm -f $cf_tempfile
9422         if test "$cross_compiling" = yes; then
9423
9424         # This will not work if the preprocessor splits the line after the
9425         # Autoconf token.  The 'unproto' program does that.
9426         cat > conftest.$ac_ext <<EOF
9427 #include <${cf_cv_ncurses_header:-curses.h}>
9428 #undef Autoconf
9429 #ifdef NCURSES_VERSION
9430 Autoconf NCURSES_VERSION
9431 #else
9432 #ifdef __NCURSES_H
9433 Autoconf "old"
9434 #endif
9435 ;
9436 #endif
9437 EOF
9438         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
9439         { (eval echo "$as_me:9439: \"$cf_try\"") >&5
9440   (eval $cf_try) 2>&5
9441   ac_status=$?
9442   echo "$as_me:9442: \$? = $ac_status" >&5
9443   (exit $ac_status); }
9444         if test -f conftest.out ; then
9445                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
9446                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
9447                 rm -f conftest.out
9448         fi
9449
9450 else
9451   cat >conftest.$ac_ext <<_ACEOF
9452 #line 9452 "configure"
9453 #include "confdefs.h"
9454
9455 #include <${cf_cv_ncurses_header:-curses.h}>
9456 #include <stdio.h>
9457 int main(void)
9458 {
9459         FILE *fp = fopen("$cf_tempfile", "w");
9460 #ifdef NCURSES_VERSION
9461 # ifdef NCURSES_VERSION_PATCH
9462         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
9463 # else
9464         fprintf(fp, "%s\n", NCURSES_VERSION);
9465 # endif
9466 #else
9467 # ifdef __NCURSES_H
9468         fprintf(fp, "old\n");
9469 # else
9470         make an error
9471 # endif
9472 #endif
9473         ${cf_cv_main_return:-return}(0);
9474 }
9475 _ACEOF
9476 rm -f conftest$ac_exeext
9477 if { (eval echo "$as_me:9477: \"$ac_link\"") >&5
9478   (eval $ac_link) 2>&5
9479   ac_status=$?
9480   echo "$as_me:9480: \$? = $ac_status" >&5
9481   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
9482   { (eval echo "$as_me:9482: \"$ac_try\"") >&5
9483   (eval $ac_try) 2>&5
9484   ac_status=$?
9485   echo "$as_me:9485: \$? = $ac_status" >&5
9486   (exit $ac_status); }; }; then
9487
9488         cf_cv_ncurses_version=`cat $cf_tempfile`
9489 else
9490   echo "$as_me: program exited with status $ac_status" >&5
9491 echo "$as_me: failed program was:" >&5
9492 cat conftest.$ac_ext >&5
9493 fi
9494 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
9495 fi
9496         rm -f $cf_tempfile
9497
9498 fi
9499 echo "$as_me:9499: result: $cf_cv_ncurses_version" >&5
9500 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
9501 test "$cf_cv_ncurses_version" = no ||
9502 cat >>confdefs.h <<\EOF
9503 #define NCURSES 1
9504 EOF
9505
9506 cf_nculib_root=$cf_cv_screen
9507         # This works, except for the special case where we find gpm, but
9508         # ncurses is in a nonstandard location via $LIBS, and we really want
9509         # to link gpm.
9510 cf_ncurses_LIBS=""
9511 cf_ncurses_SAVE="$LIBS"
9512 echo "$as_me:9512: checking for Gpm_Open in -lgpm" >&5
9513 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
9514 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
9515   echo $ECHO_N "(cached) $ECHO_C" >&6
9516 else
9517   ac_check_lib_save_LIBS=$LIBS
9518 LIBS="-lgpm  $LIBS"
9519 cat >conftest.$ac_ext <<_ACEOF
9520 #line 9520 "configure"
9521 #include "confdefs.h"
9522
9523 /* Override any gcc2 internal prototype to avoid an error.  */
9524 #ifdef __cplusplus
9525 extern "C"
9526 #endif
9527 /* We use char because int might match the return type of a gcc2
9528    builtin and then its argument prototype would still apply.  */
9529 char Gpm_Open ();
9530 int
9531 main (void)
9532 {
9533 Gpm_Open ();
9534   ;
9535   return 0;
9536 }
9537 _ACEOF
9538 rm -f conftest.$ac_objext conftest$ac_exeext
9539 if { (eval echo "$as_me:9539: \"$ac_link\"") >&5
9540   (eval $ac_link) 2>&5
9541   ac_status=$?
9542   echo "$as_me:9542: \$? = $ac_status" >&5
9543   (exit $ac_status); } &&
9544          { ac_try='test -s conftest$ac_exeext'
9545   { (eval echo "$as_me:9545: \"$ac_try\"") >&5
9546   (eval $ac_try) 2>&5
9547   ac_status=$?
9548   echo "$as_me:9548: \$? = $ac_status" >&5
9549   (exit $ac_status); }; }; then
9550   ac_cv_lib_gpm_Gpm_Open=yes
9551 else
9552   echo "$as_me: failed program was:" >&5
9553 cat conftest.$ac_ext >&5
9554 ac_cv_lib_gpm_Gpm_Open=no
9555 fi
9556 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9557 LIBS=$ac_check_lib_save_LIBS
9558 fi
9559 echo "$as_me:9559: result: $ac_cv_lib_gpm_Gpm_Open" >&5
9560 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
9561 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
9562   echo "$as_me:9562: checking for initscr in -lgpm" >&5
9563 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
9564 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
9565   echo $ECHO_N "(cached) $ECHO_C" >&6
9566 else
9567   ac_check_lib_save_LIBS=$LIBS
9568 LIBS="-lgpm  $LIBS"
9569 cat >conftest.$ac_ext <<_ACEOF
9570 #line 9570 "configure"
9571 #include "confdefs.h"
9572
9573 /* Override any gcc2 internal prototype to avoid an error.  */
9574 #ifdef __cplusplus
9575 extern "C"
9576 #endif
9577 /* We use char because int might match the return type of a gcc2
9578    builtin and then its argument prototype would still apply.  */
9579 char initscr ();
9580 int
9581 main (void)
9582 {
9583 initscr ();
9584   ;
9585   return 0;
9586 }
9587 _ACEOF
9588 rm -f conftest.$ac_objext conftest$ac_exeext
9589 if { (eval echo "$as_me:9589: \"$ac_link\"") >&5
9590   (eval $ac_link) 2>&5
9591   ac_status=$?
9592   echo "$as_me:9592: \$? = $ac_status" >&5
9593   (exit $ac_status); } &&
9594          { ac_try='test -s conftest$ac_exeext'
9595   { (eval echo "$as_me:9595: \"$ac_try\"") >&5
9596   (eval $ac_try) 2>&5
9597   ac_status=$?
9598   echo "$as_me:9598: \$? = $ac_status" >&5
9599   (exit $ac_status); }; }; then
9600   ac_cv_lib_gpm_initscr=yes
9601 else
9602   echo "$as_me: failed program was:" >&5
9603 cat conftest.$ac_ext >&5
9604 ac_cv_lib_gpm_initscr=no
9605 fi
9606 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9607 LIBS=$ac_check_lib_save_LIBS
9608 fi
9609 echo "$as_me:9609: result: $ac_cv_lib_gpm_initscr" >&5
9610 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
9611 if test $ac_cv_lib_gpm_initscr = yes; then
9612   LIBS="$cf_ncurses_SAVE"
9613 else
9614   cf_ncurses_LIBS="-lgpm"
9615 fi
9616
9617 fi
9618
9619 case $host_os in
9620 (freebsd*)
9621         # This is only necessary if you are linking against an obsolete
9622         # version of ncurses (but it should do no harm, since it's static).
9623         if test "$cf_nculib_root" = ncurses ; then
9624                 echo "$as_me:9624: checking for tgoto in -lmytinfo" >&5
9625 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
9626 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
9627   echo $ECHO_N "(cached) $ECHO_C" >&6
9628 else
9629   ac_check_lib_save_LIBS=$LIBS
9630 LIBS="-lmytinfo  $LIBS"
9631 cat >conftest.$ac_ext <<_ACEOF
9632 #line 9632 "configure"
9633 #include "confdefs.h"
9634
9635 /* Override any gcc2 internal prototype to avoid an error.  */
9636 #ifdef __cplusplus
9637 extern "C"
9638 #endif
9639 /* We use char because int might match the return type of a gcc2
9640    builtin and then its argument prototype would still apply.  */
9641 char tgoto ();
9642 int
9643 main (void)
9644 {
9645 tgoto ();
9646   ;
9647   return 0;
9648 }
9649 _ACEOF
9650 rm -f conftest.$ac_objext conftest$ac_exeext
9651 if { (eval echo "$as_me:9651: \"$ac_link\"") >&5
9652   (eval $ac_link) 2>&5
9653   ac_status=$?
9654   echo "$as_me:9654: \$? = $ac_status" >&5
9655   (exit $ac_status); } &&
9656          { ac_try='test -s conftest$ac_exeext'
9657   { (eval echo "$as_me:9657: \"$ac_try\"") >&5
9658   (eval $ac_try) 2>&5
9659   ac_status=$?
9660   echo "$as_me:9660: \$? = $ac_status" >&5
9661   (exit $ac_status); }; }; then
9662   ac_cv_lib_mytinfo_tgoto=yes
9663 else
9664   echo "$as_me: failed program was:" >&5
9665 cat conftest.$ac_ext >&5
9666 ac_cv_lib_mytinfo_tgoto=no
9667 fi
9668 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9669 LIBS=$ac_check_lib_save_LIBS
9670 fi
9671 echo "$as_me:9671: result: $ac_cv_lib_mytinfo_tgoto" >&5
9672 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
9673 if test $ac_cv_lib_mytinfo_tgoto = yes; then
9674   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
9675 fi
9676
9677         fi
9678         ;;
9679 esac
9680
9681 cf_add_libs="$cf_ncurses_LIBS"
9682 # Filter out duplicates - this happens with badly-designed ".pc" files...
9683 for cf_add_1lib in $LIBS
9684 do
9685         for cf_add_2lib in $cf_add_libs
9686         do
9687                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
9688                 then
9689                         cf_add_1lib=
9690                         break
9691                 fi
9692         done
9693         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
9694 done
9695 LIBS="$cf_add_libs"
9696
9697 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
9698 then
9699
9700 cf_add_libs="-l$cf_nculib_root"
9701 # Filter out duplicates - this happens with badly-designed ".pc" files...
9702 for cf_add_1lib in $LIBS
9703 do
9704         for cf_add_2lib in $cf_add_libs
9705         do
9706                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
9707                 then
9708                         cf_add_1lib=
9709                         break
9710                 fi
9711         done
9712         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
9713 done
9714 LIBS="$cf_add_libs"
9715
9716 else
9717
9718         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
9719         cf_libdir=""
9720         echo "$as_me:9720: checking for initscr" >&5
9721 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
9722 if test "${ac_cv_func_initscr+set}" = set; then
9723   echo $ECHO_N "(cached) $ECHO_C" >&6
9724 else
9725   cat >conftest.$ac_ext <<_ACEOF
9726 #line 9726 "configure"
9727 #include "confdefs.h"
9728 /* System header to define __stub macros and hopefully few prototypes,
9729     which can conflict with char initscr (); below.  */
9730 #include <assert.h>
9731 /* Override any gcc2 internal prototype to avoid an error.  */
9732 #ifdef __cplusplus
9733 extern "C"
9734 #endif
9735 /* We use char because int might match the return type of a gcc2
9736    builtin and then its argument prototype would still apply.  */
9737 char initscr ();
9738 char (*f) ();
9739
9740 int
9741 main (void)
9742 {
9743 /* The GNU C library defines this for functions which it implements
9744     to always fail with ENOSYS.  Some functions are actually named
9745     something starting with __ and the normal name is an alias.  */
9746 #if defined (__stub_initscr) || defined (__stub___initscr)
9747 choke me
9748 #else
9749 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
9750 #endif
9751
9752   ;
9753   return 0;
9754 }
9755 _ACEOF
9756 rm -f conftest.$ac_objext conftest$ac_exeext
9757 if { (eval echo "$as_me:9757: \"$ac_link\"") >&5
9758   (eval $ac_link) 2>&5
9759   ac_status=$?
9760   echo "$as_me:9760: \$? = $ac_status" >&5
9761   (exit $ac_status); } &&
9762          { ac_try='test -s conftest$ac_exeext'
9763   { (eval echo "$as_me:9763: \"$ac_try\"") >&5
9764   (eval $ac_try) 2>&5
9765   ac_status=$?
9766   echo "$as_me:9766: \$? = $ac_status" >&5
9767   (exit $ac_status); }; }; then
9768   ac_cv_func_initscr=yes
9769 else
9770   echo "$as_me: failed program was:" >&5
9771 cat conftest.$ac_ext >&5
9772 ac_cv_func_initscr=no
9773 fi
9774 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9775 fi
9776 echo "$as_me:9776: result: $ac_cv_func_initscr" >&5
9777 echo "${ECHO_T}$ac_cv_func_initscr" >&6
9778 if test $ac_cv_func_initscr = yes; then
9779   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9780 else
9781
9782                 cf_save_LIBS="$LIBS"
9783                 echo "$as_me:9783: checking for initscr in -l$cf_nculib_root" >&5
9784 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
9785                 LIBS="-l$cf_nculib_root $LIBS"
9786                 cat >conftest.$ac_ext <<_ACEOF
9787 #line 9787 "configure"
9788 #include "confdefs.h"
9789 #include <${cf_cv_ncurses_header:-curses.h}>
9790 int
9791 main (void)
9792 {
9793 initscr()
9794   ;
9795   return 0;
9796 }
9797 _ACEOF
9798 rm -f conftest.$ac_objext conftest$ac_exeext
9799 if { (eval echo "$as_me:9799: \"$ac_link\"") >&5
9800   (eval $ac_link) 2>&5
9801   ac_status=$?
9802   echo "$as_me:9802: \$? = $ac_status" >&5
9803   (exit $ac_status); } &&
9804          { ac_try='test -s conftest$ac_exeext'
9805   { (eval echo "$as_me:9805: \"$ac_try\"") >&5
9806   (eval $ac_try) 2>&5
9807   ac_status=$?
9808   echo "$as_me:9808: \$? = $ac_status" >&5
9809   (exit $ac_status); }; }; then
9810   echo "$as_me:9810: result: yes" >&5
9811 echo "${ECHO_T}yes" >&6
9812                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9813
9814 else
9815   echo "$as_me: failed program was:" >&5
9816 cat conftest.$ac_ext >&5
9817 echo "$as_me:9817: result: no" >&5
9818 echo "${ECHO_T}no" >&6
9819
9820 cf_search=
9821 cf_library_path_list=""
9822 if test -n "${LDFLAGS}${LIBS}" ; then
9823         for cf_library_path in $LDFLAGS $LIBS
9824         do
9825                 case $cf_library_path in
9826                 (-L*)
9827                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
9828
9829 test "x$cf_library_path" != "xNONE" && \
9830 test -d "$cf_library_path" && \
9831  {
9832         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
9833         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
9834         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
9835         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
9836         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
9837         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"
9838 }
9839
9840                         cf_library_path_list="$cf_library_path_list $cf_search"
9841                         ;;
9842                 esac
9843         done
9844 fi
9845
9846 cf_search=
9847
9848 test "x$prefix" != "xNONE" && \
9849 test -d "$prefix" && \
9850  {
9851         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
9852         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
9853         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
9854         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
9855         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
9856         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
9857 }
9858
9859 for cf_subdir_prefix in \
9860         /usr \
9861         /usr/local \
9862         /usr/pkg \
9863         /opt \
9864         /opt/local \
9865         $HOME
9866 do
9867
9868 test "x$cf_subdir_prefix" != "x$prefix" && \
9869 test -d "$cf_subdir_prefix" && \
9870 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
9871         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
9872         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
9873         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
9874         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
9875         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
9876         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"
9877 }
9878
9879 done
9880
9881 cf_search="$cf_library_path_list $cf_search"
9882
9883                         for cf_libdir in $cf_search
9884                         do
9885                                 echo "$as_me:9885: checking for -l$cf_nculib_root in $cf_libdir" >&5
9886 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
9887                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
9888                                 cat >conftest.$ac_ext <<_ACEOF
9889 #line 9889 "configure"
9890 #include "confdefs.h"
9891 #include <${cf_cv_ncurses_header:-curses.h}>
9892 int
9893 main (void)
9894 {
9895 initscr()
9896   ;
9897   return 0;
9898 }
9899 _ACEOF
9900 rm -f conftest.$ac_objext conftest$ac_exeext
9901 if { (eval echo "$as_me:9901: \"$ac_link\"") >&5
9902   (eval $ac_link) 2>&5
9903   ac_status=$?
9904   echo "$as_me:9904: \$? = $ac_status" >&5
9905   (exit $ac_status); } &&
9906          { ac_try='test -s conftest$ac_exeext'
9907   { (eval echo "$as_me:9907: \"$ac_try\"") >&5
9908   (eval $ac_try) 2>&5
9909   ac_status=$?
9910   echo "$as_me:9910: \$? = $ac_status" >&5
9911   (exit $ac_status); }; }; then
9912   echo "$as_me:9912: result: yes" >&5
9913 echo "${ECHO_T}yes" >&6
9914                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9915                                          break
9916 else
9917   echo "$as_me: failed program was:" >&5
9918 cat conftest.$ac_ext >&5
9919 echo "$as_me:9919: result: no" >&5
9920 echo "${ECHO_T}no" >&6
9921                                          LIBS="$cf_save_LIBS"
9922 fi
9923 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9924                         done
9925
9926 fi
9927 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9928
9929 fi
9930
9931 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
9932
9933 if test $cf_found_library = no ; then
9934         { { echo "$as_me:9934: error: Cannot link $cf_nculib_root library" >&5
9935 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
9936    { (exit 1); exit 1; }; }
9937 fi
9938
9939 fi
9940
9941 if test -n "$cf_ncurses_LIBS" ; then
9942         echo "$as_me:9942: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
9943 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
9944         cf_ncurses_SAVE="$LIBS"
9945         for p in $cf_ncurses_LIBS ; do
9946                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
9947                 if test "$q" != "$LIBS" ; then
9948                         LIBS="$q"
9949                 fi
9950         done
9951         cat >conftest.$ac_ext <<_ACEOF
9952 #line 9952 "configure"
9953 #include "confdefs.h"
9954 #include <${cf_cv_ncurses_header:-curses.h}>
9955 int
9956 main (void)
9957 {
9958 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
9959   ;
9960   return 0;
9961 }
9962 _ACEOF
9963 rm -f conftest.$ac_objext conftest$ac_exeext
9964 if { (eval echo "$as_me:9964: \"$ac_link\"") >&5
9965   (eval $ac_link) 2>&5
9966   ac_status=$?
9967   echo "$as_me:9967: \$? = $ac_status" >&5
9968   (exit $ac_status); } &&
9969          { ac_try='test -s conftest$ac_exeext'
9970   { (eval echo "$as_me:9970: \"$ac_try\"") >&5
9971   (eval $ac_try) 2>&5
9972   ac_status=$?
9973   echo "$as_me:9973: \$? = $ac_status" >&5
9974   (exit $ac_status); }; }; then
9975   echo "$as_me:9975: result: yes" >&5
9976 echo "${ECHO_T}yes" >&6
9977 else
9978   echo "$as_me: failed program was:" >&5
9979 cat conftest.$ac_ext >&5
9980 echo "$as_me:9980: result: no" >&5
9981 echo "${ECHO_T}no" >&6
9982                  LIBS="$cf_ncurses_SAVE"
9983 fi
9984 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9985 fi
9986
9987 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9988
9989 cat >>confdefs.h <<EOF
9990 #define $cf_nculib_ROOT 1
9991 EOF
9992
9993         fi
9994 else
9995         NCURSES_CONFIG=none
9996 fi
9997
9998         ;;
9999 (pdcurses)
10000         echo "$as_me:10000: checking for X" >&5
10001 echo $ECHO_N "checking for X... $ECHO_C" >&6
10002
10003 # Check whether --with-x or --without-x was given.
10004 if test "${with_x+set}" = set; then
10005   withval="$with_x"
10006
10007 fi;
10008 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
10009 if test "x$with_x" = xno; then
10010   # The user explicitly disabled X.
10011   have_x=disabled
10012 else
10013   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
10014     # Both variables are already set.
10015     have_x=yes
10016   else
10017     if test "${ac_cv_have_x+set}" = set; then
10018   echo $ECHO_N "(cached) $ECHO_C" >&6
10019 else
10020   # One or both of the vars are not set, and there is no cached value.
10021 ac_x_includes=no ac_x_libraries=no
10022 rm -fr conftest.dir
10023 if mkdir conftest.dir; then
10024   cd conftest.dir
10025   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
10026   cat >Imakefile <<'EOF'
10027 acfindx:
10028         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
10029 EOF
10030   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
10031     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
10032     eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
10033     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
10034     for ac_extension in a so sl dylib dll; do
10035       if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
10036          test -f $ac_im_libdir/libX11.$ac_extension; then
10037         ac_im_usrlibdir=$ac_im_libdir; break
10038       fi
10039     done
10040     # Screen out bogus values from the imake configuration.  They are
10041     # bogus both because they are the default anyway, and because
10042     # using them would break gcc on systems where it needs fixed includes.
10043     case $ac_im_incroot in
10044         /usr/include) ;;
10045         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
10046     esac
10047     case $ac_im_usrlibdir in
10048         /usr/lib | /lib) ;;
10049         *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
10050     esac
10051   fi
10052   cd ..
10053   rm -fr conftest.dir
10054 fi
10055
10056 # Standard set of common directories for X headers.
10057 # Check X11 before X11Rn because it is often a symlink to the current release.
10058 ac_x_header_dirs='
10059 /usr/X11/include
10060 /usr/X11R6/include
10061 /usr/X11R5/include
10062 /usr/X11R4/include
10063
10064 /usr/include/X11
10065 /usr/include/X11R6
10066 /usr/include/X11R5
10067 /usr/include/X11R4
10068
10069 /usr/local/X11/include
10070 /usr/local/X11R6/include
10071 /usr/local/X11R5/include
10072 /usr/local/X11R4/include
10073
10074 /usr/local/include/X11
10075 /usr/local/include/X11R6
10076 /usr/local/include/X11R5
10077 /usr/local/include/X11R4
10078
10079 /usr/X386/include
10080 /usr/x386/include
10081 /usr/XFree86/include/X11
10082
10083 /usr/include
10084 /usr/local/include
10085 /usr/unsupported/include
10086 /usr/athena/include
10087 /usr/local/x11r5/include
10088 /usr/lpp/Xamples/include
10089
10090 /usr/openwin/include
10091 /usr/openwin/share/include'
10092
10093 if test "$ac_x_includes" = no; then
10094   # Guess where to find include files, by looking for Intrinsic.h.
10095   # First, try using that file with no special directory specified.
10096   cat >conftest.$ac_ext <<_ACEOF
10097 #line 10097 "configure"
10098 #include "confdefs.h"
10099 #include <X11/Intrinsic.h>
10100 _ACEOF
10101 if { (eval echo "$as_me:10101: \"$ac_cpp conftest.$ac_ext\"") >&5
10102   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
10103   ac_status=$?
10104   egrep -v '^ *\+' conftest.er1 >conftest.err
10105   rm -f conftest.er1
10106   cat conftest.err >&5
10107   echo "$as_me:10107: \$? = $ac_status" >&5
10108   (exit $ac_status); } >/dev/null; then
10109   if test -s conftest.err; then
10110     ac_cpp_err=$ac_c_preproc_warn_flag
10111   else
10112     ac_cpp_err=
10113   fi
10114 else
10115   ac_cpp_err=yes
10116 fi
10117 if test -z "$ac_cpp_err"; then
10118   # We can compile using X headers with no special include directory.
10119 ac_x_includes=
10120 else
10121   echo "$as_me: failed program was:" >&5
10122   cat conftest.$ac_ext >&5
10123   for ac_dir in $ac_x_header_dirs; do
10124   if test -r "$ac_dir/X11/Intrinsic.h"; then
10125     ac_x_includes=$ac_dir
10126     break
10127   fi
10128 done
10129 fi
10130 rm -f conftest.err conftest.$ac_ext
10131 fi # $ac_x_includes = no
10132
10133 if test "$ac_x_libraries" = no; then
10134   # Check for the libraries.
10135   # See if we find them without any special options.
10136   # Don't add to $LIBS permanently.
10137   ac_save_LIBS=$LIBS
10138   LIBS="-lXt $LIBS"
10139   cat >conftest.$ac_ext <<_ACEOF
10140 #line 10140 "configure"
10141 #include "confdefs.h"
10142 #include <X11/Intrinsic.h>
10143 int
10144 main (void)
10145 {
10146 XtMalloc (0)
10147   ;
10148   return 0;
10149 }
10150 _ACEOF
10151 rm -f conftest.$ac_objext conftest$ac_exeext
10152 if { (eval echo "$as_me:10152: \"$ac_link\"") >&5
10153   (eval $ac_link) 2>&5
10154   ac_status=$?
10155   echo "$as_me:10155: \$? = $ac_status" >&5
10156   (exit $ac_status); } &&
10157          { ac_try='test -s conftest$ac_exeext'
10158   { (eval echo "$as_me:10158: \"$ac_try\"") >&5
10159   (eval $ac_try) 2>&5
10160   ac_status=$?
10161   echo "$as_me:10161: \$? = $ac_status" >&5
10162   (exit $ac_status); }; }; then
10163   LIBS=$ac_save_LIBS
10164 # We can link X programs with no special library path.
10165 ac_x_libraries=
10166 else
10167   echo "$as_me: failed program was:" >&5
10168 cat conftest.$ac_ext >&5
10169 LIBS=$ac_save_LIBS
10170 for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
10171 do
10172   # Don't even attempt the hair of trying to link an X program!
10173   for ac_extension in a so sl dylib dll; do
10174     if test -r $ac_dir/libXt.$ac_extension; then
10175       ac_x_libraries=$ac_dir
10176       break 2
10177     fi
10178   done
10179 done
10180 fi
10181 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10182 fi # $ac_x_libraries = no
10183
10184 if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then
10185   # Didn't find X anywhere.  Cache the known absence of X.
10186   ac_cv_have_x="have_x=no"
10187 else
10188   # Record where we found X for the cache.
10189   ac_cv_have_x="have_x=yes \
10190                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
10191 fi
10192 fi
10193
10194   fi
10195   eval "$ac_cv_have_x"
10196 fi # $with_x != no
10197
10198 if test "$have_x" != yes; then
10199   echo "$as_me:10199: result: $have_x" >&5
10200 echo "${ECHO_T}$have_x" >&6
10201   no_x=yes
10202 else
10203   # If each of the values was on the command line, it overrides each guess.
10204   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
10205   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
10206   # Update the cache value to reflect the command line values.
10207   ac_cv_have_x="have_x=yes \
10208                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
10209   echo "$as_me:10209: result: libraries $x_libraries, headers $x_includes" >&5
10210 echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6
10211 fi
10212
10213 if test "$no_x" = yes; then
10214   # Not all programs may use this symbol, but it does not hurt to define it.
10215
10216 cat >>confdefs.h <<\EOF
10217 #define X_DISPLAY_MISSING 1
10218 EOF
10219
10220   X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
10221 else
10222   if test -n "$x_includes"; then
10223     X_CFLAGS="$X_CFLAGS -I$x_includes"
10224   fi
10225
10226   # It would also be nice to do this for all -L options, not just this one.
10227   if test -n "$x_libraries"; then
10228     X_LIBS="$X_LIBS -L$x_libraries"
10229     # For Solaris; some versions of Sun CC require a space after -R and
10230     # others require no space.  Words are not sufficient . . . .
10231     case `(uname -sr) 2>/dev/null` in
10232     "SunOS 5"*)
10233       echo "$as_me:10233: checking whether -R must be followed by a space" >&5
10234 echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6
10235       ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
10236       cat >conftest.$ac_ext <<_ACEOF
10237 #line 10237 "configure"
10238 #include "confdefs.h"
10239
10240 int
10241 main (void)
10242 {
10243
10244   ;
10245   return 0;
10246 }
10247 _ACEOF
10248 rm -f conftest.$ac_objext conftest$ac_exeext
10249 if { (eval echo "$as_me:10249: \"$ac_link\"") >&5
10250   (eval $ac_link) 2>&5
10251   ac_status=$?
10252   echo "$as_me:10252: \$? = $ac_status" >&5
10253   (exit $ac_status); } &&
10254          { ac_try='test -s conftest$ac_exeext'
10255   { (eval echo "$as_me:10255: \"$ac_try\"") >&5
10256   (eval $ac_try) 2>&5
10257   ac_status=$?
10258   echo "$as_me:10258: \$? = $ac_status" >&5
10259   (exit $ac_status); }; }; then
10260   ac_R_nospace=yes
10261 else
10262   echo "$as_me: failed program was:" >&5
10263 cat conftest.$ac_ext >&5
10264 ac_R_nospace=no
10265 fi
10266 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10267       if test $ac_R_nospace = yes; then
10268         echo "$as_me:10268: result: no" >&5
10269 echo "${ECHO_T}no" >&6
10270         X_LIBS="$X_LIBS -R$x_libraries"
10271       else
10272         LIBS="$ac_xsave_LIBS -R $x_libraries"
10273         cat >conftest.$ac_ext <<_ACEOF
10274 #line 10274 "configure"
10275 #include "confdefs.h"
10276
10277 int
10278 main (void)
10279 {
10280
10281   ;
10282   return 0;
10283 }
10284 _ACEOF
10285 rm -f conftest.$ac_objext conftest$ac_exeext
10286 if { (eval echo "$as_me:10286: \"$ac_link\"") >&5
10287   (eval $ac_link) 2>&5
10288   ac_status=$?
10289   echo "$as_me:10289: \$? = $ac_status" >&5
10290   (exit $ac_status); } &&
10291          { ac_try='test -s conftest$ac_exeext'
10292   { (eval echo "$as_me:10292: \"$ac_try\"") >&5
10293   (eval $ac_try) 2>&5
10294   ac_status=$?
10295   echo "$as_me:10295: \$? = $ac_status" >&5
10296   (exit $ac_status); }; }; then
10297   ac_R_space=yes
10298 else
10299   echo "$as_me: failed program was:" >&5
10300 cat conftest.$ac_ext >&5
10301 ac_R_space=no
10302 fi
10303 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10304         if test $ac_R_space = yes; then
10305           echo "$as_me:10305: result: yes" >&5
10306 echo "${ECHO_T}yes" >&6
10307           X_LIBS="$X_LIBS -R $x_libraries"
10308         else
10309           echo "$as_me:10309: result: neither works" >&5
10310 echo "${ECHO_T}neither works" >&6
10311         fi
10312       fi
10313       LIBS=$ac_xsave_LIBS
10314     esac
10315   fi
10316
10317   # Check for system-dependent libraries X programs must link with.
10318   # Do this before checking for the system-independent R6 libraries
10319   # (-lICE), since we may need -lsocket or whatever for X linking.
10320
10321   if test "$ISC" = yes; then
10322     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
10323   else
10324     # Martyn Johnson says this is needed for Ultrix, if the X
10325     # libraries were built with DECnet support.  And Karl Berry says
10326     # the Alpha needs dnet_stub (dnet does not exist).
10327     ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
10328     cat >conftest.$ac_ext <<_ACEOF
10329 #line 10329 "configure"
10330 #include "confdefs.h"
10331
10332 /* Override any gcc2 internal prototype to avoid an error.  */
10333 #ifdef __cplusplus
10334 extern "C"
10335 #endif
10336 /* We use char because int might match the return type of a gcc2
10337    builtin and then its argument prototype would still apply.  */
10338 char XOpenDisplay ();
10339 int
10340 main (void)
10341 {
10342 XOpenDisplay ();
10343   ;
10344   return 0;
10345 }
10346 _ACEOF
10347 rm -f conftest.$ac_objext conftest$ac_exeext
10348 if { (eval echo "$as_me:10348: \"$ac_link\"") >&5
10349   (eval $ac_link) 2>&5
10350   ac_status=$?
10351   echo "$as_me:10351: \$? = $ac_status" >&5
10352   (exit $ac_status); } &&
10353          { ac_try='test -s conftest$ac_exeext'
10354   { (eval echo "$as_me:10354: \"$ac_try\"") >&5
10355   (eval $ac_try) 2>&5
10356   ac_status=$?
10357   echo "$as_me:10357: \$? = $ac_status" >&5
10358   (exit $ac_status); }; }; then
10359   :
10360 else
10361   echo "$as_me: failed program was:" >&5
10362 cat conftest.$ac_ext >&5
10363 echo "$as_me:10363: checking for dnet_ntoa in -ldnet" >&5
10364 echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6
10365 if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then
10366   echo $ECHO_N "(cached) $ECHO_C" >&6
10367 else
10368   ac_check_lib_save_LIBS=$LIBS
10369 LIBS="-ldnet  $LIBS"
10370 cat >conftest.$ac_ext <<_ACEOF
10371 #line 10371 "configure"
10372 #include "confdefs.h"
10373
10374 /* Override any gcc2 internal prototype to avoid an error.  */
10375 #ifdef __cplusplus
10376 extern "C"
10377 #endif
10378 /* We use char because int might match the return type of a gcc2
10379    builtin and then its argument prototype would still apply.  */
10380 char dnet_ntoa ();
10381 int
10382 main (void)
10383 {
10384 dnet_ntoa ();
10385   ;
10386   return 0;
10387 }
10388 _ACEOF
10389 rm -f conftest.$ac_objext conftest$ac_exeext
10390 if { (eval echo "$as_me:10390: \"$ac_link\"") >&5
10391   (eval $ac_link) 2>&5
10392   ac_status=$?
10393   echo "$as_me:10393: \$? = $ac_status" >&5
10394   (exit $ac_status); } &&
10395          { ac_try='test -s conftest$ac_exeext'
10396   { (eval echo "$as_me:10396: \"$ac_try\"") >&5
10397   (eval $ac_try) 2>&5
10398   ac_status=$?
10399   echo "$as_me:10399: \$? = $ac_status" >&5
10400   (exit $ac_status); }; }; then
10401   ac_cv_lib_dnet_dnet_ntoa=yes
10402 else
10403   echo "$as_me: failed program was:" >&5
10404 cat conftest.$ac_ext >&5
10405 ac_cv_lib_dnet_dnet_ntoa=no
10406 fi
10407 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10408 LIBS=$ac_check_lib_save_LIBS
10409 fi
10410 echo "$as_me:10410: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
10411 echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6
10412 if test $ac_cv_lib_dnet_dnet_ntoa = yes; then
10413   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
10414 fi
10415
10416     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
10417       echo "$as_me:10417: checking for dnet_ntoa in -ldnet_stub" >&5
10418 echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6
10419 if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then
10420   echo $ECHO_N "(cached) $ECHO_C" >&6
10421 else
10422   ac_check_lib_save_LIBS=$LIBS
10423 LIBS="-ldnet_stub  $LIBS"
10424 cat >conftest.$ac_ext <<_ACEOF
10425 #line 10425 "configure"
10426 #include "confdefs.h"
10427
10428 /* Override any gcc2 internal prototype to avoid an error.  */
10429 #ifdef __cplusplus
10430 extern "C"
10431 #endif
10432 /* We use char because int might match the return type of a gcc2
10433    builtin and then its argument prototype would still apply.  */
10434 char dnet_ntoa ();
10435 int
10436 main (void)
10437 {
10438 dnet_ntoa ();
10439   ;
10440   return 0;
10441 }
10442 _ACEOF
10443 rm -f conftest.$ac_objext conftest$ac_exeext
10444 if { (eval echo "$as_me:10444: \"$ac_link\"") >&5
10445   (eval $ac_link) 2>&5
10446   ac_status=$?
10447   echo "$as_me:10447: \$? = $ac_status" >&5
10448   (exit $ac_status); } &&
10449          { ac_try='test -s conftest$ac_exeext'
10450   { (eval echo "$as_me:10450: \"$ac_try\"") >&5
10451   (eval $ac_try) 2>&5
10452   ac_status=$?
10453   echo "$as_me:10453: \$? = $ac_status" >&5
10454   (exit $ac_status); }; }; then
10455   ac_cv_lib_dnet_stub_dnet_ntoa=yes
10456 else
10457   echo "$as_me: failed program was:" >&5
10458 cat conftest.$ac_ext >&5
10459 ac_cv_lib_dnet_stub_dnet_ntoa=no
10460 fi
10461 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10462 LIBS=$ac_check_lib_save_LIBS
10463 fi
10464 echo "$as_me:10464: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
10465 echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6
10466 if test $ac_cv_lib_dnet_stub_dnet_ntoa = yes; then
10467   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
10468 fi
10469
10470     fi
10471 fi
10472 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10473     LIBS="$ac_xsave_LIBS"
10474
10475     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
10476     # to get the SysV transport functions.
10477     # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4)
10478     # needs -lnsl.
10479     # The nsl library prevents programs from opening the X display
10480     # on Irix 5.2, according to T.E. Dickey.
10481     # The functions gethostbyname, getservbyname, and inet_addr are
10482     # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
10483     echo "$as_me:10483: checking for gethostbyname" >&5
10484 echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6
10485 if test "${ac_cv_func_gethostbyname+set}" = set; then
10486   echo $ECHO_N "(cached) $ECHO_C" >&6
10487 else
10488   cat >conftest.$ac_ext <<_ACEOF
10489 #line 10489 "configure"
10490 #include "confdefs.h"
10491 /* System header to define __stub macros and hopefully few prototypes,
10492     which can conflict with char gethostbyname (); below.  */
10493 #include <assert.h>
10494 /* Override any gcc2 internal prototype to avoid an error.  */
10495 #ifdef __cplusplus
10496 extern "C"
10497 #endif
10498 /* We use char because int might match the return type of a gcc2
10499    builtin and then its argument prototype would still apply.  */
10500 char gethostbyname ();
10501 char (*f) ();
10502
10503 int
10504 main (void)
10505 {
10506 /* The GNU C library defines this for functions which it implements
10507     to always fail with ENOSYS.  Some functions are actually named
10508     something starting with __ and the normal name is an alias.  */
10509 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
10510 choke me
10511 #else
10512 f = gethostbyname; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
10513 #endif
10514
10515   ;
10516   return 0;
10517 }
10518 _ACEOF
10519 rm -f conftest.$ac_objext conftest$ac_exeext
10520 if { (eval echo "$as_me:10520: \"$ac_link\"") >&5
10521   (eval $ac_link) 2>&5
10522   ac_status=$?
10523   echo "$as_me:10523: \$? = $ac_status" >&5
10524   (exit $ac_status); } &&
10525          { ac_try='test -s conftest$ac_exeext'
10526   { (eval echo "$as_me:10526: \"$ac_try\"") >&5
10527   (eval $ac_try) 2>&5
10528   ac_status=$?
10529   echo "$as_me:10529: \$? = $ac_status" >&5
10530   (exit $ac_status); }; }; then
10531   ac_cv_func_gethostbyname=yes
10532 else
10533   echo "$as_me: failed program was:" >&5
10534 cat conftest.$ac_ext >&5
10535 ac_cv_func_gethostbyname=no
10536 fi
10537 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10538 fi
10539 echo "$as_me:10539: result: $ac_cv_func_gethostbyname" >&5
10540 echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6
10541
10542     if test $ac_cv_func_gethostbyname = no; then
10543       echo "$as_me:10543: checking for gethostbyname in -lnsl" >&5
10544 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6
10545 if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
10546   echo $ECHO_N "(cached) $ECHO_C" >&6
10547 else
10548   ac_check_lib_save_LIBS=$LIBS
10549 LIBS="-lnsl  $LIBS"
10550 cat >conftest.$ac_ext <<_ACEOF
10551 #line 10551 "configure"
10552 #include "confdefs.h"
10553
10554 /* Override any gcc2 internal prototype to avoid an error.  */
10555 #ifdef __cplusplus
10556 extern "C"
10557 #endif
10558 /* We use char because int might match the return type of a gcc2
10559    builtin and then its argument prototype would still apply.  */
10560 char gethostbyname ();
10561 int
10562 main (void)
10563 {
10564 gethostbyname ();
10565   ;
10566   return 0;
10567 }
10568 _ACEOF
10569 rm -f conftest.$ac_objext conftest$ac_exeext
10570 if { (eval echo "$as_me:10570: \"$ac_link\"") >&5
10571   (eval $ac_link) 2>&5
10572   ac_status=$?
10573   echo "$as_me:10573: \$? = $ac_status" >&5
10574   (exit $ac_status); } &&
10575          { ac_try='test -s conftest$ac_exeext'
10576   { (eval echo "$as_me:10576: \"$ac_try\"") >&5
10577   (eval $ac_try) 2>&5
10578   ac_status=$?
10579   echo "$as_me:10579: \$? = $ac_status" >&5
10580   (exit $ac_status); }; }; then
10581   ac_cv_lib_nsl_gethostbyname=yes
10582 else
10583   echo "$as_me: failed program was:" >&5
10584 cat conftest.$ac_ext >&5
10585 ac_cv_lib_nsl_gethostbyname=no
10586 fi
10587 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10588 LIBS=$ac_check_lib_save_LIBS
10589 fi
10590 echo "$as_me:10590: result: $ac_cv_lib_nsl_gethostbyname" >&5
10591 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6
10592 if test $ac_cv_lib_nsl_gethostbyname = yes; then
10593   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
10594 fi
10595
10596       if test $ac_cv_lib_nsl_gethostbyname = no; then
10597         echo "$as_me:10597: checking for gethostbyname in -lbsd" >&5
10598 echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6
10599 if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then
10600   echo $ECHO_N "(cached) $ECHO_C" >&6
10601 else
10602   ac_check_lib_save_LIBS=$LIBS
10603 LIBS="-lbsd  $LIBS"
10604 cat >conftest.$ac_ext <<_ACEOF
10605 #line 10605 "configure"
10606 #include "confdefs.h"
10607
10608 /* Override any gcc2 internal prototype to avoid an error.  */
10609 #ifdef __cplusplus
10610 extern "C"
10611 #endif
10612 /* We use char because int might match the return type of a gcc2
10613    builtin and then its argument prototype would still apply.  */
10614 char gethostbyname ();
10615 int
10616 main (void)
10617 {
10618 gethostbyname ();
10619   ;
10620   return 0;
10621 }
10622 _ACEOF
10623 rm -f conftest.$ac_objext conftest$ac_exeext
10624 if { (eval echo "$as_me:10624: \"$ac_link\"") >&5
10625   (eval $ac_link) 2>&5
10626   ac_status=$?
10627   echo "$as_me:10627: \$? = $ac_status" >&5
10628   (exit $ac_status); } &&
10629          { ac_try='test -s conftest$ac_exeext'
10630   { (eval echo "$as_me:10630: \"$ac_try\"") >&5
10631   (eval $ac_try) 2>&5
10632   ac_status=$?
10633   echo "$as_me:10633: \$? = $ac_status" >&5
10634   (exit $ac_status); }; }; then
10635   ac_cv_lib_bsd_gethostbyname=yes
10636 else
10637   echo "$as_me: failed program was:" >&5
10638 cat conftest.$ac_ext >&5
10639 ac_cv_lib_bsd_gethostbyname=no
10640 fi
10641 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10642 LIBS=$ac_check_lib_save_LIBS
10643 fi
10644 echo "$as_me:10644: result: $ac_cv_lib_bsd_gethostbyname" >&5
10645 echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6
10646 if test $ac_cv_lib_bsd_gethostbyname = yes; then
10647   X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
10648 fi
10649
10650       fi
10651     fi
10652
10653     # lieder@skyler.mavd.honeywell.com says without -lsocket,
10654     # socket/setsockopt and other routines are undefined under SCO ODT
10655     # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
10656     # on later versions), says Simon Leinen: it contains gethostby*
10657     # variants that don't use the nameserver (or something).  -lsocket
10658     # must be given before -lnsl if both are needed.  We assume that
10659     # if connect needs -lnsl, so does gethostbyname.
10660     echo "$as_me:10660: checking for connect" >&5
10661 echo $ECHO_N "checking for connect... $ECHO_C" >&6
10662 if test "${ac_cv_func_connect+set}" = set; then
10663   echo $ECHO_N "(cached) $ECHO_C" >&6
10664 else
10665   cat >conftest.$ac_ext <<_ACEOF
10666 #line 10666 "configure"
10667 #include "confdefs.h"
10668 /* System header to define __stub macros and hopefully few prototypes,
10669     which can conflict with char connect (); below.  */
10670 #include <assert.h>
10671 /* Override any gcc2 internal prototype to avoid an error.  */
10672 #ifdef __cplusplus
10673 extern "C"
10674 #endif
10675 /* We use char because int might match the return type of a gcc2
10676    builtin and then its argument prototype would still apply.  */
10677 char connect ();
10678 char (*f) ();
10679
10680 int
10681 main (void)
10682 {
10683 /* The GNU C library defines this for functions which it implements
10684     to always fail with ENOSYS.  Some functions are actually named
10685     something starting with __ and the normal name is an alias.  */
10686 #if defined (__stub_connect) || defined (__stub___connect)
10687 choke me
10688 #else
10689 f = connect; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
10690 #endif
10691
10692   ;
10693   return 0;
10694 }
10695 _ACEOF
10696 rm -f conftest.$ac_objext conftest$ac_exeext
10697 if { (eval echo "$as_me:10697: \"$ac_link\"") >&5
10698   (eval $ac_link) 2>&5
10699   ac_status=$?
10700   echo "$as_me:10700: \$? = $ac_status" >&5
10701   (exit $ac_status); } &&
10702          { ac_try='test -s conftest$ac_exeext'
10703   { (eval echo "$as_me:10703: \"$ac_try\"") >&5
10704   (eval $ac_try) 2>&5
10705   ac_status=$?
10706   echo "$as_me:10706: \$? = $ac_status" >&5
10707   (exit $ac_status); }; }; then
10708   ac_cv_func_connect=yes
10709 else
10710   echo "$as_me: failed program was:" >&5
10711 cat conftest.$ac_ext >&5
10712 ac_cv_func_connect=no
10713 fi
10714 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10715 fi
10716 echo "$as_me:10716: result: $ac_cv_func_connect" >&5
10717 echo "${ECHO_T}$ac_cv_func_connect" >&6
10718
10719     if test $ac_cv_func_connect = no; then
10720       echo "$as_me:10720: checking for connect in -lsocket" >&5
10721 echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6
10722 if test "${ac_cv_lib_socket_connect+set}" = set; then
10723   echo $ECHO_N "(cached) $ECHO_C" >&6
10724 else
10725   ac_check_lib_save_LIBS=$LIBS
10726 LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
10727 cat >conftest.$ac_ext <<_ACEOF
10728 #line 10728 "configure"
10729 #include "confdefs.h"
10730
10731 /* Override any gcc2 internal prototype to avoid an error.  */
10732 #ifdef __cplusplus
10733 extern "C"
10734 #endif
10735 /* We use char because int might match the return type of a gcc2
10736    builtin and then its argument prototype would still apply.  */
10737 char connect ();
10738 int
10739 main (void)
10740 {
10741 connect ();
10742   ;
10743   return 0;
10744 }
10745 _ACEOF
10746 rm -f conftest.$ac_objext conftest$ac_exeext
10747 if { (eval echo "$as_me:10747: \"$ac_link\"") >&5
10748   (eval $ac_link) 2>&5
10749   ac_status=$?
10750   echo "$as_me:10750: \$? = $ac_status" >&5
10751   (exit $ac_status); } &&
10752          { ac_try='test -s conftest$ac_exeext'
10753   { (eval echo "$as_me:10753: \"$ac_try\"") >&5
10754   (eval $ac_try) 2>&5
10755   ac_status=$?
10756   echo "$as_me:10756: \$? = $ac_status" >&5
10757   (exit $ac_status); }; }; then
10758   ac_cv_lib_socket_connect=yes
10759 else
10760   echo "$as_me: failed program was:" >&5
10761 cat conftest.$ac_ext >&5
10762 ac_cv_lib_socket_connect=no
10763 fi
10764 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10765 LIBS=$ac_check_lib_save_LIBS
10766 fi
10767 echo "$as_me:10767: result: $ac_cv_lib_socket_connect" >&5
10768 echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6
10769 if test $ac_cv_lib_socket_connect = yes; then
10770   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
10771 fi
10772
10773     fi
10774
10775     # Guillermo Gomez says -lposix is necessary on A/UX.
10776     echo "$as_me:10776: checking for remove" >&5
10777 echo $ECHO_N "checking for remove... $ECHO_C" >&6
10778 if test "${ac_cv_func_remove+set}" = set; then
10779   echo $ECHO_N "(cached) $ECHO_C" >&6
10780 else
10781   cat >conftest.$ac_ext <<_ACEOF
10782 #line 10782 "configure"
10783 #include "confdefs.h"
10784 /* System header to define __stub macros and hopefully few prototypes,
10785     which can conflict with char remove (); below.  */
10786 #include <assert.h>
10787 /* Override any gcc2 internal prototype to avoid an error.  */
10788 #ifdef __cplusplus
10789 extern "C"
10790 #endif
10791 /* We use char because int might match the return type of a gcc2
10792    builtin and then its argument prototype would still apply.  */
10793 char remove ();
10794 char (*f) ();
10795
10796 int
10797 main (void)
10798 {
10799 /* The GNU C library defines this for functions which it implements
10800     to always fail with ENOSYS.  Some functions are actually named
10801     something starting with __ and the normal name is an alias.  */
10802 #if defined (__stub_remove) || defined (__stub___remove)
10803 choke me
10804 #else
10805 f = remove; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
10806 #endif
10807
10808   ;
10809   return 0;
10810 }
10811 _ACEOF
10812 rm -f conftest.$ac_objext conftest$ac_exeext
10813 if { (eval echo "$as_me:10813: \"$ac_link\"") >&5
10814   (eval $ac_link) 2>&5
10815   ac_status=$?
10816   echo "$as_me:10816: \$? = $ac_status" >&5
10817   (exit $ac_status); } &&
10818          { ac_try='test -s conftest$ac_exeext'
10819   { (eval echo "$as_me:10819: \"$ac_try\"") >&5
10820   (eval $ac_try) 2>&5
10821   ac_status=$?
10822   echo "$as_me:10822: \$? = $ac_status" >&5
10823   (exit $ac_status); }; }; then
10824   ac_cv_func_remove=yes
10825 else
10826   echo "$as_me: failed program was:" >&5
10827 cat conftest.$ac_ext >&5
10828 ac_cv_func_remove=no
10829 fi
10830 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10831 fi
10832 echo "$as_me:10832: result: $ac_cv_func_remove" >&5
10833 echo "${ECHO_T}$ac_cv_func_remove" >&6
10834
10835     if test $ac_cv_func_remove = no; then
10836       echo "$as_me:10836: checking for remove in -lposix" >&5
10837 echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6
10838 if test "${ac_cv_lib_posix_remove+set}" = set; then
10839   echo $ECHO_N "(cached) $ECHO_C" >&6
10840 else
10841   ac_check_lib_save_LIBS=$LIBS
10842 LIBS="-lposix  $LIBS"
10843 cat >conftest.$ac_ext <<_ACEOF
10844 #line 10844 "configure"
10845 #include "confdefs.h"
10846
10847 /* Override any gcc2 internal prototype to avoid an error.  */
10848 #ifdef __cplusplus
10849 extern "C"
10850 #endif
10851 /* We use char because int might match the return type of a gcc2
10852    builtin and then its argument prototype would still apply.  */
10853 char remove ();
10854 int
10855 main (void)
10856 {
10857 remove ();
10858   ;
10859   return 0;
10860 }
10861 _ACEOF
10862 rm -f conftest.$ac_objext conftest$ac_exeext
10863 if { (eval echo "$as_me:10863: \"$ac_link\"") >&5
10864   (eval $ac_link) 2>&5
10865   ac_status=$?
10866   echo "$as_me:10866: \$? = $ac_status" >&5
10867   (exit $ac_status); } &&
10868          { ac_try='test -s conftest$ac_exeext'
10869   { (eval echo "$as_me:10869: \"$ac_try\"") >&5
10870   (eval $ac_try) 2>&5
10871   ac_status=$?
10872   echo "$as_me:10872: \$? = $ac_status" >&5
10873   (exit $ac_status); }; }; then
10874   ac_cv_lib_posix_remove=yes
10875 else
10876   echo "$as_me: failed program was:" >&5
10877 cat conftest.$ac_ext >&5
10878 ac_cv_lib_posix_remove=no
10879 fi
10880 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10881 LIBS=$ac_check_lib_save_LIBS
10882 fi
10883 echo "$as_me:10883: result: $ac_cv_lib_posix_remove" >&5
10884 echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6
10885 if test $ac_cv_lib_posix_remove = yes; then
10886   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
10887 fi
10888
10889     fi
10890
10891     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
10892     echo "$as_me:10892: checking for shmat" >&5
10893 echo $ECHO_N "checking for shmat... $ECHO_C" >&6
10894 if test "${ac_cv_func_shmat+set}" = set; then
10895   echo $ECHO_N "(cached) $ECHO_C" >&6
10896 else
10897   cat >conftest.$ac_ext <<_ACEOF
10898 #line 10898 "configure"
10899 #include "confdefs.h"
10900 /* System header to define __stub macros and hopefully few prototypes,
10901     which can conflict with char shmat (); below.  */
10902 #include <assert.h>
10903 /* Override any gcc2 internal prototype to avoid an error.  */
10904 #ifdef __cplusplus
10905 extern "C"
10906 #endif
10907 /* We use char because int might match the return type of a gcc2
10908    builtin and then its argument prototype would still apply.  */
10909 char shmat ();
10910 char (*f) ();
10911
10912 int
10913 main (void)
10914 {
10915 /* The GNU C library defines this for functions which it implements
10916     to always fail with ENOSYS.  Some functions are actually named
10917     something starting with __ and the normal name is an alias.  */
10918 #if defined (__stub_shmat) || defined (__stub___shmat)
10919 choke me
10920 #else
10921 f = shmat; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
10922 #endif
10923
10924   ;
10925   return 0;
10926 }
10927 _ACEOF
10928 rm -f conftest.$ac_objext conftest$ac_exeext
10929 if { (eval echo "$as_me:10929: \"$ac_link\"") >&5
10930   (eval $ac_link) 2>&5
10931   ac_status=$?
10932   echo "$as_me:10932: \$? = $ac_status" >&5
10933   (exit $ac_status); } &&
10934          { ac_try='test -s conftest$ac_exeext'
10935   { (eval echo "$as_me:10935: \"$ac_try\"") >&5
10936   (eval $ac_try) 2>&5
10937   ac_status=$?
10938   echo "$as_me:10938: \$? = $ac_status" >&5
10939   (exit $ac_status); }; }; then
10940   ac_cv_func_shmat=yes
10941 else
10942   echo "$as_me: failed program was:" >&5
10943 cat conftest.$ac_ext >&5
10944 ac_cv_func_shmat=no
10945 fi
10946 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10947 fi
10948 echo "$as_me:10948: result: $ac_cv_func_shmat" >&5
10949 echo "${ECHO_T}$ac_cv_func_shmat" >&6
10950
10951     if test $ac_cv_func_shmat = no; then
10952       echo "$as_me:10952: checking for shmat in -lipc" >&5
10953 echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6
10954 if test "${ac_cv_lib_ipc_shmat+set}" = set; then
10955   echo $ECHO_N "(cached) $ECHO_C" >&6
10956 else
10957   ac_check_lib_save_LIBS=$LIBS
10958 LIBS="-lipc  $LIBS"
10959 cat >conftest.$ac_ext <<_ACEOF
10960 #line 10960 "configure"
10961 #include "confdefs.h"
10962
10963 /* Override any gcc2 internal prototype to avoid an error.  */
10964 #ifdef __cplusplus
10965 extern "C"
10966 #endif
10967 /* We use char because int might match the return type of a gcc2
10968    builtin and then its argument prototype would still apply.  */
10969 char shmat ();
10970 int
10971 main (void)
10972 {
10973 shmat ();
10974   ;
10975   return 0;
10976 }
10977 _ACEOF
10978 rm -f conftest.$ac_objext conftest$ac_exeext
10979 if { (eval echo "$as_me:10979: \"$ac_link\"") >&5
10980   (eval $ac_link) 2>&5
10981   ac_status=$?
10982   echo "$as_me:10982: \$? = $ac_status" >&5
10983   (exit $ac_status); } &&
10984          { ac_try='test -s conftest$ac_exeext'
10985   { (eval echo "$as_me:10985: \"$ac_try\"") >&5
10986   (eval $ac_try) 2>&5
10987   ac_status=$?
10988   echo "$as_me:10988: \$? = $ac_status" >&5
10989   (exit $ac_status); }; }; then
10990   ac_cv_lib_ipc_shmat=yes
10991 else
10992   echo "$as_me: failed program was:" >&5
10993 cat conftest.$ac_ext >&5
10994 ac_cv_lib_ipc_shmat=no
10995 fi
10996 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10997 LIBS=$ac_check_lib_save_LIBS
10998 fi
10999 echo "$as_me:10999: result: $ac_cv_lib_ipc_shmat" >&5
11000 echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6
11001 if test $ac_cv_lib_ipc_shmat = yes; then
11002   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
11003 fi
11004
11005     fi
11006   fi
11007
11008   # Check for libraries that X11R6 Xt/Xaw programs need.
11009   ac_save_LDFLAGS=$LDFLAGS
11010   test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
11011   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
11012   # check for ICE first), but we must link in the order -lSM -lICE or
11013   # we get undefined symbols.  So assume we have SM if we have ICE.
11014   # These have to be linked with before -lX11, unlike the other
11015   # libraries we check for below, so use a different variable.
11016   # John Interrante, Karl Berry
11017   echo "$as_me:11017: checking for IceConnectionNumber in -lICE" >&5
11018 echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6
11019 if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then
11020   echo $ECHO_N "(cached) $ECHO_C" >&6
11021 else
11022   ac_check_lib_save_LIBS=$LIBS
11023 LIBS="-lICE $X_EXTRA_LIBS $LIBS"
11024 cat >conftest.$ac_ext <<_ACEOF
11025 #line 11025 "configure"
11026 #include "confdefs.h"
11027
11028 /* Override any gcc2 internal prototype to avoid an error.  */
11029 #ifdef __cplusplus
11030 extern "C"
11031 #endif
11032 /* We use char because int might match the return type of a gcc2
11033    builtin and then its argument prototype would still apply.  */
11034 char IceConnectionNumber ();
11035 int
11036 main (void)
11037 {
11038 IceConnectionNumber ();
11039   ;
11040   return 0;
11041 }
11042 _ACEOF
11043 rm -f conftest.$ac_objext conftest$ac_exeext
11044 if { (eval echo "$as_me:11044: \"$ac_link\"") >&5
11045   (eval $ac_link) 2>&5
11046   ac_status=$?
11047   echo "$as_me:11047: \$? = $ac_status" >&5
11048   (exit $ac_status); } &&
11049          { ac_try='test -s conftest$ac_exeext'
11050   { (eval echo "$as_me:11050: \"$ac_try\"") >&5
11051   (eval $ac_try) 2>&5
11052   ac_status=$?
11053   echo "$as_me:11053: \$? = $ac_status" >&5
11054   (exit $ac_status); }; }; then
11055   ac_cv_lib_ICE_IceConnectionNumber=yes
11056 else
11057   echo "$as_me: failed program was:" >&5
11058 cat conftest.$ac_ext >&5
11059 ac_cv_lib_ICE_IceConnectionNumber=no
11060 fi
11061 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11062 LIBS=$ac_check_lib_save_LIBS
11063 fi
11064 echo "$as_me:11064: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
11065 echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6
11066 if test $ac_cv_lib_ICE_IceConnectionNumber = yes; then
11067   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
11068 fi
11069
11070   LDFLAGS=$ac_save_LDFLAGS
11071
11072 fi
11073
11074 cf_x_athena=${cf_x_athena:-Xaw}
11075
11076 echo "$as_me:11076: checking if you want to link with Xaw 3d library" >&5
11077 echo $ECHO_N "checking if you want to link with Xaw 3d library... $ECHO_C" >&6
11078 withval=
11079
11080 # Check whether --with-Xaw3d or --without-Xaw3d was given.
11081 if test "${with_Xaw3d+set}" = set; then
11082   withval="$with_Xaw3d"
11083
11084 fi;
11085 if test "$withval" = yes ; then
11086         cf_x_athena=Xaw3d
11087         echo "$as_me:11087: result: yes" >&5
11088 echo "${ECHO_T}yes" >&6
11089 else
11090         echo "$as_me:11090: result: no" >&5
11091 echo "${ECHO_T}no" >&6
11092 fi
11093
11094 echo "$as_me:11094: checking if you want to link with Xaw 3d xft library" >&5
11095 echo $ECHO_N "checking if you want to link with Xaw 3d xft library... $ECHO_C" >&6
11096 withval=
11097
11098 # Check whether --with-Xaw3dxft or --without-Xaw3dxft was given.
11099 if test "${with_Xaw3dxft+set}" = set; then
11100   withval="$with_Xaw3dxft"
11101
11102 fi;
11103 if test "$withval" = yes ; then
11104         cf_x_athena=Xaw3dxft
11105         echo "$as_me:11105: result: yes" >&5
11106 echo "${ECHO_T}yes" >&6
11107 else
11108         echo "$as_me:11108: result: no" >&5
11109 echo "${ECHO_T}no" >&6
11110 fi
11111
11112 echo "$as_me:11112: checking if you want to link with neXT Athena library" >&5
11113 echo $ECHO_N "checking if you want to link with neXT Athena library... $ECHO_C" >&6
11114 withval=
11115
11116 # Check whether --with-neXtaw or --without-neXtaw was given.
11117 if test "${with_neXtaw+set}" = set; then
11118   withval="$with_neXtaw"
11119
11120 fi;
11121 if test "$withval" = yes ; then
11122         cf_x_athena=neXtaw
11123         echo "$as_me:11123: result: yes" >&5
11124 echo "${ECHO_T}yes" >&6
11125 else
11126         echo "$as_me:11126: result: no" >&5
11127 echo "${ECHO_T}no" >&6
11128 fi
11129
11130 echo "$as_me:11130: checking if you want to link with Athena-Plus library" >&5
11131 echo $ECHO_N "checking if you want to link with Athena-Plus library... $ECHO_C" >&6
11132 withval=
11133
11134 # Check whether --with-XawPlus or --without-XawPlus was given.
11135 if test "${with_XawPlus+set}" = set; then
11136   withval="$with_XawPlus"
11137
11138 fi;
11139 if test "$withval" = yes ; then
11140         cf_x_athena=XawPlus
11141         echo "$as_me:11141: result: yes" >&5
11142 echo "${ECHO_T}yes" >&6
11143 else
11144         echo "$as_me:11144: result: no" >&5
11145 echo "${ECHO_T}no" >&6
11146 fi
11147
11148 cf_x_athena_lib=""
11149
11150 if test "$PKG_CONFIG" != none ; then
11151         cf_athena_list=
11152         test "$cf_x_athena" = Xaw && cf_athena_list="xaw8 xaw7 xaw6"
11153         for cf_athena_pkg in \
11154                 $cf_athena_list \
11155                 ${cf_x_athena} \
11156                 ${cf_x_athena}-devel \
11157                 lib${cf_x_athena} \
11158                 lib${cf_x_athena}-devel
11159         do
11160
11161 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists $cf_athena_pkg; then
11162         test -n "$verbose" && echo "    found package $cf_athena_pkg" 1>&6
11163
11164 echo "${as_me:-configure}:11164: testing found package $cf_athena_pkg ..." 1>&5
11165
11166         cf_pkgconfig_incs="`$PKG_CONFIG --cflags $cf_athena_pkg 2>/dev/null`"
11167         cf_pkgconfig_libs="`$PKG_CONFIG --libs   $cf_athena_pkg 2>/dev/null`"
11168         test -n "$verbose" && echo "    package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs" 1>&6
11169
11170 echo "${as_me:-configure}:11170: testing package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11171
11172         test -n "$verbose" && echo "    package $cf_athena_pkg LIBS: $cf_pkgconfig_libs" 1>&6
11173
11174 echo "${as_me:-configure}:11174: testing package $cf_athena_pkg LIBS: $cf_pkgconfig_libs ..." 1>&5
11175
11176 cf_fix_cppflags=no
11177 cf_new_cflags=
11178 cf_new_cppflags=
11179 cf_new_extra_cppflags=
11180
11181 for cf_add_cflags in $cf_pkgconfig_incs
11182 do
11183 case $cf_fix_cppflags in
11184 (no)
11185         case $cf_add_cflags in
11186         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11187                 case $cf_add_cflags in
11188                 (-D*)
11189                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11190
11191                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11192                                 && test -z "${cf_tst_cflags}" \
11193                                 && cf_fix_cppflags=yes
11194
11195                         if test $cf_fix_cppflags = yes ; then
11196
11197         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11198         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11199
11200                                 continue
11201                         elif test "${cf_tst_cflags}" = "\"'" ; then
11202
11203         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11204         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11205
11206                                 continue
11207                         fi
11208                         ;;
11209                 esac
11210                 case "$CPPFLAGS" in
11211                 (*$cf_add_cflags)
11212                         ;;
11213                 (*)
11214                         case $cf_add_cflags in
11215                         (-D*)
11216                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11217
11218 CPPFLAGS=`echo "$CPPFLAGS" | \
11219         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11220                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11221
11222                                 ;;
11223                         esac
11224
11225         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
11226         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
11227
11228                         ;;
11229                 esac
11230                 ;;
11231         (*)
11232
11233         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
11234         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
11235
11236                 ;;
11237         esac
11238         ;;
11239 (yes)
11240
11241         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11242         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11243
11244         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11245
11246         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11247                 && test -z "${cf_tst_cflags}" \
11248                 && cf_fix_cppflags=no
11249         ;;
11250 esac
11251 done
11252
11253 if test -n "$cf_new_cflags" ; then
11254
11255         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
11256         CFLAGS="${CFLAGS}$cf_new_cflags"
11257
11258 fi
11259
11260 if test -n "$cf_new_cppflags" ; then
11261
11262         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11263         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
11264
11265 fi
11266
11267 if test -n "$cf_new_extra_cppflags" ; then
11268
11269         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
11270         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
11271
11272 fi
11273
11274 cf_add_libs="$cf_pkgconfig_libs"
11275 # Filter out duplicates - this happens with badly-designed ".pc" files...
11276 for cf_add_1lib in $LIBS
11277 do
11278         for cf_add_2lib in $cf_add_libs
11279         do
11280                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11281                 then
11282                         cf_add_1lib=
11283                         break
11284                 fi
11285         done
11286         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11287 done
11288 LIBS="$cf_add_libs"
11289
11290                         cf_x_athena_lib="$cf_pkgconfig_libs"
11291
11292 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
11293
11294                         cat >>confdefs.h <<EOF
11295 #define $cf_x_athena_LIBS 1
11296 EOF
11297
11298         for cf_trim_lib in Xmu Xt X11
11299         do
11300                 case "$LIBS" in
11301                 (*-l$cf_trim_lib\ *-l$cf_trim_lib*)
11302                         LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
11303                         test -n "$verbose" && echo "    ..trimmed $LIBS" 1>&6
11304
11305 echo "${as_me:-configure}:11305: testing ..trimmed $LIBS ..." 1>&5
11306
11307                         ;;
11308                 esac
11309         done
11310
11311 echo "$as_me:11311: checking for usable $cf_x_athena/Xmu package" >&5
11312 echo $ECHO_N "checking for usable $cf_x_athena/Xmu package... $ECHO_C" >&6
11313 if test "${cf_cv_xaw_compat+set}" = set; then
11314   echo $ECHO_N "(cached) $ECHO_C" >&6
11315 else
11316
11317 cat >conftest.$ac_ext <<_ACEOF
11318 #line 11318 "configure"
11319 #include "confdefs.h"
11320
11321 #include <X11/Xmu/CharSet.h>
11322
11323 int
11324 main (void)
11325 {
11326
11327 int check = XmuCompareISOLatin1("big", "small")
11328
11329   ;
11330   return 0;
11331 }
11332 _ACEOF
11333 rm -f conftest.$ac_objext conftest$ac_exeext
11334 if { (eval echo "$as_me:11334: \"$ac_link\"") >&5
11335   (eval $ac_link) 2>&5
11336   ac_status=$?
11337   echo "$as_me:11337: \$? = $ac_status" >&5
11338   (exit $ac_status); } &&
11339          { ac_try='test -s conftest$ac_exeext'
11340   { (eval echo "$as_me:11340: \"$ac_try\"") >&5
11341   (eval $ac_try) 2>&5
11342   ac_status=$?
11343   echo "$as_me:11343: \$? = $ac_status" >&5
11344   (exit $ac_status); }; }; then
11345   cf_cv_xaw_compat=yes
11346 else
11347   echo "$as_me: failed program was:" >&5
11348 cat conftest.$ac_ext >&5
11349 cf_cv_xaw_compat=no
11350 fi
11351 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11352 fi
11353 echo "$as_me:11353: result: $cf_cv_xaw_compat" >&5
11354 echo "${ECHO_T}$cf_cv_xaw_compat" >&6
11355
11356                         if test "$cf_cv_xaw_compat" = no
11357                         then
11358                                 # workaround for broken ".pc" files...
11359                                 case "$cf_x_athena_lib" in
11360                                 (*-lXmu*)
11361                                         ;;
11362                                 (*)
11363                                         test -n "$verbose" && echo "    work around broken package" 1>&6
11364
11365 echo "${as_me:-configure}:11365: testing work around broken package ..." 1>&5
11366
11367                                         cf_save_xmu="$LIBS"
11368                                         cf_first_lib=`echo "$cf_save_xmu" | sed -e 's/^  *//' -e 's/ .*//'`
11369
11370 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xmu; then
11371         test -n "$verbose" && echo "    found package xmu" 1>&6
11372
11373 echo "${as_me:-configure}:11373: testing found package xmu ..." 1>&5
11374
11375         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xmu 2>/dev/null`"
11376         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xmu 2>/dev/null`"
11377         test -n "$verbose" && echo "    package xmu CFLAGS: $cf_pkgconfig_incs" 1>&6
11378
11379 echo "${as_me:-configure}:11379: testing package xmu CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11380
11381         test -n "$verbose" && echo "    package xmu LIBS: $cf_pkgconfig_libs" 1>&6
11382
11383 echo "${as_me:-configure}:11383: testing package xmu LIBS: $cf_pkgconfig_libs ..." 1>&5
11384
11385 cf_fix_cppflags=no
11386 cf_new_cflags=
11387 cf_new_cppflags=
11388 cf_new_extra_cppflags=
11389
11390 for cf_add_cflags in $cf_pkgconfig_incs
11391 do
11392 case $cf_fix_cppflags in
11393 (no)
11394         case $cf_add_cflags in
11395         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11396                 case $cf_add_cflags in
11397                 (-D*)
11398                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11399
11400                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11401                                 && test -z "${cf_tst_cflags}" \
11402                                 && cf_fix_cppflags=yes
11403
11404                         if test $cf_fix_cppflags = yes ; then
11405
11406         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11407         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11408
11409                                 continue
11410                         elif test "${cf_tst_cflags}" = "\"'" ; then
11411
11412         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11413         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11414
11415                                 continue
11416                         fi
11417                         ;;
11418                 esac
11419                 case "$CPPFLAGS" in
11420                 (*$cf_add_cflags)
11421                         ;;
11422                 (*)
11423                         case $cf_add_cflags in
11424                         (-D*)
11425                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11426
11427 CPPFLAGS=`echo "$CPPFLAGS" | \
11428         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11429                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11430
11431                                 ;;
11432                         esac
11433
11434         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
11435         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
11436
11437                         ;;
11438                 esac
11439                 ;;
11440         (*)
11441
11442         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
11443         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
11444
11445                 ;;
11446         esac
11447         ;;
11448 (yes)
11449
11450         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11451         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11452
11453         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11454
11455         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11456                 && test -z "${cf_tst_cflags}" \
11457                 && cf_fix_cppflags=no
11458         ;;
11459 esac
11460 done
11461
11462 if test -n "$cf_new_cflags" ; then
11463
11464         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
11465         CFLAGS="${CFLAGS}$cf_new_cflags"
11466
11467 fi
11468
11469 if test -n "$cf_new_cppflags" ; then
11470
11471         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11472         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
11473
11474 fi
11475
11476 if test -n "$cf_new_extra_cppflags" ; then
11477
11478         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
11479         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
11480
11481 fi
11482
11483 cf_add_libs="$cf_pkgconfig_libs"
11484 # Filter out duplicates - this happens with badly-designed ".pc" files...
11485 for cf_add_1lib in $LIBS
11486 do
11487         for cf_add_2lib in $cf_add_libs
11488         do
11489                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11490                 then
11491                         cf_add_1lib=
11492                         break
11493                 fi
11494         done
11495         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11496 done
11497 LIBS="$cf_add_libs"
11498
11499                                                         LIBS="$cf_save_xmu"
11500
11501 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
11502
11503 echo "${as_me:-configure}:11503: testing ...before $LIBS ..." 1>&5
11504
11505 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib $cf_pkgconfig_libs %" -e 's%  % %g'`
11506 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
11507
11508 echo "${as_me:-configure}:11508: testing ...after  $LIBS ..." 1>&5
11509
11510 else
11511         cf_pkgconfig_incs=
11512         cf_pkgconfig_libs=
11513
11514 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
11515
11516 echo "${as_me:-configure}:11516: testing ...before $LIBS ..." 1>&5
11517
11518 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib -lXmu %" -e 's%  % %g'`
11519 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
11520
11521 echo "${as_me:-configure}:11521: testing ...after  $LIBS ..." 1>&5
11522
11523 fi
11524
11525         for cf_trim_lib in Xmu Xt X11
11526         do
11527                 case "$LIBS" in
11528                 (*-l$cf_trim_lib\ *-l$cf_trim_lib*)
11529                         LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
11530                         test -n "$verbose" && echo "    ..trimmed $LIBS" 1>&6
11531
11532 echo "${as_me:-configure}:11532: testing ..trimmed $LIBS ..." 1>&5
11533
11534                         ;;
11535                 esac
11536         done
11537
11538                                         ;;
11539                                 esac
11540                         fi
11541
11542                         break
11543 else
11544         cf_pkgconfig_incs=
11545         cf_pkgconfig_libs=
11546         :
11547 fi
11548
11549         done
11550 fi
11551
11552 if test -z "$cf_x_athena_lib" ; then
11553
11554 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists Xext; then
11555         test -n "$verbose" && echo "    found package Xext" 1>&6
11556
11557 echo "${as_me:-configure}:11557: testing found package Xext ..." 1>&5
11558
11559         cf_pkgconfig_incs="`$PKG_CONFIG --cflags Xext 2>/dev/null`"
11560         cf_pkgconfig_libs="`$PKG_CONFIG --libs   Xext 2>/dev/null`"
11561         test -n "$verbose" && echo "    package Xext CFLAGS: $cf_pkgconfig_incs" 1>&6
11562
11563 echo "${as_me:-configure}:11563: testing package Xext CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11564
11565         test -n "$verbose" && echo "    package Xext LIBS: $cf_pkgconfig_libs" 1>&6
11566
11567 echo "${as_me:-configure}:11567: testing package Xext LIBS: $cf_pkgconfig_libs ..." 1>&5
11568
11569 cf_fix_cppflags=no
11570 cf_new_cflags=
11571 cf_new_cppflags=
11572 cf_new_extra_cppflags=
11573
11574 for cf_add_cflags in $cf_pkgconfig_incs
11575 do
11576 case $cf_fix_cppflags in
11577 (no)
11578         case $cf_add_cflags in
11579         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11580                 case $cf_add_cflags in
11581                 (-D*)
11582                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11583
11584                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11585                                 && test -z "${cf_tst_cflags}" \
11586                                 && cf_fix_cppflags=yes
11587
11588                         if test $cf_fix_cppflags = yes ; then
11589
11590         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11591         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11592
11593                                 continue
11594                         elif test "${cf_tst_cflags}" = "\"'" ; then
11595
11596         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11597         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11598
11599                                 continue
11600                         fi
11601                         ;;
11602                 esac
11603                 case "$CPPFLAGS" in
11604                 (*$cf_add_cflags)
11605                         ;;
11606                 (*)
11607                         case $cf_add_cflags in
11608                         (-D*)
11609                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11610
11611 CPPFLAGS=`echo "$CPPFLAGS" | \
11612         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11613                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11614
11615                                 ;;
11616                         esac
11617
11618         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
11619         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
11620
11621                         ;;
11622                 esac
11623                 ;;
11624         (*)
11625
11626         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
11627         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
11628
11629                 ;;
11630         esac
11631         ;;
11632 (yes)
11633
11634         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11635         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11636
11637         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11638
11639         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11640                 && test -z "${cf_tst_cflags}" \
11641                 && cf_fix_cppflags=no
11642         ;;
11643 esac
11644 done
11645
11646 if test -n "$cf_new_cflags" ; then
11647
11648         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
11649         CFLAGS="${CFLAGS}$cf_new_cflags"
11650
11651 fi
11652
11653 if test -n "$cf_new_cppflags" ; then
11654
11655         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11656         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
11657
11658 fi
11659
11660 if test -n "$cf_new_extra_cppflags" ; then
11661
11662         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
11663         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
11664
11665 fi
11666
11667 cf_add_libs="$cf_pkgconfig_libs"
11668 # Filter out duplicates - this happens with badly-designed ".pc" files...
11669 for cf_add_1lib in $LIBS
11670 do
11671         for cf_add_2lib in $cf_add_libs
11672         do
11673                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11674                 then
11675                         cf_add_1lib=
11676                         break
11677                 fi
11678         done
11679         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11680 done
11681 LIBS="$cf_add_libs"
11682
11683         :
11684 else
11685         cf_pkgconfig_incs=
11686         cf_pkgconfig_libs=
11687
11688         echo "$as_me:11688: checking for XextCreateExtension in -lXext" >&5
11689 echo $ECHO_N "checking for XextCreateExtension in -lXext... $ECHO_C" >&6
11690 if test "${ac_cv_lib_Xext_XextCreateExtension+set}" = set; then
11691   echo $ECHO_N "(cached) $ECHO_C" >&6
11692 else
11693   ac_check_lib_save_LIBS=$LIBS
11694 LIBS="-lXext  $LIBS"
11695 cat >conftest.$ac_ext <<_ACEOF
11696 #line 11696 "configure"
11697 #include "confdefs.h"
11698
11699 /* Override any gcc2 internal prototype to avoid an error.  */
11700 #ifdef __cplusplus
11701 extern "C"
11702 #endif
11703 /* We use char because int might match the return type of a gcc2
11704    builtin and then its argument prototype would still apply.  */
11705 char XextCreateExtension ();
11706 int
11707 main (void)
11708 {
11709 XextCreateExtension ();
11710   ;
11711   return 0;
11712 }
11713 _ACEOF
11714 rm -f conftest.$ac_objext conftest$ac_exeext
11715 if { (eval echo "$as_me:11715: \"$ac_link\"") >&5
11716   (eval $ac_link) 2>&5
11717   ac_status=$?
11718   echo "$as_me:11718: \$? = $ac_status" >&5
11719   (exit $ac_status); } &&
11720          { ac_try='test -s conftest$ac_exeext'
11721   { (eval echo "$as_me:11721: \"$ac_try\"") >&5
11722   (eval $ac_try) 2>&5
11723   ac_status=$?
11724   echo "$as_me:11724: \$? = $ac_status" >&5
11725   (exit $ac_status); }; }; then
11726   ac_cv_lib_Xext_XextCreateExtension=yes
11727 else
11728   echo "$as_me: failed program was:" >&5
11729 cat conftest.$ac_ext >&5
11730 ac_cv_lib_Xext_XextCreateExtension=no
11731 fi
11732 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11733 LIBS=$ac_check_lib_save_LIBS
11734 fi
11735 echo "$as_me:11735: result: $ac_cv_lib_Xext_XextCreateExtension" >&5
11736 echo "${ECHO_T}$ac_cv_lib_Xext_XextCreateExtension" >&6
11737 if test $ac_cv_lib_Xext_XextCreateExtension = yes; then
11738
11739 cf_add_libs="-lXext"
11740 # Filter out duplicates - this happens with badly-designed ".pc" files...
11741 for cf_add_1lib in $LIBS
11742 do
11743         for cf_add_2lib in $cf_add_libs
11744         do
11745                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11746                 then
11747                         cf_add_1lib=
11748                         break
11749                 fi
11750         done
11751         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11752 done
11753 LIBS="$cf_add_libs"
11754
11755 fi
11756
11757 fi
11758
11759 # OSX is schizoid about who owns /usr/X11 (old) versus /opt/X11 (new), and (and
11760 # in some cases has installed dummy files in the former, other cases replaced
11761 # it with a link to the new location).  This complicates the configure script.
11762 # Check for that pitfall, and recover using pkg-config
11763 #
11764 # If none of these are set, the configuration is almost certainly broken.
11765 if test -z "${X_CFLAGS}${X_PRE_LIBS}${X_LIBS}${X_EXTRA_LIBS}"
11766 then
11767
11768 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists x11; then
11769         test -n "$verbose" && echo "    found package x11" 1>&6
11770
11771 echo "${as_me:-configure}:11771: testing found package x11 ..." 1>&5
11772
11773         cf_pkgconfig_incs="`$PKG_CONFIG --cflags x11 2>/dev/null`"
11774         cf_pkgconfig_libs="`$PKG_CONFIG --libs   x11 2>/dev/null`"
11775         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
11776
11777 echo "${as_me:-configure}:11777: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11778
11779         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
11780
11781 echo "${as_me:-configure}:11781: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
11782
11783 cf_fix_cppflags=no
11784 cf_new_cflags=
11785 cf_new_cppflags=
11786 cf_new_extra_cppflags=
11787
11788 for cf_add_cflags in $cf_pkgconfig_incs
11789 do
11790 case $cf_fix_cppflags in
11791 (no)
11792         case $cf_add_cflags in
11793         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11794                 case $cf_add_cflags in
11795                 (-D*)
11796                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11797
11798                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11799                                 && test -z "${cf_tst_cflags}" \
11800                                 && cf_fix_cppflags=yes
11801
11802                         if test $cf_fix_cppflags = yes ; then
11803
11804         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11805         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11806
11807                                 continue
11808                         elif test "${cf_tst_cflags}" = "\"'" ; then
11809
11810         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11811         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11812
11813                                 continue
11814                         fi
11815                         ;;
11816                 esac
11817                 case "$CPPFLAGS" in
11818                 (*$cf_add_cflags)
11819                         ;;
11820                 (*)
11821                         case $cf_add_cflags in
11822                         (-D*)
11823                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11824
11825 CPPFLAGS=`echo "$CPPFLAGS" | \
11826         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11827                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11828
11829                                 ;;
11830                         esac
11831
11832         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
11833         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
11834
11835                         ;;
11836                 esac
11837                 ;;
11838         (*)
11839
11840         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
11841         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
11842
11843                 ;;
11844         esac
11845         ;;
11846 (yes)
11847
11848         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11849         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11850
11851         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11852
11853         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11854                 && test -z "${cf_tst_cflags}" \
11855                 && cf_fix_cppflags=no
11856         ;;
11857 esac
11858 done
11859
11860 if test -n "$cf_new_cflags" ; then
11861
11862         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
11863         CFLAGS="${CFLAGS}$cf_new_cflags"
11864
11865 fi
11866
11867 if test -n "$cf_new_cppflags" ; then
11868
11869         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11870         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
11871
11872 fi
11873
11874 if test -n "$cf_new_extra_cppflags" ; then
11875
11876         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
11877         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
11878
11879 fi
11880
11881 cf_add_libs="$cf_pkgconfig_libs"
11882 # Filter out duplicates - this happens with badly-designed ".pc" files...
11883 for cf_add_1lib in $LIBS
11884 do
11885         for cf_add_2lib in $cf_add_libs
11886         do
11887                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11888                 then
11889                         cf_add_1lib=
11890                         break
11891                 fi
11892         done
11893         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11894 done
11895 LIBS="$cf_add_libs"
11896
11897         :
11898 else
11899         cf_pkgconfig_incs=
11900         cf_pkgconfig_libs=
11901         { echo "$as_me:11901: WARNING: unable to find X11 library" >&5
11902 echo "$as_me: WARNING: unable to find X11 library" >&2;}
11903 fi
11904
11905 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists ice; then
11906         test -n "$verbose" && echo "    found package ice" 1>&6
11907
11908 echo "${as_me:-configure}:11908: testing found package ice ..." 1>&5
11909
11910         cf_pkgconfig_incs="`$PKG_CONFIG --cflags ice 2>/dev/null`"
11911         cf_pkgconfig_libs="`$PKG_CONFIG --libs   ice 2>/dev/null`"
11912         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
11913
11914 echo "${as_me:-configure}:11914: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11915
11916         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
11917
11918 echo "${as_me:-configure}:11918: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
11919
11920 cf_fix_cppflags=no
11921 cf_new_cflags=
11922 cf_new_cppflags=
11923 cf_new_extra_cppflags=
11924
11925 for cf_add_cflags in $cf_pkgconfig_incs
11926 do
11927 case $cf_fix_cppflags in
11928 (no)
11929         case $cf_add_cflags in
11930         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11931                 case $cf_add_cflags in
11932                 (-D*)
11933                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11934
11935                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11936                                 && test -z "${cf_tst_cflags}" \
11937                                 && cf_fix_cppflags=yes
11938
11939                         if test $cf_fix_cppflags = yes ; then
11940
11941         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11942         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11943
11944                                 continue
11945                         elif test "${cf_tst_cflags}" = "\"'" ; then
11946
11947         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11948         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11949
11950                                 continue
11951                         fi
11952                         ;;
11953                 esac
11954                 case "$CPPFLAGS" in
11955                 (*$cf_add_cflags)
11956                         ;;
11957                 (*)
11958                         case $cf_add_cflags in
11959                         (-D*)
11960                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11961
11962 CPPFLAGS=`echo "$CPPFLAGS" | \
11963         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11964                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11965
11966                                 ;;
11967                         esac
11968
11969         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
11970         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
11971
11972                         ;;
11973                 esac
11974                 ;;
11975         (*)
11976
11977         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
11978         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
11979
11980                 ;;
11981         esac
11982         ;;
11983 (yes)
11984
11985         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11986         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11987
11988         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11989
11990         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11991                 && test -z "${cf_tst_cflags}" \
11992                 && cf_fix_cppflags=no
11993         ;;
11994 esac
11995 done
11996
11997 if test -n "$cf_new_cflags" ; then
11998
11999         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12000         CFLAGS="${CFLAGS}$cf_new_cflags"
12001
12002 fi
12003
12004 if test -n "$cf_new_cppflags" ; then
12005
12006         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12007         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12008
12009 fi
12010
12011 if test -n "$cf_new_extra_cppflags" ; then
12012
12013         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12014         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12015
12016 fi
12017
12018 cf_add_libs="$cf_pkgconfig_libs"
12019 # Filter out duplicates - this happens with badly-designed ".pc" files...
12020 for cf_add_1lib in $LIBS
12021 do
12022         for cf_add_2lib in $cf_add_libs
12023         do
12024                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12025                 then
12026                         cf_add_1lib=
12027                         break
12028                 fi
12029         done
12030         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12031 done
12032 LIBS="$cf_add_libs"
12033
12034         :
12035 else
12036         cf_pkgconfig_incs=
12037         cf_pkgconfig_libs=
12038         { echo "$as_me:12038: WARNING: unable to find ICE library" >&5
12039 echo "$as_me: WARNING: unable to find ICE library" >&2;}
12040 fi
12041
12042 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists sm; then
12043         test -n "$verbose" && echo "    found package sm" 1>&6
12044
12045 echo "${as_me:-configure}:12045: testing found package sm ..." 1>&5
12046
12047         cf_pkgconfig_incs="`$PKG_CONFIG --cflags sm 2>/dev/null`"
12048         cf_pkgconfig_libs="`$PKG_CONFIG --libs   sm 2>/dev/null`"
12049         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
12050
12051 echo "${as_me:-configure}:12051: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12052
12053         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
12054
12055 echo "${as_me:-configure}:12055: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
12056
12057 cf_fix_cppflags=no
12058 cf_new_cflags=
12059 cf_new_cppflags=
12060 cf_new_extra_cppflags=
12061
12062 for cf_add_cflags in $cf_pkgconfig_incs
12063 do
12064 case $cf_fix_cppflags in
12065 (no)
12066         case $cf_add_cflags in
12067         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12068                 case $cf_add_cflags in
12069                 (-D*)
12070                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12071
12072                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12073                                 && test -z "${cf_tst_cflags}" \
12074                                 && cf_fix_cppflags=yes
12075
12076                         if test $cf_fix_cppflags = yes ; then
12077
12078         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12079         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12080
12081                                 continue
12082                         elif test "${cf_tst_cflags}" = "\"'" ; then
12083
12084         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12085         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12086
12087                                 continue
12088                         fi
12089                         ;;
12090                 esac
12091                 case "$CPPFLAGS" in
12092                 (*$cf_add_cflags)
12093                         ;;
12094                 (*)
12095                         case $cf_add_cflags in
12096                         (-D*)
12097                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12098
12099 CPPFLAGS=`echo "$CPPFLAGS" | \
12100         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12101                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12102
12103                                 ;;
12104                         esac
12105
12106         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12107         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12108
12109                         ;;
12110                 esac
12111                 ;;
12112         (*)
12113
12114         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12115         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12116
12117                 ;;
12118         esac
12119         ;;
12120 (yes)
12121
12122         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12123         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12124
12125         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12126
12127         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12128                 && test -z "${cf_tst_cflags}" \
12129                 && cf_fix_cppflags=no
12130         ;;
12131 esac
12132 done
12133
12134 if test -n "$cf_new_cflags" ; then
12135
12136         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12137         CFLAGS="${CFLAGS}$cf_new_cflags"
12138
12139 fi
12140
12141 if test -n "$cf_new_cppflags" ; then
12142
12143         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12144         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12145
12146 fi
12147
12148 if test -n "$cf_new_extra_cppflags" ; then
12149
12150         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12151         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12152
12153 fi
12154
12155 cf_add_libs="$cf_pkgconfig_libs"
12156 # Filter out duplicates - this happens with badly-designed ".pc" files...
12157 for cf_add_1lib in $LIBS
12158 do
12159         for cf_add_2lib in $cf_add_libs
12160         do
12161                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12162                 then
12163                         cf_add_1lib=
12164                         break
12165                 fi
12166         done
12167         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12168 done
12169 LIBS="$cf_add_libs"
12170
12171         :
12172 else
12173         cf_pkgconfig_incs=
12174         cf_pkgconfig_libs=
12175         { echo "$as_me:12175: WARNING: unable to find SM library" >&5
12176 echo "$as_me: WARNING: unable to find SM library" >&2;}
12177 fi
12178
12179 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xt; then
12180         test -n "$verbose" && echo "    found package xt" 1>&6
12181
12182 echo "${as_me:-configure}:12182: testing found package xt ..." 1>&5
12183
12184         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xt 2>/dev/null`"
12185         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xt 2>/dev/null`"
12186         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
12187
12188 echo "${as_me:-configure}:12188: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12189
12190         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
12191
12192 echo "${as_me:-configure}:12192: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
12193
12194 cf_fix_cppflags=no
12195 cf_new_cflags=
12196 cf_new_cppflags=
12197 cf_new_extra_cppflags=
12198
12199 for cf_add_cflags in $cf_pkgconfig_incs
12200 do
12201 case $cf_fix_cppflags in
12202 (no)
12203         case $cf_add_cflags in
12204         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12205                 case $cf_add_cflags in
12206                 (-D*)
12207                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12208
12209                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12210                                 && test -z "${cf_tst_cflags}" \
12211                                 && cf_fix_cppflags=yes
12212
12213                         if test $cf_fix_cppflags = yes ; then
12214
12215         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12216         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12217
12218                                 continue
12219                         elif test "${cf_tst_cflags}" = "\"'" ; then
12220
12221         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12222         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12223
12224                                 continue
12225                         fi
12226                         ;;
12227                 esac
12228                 case "$CPPFLAGS" in
12229                 (*$cf_add_cflags)
12230                         ;;
12231                 (*)
12232                         case $cf_add_cflags in
12233                         (-D*)
12234                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12235
12236 CPPFLAGS=`echo "$CPPFLAGS" | \
12237         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12238                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12239
12240                                 ;;
12241                         esac
12242
12243         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12244         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12245
12246                         ;;
12247                 esac
12248                 ;;
12249         (*)
12250
12251         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12252         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12253
12254                 ;;
12255         esac
12256         ;;
12257 (yes)
12258
12259         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12260         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12261
12262         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12263
12264         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12265                 && test -z "${cf_tst_cflags}" \
12266                 && cf_fix_cppflags=no
12267         ;;
12268 esac
12269 done
12270
12271 if test -n "$cf_new_cflags" ; then
12272
12273         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12274         CFLAGS="${CFLAGS}$cf_new_cflags"
12275
12276 fi
12277
12278 if test -n "$cf_new_cppflags" ; then
12279
12280         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12281         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12282
12283 fi
12284
12285 if test -n "$cf_new_extra_cppflags" ; then
12286
12287         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12288         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12289
12290 fi
12291
12292 cf_add_libs="$cf_pkgconfig_libs"
12293 # Filter out duplicates - this happens with badly-designed ".pc" files...
12294 for cf_add_1lib in $LIBS
12295 do
12296         for cf_add_2lib in $cf_add_libs
12297         do
12298                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12299                 then
12300                         cf_add_1lib=
12301                         break
12302                 fi
12303         done
12304         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12305 done
12306 LIBS="$cf_add_libs"
12307
12308         :
12309 else
12310         cf_pkgconfig_incs=
12311         cf_pkgconfig_libs=
12312         { echo "$as_me:12312: WARNING: unable to find Xt library" >&5
12313 echo "$as_me: WARNING: unable to find Xt library" >&2;}
12314 fi
12315
12316 fi
12317
12318 cf_have_X_LIBS=no
12319
12320 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xt; then
12321         test -n "$verbose" && echo "    found package xt" 1>&6
12322
12323 echo "${as_me:-configure}:12323: testing found package xt ..." 1>&5
12324
12325         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xt 2>/dev/null`"
12326         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xt 2>/dev/null`"
12327         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
12328
12329 echo "${as_me:-configure}:12329: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12330
12331         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
12332
12333 echo "${as_me:-configure}:12333: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
12334
12335 cf_fix_cppflags=no
12336 cf_new_cflags=
12337 cf_new_cppflags=
12338 cf_new_extra_cppflags=
12339
12340 for cf_add_cflags in $cf_pkgconfig_incs
12341 do
12342 case $cf_fix_cppflags in
12343 (no)
12344         case $cf_add_cflags in
12345         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12346                 case $cf_add_cflags in
12347                 (-D*)
12348                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12349
12350                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12351                                 && test -z "${cf_tst_cflags}" \
12352                                 && cf_fix_cppflags=yes
12353
12354                         if test $cf_fix_cppflags = yes ; then
12355
12356         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12357         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12358
12359                                 continue
12360                         elif test "${cf_tst_cflags}" = "\"'" ; then
12361
12362         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12363         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12364
12365                                 continue
12366                         fi
12367                         ;;
12368                 esac
12369                 case "$CPPFLAGS" in
12370                 (*$cf_add_cflags)
12371                         ;;
12372                 (*)
12373                         case $cf_add_cflags in
12374                         (-D*)
12375                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12376
12377 CPPFLAGS=`echo "$CPPFLAGS" | \
12378         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12379                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12380
12381                                 ;;
12382                         esac
12383
12384         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12385         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12386
12387                         ;;
12388                 esac
12389                 ;;
12390         (*)
12391
12392         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12393         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12394
12395                 ;;
12396         esac
12397         ;;
12398 (yes)
12399
12400         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12401         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12402
12403         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12404
12405         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12406                 && test -z "${cf_tst_cflags}" \
12407                 && cf_fix_cppflags=no
12408         ;;
12409 esac
12410 done
12411
12412 if test -n "$cf_new_cflags" ; then
12413
12414         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12415         CFLAGS="${CFLAGS}$cf_new_cflags"
12416
12417 fi
12418
12419 if test -n "$cf_new_cppflags" ; then
12420
12421         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12422         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12423
12424 fi
12425
12426 if test -n "$cf_new_extra_cppflags" ; then
12427
12428         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12429         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12430
12431 fi
12432
12433 cf_add_libs="$cf_pkgconfig_libs"
12434 # Filter out duplicates - this happens with badly-designed ".pc" files...
12435 for cf_add_1lib in $LIBS
12436 do
12437         for cf_add_2lib in $cf_add_libs
12438         do
12439                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12440                 then
12441                         cf_add_1lib=
12442                         break
12443                 fi
12444         done
12445         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12446 done
12447 LIBS="$cf_add_libs"
12448
12449         case "x$LIBS" in
12450         (*-lX11*)
12451                 ;;
12452         (*)
12453 # we have an "xt" package, but it may omit Xt's dependency on X11
12454 echo "$as_me:12454: checking for usable X dependency" >&5
12455 echo $ECHO_N "checking for usable X dependency... $ECHO_C" >&6
12456 if test "${cf_cv_xt_x11_compat+set}" = set; then
12457   echo $ECHO_N "(cached) $ECHO_C" >&6
12458 else
12459
12460 cat >conftest.$ac_ext <<_ACEOF
12461 #line 12461 "configure"
12462 #include "confdefs.h"
12463
12464 #include <X11/Xlib.h>
12465
12466 int
12467 main (void)
12468 {
12469
12470         int rc1 = XDrawLine((Display*) 0, (Drawable) 0, (GC) 0, 0, 0, 0, 0);
12471         int rc2 = XClearWindow((Display*) 0, (Window) 0);
12472         int rc3 = XMoveWindow((Display*) 0, (Window) 0, 0, 0);
12473         int rc4 = XMoveResizeWindow((Display*)0, (Window)0, 0, 0, 0, 0);
12474
12475   ;
12476   return 0;
12477 }
12478 _ACEOF
12479 rm -f conftest.$ac_objext conftest$ac_exeext
12480 if { (eval echo "$as_me:12480: \"$ac_link\"") >&5
12481   (eval $ac_link) 2>&5
12482   ac_status=$?
12483   echo "$as_me:12483: \$? = $ac_status" >&5
12484   (exit $ac_status); } &&
12485          { ac_try='test -s conftest$ac_exeext'
12486   { (eval echo "$as_me:12486: \"$ac_try\"") >&5
12487   (eval $ac_try) 2>&5
12488   ac_status=$?
12489   echo "$as_me:12489: \$? = $ac_status" >&5
12490   (exit $ac_status); }; }; then
12491   cf_cv_xt_x11_compat=yes
12492 else
12493   echo "$as_me: failed program was:" >&5
12494 cat conftest.$ac_ext >&5
12495 cf_cv_xt_x11_compat=no
12496 fi
12497 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12498 fi
12499 echo "$as_me:12499: result: $cf_cv_xt_x11_compat" >&5
12500 echo "${ECHO_T}$cf_cv_xt_x11_compat" >&6
12501                 if test "$cf_cv_xt_x11_compat" = no
12502                 then
12503                         test -n "$verbose" && echo "    work around broken X11 dependency" 1>&6
12504
12505 echo "${as_me:-configure}:12505: testing work around broken X11 dependency ..." 1>&5
12506
12507                         # 2010/11/19 - good enough until a working Xt on Xcb is delivered.
12508
12509 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists x11; then
12510         test -n "$verbose" && echo "    found package x11" 1>&6
12511
12512 echo "${as_me:-configure}:12512: testing found package x11 ..." 1>&5
12513
12514         cf_pkgconfig_incs="`$PKG_CONFIG --cflags x11 2>/dev/null`"
12515         cf_pkgconfig_libs="`$PKG_CONFIG --libs   x11 2>/dev/null`"
12516         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
12517
12518 echo "${as_me:-configure}:12518: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12519
12520         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
12521
12522 echo "${as_me:-configure}:12522: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
12523
12524 cf_fix_cppflags=no
12525 cf_new_cflags=
12526 cf_new_cppflags=
12527 cf_new_extra_cppflags=
12528
12529 for cf_add_cflags in $cf_pkgconfig_incs
12530 do
12531 case $cf_fix_cppflags in
12532 (no)
12533         case $cf_add_cflags in
12534         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12535                 case $cf_add_cflags in
12536                 (-D*)
12537                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12538
12539                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12540                                 && test -z "${cf_tst_cflags}" \
12541                                 && cf_fix_cppflags=yes
12542
12543                         if test $cf_fix_cppflags = yes ; then
12544
12545         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12546         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12547
12548                                 continue
12549                         elif test "${cf_tst_cflags}" = "\"'" ; then
12550
12551         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12552         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12553
12554                                 continue
12555                         fi
12556                         ;;
12557                 esac
12558                 case "$CPPFLAGS" in
12559                 (*$cf_add_cflags)
12560                         ;;
12561                 (*)
12562                         case $cf_add_cflags in
12563                         (-D*)
12564                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12565
12566 CPPFLAGS=`echo "$CPPFLAGS" | \
12567         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12568                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12569
12570                                 ;;
12571                         esac
12572
12573         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12574         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12575
12576                         ;;
12577                 esac
12578                 ;;
12579         (*)
12580
12581         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12582         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12583
12584                 ;;
12585         esac
12586         ;;
12587 (yes)
12588
12589         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12590         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12591
12592         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12593
12594         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12595                 && test -z "${cf_tst_cflags}" \
12596                 && cf_fix_cppflags=no
12597         ;;
12598 esac
12599 done
12600
12601 if test -n "$cf_new_cflags" ; then
12602
12603         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12604         CFLAGS="${CFLAGS}$cf_new_cflags"
12605
12606 fi
12607
12608 if test -n "$cf_new_cppflags" ; then
12609
12610         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12611         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12612
12613 fi
12614
12615 if test -n "$cf_new_extra_cppflags" ; then
12616
12617         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12618         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12619
12620 fi
12621
12622 cf_add_libs="$cf_pkgconfig_libs"
12623 # Filter out duplicates - this happens with badly-designed ".pc" files...
12624 for cf_add_1lib in $LIBS
12625 do
12626         for cf_add_2lib in $cf_add_libs
12627         do
12628                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12629                 then
12630                         cf_add_1lib=
12631                         break
12632                 fi
12633         done
12634         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12635 done
12636 LIBS="$cf_add_libs"
12637
12638         :
12639 else
12640         cf_pkgconfig_incs=
12641         cf_pkgconfig_libs=
12642
12643 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
12644
12645 echo "${as_me:-configure}:12645: testing ...before $LIBS ..." 1>&5
12646
12647 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%-lXt %-lXt -lX11 %" -e 's%  % %g'`
12648 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
12649
12650 echo "${as_me:-configure}:12650: testing ...after  $LIBS ..." 1>&5
12651
12652 fi
12653
12654                 fi
12655                 ;;
12656         esac
12657
12658 echo "$as_me:12658: checking for usable X Toolkit package" >&5
12659 echo $ECHO_N "checking for usable X Toolkit package... $ECHO_C" >&6
12660 if test "${cf_cv_xt_ice_compat+set}" = set; then
12661   echo $ECHO_N "(cached) $ECHO_C" >&6
12662 else
12663
12664 cat >conftest.$ac_ext <<_ACEOF
12665 #line 12665 "configure"
12666 #include "confdefs.h"
12667
12668 #include <X11/Shell.h>
12669
12670 int
12671 main (void)
12672 {
12673 int num = IceConnectionNumber(0)
12674
12675   ;
12676   return 0;
12677 }
12678 _ACEOF
12679 rm -f conftest.$ac_objext conftest$ac_exeext
12680 if { (eval echo "$as_me:12680: \"$ac_link\"") >&5
12681   (eval $ac_link) 2>&5
12682   ac_status=$?
12683   echo "$as_me:12683: \$? = $ac_status" >&5
12684   (exit $ac_status); } &&
12685          { ac_try='test -s conftest$ac_exeext'
12686   { (eval echo "$as_me:12686: \"$ac_try\"") >&5
12687   (eval $ac_try) 2>&5
12688   ac_status=$?
12689   echo "$as_me:12689: \$? = $ac_status" >&5
12690   (exit $ac_status); }; }; then
12691   cf_cv_xt_ice_compat=yes
12692 else
12693   echo "$as_me: failed program was:" >&5
12694 cat conftest.$ac_ext >&5
12695 cf_cv_xt_ice_compat=no
12696 fi
12697 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12698 fi
12699 echo "$as_me:12699: result: $cf_cv_xt_ice_compat" >&5
12700 echo "${ECHO_T}$cf_cv_xt_ice_compat" >&6
12701
12702         if test "$cf_cv_xt_ice_compat" = no
12703         then
12704                 # workaround for broken ".pc" files used for X Toolkit.
12705                 case "x$X_PRE_LIBS" in
12706                 (*-lICE*)
12707                         case "x$LIBS" in
12708                         (*-lICE*)
12709                                 ;;
12710                         (*)
12711                                 test -n "$verbose" && echo "    work around broken ICE dependency" 1>&6
12712
12713 echo "${as_me:-configure}:12713: testing work around broken ICE dependency ..." 1>&5
12714
12715 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists ice; then
12716         test -n "$verbose" && echo "    found package ice" 1>&6
12717
12718 echo "${as_me:-configure}:12718: testing found package ice ..." 1>&5
12719
12720         cf_pkgconfig_incs="`$PKG_CONFIG --cflags ice 2>/dev/null`"
12721         cf_pkgconfig_libs="`$PKG_CONFIG --libs   ice 2>/dev/null`"
12722         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
12723
12724 echo "${as_me:-configure}:12724: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12725
12726         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
12727
12728 echo "${as_me:-configure}:12728: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
12729
12730 cf_fix_cppflags=no
12731 cf_new_cflags=
12732 cf_new_cppflags=
12733 cf_new_extra_cppflags=
12734
12735 for cf_add_cflags in $cf_pkgconfig_incs
12736 do
12737 case $cf_fix_cppflags in
12738 (no)
12739         case $cf_add_cflags in
12740         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12741                 case $cf_add_cflags in
12742                 (-D*)
12743                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12744
12745                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12746                                 && test -z "${cf_tst_cflags}" \
12747                                 && cf_fix_cppflags=yes
12748
12749                         if test $cf_fix_cppflags = yes ; then
12750
12751         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12752         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12753
12754                                 continue
12755                         elif test "${cf_tst_cflags}" = "\"'" ; then
12756
12757         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12758         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12759
12760                                 continue
12761                         fi
12762                         ;;
12763                 esac
12764                 case "$CPPFLAGS" in
12765                 (*$cf_add_cflags)
12766                         ;;
12767                 (*)
12768                         case $cf_add_cflags in
12769                         (-D*)
12770                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12771
12772 CPPFLAGS=`echo "$CPPFLAGS" | \
12773         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12774                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12775
12776                                 ;;
12777                         esac
12778
12779         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12780         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12781
12782                         ;;
12783                 esac
12784                 ;;
12785         (*)
12786
12787         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12788         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12789
12790                 ;;
12791         esac
12792         ;;
12793 (yes)
12794
12795         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12796         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12797
12798         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12799
12800         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12801                 && test -z "${cf_tst_cflags}" \
12802                 && cf_fix_cppflags=no
12803         ;;
12804 esac
12805 done
12806
12807 if test -n "$cf_new_cflags" ; then
12808
12809         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12810         CFLAGS="${CFLAGS}$cf_new_cflags"
12811
12812 fi
12813
12814 if test -n "$cf_new_cppflags" ; then
12815
12816         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12817         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12818
12819 fi
12820
12821 if test -n "$cf_new_extra_cppflags" ; then
12822
12823         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12824         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12825
12826 fi
12827
12828 cf_add_libs="$cf_pkgconfig_libs"
12829 # Filter out duplicates - this happens with badly-designed ".pc" files...
12830 for cf_add_1lib in $LIBS
12831 do
12832         for cf_add_2lib in $cf_add_libs
12833         do
12834                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12835                 then
12836                         cf_add_1lib=
12837                         break
12838                 fi
12839         done
12840         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12841 done
12842 LIBS="$cf_add_libs"
12843
12844 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists sm; then
12845         test -n "$verbose" && echo "    found package sm" 1>&6
12846
12847 echo "${as_me:-configure}:12847: testing found package sm ..." 1>&5
12848
12849         cf_pkgconfig_incs="`$PKG_CONFIG --cflags sm 2>/dev/null`"
12850         cf_pkgconfig_libs="`$PKG_CONFIG --libs   sm 2>/dev/null`"
12851         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
12852
12853 echo "${as_me:-configure}:12853: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12854
12855         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
12856
12857 echo "${as_me:-configure}:12857: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
12858
12859 cf_fix_cppflags=no
12860 cf_new_cflags=
12861 cf_new_cppflags=
12862 cf_new_extra_cppflags=
12863
12864 for cf_add_cflags in $cf_pkgconfig_incs
12865 do
12866 case $cf_fix_cppflags in
12867 (no)
12868         case $cf_add_cflags in
12869         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12870                 case $cf_add_cflags in
12871                 (-D*)
12872                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12873
12874                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12875                                 && test -z "${cf_tst_cflags}" \
12876                                 && cf_fix_cppflags=yes
12877
12878                         if test $cf_fix_cppflags = yes ; then
12879
12880         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12881         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12882
12883                                 continue
12884                         elif test "${cf_tst_cflags}" = "\"'" ; then
12885
12886         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12887         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12888
12889                                 continue
12890                         fi
12891                         ;;
12892                 esac
12893                 case "$CPPFLAGS" in
12894                 (*$cf_add_cflags)
12895                         ;;
12896                 (*)
12897                         case $cf_add_cflags in
12898                         (-D*)
12899                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12900
12901 CPPFLAGS=`echo "$CPPFLAGS" | \
12902         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12903                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12904
12905                                 ;;
12906                         esac
12907
12908         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12909         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12910
12911                         ;;
12912                 esac
12913                 ;;
12914         (*)
12915
12916         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12917         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12918
12919                 ;;
12920         esac
12921         ;;
12922 (yes)
12923
12924         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12925         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12926
12927         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12928
12929         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12930                 && test -z "${cf_tst_cflags}" \
12931                 && cf_fix_cppflags=no
12932         ;;
12933 esac
12934 done
12935
12936 if test -n "$cf_new_cflags" ; then
12937
12938         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12939         CFLAGS="${CFLAGS}$cf_new_cflags"
12940
12941 fi
12942
12943 if test -n "$cf_new_cppflags" ; then
12944
12945         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12946         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12947
12948 fi
12949
12950 if test -n "$cf_new_extra_cppflags" ; then
12951
12952         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12953         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12954
12955 fi
12956
12957 cf_add_libs="$cf_pkgconfig_libs"
12958 # Filter out duplicates - this happens with badly-designed ".pc" files...
12959 for cf_add_1lib in $LIBS
12960 do
12961         for cf_add_2lib in $cf_add_libs
12962         do
12963                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12964                 then
12965                         cf_add_1lib=
12966                         break
12967                 fi
12968         done
12969         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12970 done
12971 LIBS="$cf_add_libs"
12972
12973         :
12974 else
12975         cf_pkgconfig_incs=
12976         cf_pkgconfig_libs=
12977         :
12978 fi
12979
12980 else
12981         cf_pkgconfig_incs=
12982         cf_pkgconfig_libs=
12983
12984 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
12985
12986 echo "${as_me:-configure}:12986: testing ...before $LIBS ..." 1>&5
12987
12988 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%-lXt %-lXt $X_PRE_LIBS %" -e 's%  % %g'`
12989 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
12990
12991 echo "${as_me:-configure}:12991: testing ...after  $LIBS ..." 1>&5
12992
12993 fi
12994
12995                                 ;;
12996                         esac
12997                         ;;
12998                 esac
12999         fi
13000
13001         cf_have_X_LIBS=yes
13002
13003 else
13004         cf_pkgconfig_incs=
13005         cf_pkgconfig_libs=
13006
13007         LDFLAGS="$X_LIBS $LDFLAGS"
13008
13009 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
13010
13011 echo "${as_me:-configure}:13011: testing checking additions to CFLAGS ..." 1>&5
13012
13013 cf_check_cflags="$CFLAGS"
13014 cf_check_cppflags="$CPPFLAGS"
13015
13016 cf_fix_cppflags=no
13017 cf_new_cflags=
13018 cf_new_cppflags=
13019 cf_new_extra_cppflags=
13020
13021 for cf_add_cflags in $X_CFLAGS
13022 do
13023 case $cf_fix_cppflags in
13024 (no)
13025         case $cf_add_cflags in
13026         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13027                 case $cf_add_cflags in
13028                 (-D*)
13029                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13030
13031                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13032                                 && test -z "${cf_tst_cflags}" \
13033                                 && cf_fix_cppflags=yes
13034
13035                         if test $cf_fix_cppflags = yes ; then
13036
13037         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13038         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13039
13040                                 continue
13041                         elif test "${cf_tst_cflags}" = "\"'" ; then
13042
13043         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13044         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13045
13046                                 continue
13047                         fi
13048                         ;;
13049                 esac
13050                 case "$CPPFLAGS" in
13051                 (*$cf_add_cflags)
13052                         ;;
13053                 (*)
13054                         case $cf_add_cflags in
13055                         (-D*)
13056                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13057
13058 CPPFLAGS=`echo "$CPPFLAGS" | \
13059         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13060                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13061
13062                                 ;;
13063                         esac
13064
13065         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13066         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13067
13068                         ;;
13069                 esac
13070                 ;;
13071         (*)
13072
13073         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13074         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13075
13076                 ;;
13077         esac
13078         ;;
13079 (yes)
13080
13081         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13082         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13083
13084         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13085
13086         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13087                 && test -z "${cf_tst_cflags}" \
13088                 && cf_fix_cppflags=no
13089         ;;
13090 esac
13091 done
13092
13093 if test -n "$cf_new_cflags" ; then
13094         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
13095
13096 echo "${as_me:-configure}:13096: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
13097
13098         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13099         CFLAGS="${CFLAGS}$cf_new_cflags"
13100
13101 fi
13102
13103 if test -n "$cf_new_cppflags" ; then
13104         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
13105
13106 echo "${as_me:-configure}:13106: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
13107
13108         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13109         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13110
13111 fi
13112
13113 if test -n "$cf_new_extra_cppflags" ; then
13114         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
13115
13116 echo "${as_me:-configure}:13116: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
13117
13118         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13119         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13120
13121 fi
13122
13123 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
13124 cat >conftest.$ac_ext <<_ACEOF
13125 #line 13125 "configure"
13126 #include "confdefs.h"
13127 #include <stdio.h>
13128 int
13129 main (void)
13130 {
13131 printf("Hello world");
13132   ;
13133   return 0;
13134 }
13135 _ACEOF
13136 rm -f conftest.$ac_objext conftest$ac_exeext
13137 if { (eval echo "$as_me:13137: \"$ac_link\"") >&5
13138   (eval $ac_link) 2>&5
13139   ac_status=$?
13140   echo "$as_me:13140: \$? = $ac_status" >&5
13141   (exit $ac_status); } &&
13142          { ac_try='test -s conftest$ac_exeext'
13143   { (eval echo "$as_me:13143: \"$ac_try\"") >&5
13144   (eval $ac_try) 2>&5
13145   ac_status=$?
13146   echo "$as_me:13146: \$? = $ac_status" >&5
13147   (exit $ac_status); }; }; then
13148   :
13149 else
13150   echo "$as_me: failed program was:" >&5
13151 cat conftest.$ac_ext >&5
13152 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
13153
13154 echo "${as_me:-configure}:13154: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
13155
13156          if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
13157                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
13158
13159 echo "${as_me:-configure}:13159: testing but keeping change to \$CPPFLAGS ..." 1>&5
13160
13161          fi
13162          CFLAGS="$cf_check_flags"
13163 fi
13164 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13165 fi
13166
13167         echo "$as_me:13167: checking for XOpenDisplay" >&5
13168 echo $ECHO_N "checking for XOpenDisplay... $ECHO_C" >&6
13169 if test "${ac_cv_func_XOpenDisplay+set}" = set; then
13170   echo $ECHO_N "(cached) $ECHO_C" >&6
13171 else
13172   cat >conftest.$ac_ext <<_ACEOF
13173 #line 13173 "configure"
13174 #include "confdefs.h"
13175 /* System header to define __stub macros and hopefully few prototypes,
13176     which can conflict with char XOpenDisplay (); below.  */
13177 #include <assert.h>
13178 /* Override any gcc2 internal prototype to avoid an error.  */
13179 #ifdef __cplusplus
13180 extern "C"
13181 #endif
13182 /* We use char because int might match the return type of a gcc2
13183    builtin and then its argument prototype would still apply.  */
13184 char XOpenDisplay ();
13185 char (*f) ();
13186
13187 int
13188 main (void)
13189 {
13190 /* The GNU C library defines this for functions which it implements
13191     to always fail with ENOSYS.  Some functions are actually named
13192     something starting with __ and the normal name is an alias.  */
13193 #if defined (__stub_XOpenDisplay) || defined (__stub___XOpenDisplay)
13194 choke me
13195 #else
13196 f = XOpenDisplay; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
13197 #endif
13198
13199   ;
13200   return 0;
13201 }
13202 _ACEOF
13203 rm -f conftest.$ac_objext conftest$ac_exeext
13204 if { (eval echo "$as_me:13204: \"$ac_link\"") >&5
13205   (eval $ac_link) 2>&5
13206   ac_status=$?
13207   echo "$as_me:13207: \$? = $ac_status" >&5
13208   (exit $ac_status); } &&
13209          { ac_try='test -s conftest$ac_exeext'
13210   { (eval echo "$as_me:13210: \"$ac_try\"") >&5
13211   (eval $ac_try) 2>&5
13212   ac_status=$?
13213   echo "$as_me:13213: \$? = $ac_status" >&5
13214   (exit $ac_status); }; }; then
13215   ac_cv_func_XOpenDisplay=yes
13216 else
13217   echo "$as_me: failed program was:" >&5
13218 cat conftest.$ac_ext >&5
13219 ac_cv_func_XOpenDisplay=no
13220 fi
13221 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13222 fi
13223 echo "$as_me:13223: result: $ac_cv_func_XOpenDisplay" >&5
13224 echo "${ECHO_T}$ac_cv_func_XOpenDisplay" >&6
13225 if test $ac_cv_func_XOpenDisplay = yes; then
13226   :
13227 else
13228
13229         echo "$as_me:13229: checking for XOpenDisplay in -lX11" >&5
13230 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
13231 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
13232   echo $ECHO_N "(cached) $ECHO_C" >&6
13233 else
13234   ac_check_lib_save_LIBS=$LIBS
13235 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
13236 cat >conftest.$ac_ext <<_ACEOF
13237 #line 13237 "configure"
13238 #include "confdefs.h"
13239
13240 /* Override any gcc2 internal prototype to avoid an error.  */
13241 #ifdef __cplusplus
13242 extern "C"
13243 #endif
13244 /* We use char because int might match the return type of a gcc2
13245    builtin and then its argument prototype would still apply.  */
13246 char XOpenDisplay ();
13247 int
13248 main (void)
13249 {
13250 XOpenDisplay ();
13251   ;
13252   return 0;
13253 }
13254 _ACEOF
13255 rm -f conftest.$ac_objext conftest$ac_exeext
13256 if { (eval echo "$as_me:13256: \"$ac_link\"") >&5
13257   (eval $ac_link) 2>&5
13258   ac_status=$?
13259   echo "$as_me:13259: \$? = $ac_status" >&5
13260   (exit $ac_status); } &&
13261          { ac_try='test -s conftest$ac_exeext'
13262   { (eval echo "$as_me:13262: \"$ac_try\"") >&5
13263   (eval $ac_try) 2>&5
13264   ac_status=$?
13265   echo "$as_me:13265: \$? = $ac_status" >&5
13266   (exit $ac_status); }; }; then
13267   ac_cv_lib_X11_XOpenDisplay=yes
13268 else
13269   echo "$as_me: failed program was:" >&5
13270 cat conftest.$ac_ext >&5
13271 ac_cv_lib_X11_XOpenDisplay=no
13272 fi
13273 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13274 LIBS=$ac_check_lib_save_LIBS
13275 fi
13276 echo "$as_me:13276: result: $ac_cv_lib_X11_XOpenDisplay" >&5
13277 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
13278 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
13279
13280 cf_add_libs="-lX11"
13281 # Filter out duplicates - this happens with badly-designed ".pc" files...
13282 for cf_add_1lib in $LIBS
13283 do
13284         for cf_add_2lib in $cf_add_libs
13285         do
13286                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13287                 then
13288                         cf_add_1lib=
13289                         break
13290                 fi
13291         done
13292         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13293 done
13294 LIBS="$cf_add_libs"
13295
13296 fi
13297
13298 fi
13299
13300         echo "$as_me:13300: checking for XtAppInitialize" >&5
13301 echo $ECHO_N "checking for XtAppInitialize... $ECHO_C" >&6
13302 if test "${ac_cv_func_XtAppInitialize+set}" = set; then
13303   echo $ECHO_N "(cached) $ECHO_C" >&6
13304 else
13305   cat >conftest.$ac_ext <<_ACEOF
13306 #line 13306 "configure"
13307 #include "confdefs.h"
13308 /* System header to define __stub macros and hopefully few prototypes,
13309     which can conflict with char XtAppInitialize (); below.  */
13310 #include <assert.h>
13311 /* Override any gcc2 internal prototype to avoid an error.  */
13312 #ifdef __cplusplus
13313 extern "C"
13314 #endif
13315 /* We use char because int might match the return type of a gcc2
13316    builtin and then its argument prototype would still apply.  */
13317 char XtAppInitialize ();
13318 char (*f) ();
13319
13320 int
13321 main (void)
13322 {
13323 /* The GNU C library defines this for functions which it implements
13324     to always fail with ENOSYS.  Some functions are actually named
13325     something starting with __ and the normal name is an alias.  */
13326 #if defined (__stub_XtAppInitialize) || defined (__stub___XtAppInitialize)
13327 choke me
13328 #else
13329 f = XtAppInitialize; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
13330 #endif
13331
13332   ;
13333   return 0;
13334 }
13335 _ACEOF
13336 rm -f conftest.$ac_objext conftest$ac_exeext
13337 if { (eval echo "$as_me:13337: \"$ac_link\"") >&5
13338   (eval $ac_link) 2>&5
13339   ac_status=$?
13340   echo "$as_me:13340: \$? = $ac_status" >&5
13341   (exit $ac_status); } &&
13342          { ac_try='test -s conftest$ac_exeext'
13343   { (eval echo "$as_me:13343: \"$ac_try\"") >&5
13344   (eval $ac_try) 2>&5
13345   ac_status=$?
13346   echo "$as_me:13346: \$? = $ac_status" >&5
13347   (exit $ac_status); }; }; then
13348   ac_cv_func_XtAppInitialize=yes
13349 else
13350   echo "$as_me: failed program was:" >&5
13351 cat conftest.$ac_ext >&5
13352 ac_cv_func_XtAppInitialize=no
13353 fi
13354 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13355 fi
13356 echo "$as_me:13356: result: $ac_cv_func_XtAppInitialize" >&5
13357 echo "${ECHO_T}$ac_cv_func_XtAppInitialize" >&6
13358 if test $ac_cv_func_XtAppInitialize = yes; then
13359   :
13360 else
13361
13362         echo "$as_me:13362: checking for XtAppInitialize in -lXt" >&5
13363 echo $ECHO_N "checking for XtAppInitialize in -lXt... $ECHO_C" >&6
13364 if test "${ac_cv_lib_Xt_XtAppInitialize+set}" = set; then
13365   echo $ECHO_N "(cached) $ECHO_C" >&6
13366 else
13367   ac_check_lib_save_LIBS=$LIBS
13368 LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
13369 cat >conftest.$ac_ext <<_ACEOF
13370 #line 13370 "configure"
13371 #include "confdefs.h"
13372
13373 /* Override any gcc2 internal prototype to avoid an error.  */
13374 #ifdef __cplusplus
13375 extern "C"
13376 #endif
13377 /* We use char because int might match the return type of a gcc2
13378    builtin and then its argument prototype would still apply.  */
13379 char XtAppInitialize ();
13380 int
13381 main (void)
13382 {
13383 XtAppInitialize ();
13384   ;
13385   return 0;
13386 }
13387 _ACEOF
13388 rm -f conftest.$ac_objext conftest$ac_exeext
13389 if { (eval echo "$as_me:13389: \"$ac_link\"") >&5
13390   (eval $ac_link) 2>&5
13391   ac_status=$?
13392   echo "$as_me:13392: \$? = $ac_status" >&5
13393   (exit $ac_status); } &&
13394          { ac_try='test -s conftest$ac_exeext'
13395   { (eval echo "$as_me:13395: \"$ac_try\"") >&5
13396   (eval $ac_try) 2>&5
13397   ac_status=$?
13398   echo "$as_me:13398: \$? = $ac_status" >&5
13399   (exit $ac_status); }; }; then
13400   ac_cv_lib_Xt_XtAppInitialize=yes
13401 else
13402   echo "$as_me: failed program was:" >&5
13403 cat conftest.$ac_ext >&5
13404 ac_cv_lib_Xt_XtAppInitialize=no
13405 fi
13406 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13407 LIBS=$ac_check_lib_save_LIBS
13408 fi
13409 echo "$as_me:13409: result: $ac_cv_lib_Xt_XtAppInitialize" >&5
13410 echo "${ECHO_T}$ac_cv_lib_Xt_XtAppInitialize" >&6
13411 if test $ac_cv_lib_Xt_XtAppInitialize = yes; then
13412
13413 cat >>confdefs.h <<\EOF
13414 #define HAVE_LIBXT 1
13415 EOF
13416
13417                  cf_have_X_LIBS=Xt
13418                  LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS"
13419 fi
13420
13421 fi
13422
13423 fi
13424
13425 if test $cf_have_X_LIBS = no ; then
13426         { echo "$as_me:13426: WARNING: Unable to successfully link X Toolkit library (-lXt) with
13427 test program.  You will have to check and add the proper libraries by hand
13428 to makefile." >&5
13429 echo "$as_me: WARNING: Unable to successfully link X Toolkit library (-lXt) with
13430 test program.  You will have to check and add the proper libraries by hand
13431 to makefile." >&2;}
13432 fi
13433
13434 cf_x_athena_root=$cf_x_athena
13435 cf_x_athena_inc=""
13436
13437 for cf_path in default \
13438         /usr/contrib/X11R6 \
13439         /usr/contrib/X11R5 \
13440         /usr/lib/X11R5 \
13441         /usr/local
13442 do
13443         if test -z "$cf_x_athena_inc" ; then
13444                 cf_save="$CPPFLAGS"
13445                 cf_test=X11/$cf_x_athena_root/SimpleMenu.h
13446                 if test $cf_path != default ; then
13447                         CPPFLAGS="$cf_save -I$cf_path/include"
13448                         echo "$as_me:13448: checking for $cf_test in $cf_path" >&5
13449 echo $ECHO_N "checking for $cf_test in $cf_path... $ECHO_C" >&6
13450                 else
13451                         echo "$as_me:13451: checking for $cf_test" >&5
13452 echo $ECHO_N "checking for $cf_test... $ECHO_C" >&6
13453                 fi
13454                 cat >conftest.$ac_ext <<_ACEOF
13455 #line 13455 "configure"
13456 #include "confdefs.h"
13457
13458 #include <X11/Intrinsic.h>
13459 #include <$cf_test>
13460 int
13461 main (void)
13462 {
13463
13464   ;
13465   return 0;
13466 }
13467 _ACEOF
13468 rm -f conftest.$ac_objext
13469 if { (eval echo "$as_me:13469: \"$ac_compile\"") >&5
13470   (eval $ac_compile) 2>&5
13471   ac_status=$?
13472   echo "$as_me:13472: \$? = $ac_status" >&5
13473   (exit $ac_status); } &&
13474          { ac_try='test -s conftest.$ac_objext'
13475   { (eval echo "$as_me:13475: \"$ac_try\"") >&5
13476   (eval $ac_try) 2>&5
13477   ac_status=$?
13478   echo "$as_me:13478: \$? = $ac_status" >&5
13479   (exit $ac_status); }; }; then
13480   cf_result=yes
13481 else
13482   echo "$as_me: failed program was:" >&5
13483 cat conftest.$ac_ext >&5
13484 cf_result=no
13485 fi
13486 rm -f conftest.$ac_objext conftest.$ac_ext
13487                 echo "$as_me:13487: result: $cf_result" >&5
13488 echo "${ECHO_T}$cf_result" >&6
13489                 if test "$cf_result" = yes ; then
13490                         cf_x_athena_inc=$cf_path
13491                         break
13492                 else
13493                         CPPFLAGS="$cf_save"
13494                 fi
13495         fi
13496 done
13497
13498 if test -z "$cf_x_athena_inc" ; then
13499         { echo "$as_me:13499: WARNING: Unable to successfully find Athena header files with test program" >&5
13500 echo "$as_me: WARNING: Unable to successfully find Athena header files with test program" >&2;}
13501 elif test "$cf_x_athena_inc" != default ; then
13502         CPPFLAGS="$CPPFLAGS -I$cf_x_athena_inc"
13503 fi
13504
13505 cf_x_athena_root=$cf_x_athena
13506 cf_x_athena_lib=""
13507
13508 for cf_path in default \
13509         /usr/contrib/X11R6 \
13510         /usr/contrib/X11R5 \
13511         /usr/lib/X11R5 \
13512         /usr/local
13513 do
13514         for cf_lib in \
13515                 ${cf_x_athena_root} \
13516                 ${cf_x_athena_root}7 \
13517                 ${cf_x_athena_root}6
13518         do
13519         for cf_libs in \
13520                 "-l$cf_lib -lXmu" \
13521                 "-l$cf_lib -lXpm -lXmu" \
13522                 "-l${cf_lib}_s -lXmu_s"
13523         do
13524                 if test -z "$cf_x_athena_lib" ; then
13525                         cf_save="$LIBS"
13526                         cf_test=XawSimpleMenuAddGlobalActions
13527                         if test $cf_path != default ; then
13528
13529 cf_add_libs="-L$cf_path/lib $cf_libs"
13530 # Filter out duplicates - this happens with badly-designed ".pc" files...
13531 for cf_add_1lib in $LIBS
13532 do
13533         for cf_add_2lib in $cf_add_libs
13534         do
13535                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13536                 then
13537                         cf_add_1lib=
13538                         break
13539                 fi
13540         done
13541         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13542 done
13543 LIBS="$cf_add_libs"
13544
13545                                 echo "$as_me:13545: checking for $cf_libs in $cf_path" >&5
13546 echo $ECHO_N "checking for $cf_libs in $cf_path... $ECHO_C" >&6
13547                         else
13548
13549 cf_add_libs="$cf_libs"
13550 # Filter out duplicates - this happens with badly-designed ".pc" files...
13551 for cf_add_1lib in $LIBS
13552 do
13553         for cf_add_2lib in $cf_add_libs
13554         do
13555                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13556                 then
13557                         cf_add_1lib=
13558                         break
13559                 fi
13560         done
13561         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13562 done
13563 LIBS="$cf_add_libs"
13564
13565                                 echo "$as_me:13565: checking for $cf_test in $cf_libs" >&5
13566 echo $ECHO_N "checking for $cf_test in $cf_libs... $ECHO_C" >&6
13567                         fi
13568                         cat >conftest.$ac_ext <<_ACEOF
13569 #line 13569 "configure"
13570 #include "confdefs.h"
13571
13572 #include <X11/Intrinsic.h>
13573 #include <X11/$cf_x_athena_root/SimpleMenu.h>
13574
13575 int
13576 main (void)
13577 {
13578
13579 $cf_test((XtAppContext) 0)
13580   ;
13581   return 0;
13582 }
13583 _ACEOF
13584 rm -f conftest.$ac_objext conftest$ac_exeext
13585 if { (eval echo "$as_me:13585: \"$ac_link\"") >&5
13586   (eval $ac_link) 2>&5
13587   ac_status=$?
13588   echo "$as_me:13588: \$? = $ac_status" >&5
13589   (exit $ac_status); } &&
13590          { ac_try='test -s conftest$ac_exeext'
13591   { (eval echo "$as_me:13591: \"$ac_try\"") >&5
13592   (eval $ac_try) 2>&5
13593   ac_status=$?
13594   echo "$as_me:13594: \$? = $ac_status" >&5
13595   (exit $ac_status); }; }; then
13596   cf_result=yes
13597 else
13598   echo "$as_me: failed program was:" >&5
13599 cat conftest.$ac_ext >&5
13600 cf_result=no
13601 fi
13602 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13603                         echo "$as_me:13603: result: $cf_result" >&5
13604 echo "${ECHO_T}$cf_result" >&6
13605                         if test "$cf_result" = yes ; then
13606                                 cf_x_athena_lib="$cf_libs"
13607                                 break
13608                         fi
13609                         LIBS="$cf_save"
13610                 fi
13611         done # cf_libs
13612                 test -n "$cf_x_athena_lib" && break
13613         done # cf_lib
13614 done
13615
13616 if test -z "$cf_x_athena_lib" ; then
13617         { { echo "$as_me:13617: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&5
13618 echo "$as_me: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&2;}
13619    { (exit 1); exit 1; }; }
13620 fi
13621
13622 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
13623
13624 cat >>confdefs.h <<EOF
13625 #define $cf_x_athena_LIBS 1
13626 EOF
13627
13628 fi
13629
13630 if test -n "$ac_tool_prefix"; then
13631   for ac_prog in xcurses-config
13632   do
13633     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
13634 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
13635 echo "$as_me:13635: checking for $ac_word" >&5
13636 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
13637 if test "${ac_cv_prog_XCURSES_CONFIG+set}" = set; then
13638   echo $ECHO_N "(cached) $ECHO_C" >&6
13639 else
13640   if test -n "$XCURSES_CONFIG"; then
13641   ac_cv_prog_XCURSES_CONFIG="$XCURSES_CONFIG" # Let the user override the test.
13642 else
13643   ac_save_IFS=$IFS; IFS=$ac_path_separator
13644 ac_dummy="$PATH"
13645 for ac_dir in $ac_dummy; do
13646   IFS=$ac_save_IFS
13647   test -z "$ac_dir" && ac_dir=.
13648   $as_executable_p "$ac_dir/$ac_word" || continue
13649 ac_cv_prog_XCURSES_CONFIG="$ac_tool_prefix$ac_prog"
13650 echo "$as_me:13650: found $ac_dir/$ac_word" >&5
13651 break
13652 done
13653
13654 fi
13655 fi
13656 XCURSES_CONFIG=$ac_cv_prog_XCURSES_CONFIG
13657 if test -n "$XCURSES_CONFIG"; then
13658   echo "$as_me:13658: result: $XCURSES_CONFIG" >&5
13659 echo "${ECHO_T}$XCURSES_CONFIG" >&6
13660 else
13661   echo "$as_me:13661: result: no" >&5
13662 echo "${ECHO_T}no" >&6
13663 fi
13664
13665     test -n "$XCURSES_CONFIG" && break
13666   done
13667 fi
13668 if test -z "$XCURSES_CONFIG"; then
13669   ac_ct_XCURSES_CONFIG=$XCURSES_CONFIG
13670   for ac_prog in xcurses-config
13671 do
13672   # Extract the first word of "$ac_prog", so it can be a program name with args.
13673 set dummy $ac_prog; ac_word=$2
13674 echo "$as_me:13674: checking for $ac_word" >&5
13675 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
13676 if test "${ac_cv_prog_ac_ct_XCURSES_CONFIG+set}" = set; then
13677   echo $ECHO_N "(cached) $ECHO_C" >&6
13678 else
13679   if test -n "$ac_ct_XCURSES_CONFIG"; then
13680   ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_ct_XCURSES_CONFIG" # Let the user override the test.
13681 else
13682   ac_save_IFS=$IFS; IFS=$ac_path_separator
13683 ac_dummy="$PATH"
13684 for ac_dir in $ac_dummy; do
13685   IFS=$ac_save_IFS
13686   test -z "$ac_dir" && ac_dir=.
13687   $as_executable_p "$ac_dir/$ac_word" || continue
13688 ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_prog"
13689 echo "$as_me:13689: found $ac_dir/$ac_word" >&5
13690 break
13691 done
13692
13693 fi
13694 fi
13695 ac_ct_XCURSES_CONFIG=$ac_cv_prog_ac_ct_XCURSES_CONFIG
13696 if test -n "$ac_ct_XCURSES_CONFIG"; then
13697   echo "$as_me:13697: result: $ac_ct_XCURSES_CONFIG" >&5
13698 echo "${ECHO_T}$ac_ct_XCURSES_CONFIG" >&6
13699 else
13700   echo "$as_me:13700: result: no" >&5
13701 echo "${ECHO_T}no" >&6
13702 fi
13703
13704   test -n "$ac_ct_XCURSES_CONFIG" && break
13705 done
13706 test -n "$ac_ct_XCURSES_CONFIG" || ac_ct_XCURSES_CONFIG="none"
13707
13708   XCURSES_CONFIG=$ac_ct_XCURSES_CONFIG
13709 fi
13710
13711 if test "$XCURSES_CONFIG" != none ; then
13712
13713 CPPFLAGS="$CPPFLAGS `$XCURSES_CONFIG --cflags`"
13714
13715 cf_add_libs="`$XCURSES_CONFIG --libs`"
13716 # Filter out duplicates - this happens with badly-designed ".pc" files...
13717 for cf_add_1lib in $LIBS
13718 do
13719         for cf_add_2lib in $cf_add_libs
13720         do
13721                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13722                 then
13723                         cf_add_1lib=
13724                         break
13725                 fi
13726         done
13727         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13728 done
13729 LIBS="$cf_add_libs"
13730
13731 cf_cv_lib_XCurses=yes
13732
13733 else
13734
13735 LDFLAGS="$LDFLAGS $X_LIBS"
13736
13737 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
13738
13739 echo "${as_me:-configure}:13739: testing checking additions to CFLAGS ..." 1>&5
13740
13741 cf_check_cflags="$CFLAGS"
13742 cf_check_cppflags="$CPPFLAGS"
13743
13744 cf_fix_cppflags=no
13745 cf_new_cflags=
13746 cf_new_cppflags=
13747 cf_new_extra_cppflags=
13748
13749 for cf_add_cflags in $X_CFLAGS
13750 do
13751 case $cf_fix_cppflags in
13752 (no)
13753         case $cf_add_cflags in
13754         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13755                 case $cf_add_cflags in
13756                 (-D*)
13757                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13758
13759                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13760                                 && test -z "${cf_tst_cflags}" \
13761                                 && cf_fix_cppflags=yes
13762
13763                         if test $cf_fix_cppflags = yes ; then
13764
13765         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13766         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13767
13768                                 continue
13769                         elif test "${cf_tst_cflags}" = "\"'" ; then
13770
13771         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13772         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13773
13774                                 continue
13775                         fi
13776                         ;;
13777                 esac
13778                 case "$CPPFLAGS" in
13779                 (*$cf_add_cflags)
13780                         ;;
13781                 (*)
13782                         case $cf_add_cflags in
13783                         (-D*)
13784                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13785
13786 CPPFLAGS=`echo "$CPPFLAGS" | \
13787         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13788                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13789
13790                                 ;;
13791                         esac
13792
13793         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13794         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13795
13796                         ;;
13797                 esac
13798                 ;;
13799         (*)
13800
13801         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13802         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13803
13804                 ;;
13805         esac
13806         ;;
13807 (yes)
13808
13809         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13810         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13811
13812         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13813
13814         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13815                 && test -z "${cf_tst_cflags}" \
13816                 && cf_fix_cppflags=no
13817         ;;
13818 esac
13819 done
13820
13821 if test -n "$cf_new_cflags" ; then
13822         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
13823
13824 echo "${as_me:-configure}:13824: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
13825
13826         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13827         CFLAGS="${CFLAGS}$cf_new_cflags"
13828
13829 fi
13830
13831 if test -n "$cf_new_cppflags" ; then
13832         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
13833
13834 echo "${as_me:-configure}:13834: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
13835
13836         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13837         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13838
13839 fi
13840
13841 if test -n "$cf_new_extra_cppflags" ; then
13842         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
13843
13844 echo "${as_me:-configure}:13844: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
13845
13846         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13847         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13848
13849 fi
13850
13851 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
13852 cat >conftest.$ac_ext <<_ACEOF
13853 #line 13853 "configure"
13854 #include "confdefs.h"
13855 #include <stdio.h>
13856 int
13857 main (void)
13858 {
13859 printf("Hello world");
13860   ;
13861   return 0;
13862 }
13863 _ACEOF
13864 rm -f conftest.$ac_objext conftest$ac_exeext
13865 if { (eval echo "$as_me:13865: \"$ac_link\"") >&5
13866   (eval $ac_link) 2>&5
13867   ac_status=$?
13868   echo "$as_me:13868: \$? = $ac_status" >&5
13869   (exit $ac_status); } &&
13870          { ac_try='test -s conftest$ac_exeext'
13871   { (eval echo "$as_me:13871: \"$ac_try\"") >&5
13872   (eval $ac_try) 2>&5
13873   ac_status=$?
13874   echo "$as_me:13874: \$? = $ac_status" >&5
13875   (exit $ac_status); }; }; then
13876   :
13877 else
13878   echo "$as_me: failed program was:" >&5
13879 cat conftest.$ac_ext >&5
13880 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
13881
13882 echo "${as_me:-configure}:13882: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
13883
13884          if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
13885                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
13886
13887 echo "${as_me:-configure}:13887: testing but keeping change to \$CPPFLAGS ..." 1>&5
13888
13889          fi
13890          CFLAGS="$cf_check_flags"
13891 fi
13892 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13893 fi
13894
13895 echo "$as_me:13895: checking for XOpenDisplay in -lX11" >&5
13896 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
13897 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
13898   echo $ECHO_N "(cached) $ECHO_C" >&6
13899 else
13900   ac_check_lib_save_LIBS=$LIBS
13901 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
13902 cat >conftest.$ac_ext <<_ACEOF
13903 #line 13903 "configure"
13904 #include "confdefs.h"
13905
13906 /* Override any gcc2 internal prototype to avoid an error.  */
13907 #ifdef __cplusplus
13908 extern "C"
13909 #endif
13910 /* We use char because int might match the return type of a gcc2
13911    builtin and then its argument prototype would still apply.  */
13912 char XOpenDisplay ();
13913 int
13914 main (void)
13915 {
13916 XOpenDisplay ();
13917   ;
13918   return 0;
13919 }
13920 _ACEOF
13921 rm -f conftest.$ac_objext conftest$ac_exeext
13922 if { (eval echo "$as_me:13922: \"$ac_link\"") >&5
13923   (eval $ac_link) 2>&5
13924   ac_status=$?
13925   echo "$as_me:13925: \$? = $ac_status" >&5
13926   (exit $ac_status); } &&
13927          { ac_try='test -s conftest$ac_exeext'
13928   { (eval echo "$as_me:13928: \"$ac_try\"") >&5
13929   (eval $ac_try) 2>&5
13930   ac_status=$?
13931   echo "$as_me:13931: \$? = $ac_status" >&5
13932   (exit $ac_status); }; }; then
13933   ac_cv_lib_X11_XOpenDisplay=yes
13934 else
13935   echo "$as_me: failed program was:" >&5
13936 cat conftest.$ac_ext >&5
13937 ac_cv_lib_X11_XOpenDisplay=no
13938 fi
13939 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13940 LIBS=$ac_check_lib_save_LIBS
13941 fi
13942 echo "$as_me:13942: result: $ac_cv_lib_X11_XOpenDisplay" >&5
13943 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
13944 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
13945
13946 cf_add_libs="-lX11"
13947 # Filter out duplicates - this happens with badly-designed ".pc" files...
13948 for cf_add_1lib in $LIBS
13949 do
13950         for cf_add_2lib in $cf_add_libs
13951         do
13952                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13953                 then
13954                         cf_add_1lib=
13955                         break
13956                 fi
13957         done
13958         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13959 done
13960 LIBS="$cf_add_libs"
13961
13962 fi
13963
13964 echo "$as_me:13964: checking for XCurses library" >&5
13965 echo $ECHO_N "checking for XCurses library... $ECHO_C" >&6
13966 if test "${cf_cv_lib_XCurses+set}" = set; then
13967   echo $ECHO_N "(cached) $ECHO_C" >&6
13968 else
13969
13970 cf_add_libs="-lXCurses"
13971 # Filter out duplicates - this happens with badly-designed ".pc" files...
13972 for cf_add_1lib in $LIBS
13973 do
13974         for cf_add_2lib in $cf_add_libs
13975         do
13976                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13977                 then
13978                         cf_add_1lib=
13979                         break
13980                 fi
13981         done
13982         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13983 done
13984 LIBS="$cf_add_libs"
13985
13986 cat >conftest.$ac_ext <<_ACEOF
13987 #line 13987 "configure"
13988 #include "confdefs.h"
13989
13990 #include <xcurses.h>
13991 char *XCursesProgramName = "test";
13992
13993 int
13994 main (void)
13995 {
13996 XCursesExit();
13997   ;
13998   return 0;
13999 }
14000 _ACEOF
14001 rm -f conftest.$ac_objext conftest$ac_exeext
14002 if { (eval echo "$as_me:14002: \"$ac_link\"") >&5
14003   (eval $ac_link) 2>&5
14004   ac_status=$?
14005   echo "$as_me:14005: \$? = $ac_status" >&5
14006   (exit $ac_status); } &&
14007          { ac_try='test -s conftest$ac_exeext'
14008   { (eval echo "$as_me:14008: \"$ac_try\"") >&5
14009   (eval $ac_try) 2>&5
14010   ac_status=$?
14011   echo "$as_me:14011: \$? = $ac_status" >&5
14012   (exit $ac_status); }; }; then
14013   cf_cv_lib_XCurses=yes
14014 else
14015   echo "$as_me: failed program was:" >&5
14016 cat conftest.$ac_ext >&5
14017 cf_cv_lib_XCurses=no
14018 fi
14019 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14020
14021 fi
14022 echo "$as_me:14022: result: $cf_cv_lib_XCurses" >&5
14023 echo "${ECHO_T}$cf_cv_lib_XCurses" >&6
14024
14025 fi
14026
14027 if test $cf_cv_lib_XCurses = yes ; then
14028
14029 cat >>confdefs.h <<\EOF
14030 #define UNIX 1
14031 EOF
14032
14033 cat >>confdefs.h <<\EOF
14034 #define XCURSES 1
14035 EOF
14036
14037         echo "$as_me:14037: checking for xcurses.h" >&5
14038 echo $ECHO_N "checking for xcurses.h... $ECHO_C" >&6
14039 if test "${ac_cv_header_xcurses_h+set}" = set; then
14040   echo $ECHO_N "(cached) $ECHO_C" >&6
14041 else
14042   cat >conftest.$ac_ext <<_ACEOF
14043 #line 14043 "configure"
14044 #include "confdefs.h"
14045 #include <xcurses.h>
14046 _ACEOF
14047 if { (eval echo "$as_me:14047: \"$ac_cpp conftest.$ac_ext\"") >&5
14048   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
14049   ac_status=$?
14050   egrep -v '^ *\+' conftest.er1 >conftest.err
14051   rm -f conftest.er1
14052   cat conftest.err >&5
14053   echo "$as_me:14053: \$? = $ac_status" >&5
14054   (exit $ac_status); } >/dev/null; then
14055   if test -s conftest.err; then
14056     ac_cpp_err=$ac_c_preproc_warn_flag
14057   else
14058     ac_cpp_err=
14059   fi
14060 else
14061   ac_cpp_err=yes
14062 fi
14063 if test -z "$ac_cpp_err"; then
14064   ac_cv_header_xcurses_h=yes
14065 else
14066   echo "$as_me: failed program was:" >&5
14067   cat conftest.$ac_ext >&5
14068   ac_cv_header_xcurses_h=no
14069 fi
14070 rm -f conftest.err conftest.$ac_ext
14071 fi
14072 echo "$as_me:14072: result: $ac_cv_header_xcurses_h" >&5
14073 echo "${ECHO_T}$ac_cv_header_xcurses_h" >&6
14074 if test $ac_cv_header_xcurses_h = yes; then
14075
14076 cat >>confdefs.h <<\EOF
14077 #define HAVE_XCURSES 1
14078 EOF
14079
14080 fi
14081
14082 else
14083         { { echo "$as_me:14083: error: Cannot link with XCurses" >&5
14084 echo "$as_me: error: Cannot link with XCurses" >&2;}
14085    { (exit 1); exit 1; }; }
14086 fi
14087
14088         ;;
14089 (*)
14090         { { echo "$as_me:14090: error: unexpected screen-value: $cf_cv_screen" >&5
14091 echo "$as_me: error: unexpected screen-value: $cf_cv_screen" >&2;}
14092    { (exit 1); exit 1; }; }
14093         ;;
14094 esac
14095
14096 : ${cf_nculib_root:=$cf_cv_screen}
14097 as_ac_Lib=`echo "ac_cv_lib_$cf_nculib_root''__nc_init_pthreads" | $as_tr_sh`
14098 echo "$as_me:14098: checking for _nc_init_pthreads in -l$cf_nculib_root" >&5
14099 echo $ECHO_N "checking for _nc_init_pthreads in -l$cf_nculib_root... $ECHO_C" >&6
14100 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
14101   echo $ECHO_N "(cached) $ECHO_C" >&6
14102 else
14103   ac_check_lib_save_LIBS=$LIBS
14104 LIBS="-l$cf_nculib_root  $LIBS"
14105 cat >conftest.$ac_ext <<_ACEOF
14106 #line 14106 "configure"
14107 #include "confdefs.h"
14108
14109 /* Override any gcc2 internal prototype to avoid an error.  */
14110 #ifdef __cplusplus
14111 extern "C"
14112 #endif
14113 /* We use char because int might match the return type of a gcc2
14114    builtin and then its argument prototype would still apply.  */
14115 char _nc_init_pthreads ();
14116 int
14117 main (void)
14118 {
14119 _nc_init_pthreads ();
14120   ;
14121   return 0;
14122 }
14123 _ACEOF
14124 rm -f conftest.$ac_objext conftest$ac_exeext
14125 if { (eval echo "$as_me:14125: \"$ac_link\"") >&5
14126   (eval $ac_link) 2>&5
14127   ac_status=$?
14128   echo "$as_me:14128: \$? = $ac_status" >&5
14129   (exit $ac_status); } &&
14130          { ac_try='test -s conftest$ac_exeext'
14131   { (eval echo "$as_me:14131: \"$ac_try\"") >&5
14132   (eval $ac_try) 2>&5
14133   ac_status=$?
14134   echo "$as_me:14134: \$? = $ac_status" >&5
14135   (exit $ac_status); }; }; then
14136   eval "$as_ac_Lib=yes"
14137 else
14138   echo "$as_me: failed program was:" >&5
14139 cat conftest.$ac_ext >&5
14140 eval "$as_ac_Lib=no"
14141 fi
14142 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14143 LIBS=$ac_check_lib_save_LIBS
14144 fi
14145 echo "$as_me:14145: result: `eval echo '${'$as_ac_Lib'}'`" >&5
14146 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
14147 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
14148   cf_cv_ncurses_pthreads=yes
14149 else
14150   cf_cv_ncurses_pthreads=no
14151 fi
14152
14153 if test "$cf_cv_ncurses_pthreads" = yes
14154 then
14155
14156 cf_add_libs="-lpthread"
14157 # Filter out duplicates - this happens with badly-designed ".pc" files...
14158 for cf_add_1lib in $LIBS
14159 do
14160         for cf_add_2lib in $cf_add_libs
14161         do
14162                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
14163                 then
14164                         cf_add_1lib=
14165                         break
14166                 fi
14167         done
14168         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
14169 done
14170 LIBS="$cf_add_libs"
14171
14172 fi
14173
14174 case $cf_cv_screen in
14175 (ncurses*)
14176         cf_cv_libtype=`echo "$cf_cv_screen" | sed -e 's/^ncurses//'`
14177         ;;
14178 esac
14179
14180 echo "$as_me:14180: checking for X11 rgb file" >&5
14181 echo $ECHO_N "checking for X11 rgb file... $ECHO_C" >&6
14182
14183 # Check whether --with-x11-rgb or --without-x11-rgb was given.
14184 if test "${with_x11_rgb+set}" = set; then
14185   withval="$with_x11_rgb"
14186   RGB_PATH=$withval
14187 else
14188   RGB_PATH=auto
14189 fi;
14190
14191 if test "x$RGB_PATH" = xauto
14192 then
14193         RGB_PATH='${exec_prefix}/lib/X11/rgb.txt'
14194         for cf_path in \
14195                 /opt/local/share/X11/rgb.txt \
14196                 /opt/X11/share/X11/rgb.txt \
14197                 /usr/share/X11/rgb.txt \
14198                 /usr/X11/share/X11/rgb.txt \
14199                 /usr/X11/lib/X11/rgb.txt \
14200                 /usr/lib/X11/rgb.txt \
14201                 /etc/X11/rgb.txt \
14202                 /usr/pkg/lib/X11/rgb.txt \
14203                 /usr/X11R7/lib/X11/rgb.txt \
14204                 /usr/X11R6/lib/X11/rgb.txt \
14205                 /usr/X11R5/lib/X11/rgb.txt \
14206                 /usr/X11R4/lib/X11/rgb.txt \
14207                 /usr/local/lib/X11/rgb.txt \
14208                 /usr/local/share/X11/rgb.txt \
14209                 /usr/lib64/X11/rgb.txt
14210         do
14211                 if test -f "$cf_path" ; then
14212                         RGB_PATH="$cf_path"
14213                         break
14214                 fi
14215         done
14216 else
14217         cf_path=$RGB_PATH
14218
14219 if test "x$prefix" != xNONE; then
14220         cf_path_syntax="$prefix"
14221 else
14222         cf_path_syntax="$ac_default_prefix"
14223 fi
14224
14225 case ".$cf_path" in
14226 (.\$\(*\)*|.\'*\'*)
14227         ;;
14228 (..|./*|.\\*)
14229         ;;
14230 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
14231         ;;
14232 (.\${*prefix}*|.\${*dir}*)
14233         eval cf_path="$cf_path"
14234         case ".$cf_path" in
14235         (.NONE/*)
14236                 cf_path=`echo $cf_path | sed -e s%NONE%$cf_path_syntax%`
14237                 ;;
14238         esac
14239         ;;
14240 (.no|.NONE/*)
14241         cf_path=`echo $cf_path | sed -e s%NONE%$cf_path_syntax%`
14242         ;;
14243 (*)
14244         { { echo "$as_me:14244: error: expected a pathname, not \"$cf_path\"" >&5
14245 echo "$as_me: error: expected a pathname, not \"$cf_path\"" >&2;}
14246    { (exit 1); exit 1; }; }
14247         ;;
14248 esac
14249
14250 fi
14251
14252 echo "$as_me:14252: result: $RGB_PATH" >&5
14253 echo "${ECHO_T}$RGB_PATH" >&6
14254
14255 cat >>confdefs.h <<EOF
14256 #define RGB_PATH "$cf_path"
14257 EOF
14258
14259 no_x11_rgb=
14260 if test "$RGB_PATH" = no
14261 then
14262         no_x11_rgb="#"
14263 fi
14264
14265 cf_curses_headers=
14266
14267 case $cf_cv_screen in
14268 (pdcurses)
14269         cf_default_panel=no
14270         cf_default_form=no
14271         cf_default_menu=no
14272         cf_default_tinfo=no
14273         ;;
14274 (xcurses|bsdcurses)
14275         cf_default_panel=no
14276         cf_default_form=no
14277         cf_default_menu=no
14278         cf_default_tinfo=yes
14279         ;;
14280 (*)
14281         cf_default_panel=yes
14282         cf_default_form=yes
14283         cf_default_menu=yes
14284         cf_default_tinfo=yes
14285         case $cf_cv_screen in
14286         (ncurses*)
14287                 cf_curses_headers="nc_alloc.h nomacros.h term_entry.h"
14288                 ;;
14289         esac
14290         ;;
14291 esac
14292
14293 echo "$as_me:14293: checking if you want to check for panel functions" >&5
14294 echo $ECHO_N "checking if you want to check for panel functions... $ECHO_C" >&6
14295
14296 # Check whether --enable-panel or --disable-panel was given.
14297 if test "${enable_panel+set}" = set; then
14298   enableval="$enable_panel"
14299   test "$enableval" != no && enableval=yes
14300         if test "$enableval" != "yes" ; then
14301     cf_enable_panel=no
14302         else
14303                 cf_enable_panel=$cf_default_panel
14304         fi
14305 else
14306   enableval=yes
14307         cf_enable_panel=$cf_default_panel
14308
14309 fi;
14310 echo "$as_me:14310: result: $cf_enable_panel" >&5
14311 echo "${ECHO_T}$cf_enable_panel" >&6
14312 if test $cf_enable_panel = yes
14313 then
14314
14315 as_ac_Lib=`echo "ac_cv_lib_panel$cf_cv_libtype''_new_panel" | $as_tr_sh`
14316 echo "$as_me:14316: checking for new_panel in -lpanel$cf_cv_libtype" >&5
14317 echo $ECHO_N "checking for new_panel in -lpanel$cf_cv_libtype... $ECHO_C" >&6
14318 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
14319   echo $ECHO_N "(cached) $ECHO_C" >&6
14320 else
14321   ac_check_lib_save_LIBS=$LIBS
14322 LIBS="-lpanel$cf_cv_libtype  $LIBS"
14323 cat >conftest.$ac_ext <<_ACEOF
14324 #line 14324 "configure"
14325 #include "confdefs.h"
14326
14327 /* Override any gcc2 internal prototype to avoid an error.  */
14328 #ifdef __cplusplus
14329 extern "C"
14330 #endif
14331 /* We use char because int might match the return type of a gcc2
14332    builtin and then its argument prototype would still apply.  */
14333 char new_panel ();
14334 int
14335 main (void)
14336 {
14337 new_panel ();
14338   ;
14339   return 0;
14340 }
14341 _ACEOF
14342 rm -f conftest.$ac_objext conftest$ac_exeext
14343 if { (eval echo "$as_me:14343: \"$ac_link\"") >&5
14344   (eval $ac_link) 2>&5
14345   ac_status=$?
14346   echo "$as_me:14346: \$? = $ac_status" >&5
14347   (exit $ac_status); } &&
14348          { ac_try='test -s conftest$ac_exeext'
14349   { (eval echo "$as_me:14349: \"$ac_try\"") >&5
14350   (eval $ac_try) 2>&5
14351   ac_status=$?
14352   echo "$as_me:14352: \$? = $ac_status" >&5
14353   (exit $ac_status); }; }; then
14354   eval "$as_ac_Lib=yes"
14355 else
14356   echo "$as_me: failed program was:" >&5
14357 cat conftest.$ac_ext >&5
14358 eval "$as_ac_Lib=no"
14359 fi
14360 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14361 LIBS=$ac_check_lib_save_LIBS
14362 fi
14363 echo "$as_me:14363: result: `eval echo '${'$as_ac_Lib'}'`" >&5
14364 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
14365 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
14366
14367 cf_upper=`echo "have_libpanel" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14368
14369 cf_add_libs="-lpanel$cf_cv_libtype"
14370 # Filter out duplicates - this happens with badly-designed ".pc" files...
14371 for cf_add_1lib in $LIBS
14372 do
14373         for cf_add_2lib in $cf_add_libs
14374         do
14375                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
14376                 then
14377                         cf_add_1lib=
14378                         break
14379                 fi
14380         done
14381         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
14382 done
14383 LIBS="$cf_add_libs"
14384
14385 cat >>confdefs.h <<EOF
14386 #define $cf_upper 1
14387 EOF
14388
14389 fi
14390
14391         cf_curses_headers="$cf_curses_headers panel.h"
14392 fi
14393
14394 echo "$as_me:14394: checking if you want to check for menu functions" >&5
14395 echo $ECHO_N "checking if you want to check for menu functions... $ECHO_C" >&6
14396
14397 # Check whether --enable-menu or --disable-menu was given.
14398 if test "${enable_menu+set}" = set; then
14399   enableval="$enable_menu"
14400   test "$enableval" != no && enableval=yes
14401         if test "$enableval" != "yes" ; then
14402     cf_enable_menu=no
14403         else
14404                 cf_enable_menu=$cf_default_menu
14405         fi
14406 else
14407   enableval=yes
14408         cf_enable_menu=$cf_default_menu
14409
14410 fi;
14411 echo "$as_me:14411: result: $cf_enable_menu" >&5
14412 echo "${ECHO_T}$cf_enable_menu" >&6
14413 if test $cf_enable_menu = yes
14414 then
14415         case $cf_cv_screen in
14416         (ncurses*)
14417                 ;;
14418         (curses*)
14419
14420 echo "$as_me:14420: checking for NetBSD menu.h" >&5
14421 echo $ECHO_N "checking for NetBSD menu.h... $ECHO_C" >&6
14422 if test "${cf_cv_netbsd_menu_h+set}" = set; then
14423   echo $ECHO_N "(cached) $ECHO_C" >&6
14424 else
14425
14426 cat >conftest.$ac_ext <<_ACEOF
14427 #line 14427 "configure"
14428 #include "confdefs.h"
14429
14430 #include <${cf_cv_ncurses_header:-curses.h}>
14431 #include <menu.h>
14432
14433 int
14434 main (void)
14435 {
14436
14437         MENU *menu;
14438         int y = menu->max_item_width;
14439
14440   ;
14441   return 0;
14442 }
14443 _ACEOF
14444 rm -f conftest.$ac_objext
14445 if { (eval echo "$as_me:14445: \"$ac_compile\"") >&5
14446   (eval $ac_compile) 2>&5
14447   ac_status=$?
14448   echo "$as_me:14448: \$? = $ac_status" >&5
14449   (exit $ac_status); } &&
14450          { ac_try='test -s conftest.$ac_objext'
14451   { (eval echo "$as_me:14451: \"$ac_try\"") >&5
14452   (eval $ac_try) 2>&5
14453   ac_status=$?
14454   echo "$as_me:14454: \$? = $ac_status" >&5
14455   (exit $ac_status); }; }; then
14456   cf_cv_netbsd_menu_h=yes
14457
14458 else
14459   echo "$as_me: failed program was:" >&5
14460 cat conftest.$ac_ext >&5
14461 cf_cv_netbsd_menu_h=no
14462 fi
14463 rm -f conftest.$ac_objext conftest.$ac_ext
14464
14465 fi
14466 echo "$as_me:14466: result: $cf_cv_netbsd_menu_h" >&5
14467 echo "${ECHO_T}$cf_cv_netbsd_menu_h" >&6
14468
14469 test "$cf_cv_netbsd_menu_h" = yes &&
14470 cat >>confdefs.h <<\EOF
14471 #define HAVE_NETBSD_MENU_H 1
14472 EOF
14473
14474                 ;;
14475         esac
14476
14477 as_ac_Lib=`echo "ac_cv_lib_menu$cf_cv_libtype''_menu_driver" | $as_tr_sh`
14478 echo "$as_me:14478: checking for menu_driver in -lmenu$cf_cv_libtype" >&5
14479 echo $ECHO_N "checking for menu_driver in -lmenu$cf_cv_libtype... $ECHO_C" >&6
14480 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
14481   echo $ECHO_N "(cached) $ECHO_C" >&6
14482 else
14483   ac_check_lib_save_LIBS=$LIBS
14484 LIBS="-lmenu$cf_cv_libtype  $LIBS"
14485 cat >conftest.$ac_ext <<_ACEOF
14486 #line 14486 "configure"
14487 #include "confdefs.h"
14488
14489 /* Override any gcc2 internal prototype to avoid an error.  */
14490 #ifdef __cplusplus
14491 extern "C"
14492 #endif
14493 /* We use char because int might match the return type of a gcc2
14494    builtin and then its argument prototype would still apply.  */
14495 char menu_driver ();
14496 int
14497 main (void)
14498 {
14499 menu_driver ();
14500   ;
14501   return 0;
14502 }
14503 _ACEOF
14504 rm -f conftest.$ac_objext conftest$ac_exeext
14505 if { (eval echo "$as_me:14505: \"$ac_link\"") >&5
14506   (eval $ac_link) 2>&5
14507   ac_status=$?
14508   echo "$as_me:14508: \$? = $ac_status" >&5
14509   (exit $ac_status); } &&
14510          { ac_try='test -s conftest$ac_exeext'
14511   { (eval echo "$as_me:14511: \"$ac_try\"") >&5
14512   (eval $ac_try) 2>&5
14513   ac_status=$?
14514   echo "$as_me:14514: \$? = $ac_status" >&5
14515   (exit $ac_status); }; }; then
14516   eval "$as_ac_Lib=yes"
14517 else
14518   echo "$as_me: failed program was:" >&5
14519 cat conftest.$ac_ext >&5
14520 eval "$as_ac_Lib=no"
14521 fi
14522 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14523 LIBS=$ac_check_lib_save_LIBS
14524 fi
14525 echo "$as_me:14525: result: `eval echo '${'$as_ac_Lib'}'`" >&5
14526 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
14527 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
14528
14529 cf_upper=`echo "have_libmenu" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14530
14531 cf_add_libs="-lmenu$cf_cv_libtype"
14532 # Filter out duplicates - this happens with badly-designed ".pc" files...
14533 for cf_add_1lib in $LIBS
14534 do
14535         for cf_add_2lib in $cf_add_libs
14536         do
14537                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
14538                 then
14539                         cf_add_1lib=
14540                         break
14541                 fi
14542         done
14543         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
14544 done
14545 LIBS="$cf_add_libs"
14546
14547 cat >>confdefs.h <<EOF
14548 #define $cf_upper 1
14549 EOF
14550
14551 fi
14552
14553         cf_curses_headers="$cf_curses_headers menu.h"
14554 fi
14555
14556 echo "$as_me:14556: checking if you want to check for form functions" >&5
14557 echo $ECHO_N "checking if you want to check for form functions... $ECHO_C" >&6
14558
14559 # Check whether --enable-form or --disable-form was given.
14560 if test "${enable_form+set}" = set; then
14561   enableval="$enable_form"
14562   test "$enableval" != no && enableval=yes
14563         if test "$enableval" != "yes" ; then
14564     cf_enable_form=no
14565         else
14566                 cf_enable_form=$cf_default_form
14567         fi
14568 else
14569   enableval=yes
14570         cf_enable_form=$cf_default_form
14571
14572 fi;
14573 echo "$as_me:14573: result: $cf_enable_form" >&5
14574 echo "${ECHO_T}$cf_enable_form" >&6
14575 if test $cf_enable_form = yes
14576 then
14577         case $cf_cv_screen in
14578         (ncurses*)
14579                 ;;
14580         (curses*)
14581
14582 echo "$as_me:14582: checking for NetBSD form.h" >&5
14583 echo $ECHO_N "checking for NetBSD form.h... $ECHO_C" >&6
14584 if test "${cf_cv_netbsd_form_h+set}" = set; then
14585   echo $ECHO_N "(cached) $ECHO_C" >&6
14586 else
14587
14588 cat >conftest.$ac_ext <<_ACEOF
14589 #line 14589 "configure"
14590 #include "confdefs.h"
14591
14592 #include <${cf_cv_ncurses_header:-curses.h}>
14593 #include <form.h>
14594
14595 int
14596 main (void)
14597 {
14598
14599         FORM *form;
14600         int y = current_field(form)->cursor_ypos;
14601         int x = current_field(form)->cursor_xpos;
14602
14603   ;
14604   return 0;
14605 }
14606 _ACEOF
14607 rm -f conftest.$ac_objext
14608 if { (eval echo "$as_me:14608: \"$ac_compile\"") >&5
14609   (eval $ac_compile) 2>&5
14610   ac_status=$?
14611   echo "$as_me:14611: \$? = $ac_status" >&5
14612   (exit $ac_status); } &&
14613          { ac_try='test -s conftest.$ac_objext'
14614   { (eval echo "$as_me:14614: \"$ac_try\"") >&5
14615   (eval $ac_try) 2>&5
14616   ac_status=$?
14617   echo "$as_me:14617: \$? = $ac_status" >&5
14618   (exit $ac_status); }; }; then
14619   cf_cv_netbsd_form_h=yes
14620
14621 else
14622   echo "$as_me: failed program was:" >&5
14623 cat conftest.$ac_ext >&5
14624 cf_cv_netbsd_form_h=no
14625 fi
14626 rm -f conftest.$ac_objext conftest.$ac_ext
14627
14628 fi
14629 echo "$as_me:14629: result: $cf_cv_netbsd_form_h" >&5
14630 echo "${ECHO_T}$cf_cv_netbsd_form_h" >&6
14631
14632 test "$cf_cv_netbsd_form_h" = yes &&
14633 cat >>confdefs.h <<\EOF
14634 #define HAVE_NETBSD_FORM_H 1
14635 EOF
14636
14637                 ;;
14638         esac
14639
14640 as_ac_Lib=`echo "ac_cv_lib_form$cf_cv_libtype''_form_driver" | $as_tr_sh`
14641 echo "$as_me:14641: checking for form_driver in -lform$cf_cv_libtype" >&5
14642 echo $ECHO_N "checking for form_driver in -lform$cf_cv_libtype... $ECHO_C" >&6
14643 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
14644   echo $ECHO_N "(cached) $ECHO_C" >&6
14645 else
14646   ac_check_lib_save_LIBS=$LIBS
14647 LIBS="-lform$cf_cv_libtype  $LIBS"
14648 cat >conftest.$ac_ext <<_ACEOF
14649 #line 14649 "configure"
14650 #include "confdefs.h"
14651
14652 /* Override any gcc2 internal prototype to avoid an error.  */
14653 #ifdef __cplusplus
14654 extern "C"
14655 #endif
14656 /* We use char because int might match the return type of a gcc2
14657    builtin and then its argument prototype would still apply.  */
14658 char form_driver ();
14659 int
14660 main (void)
14661 {
14662 form_driver ();
14663   ;
14664   return 0;
14665 }
14666 _ACEOF
14667 rm -f conftest.$ac_objext conftest$ac_exeext
14668 if { (eval echo "$as_me:14668: \"$ac_link\"") >&5
14669   (eval $ac_link) 2>&5
14670   ac_status=$?
14671   echo "$as_me:14671: \$? = $ac_status" >&5
14672   (exit $ac_status); } &&
14673          { ac_try='test -s conftest$ac_exeext'
14674   { (eval echo "$as_me:14674: \"$ac_try\"") >&5
14675   (eval $ac_try) 2>&5
14676   ac_status=$?
14677   echo "$as_me:14677: \$? = $ac_status" >&5
14678   (exit $ac_status); }; }; then
14679   eval "$as_ac_Lib=yes"
14680 else
14681   echo "$as_me: failed program was:" >&5
14682 cat conftest.$ac_ext >&5
14683 eval "$as_ac_Lib=no"
14684 fi
14685 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14686 LIBS=$ac_check_lib_save_LIBS
14687 fi
14688 echo "$as_me:14688: result: `eval echo '${'$as_ac_Lib'}'`" >&5
14689 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
14690 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
14691
14692 cf_upper=`echo "have_libform" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14693
14694 cf_add_libs="-lform$cf_cv_libtype"
14695 # Filter out duplicates - this happens with badly-designed ".pc" files...
14696 for cf_add_1lib in $LIBS
14697 do
14698         for cf_add_2lib in $cf_add_libs
14699         do
14700                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
14701                 then
14702                         cf_add_1lib=
14703                         break
14704                 fi
14705         done
14706         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
14707 done
14708 LIBS="$cf_add_libs"
14709
14710 cat >>confdefs.h <<EOF
14711 #define $cf_upper 1
14712 EOF
14713
14714 fi
14715
14716         cf_curses_headers="$cf_curses_headers form.h"
14717 fi
14718
14719 # look for curses-related headers
14720
14721 for ac_header in $cf_curses_headers
14722 do
14723 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
14724 echo "$as_me:14724: checking for $ac_header" >&5
14725 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
14726 if eval "test \"\${$as_ac_Header+set}\" = set"; then
14727   echo $ECHO_N "(cached) $ECHO_C" >&6
14728 else
14729   cat >conftest.$ac_ext <<_ACEOF
14730 #line 14730 "configure"
14731 #include "confdefs.h"
14732 #include <$ac_header>
14733 _ACEOF
14734 if { (eval echo "$as_me:14734: \"$ac_cpp conftest.$ac_ext\"") >&5
14735   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
14736   ac_status=$?
14737   egrep -v '^ *\+' conftest.er1 >conftest.err
14738   rm -f conftest.er1
14739   cat conftest.err >&5
14740   echo "$as_me:14740: \$? = $ac_status" >&5
14741   (exit $ac_status); } >/dev/null; then
14742   if test -s conftest.err; then
14743     ac_cpp_err=$ac_c_preproc_warn_flag
14744   else
14745     ac_cpp_err=
14746   fi
14747 else
14748   ac_cpp_err=yes
14749 fi
14750 if test -z "$ac_cpp_err"; then
14751   eval "$as_ac_Header=yes"
14752 else
14753   echo "$as_me: failed program was:" >&5
14754   cat conftest.$ac_ext >&5
14755   eval "$as_ac_Header=no"
14756 fi
14757 rm -f conftest.err conftest.$ac_ext
14758 fi
14759 echo "$as_me:14759: result: `eval echo '${'$as_ac_Header'}'`" >&5
14760 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
14761 if test `eval echo '${'$as_ac_Header'}'` = yes; then
14762   cat >>confdefs.h <<EOF
14763 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
14764 EOF
14765
14766 fi
14767 done
14768
14769 echo "$as_me:14769: checking for ANSI C header files" >&5
14770 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
14771 if test "${ac_cv_header_stdc+set}" = set; then
14772   echo $ECHO_N "(cached) $ECHO_C" >&6
14773 else
14774   cat >conftest.$ac_ext <<_ACEOF
14775 #line 14775 "configure"
14776 #include "confdefs.h"
14777 #include <stdlib.h>
14778 #include <stdarg.h>
14779 #include <string.h>
14780 #include <float.h>
14781
14782 _ACEOF
14783 if { (eval echo "$as_me:14783: \"$ac_cpp conftest.$ac_ext\"") >&5
14784   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
14785   ac_status=$?
14786   egrep -v '^ *\+' conftest.er1 >conftest.err
14787   rm -f conftest.er1
14788   cat conftest.err >&5
14789   echo "$as_me:14789: \$? = $ac_status" >&5
14790   (exit $ac_status); } >/dev/null; then
14791   if test -s conftest.err; then
14792     ac_cpp_err=$ac_c_preproc_warn_flag
14793   else
14794     ac_cpp_err=
14795   fi
14796 else
14797   ac_cpp_err=yes
14798 fi
14799 if test -z "$ac_cpp_err"; then
14800   ac_cv_header_stdc=yes
14801 else
14802   echo "$as_me: failed program was:" >&5
14803   cat conftest.$ac_ext >&5
14804   ac_cv_header_stdc=no
14805 fi
14806 rm -f conftest.err conftest.$ac_ext
14807
14808 if test $ac_cv_header_stdc = yes; then
14809   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
14810   cat >conftest.$ac_ext <<_ACEOF
14811 #line 14811 "configure"
14812 #include "confdefs.h"
14813 #include <string.h>
14814
14815 _ACEOF
14816 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14817   egrep "memchr" >/dev/null 2>&1; then
14818   :
14819 else
14820   ac_cv_header_stdc=no
14821 fi
14822 rm -rf conftest*
14823
14824 fi
14825
14826 if test $ac_cv_header_stdc = yes; then
14827   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
14828   cat >conftest.$ac_ext <<_ACEOF
14829 #line 14829 "configure"
14830 #include "confdefs.h"
14831 #include <stdlib.h>
14832
14833 _ACEOF
14834 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14835   egrep "free" >/dev/null 2>&1; then
14836   :
14837 else
14838   ac_cv_header_stdc=no
14839 fi
14840 rm -rf conftest*
14841
14842 fi
14843
14844 if test $ac_cv_header_stdc = yes; then
14845   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
14846   if test "$cross_compiling" = yes; then
14847   :
14848 else
14849   cat >conftest.$ac_ext <<_ACEOF
14850 #line 14850 "configure"
14851 #include "confdefs.h"
14852 #include <ctype.h>
14853 #if ((' ' & 0x0FF) == 0x020)
14854 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
14855 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
14856 #else
14857 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
14858                      || ('j' <= (c) && (c) <= 'r') \
14859                      || ('s' <= (c) && (c) <= 'z'))
14860 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
14861 #endif
14862
14863 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
14864 int
14865 main (void)
14866 {
14867   int i;
14868   for (i = 0; i < 256; i++)
14869     if (XOR (islower (i), ISLOWER (i))
14870         || toupper (i) != TOUPPER (i))
14871       $ac_main_return(2);
14872   $ac_main_return (0);
14873 }
14874 _ACEOF
14875 rm -f conftest$ac_exeext
14876 if { (eval echo "$as_me:14876: \"$ac_link\"") >&5
14877   (eval $ac_link) 2>&5
14878   ac_status=$?
14879   echo "$as_me:14879: \$? = $ac_status" >&5
14880   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
14881   { (eval echo "$as_me:14881: \"$ac_try\"") >&5
14882   (eval $ac_try) 2>&5
14883   ac_status=$?
14884   echo "$as_me:14884: \$? = $ac_status" >&5
14885   (exit $ac_status); }; }; then
14886   :
14887 else
14888   echo "$as_me: program exited with status $ac_status" >&5
14889 echo "$as_me: failed program was:" >&5
14890 cat conftest.$ac_ext >&5
14891 ac_cv_header_stdc=no
14892 fi
14893 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
14894 fi
14895 fi
14896 fi
14897 echo "$as_me:14897: result: $ac_cv_header_stdc" >&5
14898 echo "${ECHO_T}$ac_cv_header_stdc" >&6
14899 if test $ac_cv_header_stdc = yes; then
14900
14901 cat >>confdefs.h <<\EOF
14902 #define STDC_HEADERS 1
14903 EOF
14904
14905 fi
14906
14907 echo "$as_me:14907: checking whether time.h and sys/time.h may both be included" >&5
14908 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
14909 if test "${ac_cv_header_time+set}" = set; then
14910   echo $ECHO_N "(cached) $ECHO_C" >&6
14911 else
14912   cat >conftest.$ac_ext <<_ACEOF
14913 #line 14913 "configure"
14914 #include "confdefs.h"
14915 #include <sys/types.h>
14916 #include <sys/time.h>
14917 #include <time.h>
14918
14919 int
14920 main (void)
14921 {
14922 if ((struct tm *) 0)
14923 return 0;
14924   ;
14925   return 0;
14926 }
14927 _ACEOF
14928 rm -f conftest.$ac_objext
14929 if { (eval echo "$as_me:14929: \"$ac_compile\"") >&5
14930   (eval $ac_compile) 2>&5
14931   ac_status=$?
14932   echo "$as_me:14932: \$? = $ac_status" >&5
14933   (exit $ac_status); } &&
14934          { ac_try='test -s conftest.$ac_objext'
14935   { (eval echo "$as_me:14935: \"$ac_try\"") >&5
14936   (eval $ac_try) 2>&5
14937   ac_status=$?
14938   echo "$as_me:14938: \$? = $ac_status" >&5
14939   (exit $ac_status); }; }; then
14940   ac_cv_header_time=yes
14941 else
14942   echo "$as_me: failed program was:" >&5
14943 cat conftest.$ac_ext >&5
14944 ac_cv_header_time=no
14945 fi
14946 rm -f conftest.$ac_objext conftest.$ac_ext
14947 fi
14948 echo "$as_me:14948: result: $ac_cv_header_time" >&5
14949 echo "${ECHO_T}$ac_cv_header_time" >&6
14950 if test $ac_cv_header_time = yes; then
14951
14952 cat >>confdefs.h <<\EOF
14953 #define TIME_WITH_SYS_TIME 1
14954 EOF
14955
14956 fi
14957
14958 for ac_header in \
14959 getopt.h \
14960 locale.h \
14961 math.h \
14962 stdarg.h \
14963 stdint.h \
14964 sys/ioctl.h \
14965 sys/select.h \
14966 sys/time.h \
14967 termios.h \
14968 unistd.h \
14969
14970 do
14971 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
14972 echo "$as_me:14972: checking for $ac_header" >&5
14973 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
14974 if eval "test \"\${$as_ac_Header+set}\" = set"; then
14975   echo $ECHO_N "(cached) $ECHO_C" >&6
14976 else
14977   cat >conftest.$ac_ext <<_ACEOF
14978 #line 14978 "configure"
14979 #include "confdefs.h"
14980 #include <$ac_header>
14981 _ACEOF
14982 if { (eval echo "$as_me:14982: \"$ac_cpp conftest.$ac_ext\"") >&5
14983   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
14984   ac_status=$?
14985   egrep -v '^ *\+' conftest.er1 >conftest.err
14986   rm -f conftest.er1
14987   cat conftest.err >&5
14988   echo "$as_me:14988: \$? = $ac_status" >&5
14989   (exit $ac_status); } >/dev/null; then
14990   if test -s conftest.err; then
14991     ac_cpp_err=$ac_c_preproc_warn_flag
14992   else
14993     ac_cpp_err=
14994   fi
14995 else
14996   ac_cpp_err=yes
14997 fi
14998 if test -z "$ac_cpp_err"; then
14999   eval "$as_ac_Header=yes"
15000 else
15001   echo "$as_me: failed program was:" >&5
15002   cat conftest.$ac_ext >&5
15003   eval "$as_ac_Header=no"
15004 fi
15005 rm -f conftest.err conftest.$ac_ext
15006 fi
15007 echo "$as_me:15007: result: `eval echo '${'$as_ac_Header'}'`" >&5
15008 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
15009 if test `eval echo '${'$as_ac_Header'}'` = yes; then
15010   cat >>confdefs.h <<EOF
15011 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
15012 EOF
15013
15014 fi
15015 done
15016
15017 for ac_header in unistd.h getopt.h
15018 do
15019 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
15020 echo "$as_me:15020: checking for $ac_header" >&5
15021 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
15022 if eval "test \"\${$as_ac_Header+set}\" = set"; then
15023   echo $ECHO_N "(cached) $ECHO_C" >&6
15024 else
15025   cat >conftest.$ac_ext <<_ACEOF
15026 #line 15026 "configure"
15027 #include "confdefs.h"
15028 #include <$ac_header>
15029 _ACEOF
15030 if { (eval echo "$as_me:15030: \"$ac_cpp conftest.$ac_ext\"") >&5
15031   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
15032   ac_status=$?
15033   egrep -v '^ *\+' conftest.er1 >conftest.err
15034   rm -f conftest.er1
15035   cat conftest.err >&5
15036   echo "$as_me:15036: \$? = $ac_status" >&5
15037   (exit $ac_status); } >/dev/null; then
15038   if test -s conftest.err; then
15039     ac_cpp_err=$ac_c_preproc_warn_flag
15040   else
15041     ac_cpp_err=
15042   fi
15043 else
15044   ac_cpp_err=yes
15045 fi
15046 if test -z "$ac_cpp_err"; then
15047   eval "$as_ac_Header=yes"
15048 else
15049   echo "$as_me: failed program was:" >&5
15050   cat conftest.$ac_ext >&5
15051   eval "$as_ac_Header=no"
15052 fi
15053 rm -f conftest.err conftest.$ac_ext
15054 fi
15055 echo "$as_me:15055: result: `eval echo '${'$as_ac_Header'}'`" >&5
15056 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
15057 if test `eval echo '${'$as_ac_Header'}'` = yes; then
15058   cat >>confdefs.h <<EOF
15059 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
15060 EOF
15061
15062 fi
15063 done
15064
15065 echo "$as_me:15065: checking for header declaring getopt variables" >&5
15066 echo $ECHO_N "checking for header declaring getopt variables... $ECHO_C" >&6
15067 if test "${cf_cv_getopt_header+set}" = set; then
15068   echo $ECHO_N "(cached) $ECHO_C" >&6
15069 else
15070
15071 cf_cv_getopt_header=none
15072 for cf_header in stdio.h stdlib.h unistd.h getopt.h
15073 do
15074 cat >conftest.$ac_ext <<_ACEOF
15075 #line 15075 "configure"
15076 #include "confdefs.h"
15077
15078 #include <$cf_header>
15079 int
15080 main (void)
15081 {
15082 int x = optind; char *y = optarg
15083   ;
15084   return 0;
15085 }
15086 _ACEOF
15087 rm -f conftest.$ac_objext
15088 if { (eval echo "$as_me:15088: \"$ac_compile\"") >&5
15089   (eval $ac_compile) 2>&5
15090   ac_status=$?
15091   echo "$as_me:15091: \$? = $ac_status" >&5
15092   (exit $ac_status); } &&
15093          { ac_try='test -s conftest.$ac_objext'
15094   { (eval echo "$as_me:15094: \"$ac_try\"") >&5
15095   (eval $ac_try) 2>&5
15096   ac_status=$?
15097   echo "$as_me:15097: \$? = $ac_status" >&5
15098   (exit $ac_status); }; }; then
15099   cf_cv_getopt_header=$cf_header
15100  break
15101 else
15102   echo "$as_me: failed program was:" >&5
15103 cat conftest.$ac_ext >&5
15104 fi
15105 rm -f conftest.$ac_objext conftest.$ac_ext
15106 done
15107
15108 fi
15109 echo "$as_me:15109: result: $cf_cv_getopt_header" >&5
15110 echo "${ECHO_T}$cf_cv_getopt_header" >&6
15111 if test $cf_cv_getopt_header != none ; then
15112
15113 cat >>confdefs.h <<\EOF
15114 #define HAVE_GETOPT_HEADER 1
15115 EOF
15116
15117 fi
15118 if test $cf_cv_getopt_header = getopt.h ; then
15119
15120 cat >>confdefs.h <<\EOF
15121 #define NEED_GETOPT_H 1
15122 EOF
15123
15124 fi
15125
15126 for ac_func in \
15127 getopt \
15128 gettimeofday \
15129 tdestroy \
15130 tsearch \
15131
15132 do
15133 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
15134 echo "$as_me:15134: checking for $ac_func" >&5
15135 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
15136 if eval "test \"\${$as_ac_var+set}\" = set"; then
15137   echo $ECHO_N "(cached) $ECHO_C" >&6
15138 else
15139   cat >conftest.$ac_ext <<_ACEOF
15140 #line 15140 "configure"
15141 #include "confdefs.h"
15142 /* System header to define __stub macros and hopefully few prototypes,
15143     which can conflict with char $ac_func (); below.  */
15144 #include <assert.h>
15145 /* Override any gcc2 internal prototype to avoid an error.  */
15146 #ifdef __cplusplus
15147 extern "C"
15148 #endif
15149 /* We use char because int might match the return type of a gcc2
15150    builtin and then its argument prototype would still apply.  */
15151 char $ac_func ();
15152 char (*f) ();
15153
15154 int
15155 main (void)
15156 {
15157 /* The GNU C library defines this for functions which it implements
15158     to always fail with ENOSYS.  Some functions are actually named
15159     something starting with __ and the normal name is an alias.  */
15160 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
15161 choke me
15162 #else
15163 f = $ac_func; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
15164 #endif
15165
15166   ;
15167   return 0;
15168 }
15169 _ACEOF
15170 rm -f conftest.$ac_objext conftest$ac_exeext
15171 if { (eval echo "$as_me:15171: \"$ac_link\"") >&5
15172   (eval $ac_link) 2>&5
15173   ac_status=$?
15174   echo "$as_me:15174: \$? = $ac_status" >&5
15175   (exit $ac_status); } &&
15176          { ac_try='test -s conftest$ac_exeext'
15177   { (eval echo "$as_me:15177: \"$ac_try\"") >&5
15178   (eval $ac_try) 2>&5
15179   ac_status=$?
15180   echo "$as_me:15180: \$? = $ac_status" >&5
15181   (exit $ac_status); }; }; then
15182   eval "$as_ac_var=yes"
15183 else
15184   echo "$as_me: failed program was:" >&5
15185 cat conftest.$ac_ext >&5
15186 eval "$as_ac_var=no"
15187 fi
15188 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15189 fi
15190 echo "$as_me:15190: result: `eval echo '${'$as_ac_var'}'`" >&5
15191 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
15192 if test `eval echo '${'$as_ac_var'}'` = yes; then
15193   cat >>confdefs.h <<EOF
15194 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
15195 EOF
15196
15197 fi
15198 done
15199
15200 # use a compile-check to work with ncurses*-config and subdirectory includes
15201 echo "$as_me:15201: checking if we can use termcap.h" >&5
15202 echo $ECHO_N "checking if we can use termcap.h... $ECHO_C" >&6
15203 if test "${cf_cv_have_termcap_h+set}" = set; then
15204   echo $ECHO_N "(cached) $ECHO_C" >&6
15205 else
15206
15207         cat >conftest.$ac_ext <<_ACEOF
15208 #line 15208 "configure"
15209 #include "confdefs.h"
15210
15211 #include <curses.h>
15212 #include <termcap.h>
15213
15214 int
15215 main (void)
15216 {
15217 return 0;
15218   ;
15219   return 0;
15220 }
15221 _ACEOF
15222 rm -f conftest.$ac_objext
15223 if { (eval echo "$as_me:15223: \"$ac_compile\"") >&5
15224   (eval $ac_compile) 2>&5
15225   ac_status=$?
15226   echo "$as_me:15226: \$? = $ac_status" >&5
15227   (exit $ac_status); } &&
15228          { ac_try='test -s conftest.$ac_objext'
15229   { (eval echo "$as_me:15229: \"$ac_try\"") >&5
15230   (eval $ac_try) 2>&5
15231   ac_status=$?
15232   echo "$as_me:15232: \$? = $ac_status" >&5
15233   (exit $ac_status); }; }; then
15234   cf_cv_have_termcap_h=yes
15235 else
15236   echo "$as_me: failed program was:" >&5
15237 cat conftest.$ac_ext >&5
15238 cf_cv_have_termcap_h=no
15239 fi
15240 rm -f conftest.$ac_objext conftest.$ac_ext
15241 fi
15242 echo "$as_me:15242: result: $cf_cv_have_termcap_h" >&5
15243 echo "${ECHO_T}$cf_cv_have_termcap_h" >&6
15244 test "x$cf_cv_have_termcap_h" = xyes && cat >>confdefs.h <<\EOF
15245 #define HAVE_TERMCAP_H 1
15246 EOF
15247
15248 if test "x$ac_cv_func_getopt" = xno; then
15249         { { echo "$as_me:15249: error: getopt is required for building programs" >&5
15250 echo "$as_me: error: getopt is required for building programs" >&2;}
15251    { (exit 1); exit 1; }; }
15252 fi
15253
15254 if test "$cf_enable_widec" = yes; then
15255
15256 for ac_func in \
15257 mblen \
15258 mbrlen \
15259 mbrtowc \
15260 mbsrtowcs \
15261 mbstowcs \
15262 mbtowc \
15263 wcsrtombs \
15264 wcstombs \
15265
15266 do
15267 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
15268 echo "$as_me:15268: checking for $ac_func" >&5
15269 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
15270 if eval "test \"\${$as_ac_var+set}\" = set"; then
15271   echo $ECHO_N "(cached) $ECHO_C" >&6
15272 else
15273   cat >conftest.$ac_ext <<_ACEOF
15274 #line 15274 "configure"
15275 #include "confdefs.h"
15276 /* System header to define __stub macros and hopefully few prototypes,
15277     which can conflict with char $ac_func (); below.  */
15278 #include <assert.h>
15279 /* Override any gcc2 internal prototype to avoid an error.  */
15280 #ifdef __cplusplus
15281 extern "C"
15282 #endif
15283 /* We use char because int might match the return type of a gcc2
15284    builtin and then its argument prototype would still apply.  */
15285 char $ac_func ();
15286 char (*f) ();
15287
15288 int
15289 main (void)
15290 {
15291 /* The GNU C library defines this for functions which it implements
15292     to always fail with ENOSYS.  Some functions are actually named
15293     something starting with __ and the normal name is an alias.  */
15294 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
15295 choke me
15296 #else
15297 f = $ac_func; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
15298 #endif
15299
15300   ;
15301   return 0;
15302 }
15303 _ACEOF
15304 rm -f conftest.$ac_objext conftest$ac_exeext
15305 if { (eval echo "$as_me:15305: \"$ac_link\"") >&5
15306   (eval $ac_link) 2>&5
15307   ac_status=$?
15308   echo "$as_me:15308: \$? = $ac_status" >&5
15309   (exit $ac_status); } &&
15310          { ac_try='test -s conftest$ac_exeext'
15311   { (eval echo "$as_me:15311: \"$ac_try\"") >&5
15312   (eval $ac_try) 2>&5
15313   ac_status=$?
15314   echo "$as_me:15314: \$? = $ac_status" >&5
15315   (exit $ac_status); }; }; then
15316   eval "$as_ac_var=yes"
15317 else
15318   echo "$as_me: failed program was:" >&5
15319 cat conftest.$ac_ext >&5
15320 eval "$as_ac_var=no"
15321 fi
15322 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15323 fi
15324 echo "$as_me:15324: result: `eval echo '${'$as_ac_var'}'`" >&5
15325 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
15326 if test `eval echo '${'$as_ac_var'}'` = yes; then
15327   cat >>confdefs.h <<EOF
15328 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
15329 EOF
15330
15331 fi
15332 done
15333
15334 fi
15335
15336 echo "$as_me:15336: checking definition to turn on extended curses functions" >&5
15337 echo $ECHO_N "checking definition to turn on extended curses functions... $ECHO_C" >&6
15338 if test "${cf_cv_need_xopen_extension+set}" = set; then
15339   echo $ECHO_N "(cached) $ECHO_C" >&6
15340 else
15341
15342 cf_cv_need_xopen_extension=unknown
15343 cat >conftest.$ac_ext <<_ACEOF
15344 #line 15344 "configure"
15345 #include "confdefs.h"
15346
15347 #include <stdlib.h>
15348 #include <${cf_cv_ncurses_header:-curses.h}>
15349 int
15350 main (void)
15351 {
15352
15353 #if defined(NCURSES_VERSION_PATCH)
15354 #if (NCURSES_VERSION_PATCH < 20100501) && (NCURSES_VERSION_PATCH >= 20100403)
15355         make an error
15356 #endif
15357 #endif
15358 #ifdef NCURSES_VERSION
15359         cchar_t check;
15360         int check2 = curs_set((int)sizeof(check));
15361 #endif
15362         long x = winnstr(stdscr, "", 0);
15363         int x1, y1;
15364         getbegyx(stdscr, y1, x1)
15365   ;
15366   return 0;
15367 }
15368 _ACEOF
15369 rm -f conftest.$ac_objext conftest$ac_exeext
15370 if { (eval echo "$as_me:15370: \"$ac_link\"") >&5
15371   (eval $ac_link) 2>&5
15372   ac_status=$?
15373   echo "$as_me:15373: \$? = $ac_status" >&5
15374   (exit $ac_status); } &&
15375          { ac_try='test -s conftest$ac_exeext'
15376   { (eval echo "$as_me:15376: \"$ac_try\"") >&5
15377   (eval $ac_try) 2>&5
15378   ac_status=$?
15379   echo "$as_me:15379: \$? = $ac_status" >&5
15380   (exit $ac_status); }; }; then
15381   cf_cv_need_xopen_extension=none
15382 else
15383   echo "$as_me: failed program was:" >&5
15384 cat conftest.$ac_ext >&5
15385
15386         for cf_try_xopen_extension in _XOPEN_SOURCE_EXTENDED NCURSES_WIDECHAR
15387         do
15388                 cat >conftest.$ac_ext <<_ACEOF
15389 #line 15389 "configure"
15390 #include "confdefs.h"
15391
15392 #define $cf_try_xopen_extension 1
15393 #include <stdlib.h>
15394 #include <${cf_cv_ncurses_header:-curses.h}>
15395 int
15396 main (void)
15397 {
15398
15399 #ifdef NCURSES_VERSION
15400                 cchar_t check;
15401                 int check2 = curs_set((int)sizeof(check));
15402 #endif
15403                 long x = winnstr(stdscr, "", 0);
15404                 int x1, y1;
15405                 getbegyx(stdscr, y1, x1)
15406   ;
15407   return 0;
15408 }
15409 _ACEOF
15410 rm -f conftest.$ac_objext conftest$ac_exeext
15411 if { (eval echo "$as_me:15411: \"$ac_link\"") >&5
15412   (eval $ac_link) 2>&5
15413   ac_status=$?
15414   echo "$as_me:15414: \$? = $ac_status" >&5
15415   (exit $ac_status); } &&
15416          { ac_try='test -s conftest$ac_exeext'
15417   { (eval echo "$as_me:15417: \"$ac_try\"") >&5
15418   (eval $ac_try) 2>&5
15419   ac_status=$?
15420   echo "$as_me:15420: \$? = $ac_status" >&5
15421   (exit $ac_status); }; }; then
15422   cf_cv_need_xopen_extension=$cf_try_xopen_extension; break
15423 else
15424   echo "$as_me: failed program was:" >&5
15425 cat conftest.$ac_ext >&5
15426 fi
15427 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15428         done
15429
15430 fi
15431 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15432
15433 fi
15434 echo "$as_me:15434: result: $cf_cv_need_xopen_extension" >&5
15435 echo "${ECHO_T}$cf_cv_need_xopen_extension" >&6
15436
15437 case $cf_cv_need_xopen_extension in
15438 (*_*)
15439         CPPFLAGS="$CPPFLAGS -D$cf_cv_need_xopen_extension"
15440         ;;
15441 esac
15442
15443 echo "$as_me:15443: checking for term.h" >&5
15444 echo $ECHO_N "checking for term.h... $ECHO_C" >&6
15445 if test "${cf_cv_term_header+set}" = set; then
15446   echo $ECHO_N "(cached) $ECHO_C" >&6
15447 else
15448
15449 # If we found <ncurses/curses.h>, look for <ncurses/term.h>, but always look
15450 # for <term.h> if we do not find the variant.
15451
15452 cf_header_list="term.h ncurses/term.h ncursesw/term.h"
15453
15454 case ${cf_cv_ncurses_header:-curses.h} in
15455 (*/*)
15456         cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`term.h
15457         cf_header_list="$cf_header_item $cf_header_list"
15458         ;;
15459 esac
15460
15461 for cf_header in $cf_header_list
15462 do
15463         cat >conftest.$ac_ext <<_ACEOF
15464 #line 15464 "configure"
15465 #include "confdefs.h"
15466
15467 #include <${cf_cv_ncurses_header:-curses.h}>
15468 #include <${cf_header}>
15469 int
15470 main (void)
15471 {
15472 WINDOW *x
15473   ;
15474   return 0;
15475 }
15476 _ACEOF
15477 rm -f conftest.$ac_objext
15478 if { (eval echo "$as_me:15478: \"$ac_compile\"") >&5
15479   (eval $ac_compile) 2>&5
15480   ac_status=$?
15481   echo "$as_me:15481: \$? = $ac_status" >&5
15482   (exit $ac_status); } &&
15483          { ac_try='test -s conftest.$ac_objext'
15484   { (eval echo "$as_me:15484: \"$ac_try\"") >&5
15485   (eval $ac_try) 2>&5
15486   ac_status=$?
15487   echo "$as_me:15487: \$? = $ac_status" >&5
15488   (exit $ac_status); }; }; then
15489   cf_cv_term_header=$cf_header
15490          break
15491 else
15492   echo "$as_me: failed program was:" >&5
15493 cat conftest.$ac_ext >&5
15494 cf_cv_term_header=no
15495 fi
15496 rm -f conftest.$ac_objext conftest.$ac_ext
15497 done
15498
15499 case $cf_cv_term_header in
15500 (no)
15501         # If curses is ncurses, some packagers still mess it up by trying to make
15502         # us use GNU termcap.  This handles the most common case.
15503         for cf_header in ncurses/term.h ncursesw/term.h
15504         do
15505                 cat >conftest.$ac_ext <<_ACEOF
15506 #line 15506 "configure"
15507 #include "confdefs.h"
15508
15509 #include <${cf_cv_ncurses_header:-curses.h}>
15510 #ifdef NCURSES_VERSION
15511 #include <${cf_header}>
15512 #else
15513 make an error
15514 #endif
15515 int
15516 main (void)
15517 {
15518 WINDOW *x
15519   ;
15520   return 0;
15521 }
15522 _ACEOF
15523 rm -f conftest.$ac_objext
15524 if { (eval echo "$as_me:15524: \"$ac_compile\"") >&5
15525   (eval $ac_compile) 2>&5
15526   ac_status=$?
15527   echo "$as_me:15527: \$? = $ac_status" >&5
15528   (exit $ac_status); } &&
15529          { ac_try='test -s conftest.$ac_objext'
15530   { (eval echo "$as_me:15530: \"$ac_try\"") >&5
15531   (eval $ac_try) 2>&5
15532   ac_status=$?
15533   echo "$as_me:15533: \$? = $ac_status" >&5
15534   (exit $ac_status); }; }; then
15535   cf_cv_term_header=$cf_header
15536                          break
15537 else
15538   echo "$as_me: failed program was:" >&5
15539 cat conftest.$ac_ext >&5
15540 cf_cv_term_header=no
15541 fi
15542 rm -f conftest.$ac_objext conftest.$ac_ext
15543         done
15544         ;;
15545 esac
15546
15547 fi
15548 echo "$as_me:15548: result: $cf_cv_term_header" >&5
15549 echo "${ECHO_T}$cf_cv_term_header" >&6
15550
15551 case $cf_cv_term_header in
15552 (term.h)
15553
15554 cat >>confdefs.h <<\EOF
15555 #define HAVE_TERM_H 1
15556 EOF
15557
15558         ;;
15559 (ncurses/term.h)
15560
15561 cat >>confdefs.h <<\EOF
15562 #define HAVE_NCURSES_TERM_H 1
15563 EOF
15564
15565         ;;
15566 (ncursesw/term.h)
15567
15568 cat >>confdefs.h <<\EOF
15569 #define HAVE_NCURSESW_TERM_H 1
15570 EOF
15571
15572         ;;
15573 esac
15574
15575 echo "$as_me:15575: checking for unctrl.h" >&5
15576 echo $ECHO_N "checking for unctrl.h... $ECHO_C" >&6
15577 if test "${cf_cv_unctrl_header+set}" = set; then
15578   echo $ECHO_N "(cached) $ECHO_C" >&6
15579 else
15580
15581 # If we found <ncurses/curses.h>, look for <ncurses/unctrl.h>, but always look
15582 # for <unctrl.h> if we do not find the variant.
15583
15584 cf_header_list="unctrl.h ncurses/unctrl.h ncursesw/unctrl.h"
15585
15586 case ${cf_cv_ncurses_header:-curses.h} in
15587 (*/*)
15588         cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`unctrl.h
15589         cf_header_list="$cf_header_item $cf_header_list"
15590         ;;
15591 esac
15592
15593 for cf_header in $cf_header_list
15594 do
15595         cat >conftest.$ac_ext <<_ACEOF
15596 #line 15596 "configure"
15597 #include "confdefs.h"
15598
15599 #include <${cf_cv_ncurses_header:-curses.h}>
15600 #include <${cf_header}>
15601 int
15602 main (void)
15603 {
15604 WINDOW *x
15605   ;
15606   return 0;
15607 }
15608 _ACEOF
15609 rm -f conftest.$ac_objext
15610 if { (eval echo "$as_me:15610: \"$ac_compile\"") >&5
15611   (eval $ac_compile) 2>&5
15612   ac_status=$?
15613   echo "$as_me:15613: \$? = $ac_status" >&5
15614   (exit $ac_status); } &&
15615          { ac_try='test -s conftest.$ac_objext'
15616   { (eval echo "$as_me:15616: \"$ac_try\"") >&5
15617   (eval $ac_try) 2>&5
15618   ac_status=$?
15619   echo "$as_me:15619: \$? = $ac_status" >&5
15620   (exit $ac_status); }; }; then
15621   cf_cv_unctrl_header=$cf_header
15622          break
15623 else
15624   echo "$as_me: failed program was:" >&5
15625 cat conftest.$ac_ext >&5
15626 cf_cv_unctrl_header=no
15627 fi
15628 rm -f conftest.$ac_objext conftest.$ac_ext
15629 done
15630
15631 fi
15632 echo "$as_me:15632: result: $cf_cv_unctrl_header" >&5
15633 echo "${ECHO_T}$cf_cv_unctrl_header" >&6
15634
15635 case $cf_cv_unctrl_header in
15636 (no)
15637         { echo "$as_me:15637: WARNING: unctrl.h header not found" >&5
15638 echo "$as_me: WARNING: unctrl.h header not found" >&2;}
15639         ;;
15640 esac
15641
15642 case $cf_cv_unctrl_header in
15643 (unctrl.h)
15644
15645 cat >>confdefs.h <<\EOF
15646 #define HAVE_UNCTRL_H 1
15647 EOF
15648
15649         ;;
15650 (ncurses/unctrl.h)
15651
15652 cat >>confdefs.h <<\EOF
15653 #define HAVE_NCURSES_UNCTRL_H 1
15654 EOF
15655
15656         ;;
15657 (ncursesw/unctrl.h)
15658
15659 cat >>confdefs.h <<\EOF
15660 #define HAVE_NCURSESW_UNCTRL_H 1
15661 EOF
15662
15663         ;;
15664 esac
15665
15666 for cf_func in \
15667 alloc_pair \
15668 assume_default_colors \
15669 chgat \
15670 color_content \
15671 color_set \
15672 copywin \
15673 delscreen \
15674 dupwin \
15675 filter \
15676 getbegx \
15677 getcurx \
15678 getmaxx \
15679 getnstr \
15680 getparx \
15681 getwin \
15682 halfdelay \
15683 init_extended_color \
15684 mvderwin \
15685 mvvline \
15686 mvwin \
15687 mvwvline \
15688 napms \
15689 newpad \
15690 putwin \
15691 reset_color_pairs \
15692 resize_term \
15693 resizeterm \
15694 restartterm \
15695 ripoffline \
15696 scr_dump \
15697 setupterm \
15698 slk_color \
15699 slk_init \
15700 termattrs \
15701 tgetent \
15702 tigetnum \
15703 tigetstr \
15704 tputs_sp \
15705 typeahead \
15706 use_default_colors \
15707 use_env \
15708 use_extended_names \
15709 use_screen \
15710 use_window \
15711 vid_puts \
15712 vidputs \
15713 vsscanf \
15714 vw_printw \
15715 wchgat \
15716 winsdelln \
15717 winsstr \
15718 wresize \
15719 wsyncdown \
15720 _tracef \
15721
15722 do
15723
15724 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15725
15726         echo "$as_me:15726: checking for ${cf_func}" >&5
15727 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
15728
15729 echo "${as_me:-configure}:15729: testing ${cf_func} ..." 1>&5
15730
15731         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
15732   echo $ECHO_N "(cached) $ECHO_C" >&6
15733 else
15734
15735                 eval cf_result='$ac_cv_func_'$cf_func
15736                 if test ".$cf_result" != ".no"; then
15737                         cat >conftest.$ac_ext <<_ACEOF
15738 #line 15738 "configure"
15739 #include "confdefs.h"
15740
15741 #ifdef HAVE_XCURSES
15742 #include <xcurses.h>
15743 char * XCursesProgramName = "test";
15744 #else
15745 #include <${cf_cv_ncurses_header:-curses.h}>
15746 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
15747 #include <ncursesw/term.h>
15748 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
15749 #include <ncurses/term.h>
15750 #elif defined(HAVE_TERM_H)
15751 #include <term.h>
15752 #endif
15753 #endif
15754
15755 int
15756 main (void)
15757 {
15758
15759 #ifndef ${cf_func}
15760 long foo = (long)(&${cf_func});
15761 fprintf(stderr, "testing linkage of $cf_func:%p\n", foo);
15762 if (foo + 1234 > 5678)
15763         ${cf_cv_main_return:-return}(foo);
15764 #endif
15765
15766   ;
15767   return 0;
15768 }
15769 _ACEOF
15770 rm -f conftest.$ac_objext conftest$ac_exeext
15771 if { (eval echo "$as_me:15771: \"$ac_link\"") >&5
15772   (eval $ac_link) 2>&5
15773   ac_status=$?
15774   echo "$as_me:15774: \$? = $ac_status" >&5
15775   (exit $ac_status); } &&
15776          { ac_try='test -s conftest$ac_exeext'
15777   { (eval echo "$as_me:15777: \"$ac_try\"") >&5
15778   (eval $ac_try) 2>&5
15779   ac_status=$?
15780   echo "$as_me:15780: \$? = $ac_status" >&5
15781   (exit $ac_status); }; }; then
15782   cf_result=yes
15783 else
15784   echo "$as_me: failed program was:" >&5
15785 cat conftest.$ac_ext >&5
15786 cf_result=no
15787 fi
15788 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15789                 fi
15790                 eval 'cf_cv_func_'$cf_func'=$cf_result'
15791
15792 fi
15793
15794         # use the computed/retrieved cache-value:
15795         eval 'cf_result=$cf_cv_func_'$cf_func
15796         echo "$as_me:15796: result: $cf_result" >&5
15797 echo "${ECHO_T}$cf_result" >&6
15798         if test $cf_result != no; then
15799                 cat >>confdefs.h <<EOF
15800 #define HAVE_${cf_tr_func} 1
15801 EOF
15802
15803         fi
15804 done
15805
15806 for cf_func in tputs
15807 do
15808
15809 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15810
15811         echo "$as_me:15811: checking for ${cf_func}" >&5
15812 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
15813
15814 echo "${as_me:-configure}:15814: testing ${cf_func} ..." 1>&5
15815
15816         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
15817   echo $ECHO_N "(cached) $ECHO_C" >&6
15818 else
15819
15820                 eval cf_result='$ac_cv_func_'$cf_func
15821                 if test ".$cf_result" != ".no"; then
15822                         cat >conftest.$ac_ext <<_ACEOF
15823 #line 15823 "configure"
15824 #include "confdefs.h"
15825
15826 #ifdef HAVE_XCURSES
15827 #include <xcurses.h>
15828 char * XCursesProgramName = "test";
15829 #else
15830 #include <${cf_cv_ncurses_header:-curses.h}>
15831 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
15832 #include <ncursesw/term.h>
15833 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
15834 #include <ncurses/term.h>
15835 #elif defined(HAVE_TERM_H)
15836 #include <term.h>
15837 #endif
15838 #endif
15839
15840 int
15841 main (void)
15842 {
15843
15844 #ifndef ${cf_func}
15845 long foo = (long)(&${cf_func});
15846 fprintf(stderr, "testing linkage of $cf_func:%p\n", foo);
15847 if (foo + 1234 > 5678)
15848         ${cf_cv_main_return:-return}(foo);
15849 #endif
15850
15851   ;
15852   return 0;
15853 }
15854 _ACEOF
15855 rm -f conftest.$ac_objext conftest$ac_exeext
15856 if { (eval echo "$as_me:15856: \"$ac_link\"") >&5
15857   (eval $ac_link) 2>&5
15858   ac_status=$?
15859   echo "$as_me:15859: \$? = $ac_status" >&5
15860   (exit $ac_status); } &&
15861          { ac_try='test -s conftest$ac_exeext'
15862   { (eval echo "$as_me:15862: \"$ac_try\"") >&5
15863   (eval $ac_try) 2>&5
15864   ac_status=$?
15865   echo "$as_me:15865: \$? = $ac_status" >&5
15866   (exit $ac_status); }; }; then
15867   cf_result=yes
15868 else
15869   echo "$as_me: failed program was:" >&5
15870 cat conftest.$ac_ext >&5
15871 cf_result=no
15872 fi
15873 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15874                 fi
15875                 eval 'cf_cv_func_'$cf_func'=$cf_result'
15876
15877 fi
15878
15879         # use the computed/retrieved cache-value:
15880         eval 'cf_result=$cf_cv_func_'$cf_func
15881         echo "$as_me:15881: result: $cf_result" >&5
15882 echo "${ECHO_T}$cf_result" >&6
15883         if test $cf_result != no; then
15884                 cat >>confdefs.h <<EOF
15885 #define HAVE_${cf_tr_func} 1
15886 EOF
15887
15888         fi
15889 done
15890
15891 if test x$cf_cv_func_tputs = xyes
15892 then
15893         cf_done=no
15894         for cf_arg in int char
15895         do
15896                 for cf_ret in int void
15897                 do
15898                         if test $cf_ret = void
15899                         then
15900                                 cf_return="/* nothing */"
15901                         else
15902                                 cf_return="return value"
15903                         fi
15904                         cat >conftest.$ac_ext <<_ACEOF
15905 #line 15905 "configure"
15906 #include "confdefs.h"
15907
15908 #include <${cf_cv_ncurses_header:-curses.h}>
15909 #include <$cf_cv_term_header>
15910
15911 static $cf_ret outc($cf_arg value) { $cf_return; }
15912
15913 int
15914 main (void)
15915 {
15916
15917         tputs("hello", 0, outc);
15918         ${cf_cv_main_return:-return}(0);
15919
15920   ;
15921   return 0;
15922 }
15923 _ACEOF
15924 rm -f conftest.$ac_objext
15925 if { (eval echo "$as_me:15925: \"$ac_compile\"") >&5
15926   (eval $ac_compile) 2>&5
15927   ac_status=$?
15928   echo "$as_me:15928: \$? = $ac_status" >&5
15929   (exit $ac_status); } &&
15930          { ac_try='test -s conftest.$ac_objext'
15931   { (eval echo "$as_me:15931: \"$ac_try\"") >&5
15932   (eval $ac_try) 2>&5
15933   ac_status=$?
15934   echo "$as_me:15934: \$? = $ac_status" >&5
15935   (exit $ac_status); }; }; then
15936
15937                 test -n "$verbose" && echo "    prototype $cf_ret func($cf_arg value)" 1>&6
15938
15939 echo "${as_me:-configure}:15939: testing prototype $cf_ret func($cf_arg value) ..." 1>&5
15940
15941                 cat >>confdefs.h <<EOF
15942 #define TPUTS_ARG               $cf_arg
15943 #define TPUTS_PROTO(func,value) $cf_ret func(TPUTS_ARG value)
15944 #define TPUTS_RETURN(value)     $cf_return
15945 EOF
15946                 cf_done=yes
15947                 break
15948
15949 else
15950   echo "$as_me: failed program was:" >&5
15951 cat conftest.$ac_ext >&5
15952 fi
15953 rm -f conftest.$ac_objext conftest.$ac_ext
15954                 done
15955                 test $cf_done = yes && break
15956         done
15957 fi
15958
15959 echo "$as_me:15959: checking for ncurses extended functions" >&5
15960 echo $ECHO_N "checking for ncurses extended functions... $ECHO_C" >&6
15961 if test "${cf_cv_ncurses_ext_funcs+set}" = set; then
15962   echo $ECHO_N "(cached) $ECHO_C" >&6
15963 else
15964
15965 cat >conftest.$ac_ext <<_ACEOF
15966 #line 15966 "configure"
15967 #include "confdefs.h"
15968
15969 #include <${cf_cv_ncurses_header:-curses.h}>
15970 int
15971 main (void)
15972 {
15973
15974 int x = NCURSES_EXT_FUNCS
15975
15976   ;
15977   return 0;
15978 }
15979 _ACEOF
15980 rm -f conftest.$ac_objext
15981 if { (eval echo "$as_me:15981: \"$ac_compile\"") >&5
15982   (eval $ac_compile) 2>&5
15983   ac_status=$?
15984   echo "$as_me:15984: \$? = $ac_status" >&5
15985   (exit $ac_status); } &&
15986          { ac_try='test -s conftest.$ac_objext'
15987   { (eval echo "$as_me:15987: \"$ac_try\"") >&5
15988   (eval $ac_try) 2>&5
15989   ac_status=$?
15990   echo "$as_me:15990: \$? = $ac_status" >&5
15991   (exit $ac_status); }; }; then
15992   cf_cv_ncurses_ext_funcs=defined
15993 else
15994   echo "$as_me: failed program was:" >&5
15995 cat conftest.$ac_ext >&5
15996
15997 cat >conftest.$ac_ext <<_ACEOF
15998 #line 15998 "configure"
15999 #include "confdefs.h"
16000
16001 #include <${cf_cv_ncurses_header:-curses.h}>
16002 int
16003 main (void)
16004 {
16005
16006         (void) assume_default_colors (0, 0);
16007         (void) curses_version ();
16008         (void) define_key (0, 0);
16009         (void) is_term_resized (0, 0);
16010         (void) key_defined (0);
16011         (void) keybound (0, 0);
16012         (void) keyok (0, 0);
16013         (void) resize_term (0, 0);
16014         (void) resizeterm (0, 0);
16015         (void) use_default_colors ();
16016         (void) use_extended_names (0);
16017         (void) wresize (0, 0, 0);
16018   ;
16019   return 0;
16020 }
16021 _ACEOF
16022 rm -f conftest.$ac_objext conftest$ac_exeext
16023 if { (eval echo "$as_me:16023: \"$ac_link\"") >&5
16024   (eval $ac_link) 2>&5
16025   ac_status=$?
16026   echo "$as_me:16026: \$? = $ac_status" >&5
16027   (exit $ac_status); } &&
16028          { ac_try='test -s conftest$ac_exeext'
16029   { (eval echo "$as_me:16029: \"$ac_try\"") >&5
16030   (eval $ac_try) 2>&5
16031   ac_status=$?
16032   echo "$as_me:16032: \$? = $ac_status" >&5
16033   (exit $ac_status); }; }; then
16034   cf_cv_ncurses_ext_funcs=yes
16035 else
16036   echo "$as_me: failed program was:" >&5
16037 cat conftest.$ac_ext >&5
16038 cf_cv_ncurses_ext_funcs=no
16039 fi
16040 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16041
16042 fi
16043 rm -f conftest.$ac_objext conftest.$ac_ext
16044
16045 fi
16046 echo "$as_me:16046: result: $cf_cv_ncurses_ext_funcs" >&5
16047 echo "${ECHO_T}$cf_cv_ncurses_ext_funcs" >&6
16048 test "$cf_cv_ncurses_ext_funcs" = yes &&
16049 cat >>confdefs.h <<\EOF
16050 #define NCURSES_EXT_FUNCS 1
16051 EOF
16052
16053 if test "$cf_enable_widec" = yes
16054 then
16055         # workaround for systems with ncurses before 20111029, due to change of
16056         # feature test macro from _XPG5 to _XOPEN_SOURCE
16057         if test -n "$cf_cv_ncurses_version" && test "x$cf_cv_ncurses_version" != xno
16058         then
16059                 cf_define_xpg5=no
16060                 echo "$as_me:16060: checking if _XPG5 should be defined to enable wide-characters" >&5
16061 echo $ECHO_N "checking if _XPG5 should be defined to enable wide-characters... $ECHO_C" >&6
16062
16063                 cat >conftest.$ac_ext <<_ACEOF
16064 #line 16064 "configure"
16065 #include "confdefs.h"
16066
16067 #include <${cf_cv_ncurses_header:-curses.h}>
16068 int
16069 main (void)
16070 {
16071 int x = _XPG5
16072   ;
16073   return 0;
16074 }
16075 _ACEOF
16076 rm -f conftest.$ac_objext
16077 if { (eval echo "$as_me:16077: \"$ac_compile\"") >&5
16078   (eval $ac_compile) 2>&5
16079   ac_status=$?
16080   echo "$as_me:16080: \$? = $ac_status" >&5
16081   (exit $ac_status); } &&
16082          { ac_try='test -s conftest.$ac_objext'
16083   { (eval echo "$as_me:16083: \"$ac_try\"") >&5
16084   (eval $ac_try) 2>&5
16085   ac_status=$?
16086   echo "$as_me:16086: \$? = $ac_status" >&5
16087   (exit $ac_status); }; }; then
16088   :
16089 else
16090   echo "$as_me: failed program was:" >&5
16091 cat conftest.$ac_ext >&5
16092 cf_save_cppflags="$CPPFLAGS"
16093                          CPPFLAGS="$CPPFLAGS -D_XPG5"
16094                          cat >conftest.$ac_ext <<_ACEOF
16095 #line 16095 "configure"
16096 #include "confdefs.h"
16097
16098 #include <${cf_cv_ncurses_header:-curses.h}>
16099 int
16100 main (void)
16101 {
16102 int x = _XPG5
16103   ;
16104   return 0;
16105 }
16106 _ACEOF
16107 rm -f conftest.$ac_objext
16108 if { (eval echo "$as_me:16108: \"$ac_compile\"") >&5
16109   (eval $ac_compile) 2>&5
16110   ac_status=$?
16111   echo "$as_me:16111: \$? = $ac_status" >&5
16112   (exit $ac_status); } &&
16113          { ac_try='test -s conftest.$ac_objext'
16114   { (eval echo "$as_me:16114: \"$ac_try\"") >&5
16115   (eval $ac_try) 2>&5
16116   ac_status=$?
16117   echo "$as_me:16117: \$? = $ac_status" >&5
16118   (exit $ac_status); }; }; then
16119   cf_define_xpg5=yes
16120 else
16121   echo "$as_me: failed program was:" >&5
16122 cat conftest.$ac_ext >&5
16123 fi
16124 rm -f conftest.$ac_objext conftest.$ac_ext
16125                          CPPFLAGS="$cf_save_cppflags"
16126 fi
16127 rm -f conftest.$ac_objext conftest.$ac_ext
16128                 echo "$as_me:16128: result: $cf_define_xpg5" >&5
16129 echo "${ECHO_T}$cf_define_xpg5" >&6
16130
16131                 if test "$cf_define_xpg5" = yes
16132                 then
16133                         CPPFLAGS="$CPPFLAGS -D_XPG5"
16134                 fi
16135         fi
16136
16137         echo "$as_me:16137: checking for wide-character functions" >&5
16138 echo $ECHO_N "checking for wide-character functions... $ECHO_C" >&6
16139 if test "${cf_cv_widechar_funcs+set}" = set; then
16140   echo $ECHO_N "(cached) $ECHO_C" >&6
16141 else
16142
16143         cat >conftest.$ac_ext <<_ACEOF
16144 #line 16144 "configure"
16145 #include "confdefs.h"
16146
16147 #include <${cf_cv_ncurses_header:-curses.h}>
16148 int
16149 main (void)
16150 {
16151
16152                 static wchar_t src_wchar[2];
16153                 static cchar_t dst_cchar;
16154                 setcchar(&dst_cchar, src_wchar, A_NORMAL, 0, (void *) 0);
16155
16156   ;
16157   return 0;
16158 }
16159 _ACEOF
16160 rm -f conftest.$ac_objext conftest$ac_exeext
16161 if { (eval echo "$as_me:16161: \"$ac_link\"") >&5
16162   (eval $ac_link) 2>&5
16163   ac_status=$?
16164   echo "$as_me:16164: \$? = $ac_status" >&5
16165   (exit $ac_status); } &&
16166          { ac_try='test -s conftest$ac_exeext'
16167   { (eval echo "$as_me:16167: \"$ac_try\"") >&5
16168   (eval $ac_try) 2>&5
16169   ac_status=$?
16170   echo "$as_me:16170: \$? = $ac_status" >&5
16171   (exit $ac_status); }; }; then
16172   cf_cv_widechar_funcs=yes
16173 else
16174   echo "$as_me: failed program was:" >&5
16175 cat conftest.$ac_ext >&5
16176 cf_cv_widechar_funcs=no
16177 fi
16178 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16179
16180 fi
16181 echo "$as_me:16181: result: $cf_cv_widechar_funcs" >&5
16182 echo "${ECHO_T}$cf_cv_widechar_funcs" >&6
16183         if test "$cf_cv_widechar_funcs" != no ; then
16184
16185 cat >>confdefs.h <<\EOF
16186 #define USE_WIDEC_SUPPORT 1
16187 EOF
16188
16189         else
16190                 cat >>confdefs.h <<\EOF
16191 #define USE_WIDEC_SUPPORT 0
16192 EOF
16193
16194         fi
16195 else
16196         cat >>confdefs.h <<\EOF
16197 #define USE_WIDEC_SUPPORT 0
16198 EOF
16199
16200 fi
16201
16202 echo "$as_me:16202: checking if $cf_cv_screen library uses pthreads" >&5
16203 echo $ECHO_N "checking if $cf_cv_screen library uses pthreads... $ECHO_C" >&6
16204 if test "${cf_cv_use_pthreads+set}" = set; then
16205   echo $ECHO_N "(cached) $ECHO_C" >&6
16206 else
16207
16208 cat >conftest.$ac_ext <<_ACEOF
16209 #line 16209 "configure"
16210 #include "confdefs.h"
16211
16212 #include <${cf_cv_ncurses_header:-curses.h}>
16213 extern void _nc_init_pthreads(void);
16214
16215 int
16216 main (void)
16217 {
16218
16219         initscr();
16220         _nc_init_pthreads();
16221
16222   ;
16223   return 0;
16224 }
16225 _ACEOF
16226 rm -f conftest.$ac_objext conftest$ac_exeext
16227 if { (eval echo "$as_me:16227: \"$ac_link\"") >&5
16228   (eval $ac_link) 2>&5
16229   ac_status=$?
16230   echo "$as_me:16230: \$? = $ac_status" >&5
16231   (exit $ac_status); } &&
16232          { ac_try='test -s conftest$ac_exeext'
16233   { (eval echo "$as_me:16233: \"$ac_try\"") >&5
16234   (eval $ac_try) 2>&5
16235   ac_status=$?
16236   echo "$as_me:16236: \$? = $ac_status" >&5
16237   (exit $ac_status); }; }; then
16238   cf_cv_use_pthreads=yes
16239 else
16240   echo "$as_me: failed program was:" >&5
16241 cat conftest.$ac_ext >&5
16242 cf_cv_use_pthreads=no
16243 fi
16244 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16245
16246 fi
16247 echo "$as_me:16247: result: $cf_cv_use_pthreads" >&5
16248 echo "${ECHO_T}$cf_cv_use_pthreads" >&6
16249 test $cf_cv_use_pthreads = yes && cat >>confdefs.h <<\EOF
16250 #define USE_PTHREADS 1
16251 EOF
16252
16253 echo "$as_me:16253: checking if sys/time.h works with sys/select.h" >&5
16254 echo $ECHO_N "checking if sys/time.h works with sys/select.h... $ECHO_C" >&6
16255 if test "${cf_cv_sys_time_select+set}" = set; then
16256   echo $ECHO_N "(cached) $ECHO_C" >&6
16257 else
16258
16259 cat >conftest.$ac_ext <<_ACEOF
16260 #line 16260 "configure"
16261 #include "confdefs.h"
16262
16263 #include <sys/types.h>
16264 #ifdef HAVE_SYS_TIME_H
16265 #include <sys/time.h>
16266 #endif
16267 #ifdef HAVE_SYS_SELECT_H
16268 #include <sys/select.h>
16269 #endif
16270
16271 int
16272 main (void)
16273 {
16274
16275   ;
16276   return 0;
16277 }
16278 _ACEOF
16279 rm -f conftest.$ac_objext
16280 if { (eval echo "$as_me:16280: \"$ac_compile\"") >&5
16281   (eval $ac_compile) 2>&5
16282   ac_status=$?
16283   echo "$as_me:16283: \$? = $ac_status" >&5
16284   (exit $ac_status); } &&
16285          { ac_try='test -s conftest.$ac_objext'
16286   { (eval echo "$as_me:16286: \"$ac_try\"") >&5
16287   (eval $ac_try) 2>&5
16288   ac_status=$?
16289   echo "$as_me:16289: \$? = $ac_status" >&5
16290   (exit $ac_status); }; }; then
16291   cf_cv_sys_time_select=yes
16292 else
16293   echo "$as_me: failed program was:" >&5
16294 cat conftest.$ac_ext >&5
16295 cf_cv_sys_time_select=no
16296 fi
16297 rm -f conftest.$ac_objext conftest.$ac_ext
16298
16299 fi
16300
16301 echo "$as_me:16301: result: $cf_cv_sys_time_select" >&5
16302 echo "${ECHO_T}$cf_cv_sys_time_select" >&6
16303 test "$cf_cv_sys_time_select" = yes &&
16304 cat >>confdefs.h <<\EOF
16305 #define HAVE_SYS_TIME_SELECT 1
16306 EOF
16307
16308 # special check for test/ditto.c
16309
16310 echo "$as_me:16310: checking for openpty in -lutil" >&5
16311 echo $ECHO_N "checking for openpty in -lutil... $ECHO_C" >&6
16312 if test "${ac_cv_lib_util_openpty+set}" = set; then
16313   echo $ECHO_N "(cached) $ECHO_C" >&6
16314 else
16315   ac_check_lib_save_LIBS=$LIBS
16316 LIBS="-lutil  $LIBS"
16317 cat >conftest.$ac_ext <<_ACEOF
16318 #line 16318 "configure"
16319 #include "confdefs.h"
16320
16321 /* Override any gcc2 internal prototype to avoid an error.  */
16322 #ifdef __cplusplus
16323 extern "C"
16324 #endif
16325 /* We use char because int might match the return type of a gcc2
16326    builtin and then its argument prototype would still apply.  */
16327 char openpty ();
16328 int
16329 main (void)
16330 {
16331 openpty ();
16332   ;
16333   return 0;
16334 }
16335 _ACEOF
16336 rm -f conftest.$ac_objext conftest$ac_exeext
16337 if { (eval echo "$as_me:16337: \"$ac_link\"") >&5
16338   (eval $ac_link) 2>&5
16339   ac_status=$?
16340   echo "$as_me:16340: \$? = $ac_status" >&5
16341   (exit $ac_status); } &&
16342          { ac_try='test -s conftest$ac_exeext'
16343   { (eval echo "$as_me:16343: \"$ac_try\"") >&5
16344   (eval $ac_try) 2>&5
16345   ac_status=$?
16346   echo "$as_me:16346: \$? = $ac_status" >&5
16347   (exit $ac_status); }; }; then
16348   ac_cv_lib_util_openpty=yes
16349 else
16350   echo "$as_me: failed program was:" >&5
16351 cat conftest.$ac_ext >&5
16352 ac_cv_lib_util_openpty=no
16353 fi
16354 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16355 LIBS=$ac_check_lib_save_LIBS
16356 fi
16357 echo "$as_me:16357: result: $ac_cv_lib_util_openpty" >&5
16358 echo "${ECHO_T}$ac_cv_lib_util_openpty" >&6
16359 if test $ac_cv_lib_util_openpty = yes; then
16360   cf_cv_lib_util=yes
16361 else
16362   cf_cv_lib_util=no
16363 fi
16364
16365 echo "$as_me:16365: checking for openpty header" >&5
16366 echo $ECHO_N "checking for openpty header... $ECHO_C" >&6
16367 if test "${cf_cv_func_openpty+set}" = set; then
16368   echo $ECHO_N "(cached) $ECHO_C" >&6
16369 else
16370
16371         cf_save_LIBS="$LIBS"
16372         test $cf_cv_lib_util = yes && {
16373 cf_add_libs="-lutil"
16374 # Filter out duplicates - this happens with badly-designed ".pc" files...
16375 for cf_add_1lib in $LIBS
16376 do
16377         for cf_add_2lib in $cf_add_libs
16378         do
16379                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
16380                 then
16381                         cf_add_1lib=
16382                         break
16383                 fi
16384         done
16385         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
16386 done
16387 LIBS="$cf_add_libs"
16388  }
16389         for cf_header in pty.h libutil.h util.h
16390         do
16391         cat >conftest.$ac_ext <<_ACEOF
16392 #line 16392 "configure"
16393 #include "confdefs.h"
16394
16395 #include <$cf_header>
16396
16397 int
16398 main (void)
16399 {
16400
16401         int x = openpty((int *)0, (int *)0, (char *)0,
16402                                    (struct termios *)0, (struct winsize *)0);
16403
16404   ;
16405   return 0;
16406 }
16407 _ACEOF
16408 rm -f conftest.$ac_objext conftest$ac_exeext
16409 if { (eval echo "$as_me:16409: \"$ac_link\"") >&5
16410   (eval $ac_link) 2>&5
16411   ac_status=$?
16412   echo "$as_me:16412: \$? = $ac_status" >&5
16413   (exit $ac_status); } &&
16414          { ac_try='test -s conftest$ac_exeext'
16415   { (eval echo "$as_me:16415: \"$ac_try\"") >&5
16416   (eval $ac_try) 2>&5
16417   ac_status=$?
16418   echo "$as_me:16418: \$? = $ac_status" >&5
16419   (exit $ac_status); }; }; then
16420
16421                 cf_cv_func_openpty=$cf_header
16422                 break
16423
16424 else
16425   echo "$as_me: failed program was:" >&5
16426 cat conftest.$ac_ext >&5
16427
16428                 cf_cv_func_openpty=no
16429
16430 fi
16431 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16432         done
16433         LIBS="$cf_save_LIBS"
16434
16435 fi
16436 echo "$as_me:16436: result: $cf_cv_func_openpty" >&5
16437 echo "${ECHO_T}$cf_cv_func_openpty" >&6
16438
16439 if test "$cf_cv_func_openpty" != no ; then
16440
16441 cat >>confdefs.h <<EOF
16442 #define USE_OPENPTY_HEADER <$cf_cv_func_openpty>
16443 EOF
16444
16445 cat >>confdefs.h <<\EOF
16446 #define USE_XTERM_PTY 1
16447 EOF
16448
16449         if test "x$cf_cv_lib_util" = xyes ; then
16450
16451 cf_add_libs="-lutil"
16452 # Filter out duplicates - this happens with badly-designed ".pc" files...
16453 for cf_add_1lib in $TEST_LIBS
16454 do
16455         for cf_add_2lib in $cf_add_libs
16456         do
16457                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
16458                 then
16459                         cf_add_1lib=
16460                         break
16461                 fi
16462         done
16463         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
16464 done
16465 TEST_LIBS="$cf_add_libs"
16466
16467         fi
16468 fi
16469
16470 echo "$as_me:16470: checking for function curses_version" >&5
16471 echo $ECHO_N "checking for function curses_version... $ECHO_C" >&6
16472 if test "${cf_cv_func_curses_version+set}" = set; then
16473   echo $ECHO_N "(cached) $ECHO_C" >&6
16474 else
16475
16476 if test "$cross_compiling" = yes; then
16477   cf_cv_func_curses_version=unknown
16478 else
16479   cat >conftest.$ac_ext <<_ACEOF
16480 #line 16480 "configure"
16481 #include "confdefs.h"
16482
16483 #include <${cf_cv_ncurses_header:-curses.h}>
16484 int main(void)
16485 {
16486         char temp[1024];
16487         sprintf(temp, "%s\n", curses_version());
16488         ${cf_cv_main_return:-return}(0);
16489 }
16490
16491 _ACEOF
16492 rm -f conftest$ac_exeext
16493 if { (eval echo "$as_me:16493: \"$ac_link\"") >&5
16494   (eval $ac_link) 2>&5
16495   ac_status=$?
16496   echo "$as_me:16496: \$? = $ac_status" >&5
16497   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
16498   { (eval echo "$as_me:16498: \"$ac_try\"") >&5
16499   (eval $ac_try) 2>&5
16500   ac_status=$?
16501   echo "$as_me:16501: \$? = $ac_status" >&5
16502   (exit $ac_status); }; }; then
16503   cf_cv_func_curses_version=yes
16504
16505 else
16506   echo "$as_me: program exited with status $ac_status" >&5
16507 echo "$as_me: failed program was:" >&5
16508 cat conftest.$ac_ext >&5
16509 cf_cv_func_curses_version=no
16510
16511 fi
16512 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
16513 fi
16514 rm -f core
16515 fi
16516 echo "$as_me:16516: result: $cf_cv_func_curses_version" >&5
16517 echo "${ECHO_T}$cf_cv_func_curses_version" >&6
16518 test "$cf_cv_func_curses_version" = yes &&
16519 cat >>confdefs.h <<\EOF
16520 #define HAVE_CURSES_VERSION 1
16521 EOF
16522
16523 echo "$as_me:16523: checking for alternate character set array" >&5
16524 echo $ECHO_N "checking for alternate character set array... $ECHO_C" >&6
16525 if test "${cf_cv_curses_acs_map+set}" = set; then
16526   echo $ECHO_N "(cached) $ECHO_C" >&6
16527 else
16528
16529 cf_cv_curses_acs_map=unknown
16530 for name in acs_map _acs_map __acs_map ${NCURSES_WRAP_PREFIX}acs_map
16531 do
16532 cat >conftest.$ac_ext <<_ACEOF
16533 #line 16533 "configure"
16534 #include "confdefs.h"
16535
16536 #include <${cf_cv_ncurses_header:-curses.h}>
16537
16538 int
16539 main (void)
16540 {
16541
16542 $name['k'] = ACS_PLUS
16543
16544   ;
16545   return 0;
16546 }
16547 _ACEOF
16548 rm -f conftest.$ac_objext conftest$ac_exeext
16549 if { (eval echo "$as_me:16549: \"$ac_link\"") >&5
16550   (eval $ac_link) 2>&5
16551   ac_status=$?
16552   echo "$as_me:16552: \$? = $ac_status" >&5
16553   (exit $ac_status); } &&
16554          { ac_try='test -s conftest$ac_exeext'
16555   { (eval echo "$as_me:16555: \"$ac_try\"") >&5
16556   (eval $ac_try) 2>&5
16557   ac_status=$?
16558   echo "$as_me:16558: \$? = $ac_status" >&5
16559   (exit $ac_status); }; }; then
16560   cf_cv_curses_acs_map=$name; break
16561 else
16562   echo "$as_me: failed program was:" >&5
16563 cat conftest.$ac_ext >&5
16564 fi
16565 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16566 done
16567
16568 fi
16569 echo "$as_me:16569: result: $cf_cv_curses_acs_map" >&5
16570 echo "${ECHO_T}$cf_cv_curses_acs_map" >&6
16571
16572 test "$cf_cv_curses_acs_map" != unknown &&
16573 cat >>confdefs.h <<EOF
16574 #define CURSES_ACS_ARRAY $cf_cv_curses_acs_map
16575 EOF
16576
16577 if test "$cf_enable_widec" = yes; then
16578
16579 echo "$as_me:16579: checking for wide alternate character set array" >&5
16580 echo $ECHO_N "checking for wide alternate character set array... $ECHO_C" >&6
16581 if test "${cf_cv_curses_wacs_map+set}" = set; then
16582   echo $ECHO_N "(cached) $ECHO_C" >&6
16583 else
16584
16585         cf_cv_curses_wacs_map=unknown
16586         for name in wacs_map _wacs_map __wacs_map _nc_wacs _wacs_char
16587         do
16588         cat >conftest.$ac_ext <<_ACEOF
16589 #line 16589 "configure"
16590 #include "confdefs.h"
16591
16592 #ifndef _XOPEN_SOURCE_EXTENDED
16593 #define _XOPEN_SOURCE_EXTENDED
16594 #endif
16595 #include <${cf_cv_ncurses_header:-curses.h}>
16596 int
16597 main (void)
16598 {
16599 void *foo = &($name['k'])
16600   ;
16601   return 0;
16602 }
16603 _ACEOF
16604 rm -f conftest.$ac_objext conftest$ac_exeext
16605 if { (eval echo "$as_me:16605: \"$ac_link\"") >&5
16606   (eval $ac_link) 2>&5
16607   ac_status=$?
16608   echo "$as_me:16608: \$? = $ac_status" >&5
16609   (exit $ac_status); } &&
16610          { ac_try='test -s conftest$ac_exeext'
16611   { (eval echo "$as_me:16611: \"$ac_try\"") >&5
16612   (eval $ac_try) 2>&5
16613   ac_status=$?
16614   echo "$as_me:16614: \$? = $ac_status" >&5
16615   (exit $ac_status); }; }; then
16616   cf_cv_curses_wacs_map=$name
16617          break
16618 else
16619   echo "$as_me: failed program was:" >&5
16620 cat conftest.$ac_ext >&5
16621 fi
16622 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16623         done
16624 fi
16625 echo "$as_me:16625: result: $cf_cv_curses_wacs_map" >&5
16626 echo "${ECHO_T}$cf_cv_curses_wacs_map" >&6
16627
16628 test "$cf_cv_curses_wacs_map" != unknown &&
16629 cat >>confdefs.h <<EOF
16630 #define CURSES_WACS_ARRAY $cf_cv_curses_wacs_map
16631 EOF
16632
16633 echo "$as_me:16633: checking for wide alternate character constants" >&5
16634 echo $ECHO_N "checking for wide alternate character constants... $ECHO_C" >&6
16635 if test "${cf_cv_curses_wacs_symbols+set}" = set; then
16636   echo $ECHO_N "(cached) $ECHO_C" >&6
16637 else
16638
16639 cf_cv_curses_wacs_symbols=no
16640 if test "$cf_cv_curses_wacs_map" != unknown
16641 then
16642         cat >conftest.$ac_ext <<_ACEOF
16643 #line 16643 "configure"
16644 #include "confdefs.h"
16645
16646 #ifndef _XOPEN_SOURCE_EXTENDED
16647 #define _XOPEN_SOURCE_EXTENDED
16648 #endif
16649 #include <${cf_cv_ncurses_header:-curses.h}>
16650 int
16651 main (void)
16652 {
16653 cchar_t *foo = WACS_PLUS;
16654          $cf_cv_curses_wacs_map['k'] = *WACS_PLUS
16655   ;
16656   return 0;
16657 }
16658 _ACEOF
16659 rm -f conftest.$ac_objext conftest$ac_exeext
16660 if { (eval echo "$as_me:16660: \"$ac_link\"") >&5
16661   (eval $ac_link) 2>&5
16662   ac_status=$?
16663   echo "$as_me:16663: \$? = $ac_status" >&5
16664   (exit $ac_status); } &&
16665          { ac_try='test -s conftest$ac_exeext'
16666   { (eval echo "$as_me:16666: \"$ac_try\"") >&5
16667   (eval $ac_try) 2>&5
16668   ac_status=$?
16669   echo "$as_me:16669: \$? = $ac_status" >&5
16670   (exit $ac_status); }; }; then
16671   cf_cv_curses_wacs_symbols=yes
16672 else
16673   echo "$as_me: failed program was:" >&5
16674 cat conftest.$ac_ext >&5
16675 fi
16676 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16677 else
16678         cat >conftest.$ac_ext <<_ACEOF
16679 #line 16679 "configure"
16680 #include "confdefs.h"
16681
16682 #ifndef _XOPEN_SOURCE_EXTENDED
16683 #define _XOPEN_SOURCE_EXTENDED
16684 #endif
16685 #include <${cf_cv_ncurses_header:-curses.h}>
16686 int
16687 main (void)
16688 {
16689 cchar_t *foo = WACS_PLUS
16690   ;
16691   return 0;
16692 }
16693 _ACEOF
16694 rm -f conftest.$ac_objext conftest$ac_exeext
16695 if { (eval echo "$as_me:16695: \"$ac_link\"") >&5
16696   (eval $ac_link) 2>&5
16697   ac_status=$?
16698   echo "$as_me:16698: \$? = $ac_status" >&5
16699   (exit $ac_status); } &&
16700          { ac_try='test -s conftest$ac_exeext'
16701   { (eval echo "$as_me:16701: \"$ac_try\"") >&5
16702   (eval $ac_try) 2>&5
16703   ac_status=$?
16704   echo "$as_me:16704: \$? = $ac_status" >&5
16705   (exit $ac_status); }; }; then
16706   cf_cv_curses_wacs_symbols=yes
16707 else
16708   echo "$as_me: failed program was:" >&5
16709 cat conftest.$ac_ext >&5
16710 fi
16711 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16712 fi
16713
16714 fi
16715 echo "$as_me:16715: result: $cf_cv_curses_wacs_symbols" >&5
16716 echo "${ECHO_T}$cf_cv_curses_wacs_symbols" >&6
16717
16718 test "$cf_cv_curses_wacs_symbols" != no &&
16719 cat >>confdefs.h <<\EOF
16720 #define CURSES_WACS_SYMBOLS 1
16721 EOF
16722
16723 fi
16724
16725 echo "$as_me:16725: checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}" >&5
16726 echo $ECHO_N "checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
16727 cat >conftest.$ac_ext <<_ACEOF
16728 #line 16728 "configure"
16729 #include "confdefs.h"
16730
16731 #ifndef _XOPEN_SOURCE_EXTENDED
16732 #define _XOPEN_SOURCE_EXTENDED
16733 #endif
16734 #include <${cf_cv_ncurses_header:-curses.h}>
16735 int
16736 main (void)
16737 {
16738
16739 attr_t foo
16740
16741   ;
16742   return 0;
16743 }
16744 _ACEOF
16745 rm -f conftest.$ac_objext
16746 if { (eval echo "$as_me:16746: \"$ac_compile\"") >&5
16747   (eval $ac_compile) 2>&5
16748   ac_status=$?
16749   echo "$as_me:16749: \$? = $ac_status" >&5
16750   (exit $ac_status); } &&
16751          { ac_try='test -s conftest.$ac_objext'
16752   { (eval echo "$as_me:16752: \"$ac_try\"") >&5
16753   (eval $ac_try) 2>&5
16754   ac_status=$?
16755   echo "$as_me:16755: \$? = $ac_status" >&5
16756   (exit $ac_status); }; }; then
16757   cf_result=yes
16758 else
16759   echo "$as_me: failed program was:" >&5
16760 cat conftest.$ac_ext >&5
16761 cf_result=no
16762 fi
16763 rm -f conftest.$ac_objext conftest.$ac_ext
16764 echo "$as_me:16764: result: $cf_result" >&5
16765 echo "${ECHO_T}$cf_result" >&6
16766 if test $cf_result = yes ; then
16767
16768 cf_result=`echo "have_type_attr_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16769
16770 cat >>confdefs.h <<EOF
16771 #define $cf_result 1
16772 EOF
16773
16774 else
16775
16776 cat >>confdefs.h <<EOF
16777 #define attr_t long
16778 EOF
16779
16780 fi
16781
16782 if test "$cf_enable_widec" = yes; then
16783
16784 # This is needed on Tru64 5.0 to declare mbstate_t
16785 echo "$as_me:16785: checking if we must include wchar.h to declare mbstate_t" >&5
16786 echo $ECHO_N "checking if we must include wchar.h to declare mbstate_t... $ECHO_C" >&6
16787 if test "${cf_cv_mbstate_t+set}" = set; then
16788   echo $ECHO_N "(cached) $ECHO_C" >&6
16789 else
16790
16791 cat >conftest.$ac_ext <<_ACEOF
16792 #line 16792 "configure"
16793 #include "confdefs.h"
16794
16795 #include <stdlib.h>
16796 #include <stdarg.h>
16797 #include <stdio.h>
16798 #ifdef HAVE_LIBUTF8_H
16799 #include <libutf8.h>
16800 #endif
16801 int
16802 main (void)
16803 {
16804 mbstate_t state
16805   ;
16806   return 0;
16807 }
16808 _ACEOF
16809 rm -f conftest.$ac_objext
16810 if { (eval echo "$as_me:16810: \"$ac_compile\"") >&5
16811   (eval $ac_compile) 2>&5
16812   ac_status=$?
16813   echo "$as_me:16813: \$? = $ac_status" >&5
16814   (exit $ac_status); } &&
16815          { ac_try='test -s conftest.$ac_objext'
16816   { (eval echo "$as_me:16816: \"$ac_try\"") >&5
16817   (eval $ac_try) 2>&5
16818   ac_status=$?
16819   echo "$as_me:16819: \$? = $ac_status" >&5
16820   (exit $ac_status); }; }; then
16821   cf_cv_mbstate_t=no
16822 else
16823   echo "$as_me: failed program was:" >&5
16824 cat conftest.$ac_ext >&5
16825 cat >conftest.$ac_ext <<_ACEOF
16826 #line 16826 "configure"
16827 #include "confdefs.h"
16828
16829 #include <stdlib.h>
16830 #include <stdarg.h>
16831 #include <stdio.h>
16832 #include <wchar.h>
16833 #ifdef HAVE_LIBUTF8_H
16834 #include <libutf8.h>
16835 #endif
16836 int
16837 main (void)
16838 {
16839 mbstate_t value
16840   ;
16841   return 0;
16842 }
16843 _ACEOF
16844 rm -f conftest.$ac_objext
16845 if { (eval echo "$as_me:16845: \"$ac_compile\"") >&5
16846   (eval $ac_compile) 2>&5
16847   ac_status=$?
16848   echo "$as_me:16848: \$? = $ac_status" >&5
16849   (exit $ac_status); } &&
16850          { ac_try='test -s conftest.$ac_objext'
16851   { (eval echo "$as_me:16851: \"$ac_try\"") >&5
16852   (eval $ac_try) 2>&5
16853   ac_status=$?
16854   echo "$as_me:16854: \$? = $ac_status" >&5
16855   (exit $ac_status); }; }; then
16856   cf_cv_mbstate_t=yes
16857 else
16858   echo "$as_me: failed program was:" >&5
16859 cat conftest.$ac_ext >&5
16860 cf_cv_mbstate_t=unknown
16861 fi
16862 rm -f conftest.$ac_objext conftest.$ac_ext
16863 fi
16864 rm -f conftest.$ac_objext conftest.$ac_ext
16865 fi
16866 echo "$as_me:16866: result: $cf_cv_mbstate_t" >&5
16867 echo "${ECHO_T}$cf_cv_mbstate_t" >&6
16868
16869 if test "$cf_cv_mbstate_t" = yes ; then
16870
16871 cat >>confdefs.h <<\EOF
16872 #define NEED_WCHAR_H 1
16873 EOF
16874
16875         NEED_WCHAR_H=1
16876 fi
16877
16878 # if we do not find mbstate_t in either place, use substitution to provide a fallback.
16879 if test "$cf_cv_mbstate_t" = unknown ; then
16880         NCURSES_MBSTATE_T=1
16881 fi
16882
16883 # if we find mbstate_t in either place, use substitution to provide a fallback.
16884 if test "$cf_cv_mbstate_t" != unknown ; then
16885         NCURSES_OK_MBSTATE_T=1
16886 fi
16887
16888 # This is needed on Tru64 5.0 to declare wchar_t
16889 echo "$as_me:16889: checking if we must include wchar.h to declare wchar_t" >&5
16890 echo $ECHO_N "checking if we must include wchar.h to declare wchar_t... $ECHO_C" >&6
16891 if test "${cf_cv_wchar_t+set}" = set; then
16892   echo $ECHO_N "(cached) $ECHO_C" >&6
16893 else
16894
16895 cat >conftest.$ac_ext <<_ACEOF
16896 #line 16896 "configure"
16897 #include "confdefs.h"
16898
16899 #include <stdlib.h>
16900 #include <stdarg.h>
16901 #include <stdio.h>
16902 #ifdef HAVE_LIBUTF8_H
16903 #include <libutf8.h>
16904 #endif
16905 int
16906 main (void)
16907 {
16908 wchar_t state
16909   ;
16910   return 0;
16911 }
16912 _ACEOF
16913 rm -f conftest.$ac_objext
16914 if { (eval echo "$as_me:16914: \"$ac_compile\"") >&5
16915   (eval $ac_compile) 2>&5
16916   ac_status=$?
16917   echo "$as_me:16917: \$? = $ac_status" >&5
16918   (exit $ac_status); } &&
16919          { ac_try='test -s conftest.$ac_objext'
16920   { (eval echo "$as_me:16920: \"$ac_try\"") >&5
16921   (eval $ac_try) 2>&5
16922   ac_status=$?
16923   echo "$as_me:16923: \$? = $ac_status" >&5
16924   (exit $ac_status); }; }; then
16925   cf_cv_wchar_t=no
16926 else
16927   echo "$as_me: failed program was:" >&5
16928 cat conftest.$ac_ext >&5
16929 cat >conftest.$ac_ext <<_ACEOF
16930 #line 16930 "configure"
16931 #include "confdefs.h"
16932
16933 #include <stdlib.h>
16934 #include <stdarg.h>
16935 #include <stdio.h>
16936 #include <wchar.h>
16937 #ifdef HAVE_LIBUTF8_H
16938 #include <libutf8.h>
16939 #endif
16940 int
16941 main (void)
16942 {
16943 wchar_t value
16944   ;
16945   return 0;
16946 }
16947 _ACEOF
16948 rm -f conftest.$ac_objext
16949 if { (eval echo "$as_me:16949: \"$ac_compile\"") >&5
16950   (eval $ac_compile) 2>&5
16951   ac_status=$?
16952   echo "$as_me:16952: \$? = $ac_status" >&5
16953   (exit $ac_status); } &&
16954          { ac_try='test -s conftest.$ac_objext'
16955   { (eval echo "$as_me:16955: \"$ac_try\"") >&5
16956   (eval $ac_try) 2>&5
16957   ac_status=$?
16958   echo "$as_me:16958: \$? = $ac_status" >&5
16959   (exit $ac_status); }; }; then
16960   cf_cv_wchar_t=yes
16961 else
16962   echo "$as_me: failed program was:" >&5
16963 cat conftest.$ac_ext >&5
16964 cf_cv_wchar_t=unknown
16965 fi
16966 rm -f conftest.$ac_objext conftest.$ac_ext
16967 fi
16968 rm -f conftest.$ac_objext conftest.$ac_ext
16969 fi
16970 echo "$as_me:16970: result: $cf_cv_wchar_t" >&5
16971 echo "${ECHO_T}$cf_cv_wchar_t" >&6
16972
16973 if test "$cf_cv_wchar_t" = yes ; then
16974
16975 cat >>confdefs.h <<\EOF
16976 #define NEED_WCHAR_H 1
16977 EOF
16978
16979         NEED_WCHAR_H=1
16980 fi
16981
16982 # if we do not find wchar_t in either place, use substitution to provide a fallback.
16983 if test "$cf_cv_wchar_t" = unknown ; then
16984         NCURSES_WCHAR_T=1
16985 fi
16986
16987 # if we find wchar_t in either place, use substitution to provide a fallback.
16988 if test "$cf_cv_wchar_t" != unknown ; then
16989         NCURSES_OK_WCHAR_T=1
16990 fi
16991
16992 # This is needed on Tru64 5.0 to declare wint_t
16993 echo "$as_me:16993: checking if we must include wchar.h to declare wint_t" >&5
16994 echo $ECHO_N "checking if we must include wchar.h to declare wint_t... $ECHO_C" >&6
16995 if test "${cf_cv_wint_t+set}" = set; then
16996   echo $ECHO_N "(cached) $ECHO_C" >&6
16997 else
16998
16999 cat >conftest.$ac_ext <<_ACEOF
17000 #line 17000 "configure"
17001 #include "confdefs.h"
17002
17003 #include <stdlib.h>
17004 #include <stdarg.h>
17005 #include <stdio.h>
17006 #ifdef HAVE_LIBUTF8_H
17007 #include <libutf8.h>
17008 #endif
17009 int
17010 main (void)
17011 {
17012 wint_t state
17013   ;
17014   return 0;
17015 }
17016 _ACEOF
17017 rm -f conftest.$ac_objext
17018 if { (eval echo "$as_me:17018: \"$ac_compile\"") >&5
17019   (eval $ac_compile) 2>&5
17020   ac_status=$?
17021   echo "$as_me:17021: \$? = $ac_status" >&5
17022   (exit $ac_status); } &&
17023          { ac_try='test -s conftest.$ac_objext'
17024   { (eval echo "$as_me:17024: \"$ac_try\"") >&5
17025   (eval $ac_try) 2>&5
17026   ac_status=$?
17027   echo "$as_me:17027: \$? = $ac_status" >&5
17028   (exit $ac_status); }; }; then
17029   cf_cv_wint_t=no
17030 else
17031   echo "$as_me: failed program was:" >&5
17032 cat conftest.$ac_ext >&5
17033 cat >conftest.$ac_ext <<_ACEOF
17034 #line 17034 "configure"
17035 #include "confdefs.h"
17036
17037 #include <stdlib.h>
17038 #include <stdarg.h>
17039 #include <stdio.h>
17040 #include <wchar.h>
17041 #ifdef HAVE_LIBUTF8_H
17042 #include <libutf8.h>
17043 #endif
17044 int
17045 main (void)
17046 {
17047 wint_t value
17048   ;
17049   return 0;
17050 }
17051 _ACEOF
17052 rm -f conftest.$ac_objext
17053 if { (eval echo "$as_me:17053: \"$ac_compile\"") >&5
17054   (eval $ac_compile) 2>&5
17055   ac_status=$?
17056   echo "$as_me:17056: \$? = $ac_status" >&5
17057   (exit $ac_status); } &&
17058          { ac_try='test -s conftest.$ac_objext'
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   cf_cv_wint_t=yes
17065 else
17066   echo "$as_me: failed program was:" >&5
17067 cat conftest.$ac_ext >&5
17068 cf_cv_wint_t=unknown
17069 fi
17070 rm -f conftest.$ac_objext conftest.$ac_ext
17071 fi
17072 rm -f conftest.$ac_objext conftest.$ac_ext
17073 fi
17074 echo "$as_me:17074: result: $cf_cv_wint_t" >&5
17075 echo "${ECHO_T}$cf_cv_wint_t" >&6
17076
17077 if test "$cf_cv_wint_t" = yes ; then
17078
17079 cat >>confdefs.h <<\EOF
17080 #define NEED_WCHAR_H 1
17081 EOF
17082
17083         NEED_WCHAR_H=1
17084 fi
17085
17086 # if we do not find wint_t in either place, use substitution to provide a fallback.
17087 if test "$cf_cv_wint_t" = unknown ; then
17088         NCURSES_WINT_T=1
17089 fi
17090
17091 # if we find wint_t in either place, use substitution to provide a fallback.
17092 if test "$cf_cv_wint_t" != unknown ; then
17093         NCURSES_OK_WINT_T=1
17094 fi
17095
17096         if test "$NCURSES_OK_MBSTATE_T" = 0 ; then
17097
17098 echo "$as_me:17098: checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}" >&5
17099 echo $ECHO_N "checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
17100 cat >conftest.$ac_ext <<_ACEOF
17101 #line 17101 "configure"
17102 #include "confdefs.h"
17103
17104 #ifndef _XOPEN_SOURCE_EXTENDED
17105 #define _XOPEN_SOURCE_EXTENDED
17106 #endif
17107 #include <${cf_cv_ncurses_header:-curses.h}>
17108 int
17109 main (void)
17110 {
17111
17112 mbstate_t foo
17113
17114   ;
17115   return 0;
17116 }
17117 _ACEOF
17118 rm -f conftest.$ac_objext
17119 if { (eval echo "$as_me:17119: \"$ac_compile\"") >&5
17120   (eval $ac_compile) 2>&5
17121   ac_status=$?
17122   echo "$as_me:17122: \$? = $ac_status" >&5
17123   (exit $ac_status); } &&
17124          { ac_try='test -s conftest.$ac_objext'
17125   { (eval echo "$as_me:17125: \"$ac_try\"") >&5
17126   (eval $ac_try) 2>&5
17127   ac_status=$?
17128   echo "$as_me:17128: \$? = $ac_status" >&5
17129   (exit $ac_status); }; }; then
17130   cf_result=yes
17131 else
17132   echo "$as_me: failed program was:" >&5
17133 cat conftest.$ac_ext >&5
17134 cf_result=no
17135 fi
17136 rm -f conftest.$ac_objext conftest.$ac_ext
17137 echo "$as_me:17137: result: $cf_result" >&5
17138 echo "${ECHO_T}$cf_result" >&6
17139 if test $cf_result = yes ; then
17140
17141 cf_result=`echo "have_type_mbstate_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17142
17143 cat >>confdefs.h <<EOF
17144 #define $cf_result 1
17145 EOF
17146
17147 else
17148
17149 cat >>confdefs.h <<EOF
17150 #define mbstate_t long
17151 EOF
17152
17153 fi
17154
17155         fi
17156
17157         if test "$NCURSES_OK_WCHAR_T" = 0 ; then
17158
17159 echo "$as_me:17159: checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}" >&5
17160 echo $ECHO_N "checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
17161 cat >conftest.$ac_ext <<_ACEOF
17162 #line 17162 "configure"
17163 #include "confdefs.h"
17164
17165 #ifndef _XOPEN_SOURCE_EXTENDED
17166 #define _XOPEN_SOURCE_EXTENDED
17167 #endif
17168 #include <${cf_cv_ncurses_header:-curses.h}>
17169 int
17170 main (void)
17171 {
17172
17173 wchar_t foo
17174
17175   ;
17176   return 0;
17177 }
17178 _ACEOF
17179 rm -f conftest.$ac_objext
17180 if { (eval echo "$as_me:17180: \"$ac_compile\"") >&5
17181   (eval $ac_compile) 2>&5
17182   ac_status=$?
17183   echo "$as_me:17183: \$? = $ac_status" >&5
17184   (exit $ac_status); } &&
17185          { ac_try='test -s conftest.$ac_objext'
17186   { (eval echo "$as_me:17186: \"$ac_try\"") >&5
17187   (eval $ac_try) 2>&5
17188   ac_status=$?
17189   echo "$as_me:17189: \$? = $ac_status" >&5
17190   (exit $ac_status); }; }; then
17191   cf_result=yes
17192 else
17193   echo "$as_me: failed program was:" >&5
17194 cat conftest.$ac_ext >&5
17195 cf_result=no
17196 fi
17197 rm -f conftest.$ac_objext conftest.$ac_ext
17198 echo "$as_me:17198: result: $cf_result" >&5
17199 echo "${ECHO_T}$cf_result" >&6
17200 if test $cf_result = yes ; then
17201
17202 cf_result=`echo "have_type_wchar_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17203
17204 cat >>confdefs.h <<EOF
17205 #define $cf_result 1
17206 EOF
17207
17208 else
17209
17210 cat >>confdefs.h <<EOF
17211 #define wchar_t long
17212 EOF
17213
17214 fi
17215
17216         fi
17217
17218         if test "$NCURSES_OK_WINT_T" = 0 ; then
17219
17220 echo "$as_me:17220: checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}" >&5
17221 echo $ECHO_N "checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
17222 cat >conftest.$ac_ext <<_ACEOF
17223 #line 17223 "configure"
17224 #include "confdefs.h"
17225
17226 #ifndef _XOPEN_SOURCE_EXTENDED
17227 #define _XOPEN_SOURCE_EXTENDED
17228 #endif
17229 #include <${cf_cv_ncurses_header:-curses.h}>
17230 int
17231 main (void)
17232 {
17233
17234 wint_t foo
17235
17236   ;
17237   return 0;
17238 }
17239 _ACEOF
17240 rm -f conftest.$ac_objext
17241 if { (eval echo "$as_me:17241: \"$ac_compile\"") >&5
17242   (eval $ac_compile) 2>&5
17243   ac_status=$?
17244   echo "$as_me:17244: \$? = $ac_status" >&5
17245   (exit $ac_status); } &&
17246          { ac_try='test -s conftest.$ac_objext'
17247   { (eval echo "$as_me:17247: \"$ac_try\"") >&5
17248   (eval $ac_try) 2>&5
17249   ac_status=$?
17250   echo "$as_me:17250: \$? = $ac_status" >&5
17251   (exit $ac_status); }; }; then
17252   cf_result=yes
17253 else
17254   echo "$as_me: failed program was:" >&5
17255 cat conftest.$ac_ext >&5
17256 cf_result=no
17257 fi
17258 rm -f conftest.$ac_objext conftest.$ac_ext
17259 echo "$as_me:17259: result: $cf_result" >&5
17260 echo "${ECHO_T}$cf_result" >&6
17261 if test $cf_result = yes ; then
17262
17263 cf_result=`echo "have_type_wint_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17264
17265 cat >>confdefs.h <<EOF
17266 #define $cf_result 1
17267 EOF
17268
17269 else
17270
17271 cat >>confdefs.h <<EOF
17272 #define wint_t long
17273 EOF
17274
17275 fi
17276
17277         fi
17278 fi
17279
17280 for cf_data in \
17281 curscr \
17282 ospeed \
17283 boolnames \
17284 boolfnames \
17285 ttytype
17286 do
17287 echo "$as_me:17287: checking for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
17288 echo $ECHO_N "checking for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
17289
17290 cat >conftest.$ac_ext <<_ACEOF
17291 #line 17291 "configure"
17292 #include "confdefs.h"
17293
17294 #ifdef HAVE_XCURSES
17295 #include <xcurses.h>
17296 char * XCursesProgramName = "test";
17297 #else
17298 #include <${cf_cv_ncurses_header:-curses.h}>
17299 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
17300 #include <ncursesw/term.h>
17301 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
17302 #include <ncurses/term.h>
17303 #elif defined(HAVE_TERM_H)
17304 #include <term.h>
17305 #endif
17306 #endif
17307
17308 int
17309 main (void)
17310 {
17311
17312 void *foo = &($cf_data)
17313
17314   ;
17315   return 0;
17316 }
17317 _ACEOF
17318 rm -f conftest.$ac_objext
17319 if { (eval echo "$as_me:17319: \"$ac_compile\"") >&5
17320   (eval $ac_compile) 2>&5
17321   ac_status=$?
17322   echo "$as_me:17322: \$? = $ac_status" >&5
17323   (exit $ac_status); } &&
17324          { ac_try='test -s conftest.$ac_objext'
17325   { (eval echo "$as_me:17325: \"$ac_try\"") >&5
17326   (eval $ac_try) 2>&5
17327   ac_status=$?
17328   echo "$as_me:17328: \$? = $ac_status" >&5
17329   (exit $ac_status); }; }; then
17330   cf_result=yes
17331
17332 else
17333   echo "$as_me: failed program was:" >&5
17334 cat conftest.$ac_ext >&5
17335 cf_result=no
17336 fi
17337 rm -f conftest.$ac_objext conftest.$ac_ext
17338 echo "$as_me:17338: result: $cf_result" >&5
17339 echo "${ECHO_T}$cf_result" >&6
17340
17341 if test $cf_result = yes ; then
17342
17343 cf_result=`echo "have_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17344
17345         cat >>confdefs.h <<EOF
17346 #define $cf_result 1
17347 EOF
17348
17349 else
17350         echo "$as_me:17350: checking for data $cf_data in library" >&5
17351 echo $ECHO_N "checking for data $cf_data in library... $ECHO_C" >&6
17352         # BSD linkers insist on making weak linkage, but resolve at runtime.
17353         if test "$cross_compiling" = yes; then
17354
17355         # cross-compiling
17356         cat >conftest.$ac_ext <<_ACEOF
17357 #line 17357 "configure"
17358 #include "confdefs.h"
17359
17360 #ifdef HAVE_XCURSES
17361 #include <xcurses.h>
17362 char * XCursesProgramName = "test";
17363 #else
17364 #include <${cf_cv_ncurses_header:-curses.h}>
17365 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
17366 #include <ncursesw/term.h>
17367 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
17368 #include <ncurses/term.h>
17369 #elif defined(HAVE_TERM_H)
17370 #include <term.h>
17371 #endif
17372 #endif
17373
17374 extern char $cf_data;
17375 int
17376 main (void)
17377 {
17378
17379         do {
17380                 void *foo = &($cf_data);
17381                 fprintf(stderr, "testing linkage of $cf_data:%p\n", foo);
17382                 ${cf_cv_main_return:-return}(foo == 0);
17383         } while (0)
17384
17385   ;
17386   return 0;
17387 }
17388 _ACEOF
17389 rm -f conftest.$ac_objext conftest$ac_exeext
17390 if { (eval echo "$as_me:17390: \"$ac_link\"") >&5
17391   (eval $ac_link) 2>&5
17392   ac_status=$?
17393   echo "$as_me:17393: \$? = $ac_status" >&5
17394   (exit $ac_status); } &&
17395          { ac_try='test -s conftest$ac_exeext'
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_exeext conftest.$ac_ext
17408
17409 else
17410   cat >conftest.$ac_ext <<_ACEOF
17411 #line 17411 "configure"
17412 #include "confdefs.h"
17413
17414 #ifdef HAVE_XCURSES
17415 #include <xcurses.h>
17416 char * XCursesProgramName = "test";
17417 #else
17418 #include <${cf_cv_ncurses_header:-curses.h}>
17419 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
17420 #include <ncursesw/term.h>
17421 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
17422 #include <ncurses/term.h>
17423 #elif defined(HAVE_TERM_H)
17424 #include <term.h>
17425 #endif
17426 #endif
17427
17428 extern char $cf_data;
17429 int main(void)
17430 {
17431         void *foo = &($cf_data);
17432         fprintf(stderr, "testing linkage of $cf_data:%p\n", foo);
17433         ${cf_cv_main_return:-return}(foo == 0);
17434 }
17435 _ACEOF
17436 rm -f conftest$ac_exeext
17437 if { (eval echo "$as_me:17437: \"$ac_link\"") >&5
17438   (eval $ac_link) 2>&5
17439   ac_status=$?
17440   echo "$as_me:17440: \$? = $ac_status" >&5
17441   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
17442   { (eval echo "$as_me:17442: \"$ac_try\"") >&5
17443   (eval $ac_try) 2>&5
17444   ac_status=$?
17445   echo "$as_me:17445: \$? = $ac_status" >&5
17446   (exit $ac_status); }; }; then
17447   cf_result=yes
17448
17449 else
17450   echo "$as_me: program exited with status $ac_status" >&5
17451 echo "$as_me: failed program was:" >&5
17452 cat conftest.$ac_ext >&5
17453 cf_result=no
17454 fi
17455 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
17456 fi
17457         echo "$as_me:17457: result: $cf_result" >&5
17458 echo "${ECHO_T}$cf_result" >&6
17459         if test $cf_result = yes ; then
17460
17461 cf_result=`echo "decl_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17462
17463                 cat >>confdefs.h <<EOF
17464 #define $cf_result 1
17465 EOF
17466
17467                 # do not exit loop here, since we prefer system's declarations
17468         fi
17469 fi
17470 done
17471
17472 if ( test "$GCC" = yes || test "$GXX" = yes )
17473 then
17474 echo "$as_me:17474: checking if you want to turn on gcc warnings" >&5
17475 echo $ECHO_N "checking if you want to turn on gcc warnings... $ECHO_C" >&6
17476
17477 # Check whether --enable-warnings or --disable-warnings was given.
17478 if test "${enable_warnings+set}" = set; then
17479   enableval="$enable_warnings"
17480   test "$enableval" != yes && enableval=no
17481         if test "$enableval" != "no" ; then
17482     with_warnings=yes
17483         else
17484                 with_warnings=no
17485         fi
17486 else
17487   enableval=no
17488         with_warnings=no
17489
17490 fi;
17491 echo "$as_me:17491: result: $with_warnings" >&5
17492 echo "${ECHO_T}$with_warnings" >&6
17493 if test "$with_warnings" = "yes"
17494 then
17495
17496 if test "$GCC" = yes
17497 then
17498 cat > conftest.i <<EOF
17499 #ifndef GCC_PRINTF
17500 #define GCC_PRINTF 0
17501 #endif
17502 #ifndef GCC_SCANF
17503 #define GCC_SCANF 0
17504 #endif
17505 #ifndef GCC_NORETURN
17506 #define GCC_NORETURN /* nothing */
17507 #endif
17508 #ifndef GCC_UNUSED
17509 #define GCC_UNUSED /* nothing */
17510 #endif
17511 EOF
17512 if test "$GCC" = yes
17513 then
17514         { echo "$as_me:17514: checking for $CC __attribute__ directives..." >&5
17515 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
17516 cat > conftest.$ac_ext <<EOF
17517 #line 17517 "${as_me:-configure}"
17518 #include "confdefs.h"
17519 #include "conftest.h"
17520 #include "conftest.i"
17521 #if     GCC_PRINTF
17522 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
17523 #else
17524 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
17525 #endif
17526 #if     GCC_SCANF
17527 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
17528 #else
17529 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
17530 #endif
17531 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
17532 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
17533 extern void foo(void) GCC_NORETURN;
17534 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
17535 EOF
17536         cf_printf_attribute=no
17537         cf_scanf_attribute=no
17538         for cf_attribute in scanf printf unused noreturn
17539         do
17540
17541 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17542
17543                 cf_directive="__attribute__(($cf_attribute))"
17544                 echo "checking for $CC $cf_directive" 1>&5
17545
17546                 case $cf_attribute in
17547                 (printf)
17548                         cf_printf_attribute=yes
17549                         cat >conftest.h <<EOF
17550 #define GCC_$cf_ATTRIBUTE 1
17551 EOF
17552                         ;;
17553                 (scanf)
17554                         cf_scanf_attribute=yes
17555                         cat >conftest.h <<EOF
17556 #define GCC_$cf_ATTRIBUTE 1
17557 EOF
17558                         ;;
17559                 (*)
17560                         cat >conftest.h <<EOF
17561 #define GCC_$cf_ATTRIBUTE $cf_directive
17562 EOF
17563                         ;;
17564                 esac
17565
17566                 if { (eval echo "$as_me:17566: \"$ac_compile\"") >&5
17567   (eval $ac_compile) 2>&5
17568   ac_status=$?
17569   echo "$as_me:17569: \$? = $ac_status" >&5
17570   (exit $ac_status); }; then
17571                         test -n "$verbose" && echo "$as_me:17571: result: ... $cf_attribute" >&5
17572 echo "${ECHO_T}... $cf_attribute" >&6
17573                         cat conftest.h >>confdefs.h
17574                         case $cf_attribute in
17575                         (noreturn)
17576
17577 cat >>confdefs.h <<EOF
17578 #define GCC_NORETURN $cf_directive
17579 EOF
17580
17581                                 ;;
17582                         (printf)
17583                                 cf_value='/* nothing */'
17584                                 if test "$cf_printf_attribute" != no ; then
17585                                         cf_value='__attribute__((format(printf,fmt,var)))'
17586
17587 cat >>confdefs.h <<\EOF
17588 #define GCC_PRINTF 1
17589 EOF
17590
17591                                 fi
17592
17593 cat >>confdefs.h <<EOF
17594 #define GCC_PRINTFLIKE(fmt,var) $cf_value
17595 EOF
17596
17597                                 ;;
17598                         (scanf)
17599                                 cf_value='/* nothing */'
17600                                 if test "$cf_scanf_attribute" != no ; then
17601                                         cf_value='__attribute__((format(scanf,fmt,var)))'
17602
17603 cat >>confdefs.h <<\EOF
17604 #define GCC_SCANF 1
17605 EOF
17606
17607                                 fi
17608
17609 cat >>confdefs.h <<EOF
17610 #define GCC_SCANFLIKE(fmt,var) $cf_value
17611 EOF
17612
17613                                 ;;
17614                         (unused)
17615
17616 cat >>confdefs.h <<EOF
17617 #define GCC_UNUSED $cf_directive
17618 EOF
17619
17620                                 ;;
17621                         esac
17622                 fi
17623         done
17624 else
17625         fgrep define conftest.i >>confdefs.h
17626 fi
17627 rm -rf conftest*
17628 fi
17629
17630 INTEL_COMPILER=no
17631
17632 if test "$GCC" = yes ; then
17633         case $host_os in
17634         (linux*|gnu*)
17635                 echo "$as_me:17635: checking if this is really Intel C compiler" >&5
17636 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
17637                 cf_save_CFLAGS="$CFLAGS"
17638                 CFLAGS="$CFLAGS -no-gcc"
17639                 cat >conftest.$ac_ext <<_ACEOF
17640 #line 17640 "configure"
17641 #include "confdefs.h"
17642
17643 int
17644 main (void)
17645 {
17646
17647 #ifdef __INTEL_COMPILER
17648 #else
17649 make an error
17650 #endif
17651
17652   ;
17653   return 0;
17654 }
17655 _ACEOF
17656 rm -f conftest.$ac_objext
17657 if { (eval echo "$as_me:17657: \"$ac_compile\"") >&5
17658   (eval $ac_compile) 2>&5
17659   ac_status=$?
17660   echo "$as_me:17660: \$? = $ac_status" >&5
17661   (exit $ac_status); } &&
17662          { ac_try='test -s conftest.$ac_objext'
17663   { (eval echo "$as_me:17663: \"$ac_try\"") >&5
17664   (eval $ac_try) 2>&5
17665   ac_status=$?
17666   echo "$as_me:17666: \$? = $ac_status" >&5
17667   (exit $ac_status); }; }; then
17668   INTEL_COMPILER=yes
17669 cf_save_CFLAGS="$cf_save_CFLAGS -we147"
17670
17671 else
17672   echo "$as_me: failed program was:" >&5
17673 cat conftest.$ac_ext >&5
17674 fi
17675 rm -f conftest.$ac_objext conftest.$ac_ext
17676                 CFLAGS="$cf_save_CFLAGS"
17677                 echo "$as_me:17677: result: $INTEL_COMPILER" >&5
17678 echo "${ECHO_T}$INTEL_COMPILER" >&6
17679                 ;;
17680         esac
17681 fi
17682
17683 CLANG_COMPILER=no
17684
17685 if test "$GCC" = yes ; then
17686         echo "$as_me:17686: checking if this is really Clang C compiler" >&5
17687 echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6
17688         cf_save_CFLAGS="$CFLAGS"
17689         CFLAGS="$CFLAGS -Qunused-arguments"
17690         cat >conftest.$ac_ext <<_ACEOF
17691 #line 17691 "configure"
17692 #include "confdefs.h"
17693
17694 int
17695 main (void)
17696 {
17697
17698 #ifdef __clang__
17699 #else
17700 make an error
17701 #endif
17702
17703   ;
17704   return 0;
17705 }
17706 _ACEOF
17707 rm -f conftest.$ac_objext
17708 if { (eval echo "$as_me:17708: \"$ac_compile\"") >&5
17709   (eval $ac_compile) 2>&5
17710   ac_status=$?
17711   echo "$as_me:17711: \$? = $ac_status" >&5
17712   (exit $ac_status); } &&
17713          { ac_try='test -s conftest.$ac_objext'
17714   { (eval echo "$as_me:17714: \"$ac_try\"") >&5
17715   (eval $ac_try) 2>&5
17716   ac_status=$?
17717   echo "$as_me:17717: \$? = $ac_status" >&5
17718   (exit $ac_status); }; }; then
17719   CLANG_COMPILER=yes
17720 cf_save_CFLAGS="$cf_save_CFLAGS -Qunused-arguments"
17721
17722 else
17723   echo "$as_me: failed program was:" >&5
17724 cat conftest.$ac_ext >&5
17725 fi
17726 rm -f conftest.$ac_objext conftest.$ac_ext
17727         CFLAGS="$cf_save_CFLAGS"
17728         echo "$as_me:17728: result: $CLANG_COMPILER" >&5
17729 echo "${ECHO_T}$CLANG_COMPILER" >&6
17730 fi
17731
17732 cat > conftest.$ac_ext <<EOF
17733 #line 17733 "${as_me:-configure}"
17734 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
17735 EOF
17736
17737 if test "$INTEL_COMPILER" = yes
17738 then
17739 # The "-wdXXX" options suppress warnings:
17740 # remark #1419: external declaration in primary source file
17741 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
17742 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
17743 # remark #193: zero used for undefined preprocessing identifier
17744 # remark #593: variable "curs_sb_left_arrow" was set but never used
17745 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
17746 # remark #869: parameter "tw" was never referenced
17747 # remark #981: operands are evaluated in unspecified order
17748 # warning #279: controlling expression is constant
17749
17750         { echo "$as_me:17750: checking for $CC warning options..." >&5
17751 echo "$as_me: checking for $CC warning options..." >&6;}
17752         cf_save_CFLAGS="$CFLAGS"
17753         EXTRA_CFLAGS="-Wall"
17754         for cf_opt in \
17755                 wd1419 \
17756                 wd1683 \
17757                 wd1684 \
17758                 wd193 \
17759                 wd593 \
17760                 wd279 \
17761                 wd810 \
17762                 wd869 \
17763                 wd981
17764         do
17765                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
17766                 if { (eval echo "$as_me:17766: \"$ac_compile\"") >&5
17767   (eval $ac_compile) 2>&5
17768   ac_status=$?
17769   echo "$as_me:17769: \$? = $ac_status" >&5
17770   (exit $ac_status); }; then
17771                         test -n "$verbose" && echo "$as_me:17771: result: ... -$cf_opt" >&5
17772 echo "${ECHO_T}... -$cf_opt" >&6
17773                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
17774                 fi
17775         done
17776         CFLAGS="$cf_save_CFLAGS"
17777
17778 elif test "$GCC" = yes
17779 then
17780         { echo "$as_me:17780: checking for $CC warning options..." >&5
17781 echo "$as_me: checking for $CC warning options..." >&6;}
17782         cf_save_CFLAGS="$CFLAGS"
17783         EXTRA_CFLAGS=
17784         cf_warn_CONST=""
17785         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
17786         cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
17787         test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
17788         for cf_opt in W Wall \
17789                 Wbad-function-cast \
17790                 Wcast-align \
17791                 Wcast-qual \
17792                 Wdeclaration-after-statement \
17793                 Wextra \
17794                 Winline \
17795                 Wmissing-declarations \
17796                 Wmissing-prototypes \
17797                 Wnested-externs \
17798                 Wpointer-arith \
17799                 Wshadow \
17800                 Wstrict-prototypes \
17801                 Wundef $cf_gcc_warnings $cf_warn_CONST Wno-unknown-pragmas
17802         do
17803                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
17804                 if { (eval echo "$as_me:17804: \"$ac_compile\"") >&5
17805   (eval $ac_compile) 2>&5
17806   ac_status=$?
17807   echo "$as_me:17807: \$? = $ac_status" >&5
17808   (exit $ac_status); }; then
17809                         test -n "$verbose" && echo "$as_me:17809: result: ... -$cf_opt" >&5
17810 echo "${ECHO_T}... -$cf_opt" >&6
17811                         case $cf_opt in
17812                         (Wcast-qual)
17813                                 CPPFLAGS="$CPPFLAGS -DXTSTRINGDEFINES"
17814                                 ;;
17815                         (Winline)
17816                                 case $GCC_VERSION in
17817                                 ([34].*)
17818                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
17819
17820 echo "${as_me:-configure}:17820: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
17821
17822                                         continue;;
17823                                 esac
17824                                 ;;
17825                         (Wpointer-arith)
17826                                 case $GCC_VERSION in
17827                                 ([12].*)
17828                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
17829
17830 echo "${as_me:-configure}:17830: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
17831
17832                                         continue;;
17833                                 esac
17834                                 ;;
17835                         esac
17836                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
17837                 fi
17838         done
17839         CFLAGS="$cf_save_CFLAGS"
17840 fi
17841 rm -rf conftest*
17842
17843 fi
17844 fi
17845
17846 echo "$as_me:17846: checking if you want to use dmalloc for testing" >&5
17847 echo $ECHO_N "checking if you want to use dmalloc for testing... $ECHO_C" >&6
17848
17849 # Check whether --with-dmalloc or --without-dmalloc was given.
17850 if test "${with_dmalloc+set}" = set; then
17851   withval="$with_dmalloc"
17852
17853 cat >>confdefs.h <<EOF
17854 #define USE_DMALLOC 1
17855 EOF
17856
17857         : ${with_cflags:=-g}
17858         : ${with_no_leaks:=yes}
17859          with_dmalloc=yes
17860 else
17861   with_dmalloc=
17862 fi;
17863 echo "$as_me:17863: result: ${with_dmalloc:-no}" >&5
17864 echo "${ECHO_T}${with_dmalloc:-no}" >&6
17865
17866 case .$with_cflags in
17867 (.*-g*)
17868         case .$CFLAGS in
17869         (.*-g*)
17870                 ;;
17871         (*)
17872
17873 cf_fix_cppflags=no
17874 cf_new_cflags=
17875 cf_new_cppflags=
17876 cf_new_extra_cppflags=
17877
17878 for cf_add_cflags in -g
17879 do
17880 case $cf_fix_cppflags in
17881 (no)
17882         case $cf_add_cflags in
17883         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
17884                 case $cf_add_cflags in
17885                 (-D*)
17886                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
17887
17888                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17889                                 && test -z "${cf_tst_cflags}" \
17890                                 && cf_fix_cppflags=yes
17891
17892                         if test $cf_fix_cppflags = yes ; then
17893
17894         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
17895         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
17896
17897                                 continue
17898                         elif test "${cf_tst_cflags}" = "\"'" ; then
17899
17900         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
17901         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
17902
17903                                 continue
17904                         fi
17905                         ;;
17906                 esac
17907                 case "$CPPFLAGS" in
17908                 (*$cf_add_cflags)
17909                         ;;
17910                 (*)
17911                         case $cf_add_cflags in
17912                         (-D*)
17913                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
17914
17915 CPPFLAGS=`echo "$CPPFLAGS" | \
17916         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
17917                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
17918
17919                                 ;;
17920                         esac
17921
17922         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
17923         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
17924
17925                         ;;
17926                 esac
17927                 ;;
17928         (*)
17929
17930         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
17931         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
17932
17933                 ;;
17934         esac
17935         ;;
17936 (yes)
17937
17938         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
17939         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
17940
17941         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
17942
17943         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17944                 && test -z "${cf_tst_cflags}" \
17945                 && cf_fix_cppflags=no
17946         ;;
17947 esac
17948 done
17949
17950 if test -n "$cf_new_cflags" ; then
17951
17952         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
17953         CFLAGS="${CFLAGS}$cf_new_cflags"
17954
17955 fi
17956
17957 if test -n "$cf_new_cppflags" ; then
17958
17959         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
17960         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
17961
17962 fi
17963
17964 if test -n "$cf_new_extra_cppflags" ; then
17965
17966         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
17967         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
17968
17969 fi
17970
17971                 ;;
17972         esac
17973         ;;
17974 esac
17975
17976 if test "$with_dmalloc" = yes ; then
17977         echo "$as_me:17977: checking for dmalloc.h" >&5
17978 echo $ECHO_N "checking for dmalloc.h... $ECHO_C" >&6
17979 if test "${ac_cv_header_dmalloc_h+set}" = set; then
17980   echo $ECHO_N "(cached) $ECHO_C" >&6
17981 else
17982   cat >conftest.$ac_ext <<_ACEOF
17983 #line 17983 "configure"
17984 #include "confdefs.h"
17985 #include <dmalloc.h>
17986 _ACEOF
17987 if { (eval echo "$as_me:17987: \"$ac_cpp conftest.$ac_ext\"") >&5
17988   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
17989   ac_status=$?
17990   egrep -v '^ *\+' conftest.er1 >conftest.err
17991   rm -f conftest.er1
17992   cat conftest.err >&5
17993   echo "$as_me:17993: \$? = $ac_status" >&5
17994   (exit $ac_status); } >/dev/null; then
17995   if test -s conftest.err; then
17996     ac_cpp_err=$ac_c_preproc_warn_flag
17997   else
17998     ac_cpp_err=
17999   fi
18000 else
18001   ac_cpp_err=yes
18002 fi
18003 if test -z "$ac_cpp_err"; then
18004   ac_cv_header_dmalloc_h=yes
18005 else
18006   echo "$as_me: failed program was:" >&5
18007   cat conftest.$ac_ext >&5
18008   ac_cv_header_dmalloc_h=no
18009 fi
18010 rm -f conftest.err conftest.$ac_ext
18011 fi
18012 echo "$as_me:18012: result: $ac_cv_header_dmalloc_h" >&5
18013 echo "${ECHO_T}$ac_cv_header_dmalloc_h" >&6
18014 if test $ac_cv_header_dmalloc_h = yes; then
18015
18016 echo "$as_me:18016: checking for dmalloc_debug in -ldmalloc" >&5
18017 echo $ECHO_N "checking for dmalloc_debug in -ldmalloc... $ECHO_C" >&6
18018 if test "${ac_cv_lib_dmalloc_dmalloc_debug+set}" = set; then
18019   echo $ECHO_N "(cached) $ECHO_C" >&6
18020 else
18021   ac_check_lib_save_LIBS=$LIBS
18022 LIBS="-ldmalloc  $LIBS"
18023 cat >conftest.$ac_ext <<_ACEOF
18024 #line 18024 "configure"
18025 #include "confdefs.h"
18026
18027 /* Override any gcc2 internal prototype to avoid an error.  */
18028 #ifdef __cplusplus
18029 extern "C"
18030 #endif
18031 /* We use char because int might match the return type of a gcc2
18032    builtin and then its argument prototype would still apply.  */
18033 char dmalloc_debug ();
18034 int
18035 main (void)
18036 {
18037 dmalloc_debug ();
18038   ;
18039   return 0;
18040 }
18041 _ACEOF
18042 rm -f conftest.$ac_objext conftest$ac_exeext
18043 if { (eval echo "$as_me:18043: \"$ac_link\"") >&5
18044   (eval $ac_link) 2>&5
18045   ac_status=$?
18046   echo "$as_me:18046: \$? = $ac_status" >&5
18047   (exit $ac_status); } &&
18048          { ac_try='test -s conftest$ac_exeext'
18049   { (eval echo "$as_me:18049: \"$ac_try\"") >&5
18050   (eval $ac_try) 2>&5
18051   ac_status=$?
18052   echo "$as_me:18052: \$? = $ac_status" >&5
18053   (exit $ac_status); }; }; then
18054   ac_cv_lib_dmalloc_dmalloc_debug=yes
18055 else
18056   echo "$as_me: failed program was:" >&5
18057 cat conftest.$ac_ext >&5
18058 ac_cv_lib_dmalloc_dmalloc_debug=no
18059 fi
18060 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18061 LIBS=$ac_check_lib_save_LIBS
18062 fi
18063 echo "$as_me:18063: result: $ac_cv_lib_dmalloc_dmalloc_debug" >&5
18064 echo "${ECHO_T}$ac_cv_lib_dmalloc_dmalloc_debug" >&6
18065 if test $ac_cv_lib_dmalloc_dmalloc_debug = yes; then
18066   cat >>confdefs.h <<EOF
18067 #define HAVE_LIBDMALLOC 1
18068 EOF
18069
18070   LIBS="-ldmalloc $LIBS"
18071
18072 fi
18073
18074 fi
18075
18076 fi
18077
18078 echo "$as_me:18078: checking if you want to use dbmalloc for testing" >&5
18079 echo $ECHO_N "checking if you want to use dbmalloc for testing... $ECHO_C" >&6
18080
18081 # Check whether --with-dbmalloc or --without-dbmalloc was given.
18082 if test "${with_dbmalloc+set}" = set; then
18083   withval="$with_dbmalloc"
18084
18085 cat >>confdefs.h <<EOF
18086 #define USE_DBMALLOC 1
18087 EOF
18088
18089         : ${with_cflags:=-g}
18090         : ${with_no_leaks:=yes}
18091          with_dbmalloc=yes
18092 else
18093   with_dbmalloc=
18094 fi;
18095 echo "$as_me:18095: result: ${with_dbmalloc:-no}" >&5
18096 echo "${ECHO_T}${with_dbmalloc:-no}" >&6
18097
18098 case .$with_cflags in
18099 (.*-g*)
18100         case .$CFLAGS in
18101         (.*-g*)
18102                 ;;
18103         (*)
18104
18105 cf_fix_cppflags=no
18106 cf_new_cflags=
18107 cf_new_cppflags=
18108 cf_new_extra_cppflags=
18109
18110 for cf_add_cflags in -g
18111 do
18112 case $cf_fix_cppflags in
18113 (no)
18114         case $cf_add_cflags in
18115         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
18116                 case $cf_add_cflags in
18117                 (-D*)
18118                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
18119
18120                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
18121                                 && test -z "${cf_tst_cflags}" \
18122                                 && cf_fix_cppflags=yes
18123
18124                         if test $cf_fix_cppflags = yes ; then
18125
18126         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
18127         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
18128
18129                                 continue
18130                         elif test "${cf_tst_cflags}" = "\"'" ; then
18131
18132         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
18133         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
18134
18135                                 continue
18136                         fi
18137                         ;;
18138                 esac
18139                 case "$CPPFLAGS" in
18140                 (*$cf_add_cflags)
18141                         ;;
18142                 (*)
18143                         case $cf_add_cflags in
18144                         (-D*)
18145                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
18146
18147 CPPFLAGS=`echo "$CPPFLAGS" | \
18148         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
18149                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
18150
18151                                 ;;
18152                         esac
18153
18154         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
18155         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
18156
18157                         ;;
18158                 esac
18159                 ;;
18160         (*)
18161
18162         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
18163         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
18164
18165                 ;;
18166         esac
18167         ;;
18168 (yes)
18169
18170         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
18171         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
18172
18173         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
18174
18175         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
18176                 && test -z "${cf_tst_cflags}" \
18177                 && cf_fix_cppflags=no
18178         ;;
18179 esac
18180 done
18181
18182 if test -n "$cf_new_cflags" ; then
18183
18184         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
18185         CFLAGS="${CFLAGS}$cf_new_cflags"
18186
18187 fi
18188
18189 if test -n "$cf_new_cppflags" ; then
18190
18191         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
18192         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
18193
18194 fi
18195
18196 if test -n "$cf_new_extra_cppflags" ; then
18197
18198         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
18199         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
18200
18201 fi
18202
18203                 ;;
18204         esac
18205         ;;
18206 esac
18207
18208 if test "$with_dbmalloc" = yes ; then
18209         echo "$as_me:18209: checking for dbmalloc.h" >&5
18210 echo $ECHO_N "checking for dbmalloc.h... $ECHO_C" >&6
18211 if test "${ac_cv_header_dbmalloc_h+set}" = set; then
18212   echo $ECHO_N "(cached) $ECHO_C" >&6
18213 else
18214   cat >conftest.$ac_ext <<_ACEOF
18215 #line 18215 "configure"
18216 #include "confdefs.h"
18217 #include <dbmalloc.h>
18218 _ACEOF
18219 if { (eval echo "$as_me:18219: \"$ac_cpp conftest.$ac_ext\"") >&5
18220   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
18221   ac_status=$?
18222   egrep -v '^ *\+' conftest.er1 >conftest.err
18223   rm -f conftest.er1
18224   cat conftest.err >&5
18225   echo "$as_me:18225: \$? = $ac_status" >&5
18226   (exit $ac_status); } >/dev/null; then
18227   if test -s conftest.err; then
18228     ac_cpp_err=$ac_c_preproc_warn_flag
18229   else
18230     ac_cpp_err=
18231   fi
18232 else
18233   ac_cpp_err=yes
18234 fi
18235 if test -z "$ac_cpp_err"; then
18236   ac_cv_header_dbmalloc_h=yes
18237 else
18238   echo "$as_me: failed program was:" >&5
18239   cat conftest.$ac_ext >&5
18240   ac_cv_header_dbmalloc_h=no
18241 fi
18242 rm -f conftest.err conftest.$ac_ext
18243 fi
18244 echo "$as_me:18244: result: $ac_cv_header_dbmalloc_h" >&5
18245 echo "${ECHO_T}$ac_cv_header_dbmalloc_h" >&6
18246 if test $ac_cv_header_dbmalloc_h = yes; then
18247
18248 echo "$as_me:18248: checking for debug_malloc in -ldbmalloc" >&5
18249 echo $ECHO_N "checking for debug_malloc in -ldbmalloc... $ECHO_C" >&6
18250 if test "${ac_cv_lib_dbmalloc_debug_malloc+set}" = set; then
18251   echo $ECHO_N "(cached) $ECHO_C" >&6
18252 else
18253   ac_check_lib_save_LIBS=$LIBS
18254 LIBS="-ldbmalloc  $LIBS"
18255 cat >conftest.$ac_ext <<_ACEOF
18256 #line 18256 "configure"
18257 #include "confdefs.h"
18258
18259 /* Override any gcc2 internal prototype to avoid an error.  */
18260 #ifdef __cplusplus
18261 extern "C"
18262 #endif
18263 /* We use char because int might match the return type of a gcc2
18264    builtin and then its argument prototype would still apply.  */
18265 char debug_malloc ();
18266 int
18267 main (void)
18268 {
18269 debug_malloc ();
18270   ;
18271   return 0;
18272 }
18273 _ACEOF
18274 rm -f conftest.$ac_objext conftest$ac_exeext
18275 if { (eval echo "$as_me:18275: \"$ac_link\"") >&5
18276   (eval $ac_link) 2>&5
18277   ac_status=$?
18278   echo "$as_me:18278: \$? = $ac_status" >&5
18279   (exit $ac_status); } &&
18280          { ac_try='test -s conftest$ac_exeext'
18281   { (eval echo "$as_me:18281: \"$ac_try\"") >&5
18282   (eval $ac_try) 2>&5
18283   ac_status=$?
18284   echo "$as_me:18284: \$? = $ac_status" >&5
18285   (exit $ac_status); }; }; then
18286   ac_cv_lib_dbmalloc_debug_malloc=yes
18287 else
18288   echo "$as_me: failed program was:" >&5
18289 cat conftest.$ac_ext >&5
18290 ac_cv_lib_dbmalloc_debug_malloc=no
18291 fi
18292 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18293 LIBS=$ac_check_lib_save_LIBS
18294 fi
18295 echo "$as_me:18295: result: $ac_cv_lib_dbmalloc_debug_malloc" >&5
18296 echo "${ECHO_T}$ac_cv_lib_dbmalloc_debug_malloc" >&6
18297 if test $ac_cv_lib_dbmalloc_debug_malloc = yes; then
18298   cat >>confdefs.h <<EOF
18299 #define HAVE_LIBDBMALLOC 1
18300 EOF
18301
18302   LIBS="-ldbmalloc $LIBS"
18303
18304 fi
18305
18306 fi
18307
18308 fi
18309
18310 echo "$as_me:18310: checking if you want to use valgrind for testing" >&5
18311 echo $ECHO_N "checking if you want to use valgrind for testing... $ECHO_C" >&6
18312
18313 # Check whether --with-valgrind or --without-valgrind was given.
18314 if test "${with_valgrind+set}" = set; then
18315   withval="$with_valgrind"
18316
18317 cat >>confdefs.h <<EOF
18318 #define USE_VALGRIND 1
18319 EOF
18320
18321         : ${with_cflags:=-g}
18322         : ${with_no_leaks:=yes}
18323          with_valgrind=yes
18324 else
18325   with_valgrind=
18326 fi;
18327 echo "$as_me:18327: result: ${with_valgrind:-no}" >&5
18328 echo "${ECHO_T}${with_valgrind:-no}" >&6
18329
18330 case .$with_cflags in
18331 (.*-g*)
18332         case .$CFLAGS in
18333         (.*-g*)
18334                 ;;
18335         (*)
18336
18337 cf_fix_cppflags=no
18338 cf_new_cflags=
18339 cf_new_cppflags=
18340 cf_new_extra_cppflags=
18341
18342 for cf_add_cflags in -g
18343 do
18344 case $cf_fix_cppflags in
18345 (no)
18346         case $cf_add_cflags in
18347         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
18348                 case $cf_add_cflags in
18349                 (-D*)
18350                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
18351
18352                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
18353                                 && test -z "${cf_tst_cflags}" \
18354                                 && cf_fix_cppflags=yes
18355
18356                         if test $cf_fix_cppflags = yes ; then
18357
18358         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
18359         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
18360
18361                                 continue
18362                         elif test "${cf_tst_cflags}" = "\"'" ; then
18363
18364         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
18365         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
18366
18367                                 continue
18368                         fi
18369                         ;;
18370                 esac
18371                 case "$CPPFLAGS" in
18372                 (*$cf_add_cflags)
18373                         ;;
18374                 (*)
18375                         case $cf_add_cflags in
18376                         (-D*)
18377                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
18378
18379 CPPFLAGS=`echo "$CPPFLAGS" | \
18380         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
18381                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
18382
18383                                 ;;
18384                         esac
18385
18386         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
18387         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
18388
18389                         ;;
18390                 esac
18391                 ;;
18392         (*)
18393
18394         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
18395         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
18396
18397                 ;;
18398         esac
18399         ;;
18400 (yes)
18401
18402         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
18403         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
18404
18405         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
18406
18407         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
18408                 && test -z "${cf_tst_cflags}" \
18409                 && cf_fix_cppflags=no
18410         ;;
18411 esac
18412 done
18413
18414 if test -n "$cf_new_cflags" ; then
18415
18416         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
18417         CFLAGS="${CFLAGS}$cf_new_cflags"
18418
18419 fi
18420
18421 if test -n "$cf_new_cppflags" ; then
18422
18423         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
18424         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
18425
18426 fi
18427
18428 if test -n "$cf_new_extra_cppflags" ; then
18429
18430         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
18431         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
18432
18433 fi
18434
18435                 ;;
18436         esac
18437         ;;
18438 esac
18439
18440 echo "$as_me:18440: checking if you want to perform memory-leak testing" >&5
18441 echo $ECHO_N "checking if you want to perform memory-leak testing... $ECHO_C" >&6
18442
18443 # Check whether --enable-leaks or --disable-leaks was given.
18444 if test "${enable_leaks+set}" = set; then
18445   enableval="$enable_leaks"
18446   if test "x$enableval" = xno; then with_no_leaks=yes; else with_no_leaks=no; fi
18447 else
18448   : ${with_no_leaks:=no}
18449 fi;
18450 echo "$as_me:18450: result: $with_no_leaks" >&5
18451 echo "${ECHO_T}$with_no_leaks" >&6
18452
18453 if test "$with_no_leaks" = yes ; then
18454
18455 cat >>confdefs.h <<\EOF
18456 #define NO_LEAKS 1
18457 EOF
18458
18459 cat >>confdefs.h <<\EOF
18460 #define YY_NO_LEAKS 1
18461 EOF
18462
18463 fi
18464
18465 LD_RPATH_OPT=
18466 echo "$as_me:18466: checking for an rpath option" >&5
18467 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
18468 case $cf_cv_system_name in
18469 (irix*)
18470         if test "$GCC" = yes; then
18471                 LD_RPATH_OPT="-Wl,-rpath,"
18472         else
18473                 LD_RPATH_OPT="-rpath "
18474         fi
18475         ;;
18476 (linux*|gnu*|k*bsd*-gnu|freebsd*)
18477         LD_RPATH_OPT="-Wl,-rpath,"
18478         ;;
18479 (openbsd[2-9].*|mirbsd*)
18480         LD_RPATH_OPT="-Wl,-rpath,"
18481         ;;
18482 (dragonfly*)
18483         LD_RPATH_OPT="-rpath "
18484         ;;
18485 (netbsd*)
18486         LD_RPATH_OPT="-Wl,-rpath,"
18487         ;;
18488 (osf*|mls+*)
18489         LD_RPATH_OPT="-rpath "
18490         ;;
18491 (solaris2*)
18492         LD_RPATH_OPT="-R"
18493         ;;
18494 (*)
18495         ;;
18496 esac
18497 echo "$as_me:18497: result: $LD_RPATH_OPT" >&5
18498 echo "${ECHO_T}$LD_RPATH_OPT" >&6
18499
18500 case "x$LD_RPATH_OPT" in
18501 (x-R*)
18502         echo "$as_me:18502: checking if we need a space after rpath option" >&5
18503 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
18504         cf_save_LIBS="$LIBS"
18505
18506 cf_add_libs="${LD_RPATH_OPT}$libdir"
18507 # Filter out duplicates - this happens with badly-designed ".pc" files...
18508 for cf_add_1lib in $LIBS
18509 do
18510         for cf_add_2lib in $cf_add_libs
18511         do
18512                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
18513                 then
18514                         cf_add_1lib=
18515                         break
18516                 fi
18517         done
18518         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
18519 done
18520 LIBS="$cf_add_libs"
18521
18522         cat >conftest.$ac_ext <<_ACEOF
18523 #line 18523 "configure"
18524 #include "confdefs.h"
18525
18526 int
18527 main (void)
18528 {
18529
18530   ;
18531   return 0;
18532 }
18533 _ACEOF
18534 rm -f conftest.$ac_objext conftest$ac_exeext
18535 if { (eval echo "$as_me:18535: \"$ac_link\"") >&5
18536   (eval $ac_link) 2>&5
18537   ac_status=$?
18538   echo "$as_me:18538: \$? = $ac_status" >&5
18539   (exit $ac_status); } &&
18540          { ac_try='test -s conftest$ac_exeext'
18541   { (eval echo "$as_me:18541: \"$ac_try\"") >&5
18542   (eval $ac_try) 2>&5
18543   ac_status=$?
18544   echo "$as_me:18544: \$? = $ac_status" >&5
18545   (exit $ac_status); }; }; then
18546   cf_rpath_space=no
18547 else
18548   echo "$as_me: failed program was:" >&5
18549 cat conftest.$ac_ext >&5
18550 cf_rpath_space=yes
18551 fi
18552 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18553         LIBS="$cf_save_LIBS"
18554         echo "$as_me:18554: result: $cf_rpath_space" >&5
18555 echo "${ECHO_T}$cf_rpath_space" >&6
18556         test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
18557         ;;
18558 esac
18559
18560 echo "$as_me:18560: checking if rpath-hack should be disabled" >&5
18561 echo $ECHO_N "checking if rpath-hack should be disabled... $ECHO_C" >&6
18562
18563 # Check whether --enable-rpath-hack or --disable-rpath-hack was given.
18564 if test "${enable_rpath_hack+set}" = set; then
18565   enableval="$enable_rpath_hack"
18566   test "$enableval" != no && enableval=yes
18567         if test "$enableval" != "yes" ; then
18568     cf_disable_rpath_hack=yes
18569         else
18570                 cf_disable_rpath_hack=no
18571         fi
18572 else
18573   enableval=yes
18574         cf_disable_rpath_hack=no
18575
18576 fi;
18577 echo "$as_me:18577: result: $cf_disable_rpath_hack" >&5
18578 echo "${ECHO_T}$cf_disable_rpath_hack" >&6
18579 if test "$cf_disable_rpath_hack" = no ; then
18580
18581 echo "$as_me:18581: checking for updated LDFLAGS" >&5
18582 echo $ECHO_N "checking for updated LDFLAGS... $ECHO_C" >&6
18583 if test -n "$LD_RPATH_OPT" ; then
18584         echo "$as_me:18584: result: maybe" >&5
18585 echo "${ECHO_T}maybe" >&6
18586
18587         for ac_prog in ldd
18588 do
18589   # Extract the first word of "$ac_prog", so it can be a program name with args.
18590 set dummy $ac_prog; ac_word=$2
18591 echo "$as_me:18591: checking for $ac_word" >&5
18592 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
18593 if test "${ac_cv_prog_cf_ldd_prog+set}" = set; then
18594   echo $ECHO_N "(cached) $ECHO_C" >&6
18595 else
18596   if test -n "$cf_ldd_prog"; then
18597   ac_cv_prog_cf_ldd_prog="$cf_ldd_prog" # Let the user override the test.
18598 else
18599   ac_save_IFS=$IFS; IFS=$ac_path_separator
18600 ac_dummy="$PATH"
18601 for ac_dir in $ac_dummy; do
18602   IFS=$ac_save_IFS
18603   test -z "$ac_dir" && ac_dir=.
18604   $as_executable_p "$ac_dir/$ac_word" || continue
18605 ac_cv_prog_cf_ldd_prog="$ac_prog"
18606 echo "$as_me:18606: found $ac_dir/$ac_word" >&5
18607 break
18608 done
18609
18610 fi
18611 fi
18612 cf_ldd_prog=$ac_cv_prog_cf_ldd_prog
18613 if test -n "$cf_ldd_prog"; then
18614   echo "$as_me:18614: result: $cf_ldd_prog" >&5
18615 echo "${ECHO_T}$cf_ldd_prog" >&6
18616 else
18617   echo "$as_me:18617: result: no" >&5
18618 echo "${ECHO_T}no" >&6
18619 fi
18620
18621   test -n "$cf_ldd_prog" && break
18622 done
18623 test -n "$cf_ldd_prog" || cf_ldd_prog="no"
18624
18625         cf_rpath_list="/usr/lib /lib"
18626         if test "$cf_ldd_prog" != no
18627         then
18628                 cf_rpath_oops=
18629
18630 cat >conftest.$ac_ext <<_ACEOF
18631 #line 18631 "configure"
18632 #include "confdefs.h"
18633 #include <stdio.h>
18634 int
18635 main (void)
18636 {
18637 printf("Hello");
18638   ;
18639   return 0;
18640 }
18641 _ACEOF
18642 rm -f conftest.$ac_objext conftest$ac_exeext
18643 if { (eval echo "$as_me:18643: \"$ac_link\"") >&5
18644   (eval $ac_link) 2>&5
18645   ac_status=$?
18646   echo "$as_me:18646: \$? = $ac_status" >&5
18647   (exit $ac_status); } &&
18648          { ac_try='test -s conftest$ac_exeext'
18649   { (eval echo "$as_me:18649: \"$ac_try\"") >&5
18650   (eval $ac_try) 2>&5
18651   ac_status=$?
18652   echo "$as_me:18652: \$? = $ac_status" >&5
18653   (exit $ac_status); }; }; then
18654   cf_rpath_oops=`$cf_ldd_prog conftest$ac_exeext | fgrep ' not found' | sed -e 's% =>.*$%%' |sort | uniq`
18655                  cf_rpath_list=`$cf_ldd_prog conftest$ac_exeext | fgrep / | sed -e 's%^.*[      ]/%/%' -e 's%/[^/][^/]*$%%' |sort | uniq`
18656 else
18657   echo "$as_me: failed program was:" >&5
18658 cat conftest.$ac_ext >&5
18659 fi
18660 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18661
18662                 # If we passed the link-test, but get a "not found" on a given library,
18663                 # this could be due to inept reconfiguration of gcc to make it only
18664                 # partly honor /usr/local/lib (or whatever).  Sometimes this behavior
18665                 # is intentional, e.g., installing gcc in /usr/bin and suppressing the
18666                 # /usr/local libraries.
18667                 if test -n "$cf_rpath_oops"
18668                 then
18669                         for cf_rpath_src in $cf_rpath_oops
18670                         do
18671                                 for cf_rpath_dir in \
18672                                         /usr/local \
18673                                         /usr/pkg \
18674                                         /opt/sfw
18675                                 do
18676                                         if test -f $cf_rpath_dir/lib/$cf_rpath_src
18677                                         then
18678                                                 test -n "$verbose" && echo "    ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src" 1>&6
18679
18680 echo "${as_me:-configure}:18680: testing ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src ..." 1>&5
18681
18682                                                 LDFLAGS="$LDFLAGS -L$cf_rpath_dir/lib"
18683                                                 break
18684                                         fi
18685                                 done
18686                         done
18687                 fi
18688         fi
18689
18690         test -n "$verbose" && echo "    ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
18691
18692 echo "${as_me:-configure}:18692: testing ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
18693
18694 test -n "$verbose" && echo "    ...checking LDFLAGS $LDFLAGS" 1>&6
18695
18696 echo "${as_me:-configure}:18696: testing ...checking LDFLAGS $LDFLAGS ..." 1>&5
18697
18698 cf_rpath_dst=
18699 for cf_rpath_src in $LDFLAGS
18700 do
18701         case $cf_rpath_src in
18702         (-L*)
18703
18704                 # check if this refers to a directory which we will ignore
18705                 cf_rpath_skip=no
18706                 if test -n "$cf_rpath_list"
18707                 then
18708                         for cf_rpath_item in $cf_rpath_list
18709                         do
18710                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
18711                                 then
18712                                         cf_rpath_skip=yes
18713                                         break
18714                                 fi
18715                         done
18716                 fi
18717
18718                 if test "$cf_rpath_skip" = no
18719                 then
18720                         # transform the option
18721                         if test "$LD_RPATH_OPT" = "-R " ; then
18722                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
18723                         else
18724                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
18725                         fi
18726
18727                         # if we have not already added this, add it now
18728                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
18729                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
18730                         then
18731                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
18732
18733 echo "${as_me:-configure}:18733: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
18734
18735                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
18736                         fi
18737                 fi
18738                 ;;
18739         esac
18740         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
18741 done
18742 LDFLAGS=$cf_rpath_dst
18743
18744 test -n "$verbose" && echo "    ...checked LDFLAGS $LDFLAGS" 1>&6
18745
18746 echo "${as_me:-configure}:18746: testing ...checked LDFLAGS $LDFLAGS ..." 1>&5
18747
18748 test -n "$verbose" && echo "    ...checking LIBS $LIBS" 1>&6
18749
18750 echo "${as_me:-configure}:18750: testing ...checking LIBS $LIBS ..." 1>&5
18751
18752 cf_rpath_dst=
18753 for cf_rpath_src in $LIBS
18754 do
18755         case $cf_rpath_src in
18756         (-L*)
18757
18758                 # check if this refers to a directory which we will ignore
18759                 cf_rpath_skip=no
18760                 if test -n "$cf_rpath_list"
18761                 then
18762                         for cf_rpath_item in $cf_rpath_list
18763                         do
18764                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
18765                                 then
18766                                         cf_rpath_skip=yes
18767                                         break
18768                                 fi
18769                         done
18770                 fi
18771
18772                 if test "$cf_rpath_skip" = no
18773                 then
18774                         # transform the option
18775                         if test "$LD_RPATH_OPT" = "-R " ; then
18776                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
18777                         else
18778                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
18779                         fi
18780
18781                         # if we have not already added this, add it now
18782                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
18783                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
18784                         then
18785                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
18786
18787 echo "${as_me:-configure}:18787: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
18788
18789                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
18790                         fi
18791                 fi
18792                 ;;
18793         esac
18794         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
18795 done
18796 LIBS=$cf_rpath_dst
18797
18798 test -n "$verbose" && echo "    ...checked LIBS $LIBS" 1>&6
18799
18800 echo "${as_me:-configure}:18800: testing ...checked LIBS $LIBS ..." 1>&5
18801
18802         test -n "$verbose" && echo "    ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
18803
18804 echo "${as_me:-configure}:18804: testing ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
18805
18806 else
18807         echo "$as_me:18807: result: no" >&5
18808 echo "${ECHO_T}no" >&6
18809 fi
18810
18811 fi
18812
18813 TEST_ARGS="$LIBS"
18814 LIBS=
18815
18816 ac_config_files="$ac_config_files Makefile"
18817 ac_config_commands="$ac_config_commands default"
18818 cat >confcache <<\_ACEOF
18819 # This file is a shell script that caches the results of configure
18820 # tests run on this system so they can be shared between configure
18821 # scripts and configure runs, see configure's option --config-cache.
18822 # It is not useful on other systems.  If it contains results you don't
18823 # want to keep, you may remove or edit it.
18824 #
18825 # config.status only pays attention to the cache file if you give it
18826 # the --recheck option to rerun configure.
18827 #
18828 # `ac_cv_env_foo' variables (set or unset) will be overriden when
18829 # loading this file, other *unset* `ac_cv_foo' will be assigned the
18830 # following values.
18831
18832 _ACEOF
18833
18834 # The following way of writing the cache mishandles newlines in values,
18835 # but we know of no workaround that is simple, portable, and efficient.
18836 # So, don't put newlines in cache variables' values.
18837 # Ultrix sh set writes to stderr and can't be redirected directly,
18838 # and sets the high bit in the cache file unless we assign to the vars.
18839 {
18840   (set) 2>&1 |
18841     case `(ac_space=' '; set | grep ac_space) 2>&1` in
18842     *ac_space=\ *)
18843       # `set' does not quote correctly, so add quotes (double-quote
18844       # substitution turns \\\\ into \\, and sed turns \\ into \).
18845       sed -n \
18846         "s/'/'\\\\''/g;
18847           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
18848       ;;
18849     *)
18850       # `set' quotes correctly as required by POSIX, so do not add quotes.
18851       sed -n \
18852         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
18853       ;;
18854     esac;
18855 } |
18856   sed '
18857      t clear
18858      : clear
18859      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
18860      t end
18861      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
18862      : end' >>confcache
18863 if cmp -s $cache_file confcache; then :; else
18864   if test -w $cache_file; then
18865     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
18866     cat confcache >$cache_file
18867   else
18868     echo "not updating unwritable cache $cache_file"
18869   fi
18870 fi
18871 rm -f confcache
18872
18873 test "x$prefix" = xNONE && prefix=$ac_default_prefix
18874 # Let make expand exec_prefix.
18875 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
18876
18877 # VPATH may cause trouble with some makes, so we remove $(srcdir),
18878 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
18879 # trailing colons and then remove the whole line if VPATH becomes empty
18880 # (actually we leave an empty line to preserve line numbers).
18881 if test "x$srcdir" = x.; then
18882   ac_vpsub='/^[         ]*VPATH[        ]*=/{
18883 s/:*\$(srcdir):*/:/;
18884 s/:*\${srcdir}:*/:/;
18885 s/:*@srcdir@:*/:/;
18886 s/^\([^=]*=[    ]*\):*/\1/;
18887 s/:*$//;
18888 s/^[^=]*=[      ]*$//;
18889 }'
18890 fi
18891
18892 DEFS=-DHAVE_CONFIG_H
18893
18894 : ${CONFIG_STATUS=./config.status}
18895 ac_clean_files_save=$ac_clean_files
18896 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
18897 { echo "$as_me:18897: creating $CONFIG_STATUS" >&5
18898 echo "$as_me: creating $CONFIG_STATUS" >&6;}
18899 cat >$CONFIG_STATUS <<_ACEOF
18900 #! $SHELL
18901 # Generated automatically by configure.
18902 # Run this file to recreate the current configuration.
18903 # Compiler output produced by configure, useful for debugging
18904 # configure, is in config.log if it exists.
18905
18906 debug=false
18907 SHELL=\${CONFIG_SHELL-$SHELL}
18908 ac_cs_invocation="\$0 \$@"
18909
18910 _ACEOF
18911
18912 cat >>$CONFIG_STATUS <<\_ACEOF
18913 # Be Bourne compatible
18914 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
18915   emulate sh
18916   NULLCMD=:
18917 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
18918   set -o posix
18919 fi
18920
18921 # Name of the executable.
18922 as_me=`echo "$0" |sed 's,.*[\\/],,'`
18923
18924 if expr a : '\(a\)' >/dev/null 2>&1; then
18925   as_expr=expr
18926 else
18927   as_expr=false
18928 fi
18929
18930 rm -f conf$$ conf$$.exe conf$$.file
18931 echo >conf$$.file
18932 if ln -s conf$$.file conf$$ 2>/dev/null; then
18933   # We could just check for DJGPP; but this test a) works b) is more generic
18934   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
18935   if test -f conf$$.exe; then
18936     # Don't use ln at all; we don't have any links
18937     as_ln_s='cp -p'
18938   else
18939     as_ln_s='ln -s'
18940   fi
18941 elif ln conf$$.file conf$$ 2>/dev/null; then
18942   as_ln_s=ln
18943 else
18944   as_ln_s='cp -p'
18945 fi
18946 rm -f conf$$ conf$$.exe conf$$.file
18947
18948 as_executable_p="test -f"
18949
18950 # Support unset when possible.
18951 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
18952   as_unset=unset
18953 else
18954   as_unset=false
18955 fi
18956
18957 # NLS nuisances.
18958 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
18959 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
18960 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
18961 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
18962 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
18963 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
18964 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
18965 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
18966
18967 # IFS
18968 # We need space, tab and new line, in precisely that order.
18969 as_nl='
18970 '
18971 IFS="   $as_nl"
18972
18973 # CDPATH.
18974 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
18975
18976 exec 6>&1
18977
18978 _ACEOF
18979
18980 # Files that config.status was made for.
18981 if test -n "$ac_config_files"; then
18982   echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
18983 fi
18984
18985 if test -n "$ac_config_headers"; then
18986   echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
18987 fi
18988
18989 if test -n "$ac_config_links"; then
18990   echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
18991 fi
18992
18993 if test -n "$ac_config_commands"; then
18994   echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
18995 fi
18996
18997 cat >>$CONFIG_STATUS <<\EOF
18998
18999 ac_cs_usage="\
19000 \`$as_me' instantiates files from templates according to the
19001 current configuration.
19002
19003 Usage: $0 [OPTIONS] [FILE]...
19004
19005   -h, --help       print this help, then exit
19006   -V, --version    print version number, then exit
19007   -d, --debug      don't remove temporary files
19008       --recheck    update $as_me by reconfiguring in the same conditions
19009   --file=FILE[:TEMPLATE]
19010                    instantiate the configuration file FILE
19011   --header=FILE[:TEMPLATE]
19012                    instantiate the configuration header FILE
19013
19014 Configuration files:
19015 $config_files
19016
19017 Configuration headers:
19018 $config_headers
19019
19020 Configuration commands:
19021 $config_commands
19022
19023 Report bugs to <dickey@invisible-island.net>."
19024 EOF
19025
19026 cat >>$CONFIG_STATUS <<EOF
19027 ac_cs_version="\\
19028 config.status
19029 configured by $0, generated by GNU Autoconf 2.52.20170501,
19030   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
19031
19032 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
19033 Free Software Foundation, Inc.
19034 This config.status script is free software; the Free Software Foundation
19035 gives unlimited permission to copy, distribute and modify it."
19036 srcdir=$srcdir
19037 INSTALL="$INSTALL"
19038 EOF
19039
19040 cat >>$CONFIG_STATUS <<\EOF
19041 # If no file are specified by the user, then we need to provide default
19042 # value.  By we need to know if files were specified by the user.
19043 ac_need_defaults=:
19044 while test $# != 0
19045 do
19046   case $1 in
19047   --*=*)
19048     ac_option=`expr "x$1" : 'x\([^=]*\)='`
19049     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
19050     shift
19051     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
19052     shift
19053     ;;
19054   -*);;
19055   *) # This is not an option, so the user has probably given explicit
19056      # arguments.
19057      ac_need_defaults=false;;
19058   esac
19059
19060   case $1 in
19061   # Handling of the options.
19062 EOF
19063 cat >>$CONFIG_STATUS <<EOF
19064   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
19065     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
19066     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
19067 EOF
19068 cat >>$CONFIG_STATUS <<\EOF
19069   --version | --vers* | -V )
19070     echo "$ac_cs_version"; exit 0 ;;
19071   --he | --h)
19072     # Conflict between --help and --header
19073     { { echo "$as_me:19073: error: ambiguous option: $1
19074 Try \`$0 --help' for more information." >&5
19075 echo "$as_me: error: ambiguous option: $1
19076 Try \`$0 --help' for more information." >&2;}
19077    { (exit 1); exit 1; }; };;
19078   --help | --hel | -h )
19079     echo "$ac_cs_usage"; exit 0 ;;
19080   --debug | --d* | -d )
19081     debug=: ;;
19082   --file | --fil | --fi | --f )
19083     shift
19084     CONFIG_FILES="$CONFIG_FILES $1"
19085     ac_need_defaults=false;;
19086   --header | --heade | --head | --hea )
19087     shift
19088     CONFIG_HEADERS="$CONFIG_HEADERS $1"
19089     ac_need_defaults=false;;
19090
19091   # This is an error.
19092   -*) { { echo "$as_me:19092: error: unrecognized option: $1
19093 Try \`$0 --help' for more information." >&5
19094 echo "$as_me: error: unrecognized option: $1
19095 Try \`$0 --help' for more information." >&2;}
19096    { (exit 1); exit 1; }; } ;;
19097
19098   *) ac_config_targets="$ac_config_targets $1" ;;
19099
19100   esac
19101   shift
19102 done
19103
19104 exec 5>>config.log
19105 cat >&5 << _ACEOF
19106
19107 ## ----------------------- ##
19108 ## Running config.status.  ##
19109 ## ----------------------- ##
19110
19111 This file was extended by $as_me 2.52.20170501, executed with
19112   CONFIG_FILES    = $CONFIG_FILES
19113   CONFIG_HEADERS  = $CONFIG_HEADERS
19114   CONFIG_LINKS    = $CONFIG_LINKS
19115   CONFIG_COMMANDS = $CONFIG_COMMANDS
19116   > $ac_cs_invocation
19117 on `(hostname || uname -n) 2>/dev/null | sed 1q`
19118
19119 _ACEOF
19120 EOF
19121
19122 cat >>$CONFIG_STATUS <<EOF
19123 #
19124 # INIT-COMMANDS section.
19125 #
19126
19127 AWK="$AWK"
19128 ECHO_CC="$ECHO_CC"
19129 ECHO_LD="$ECHO_LD"
19130 SHOW_CC="$SHOW_LD"
19131
19132 EOF
19133
19134 cat >>$CONFIG_STATUS <<\EOF
19135 for ac_config_target in $ac_config_targets
19136 do
19137   case "$ac_config_target" in
19138   # Handling of arguments.
19139   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
19140   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
19141   "ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS ncurses_cfg.h:ncurses_tst.hin" ;;
19142   *) { { echo "$as_me:19142: error: invalid argument: $ac_config_target" >&5
19143 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
19144    { (exit 1); exit 1; }; };;
19145   esac
19146 done
19147
19148 # If the user did not use the arguments to specify the items to instantiate,
19149 # then the envvar interface is used.  Set only those that are not.
19150 # We use the long form for the default assignment because of an extremely
19151 # bizarre bug on SunOS 4.1.3.
19152 if $ac_need_defaults; then
19153   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
19154   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
19155   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
19156 fi
19157
19158 # Create a temporary directory, and hook for its removal unless debugging.
19159 $debug ||
19160 {
19161   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
19162   trap '{ (exit 1); exit 1; }' 1 2 13 15
19163 }
19164
19165 # Create a (secure) tmp directory for tmp files.
19166 : ${TMPDIR=/tmp}
19167 {
19168   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
19169   test -n "$tmp" && test -d "$tmp"
19170 }  ||
19171 {
19172   tmp=$TMPDIR/cs$$-$RANDOM
19173   (umask 077 && mkdir $tmp)
19174 } ||
19175 {
19176    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
19177    { (exit 1); exit 1; }
19178 }
19179
19180 EOF
19181
19182 cat >>$CONFIG_STATUS <<EOF
19183
19184 #
19185 # CONFIG_FILES section.
19186 #
19187
19188 # No need to generate the scripts if there are no CONFIG_FILES.
19189 # This happens for instance when ./config.status config.h
19190 if test -n "\$CONFIG_FILES"; then
19191   # Protect against being on the right side of a sed subst in config.status.
19192   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
19193    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
19194 s,@SHELL@,$SHELL,;t t
19195 s,@exec_prefix@,$exec_prefix,;t t
19196 s,@prefix@,$prefix,;t t
19197 s,@program_transform_name@,$program_transform_name,;t t
19198 s,@bindir@,$bindir,;t t
19199 s,@sbindir@,$sbindir,;t t
19200 s,@libexecdir@,$libexecdir,;t t
19201 s,@datarootdir@,$datarootdir,;t t
19202 s,@datadir@,$datadir,;t t
19203 s,@sysconfdir@,$sysconfdir,;t t
19204 s,@sharedstatedir@,$sharedstatedir,;t t
19205 s,@localstatedir@,$localstatedir,;t t
19206 s,@libdir@,$libdir,;t t
19207 s,@includedir@,$includedir,;t t
19208 s,@oldincludedir@,$oldincludedir,;t t
19209 s,@infodir@,$infodir,;t t
19210 s,@mandir@,$mandir,;t t
19211 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
19212 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
19213 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
19214 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
19215 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
19216 s,@build_alias@,$build_alias,;t t
19217 s,@host_alias@,$host_alias,;t t
19218 s,@target_alias@,$target_alias,;t t
19219 s,@ECHO_C@,$ECHO_C,;t t
19220 s,@ECHO_N@,$ECHO_N,;t t
19221 s,@ECHO_T@,$ECHO_T,;t t
19222 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
19223 s,@DEFS@,$DEFS,;t t
19224 s,@LIBS@,$LIBS,;t t
19225 s,@build@,$build,;t t
19226 s,@build_cpu@,$build_cpu,;t t
19227 s,@build_vendor@,$build_vendor,;t t
19228 s,@build_os@,$build_os,;t t
19229 s,@host@,$host,;t t
19230 s,@host_cpu@,$host_cpu,;t t
19231 s,@host_vendor@,$host_vendor,;t t
19232 s,@host_os@,$host_os,;t t
19233 s,@SET_MAKE@,$SET_MAKE,;t t
19234 s,@CC@,$CC,;t t
19235 s,@CFLAGS@,$CFLAGS,;t t
19236 s,@LDFLAGS@,$LDFLAGS,;t t
19237 s,@CPPFLAGS@,$CPPFLAGS,;t t
19238 s,@ac_ct_CC@,$ac_ct_CC,;t t
19239 s,@EXEEXT@,$EXEEXT,;t t
19240 s,@OBJEXT@,$OBJEXT,;t t
19241 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
19242 s,@CPP@,$CPP,;t t
19243 s,@AWK@,$AWK,;t t
19244 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
19245 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
19246 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
19247 s,@LINT@,$LINT,;t t
19248 s,@LINT_OPTS@,$LINT_OPTS,;t t
19249 s,@CTAGS@,$CTAGS,;t t
19250 s,@ETAGS@,$ETAGS,;t t
19251 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
19252 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
19253 s,@MATH_LIB@,$MATH_LIB,;t t
19254 s,@top_builddir@,$top_builddir,;t t
19255 s,@CC_G_OPT@,$CC_G_OPT,;t t
19256 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
19257 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
19258 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
19259 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
19260 s,@LD@,$LD,;t t
19261 s,@LDFLAGS_SHARED@,$LDFLAGS_SHARED,;t t
19262 s,@LDFLAGS_STATIC@,$LDFLAGS_STATIC,;t t
19263 s,@LD_MODEL@,$LD_MODEL,;t t
19264 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
19265 s,@LIBTOOL@,$LIBTOOL,;t t
19266 s,@LIBTOOL_OPTS@,$LIBTOOL_OPTS,;t t
19267 s,@LIB_CLEAN@,$LIB_CLEAN,;t t
19268 s,@LIB_COMPILE@,$LIB_COMPILE,;t t
19269 s,@LIB_LINK@,$LIB_LINK,;t t
19270 s,@LINK_TESTS@,$LINK_TESTS,;t t
19271 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
19272 s,@PACKAGE@,$PACKAGE,;t t
19273 s,@PTHREAD@,$PTHREAD,;t t
19274 s,@TEST_ARGS@,$TEST_ARGS,;t t
19275 s,@TEST_DEPS@,$TEST_DEPS,;t t
19276 s,@TEST_LIBS@,$TEST_LIBS,;t t
19277 s,@TINFO_LDFLAGS@,$TINFO_LDFLAGS,;t t
19278 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
19279 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
19280 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
19281 s,@includesubdir@,$includesubdir,;t t
19282 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
19283 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
19284 s,@ECHO_LT@,$ECHO_LT,;t t
19285 s,@ECHO_LD@,$ECHO_LD,;t t
19286 s,@RULE_CC@,$RULE_CC,;t t
19287 s,@SHOW_CC@,$SHOW_CC,;t t
19288 s,@ECHO_CC@,$ECHO_CC,;t t
19289 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
19290 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
19291 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
19292 s,@X_CFLAGS@,$X_CFLAGS,;t t
19293 s,@X_PRE_LIBS@,$X_PRE_LIBS,;t t
19294 s,@X_LIBS@,$X_LIBS,;t t
19295 s,@X_EXTRA_LIBS@,$X_EXTRA_LIBS,;t t
19296 s,@XCURSES_CONFIG@,$XCURSES_CONFIG,;t t
19297 s,@ac_ct_XCURSES_CONFIG@,$ac_ct_XCURSES_CONFIG,;t t
19298 s,@RGB_PATH@,$RGB_PATH,;t t
19299 s,@no_x11_rgb@,$no_x11_rgb,;t t
19300 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
19301 s,@cf_ldd_prog@,$cf_ldd_prog,;t t
19302 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
19303 CEOF
19304
19305 EOF
19306
19307   cat >>$CONFIG_STATUS <<\EOF
19308   # Split the substitutions into bite-sized pieces for seds with
19309   # small command number limits, like on Digital OSF/1 and HP-UX.
19310   ac_max_sed_lines=48
19311   ac_sed_frag=1 # Number of current file.
19312   ac_beg=1 # First line for current file.
19313   ac_end=$ac_max_sed_lines # Line after last line for current file.
19314   ac_more_lines=:
19315   ac_sed_cmds=
19316   while $ac_more_lines; do
19317     if test $ac_beg -gt 1; then
19318       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
19319     else
19320       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
19321     fi
19322     if test ! -s $tmp/subs.frag; then
19323       ac_more_lines=false
19324     else
19325       # The purpose of the label and of the branching condition is to
19326       # speed up the sed processing (if there are no `@' at all, there
19327       # is no need to browse any of the substitutions).
19328       # These are the two extra sed commands mentioned above.
19329       (echo ':t
19330   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
19331       # It is possible to make a multiline substitution using escaped newlines.
19332       # Ensure that we do not split the substitution between script fragments.
19333       ac_BEG=$ac_end
19334       ac_END=`expr $ac_end + $ac_max_sed_lines`
19335       sed "1,${ac_BEG}d; ${ac_END}p; q" $tmp/subs.sed >$tmp/subs.next
19336       if test -s $tmp/subs.next; then
19337         grep '^s,@[^@,][^@,]*@,.*\\$' $tmp/subs.next >$tmp/subs.edit
19338         if test ! -s $tmp/subs.edit; then
19339           grep "^s,@[^@,][^@,]*@,.*,;t t$" $tmp/subs.next >$tmp/subs.edit
19340           if test ! -s $tmp/subs.edit; then
19341             if test $ac_beg -gt 1; then
19342               ac_end=`expr $ac_end - 1`
19343               continue
19344             fi
19345           fi
19346         fi
19347       fi
19348
19349       if test -z "$ac_sed_cmds"; then
19350         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
19351       else
19352         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
19353       fi
19354       ac_sed_frag=`expr $ac_sed_frag + 1`
19355       ac_beg=$ac_end
19356       ac_end=`expr $ac_end + $ac_max_sed_lines`
19357     fi
19358   done
19359   if test -z "$ac_sed_cmds"; then
19360     ac_sed_cmds=cat
19361   fi
19362 fi # test -n "$CONFIG_FILES"
19363
19364 EOF
19365 cat >>$CONFIG_STATUS <<\EOF
19366 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
19367   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
19368   case $ac_file in
19369   - | *:- | *:-:* ) # input from stdin
19370         cat >$tmp/stdin
19371         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
19372         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
19373   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
19374         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
19375   * )   ac_file_in=$ac_file.in ;;
19376   esac
19377
19378   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
19379   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
19380          X"$ac_file" : 'X\(//\)[^/]' \| \
19381          X"$ac_file" : 'X\(//\)$' \| \
19382          X"$ac_file" : 'X\(/\)' \| \
19383          .     : '\(.\)' 2>/dev/null ||
19384 echo X"$ac_file" |
19385     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
19386           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
19387           /^X\(\/\/\)$/{ s//\1/; q; }
19388           /^X\(\/\).*/{ s//\1/; q; }
19389           s/.*/./; q'`
19390   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
19391     { case "$ac_dir" in
19392   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
19393   *)                      as_incr_dir=.;;
19394 esac
19395 as_dummy="$ac_dir"
19396 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
19397   case $as_mkdir_dir in
19398     # Skip DOS drivespec
19399     ?:) as_incr_dir=$as_mkdir_dir ;;
19400     *)
19401       as_incr_dir=$as_incr_dir/$as_mkdir_dir
19402       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
19403     ;;
19404   esac
19405 done; }
19406
19407     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
19408     # A "../" for each directory in $ac_dir_suffix.
19409     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
19410   else
19411     ac_dir_suffix= ac_dots=
19412   fi
19413
19414   case $srcdir in
19415   .)  ac_srcdir=.
19416       if test -z "$ac_dots"; then
19417          ac_top_srcdir=.
19418       else
19419          ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'`
19420       fi ;;
19421   [\\/]* | ?:[\\/]* )
19422       ac_srcdir=$srcdir$ac_dir_suffix;
19423       ac_top_srcdir=$srcdir ;;
19424   *) # Relative path.
19425     ac_srcdir=$ac_dots$srcdir$ac_dir_suffix
19426     ac_top_srcdir=$ac_dots$srcdir ;;
19427   esac
19428
19429   case $INSTALL in
19430   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
19431   *) ac_INSTALL=$ac_dots$INSTALL ;;
19432   esac
19433
19434   if test x"$ac_file" != x-; then
19435     { echo "$as_me:19435: creating $ac_file" >&5
19436 echo "$as_me: creating $ac_file" >&6;}
19437     rm -f "$ac_file"
19438   fi
19439   # Let's still pretend it is `configure' which instantiates (i.e., don't
19440   # use $as_me), people would be surprised to read:
19441   #    /* config.h.  Generated automatically by config.status.  */
19442   configure_input="Generated automatically from `echo $ac_file_in |
19443                                                  sed 's,.*/,,'` by configure."
19444
19445   # First look for the input files in the build tree, otherwise in the
19446   # src tree.
19447   ac_file_inputs=`IFS=:
19448     for f in $ac_file_in; do
19449       case $f in
19450       -) echo $tmp/stdin ;;
19451       [\\/$]*)
19452          # Absolute (can't be DOS-style, as IFS=:)
19453          test -f "$f" || { { echo "$as_me:19453: error: cannot find input file: $f" >&5
19454 echo "$as_me: error: cannot find input file: $f" >&2;}
19455    { (exit 1); exit 1; }; }
19456          echo $f;;
19457       *) # Relative
19458          if test -f "$f"; then
19459            # Build tree
19460            echo $f
19461          elif test -f "$srcdir/$f"; then
19462            # Source tree
19463            echo $srcdir/$f
19464          else
19465            # /dev/null tree
19466            { { echo "$as_me:19466: error: cannot find input file: $f" >&5
19467 echo "$as_me: error: cannot find input file: $f" >&2;}
19468    { (exit 1); exit 1; }; }
19469          fi;;
19470       esac
19471     done` || { (exit 1); exit 1; }
19472 EOF
19473 cat >>$CONFIG_STATUS <<\EOF
19474   ac_warn_datarootdir=no
19475   if test x"$ac_file" != x-; then
19476     for ac_item in $ac_file_inputs
19477     do
19478       ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' $ac_item`
19479       if test -n "$ac_seen"; then
19480         ac_used=`grep '@datarootdir@' $ac_item`
19481         if test -z "$ac_used"; then
19482           { echo "$as_me:19482: WARNING: datarootdir was used implicitly but not set:
19483 $ac_seen" >&5
19484 echo "$as_me: WARNING: datarootdir was used implicitly but not set:
19485 $ac_seen" >&2;}
19486           ac_warn_datarootdir=yes
19487         fi
19488       fi
19489       ac_seen=`grep '${datarootdir}' $ac_item`
19490       if test -n "$ac_seen"; then
19491         { echo "$as_me:19491: WARNING: datarootdir was used explicitly but not set:
19492 $ac_seen" >&5
19493 echo "$as_me: WARNING: datarootdir was used explicitly but not set:
19494 $ac_seen" >&2;}
19495         ac_warn_datarootdir=yes
19496       fi
19497     done
19498   fi
19499
19500 if test "x$ac_warn_datarootdir" = xyes; then
19501   ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
19502 fi
19503
19504 EOF
19505 cat >>$CONFIG_STATUS <<EOF
19506   sed "$ac_vpsub
19507 $extrasub
19508 EOF
19509 cat >>$CONFIG_STATUS <<\EOF
19510 :t
19511 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
19512 s,@configure_input@,$configure_input,;t t
19513 s,@srcdir@,$ac_srcdir,;t t
19514 s,@top_srcdir@,$ac_top_srcdir,;t t
19515 s,@INSTALL@,$ac_INSTALL,;t t
19516 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
19517   rm -f $tmp/stdin
19518   if test x"$ac_file" != x-; then
19519     cp $tmp/out $ac_file
19520
19521     for ac_name in prefix exec_prefix datarootdir
19522     do
19523         ac_seen=`fgrep -n '${'$ac_name'[:=].*}' $ac_file`
19524         if test -n "$ac_seen"; then
19525             ac_init=`egrep '[   ]*'$ac_name'[   ]*=' $ac_file`
19526             if test -z "$ac_init"; then
19527               ac_seen=`echo "$ac_seen" |sed -e 's,^,'$ac_file':,'`
19528               { echo "$as_me:19528: WARNING: Variable $ac_name is used but was not set:
19529 $ac_seen" >&5
19530 echo "$as_me: WARNING: Variable $ac_name is used but was not set:
19531 $ac_seen" >&2;}
19532             fi
19533         fi
19534     done
19535     egrep -n '@[a-z_][a-z_0-9]+@' $ac_file >$tmp/out
19536     egrep -n '@[A-Z_][A-Z_0-9]+@' $ac_file >>$tmp/out
19537     if test -s $tmp/out; then
19538       ac_seen=`sed -e 's,^,'$ac_file':,' < $tmp/out`
19539       { echo "$as_me:19539: WARNING: Some variables may not be substituted:
19540 $ac_seen" >&5
19541 echo "$as_me: WARNING: Some variables may not be substituted:
19542 $ac_seen" >&2;}
19543     fi
19544   else
19545     cat $tmp/out
19546   fi
19547   rm -f $tmp/out
19548
19549 done
19550 EOF
19551 cat >>$CONFIG_STATUS <<\EOF
19552
19553 #
19554 # CONFIG_HEADER section.
19555 #
19556
19557 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
19558 # NAME is the cpp macro being defined and VALUE is the value it is being given.
19559 #
19560 # ac_d sets the value in "#define NAME VALUE" lines.
19561 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
19562 ac_dB='[        ].*$,\1#\2'
19563 ac_dC=' '
19564 ac_dD=',;t'
19565 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
19566 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
19567 ac_iB='\([      ]\),\1#\2define\3'
19568 ac_iC=' '
19569 ac_iD='\4,;t'
19570 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
19571 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
19572 ac_uB='$,\1#\2define\3'
19573 ac_uC=' '
19574 ac_uD=',;t'
19575
19576 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
19577   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
19578   case $ac_file in
19579   - | *:- | *:-:* ) # input from stdin
19580         cat >$tmp/stdin
19581         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
19582         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
19583   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
19584         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
19585   * )   ac_file_in=$ac_file.in ;;
19586   esac
19587
19588   test x"$ac_file" != x- && { echo "$as_me:19588: creating $ac_file" >&5
19589 echo "$as_me: creating $ac_file" >&6;}
19590
19591   # First look for the input files in the build tree, otherwise in the
19592   # src tree.
19593   ac_file_inputs=`IFS=:
19594     for f in $ac_file_in; do
19595       case $f in
19596       -) echo $tmp/stdin ;;
19597       [\\/$]*)
19598          # Absolute (can't be DOS-style, as IFS=:)
19599          test -f "$f" || { { echo "$as_me:19599: error: cannot find input file: $f" >&5
19600 echo "$as_me: error: cannot find input file: $f" >&2;}
19601    { (exit 1); exit 1; }; }
19602          echo $f;;
19603       *) # Relative
19604          if test -f "$f"; then
19605            # Build tree
19606            echo $f
19607          elif test -f "$srcdir/$f"; then
19608            # Source tree
19609            echo $srcdir/$f
19610          else
19611            # /dev/null tree
19612            { { echo "$as_me:19612: error: cannot find input file: $f" >&5
19613 echo "$as_me: error: cannot find input file: $f" >&2;}
19614    { (exit 1); exit 1; }; }
19615          fi;;
19616       esac
19617     done` || { (exit 1); exit 1; }
19618   # Remove the trailing spaces.
19619   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
19620
19621 EOF
19622
19623 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
19624 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
19625 # be either 'cat' or 'sort'.
19626 cat confdefs.h | uniq >conftest.vals
19627
19628 # Break up conftest.vals because some shells have a limit on
19629 # the size of here documents, and old seds have small limits too.
19630
19631 rm -f conftest.tail
19632 echo '  rm -f conftest.frag' >> $CONFIG_STATUS
19633 while grep . conftest.vals >/dev/null
19634 do
19635   # Write chunks of a limited-size here document to conftest.frag.
19636   echo '  cat >> conftest.frag <<CEOF' >> $CONFIG_STATUS
19637   sed ${ac_max_here_lines}q conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> $CONFIG_STATUS
19638   echo 'CEOF' >> $CONFIG_STATUS
19639   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
19640   rm -f conftest.vals
19641   mv conftest.tail conftest.vals
19642 done
19643 rm -f conftest.vals
19644
19645 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
19646 # marker @DEFS@.
19647 echo '  cat >> conftest.edit <<CEOF
19648 /@DEFS@/r conftest.frag
19649 /@DEFS@/d
19650 CEOF
19651 sed -f conftest.edit $tmp/in > $tmp/out
19652 rm -f $tmp/in
19653 mv $tmp/out $tmp/in
19654 rm -f conftest.edit conftest.frag
19655 ' >> $CONFIG_STATUS
19656
19657 cat >>$CONFIG_STATUS <<\EOF
19658   # Let's still pretend it is `configure' which instantiates (i.e., don't
19659   # use $as_me), people would be surprised to read:
19660   #    /* config.h.  Generated automatically by config.status.  */
19661   if test x"$ac_file" = x-; then
19662     echo "/* Generated automatically by configure.  */" >$tmp/config.h
19663   else
19664     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
19665   fi
19666   cat $tmp/in >>$tmp/config.h
19667   rm -f $tmp/in
19668   if test x"$ac_file" != x-; then
19669     if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
19670       { echo "$as_me:19670: $ac_file is unchanged" >&5
19671 echo "$as_me: $ac_file is unchanged" >&6;}
19672     else
19673       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
19674          X"$ac_file" : 'X\(//\)[^/]' \| \
19675          X"$ac_file" : 'X\(//\)$' \| \
19676          X"$ac_file" : 'X\(/\)' \| \
19677          .     : '\(.\)' 2>/dev/null ||
19678 echo X"$ac_file" |
19679     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
19680           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
19681           /^X\(\/\/\)$/{ s//\1/; q; }
19682           /^X\(\/\).*/{ s//\1/; q; }
19683           s/.*/./; q'`
19684       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
19685         { case "$ac_dir" in
19686   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
19687   *)                      as_incr_dir=.;;
19688 esac
19689 as_dummy="$ac_dir"
19690 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
19691   case $as_mkdir_dir in
19692     # Skip DOS drivespec
19693     ?:) as_incr_dir=$as_mkdir_dir ;;
19694     *)
19695       as_incr_dir=$as_incr_dir/$as_mkdir_dir
19696       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
19697     ;;
19698   esac
19699 done; }
19700
19701       fi
19702       rm -f $ac_file
19703       mv $tmp/config.h $ac_file
19704     fi
19705   else
19706     cat $tmp/config.h
19707     rm -f $tmp/config.h
19708   fi
19709 done
19710 EOF
19711 cat >>$CONFIG_STATUS <<\EOF
19712 #
19713 # CONFIG_COMMANDS section.
19714 #
19715 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
19716   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
19717   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
19718
19719   case $ac_dest in
19720     default )
19721
19722 for cf_dir in .
19723 do
19724         if test ! -d $srcdir/$cf_dir; then
19725                 continue
19726         elif test -f $srcdir/$cf_dir/programs; then
19727                 $AWK -f $srcdir/mk-test.awk INSTALL=yes ECHO_LINK="$ECHO_LD" $srcdir/$cf_dir/programs >>$cf_dir/Makefile
19728         fi
19729 done
19730
19731         cat >>Makefile <<TEST_EOF
19732
19733 # These rules are generated so we do not rely on suffix rules, which do not
19734 # work consistently for different make-programs (the '\$(MODEL)/' confuses
19735 # some, and the '\$x' confuses others).
19736 TEST_EOF
19737
19738 LIST=`sed -e 's/[       ].*//' -e '/^[#@]/d' $srcdir/modules`
19739 for N in $LIST
19740 do
19741         cat >>Makefile <<TEST_EOF
19742
19743 \$(MODEL)/$N.o : \$(srcdir)/$N.c \\
19744         \$(srcdir)/test.priv.h \\
19745         ncurses_cfg.h
19746         $SHOW_CC
19747         $ECHO_CC\$(CC) -c \$(CFLAGS_DEFAULT) -DMODULE_NAME="$N" \$(srcdir)/$N.c
19748 TEST_EOF
19749 done
19750
19751 if test -f ../config.guess && test -f ../config.sub
19752 then
19753         cat >>Makefile <<TEST_EOF
19754
19755 # if we used CF_INHERIT for getting these files, we can remove them
19756 distclean::
19757         rm -f config.guess config.sub
19758 TEST_EOF
19759 fi
19760  ;;
19761   esac
19762 done
19763 EOF
19764
19765 cat >>$CONFIG_STATUS <<\EOF
19766
19767 { (exit 0); exit 0; }
19768 EOF
19769 chmod +x $CONFIG_STATUS
19770 ac_clean_files=$ac_clean_files_save
19771
19772 # configure is writing to config.log, and then calls config.status.
19773 # config.status does its own redirection, appending to config.log.
19774 # Unfortunately, on DOS this fails, as config.log is still kept open
19775 # by configure, so config.status won't be able to write to it; its
19776 # output is simply discarded.  So we exec the FD to /dev/null,
19777 # effectively closing config.log, so it can be properly (re)opened and
19778 # appended to by config.status.  When coming back to configure, we
19779 # need to make the FD available again.
19780 if test "$no_create" != yes; then
19781   ac_cs_success=:
19782   exec 5>/dev/null
19783   $SHELL $CONFIG_STATUS || ac_cs_success=false
19784   exec 5>>config.log
19785   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
19786   # would make configure fail if this is the last instruction.
19787   $ac_cs_success || { (exit 1); exit 1; }
19788 fi
19789