]> ncurses.scripts.mit.edu Git - ncurses.git/blob - test/configure
ncurses 5.9 - patch 20150425
[ncurses.git] / test / configure
1 #! /bin/sh
2 # Guess values for system-dependent variables and create Makefiles.
3 # Generated by Autoconf 2.52.20141204.
4 #
5 # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
6 # Free Software Foundation, Inc.
7 # This configure script is free software; the Free Software Foundation
8 # gives unlimited permission to copy, distribute and modify it.
9
10 # Avoid depending upon Character Ranges.
11 as_cr_letters='abcdefghijklmnopqrstuvwxyz'
12 as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
13 as_cr_Letters=$as_cr_letters$as_cr_LETTERS
14 as_cr_digits='0123456789'
15 as_cr_alnum=$as_cr_Letters$as_cr_digits
16
17 # Sed expression to map a string onto a valid variable name.
18 as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
19
20 # Sed expression to map a string onto a valid CPP name.
21 as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
22
23 # Be Bourne compatible
24 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
25   emulate sh
26   NULLCMD=:
27 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
28   set -o posix
29 fi
30
31 # Name of the executable.
32 as_me=`echo "$0" |sed 's,.*[\\/],,'`
33
34 if expr a : '\(a\)' >/dev/null 2>&1; then
35   as_expr=expr
36 else
37   as_expr=false
38 fi
39
40 rm -f conf$$ conf$$.exe conf$$.file
41 echo >conf$$.file
42 if ln -s conf$$.file conf$$ 2>/dev/null; then
43   # We could just check for DJGPP; but this test a) works b) is more generic
44   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
45   if test -f conf$$.exe; then
46     # Don't use ln at all; we don't have any links
47     as_ln_s='cp -p'
48   else
49     as_ln_s='ln -s'
50   fi
51 elif ln conf$$.file conf$$ 2>/dev/null; then
52   as_ln_s=ln
53 else
54   as_ln_s='cp -p'
55 fi
56 rm -f conf$$ conf$$.exe conf$$.file
57
58 as_executable_p="test -f"
59
60 # Support unset when possible.
61 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
62   as_unset=unset
63 else
64   as_unset=false
65 fi
66
67 # NLS nuisances.
68 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
69 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
70 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
71 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
72 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
73 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
74 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
75 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
76
77 # IFS
78 # We need space, tab and new line, in precisely that order.
79 as_nl='
80 '
81 IFS="   $as_nl"
82
83 # CDPATH.
84 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
85
86 # Name of the host.
87 # hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
88 # so uname gets run too.
89 ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
90
91 exec 6>&1
92
93 #
94 # Initializations.
95 #
96 ac_default_prefix=/usr/local
97 cross_compiling=no
98 subdirs=
99 MFLAGS= MAKEFLAGS=
100 SHELL=${CONFIG_SHELL-/bin/sh}
101
102 # Maximum number of lines to put in a shell here document.
103 # This variable seems obsolete.  It should probably be removed, and
104 # only ac_max_sed_lines should be used.
105 : ${ac_max_here_lines=38}
106
107 ac_unique_file="ncurses.c"
108
109 # Initialize some variables set by options.
110 ac_init_help=
111 ac_init_version=false
112 # The variables have the same names as the options, with
113 # dashes changed to underlines.
114 cache_file=/dev/null
115 exec_prefix=NONE
116 no_create=
117 no_recursion=
118 prefix=NONE
119 program_prefix=NONE
120 program_suffix=NONE
121 program_transform_name=s,x,x,
122 silent=
123 site=
124 srcdir=
125 verbose=
126 x_includes=NONE
127 x_libraries=NONE
128
129 # Installation directory options.
130 # These are left unexpanded so users can "make install exec_prefix=/foo"
131 # and all the variables that are supposed to be based on exec_prefix
132 # by default will actually change.
133 # Use braces instead of parens because sh, perl, etc. also accept them.
134 bindir='${exec_prefix}/bin'
135 sbindir='${exec_prefix}/sbin'
136 libexecdir='${exec_prefix}/libexec'
137 datarootdir='${prefix}/share'
138 datadir='${datarootdir}'
139 sysconfdir='${prefix}/etc'
140 sharedstatedir='${prefix}/com'
141 localstatedir='${prefix}/var'
142 libdir='${exec_prefix}/lib'
143 includedir='${prefix}/include'
144 oldincludedir='/usr/include'
145 infodir='${datarootdir}/info'
146 mandir='${datarootdir}/man'
147
148 # Identity of this package.
149 PACKAGE_NAME=
150 PACKAGE_TARNAME=
151 PACKAGE_VERSION=
152 PACKAGE_STRING=
153 PACKAGE_BUGREPORT=
154
155 ac_prev=
156 for ac_option
157 do
158   # If the previous option needs an argument, assign it.
159   if test -n "$ac_prev"; then
160     eval "$ac_prev=\$ac_option"
161     ac_prev=
162     continue
163   fi
164
165   ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
166
167   # Accept the important Cygnus configure options, so we can diagnose typos.
168
169   case $ac_option in
170
171   -bindir | --bindir | --bindi | --bind | --bin | --bi)
172     ac_prev=bindir ;;
173   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
174     bindir=$ac_optarg ;;
175
176   -build | --build | --buil | --bui | --bu)
177     ac_prev=build_alias ;;
178   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
179     build_alias=$ac_optarg ;;
180
181   -cache-file | --cache-file | --cache-fil | --cache-fi \
182   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
183     ac_prev=cache_file ;;
184   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
185   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
186     cache_file=$ac_optarg ;;
187
188   --config-cache | -C)
189     cache_file=config.cache ;;
190
191   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
192     ac_prev=datadir ;;
193   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
194   | --da=*)
195     datadir=$ac_optarg ;;
196
197   -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
198   | --dataroo | --dataro | --datar)
199     ac_prev=datarootdir ;;
200   -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
201   | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
202     datarootdir=$ac_optarg ;;
203
204   -disable-* | --disable-*)
205     ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
206     # Reject names that are not valid shell variable names.
207     expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
208       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
209    { (exit 1); exit 1; }; }
210     ac_feature=`echo $ac_feature | sed 's/-/_/g'`
211     eval "enable_$ac_feature=no" ;;
212
213   -enable-* | --enable-*)
214     ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
215     # Reject names that are not valid shell variable names.
216     expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
217       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
218    { (exit 1); exit 1; }; }
219     ac_feature=`echo $ac_feature | sed 's/-/_/g'`
220     case $ac_option in
221       *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
222       *) ac_optarg=yes ;;
223     esac
224     eval "enable_$ac_feature='$ac_optarg'" ;;
225
226   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
227   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
228   | --exec | --exe | --ex)
229     ac_prev=exec_prefix ;;
230   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
231   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
232   | --exec=* | --exe=* | --ex=*)
233     exec_prefix=$ac_optarg ;;
234
235   -gas | --gas | --ga | --g)
236     # Obsolete; use --with-gas.
237     with_gas=yes ;;
238
239   -help | --help | --hel | --he | -h)
240     ac_init_help=long ;;
241   -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
242     ac_init_help=recursive ;;
243   -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
244     ac_init_help=short ;;
245
246   -host | --host | --hos | --ho)
247     ac_prev=host_alias ;;
248   -host=* | --host=* | --hos=* | --ho=*)
249     host_alias=$ac_optarg ;;
250
251   -includedir | --includedir | --includedi | --included | --include \
252   | --includ | --inclu | --incl | --inc)
253     ac_prev=includedir ;;
254   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
255   | --includ=* | --inclu=* | --incl=* | --inc=*)
256     includedir=$ac_optarg ;;
257
258   -infodir | --infodir | --infodi | --infod | --info | --inf)
259     ac_prev=infodir ;;
260   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
261     infodir=$ac_optarg ;;
262
263   -libdir | --libdir | --libdi | --libd)
264     ac_prev=libdir ;;
265   -libdir=* | --libdir=* | --libdi=* | --libd=*)
266     libdir=$ac_optarg ;;
267
268   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
269   | --libexe | --libex | --libe)
270     ac_prev=libexecdir ;;
271   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
272   | --libexe=* | --libex=* | --libe=*)
273     libexecdir=$ac_optarg ;;
274
275   -localstatedir | --localstatedir | --localstatedi | --localstated \
276   | --localstate | --localstat | --localsta | --localst \
277   | --locals | --local | --loca | --loc | --lo)
278     ac_prev=localstatedir ;;
279   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
280   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
281   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
282     localstatedir=$ac_optarg ;;
283
284   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
285     ac_prev=mandir ;;
286   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
287     mandir=$ac_optarg ;;
288
289   -nfp | --nfp | --nf)
290     # Obsolete; use --without-fp.
291     with_fp=no ;;
292
293   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
294   | --no-cr | --no-c)
295     no_create=yes ;;
296
297   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
298   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
299     no_recursion=yes ;;
300
301   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
302   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
303   | --oldin | --oldi | --old | --ol | --o)
304     ac_prev=oldincludedir ;;
305   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
306   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
307   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
308     oldincludedir=$ac_optarg ;;
309
310   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
311     ac_prev=prefix ;;
312   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
313     prefix=$ac_optarg ;;
314
315   -program-prefix | --program-prefix | --program-prefi | --program-pref \
316   | --program-pre | --program-pr | --program-p)
317     ac_prev=program_prefix ;;
318   -program-prefix=* | --program-prefix=* | --program-prefi=* \
319   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
320     program_prefix=$ac_optarg ;;
321
322   -program-suffix | --program-suffix | --program-suffi | --program-suff \
323   | --program-suf | --program-su | --program-s)
324     ac_prev=program_suffix ;;
325   -program-suffix=* | --program-suffix=* | --program-suffi=* \
326   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
327     program_suffix=$ac_optarg ;;
328
329   -program-transform-name | --program-transform-name \
330   | --program-transform-nam | --program-transform-na \
331   | --program-transform-n | --program-transform- \
332   | --program-transform | --program-transfor \
333   | --program-transfo | --program-transf \
334   | --program-trans | --program-tran \
335   | --progr-tra | --program-tr | --program-t)
336     ac_prev=program_transform_name ;;
337   -program-transform-name=* | --program-transform-name=* \
338   | --program-transform-nam=* | --program-transform-na=* \
339   | --program-transform-n=* | --program-transform-=* \
340   | --program-transform=* | --program-transfor=* \
341   | --program-transfo=* | --program-transf=* \
342   | --program-trans=* | --program-tran=* \
343   | --progr-tra=* | --program-tr=* | --program-t=*)
344     program_transform_name=$ac_optarg ;;
345
346   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
347   | -silent | --silent | --silen | --sile | --sil)
348     silent=yes ;;
349
350   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
351     ac_prev=sbindir ;;
352   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
353   | --sbi=* | --sb=*)
354     sbindir=$ac_optarg ;;
355
356   -sharedstatedir | --sharedstatedir | --sharedstatedi \
357   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
358   | --sharedst | --shareds | --shared | --share | --shar \
359   | --sha | --sh)
360     ac_prev=sharedstatedir ;;
361   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
362   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
363   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
364   | --sha=* | --sh=*)
365     sharedstatedir=$ac_optarg ;;
366
367   -site | --site | --sit)
368     ac_prev=site ;;
369   -site=* | --site=* | --sit=*)
370     site=$ac_optarg ;;
371
372   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
373     ac_prev=srcdir ;;
374   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
375     srcdir=$ac_optarg ;;
376
377   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
378   | --syscon | --sysco | --sysc | --sys | --sy)
379     ac_prev=sysconfdir ;;
380   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
381   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
382     sysconfdir=$ac_optarg ;;
383
384   -target | --target | --targe | --targ | --tar | --ta | --t)
385     ac_prev=target_alias ;;
386   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
387     target_alias=$ac_optarg ;;
388
389   -v | -verbose | --verbose | --verbos | --verbo | --verb)
390     verbose=yes ;;
391
392   -version | --version | --versio | --versi | --vers | -V)
393     ac_init_version=: ;;
394
395   -with-* | --with-*)
396     ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
397     # Reject names that are not valid shell variable names.
398     expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
399       { echo "$as_me: error: invalid package name: $ac_package" >&2
400    { (exit 1); exit 1; }; }
401     ac_package=`echo $ac_package| sed 's/-/_/g'`
402     case $ac_option in
403       *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
404       *) ac_optarg=yes ;;
405     esac
406     eval "with_$ac_package='$ac_optarg'" ;;
407
408   -without-* | --without-*)
409     ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
410     # Reject names that are not valid shell variable names.
411     expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
412       { echo "$as_me: error: invalid package name: $ac_package" >&2
413    { (exit 1); exit 1; }; }
414     ac_package=`echo $ac_package | sed 's/-/_/g'`
415     eval "with_$ac_package=no" ;;
416
417   --x)
418     # Obsolete; use --with-x.
419     with_x=yes ;;
420
421   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
422   | --x-incl | --x-inc | --x-in | --x-i)
423     ac_prev=x_includes ;;
424   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
425   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
426     x_includes=$ac_optarg ;;
427
428   -x-libraries | --x-libraries | --x-librarie | --x-librari \
429   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
430     ac_prev=x_libraries ;;
431   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
432   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
433     x_libraries=$ac_optarg ;;
434
435   -*) { echo "$as_me: error: unrecognized option: $ac_option
436 Try \`$0 --help' for more information." >&2
437    { (exit 1); exit 1; }; }
438     ;;
439
440   *=*)
441     ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
442     # Reject names that are not valid shell variable names.
443     expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
444       { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
445    { (exit 1); exit 1; }; }
446     ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
447     eval "$ac_envvar='$ac_optarg'"
448     export $ac_envvar ;;
449
450   *)
451     # FIXME: should be removed in autoconf 3.0.
452     echo "$as_me: WARNING: you should use --build, --host, --target" >&2
453     expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
454       echo "$as_me: WARNING: invalid host type: $ac_option" >&2
455     : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
456     ;;
457
458   esac
459 done
460
461 if test -n "$ac_prev"; then
462   ac_option=--`echo $ac_prev | sed 's/_/-/g'`
463   { echo "$as_me: error: missing argument to $ac_option" >&2
464    { (exit 1); exit 1; }; }
465 fi
466
467 # Be sure to have absolute paths.
468 for ac_var in exec_prefix prefix
469 do
470   eval ac_val=$`echo $ac_var`
471   case $ac_val in
472     [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
473     *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
474    { (exit 1); exit 1; }; };;
475   esac
476 done
477
478 # Be sure to have absolute paths.
479 for ac_var in bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir \
480               localstatedir libdir includedir oldincludedir infodir mandir
481 do
482   eval ac_val=$`echo $ac_var`
483   case $ac_val in
484     [\\/$]* | ?:[\\/]* ) ;;
485     *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
486    { (exit 1); exit 1; }; };;
487   esac
488 done
489
490 # There might be people who depend on the old broken behavior: `$host'
491 # used to hold the argument of --host etc.
492 build=$build_alias
493 host=$host_alias
494 target=$target_alias
495
496 # FIXME: should be removed in autoconf 3.0.
497 if test "x$host_alias" != x; then
498   if test "x$build_alias" = x; then
499     cross_compiling=maybe
500     echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
501     If a cross compiler is detected then cross compile mode will be used." >&2
502   elif test "x$build_alias" != "x$host_alias"; then
503     cross_compiling=yes
504   fi
505 fi
506
507 ac_tool_prefix=
508 test -n "$host_alias" && ac_tool_prefix=$host_alias-
509
510 test "$silent" = yes && exec 6>/dev/null
511
512 # Find the source files, if location was not specified.
513 if test -z "$srcdir"; then
514   ac_srcdir_defaulted=yes
515   # Try the directory containing this script, then its parent.
516   ac_prog=$0
517   ac_confdir=`echo "$ac_prog" | sed 's%[\\/][^\\/][^\\/]*$%%'`
518   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
519   srcdir=$ac_confdir
520   if test ! -r $srcdir/$ac_unique_file; then
521     srcdir=..
522   fi
523 else
524   ac_srcdir_defaulted=no
525 fi
526 if test ! -r $srcdir/$ac_unique_file; then
527   if test "$ac_srcdir_defaulted" = yes; then
528     { echo "$as_me: error: cannot find sources in $ac_confdir or .." >&2
529    { (exit 1); exit 1; }; }
530   else
531     { echo "$as_me: error: cannot find sources in $srcdir" >&2
532    { (exit 1); exit 1; }; }
533   fi
534 fi
535 srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
536 ac_env_build_alias_set=${build_alias+set}
537 ac_env_build_alias_value=$build_alias
538 ac_cv_env_build_alias_set=${build_alias+set}
539 ac_cv_env_build_alias_value=$build_alias
540 ac_env_host_alias_set=${host_alias+set}
541 ac_env_host_alias_value=$host_alias
542 ac_cv_env_host_alias_set=${host_alias+set}
543 ac_cv_env_host_alias_value=$host_alias
544 ac_env_target_alias_set=${target_alias+set}
545 ac_env_target_alias_value=$target_alias
546 ac_cv_env_target_alias_set=${target_alias+set}
547 ac_cv_env_target_alias_value=$target_alias
548 ac_env_CC_set=${CC+set}
549 ac_env_CC_value=$CC
550 ac_cv_env_CC_set=${CC+set}
551 ac_cv_env_CC_value=$CC
552 ac_env_CFLAGS_set=${CFLAGS+set}
553 ac_env_CFLAGS_value=$CFLAGS
554 ac_cv_env_CFLAGS_set=${CFLAGS+set}
555 ac_cv_env_CFLAGS_value=$CFLAGS
556 ac_env_LDFLAGS_set=${LDFLAGS+set}
557 ac_env_LDFLAGS_value=$LDFLAGS
558 ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
559 ac_cv_env_LDFLAGS_value=$LDFLAGS
560 ac_env_CPPFLAGS_set=${CPPFLAGS+set}
561 ac_env_CPPFLAGS_value=$CPPFLAGS
562 ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
563 ac_cv_env_CPPFLAGS_value=$CPPFLAGS
564 ac_env_CPP_set=${CPP+set}
565 ac_env_CPP_value=$CPP
566 ac_cv_env_CPP_set=${CPP+set}
567 ac_cv_env_CPP_value=$CPP
568
569 #
570 # Report the --help message.
571 #
572 if test "$ac_init_help" = "long"; then
573   # Omit some internal or obsolete options to make the list less imposing.
574   # This message is too long to be a string in the A/UX 3.1 sh.
575   cat <<EOF
576 \`configure' configures this package to adapt to many kinds of systems.
577
578 Usage: $0 [OPTION]... [VAR=VALUE]...
579
580 To assign environment variables (e.g., CC, CFLAGS...), specify them as
581 VAR=VALUE.  See below for descriptions of some of the useful variables.
582
583 Defaults for the options are specified in brackets.
584
585 Configuration:
586   -h, --help              display this help and exit
587       --help=short        display options specific to this package
588       --help=recursive    display the short help of all the included packages
589   -V, --version           display version information and exit
590   -q, --quiet, --silent   do not print \`checking...' messages
591       --cache-file=FILE   cache test results in FILE [disabled]
592   -C, --config-cache      alias for \`--cache-file=config.cache'
593   -n, --no-create         do not create output files
594       --srcdir=DIR        find the sources in DIR [configure dir or \`..']
595
596 EOF
597
598   cat <<EOF
599 Installation directories:
600   --prefix=PREFIX         install architecture-independent files in PREFIX
601                           [$ac_default_prefix]
602   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
603                           [PREFIX]
604
605 By default, \`make install' will install all the files in
606 \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
607 an installation prefix other than \`$ac_default_prefix' using \`--prefix',
608 for instance \`--prefix=\$HOME'.
609
610 For better control, use the options below.
611
612 Fine tuning of the installation directories:
613   --bindir=DIR            user executables [EPREFIX/bin]
614   --sbindir=DIR           system admin executables [EPREFIX/sbin]
615   --libexecdir=DIR        program executables [EPREFIX/libexec]
616   --datarootdir=DIR       read-only architecture-independent data [PREFIX/share]
617   --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
618   --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
619   --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
620   --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
621   --libdir=DIR            object code libraries [EPREFIX/lib]
622   --includedir=DIR        C header files [PREFIX/include]
623   --oldincludedir=DIR     C header files for non-gcc [/usr/include]
624   --infodir=DIR           info documentation [DATAROOTDIR/info]
625   --mandir=DIR            man documentation [DATAROOTDIR/man]
626 EOF
627
628   cat <<\EOF
629
630 Program names:
631   --program-prefix=PREFIX            prepend PREFIX to installed program names
632   --program-suffix=SUFFIX            append SUFFIX to installed program names
633   --program-transform-name=PROGRAM   run sed PROGRAM on installed program names
634
635 X features:
636   --x-includes=DIR    X include files are in DIR
637   --x-libraries=DIR   X library files are in DIR
638
639 System types:
640   --build=BUILD           configure for building on BUILD [guessed]
641   --host=HOST       build programs to run on HOST [BUILD]
642 EOF
643 fi
644
645 if test -n "$ac_init_help"; then
646
647   cat <<\EOF
648
649 Optional Packages:
650   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
651   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
652
653 Optional Features:
654   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
655   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
656
657 General Options:
658   --with-pkg-config{=path} enable/disable use of pkg-config
659   --disable-echo          do not display "compiling" commands
660 Curses Version-dependent Options:
661   --with-ncurses-wrap-prefix naming-prefix for ncurses wrapped-variables
662   --disable-widec         disable checks for wide-character functions
663   --with-curses-dir=DIR   directory in which (n)curses is installed
664   --with-screen=XXX       use specified curses-libraries
665   --with-ncursesw         use wide ncurses-libraries
666   --with-ncurses          use ncurses-libraries
667   --with-pdcurses         compile/link with pdcurses X11 library
668   --with-curses-colr      compile/link with HPUX 10.x color-curses
669   --with-curses-5lib      compile/link with SunOS 5lib curses
670   --with-Xaw3d            link with Xaw 3d library
671   --with-Xaw3dxft         link with Xaw 3d xft library
672   --with-neXtaw           link with neXT Athena library
673   --with-XawPlus          link with Athena-Plus library
674   --with-x                use the X Window System
675 Testing/development Options:
676   --enable-warnings       test: turn on gcc compiler warnings
677   --with-dmalloc          test: use Gray Watson's dmalloc library
678   --with-dbmalloc         test: use Conor Cahill's dbmalloc library
679   --with-valgrind         test: use valgrind
680   --disable-leaks         test: free permanent memory, analyze leaks
681   --disable-rpath-hack    don't add rpath options for additional libraries
682
683 Some influential environment variables:
684   CC          C compiler command
685   CFLAGS      C compiler flags
686   LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
687               nonstandard directory <lib dir>
688   CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
689               headers in a nonstandard directory <include dir>
690   CPP         C preprocessor
691
692 Use these variables to override the choices made by `configure' or to help
693 it to find libraries and programs with nonstandard names/locations.
694
695 EOF
696 fi
697
698 if test "$ac_init_help" = "recursive"; then
699   # If there are subdirs, report their specific --help.
700   ac_popdir=`pwd`
701   for ac_subdir in : $ac_subdirs_all; do test "x$ac_subdir" = x: && continue
702     cd $ac_subdir
703     # A "../" for each directory in /$ac_subdir.
704     ac_dots=`echo $ac_subdir |
705              sed 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g'`
706
707     case $srcdir in
708     .) # No --srcdir option.  We are building in place.
709       ac_sub_srcdir=$srcdir ;;
710     [\\/]* | ?:[\\/]* ) # Absolute path.
711       ac_sub_srcdir=$srcdir/$ac_subdir ;;
712     *) # Relative path.
713       ac_sub_srcdir=$ac_dots$srcdir/$ac_subdir ;;
714     esac
715
716     # Check for guested configure; otherwise get Cygnus style configure.
717     if test -f $ac_sub_srcdir/configure.gnu; then
718       echo
719       $SHELL $ac_sub_srcdir/configure.gnu  --help=recursive
720     elif test -f $ac_sub_srcdir/configure; then
721       echo
722       $SHELL $ac_sub_srcdir/configure  --help=recursive
723     elif test -f $ac_sub_srcdir/configure.ac ||
724            test -f $ac_sub_srcdir/configure.in; then
725       echo
726       $ac_configure --help
727     else
728       echo "$as_me: WARNING: no configuration information is in $ac_subdir" >&2
729     fi
730     cd $ac_popdir
731   done
732 fi
733
734 test -n "$ac_init_help" && exit 0
735 if $ac_init_version; then
736   cat <<\EOF
737
738 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
739 Free Software Foundation, Inc.
740 This configure script is free software; the Free Software Foundation
741 gives unlimited permission to copy, distribute and modify it.
742 EOF
743   exit 0
744 fi
745 exec 5>config.log
746 cat >&5 <<EOF
747 This file contains any messages produced by compilers while
748 running configure, to aid debugging if configure makes a mistake.
749
750 It was created by $as_me, which was
751 generated by GNU Autoconf 2.52.20141204.  Invocation command line was
752
753   $ $0 $@
754
755 EOF
756 {
757 cat <<_ASUNAME
758 ## ---------- ##
759 ## Platform.  ##
760 ## ---------- ##
761
762 hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
763 uname -m = `(uname -m) 2>/dev/null || echo unknown`
764 uname -r = `(uname -r) 2>/dev/null || echo unknown`
765 uname -s = `(uname -s) 2>/dev/null || echo unknown`
766 uname -v = `(uname -v) 2>/dev/null || echo unknown`
767
768 /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
769 /bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
770
771 /bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
772 /usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
773 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
774 hostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
775 /bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
776 /usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
777 /bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
778
779 PATH = $PATH
780
781 _ASUNAME
782 } >&5
783
784 cat >&5 <<EOF
785 ## ------------ ##
786 ## Core tests.  ##
787 ## ------------ ##
788
789 EOF
790
791 # Keep a trace of the command line.
792 # Strip out --no-create and --no-recursion so they do not pile up.
793 # Also quote any args containing shell meta-characters.
794 ac_configure_args=
795 ac_sep=
796 for ac_arg
797 do
798   case $ac_arg in
799   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
800   | --no-cr | --no-c) ;;
801   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
802   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
803   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
804     ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"`
805     ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
806     ac_sep=" " ;;
807   *) ac_configure_args="$ac_configure_args$ac_sep$ac_arg"
808      ac_sep=" " ;;
809   esac
810   # Get rid of the leading space.
811 done
812
813 # When interrupted or exit'd, cleanup temporary files, and complete
814 # config.log.  We remove comments because anyway the quotes in there
815 # would cause problems or look ugly.
816 trap 'exit_status=$?
817   # Save into config.log some information that might help in debugging.
818   echo >&5
819   echo "## ----------------- ##" >&5
820   echo "## Cache variables.  ##" >&5
821   echo "## ----------------- ##" >&5
822   echo >&5
823   # The following way of writing the cache mishandles newlines in values,
824 {
825   (set) 2>&1 |
826     case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
827     *ac_space=\ *)
828       sed -n \
829         "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
830           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
831       ;;
832     *)
833       sed -n \
834         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
835       ;;
836     esac;
837 } >&5
838   sed "/^$/d" confdefs.h >conftest.log
839   if test -s conftest.log; then
840     echo >&5
841     echo "## ------------ ##" >&5
842     echo "## confdefs.h.  ##" >&5
843     echo "## ------------ ##" >&5
844     echo >&5
845     cat conftest.log >&5
846   fi
847   (echo; echo) >&5
848   test "$ac_signal" != 0 &&
849     echo "$as_me: caught signal $ac_signal" >&5
850   echo "$as_me: exit $exit_status" >&5
851   rm -rf conftest* confdefs* core core.* *.core conf$$* $ac_clean_files &&
852     exit $exit_status
853      ' 0
854 for ac_signal in 1 2 13 15; do
855   trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
856 done
857 ac_signal=0
858
859 # confdefs.h avoids OS command line length limits that DEFS can exceed.
860 rm -rf conftest* confdefs.h
861 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
862 echo >confdefs.h
863
864 # Let the site file select an alternate cache file if it wants to.
865 # Prefer explicitly selected file to automatically selected ones.
866 if test -z "$CONFIG_SITE"; then
867   if test "x$prefix" != xNONE; then
868     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
869   else
870     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
871   fi
872 fi
873 for ac_site_file in $CONFIG_SITE; do
874   if test -r "$ac_site_file"; then
875     { echo "$as_me:875: loading site script $ac_site_file" >&5
876 echo "$as_me: loading site script $ac_site_file" >&6;}
877     cat "$ac_site_file" >&5
878     . "$ac_site_file"
879   fi
880 done
881
882 if test -r "$cache_file"; then
883   # Some versions of bash will fail to source /dev/null (special
884   # files actually), so we avoid doing that.
885   if test -f "$cache_file"; then
886     { echo "$as_me:886: loading cache $cache_file" >&5
887 echo "$as_me: loading cache $cache_file" >&6;}
888     case $cache_file in
889       [\\/]* | ?:[\\/]* ) . $cache_file;;
890       *)                      . ./$cache_file;;
891     esac
892   fi
893 else
894   { echo "$as_me:894: creating cache $cache_file" >&5
895 echo "$as_me: creating cache $cache_file" >&6;}
896   >$cache_file
897 fi
898
899 # Check that the precious variables saved in the cache have kept the same
900 # value.
901 ac_cache_corrupted=false
902 for ac_var in `(set) 2>&1 |
903                sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
904   eval ac_old_set=\$ac_cv_env_${ac_var}_set
905   eval ac_new_set=\$ac_env_${ac_var}_set
906   eval ac_old_val="\$ac_cv_env_${ac_var}_value"
907   eval ac_new_val="\$ac_env_${ac_var}_value"
908   case $ac_old_set,$ac_new_set in
909     set,)
910       { echo "$as_me:910: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
911 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
912       ac_cache_corrupted=: ;;
913     ,set)
914       { echo "$as_me:914: error: \`$ac_var' was not set in the previous run" >&5
915 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
916       ac_cache_corrupted=: ;;
917     ,);;
918     *)
919       if test "x$ac_old_val" != "x$ac_new_val"; then
920         { echo "$as_me:920: error: \`$ac_var' has changed since the previous run:" >&5
921 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
922         { echo "$as_me:922:   former value:  $ac_old_val" >&5
923 echo "$as_me:   former value:  $ac_old_val" >&2;}
924         { echo "$as_me:924:   current value: $ac_new_val" >&5
925 echo "$as_me:   current value: $ac_new_val" >&2;}
926         ac_cache_corrupted=:
927       fi;;
928   esac
929   # Pass precious variables to config.status.  It doesn't matter if
930   # we pass some twice (in addition to the command line arguments).
931   if test "$ac_new_set" = set; then
932     case $ac_new_val in
933     *" "*|*"    "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
934       ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"`
935       ac_configure_args="$ac_configure_args '$ac_arg'"
936       ;;
937     *) ac_configure_args="$ac_configure_args $ac_var=$ac_new_val"
938        ;;
939     esac
940   fi
941 done
942 if $ac_cache_corrupted; then
943   { echo "$as_me:943: error: changes in the environment can compromise the build" >&5
944 echo "$as_me: error: changes in the environment can compromise the build" >&2;}
945   { { echo "$as_me:945: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
946 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
947    { (exit 1); exit 1; }; }
948 fi
949
950 ac_ext=c
951 ac_cpp='$CPP $CPPFLAGS'
952 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
953 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
954 ac_compiler_gnu=$ac_cv_c_compiler_gnu
955 ac_main_return=return
956
957 case `echo "testing\c" 2>/dev/null; echo 1,2,3`,`echo -n testing 2>/dev/null; echo 1,2,3` in
958   *c*,-n*) ECHO_N= ECHO_C=      # newlines do not sed ;-) only broken shells would use this case anyway
959                    ECHO_T='     ' ;;
960   *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
961   *)      ECHO_N= ECHO_C='\c' ECHO_T= ;;
962 esac
963 echo "#! $SHELL" >conftest.sh
964 echo  "exit 0"   >>conftest.sh
965 chmod +x conftest.sh
966 if { (echo "$as_me:966: PATH=\".;.\"; conftest.sh") >&5
967   (PATH=".;."; conftest.sh) 2>&5
968   ac_status=$?
969   echo "$as_me:969: \$? = $ac_status" >&5
970   (exit $ac_status); }; then
971   ac_path_separator=';'
972 else
973   ac_path_separator=:
974 fi
975 PATH_SEPARATOR="$ac_path_separator"
976 rm -f conftest.sh
977
978 ac_config_headers="$ac_config_headers ncurses_cfg.h:ncurses_tst.hin"
979
980 test -f config.guess || ( test -f ../config.guess && cp ../config.guess ./ )
981
982 test -f config.sub || ( test -f ../config.sub && cp ../config.sub ./ )
983
984 ac_aux_dir=
985 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
986   if test -f $ac_dir/install-sh; then
987     ac_aux_dir=$ac_dir
988     ac_install_sh="$ac_aux_dir/install-sh -c"
989     break
990   elif test -f $ac_dir/install.sh; then
991     ac_aux_dir=$ac_dir
992     ac_install_sh="$ac_aux_dir/install.sh -c"
993     break
994   elif test -f $ac_dir/shtool; then
995     ac_aux_dir=$ac_dir
996     ac_install_sh="$ac_aux_dir/shtool install -c"
997     break
998   fi
999 done
1000 if test -z "$ac_aux_dir"; then
1001   { { echo "$as_me:1001: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
1002 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
1003    { (exit 1); exit 1; }; }
1004 fi
1005 ac_config_guess="$SHELL $ac_aux_dir/config.guess"
1006 ac_config_sub="$SHELL $ac_aux_dir/config.sub"
1007 ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
1008
1009 # Make sure we can run config.sub.
1010 $ac_config_sub sun4 >/dev/null 2>&1 ||
1011   { { echo "$as_me:1011: error: cannot run $ac_config_sub" >&5
1012 echo "$as_me: error: cannot run $ac_config_sub" >&2;}
1013    { (exit 1); exit 1; }; }
1014
1015 echo "$as_me:1015: checking build system type" >&5
1016 echo $ECHO_N "checking build system type... $ECHO_C" >&6
1017 if test "${ac_cv_build+set}" = set; then
1018   echo $ECHO_N "(cached) $ECHO_C" >&6
1019 else
1020   ac_cv_build_alias=$build_alias
1021 test -z "$ac_cv_build_alias" &&
1022   ac_cv_build_alias=`$ac_config_guess`
1023 test -z "$ac_cv_build_alias" &&
1024   { { echo "$as_me:1024: error: cannot guess build type; you must specify one" >&5
1025 echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
1026    { (exit 1); exit 1; }; }
1027 ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
1028   { { echo "$as_me:1028: error: $ac_config_sub $ac_cv_build_alias failed." >&5
1029 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed." >&2;}
1030    { (exit 1); exit 1; }; }
1031
1032 fi
1033 echo "$as_me:1033: result: $ac_cv_build" >&5
1034 echo "${ECHO_T}$ac_cv_build" >&6
1035 build=$ac_cv_build
1036 build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1037 build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1038 build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1039
1040 if test -f $srcdir/config.guess || test -f $ac_aux_dir/config.guess ; then
1041         echo "$as_me:1041: checking host system type" >&5
1042 echo $ECHO_N "checking host system type... $ECHO_C" >&6
1043 if test "${ac_cv_host+set}" = set; then
1044   echo $ECHO_N "(cached) $ECHO_C" >&6
1045 else
1046   ac_cv_host_alias=$host_alias
1047 test -z "$ac_cv_host_alias" &&
1048   ac_cv_host_alias=$ac_cv_build_alias
1049 ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
1050   { { echo "$as_me:1050: error: $ac_config_sub $ac_cv_host_alias failed" >&5
1051 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
1052    { (exit 1); exit 1; }; }
1053
1054 fi
1055 echo "$as_me:1055: result: $ac_cv_host" >&5
1056 echo "${ECHO_T}$ac_cv_host" >&6
1057 host=$ac_cv_host
1058 host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1059 host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1060 host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1061
1062         system_name="$host_os"
1063 else
1064         system_name="`(uname -s -r) 2>/dev/null`"
1065         if test -z "$system_name" ; then
1066                 system_name="`(hostname) 2>/dev/null`"
1067         fi
1068 fi
1069 test -n "$system_name" &&
1070 cat >>confdefs.h <<EOF
1071 #define SYSTEM_NAME "$system_name"
1072 EOF
1073
1074 if test "${cf_cv_system_name+set}" = set; then
1075   echo $ECHO_N "(cached) $ECHO_C" >&6
1076 else
1077   cf_cv_system_name="$system_name"
1078 fi
1079
1080 test -z "$system_name" && system_name="$cf_cv_system_name"
1081 test -n "$cf_cv_system_name" && echo "$as_me:1081: result: Configuring for $cf_cv_system_name" >&5
1082 echo "${ECHO_T}Configuring for $cf_cv_system_name" >&6
1083
1084 if test ".$system_name" != ".$cf_cv_system_name" ; then
1085         echo "$as_me:1085: result: Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&5
1086 echo "${ECHO_T}Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&6
1087         { { echo "$as_me:1087: error: \"Please remove config.cache and try again.\"" >&5
1088 echo "$as_me: error: \"Please remove config.cache and try again.\"" >&2;}
1089    { (exit 1); exit 1; }; }
1090 fi
1091
1092 test "$program_prefix" != NONE &&
1093   program_transform_name="s,^,$program_prefix,;$program_transform_name"
1094 # Use a double $ so make ignores it.
1095 test "$program_suffix" != NONE &&
1096   program_transform_name="s,\$,$program_suffix,;$program_transform_name"
1097 # Double any \ or $.  echo might interpret backslashes.
1098 # By default was `s,x,x', remove it if useless.
1099 cat <<\_ACEOF >conftest.sed
1100 s/[\\$]/&&/g;s/;s,x,x,$//
1101 _ACEOF
1102 program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
1103 rm conftest.sed
1104
1105 echo "$as_me:1105: checking whether ${MAKE-make} sets \${MAKE}" >&5
1106 echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6
1107 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
1108 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
1109   echo $ECHO_N "(cached) $ECHO_C" >&6
1110 else
1111   cat >conftest.make <<\EOF
1112 all:
1113         @echo 'ac_maketemp="${MAKE}"'
1114 EOF
1115 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
1116 eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
1117 if test -n "$ac_maketemp"; then
1118   eval ac_cv_prog_make_${ac_make}_set=yes
1119 else
1120   eval ac_cv_prog_make_${ac_make}_set=no
1121 fi
1122 rm -f conftest.make
1123 fi
1124 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
1125   echo "$as_me:1125: result: yes" >&5
1126 echo "${ECHO_T}yes" >&6
1127   SET_MAKE=
1128 else
1129   echo "$as_me:1129: result: no" >&5
1130 echo "${ECHO_T}no" >&6
1131   SET_MAKE="MAKE=${MAKE-make}"
1132 fi
1133
1134 ac_ext=c
1135 ac_cpp='$CPP $CPPFLAGS'
1136 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1137 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1138 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1139 ac_main_return=return
1140 if test -n "$ac_tool_prefix"; then
1141   # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
1142 set dummy ${ac_tool_prefix}gcc; ac_word=$2
1143 echo "$as_me:1143: checking for $ac_word" >&5
1144 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1145 if test "${ac_cv_prog_CC+set}" = set; then
1146   echo $ECHO_N "(cached) $ECHO_C" >&6
1147 else
1148   if test -n "$CC"; then
1149   ac_cv_prog_CC="$CC" # Let the user override the test.
1150 else
1151   ac_save_IFS=$IFS; IFS=$ac_path_separator
1152 ac_dummy="$PATH"
1153 for ac_dir in $ac_dummy; do
1154   IFS=$ac_save_IFS
1155   test -z "$ac_dir" && ac_dir=.
1156   $as_executable_p "$ac_dir/$ac_word" || continue
1157 ac_cv_prog_CC="${ac_tool_prefix}gcc"
1158 echo "$as_me:1158: found $ac_dir/$ac_word" >&5
1159 break
1160 done
1161
1162 fi
1163 fi
1164 CC=$ac_cv_prog_CC
1165 if test -n "$CC"; then
1166   echo "$as_me:1166: result: $CC" >&5
1167 echo "${ECHO_T}$CC" >&6
1168 else
1169   echo "$as_me:1169: result: no" >&5
1170 echo "${ECHO_T}no" >&6
1171 fi
1172
1173 fi
1174 if test -z "$ac_cv_prog_CC"; then
1175   ac_ct_CC=$CC
1176   # Extract the first word of "gcc", so it can be a program name with args.
1177 set dummy gcc; ac_word=$2
1178 echo "$as_me:1178: checking for $ac_word" >&5
1179 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1180 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1181   echo $ECHO_N "(cached) $ECHO_C" >&6
1182 else
1183   if test -n "$ac_ct_CC"; then
1184   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1185 else
1186   ac_save_IFS=$IFS; IFS=$ac_path_separator
1187 ac_dummy="$PATH"
1188 for ac_dir in $ac_dummy; do
1189   IFS=$ac_save_IFS
1190   test -z "$ac_dir" && ac_dir=.
1191   $as_executable_p "$ac_dir/$ac_word" || continue
1192 ac_cv_prog_ac_ct_CC="gcc"
1193 echo "$as_me:1193: found $ac_dir/$ac_word" >&5
1194 break
1195 done
1196
1197 fi
1198 fi
1199 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1200 if test -n "$ac_ct_CC"; then
1201   echo "$as_me:1201: result: $ac_ct_CC" >&5
1202 echo "${ECHO_T}$ac_ct_CC" >&6
1203 else
1204   echo "$as_me:1204: result: no" >&5
1205 echo "${ECHO_T}no" >&6
1206 fi
1207
1208   CC=$ac_ct_CC
1209 else
1210   CC="$ac_cv_prog_CC"
1211 fi
1212
1213 if test -z "$CC"; then
1214   if test -n "$ac_tool_prefix"; then
1215   # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
1216 set dummy ${ac_tool_prefix}cc; ac_word=$2
1217 echo "$as_me:1217: checking for $ac_word" >&5
1218 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1219 if test "${ac_cv_prog_CC+set}" = set; then
1220   echo $ECHO_N "(cached) $ECHO_C" >&6
1221 else
1222   if test -n "$CC"; then
1223   ac_cv_prog_CC="$CC" # Let the user override the test.
1224 else
1225   ac_save_IFS=$IFS; IFS=$ac_path_separator
1226 ac_dummy="$PATH"
1227 for ac_dir in $ac_dummy; do
1228   IFS=$ac_save_IFS
1229   test -z "$ac_dir" && ac_dir=.
1230   $as_executable_p "$ac_dir/$ac_word" || continue
1231 ac_cv_prog_CC="${ac_tool_prefix}cc"
1232 echo "$as_me:1232: found $ac_dir/$ac_word" >&5
1233 break
1234 done
1235
1236 fi
1237 fi
1238 CC=$ac_cv_prog_CC
1239 if test -n "$CC"; then
1240   echo "$as_me:1240: result: $CC" >&5
1241 echo "${ECHO_T}$CC" >&6
1242 else
1243   echo "$as_me:1243: result: no" >&5
1244 echo "${ECHO_T}no" >&6
1245 fi
1246
1247 fi
1248 if test -z "$ac_cv_prog_CC"; then
1249   ac_ct_CC=$CC
1250   # Extract the first word of "cc", so it can be a program name with args.
1251 set dummy cc; ac_word=$2
1252 echo "$as_me:1252: checking for $ac_word" >&5
1253 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1254 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1255   echo $ECHO_N "(cached) $ECHO_C" >&6
1256 else
1257   if test -n "$ac_ct_CC"; then
1258   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1259 else
1260   ac_save_IFS=$IFS; IFS=$ac_path_separator
1261 ac_dummy="$PATH"
1262 for ac_dir in $ac_dummy; do
1263   IFS=$ac_save_IFS
1264   test -z "$ac_dir" && ac_dir=.
1265   $as_executable_p "$ac_dir/$ac_word" || continue
1266 ac_cv_prog_ac_ct_CC="cc"
1267 echo "$as_me:1267: found $ac_dir/$ac_word" >&5
1268 break
1269 done
1270
1271 fi
1272 fi
1273 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1274 if test -n "$ac_ct_CC"; then
1275   echo "$as_me:1275: result: $ac_ct_CC" >&5
1276 echo "${ECHO_T}$ac_ct_CC" >&6
1277 else
1278   echo "$as_me:1278: result: no" >&5
1279 echo "${ECHO_T}no" >&6
1280 fi
1281
1282   CC=$ac_ct_CC
1283 else
1284   CC="$ac_cv_prog_CC"
1285 fi
1286
1287 fi
1288 if test -z "$CC"; then
1289   # Extract the first word of "cc", so it can be a program name with args.
1290 set dummy cc; ac_word=$2
1291 echo "$as_me:1291: checking for $ac_word" >&5
1292 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1293 if test "${ac_cv_prog_CC+set}" = set; then
1294   echo $ECHO_N "(cached) $ECHO_C" >&6
1295 else
1296   if test -n "$CC"; then
1297   ac_cv_prog_CC="$CC" # Let the user override the test.
1298 else
1299   ac_prog_rejected=no
1300   ac_save_IFS=$IFS; IFS=$ac_path_separator
1301 ac_dummy="$PATH"
1302 for ac_dir in $ac_dummy; do
1303   IFS=$ac_save_IFS
1304   test -z "$ac_dir" && ac_dir=.
1305   $as_executable_p "$ac_dir/$ac_word" || continue
1306 if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1307   ac_prog_rejected=yes
1308   continue
1309 fi
1310 ac_cv_prog_CC="cc"
1311 echo "$as_me:1311: found $ac_dir/$ac_word" >&5
1312 break
1313 done
1314
1315 if test $ac_prog_rejected = yes; then
1316   # We found a bogon in the path, so make sure we never use it.
1317   set dummy $ac_cv_prog_CC
1318   shift
1319   if test $# != 0; then
1320     # We chose a different compiler from the bogus one.
1321     # However, it has the same basename, so the bogon will be chosen
1322     # first if we set CC to just the basename; use the full file name.
1323     shift
1324     set dummy "$ac_dir/$ac_word" ${1+"$@"}
1325     shift
1326     ac_cv_prog_CC="$@"
1327   fi
1328 fi
1329 fi
1330 fi
1331 CC=$ac_cv_prog_CC
1332 if test -n "$CC"; then
1333   echo "$as_me:1333: result: $CC" >&5
1334 echo "${ECHO_T}$CC" >&6
1335 else
1336   echo "$as_me:1336: result: no" >&5
1337 echo "${ECHO_T}no" >&6
1338 fi
1339
1340 fi
1341 if test -z "$CC"; then
1342   if test -n "$ac_tool_prefix"; then
1343   for ac_prog in cl
1344   do
1345     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
1346 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
1347 echo "$as_me:1347: checking for $ac_word" >&5
1348 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1349 if test "${ac_cv_prog_CC+set}" = set; then
1350   echo $ECHO_N "(cached) $ECHO_C" >&6
1351 else
1352   if test -n "$CC"; then
1353   ac_cv_prog_CC="$CC" # Let the user override the test.
1354 else
1355   ac_save_IFS=$IFS; IFS=$ac_path_separator
1356 ac_dummy="$PATH"
1357 for ac_dir in $ac_dummy; do
1358   IFS=$ac_save_IFS
1359   test -z "$ac_dir" && ac_dir=.
1360   $as_executable_p "$ac_dir/$ac_word" || continue
1361 ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
1362 echo "$as_me:1362: found $ac_dir/$ac_word" >&5
1363 break
1364 done
1365
1366 fi
1367 fi
1368 CC=$ac_cv_prog_CC
1369 if test -n "$CC"; then
1370   echo "$as_me:1370: result: $CC" >&5
1371 echo "${ECHO_T}$CC" >&6
1372 else
1373   echo "$as_me:1373: result: no" >&5
1374 echo "${ECHO_T}no" >&6
1375 fi
1376
1377     test -n "$CC" && break
1378   done
1379 fi
1380 if test -z "$CC"; then
1381   ac_ct_CC=$CC
1382   for ac_prog in cl
1383 do
1384   # Extract the first word of "$ac_prog", so it can be a program name with args.
1385 set dummy $ac_prog; ac_word=$2
1386 echo "$as_me:1386: checking for $ac_word" >&5
1387 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1388 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1389   echo $ECHO_N "(cached) $ECHO_C" >&6
1390 else
1391   if test -n "$ac_ct_CC"; then
1392   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1393 else
1394   ac_save_IFS=$IFS; IFS=$ac_path_separator
1395 ac_dummy="$PATH"
1396 for ac_dir in $ac_dummy; do
1397   IFS=$ac_save_IFS
1398   test -z "$ac_dir" && ac_dir=.
1399   $as_executable_p "$ac_dir/$ac_word" || continue
1400 ac_cv_prog_ac_ct_CC="$ac_prog"
1401 echo "$as_me:1401: found $ac_dir/$ac_word" >&5
1402 break
1403 done
1404
1405 fi
1406 fi
1407 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1408 if test -n "$ac_ct_CC"; then
1409   echo "$as_me:1409: result: $ac_ct_CC" >&5
1410 echo "${ECHO_T}$ac_ct_CC" >&6
1411 else
1412   echo "$as_me:1412: result: no" >&5
1413 echo "${ECHO_T}no" >&6
1414 fi
1415
1416   test -n "$ac_ct_CC" && break
1417 done
1418
1419   CC=$ac_ct_CC
1420 fi
1421
1422 fi
1423
1424 test -z "$CC" && { { echo "$as_me:1424: error: no acceptable cc found in \$PATH" >&5
1425 echo "$as_me: error: no acceptable cc found in \$PATH" >&2;}
1426    { (exit 1); exit 1; }; }
1427
1428 # Provide some information about the compiler.
1429 echo "$as_me:1429:" \
1430      "checking for C compiler version" >&5
1431 ac_compiler=`set X $ac_compile; echo $2`
1432 { (eval echo "$as_me:1432: \"$ac_compiler --version </dev/null >&5\"") >&5
1433   (eval $ac_compiler --version </dev/null >&5) 2>&5
1434   ac_status=$?
1435   echo "$as_me:1435: \$? = $ac_status" >&5
1436   (exit $ac_status); }
1437 { (eval echo "$as_me:1437: \"$ac_compiler -v </dev/null >&5\"") >&5
1438   (eval $ac_compiler -v </dev/null >&5) 2>&5
1439   ac_status=$?
1440   echo "$as_me:1440: \$? = $ac_status" >&5
1441   (exit $ac_status); }
1442 { (eval echo "$as_me:1442: \"$ac_compiler -V </dev/null >&5\"") >&5
1443   (eval $ac_compiler -V </dev/null >&5) 2>&5
1444   ac_status=$?
1445   echo "$as_me:1445: \$? = $ac_status" >&5
1446   (exit $ac_status); }
1447
1448 cat >conftest.$ac_ext <<_ACEOF
1449 #line 1449 "configure"
1450 #include "confdefs.h"
1451
1452 int
1453 main ()
1454 {
1455
1456   ;
1457   return 0;
1458 }
1459 _ACEOF
1460 ac_clean_files_save=$ac_clean_files
1461 ac_clean_files="$ac_clean_files a.out a.exe"
1462 # Try to create an executable without -o first, disregard a.out.
1463 # It will help us diagnose broken compilers, and finding out an intuition
1464 # of exeext.
1465 echo "$as_me:1465: checking for C compiler default output" >&5
1466 echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
1467 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
1468 if { (eval echo "$as_me:1468: \"$ac_link_default\"") >&5
1469   (eval $ac_link_default) 2>&5
1470   ac_status=$?
1471   echo "$as_me:1471: \$? = $ac_status" >&5
1472   (exit $ac_status); }; then
1473   # Find the output, starting from the most likely.  This scheme is
1474 # not robust to junk in `.', hence go to wildcards (a.*) only as a last
1475 # resort.
1476 for ac_file in `ls a.exe conftest.exe 2>/dev/null;
1477                 ls a.out conftest 2>/dev/null;
1478                 ls a.* conftest.* 2>/dev/null`; do
1479   case $ac_file in
1480     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1481     a.out ) # We found the default executable, but exeext='' is most
1482             # certainly right.
1483             break;;
1484     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1485           # FIXME: I believe we export ac_cv_exeext for Libtool --akim.
1486           export ac_cv_exeext
1487           break;;
1488     * ) break;;
1489   esac
1490 done
1491 else
1492   echo "$as_me: failed program was:" >&5
1493 cat conftest.$ac_ext >&5
1494 { { echo "$as_me:1494: error: C compiler cannot create executables" >&5
1495 echo "$as_me: error: C compiler cannot create executables" >&2;}
1496    { (exit 77); exit 77; }; }
1497 fi
1498
1499 ac_exeext=$ac_cv_exeext
1500 echo "$as_me:1500: result: $ac_file" >&5
1501 echo "${ECHO_T}$ac_file" >&6
1502
1503 # Check the compiler produces executables we can run.  If not, either
1504 # the compiler is broken, or we cross compile.
1505 echo "$as_me:1505: checking whether the C compiler works" >&5
1506 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
1507 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0
1508 # If not cross compiling, check that we can run a simple program.
1509 if test "$cross_compiling" != yes; then
1510   if { ac_try='./$ac_file'
1511   { (eval echo "$as_me:1511: \"$ac_try\"") >&5
1512   (eval $ac_try) 2>&5
1513   ac_status=$?
1514   echo "$as_me:1514: \$? = $ac_status" >&5
1515   (exit $ac_status); }; }; then
1516     cross_compiling=no
1517   else
1518     if test "$cross_compiling" = maybe; then
1519         cross_compiling=yes
1520     else
1521         { { echo "$as_me:1521: error: cannot run C compiled programs.
1522 If you meant to cross compile, use \`--host'." >&5
1523 echo "$as_me: error: cannot run C compiled programs.
1524 If you meant to cross compile, use \`--host'." >&2;}
1525    { (exit 1); exit 1; }; }
1526     fi
1527   fi
1528 fi
1529 echo "$as_me:1529: result: yes" >&5
1530 echo "${ECHO_T}yes" >&6
1531
1532 rm -f a.out a.exe conftest$ac_cv_exeext
1533 ac_clean_files=$ac_clean_files_save
1534 # Check the compiler produces executables we can run.  If not, either
1535 # the compiler is broken, or we cross compile.
1536 echo "$as_me:1536: checking whether we are cross compiling" >&5
1537 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
1538 echo "$as_me:1538: result: $cross_compiling" >&5
1539 echo "${ECHO_T}$cross_compiling" >&6
1540
1541 echo "$as_me:1541: checking for executable suffix" >&5
1542 echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6
1543 if { (eval echo "$as_me:1543: \"$ac_link\"") >&5
1544   (eval $ac_link) 2>&5
1545   ac_status=$?
1546   echo "$as_me:1546: \$? = $ac_status" >&5
1547   (exit $ac_status); }; then
1548   # If both `conftest.exe' and `conftest' are `present' (well, observable)
1549 # catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
1550 # work properly (i.e., refer to `conftest.exe'), while it won't with
1551 # `rm'.
1552 for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do
1553   case $ac_file in
1554     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1555     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1556           export ac_cv_exeext
1557           break;;
1558     * ) break;;
1559   esac
1560 done
1561 else
1562   { { echo "$as_me:1562: error: cannot compute EXEEXT: cannot compile and link" >&5
1563 echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;}
1564    { (exit 1); exit 1; }; }
1565 fi
1566
1567 rm -f conftest$ac_cv_exeext
1568 echo "$as_me:1568: result: $ac_cv_exeext" >&5
1569 echo "${ECHO_T}$ac_cv_exeext" >&6
1570
1571 rm -f conftest.$ac_ext
1572 EXEEXT=$ac_cv_exeext
1573 ac_exeext=$EXEEXT
1574 echo "$as_me:1574: checking for object suffix" >&5
1575 echo $ECHO_N "checking for object suffix... $ECHO_C" >&6
1576 if test "${ac_cv_objext+set}" = set; then
1577   echo $ECHO_N "(cached) $ECHO_C" >&6
1578 else
1579   cat >conftest.$ac_ext <<_ACEOF
1580 #line 1580 "configure"
1581 #include "confdefs.h"
1582
1583 int
1584 main ()
1585 {
1586
1587   ;
1588   return 0;
1589 }
1590 _ACEOF
1591 rm -f conftest.o conftest.obj
1592 if { (eval echo "$as_me:1592: \"$ac_compile\"") >&5
1593   (eval $ac_compile) 2>&5
1594   ac_status=$?
1595   echo "$as_me:1595: \$? = $ac_status" >&5
1596   (exit $ac_status); }; then
1597   for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
1598   case $ac_file in
1599     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.map | *.inf ) ;;
1600     *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
1601        break;;
1602   esac
1603 done
1604 else
1605   echo "$as_me: failed program was:" >&5
1606 cat conftest.$ac_ext >&5
1607 { { echo "$as_me:1607: error: cannot compute OBJEXT: cannot compile" >&5
1608 echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;}
1609    { (exit 1); exit 1; }; }
1610 fi
1611
1612 rm -f conftest.$ac_cv_objext conftest.$ac_ext
1613 fi
1614 echo "$as_me:1614: result: $ac_cv_objext" >&5
1615 echo "${ECHO_T}$ac_cv_objext" >&6
1616 OBJEXT=$ac_cv_objext
1617 ac_objext=$OBJEXT
1618 echo "$as_me:1618: checking whether we are using the GNU C compiler" >&5
1619 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
1620 if test "${ac_cv_c_compiler_gnu+set}" = set; then
1621   echo $ECHO_N "(cached) $ECHO_C" >&6
1622 else
1623   cat >conftest.$ac_ext <<_ACEOF
1624 #line 1624 "configure"
1625 #include "confdefs.h"
1626
1627 int
1628 main ()
1629 {
1630 #ifndef __GNUC__
1631        choke me
1632 #endif
1633
1634   ;
1635   return 0;
1636 }
1637 _ACEOF
1638 rm -f conftest.$ac_objext
1639 if { (eval echo "$as_me:1639: \"$ac_compile\"") >&5
1640   (eval $ac_compile) 2>&5
1641   ac_status=$?
1642   echo "$as_me:1642: \$? = $ac_status" >&5
1643   (exit $ac_status); } &&
1644          { ac_try='test -s conftest.$ac_objext'
1645   { (eval echo "$as_me:1645: \"$ac_try\"") >&5
1646   (eval $ac_try) 2>&5
1647   ac_status=$?
1648   echo "$as_me:1648: \$? = $ac_status" >&5
1649   (exit $ac_status); }; }; then
1650   ac_compiler_gnu=yes
1651 else
1652   echo "$as_me: failed program was:" >&5
1653 cat conftest.$ac_ext >&5
1654 ac_compiler_gnu=no
1655 fi
1656 rm -f conftest.$ac_objext conftest.$ac_ext
1657 ac_cv_c_compiler_gnu=$ac_compiler_gnu
1658
1659 fi
1660 echo "$as_me:1660: result: $ac_cv_c_compiler_gnu" >&5
1661 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
1662 GCC=`test $ac_compiler_gnu = yes && echo yes`
1663 ac_test_CFLAGS=${CFLAGS+set}
1664 ac_save_CFLAGS=$CFLAGS
1665 CFLAGS="-g"
1666 echo "$as_me:1666: checking whether $CC accepts -g" >&5
1667 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
1668 if test "${ac_cv_prog_cc_g+set}" = set; then
1669   echo $ECHO_N "(cached) $ECHO_C" >&6
1670 else
1671   cat >conftest.$ac_ext <<_ACEOF
1672 #line 1672 "configure"
1673 #include "confdefs.h"
1674
1675 int
1676 main ()
1677 {
1678
1679   ;
1680   return 0;
1681 }
1682 _ACEOF
1683 rm -f conftest.$ac_objext
1684 if { (eval echo "$as_me:1684: \"$ac_compile\"") >&5
1685   (eval $ac_compile) 2>&5
1686   ac_status=$?
1687   echo "$as_me:1687: \$? = $ac_status" >&5
1688   (exit $ac_status); } &&
1689          { ac_try='test -s conftest.$ac_objext'
1690   { (eval echo "$as_me:1690: \"$ac_try\"") >&5
1691   (eval $ac_try) 2>&5
1692   ac_status=$?
1693   echo "$as_me:1693: \$? = $ac_status" >&5
1694   (exit $ac_status); }; }; then
1695   ac_cv_prog_cc_g=yes
1696 else
1697   echo "$as_me: failed program was:" >&5
1698 cat conftest.$ac_ext >&5
1699 ac_cv_prog_cc_g=no
1700 fi
1701 rm -f conftest.$ac_objext conftest.$ac_ext
1702 fi
1703 echo "$as_me:1703: result: $ac_cv_prog_cc_g" >&5
1704 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
1705 if test "$ac_test_CFLAGS" = set; then
1706   CFLAGS=$ac_save_CFLAGS
1707 elif test $ac_cv_prog_cc_g = yes; then
1708   if test "$GCC" = yes; then
1709     CFLAGS="-g -O2"
1710   else
1711     CFLAGS="-g"
1712   fi
1713 else
1714   if test "$GCC" = yes; then
1715     CFLAGS="-O2"
1716   else
1717     CFLAGS=
1718   fi
1719 fi
1720 # Some people use a C++ compiler to compile C.  Since we use `exit',
1721 # in C++ we need to declare it.  In case someone uses the same compiler
1722 # for both compiling C and C++ we need to have the C++ compiler decide
1723 # the declaration of exit, since it's the most demanding environment.
1724 cat >conftest.$ac_ext <<_ACEOF
1725 #ifndef __cplusplus
1726   choke me
1727 #endif
1728 _ACEOF
1729 rm -f conftest.$ac_objext
1730 if { (eval echo "$as_me:1730: \"$ac_compile\"") >&5
1731   (eval $ac_compile) 2>&5
1732   ac_status=$?
1733   echo "$as_me:1733: \$? = $ac_status" >&5
1734   (exit $ac_status); } &&
1735          { ac_try='test -s conftest.$ac_objext'
1736   { (eval echo "$as_me:1736: \"$ac_try\"") >&5
1737   (eval $ac_try) 2>&5
1738   ac_status=$?
1739   echo "$as_me:1739: \$? = $ac_status" >&5
1740   (exit $ac_status); }; }; then
1741   for ac_declaration in \
1742    ''\
1743    '#include <stdlib.h>' \
1744    'extern "C" void std::exit (int) throw (); using std::exit;' \
1745    'extern "C" void std::exit (int); using std::exit;' \
1746    'extern "C" void exit (int) throw ();' \
1747    'extern "C" void exit (int);' \
1748    'void exit (int);'
1749 do
1750   cat >conftest.$ac_ext <<_ACEOF
1751 #line 1751 "configure"
1752 #include "confdefs.h"
1753 #include <stdlib.h>
1754 $ac_declaration
1755 int
1756 main ()
1757 {
1758 exit (42);
1759   ;
1760   return 0;
1761 }
1762 _ACEOF
1763 rm -f conftest.$ac_objext
1764 if { (eval echo "$as_me:1764: \"$ac_compile\"") >&5
1765   (eval $ac_compile) 2>&5
1766   ac_status=$?
1767   echo "$as_me:1767: \$? = $ac_status" >&5
1768   (exit $ac_status); } &&
1769          { ac_try='test -s conftest.$ac_objext'
1770   { (eval echo "$as_me:1770: \"$ac_try\"") >&5
1771   (eval $ac_try) 2>&5
1772   ac_status=$?
1773   echo "$as_me:1773: \$? = $ac_status" >&5
1774   (exit $ac_status); }; }; then
1775   :
1776 else
1777   echo "$as_me: failed program was:" >&5
1778 cat conftest.$ac_ext >&5
1779 continue
1780 fi
1781 rm -f conftest.$ac_objext conftest.$ac_ext
1782   cat >conftest.$ac_ext <<_ACEOF
1783 #line 1783 "configure"
1784 #include "confdefs.h"
1785 $ac_declaration
1786 int
1787 main ()
1788 {
1789 exit (42);
1790   ;
1791   return 0;
1792 }
1793 _ACEOF
1794 rm -f conftest.$ac_objext
1795 if { (eval echo "$as_me:1795: \"$ac_compile\"") >&5
1796   (eval $ac_compile) 2>&5
1797   ac_status=$?
1798   echo "$as_me:1798: \$? = $ac_status" >&5
1799   (exit $ac_status); } &&
1800          { ac_try='test -s conftest.$ac_objext'
1801   { (eval echo "$as_me:1801: \"$ac_try\"") >&5
1802   (eval $ac_try) 2>&5
1803   ac_status=$?
1804   echo "$as_me:1804: \$? = $ac_status" >&5
1805   (exit $ac_status); }; }; then
1806   break
1807 else
1808   echo "$as_me: failed program was:" >&5
1809 cat conftest.$ac_ext >&5
1810 fi
1811 rm -f conftest.$ac_objext conftest.$ac_ext
1812 done
1813 rm -rf conftest*
1814 if test -n "$ac_declaration"; then
1815   echo '#ifdef __cplusplus' >>confdefs.h
1816   echo $ac_declaration      >>confdefs.h
1817   echo '#endif'             >>confdefs.h
1818 fi
1819
1820 else
1821   echo "$as_me: failed program was:" >&5
1822 cat conftest.$ac_ext >&5
1823 fi
1824 rm -f conftest.$ac_objext conftest.$ac_ext
1825 ac_ext=c
1826 ac_cpp='$CPP $CPPFLAGS'
1827 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1828 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1829 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1830 ac_main_return=return
1831
1832 GCC_VERSION=none
1833 if test "$GCC" = yes ; then
1834         echo "$as_me:1834: checking version of $CC" >&5
1835 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
1836         GCC_VERSION="`${CC} --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(GCC[^)]*) //' -e 's/^.*(Debian[^)]*) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`"
1837         test -z "$GCC_VERSION" && GCC_VERSION=unknown
1838         echo "$as_me:1838: result: $GCC_VERSION" >&5
1839 echo "${ECHO_T}$GCC_VERSION" >&6
1840 fi
1841
1842 echo "$as_me:1842: checking for $CC option to accept ANSI C" >&5
1843 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
1844 if test "${ac_cv_prog_cc_stdc+set}" = set; then
1845   echo $ECHO_N "(cached) $ECHO_C" >&6
1846 else
1847   ac_cv_prog_cc_stdc=no
1848 ac_save_CC=$CC
1849 cat >conftest.$ac_ext <<_ACEOF
1850 #line 1850 "configure"
1851 #include "confdefs.h"
1852 #include <stdarg.h>
1853 #include <stdio.h>
1854 #include <sys/types.h>
1855 #include <sys/stat.h>
1856 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
1857 struct buf { int x; };
1858 FILE * (*rcsopen) (struct buf *, struct stat *, int);
1859 static char *e (p, i)
1860      char **p;
1861      int i;
1862 {
1863   return p[i];
1864 }
1865 static char *f (char * (*g) (char **, int), char **p, ...)
1866 {
1867   char *s;
1868   va_list v;
1869   va_start (v,p);
1870   s = g (p, va_arg (v,int));
1871   va_end (v);
1872   return s;
1873 }
1874 int test (int i, double x);
1875 struct s1 {int (*f) (int a);};
1876 struct s2 {int (*f) (double a);};
1877 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
1878 int argc;
1879 char **argv;
1880 int
1881 main ()
1882 {
1883 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
1884   ;
1885   return 0;
1886 }
1887 _ACEOF
1888 # Don't try gcc -ansi; that turns off useful extensions and
1889 # breaks some systems' header files.
1890 # AIX                   -qlanglvl=ansi
1891 # Ultrix and OSF/1      -std1
1892 # HP-UX 10.20 and later -Ae
1893 # HP-UX older versions  -Aa -D_HPUX_SOURCE
1894 # SVR4                  -Xc -D__EXTENSIONS__
1895 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
1896 do
1897   CC="$ac_save_CC $ac_arg"
1898   rm -f conftest.$ac_objext
1899 if { (eval echo "$as_me:1899: \"$ac_compile\"") >&5
1900   (eval $ac_compile) 2>&5
1901   ac_status=$?
1902   echo "$as_me:1902: \$? = $ac_status" >&5
1903   (exit $ac_status); } &&
1904          { ac_try='test -s conftest.$ac_objext'
1905   { (eval echo "$as_me:1905: \"$ac_try\"") >&5
1906   (eval $ac_try) 2>&5
1907   ac_status=$?
1908   echo "$as_me:1908: \$? = $ac_status" >&5
1909   (exit $ac_status); }; }; then
1910   ac_cv_prog_cc_stdc=$ac_arg
1911 break
1912 else
1913   echo "$as_me: failed program was:" >&5
1914 cat conftest.$ac_ext >&5
1915 fi
1916 rm -f conftest.$ac_objext
1917 done
1918 rm -f conftest.$ac_ext conftest.$ac_objext
1919 CC=$ac_save_CC
1920
1921 fi
1922
1923 case "x$ac_cv_prog_cc_stdc" in
1924   x|xno)
1925     echo "$as_me:1925: result: none needed" >&5
1926 echo "${ECHO_T}none needed" >&6 ;;
1927   *)
1928     echo "$as_me:1928: result: $ac_cv_prog_cc_stdc" >&5
1929 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
1930     CC="$CC $ac_cv_prog_cc_stdc" ;;
1931 esac
1932
1933 # This should have been defined by AC_PROG_CC
1934 : ${CC:=cc}
1935
1936 echo "$as_me:1936: checking \$CC variable" >&5
1937 echo $ECHO_N "checking \$CC variable... $ECHO_C" >&6
1938 case "$CC" in
1939 (*[\ \  ]-[IUD]*)
1940         echo "$as_me:1940: result: broken" >&5
1941 echo "${ECHO_T}broken" >&6
1942         { echo "$as_me:1942: WARNING: your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options" >&5
1943 echo "$as_me: WARNING: your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options" >&2;}
1944         # humor him...
1945         cf_flags=`echo "$CC" | sed -e 's/^[^    ]*[     ]//'`
1946         CC=`echo "$CC" | sed -e 's/[    ].*//'`
1947
1948 cf_fix_cppflags=no
1949 cf_new_cflags=
1950 cf_new_cppflags=
1951 cf_new_extra_cppflags=
1952
1953 for cf_add_cflags in $cf_flags
1954 do
1955 case $cf_fix_cppflags in
1956 (no)
1957         case $cf_add_cflags in
1958         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
1959                 case $cf_add_cflags in
1960                 (-D*)
1961                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
1962
1963                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
1964                                 && test -z "${cf_tst_cflags}" \
1965                                 && cf_fix_cppflags=yes
1966
1967                         if test $cf_fix_cppflags = yes ; then
1968                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
1969                                 continue
1970                         elif test "${cf_tst_cflags}" = "\"'" ; then
1971                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
1972                                 continue
1973                         fi
1974                         ;;
1975                 esac
1976                 case "$CPPFLAGS" in
1977                 (*$cf_add_cflags)
1978                         ;;
1979                 (*)
1980                         case $cf_add_cflags in
1981                         (-D*)
1982                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
1983
1984 CPPFLAGS=`echo "$CPPFLAGS" | \
1985         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
1986                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
1987
1988                                 ;;
1989                         esac
1990                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
1991                         ;;
1992                 esac
1993                 ;;
1994         (*)
1995                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
1996                 ;;
1997         esac
1998         ;;
1999 (yes)
2000         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
2001
2002         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
2003
2004         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2005                 && test -z "${cf_tst_cflags}" \
2006                 && cf_fix_cppflags=no
2007         ;;
2008 esac
2009 done
2010
2011 if test -n "$cf_new_cflags" ; then
2012
2013         CFLAGS="$CFLAGS $cf_new_cflags"
2014 fi
2015
2016 if test -n "$cf_new_cppflags" ; then
2017
2018         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
2019 fi
2020
2021 if test -n "$cf_new_extra_cppflags" ; then
2022
2023         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
2024 fi
2025
2026         ;;
2027 (*)
2028         echo "$as_me:2028: result: ok" >&5
2029 echo "${ECHO_T}ok" >&6
2030         ;;
2031 esac
2032
2033 ac_ext=c
2034 ac_cpp='$CPP $CPPFLAGS'
2035 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2036 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2037 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2038 ac_main_return=return
2039 echo "$as_me:2039: checking how to run the C preprocessor" >&5
2040 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
2041 # On Suns, sometimes $CPP names a directory.
2042 if test -n "$CPP" && test -d "$CPP"; then
2043   CPP=
2044 fi
2045 if test -z "$CPP"; then
2046   if test "${ac_cv_prog_CPP+set}" = set; then
2047   echo $ECHO_N "(cached) $ECHO_C" >&6
2048 else
2049       # Double quotes because CPP needs to be expanded
2050     for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
2051     do
2052       ac_preproc_ok=false
2053 for ac_c_preproc_warn_flag in '' yes
2054 do
2055   # Use a header file that comes with gcc, so configuring glibc
2056   # with a fresh cross-compiler works.
2057   # On the NeXT, cc -E runs the code through the compiler's parser,
2058   # not just through cpp. "Syntax error" is here to catch this case.
2059   cat >conftest.$ac_ext <<_ACEOF
2060 #line 2060 "configure"
2061 #include "confdefs.h"
2062 #include <assert.h>
2063                      Syntax error
2064 _ACEOF
2065 if { (eval echo "$as_me:2065: \"$ac_cpp conftest.$ac_ext\"") >&5
2066   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2067   ac_status=$?
2068   egrep -v '^ *\+' conftest.er1 >conftest.err
2069   rm -f conftest.er1
2070   cat conftest.err >&5
2071   echo "$as_me:2071: \$? = $ac_status" >&5
2072   (exit $ac_status); } >/dev/null; then
2073   if test -s conftest.err; then
2074     ac_cpp_err=$ac_c_preproc_warn_flag
2075   else
2076     ac_cpp_err=
2077   fi
2078 else
2079   ac_cpp_err=yes
2080 fi
2081 if test -z "$ac_cpp_err"; then
2082   :
2083 else
2084   echo "$as_me: failed program was:" >&5
2085   cat conftest.$ac_ext >&5
2086   # Broken: fails on valid input.
2087 continue
2088 fi
2089 rm -f conftest.err conftest.$ac_ext
2090
2091   # OK, works on sane cases.  Now check whether non-existent headers
2092   # can be detected and how.
2093   cat >conftest.$ac_ext <<_ACEOF
2094 #line 2094 "configure"
2095 #include "confdefs.h"
2096 #include <ac_nonexistent.h>
2097 _ACEOF
2098 if { (eval echo "$as_me:2098: \"$ac_cpp conftest.$ac_ext\"") >&5
2099   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2100   ac_status=$?
2101   egrep -v '^ *\+' conftest.er1 >conftest.err
2102   rm -f conftest.er1
2103   cat conftest.err >&5
2104   echo "$as_me:2104: \$? = $ac_status" >&5
2105   (exit $ac_status); } >/dev/null; then
2106   if test -s conftest.err; then
2107     ac_cpp_err=$ac_c_preproc_warn_flag
2108   else
2109     ac_cpp_err=
2110   fi
2111 else
2112   ac_cpp_err=yes
2113 fi
2114 if test -z "$ac_cpp_err"; then
2115   # Broken: success on invalid input.
2116 continue
2117 else
2118   echo "$as_me: failed program was:" >&5
2119   cat conftest.$ac_ext >&5
2120   # Passes both tests.
2121 ac_preproc_ok=:
2122 break
2123 fi
2124 rm -f conftest.err conftest.$ac_ext
2125
2126 done
2127 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2128 rm -f conftest.err conftest.$ac_ext
2129 if $ac_preproc_ok; then
2130   break
2131 fi
2132
2133     done
2134     ac_cv_prog_CPP=$CPP
2135
2136 fi
2137   CPP=$ac_cv_prog_CPP
2138 else
2139   ac_cv_prog_CPP=$CPP
2140 fi
2141 echo "$as_me:2141: result: $CPP" >&5
2142 echo "${ECHO_T}$CPP" >&6
2143 ac_preproc_ok=false
2144 for ac_c_preproc_warn_flag in '' yes
2145 do
2146   # Use a header file that comes with gcc, so configuring glibc
2147   # with a fresh cross-compiler works.
2148   # On the NeXT, cc -E runs the code through the compiler's parser,
2149   # not just through cpp. "Syntax error" is here to catch this case.
2150   cat >conftest.$ac_ext <<_ACEOF
2151 #line 2151 "configure"
2152 #include "confdefs.h"
2153 #include <assert.h>
2154                      Syntax error
2155 _ACEOF
2156 if { (eval echo "$as_me:2156: \"$ac_cpp conftest.$ac_ext\"") >&5
2157   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2158   ac_status=$?
2159   egrep -v '^ *\+' conftest.er1 >conftest.err
2160   rm -f conftest.er1
2161   cat conftest.err >&5
2162   echo "$as_me:2162: \$? = $ac_status" >&5
2163   (exit $ac_status); } >/dev/null; then
2164   if test -s conftest.err; then
2165     ac_cpp_err=$ac_c_preproc_warn_flag
2166   else
2167     ac_cpp_err=
2168   fi
2169 else
2170   ac_cpp_err=yes
2171 fi
2172 if test -z "$ac_cpp_err"; then
2173   :
2174 else
2175   echo "$as_me: failed program was:" >&5
2176   cat conftest.$ac_ext >&5
2177   # Broken: fails on valid input.
2178 continue
2179 fi
2180 rm -f conftest.err conftest.$ac_ext
2181
2182   # OK, works on sane cases.  Now check whether non-existent headers
2183   # can be detected and how.
2184   cat >conftest.$ac_ext <<_ACEOF
2185 #line 2185 "configure"
2186 #include "confdefs.h"
2187 #include <ac_nonexistent.h>
2188 _ACEOF
2189 if { (eval echo "$as_me:2189: \"$ac_cpp conftest.$ac_ext\"") >&5
2190   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2191   ac_status=$?
2192   egrep -v '^ *\+' conftest.er1 >conftest.err
2193   rm -f conftest.er1
2194   cat conftest.err >&5
2195   echo "$as_me:2195: \$? = $ac_status" >&5
2196   (exit $ac_status); } >/dev/null; then
2197   if test -s conftest.err; then
2198     ac_cpp_err=$ac_c_preproc_warn_flag
2199   else
2200     ac_cpp_err=
2201   fi
2202 else
2203   ac_cpp_err=yes
2204 fi
2205 if test -z "$ac_cpp_err"; then
2206   # Broken: success on invalid input.
2207 continue
2208 else
2209   echo "$as_me: failed program was:" >&5
2210   cat conftest.$ac_ext >&5
2211   # Passes both tests.
2212 ac_preproc_ok=:
2213 break
2214 fi
2215 rm -f conftest.err conftest.$ac_ext
2216
2217 done
2218 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2219 rm -f conftest.err conftest.$ac_ext
2220 if $ac_preproc_ok; then
2221   :
2222 else
2223   { { echo "$as_me:2223: error: C preprocessor \"$CPP\" fails sanity check" >&5
2224 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;}
2225    { (exit 1); exit 1; }; }
2226 fi
2227
2228 ac_ext=c
2229 ac_cpp='$CPP $CPPFLAGS'
2230 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2231 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2232 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2233 ac_main_return=return
2234
2235 for ac_prog in mawk gawk nawk awk
2236 do
2237   # Extract the first word of "$ac_prog", so it can be a program name with args.
2238 set dummy $ac_prog; ac_word=$2
2239 echo "$as_me:2239: checking for $ac_word" >&5
2240 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2241 if test "${ac_cv_prog_AWK+set}" = set; then
2242   echo $ECHO_N "(cached) $ECHO_C" >&6
2243 else
2244   if test -n "$AWK"; then
2245   ac_cv_prog_AWK="$AWK" # Let the user override the test.
2246 else
2247   ac_save_IFS=$IFS; IFS=$ac_path_separator
2248 ac_dummy="$PATH"
2249 for ac_dir in $ac_dummy; do
2250   IFS=$ac_save_IFS
2251   test -z "$ac_dir" && ac_dir=.
2252   $as_executable_p "$ac_dir/$ac_word" || continue
2253 ac_cv_prog_AWK="$ac_prog"
2254 echo "$as_me:2254: found $ac_dir/$ac_word" >&5
2255 break
2256 done
2257
2258 fi
2259 fi
2260 AWK=$ac_cv_prog_AWK
2261 if test -n "$AWK"; then
2262   echo "$as_me:2262: result: $AWK" >&5
2263 echo "${ECHO_T}$AWK" >&6
2264 else
2265   echo "$as_me:2265: result: no" >&5
2266 echo "${ECHO_T}no" >&6
2267 fi
2268
2269   test -n "$AWK" && break
2270 done
2271
2272 # Find a good install program.  We prefer a C program (faster),
2273 # so one script is as good as another.  But avoid the broken or
2274 # incompatible versions:
2275 # SysV /etc/install, /usr/sbin/install
2276 # SunOS /usr/etc/install
2277 # IRIX /sbin/install
2278 # AIX /bin/install
2279 # AmigaOS /C/install, which installs bootblocks on floppy discs
2280 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2281 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2282 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2283 # ./install, which can be erroneously created by make from ./install.sh.
2284 echo "$as_me:2284: checking for a BSD compatible install" >&5
2285 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
2286 if test -z "$INSTALL"; then
2287 if test "${ac_cv_path_install+set}" = set; then
2288   echo $ECHO_N "(cached) $ECHO_C" >&6
2289 else
2290     ac_save_IFS=$IFS; IFS=$ac_path_separator
2291   for ac_dir in $PATH; do
2292     IFS=$ac_save_IFS
2293     # Account for people who put trailing slashes in PATH elements.
2294     case $ac_dir/ in
2295     / | ./ | .// | /cC/* \
2296     | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
2297     | /usr/ucb/* ) ;;
2298     *)
2299       # OSF1 and SCO ODT 3.0 have their own names for install.
2300       # Don't use installbsd from OSF since it installs stuff as root
2301       # by default.
2302       for ac_prog in ginstall scoinst install; do
2303         if $as_executable_p "$ac_dir/$ac_prog"; then
2304           if test $ac_prog = install &&
2305             grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2306             # AIX install.  It has an incompatible calling convention.
2307             :
2308           elif test $ac_prog = install &&
2309             grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2310             # program-specific install script used by HP pwplus--don't use.
2311             :
2312           else
2313             ac_cv_path_install="$ac_dir/$ac_prog -c"
2314             break 2
2315           fi
2316         fi
2317       done
2318       ;;
2319     esac
2320   done
2321
2322 fi
2323   if test "${ac_cv_path_install+set}" = set; then
2324     INSTALL=$ac_cv_path_install
2325   else
2326     # As a last resort, use the slow shell script.  We don't cache a
2327     # path for INSTALL within a source directory, because that will
2328     # break other packages using the cache if that directory is
2329     # removed, or if the path is relative.
2330     INSTALL=$ac_install_sh
2331   fi
2332 fi
2333 echo "$as_me:2333: result: $INSTALL" >&5
2334 echo "${ECHO_T}$INSTALL" >&6
2335
2336 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2337 # It thinks the first close brace ends the variable substitution.
2338 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2339
2340 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2341
2342 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2343
2344 case $INSTALL in
2345 (/*)
2346         ;;
2347 (*)
2348         cf_dir=`echo $INSTALL | sed -e 's%/[^/]*$%%'`
2349         test -z "$cf_dir" && cf_dir=.
2350         INSTALL=`cd $cf_dir && pwd`/`echo $INSTALL | sed -e 's%^.*/%%'`
2351         ;;
2352 esac
2353
2354 for ac_prog in tdlint lint alint splint lclint
2355 do
2356   # Extract the first word of "$ac_prog", so it can be a program name with args.
2357 set dummy $ac_prog; ac_word=$2
2358 echo "$as_me:2358: checking for $ac_word" >&5
2359 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2360 if test "${ac_cv_prog_LINT+set}" = set; then
2361   echo $ECHO_N "(cached) $ECHO_C" >&6
2362 else
2363   if test -n "$LINT"; then
2364   ac_cv_prog_LINT="$LINT" # Let the user override the test.
2365 else
2366   ac_save_IFS=$IFS; IFS=$ac_path_separator
2367 ac_dummy="$PATH"
2368 for ac_dir in $ac_dummy; do
2369   IFS=$ac_save_IFS
2370   test -z "$ac_dir" && ac_dir=.
2371   $as_executable_p "$ac_dir/$ac_word" || continue
2372 ac_cv_prog_LINT="$ac_prog"
2373 echo "$as_me:2373: found $ac_dir/$ac_word" >&5
2374 break
2375 done
2376
2377 fi
2378 fi
2379 LINT=$ac_cv_prog_LINT
2380 if test -n "$LINT"; then
2381   echo "$as_me:2381: result: $LINT" >&5
2382 echo "${ECHO_T}$LINT" >&6
2383 else
2384   echo "$as_me:2384: result: no" >&5
2385 echo "${ECHO_T}no" >&6
2386 fi
2387
2388   test -n "$LINT" && break
2389 done
2390
2391 echo "$as_me:2391: checking if filesystem supports mixed-case filenames" >&5
2392 echo $ECHO_N "checking if filesystem supports mixed-case filenames... $ECHO_C" >&6
2393 if test "${cf_cv_mixedcase+set}" = set; then
2394   echo $ECHO_N "(cached) $ECHO_C" >&6
2395 else
2396
2397 if test "$cross_compiling" = yes ; then
2398         case $target_alias in
2399         (*-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw*|*-uwin*)
2400                 cf_cv_mixedcase=no
2401                 ;;
2402         (*)
2403                 cf_cv_mixedcase=yes
2404                 ;;
2405         esac
2406 else
2407         rm -f conftest CONFTEST
2408         echo test >conftest
2409         if test -f CONFTEST ; then
2410                 cf_cv_mixedcase=no
2411         else
2412                 cf_cv_mixedcase=yes
2413         fi
2414         rm -f conftest CONFTEST
2415 fi
2416
2417 fi
2418 echo "$as_me:2418: result: $cf_cv_mixedcase" >&5
2419 echo "${ECHO_T}$cf_cv_mixedcase" >&6
2420 test "$cf_cv_mixedcase" = yes &&
2421 cat >>confdefs.h <<\EOF
2422 #define MIXEDCASE_FILENAMES 1
2423 EOF
2424
2425 for ac_prog in exctags ctags
2426 do
2427   # Extract the first word of "$ac_prog", so it can be a program name with args.
2428 set dummy $ac_prog; ac_word=$2
2429 echo "$as_me:2429: checking for $ac_word" >&5
2430 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2431 if test "${ac_cv_prog_CTAGS+set}" = set; then
2432   echo $ECHO_N "(cached) $ECHO_C" >&6
2433 else
2434   if test -n "$CTAGS"; then
2435   ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test.
2436 else
2437   ac_save_IFS=$IFS; IFS=$ac_path_separator
2438 ac_dummy="$PATH"
2439 for ac_dir in $ac_dummy; do
2440   IFS=$ac_save_IFS
2441   test -z "$ac_dir" && ac_dir=.
2442   $as_executable_p "$ac_dir/$ac_word" || continue
2443 ac_cv_prog_CTAGS="$ac_prog"
2444 echo "$as_me:2444: found $ac_dir/$ac_word" >&5
2445 break
2446 done
2447
2448 fi
2449 fi
2450 CTAGS=$ac_cv_prog_CTAGS
2451 if test -n "$CTAGS"; then
2452   echo "$as_me:2452: result: $CTAGS" >&5
2453 echo "${ECHO_T}$CTAGS" >&6
2454 else
2455   echo "$as_me:2455: result: no" >&5
2456 echo "${ECHO_T}no" >&6
2457 fi
2458
2459   test -n "$CTAGS" && break
2460 done
2461
2462 for ac_prog in exetags etags
2463 do
2464   # Extract the first word of "$ac_prog", so it can be a program name with args.
2465 set dummy $ac_prog; ac_word=$2
2466 echo "$as_me:2466: checking for $ac_word" >&5
2467 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2468 if test "${ac_cv_prog_ETAGS+set}" = set; then
2469   echo $ECHO_N "(cached) $ECHO_C" >&6
2470 else
2471   if test -n "$ETAGS"; then
2472   ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test.
2473 else
2474   ac_save_IFS=$IFS; IFS=$ac_path_separator
2475 ac_dummy="$PATH"
2476 for ac_dir in $ac_dummy; do
2477   IFS=$ac_save_IFS
2478   test -z "$ac_dir" && ac_dir=.
2479   $as_executable_p "$ac_dir/$ac_word" || continue
2480 ac_cv_prog_ETAGS="$ac_prog"
2481 echo "$as_me:2481: found $ac_dir/$ac_word" >&5
2482 break
2483 done
2484
2485 fi
2486 fi
2487 ETAGS=$ac_cv_prog_ETAGS
2488 if test -n "$ETAGS"; then
2489   echo "$as_me:2489: result: $ETAGS" >&5
2490 echo "${ECHO_T}$ETAGS" >&6
2491 else
2492   echo "$as_me:2492: result: no" >&5
2493 echo "${ECHO_T}no" >&6
2494 fi
2495
2496   test -n "$ETAGS" && break
2497 done
2498
2499 # Extract the first word of "${CTAGS:-ctags}", so it can be a program name with args.
2500 set dummy ${CTAGS:-ctags}; ac_word=$2
2501 echo "$as_me:2501: checking for $ac_word" >&5
2502 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2503 if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" = set; then
2504   echo $ECHO_N "(cached) $ECHO_C" >&6
2505 else
2506   if test -n "$MAKE_LOWER_TAGS"; then
2507   ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test.
2508 else
2509   ac_save_IFS=$IFS; IFS=$ac_path_separator
2510 ac_dummy="$PATH"
2511 for ac_dir in $ac_dummy; do
2512   IFS=$ac_save_IFS
2513   test -z "$ac_dir" && ac_dir=.
2514   $as_executable_p "$ac_dir/$ac_word" || continue
2515 ac_cv_prog_MAKE_LOWER_TAGS="yes"
2516 echo "$as_me:2516: found $ac_dir/$ac_word" >&5
2517 break
2518 done
2519
2520   test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no"
2521 fi
2522 fi
2523 MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS
2524 if test -n "$MAKE_LOWER_TAGS"; then
2525   echo "$as_me:2525: result: $MAKE_LOWER_TAGS" >&5
2526 echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6
2527 else
2528   echo "$as_me:2528: result: no" >&5
2529 echo "${ECHO_T}no" >&6
2530 fi
2531
2532 if test "$cf_cv_mixedcase" = yes ; then
2533         # Extract the first word of "${ETAGS:-etags}", so it can be a program name with args.
2534 set dummy ${ETAGS:-etags}; ac_word=$2
2535 echo "$as_me:2535: checking for $ac_word" >&5
2536 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2537 if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" = set; then
2538   echo $ECHO_N "(cached) $ECHO_C" >&6
2539 else
2540   if test -n "$MAKE_UPPER_TAGS"; then
2541   ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test.
2542 else
2543   ac_save_IFS=$IFS; IFS=$ac_path_separator
2544 ac_dummy="$PATH"
2545 for ac_dir in $ac_dummy; do
2546   IFS=$ac_save_IFS
2547   test -z "$ac_dir" && ac_dir=.
2548   $as_executable_p "$ac_dir/$ac_word" || continue
2549 ac_cv_prog_MAKE_UPPER_TAGS="yes"
2550 echo "$as_me:2550: found $ac_dir/$ac_word" >&5
2551 break
2552 done
2553
2554   test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no"
2555 fi
2556 fi
2557 MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS
2558 if test -n "$MAKE_UPPER_TAGS"; then
2559   echo "$as_me:2559: result: $MAKE_UPPER_TAGS" >&5
2560 echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6
2561 else
2562   echo "$as_me:2562: result: no" >&5
2563 echo "${ECHO_T}no" >&6
2564 fi
2565
2566 else
2567         MAKE_UPPER_TAGS=no
2568 fi
2569
2570 if test "$MAKE_UPPER_TAGS" = yes ; then
2571         MAKE_UPPER_TAGS=
2572 else
2573         MAKE_UPPER_TAGS="#"
2574 fi
2575
2576 if test "$MAKE_LOWER_TAGS" = yes ; then
2577         MAKE_LOWER_TAGS=
2578 else
2579         MAKE_LOWER_TAGS="#"
2580 fi
2581
2582 echo "$as_me:2582: checking if -lm needed for math functions" >&5
2583 echo $ECHO_N "checking if -lm needed for math functions... $ECHO_C" >&6
2584 if test "${cf_cv_need_libm+set}" = set; then
2585   echo $ECHO_N "(cached) $ECHO_C" >&6
2586 else
2587
2588         cat >conftest.$ac_ext <<_ACEOF
2589 #line 2589 "configure"
2590 #include "confdefs.h"
2591
2592         #include <stdio.h>
2593         #include <math.h>
2594
2595 int
2596 main ()
2597 {
2598 double x = rand(); printf("result = %g\n", pow(sin(x),x))
2599   ;
2600   return 0;
2601 }
2602 _ACEOF
2603 rm -f conftest.$ac_objext conftest$ac_exeext
2604 if { (eval echo "$as_me:2604: \"$ac_link\"") >&5
2605   (eval $ac_link) 2>&5
2606   ac_status=$?
2607   echo "$as_me:2607: \$? = $ac_status" >&5
2608   (exit $ac_status); } &&
2609          { ac_try='test -s conftest$ac_exeext'
2610   { (eval echo "$as_me:2610: \"$ac_try\"") >&5
2611   (eval $ac_try) 2>&5
2612   ac_status=$?
2613   echo "$as_me:2613: \$? = $ac_status" >&5
2614   (exit $ac_status); }; }; then
2615   cf_cv_need_libm=no
2616 else
2617   echo "$as_me: failed program was:" >&5
2618 cat conftest.$ac_ext >&5
2619 cf_cv_need_libm=yes
2620 fi
2621 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
2622 fi
2623 echo "$as_me:2623: result: $cf_cv_need_libm" >&5
2624 echo "${ECHO_T}$cf_cv_need_libm" >&6
2625 if test "$cf_cv_need_libm" = yes
2626 then
2627 MATH_LIB=-lm
2628 fi
2629
2630 top_builddir=`pwd`
2631
2632 CC_G_OPT="-g"
2633 CC_SHARED_OPTS=unknown
2634 CPPFLAGS="$CPPFLAGS"
2635 DFT_DEP_SUFFIX=""
2636 DFT_OBJ_SUBDIR=`pwd|sed -e's:.*/::'`
2637 DFT_UPR_MODEL="NORMAL"
2638 LD="ld"
2639 LDFLAGS_SHARED=""
2640 LDFLAGS_STATIC=""
2641 LD_MODEL=""
2642 LD_SHARED_OPTS=""
2643 LIBTOOL=""
2644 LIBTOOL_OPTS=""
2645 LIB_CLEAN=""
2646 LIB_COMPILE=""
2647 LIB_LINK='${CC}'
2648 LINK_TESTS=""
2649 LOCAL_LDFLAGS=""
2650 PACKAGE="ncurses-examples"
2651 PTHREAD="-lm"
2652 TEST_ARGS=""
2653 TEST_DEPS=""
2654 TEST_LIBS=""
2655 TINFO_LDFLAGS=''
2656 TINFO_LIBS='$(LIBS_CURSES)'
2657 cf_cv_abi_version=""
2658 cf_cv_rel_version=""
2659 includesubdir=""
2660
2661 cf_cv_screen=curses
2662 cf_cv_libtype=
2663
2664 if test "$GCC" = yes
2665 then
2666 cat > conftest.i <<EOF
2667 #ifndef GCC_PRINTF
2668 #define GCC_PRINTF 0
2669 #endif
2670 #ifndef GCC_SCANF
2671 #define GCC_SCANF 0
2672 #endif
2673 #ifndef GCC_NORETURN
2674 #define GCC_NORETURN /* nothing */
2675 #endif
2676 #ifndef GCC_UNUSED
2677 #define GCC_UNUSED /* nothing */
2678 #endif
2679 EOF
2680 if test "$GCC" = yes
2681 then
2682         { echo "$as_me:2682: checking for $CC __attribute__ directives..." >&5
2683 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
2684 cat > conftest.$ac_ext <<EOF
2685 #line 2685 "${as_me:-configure}"
2686 #include "confdefs.h"
2687 #include "conftest.h"
2688 #include "conftest.i"
2689 #if     GCC_PRINTF
2690 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
2691 #else
2692 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
2693 #endif
2694 #if     GCC_SCANF
2695 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
2696 #else
2697 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
2698 #endif
2699 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
2700 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
2701 extern void foo(void) GCC_NORETURN;
2702 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
2703 EOF
2704         cf_printf_attribute=no
2705         cf_scanf_attribute=no
2706         for cf_attribute in scanf printf unused noreturn
2707         do
2708
2709 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
2710
2711                 cf_directive="__attribute__(($cf_attribute))"
2712                 echo "checking for $CC $cf_directive" 1>&5
2713
2714                 case $cf_attribute in
2715                 (printf)
2716                         cf_printf_attribute=yes
2717                         cat >conftest.h <<EOF
2718 #define GCC_$cf_ATTRIBUTE 1
2719 EOF
2720                         ;;
2721                 (scanf)
2722                         cf_scanf_attribute=yes
2723                         cat >conftest.h <<EOF
2724 #define GCC_$cf_ATTRIBUTE 1
2725 EOF
2726                         ;;
2727                 (*)
2728                         cat >conftest.h <<EOF
2729 #define GCC_$cf_ATTRIBUTE $cf_directive
2730 EOF
2731                         ;;
2732                 esac
2733
2734                 if { (eval echo "$as_me:2734: \"$ac_compile\"") >&5
2735   (eval $ac_compile) 2>&5
2736   ac_status=$?
2737   echo "$as_me:2737: \$? = $ac_status" >&5
2738   (exit $ac_status); }; then
2739                         test -n "$verbose" && echo "$as_me:2739: result: ... $cf_attribute" >&5
2740 echo "${ECHO_T}... $cf_attribute" >&6
2741                         cat conftest.h >>confdefs.h
2742                         case $cf_attribute in
2743                         (noreturn)
2744
2745 cat >>confdefs.h <<EOF
2746 #define GCC_NORETURN $cf_directive
2747 EOF
2748
2749                                 ;;
2750                         (printf)
2751                                 cf_value='/* nothing */'
2752                                 if test "$cf_printf_attribute" != no ; then
2753                                         cf_value='__attribute__((format(printf,fmt,var)))'
2754
2755 cat >>confdefs.h <<\EOF
2756 #define GCC_PRINTF 1
2757 EOF
2758
2759                                 fi
2760
2761 cat >>confdefs.h <<EOF
2762 #define GCC_PRINTFLIKE(fmt,var) $cf_value
2763 EOF
2764
2765                                 ;;
2766                         (scanf)
2767                                 cf_value='/* nothing */'
2768                                 if test "$cf_scanf_attribute" != no ; then
2769                                         cf_value='__attribute__((format(scanf,fmt,var)))'
2770
2771 cat >>confdefs.h <<\EOF
2772 #define GCC_SCANF 1
2773 EOF
2774
2775                                 fi
2776
2777 cat >>confdefs.h <<EOF
2778 #define GCC_SCANFLIKE(fmt,var) $cf_value
2779 EOF
2780
2781                                 ;;
2782                         (unused)
2783
2784 cat >>confdefs.h <<EOF
2785 #define GCC_UNUSED $cf_directive
2786 EOF
2787
2788                                 ;;
2789                         esac
2790                 fi
2791         done
2792 else
2793         fgrep define conftest.i >>confdefs.h
2794 fi
2795 rm -rf conftest*
2796 fi
2797
2798 cf_XOPEN_SOURCE=500
2799 cf_POSIX_C_SOURCE=199506L
2800 cf_xopen_source=
2801
2802 case $host_os in
2803 (aix[4-7]*)
2804         cf_xopen_source="-D_ALL_SOURCE"
2805         ;;
2806 (cygwin|msys)
2807         cf_XOPEN_SOURCE=600
2808         ;;
2809 (darwin[0-8].*)
2810         cf_xopen_source="-D_APPLE_C_SOURCE"
2811         ;;
2812 (darwin*)
2813         cf_xopen_source="-D_DARWIN_C_SOURCE"
2814         cf_XOPEN_SOURCE=
2815         ;;
2816 (freebsd*|dragonfly*)
2817         # 5.x headers associate
2818         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
2819         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
2820         cf_POSIX_C_SOURCE=200112L
2821         cf_XOPEN_SOURCE=600
2822         cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
2823         ;;
2824 (hpux11*)
2825         cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
2826         ;;
2827 (hpux*)
2828         cf_xopen_source="-D_HPUX_SOURCE"
2829         ;;
2830 (irix[56].*)
2831         cf_xopen_source="-D_SGI_SOURCE"
2832         cf_XOPEN_SOURCE=
2833         ;;
2834 (linux*|gnu*|mint*|k*bsd*-gnu)
2835
2836 echo "$as_me:2836: checking if we must define _GNU_SOURCE" >&5
2837 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
2838 if test "${cf_cv_gnu_source+set}" = set; then
2839   echo $ECHO_N "(cached) $ECHO_C" >&6
2840 else
2841
2842 cat >conftest.$ac_ext <<_ACEOF
2843 #line 2843 "configure"
2844 #include "confdefs.h"
2845 #include <sys/types.h>
2846 int
2847 main ()
2848 {
2849
2850 #ifndef _XOPEN_SOURCE
2851 make an error
2852 #endif
2853   ;
2854   return 0;
2855 }
2856 _ACEOF
2857 rm -f conftest.$ac_objext
2858 if { (eval echo "$as_me:2858: \"$ac_compile\"") >&5
2859   (eval $ac_compile) 2>&5
2860   ac_status=$?
2861   echo "$as_me:2861: \$? = $ac_status" >&5
2862   (exit $ac_status); } &&
2863          { ac_try='test -s conftest.$ac_objext'
2864   { (eval echo "$as_me:2864: \"$ac_try\"") >&5
2865   (eval $ac_try) 2>&5
2866   ac_status=$?
2867   echo "$as_me:2867: \$? = $ac_status" >&5
2868   (exit $ac_status); }; }; then
2869   cf_cv_gnu_source=no
2870 else
2871   echo "$as_me: failed program was:" >&5
2872 cat conftest.$ac_ext >&5
2873 cf_save="$CPPFLAGS"
2874          CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
2875          cat >conftest.$ac_ext <<_ACEOF
2876 #line 2876 "configure"
2877 #include "confdefs.h"
2878 #include <sys/types.h>
2879 int
2880 main ()
2881 {
2882
2883 #ifdef _XOPEN_SOURCE
2884 make an error
2885 #endif
2886   ;
2887   return 0;
2888 }
2889 _ACEOF
2890 rm -f conftest.$ac_objext
2891 if { (eval echo "$as_me:2891: \"$ac_compile\"") >&5
2892   (eval $ac_compile) 2>&5
2893   ac_status=$?
2894   echo "$as_me:2894: \$? = $ac_status" >&5
2895   (exit $ac_status); } &&
2896          { ac_try='test -s conftest.$ac_objext'
2897   { (eval echo "$as_me:2897: \"$ac_try\"") >&5
2898   (eval $ac_try) 2>&5
2899   ac_status=$?
2900   echo "$as_me:2900: \$? = $ac_status" >&5
2901   (exit $ac_status); }; }; then
2902   cf_cv_gnu_source=no
2903 else
2904   echo "$as_me: failed program was:" >&5
2905 cat conftest.$ac_ext >&5
2906 cf_cv_gnu_source=yes
2907 fi
2908 rm -f conftest.$ac_objext conftest.$ac_ext
2909         CPPFLAGS="$cf_save"
2910
2911 fi
2912 rm -f conftest.$ac_objext conftest.$ac_ext
2913
2914 fi
2915 echo "$as_me:2915: result: $cf_cv_gnu_source" >&5
2916 echo "${ECHO_T}$cf_cv_gnu_source" >&6
2917 test "$cf_cv_gnu_source" = yes && CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
2918
2919         ;;
2920 (minix*)
2921         cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this...
2922         ;;
2923 (mirbsd*)
2924         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
2925         cf_XOPEN_SOURCE=
2926
2927 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
2928
2929 cf_save_CFLAGS="$CFLAGS"
2930 cf_save_CPPFLAGS="$CPPFLAGS"
2931
2932 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
2933         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
2934                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
2935
2936 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
2937         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
2938                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
2939
2940 echo "$as_me:2940: checking if we should define _POSIX_C_SOURCE" >&5
2941 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
2942 if test "${cf_cv_posix_c_source+set}" = set; then
2943   echo $ECHO_N "(cached) $ECHO_C" >&6
2944 else
2945
2946 echo "${as_me:-configure}:2946: testing if the symbol is already defined go no further ..." 1>&5
2947
2948         cat >conftest.$ac_ext <<_ACEOF
2949 #line 2949 "configure"
2950 #include "confdefs.h"
2951 #include <sys/types.h>
2952 int
2953 main ()
2954 {
2955
2956 #ifndef _POSIX_C_SOURCE
2957 make an error
2958 #endif
2959   ;
2960   return 0;
2961 }
2962 _ACEOF
2963 rm -f conftest.$ac_objext
2964 if { (eval echo "$as_me:2964: \"$ac_compile\"") >&5
2965   (eval $ac_compile) 2>&5
2966   ac_status=$?
2967   echo "$as_me:2967: \$? = $ac_status" >&5
2968   (exit $ac_status); } &&
2969          { ac_try='test -s conftest.$ac_objext'
2970   { (eval echo "$as_me:2970: \"$ac_try\"") >&5
2971   (eval $ac_try) 2>&5
2972   ac_status=$?
2973   echo "$as_me:2973: \$? = $ac_status" >&5
2974   (exit $ac_status); }; }; then
2975   cf_cv_posix_c_source=no
2976 else
2977   echo "$as_me: failed program was:" >&5
2978 cat conftest.$ac_ext >&5
2979 cf_want_posix_source=no
2980          case .$cf_POSIX_C_SOURCE in
2981          (.[12]??*)
2982                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
2983                 ;;
2984          (.2)
2985                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
2986                 cf_want_posix_source=yes
2987                 ;;
2988          (.*)
2989                 cf_want_posix_source=yes
2990                 ;;
2991          esac
2992          if test "$cf_want_posix_source" = yes ; then
2993                 cat >conftest.$ac_ext <<_ACEOF
2994 #line 2994 "configure"
2995 #include "confdefs.h"
2996 #include <sys/types.h>
2997 int
2998 main ()
2999 {
3000
3001 #ifdef _POSIX_SOURCE
3002 make an error
3003 #endif
3004   ;
3005   return 0;
3006 }
3007 _ACEOF
3008 rm -f conftest.$ac_objext
3009 if { (eval echo "$as_me:3009: \"$ac_compile\"") >&5
3010   (eval $ac_compile) 2>&5
3011   ac_status=$?
3012   echo "$as_me:3012: \$? = $ac_status" >&5
3013   (exit $ac_status); } &&
3014          { ac_try='test -s conftest.$ac_objext'
3015   { (eval echo "$as_me:3015: \"$ac_try\"") >&5
3016   (eval $ac_try) 2>&5
3017   ac_status=$?
3018   echo "$as_me:3018: \$? = $ac_status" >&5
3019   (exit $ac_status); }; }; then
3020   :
3021 else
3022   echo "$as_me: failed program was:" >&5
3023 cat conftest.$ac_ext >&5
3024 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
3025 fi
3026 rm -f conftest.$ac_objext conftest.$ac_ext
3027          fi
3028
3029 echo "${as_me:-configure}:3029: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
3030
3031          CFLAGS="$cf_trim_CFLAGS"
3032          CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
3033
3034 echo "${as_me:-configure}:3034: testing if the second compile does not leave our definition intact error ..." 1>&5
3035
3036          cat >conftest.$ac_ext <<_ACEOF
3037 #line 3037 "configure"
3038 #include "confdefs.h"
3039 #include <sys/types.h>
3040 int
3041 main ()
3042 {
3043
3044 #ifndef _POSIX_C_SOURCE
3045 make an error
3046 #endif
3047   ;
3048   return 0;
3049 }
3050 _ACEOF
3051 rm -f conftest.$ac_objext
3052 if { (eval echo "$as_me:3052: \"$ac_compile\"") >&5
3053   (eval $ac_compile) 2>&5
3054   ac_status=$?
3055   echo "$as_me:3055: \$? = $ac_status" >&5
3056   (exit $ac_status); } &&
3057          { ac_try='test -s conftest.$ac_objext'
3058   { (eval echo "$as_me:3058: \"$ac_try\"") >&5
3059   (eval $ac_try) 2>&5
3060   ac_status=$?
3061   echo "$as_me:3061: \$? = $ac_status" >&5
3062   (exit $ac_status); }; }; then
3063   :
3064 else
3065   echo "$as_me: failed program was:" >&5
3066 cat conftest.$ac_ext >&5
3067 cf_cv_posix_c_source=no
3068 fi
3069 rm -f conftest.$ac_objext conftest.$ac_ext
3070          CFLAGS="$cf_save_CFLAGS"
3071          CPPFLAGS="$cf_save_CPPFLAGS"
3072
3073 fi
3074 rm -f conftest.$ac_objext conftest.$ac_ext
3075
3076 fi
3077 echo "$as_me:3077: result: $cf_cv_posix_c_source" >&5
3078 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
3079
3080 if test "$cf_cv_posix_c_source" != no ; then
3081         CFLAGS="$cf_trim_CFLAGS"
3082         CPPFLAGS="$cf_trim_CPPFLAGS"
3083
3084 cf_fix_cppflags=no
3085 cf_new_cflags=
3086 cf_new_cppflags=
3087 cf_new_extra_cppflags=
3088
3089 for cf_add_cflags in $cf_cv_posix_c_source
3090 do
3091 case $cf_fix_cppflags in
3092 (no)
3093         case $cf_add_cflags in
3094         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
3095                 case $cf_add_cflags in
3096                 (-D*)
3097                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3098
3099                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3100                                 && test -z "${cf_tst_cflags}" \
3101                                 && cf_fix_cppflags=yes
3102
3103                         if test $cf_fix_cppflags = yes ; then
3104                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3105                                 continue
3106                         elif test "${cf_tst_cflags}" = "\"'" ; then
3107                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3108                                 continue
3109                         fi
3110                         ;;
3111                 esac
3112                 case "$CPPFLAGS" in
3113                 (*$cf_add_cflags)
3114                         ;;
3115                 (*)
3116                         case $cf_add_cflags in
3117                         (-D*)
3118                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3119
3120 CPPFLAGS=`echo "$CPPFLAGS" | \
3121         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3122                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3123
3124                                 ;;
3125                         esac
3126                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3127                         ;;
3128                 esac
3129                 ;;
3130         (*)
3131                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
3132                 ;;
3133         esac
3134         ;;
3135 (yes)
3136         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3137
3138         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3139
3140         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3141                 && test -z "${cf_tst_cflags}" \
3142                 && cf_fix_cppflags=no
3143         ;;
3144 esac
3145 done
3146
3147 if test -n "$cf_new_cflags" ; then
3148
3149         CFLAGS="$CFLAGS $cf_new_cflags"
3150 fi
3151
3152 if test -n "$cf_new_cppflags" ; then
3153
3154         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
3155 fi
3156
3157 if test -n "$cf_new_extra_cppflags" ; then
3158
3159         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
3160 fi
3161
3162 fi
3163
3164         ;;
3165 (netbsd*)
3166         cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
3167         ;;
3168 (openbsd[4-9]*)
3169         # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
3170         cf_xopen_source="-D_BSD_SOURCE"
3171         cf_XOPEN_SOURCE=600
3172         ;;
3173 (openbsd*)
3174         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
3175         ;;
3176 (osf[45]*)
3177         cf_xopen_source="-D_OSF_SOURCE"
3178         ;;
3179 (nto-qnx*)
3180         cf_xopen_source="-D_QNX_SOURCE"
3181         ;;
3182 (sco*)
3183         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
3184         ;;
3185 (solaris2.*)
3186         cf_xopen_source="-D__EXTENSIONS__"
3187         cf_cv_xopen_source=broken
3188         ;;
3189 (sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
3190         cf_XOPEN_SOURCE=
3191         cf_POSIX_C_SOURCE=
3192         ;;
3193 (*)
3194
3195 echo "$as_me:3195: checking if we should define _XOPEN_SOURCE" >&5
3196 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
3197 if test "${cf_cv_xopen_source+set}" = set; then
3198   echo $ECHO_N "(cached) $ECHO_C" >&6
3199 else
3200
3201         cat >conftest.$ac_ext <<_ACEOF
3202 #line 3202 "configure"
3203 #include "confdefs.h"
3204
3205 #include <stdlib.h>
3206 #include <string.h>
3207 #include <sys/types.h>
3208
3209 int
3210 main ()
3211 {
3212
3213 #ifndef _XOPEN_SOURCE
3214 make an error
3215 #endif
3216   ;
3217   return 0;
3218 }
3219 _ACEOF
3220 rm -f conftest.$ac_objext
3221 if { (eval echo "$as_me:3221: \"$ac_compile\"") >&5
3222   (eval $ac_compile) 2>&5
3223   ac_status=$?
3224   echo "$as_me:3224: \$? = $ac_status" >&5
3225   (exit $ac_status); } &&
3226          { ac_try='test -s conftest.$ac_objext'
3227   { (eval echo "$as_me:3227: \"$ac_try\"") >&5
3228   (eval $ac_try) 2>&5
3229   ac_status=$?
3230   echo "$as_me:3230: \$? = $ac_status" >&5
3231   (exit $ac_status); }; }; then
3232   cf_cv_xopen_source=no
3233 else
3234   echo "$as_me: failed program was:" >&5
3235 cat conftest.$ac_ext >&5
3236 cf_save="$CPPFLAGS"
3237          CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
3238          cat >conftest.$ac_ext <<_ACEOF
3239 #line 3239 "configure"
3240 #include "confdefs.h"
3241
3242 #include <stdlib.h>
3243 #include <string.h>
3244 #include <sys/types.h>
3245
3246 int
3247 main ()
3248 {
3249
3250 #ifdef _XOPEN_SOURCE
3251 make an error
3252 #endif
3253   ;
3254   return 0;
3255 }
3256 _ACEOF
3257 rm -f conftest.$ac_objext
3258 if { (eval echo "$as_me:3258: \"$ac_compile\"") >&5
3259   (eval $ac_compile) 2>&5
3260   ac_status=$?
3261   echo "$as_me:3261: \$? = $ac_status" >&5
3262   (exit $ac_status); } &&
3263          { ac_try='test -s conftest.$ac_objext'
3264   { (eval echo "$as_me:3264: \"$ac_try\"") >&5
3265   (eval $ac_try) 2>&5
3266   ac_status=$?
3267   echo "$as_me:3267: \$? = $ac_status" >&5
3268   (exit $ac_status); }; }; then
3269   cf_cv_xopen_source=no
3270 else
3271   echo "$as_me: failed program was:" >&5
3272 cat conftest.$ac_ext >&5
3273 cf_cv_xopen_source=$cf_XOPEN_SOURCE
3274 fi
3275 rm -f conftest.$ac_objext conftest.$ac_ext
3276         CPPFLAGS="$cf_save"
3277
3278 fi
3279 rm -f conftest.$ac_objext conftest.$ac_ext
3280
3281 fi
3282 echo "$as_me:3282: result: $cf_cv_xopen_source" >&5
3283 echo "${ECHO_T}$cf_cv_xopen_source" >&6
3284
3285 if test "$cf_cv_xopen_source" != no ; then
3286
3287 CFLAGS=`echo "$CFLAGS" | \
3288         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
3289                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
3290
3291 CPPFLAGS=`echo "$CPPFLAGS" | \
3292         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
3293                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
3294
3295         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
3296
3297 cf_fix_cppflags=no
3298 cf_new_cflags=
3299 cf_new_cppflags=
3300 cf_new_extra_cppflags=
3301
3302 for cf_add_cflags in $cf_temp_xopen_source
3303 do
3304 case $cf_fix_cppflags in
3305 (no)
3306         case $cf_add_cflags in
3307         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
3308                 case $cf_add_cflags in
3309                 (-D*)
3310                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3311
3312                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3313                                 && test -z "${cf_tst_cflags}" \
3314                                 && cf_fix_cppflags=yes
3315
3316                         if test $cf_fix_cppflags = yes ; then
3317                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3318                                 continue
3319                         elif test "${cf_tst_cflags}" = "\"'" ; then
3320                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3321                                 continue
3322                         fi
3323                         ;;
3324                 esac
3325                 case "$CPPFLAGS" in
3326                 (*$cf_add_cflags)
3327                         ;;
3328                 (*)
3329                         case $cf_add_cflags in
3330                         (-D*)
3331                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3332
3333 CPPFLAGS=`echo "$CPPFLAGS" | \
3334         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3335                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3336
3337                                 ;;
3338                         esac
3339                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3340                         ;;
3341                 esac
3342                 ;;
3343         (*)
3344                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
3345                 ;;
3346         esac
3347         ;;
3348 (yes)
3349         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3350
3351         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3352
3353         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3354                 && test -z "${cf_tst_cflags}" \
3355                 && cf_fix_cppflags=no
3356         ;;
3357 esac
3358 done
3359
3360 if test -n "$cf_new_cflags" ; then
3361
3362         CFLAGS="$CFLAGS $cf_new_cflags"
3363 fi
3364
3365 if test -n "$cf_new_cppflags" ; then
3366
3367         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
3368 fi
3369
3370 if test -n "$cf_new_extra_cppflags" ; then
3371
3372         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
3373 fi
3374
3375 fi
3376
3377 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
3378
3379 cf_save_CFLAGS="$CFLAGS"
3380 cf_save_CPPFLAGS="$CPPFLAGS"
3381
3382 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
3383         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
3384                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
3385
3386 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
3387         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
3388                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
3389
3390 echo "$as_me:3390: checking if we should define _POSIX_C_SOURCE" >&5
3391 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
3392 if test "${cf_cv_posix_c_source+set}" = set; then
3393   echo $ECHO_N "(cached) $ECHO_C" >&6
3394 else
3395
3396 echo "${as_me:-configure}:3396: testing if the symbol is already defined go no further ..." 1>&5
3397
3398         cat >conftest.$ac_ext <<_ACEOF
3399 #line 3399 "configure"
3400 #include "confdefs.h"
3401 #include <sys/types.h>
3402 int
3403 main ()
3404 {
3405
3406 #ifndef _POSIX_C_SOURCE
3407 make an error
3408 #endif
3409   ;
3410   return 0;
3411 }
3412 _ACEOF
3413 rm -f conftest.$ac_objext
3414 if { (eval echo "$as_me:3414: \"$ac_compile\"") >&5
3415   (eval $ac_compile) 2>&5
3416   ac_status=$?
3417   echo "$as_me:3417: \$? = $ac_status" >&5
3418   (exit $ac_status); } &&
3419          { ac_try='test -s conftest.$ac_objext'
3420   { (eval echo "$as_me:3420: \"$ac_try\"") >&5
3421   (eval $ac_try) 2>&5
3422   ac_status=$?
3423   echo "$as_me:3423: \$? = $ac_status" >&5
3424   (exit $ac_status); }; }; then
3425   cf_cv_posix_c_source=no
3426 else
3427   echo "$as_me: failed program was:" >&5
3428 cat conftest.$ac_ext >&5
3429 cf_want_posix_source=no
3430          case .$cf_POSIX_C_SOURCE in
3431          (.[12]??*)
3432                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
3433                 ;;
3434          (.2)
3435                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
3436                 cf_want_posix_source=yes
3437                 ;;
3438          (.*)
3439                 cf_want_posix_source=yes
3440                 ;;
3441          esac
3442          if test "$cf_want_posix_source" = yes ; then
3443                 cat >conftest.$ac_ext <<_ACEOF
3444 #line 3444 "configure"
3445 #include "confdefs.h"
3446 #include <sys/types.h>
3447 int
3448 main ()
3449 {
3450
3451 #ifdef _POSIX_SOURCE
3452 make an error
3453 #endif
3454   ;
3455   return 0;
3456 }
3457 _ACEOF
3458 rm -f conftest.$ac_objext
3459 if { (eval echo "$as_me:3459: \"$ac_compile\"") >&5
3460   (eval $ac_compile) 2>&5
3461   ac_status=$?
3462   echo "$as_me:3462: \$? = $ac_status" >&5
3463   (exit $ac_status); } &&
3464          { ac_try='test -s conftest.$ac_objext'
3465   { (eval echo "$as_me:3465: \"$ac_try\"") >&5
3466   (eval $ac_try) 2>&5
3467   ac_status=$?
3468   echo "$as_me:3468: \$? = $ac_status" >&5
3469   (exit $ac_status); }; }; then
3470   :
3471 else
3472   echo "$as_me: failed program was:" >&5
3473 cat conftest.$ac_ext >&5
3474 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
3475 fi
3476 rm -f conftest.$ac_objext conftest.$ac_ext
3477          fi
3478
3479 echo "${as_me:-configure}:3479: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
3480
3481          CFLAGS="$cf_trim_CFLAGS"
3482          CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
3483
3484 echo "${as_me:-configure}:3484: testing if the second compile does not leave our definition intact error ..." 1>&5
3485
3486          cat >conftest.$ac_ext <<_ACEOF
3487 #line 3487 "configure"
3488 #include "confdefs.h"
3489 #include <sys/types.h>
3490 int
3491 main ()
3492 {
3493
3494 #ifndef _POSIX_C_SOURCE
3495 make an error
3496 #endif
3497   ;
3498   return 0;
3499 }
3500 _ACEOF
3501 rm -f conftest.$ac_objext
3502 if { (eval echo "$as_me:3502: \"$ac_compile\"") >&5
3503   (eval $ac_compile) 2>&5
3504   ac_status=$?
3505   echo "$as_me:3505: \$? = $ac_status" >&5
3506   (exit $ac_status); } &&
3507          { ac_try='test -s conftest.$ac_objext'
3508   { (eval echo "$as_me:3508: \"$ac_try\"") >&5
3509   (eval $ac_try) 2>&5
3510   ac_status=$?
3511   echo "$as_me:3511: \$? = $ac_status" >&5
3512   (exit $ac_status); }; }; then
3513   :
3514 else
3515   echo "$as_me: failed program was:" >&5
3516 cat conftest.$ac_ext >&5
3517 cf_cv_posix_c_source=no
3518 fi
3519 rm -f conftest.$ac_objext conftest.$ac_ext
3520          CFLAGS="$cf_save_CFLAGS"
3521          CPPFLAGS="$cf_save_CPPFLAGS"
3522
3523 fi
3524 rm -f conftest.$ac_objext conftest.$ac_ext
3525
3526 fi
3527 echo "$as_me:3527: result: $cf_cv_posix_c_source" >&5
3528 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
3529
3530 if test "$cf_cv_posix_c_source" != no ; then
3531         CFLAGS="$cf_trim_CFLAGS"
3532         CPPFLAGS="$cf_trim_CPPFLAGS"
3533
3534 cf_fix_cppflags=no
3535 cf_new_cflags=
3536 cf_new_cppflags=
3537 cf_new_extra_cppflags=
3538
3539 for cf_add_cflags in $cf_cv_posix_c_source
3540 do
3541 case $cf_fix_cppflags in
3542 (no)
3543         case $cf_add_cflags in
3544         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
3545                 case $cf_add_cflags in
3546                 (-D*)
3547                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3548
3549                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3550                                 && test -z "${cf_tst_cflags}" \
3551                                 && cf_fix_cppflags=yes
3552
3553                         if test $cf_fix_cppflags = yes ; then
3554                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3555                                 continue
3556                         elif test "${cf_tst_cflags}" = "\"'" ; then
3557                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3558                                 continue
3559                         fi
3560                         ;;
3561                 esac
3562                 case "$CPPFLAGS" in
3563                 (*$cf_add_cflags)
3564                         ;;
3565                 (*)
3566                         case $cf_add_cflags in
3567                         (-D*)
3568                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3569
3570 CPPFLAGS=`echo "$CPPFLAGS" | \
3571         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3572                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3573
3574                                 ;;
3575                         esac
3576                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3577                         ;;
3578                 esac
3579                 ;;
3580         (*)
3581                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
3582                 ;;
3583         esac
3584         ;;
3585 (yes)
3586         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3587
3588         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3589
3590         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3591                 && test -z "${cf_tst_cflags}" \
3592                 && cf_fix_cppflags=no
3593         ;;
3594 esac
3595 done
3596
3597 if test -n "$cf_new_cflags" ; then
3598
3599         CFLAGS="$CFLAGS $cf_new_cflags"
3600 fi
3601
3602 if test -n "$cf_new_cppflags" ; then
3603
3604         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
3605 fi
3606
3607 if test -n "$cf_new_extra_cppflags" ; then
3608
3609         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
3610 fi
3611
3612 fi
3613
3614         ;;
3615 esac
3616
3617 if test -n "$cf_xopen_source" ; then
3618
3619 cf_fix_cppflags=no
3620 cf_new_cflags=
3621 cf_new_cppflags=
3622 cf_new_extra_cppflags=
3623
3624 for cf_add_cflags in $cf_xopen_source
3625 do
3626 case $cf_fix_cppflags in
3627 (no)
3628         case $cf_add_cflags in
3629         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
3630                 case $cf_add_cflags in
3631                 (-D*)
3632                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3633
3634                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3635                                 && test -z "${cf_tst_cflags}" \
3636                                 && cf_fix_cppflags=yes
3637
3638                         if test $cf_fix_cppflags = yes ; then
3639                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3640                                 continue
3641                         elif test "${cf_tst_cflags}" = "\"'" ; then
3642                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3643                                 continue
3644                         fi
3645                         ;;
3646                 esac
3647                 case "$CPPFLAGS" in
3648                 (*$cf_add_cflags)
3649                         ;;
3650                 (*)
3651                         case $cf_add_cflags in
3652                         (-D*)
3653                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3654
3655 CPPFLAGS=`echo "$CPPFLAGS" | \
3656         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3657                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3658
3659                                 ;;
3660                         esac
3661                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3662                         ;;
3663                 esac
3664                 ;;
3665         (*)
3666                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
3667                 ;;
3668         esac
3669         ;;
3670 (yes)
3671         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3672
3673         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3674
3675         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3676                 && test -z "${cf_tst_cflags}" \
3677                 && cf_fix_cppflags=no
3678         ;;
3679 esac
3680 done
3681
3682 if test -n "$cf_new_cflags" ; then
3683         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
3684
3685 echo "${as_me:-configure}:3685: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
3686
3687         CFLAGS="$CFLAGS $cf_new_cflags"
3688 fi
3689
3690 if test -n "$cf_new_cppflags" ; then
3691         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
3692
3693 echo "${as_me:-configure}:3693: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
3694
3695         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
3696 fi
3697
3698 if test -n "$cf_new_extra_cppflags" ; then
3699         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
3700
3701 echo "${as_me:-configure}:3701: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
3702
3703         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
3704 fi
3705
3706 fi
3707
3708 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
3709         echo "$as_me:3709: checking if _XOPEN_SOURCE really is set" >&5
3710 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
3711         cat >conftest.$ac_ext <<_ACEOF
3712 #line 3712 "configure"
3713 #include "confdefs.h"
3714 #include <stdlib.h>
3715 int
3716 main ()
3717 {
3718
3719 #ifndef _XOPEN_SOURCE
3720 make an error
3721 #endif
3722   ;
3723   return 0;
3724 }
3725 _ACEOF
3726 rm -f conftest.$ac_objext
3727 if { (eval echo "$as_me:3727: \"$ac_compile\"") >&5
3728   (eval $ac_compile) 2>&5
3729   ac_status=$?
3730   echo "$as_me:3730: \$? = $ac_status" >&5
3731   (exit $ac_status); } &&
3732          { ac_try='test -s conftest.$ac_objext'
3733   { (eval echo "$as_me:3733: \"$ac_try\"") >&5
3734   (eval $ac_try) 2>&5
3735   ac_status=$?
3736   echo "$as_me:3736: \$? = $ac_status" >&5
3737   (exit $ac_status); }; }; then
3738   cf_XOPEN_SOURCE_set=yes
3739 else
3740   echo "$as_me: failed program was:" >&5
3741 cat conftest.$ac_ext >&5
3742 cf_XOPEN_SOURCE_set=no
3743 fi
3744 rm -f conftest.$ac_objext conftest.$ac_ext
3745         echo "$as_me:3745: result: $cf_XOPEN_SOURCE_set" >&5
3746 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
3747         if test $cf_XOPEN_SOURCE_set = yes
3748         then
3749                 cat >conftest.$ac_ext <<_ACEOF
3750 #line 3750 "configure"
3751 #include "confdefs.h"
3752 #include <stdlib.h>
3753 int
3754 main ()
3755 {
3756
3757 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
3758 make an error
3759 #endif
3760   ;
3761   return 0;
3762 }
3763 _ACEOF
3764 rm -f conftest.$ac_objext
3765 if { (eval echo "$as_me:3765: \"$ac_compile\"") >&5
3766   (eval $ac_compile) 2>&5
3767   ac_status=$?
3768   echo "$as_me:3768: \$? = $ac_status" >&5
3769   (exit $ac_status); } &&
3770          { ac_try='test -s conftest.$ac_objext'
3771   { (eval echo "$as_me:3771: \"$ac_try\"") >&5
3772   (eval $ac_try) 2>&5
3773   ac_status=$?
3774   echo "$as_me:3774: \$? = $ac_status" >&5
3775   (exit $ac_status); }; }; then
3776   cf_XOPEN_SOURCE_set_ok=yes
3777 else
3778   echo "$as_me: failed program was:" >&5
3779 cat conftest.$ac_ext >&5
3780 cf_XOPEN_SOURCE_set_ok=no
3781 fi
3782 rm -f conftest.$ac_objext conftest.$ac_ext
3783                 if test $cf_XOPEN_SOURCE_set_ok = no
3784                 then
3785                         { echo "$as_me:3785: WARNING: _XOPEN_SOURCE is lower than requested" >&5
3786 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
3787                 fi
3788         else
3789
3790 echo "$as_me:3790: checking if we should define _XOPEN_SOURCE" >&5
3791 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
3792 if test "${cf_cv_xopen_source+set}" = set; then
3793   echo $ECHO_N "(cached) $ECHO_C" >&6
3794 else
3795
3796         cat >conftest.$ac_ext <<_ACEOF
3797 #line 3797 "configure"
3798 #include "confdefs.h"
3799
3800 #include <stdlib.h>
3801 #include <string.h>
3802 #include <sys/types.h>
3803
3804 int
3805 main ()
3806 {
3807
3808 #ifndef _XOPEN_SOURCE
3809 make an error
3810 #endif
3811   ;
3812   return 0;
3813 }
3814 _ACEOF
3815 rm -f conftest.$ac_objext
3816 if { (eval echo "$as_me:3816: \"$ac_compile\"") >&5
3817   (eval $ac_compile) 2>&5
3818   ac_status=$?
3819   echo "$as_me:3819: \$? = $ac_status" >&5
3820   (exit $ac_status); } &&
3821          { ac_try='test -s conftest.$ac_objext'
3822   { (eval echo "$as_me:3822: \"$ac_try\"") >&5
3823   (eval $ac_try) 2>&5
3824   ac_status=$?
3825   echo "$as_me:3825: \$? = $ac_status" >&5
3826   (exit $ac_status); }; }; then
3827   cf_cv_xopen_source=no
3828 else
3829   echo "$as_me: failed program was:" >&5
3830 cat conftest.$ac_ext >&5
3831 cf_save="$CPPFLAGS"
3832          CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
3833          cat >conftest.$ac_ext <<_ACEOF
3834 #line 3834 "configure"
3835 #include "confdefs.h"
3836
3837 #include <stdlib.h>
3838 #include <string.h>
3839 #include <sys/types.h>
3840
3841 int
3842 main ()
3843 {
3844
3845 #ifdef _XOPEN_SOURCE
3846 make an error
3847 #endif
3848   ;
3849   return 0;
3850 }
3851 _ACEOF
3852 rm -f conftest.$ac_objext
3853 if { (eval echo "$as_me:3853: \"$ac_compile\"") >&5
3854   (eval $ac_compile) 2>&5
3855   ac_status=$?
3856   echo "$as_me:3856: \$? = $ac_status" >&5
3857   (exit $ac_status); } &&
3858          { ac_try='test -s conftest.$ac_objext'
3859   { (eval echo "$as_me:3859: \"$ac_try\"") >&5
3860   (eval $ac_try) 2>&5
3861   ac_status=$?
3862   echo "$as_me:3862: \$? = $ac_status" >&5
3863   (exit $ac_status); }; }; then
3864   cf_cv_xopen_source=no
3865 else
3866   echo "$as_me: failed program was:" >&5
3867 cat conftest.$ac_ext >&5
3868 cf_cv_xopen_source=$cf_XOPEN_SOURCE
3869 fi
3870 rm -f conftest.$ac_objext conftest.$ac_ext
3871         CPPFLAGS="$cf_save"
3872
3873 fi
3874 rm -f conftest.$ac_objext conftest.$ac_ext
3875
3876 fi
3877 echo "$as_me:3877: result: $cf_cv_xopen_source" >&5
3878 echo "${ECHO_T}$cf_cv_xopen_source" >&6
3879
3880 if test "$cf_cv_xopen_source" != no ; then
3881
3882 CFLAGS=`echo "$CFLAGS" | \
3883         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
3884                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
3885
3886 CPPFLAGS=`echo "$CPPFLAGS" | \
3887         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
3888                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
3889
3890         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
3891
3892 cf_fix_cppflags=no
3893 cf_new_cflags=
3894 cf_new_cppflags=
3895 cf_new_extra_cppflags=
3896
3897 for cf_add_cflags in $cf_temp_xopen_source
3898 do
3899 case $cf_fix_cppflags in
3900 (no)
3901         case $cf_add_cflags in
3902         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
3903                 case $cf_add_cflags in
3904                 (-D*)
3905                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3906
3907                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3908                                 && test -z "${cf_tst_cflags}" \
3909                                 && cf_fix_cppflags=yes
3910
3911                         if test $cf_fix_cppflags = yes ; then
3912                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3913                                 continue
3914                         elif test "${cf_tst_cflags}" = "\"'" ; then
3915                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3916                                 continue
3917                         fi
3918                         ;;
3919                 esac
3920                 case "$CPPFLAGS" in
3921                 (*$cf_add_cflags)
3922                         ;;
3923                 (*)
3924                         case $cf_add_cflags in
3925                         (-D*)
3926                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3927
3928 CPPFLAGS=`echo "$CPPFLAGS" | \
3929         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3930                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3931
3932                                 ;;
3933                         esac
3934                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3935                         ;;
3936                 esac
3937                 ;;
3938         (*)
3939                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
3940                 ;;
3941         esac
3942         ;;
3943 (yes)
3944         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3945
3946         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3947
3948         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3949                 && test -z "${cf_tst_cflags}" \
3950                 && cf_fix_cppflags=no
3951         ;;
3952 esac
3953 done
3954
3955 if test -n "$cf_new_cflags" ; then
3956
3957         CFLAGS="$CFLAGS $cf_new_cflags"
3958 fi
3959
3960 if test -n "$cf_new_cppflags" ; then
3961
3962         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
3963 fi
3964
3965 if test -n "$cf_new_extra_cppflags" ; then
3966
3967         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
3968 fi
3969
3970 fi
3971
3972         fi
3973 fi
3974
3975 echo "$as_me:3975: checking for signal global datatype" >&5
3976 echo $ECHO_N "checking for signal global datatype... $ECHO_C" >&6
3977 if test "${cf_cv_sig_atomic_t+set}" = set; then
3978   echo $ECHO_N "(cached) $ECHO_C" >&6
3979 else
3980
3981         for cf_type in \
3982                 "volatile sig_atomic_t" \
3983                 "sig_atomic_t" \
3984                 "int"
3985         do
3986         cat >conftest.$ac_ext <<_ACEOF
3987 #line 3987 "configure"
3988 #include "confdefs.h"
3989
3990 #include <sys/types.h>
3991 #include <signal.h>
3992 #include <stdio.h>
3993
3994 extern $cf_type x;
3995 $cf_type x;
3996 static void handler(int sig)
3997 {
3998         x = 5;
3999 }
4000 int
4001 main ()
4002 {
4003 signal(SIGINT, handler);
4004                  x = 1
4005   ;
4006   return 0;
4007 }
4008 _ACEOF
4009 rm -f conftest.$ac_objext
4010 if { (eval echo "$as_me:4010: \"$ac_compile\"") >&5
4011   (eval $ac_compile) 2>&5
4012   ac_status=$?
4013   echo "$as_me:4013: \$? = $ac_status" >&5
4014   (exit $ac_status); } &&
4015          { ac_try='test -s conftest.$ac_objext'
4016   { (eval echo "$as_me:4016: \"$ac_try\"") >&5
4017   (eval $ac_try) 2>&5
4018   ac_status=$?
4019   echo "$as_me:4019: \$? = $ac_status" >&5
4020   (exit $ac_status); }; }; then
4021   cf_cv_sig_atomic_t=$cf_type
4022 else
4023   echo "$as_me: failed program was:" >&5
4024 cat conftest.$ac_ext >&5
4025 cf_cv_sig_atomic_t=no
4026 fi
4027 rm -f conftest.$ac_objext conftest.$ac_ext
4028                 test "$cf_cv_sig_atomic_t" != no && break
4029         done
4030
4031 fi
4032
4033 echo "$as_me:4033: result: $cf_cv_sig_atomic_t" >&5
4034 echo "${ECHO_T}$cf_cv_sig_atomic_t" >&6
4035 test "$cf_cv_sig_atomic_t" != no &&
4036 cat >>confdefs.h <<EOF
4037 #define SIG_ATOMIC_T $cf_cv_sig_atomic_t
4038 EOF
4039
4040 echo "$as_me:4040: checking if you want to use pkg-config" >&5
4041 echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6
4042
4043 # Check whether --with-pkg-config or --without-pkg-config was given.
4044 if test "${with_pkg_config+set}" = set; then
4045   withval="$with_pkg_config"
4046   cf_pkg_config=$withval
4047 else
4048   cf_pkg_config=yes
4049 fi;
4050 echo "$as_me:4050: result: $cf_pkg_config" >&5
4051 echo "${ECHO_T}$cf_pkg_config" >&6
4052
4053 case $cf_pkg_config in
4054 (no)
4055         PKG_CONFIG=none
4056         ;;
4057 (yes)
4058
4059 if test -n "$ac_tool_prefix"; then
4060   # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
4061 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
4062 echo "$as_me:4062: checking for $ac_word" >&5
4063 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4064 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
4065   echo $ECHO_N "(cached) $ECHO_C" >&6
4066 else
4067   case $PKG_CONFIG in
4068   [\\/]* | ?:[\\/]*)
4069   ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
4070   ;;
4071   *)
4072   ac_save_IFS=$IFS; IFS=$ac_path_separator
4073 ac_dummy="$PATH"
4074 for ac_dir in $ac_dummy; do
4075   IFS=$ac_save_IFS
4076   test -z "$ac_dir" && ac_dir=.
4077   if $as_executable_p "$ac_dir/$ac_word"; then
4078    ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
4079    echo "$as_me:4079: found $ac_dir/$ac_word" >&5
4080    break
4081 fi
4082 done
4083
4084   ;;
4085 esac
4086 fi
4087 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
4088
4089 if test -n "$PKG_CONFIG"; then
4090   echo "$as_me:4090: result: $PKG_CONFIG" >&5
4091 echo "${ECHO_T}$PKG_CONFIG" >&6
4092 else
4093   echo "$as_me:4093: result: no" >&5
4094 echo "${ECHO_T}no" >&6
4095 fi
4096
4097 fi
4098 if test -z "$ac_cv_path_PKG_CONFIG"; then
4099   ac_pt_PKG_CONFIG=$PKG_CONFIG
4100   # Extract the first word of "pkg-config", so it can be a program name with args.
4101 set dummy pkg-config; ac_word=$2
4102 echo "$as_me:4102: checking for $ac_word" >&5
4103 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4104 if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
4105   echo $ECHO_N "(cached) $ECHO_C" >&6
4106 else
4107   case $ac_pt_PKG_CONFIG in
4108   [\\/]* | ?:[\\/]*)
4109   ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
4110   ;;
4111   *)
4112   ac_save_IFS=$IFS; IFS=$ac_path_separator
4113 ac_dummy="$PATH"
4114 for ac_dir in $ac_dummy; do
4115   IFS=$ac_save_IFS
4116   test -z "$ac_dir" && ac_dir=.
4117   if $as_executable_p "$ac_dir/$ac_word"; then
4118    ac_cv_path_ac_pt_PKG_CONFIG="$ac_dir/$ac_word"
4119    echo "$as_me:4119: found $ac_dir/$ac_word" >&5
4120    break
4121 fi
4122 done
4123
4124   test -z "$ac_cv_path_ac_pt_PKG_CONFIG" && ac_cv_path_ac_pt_PKG_CONFIG="none"
4125   ;;
4126 esac
4127 fi
4128 ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
4129
4130 if test -n "$ac_pt_PKG_CONFIG"; then
4131   echo "$as_me:4131: result: $ac_pt_PKG_CONFIG" >&5
4132 echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
4133 else
4134   echo "$as_me:4134: result: no" >&5
4135 echo "${ECHO_T}no" >&6
4136 fi
4137
4138   PKG_CONFIG=$ac_pt_PKG_CONFIG
4139 else
4140   PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
4141 fi
4142
4143         ;;
4144 (*)
4145         PKG_CONFIG=$withval
4146         ;;
4147 esac
4148
4149 test -z "$PKG_CONFIG" && PKG_CONFIG=none
4150 if test "$PKG_CONFIG" != none ; then
4151
4152 if test "x$prefix" != xNONE; then
4153         cf_path_syntax="$prefix"
4154 else
4155         cf_path_syntax="$ac_default_prefix"
4156 fi
4157
4158 case ".$PKG_CONFIG" in
4159 (.\$\(*\)*|.\'*\'*)
4160         ;;
4161 (..|./*|.\\*)
4162         ;;
4163 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
4164         ;;
4165 (.\${*prefix}*|.\${*dir}*)
4166         eval PKG_CONFIG="$PKG_CONFIG"
4167         case ".$PKG_CONFIG" in
4168         (.NONE/*)
4169                 PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
4170                 ;;
4171         esac
4172         ;;
4173 (.no|.NONE/*)
4174         PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
4175         ;;
4176 (*)
4177         { { echo "$as_me:4177: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
4178 echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
4179    { (exit 1); exit 1; }; }
4180         ;;
4181 esac
4182
4183 else
4184         { echo "$as_me:4184: WARNING: pkg-config is not installed" >&5
4185 echo "$as_me: WARNING: pkg-config is not installed" >&2;}
4186 fi
4187
4188 echo "$as_me:4188: checking if you want to see long compiling messages" >&5
4189 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
4190
4191 # Check whether --enable-echo or --disable-echo was given.
4192 if test "${enable_echo+set}" = set; then
4193   enableval="$enable_echo"
4194   test "$enableval" != no && enableval=yes
4195   if test "$enableval" != "yes" ; then
4196
4197         ECHO_LT='--silent'
4198         ECHO_LD='@echo linking $@;'
4199         RULE_CC='@echo compiling $<'
4200         SHOW_CC='@echo compiling $@'
4201         ECHO_CC='@'
4202
4203   else
4204
4205         ECHO_LT=''
4206         ECHO_LD=''
4207         RULE_CC=''
4208         SHOW_CC=''
4209         ECHO_CC=''
4210
4211   fi
4212 else
4213   enableval=yes
4214
4215         ECHO_LT=''
4216         ECHO_LD=''
4217         RULE_CC=''
4218         SHOW_CC=''
4219         ECHO_CC=''
4220
4221 fi;
4222 echo "$as_me:4222: result: $enableval" >&5
4223 echo "${ECHO_T}$enableval" >&6
4224
4225 echo "$as_me:4225: checking for ncurses wrap-prefix" >&5
4226 echo $ECHO_N "checking for ncurses wrap-prefix... $ECHO_C" >&6
4227
4228 # Check whether --with-ncurses-wrap-prefix or --without-ncurses-wrap-prefix was given.
4229 if test "${with_ncurses_wrap_prefix+set}" = set; then
4230   withval="$with_ncurses_wrap_prefix"
4231   NCURSES_WRAP_PREFIX=$withval
4232 else
4233   NCURSES_WRAP_PREFIX=_nc_
4234 fi;
4235 echo "$as_me:4235: result: $NCURSES_WRAP_PREFIX" >&5
4236 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
4237
4238 echo "$as_me:4238: checking if you want to check for wide-character functions" >&5
4239 echo $ECHO_N "checking if you want to check for wide-character functions... $ECHO_C" >&6
4240
4241 # Check whether --enable-widec or --disable-widec was given.
4242 if test "${enable_widec+set}" = set; then
4243   enableval="$enable_widec"
4244   test "$enableval" != no && enableval=yes
4245   if test "$enableval" != "yes" ; then
4246     cf_enable_widec=no
4247   else
4248     cf_enable_widec=yes
4249   fi
4250 else
4251   enableval=yes
4252   cf_enable_widec=yes
4253
4254 fi;
4255 echo "$as_me:4255: result: $cf_enable_widec" >&5
4256 echo "${ECHO_T}$cf_enable_widec" >&6
4257
4258 echo "$as_me:4258: checking for specific curses-directory" >&5
4259 echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
4260
4261 # Check whether --with-curses-dir or --without-curses-dir was given.
4262 if test "${with_curses_dir+set}" = set; then
4263   withval="$with_curses_dir"
4264   cf_cv_curses_dir=$withval
4265 else
4266   cf_cv_curses_dir=no
4267 fi;
4268 echo "$as_me:4268: result: $cf_cv_curses_dir" >&5
4269 echo "${ECHO_T}$cf_cv_curses_dir" >&6
4270
4271 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
4272 then
4273
4274 if test "x$prefix" != xNONE; then
4275         cf_path_syntax="$prefix"
4276 else
4277         cf_path_syntax="$ac_default_prefix"
4278 fi
4279
4280 case ".$withval" in
4281 (.\$\(*\)*|.\'*\'*)
4282         ;;
4283 (..|./*|.\\*)
4284         ;;
4285 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
4286         ;;
4287 (.\${*prefix}*|.\${*dir}*)
4288         eval withval="$withval"
4289         case ".$withval" in
4290         (.NONE/*)
4291                 withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
4292                 ;;
4293         esac
4294         ;;
4295 (.no|.NONE/*)
4296         withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
4297         ;;
4298 (*)
4299         { { echo "$as_me:4299: error: expected a pathname, not \"$withval\"" >&5
4300 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
4301    { (exit 1); exit 1; }; }
4302         ;;
4303 esac
4304
4305         if test -d "$cf_cv_curses_dir"
4306         then
4307
4308 if test -n "$cf_cv_curses_dir/include" ; then
4309   for cf_add_incdir in $cf_cv_curses_dir/include
4310   do
4311         while test $cf_add_incdir != /usr/include
4312         do
4313           if test -d $cf_add_incdir
4314           then
4315                 cf_have_incdir=no
4316                 if test -n "$CFLAGS$CPPFLAGS" ; then
4317                   # a loop is needed to ensure we can add subdirs of existing dirs
4318                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4319                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4320                           cf_have_incdir=yes; break
4321                         fi
4322                   done
4323                 fi
4324
4325                 if test "$cf_have_incdir" = no ; then
4326                   if test "$cf_add_incdir" = /usr/local/include ; then
4327                         if test "$GCC" = yes
4328                         then
4329                           cf_save_CPPFLAGS=$CPPFLAGS
4330                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4331                           cat >conftest.$ac_ext <<_ACEOF
4332 #line 4332 "configure"
4333 #include "confdefs.h"
4334 #include <stdio.h>
4335 int
4336 main ()
4337 {
4338 printf("Hello")
4339   ;
4340   return 0;
4341 }
4342 _ACEOF
4343 rm -f conftest.$ac_objext
4344 if { (eval echo "$as_me:4344: \"$ac_compile\"") >&5
4345   (eval $ac_compile) 2>&5
4346   ac_status=$?
4347   echo "$as_me:4347: \$? = $ac_status" >&5
4348   (exit $ac_status); } &&
4349          { ac_try='test -s conftest.$ac_objext'
4350   { (eval echo "$as_me:4350: \"$ac_try\"") >&5
4351   (eval $ac_try) 2>&5
4352   ac_status=$?
4353   echo "$as_me:4353: \$? = $ac_status" >&5
4354   (exit $ac_status); }; }; then
4355   :
4356 else
4357   echo "$as_me: failed program was:" >&5
4358 cat conftest.$ac_ext >&5
4359 cf_have_incdir=yes
4360 fi
4361 rm -f conftest.$ac_objext conftest.$ac_ext
4362                           CPPFLAGS=$cf_save_CPPFLAGS
4363                         fi
4364                   fi
4365                 fi
4366
4367                 if test "$cf_have_incdir" = no ; then
4368                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4369
4370 echo "${as_me:-configure}:4370: testing adding $cf_add_incdir to include-path ..." 1>&5
4371
4372                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4373
4374                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
4375                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4376                   cf_add_incdir="$cf_top_incdir"
4377                 else
4378                   break
4379                 fi
4380           fi
4381         done
4382   done
4383 fi
4384
4385 if test -n "$cf_cv_curses_dir/lib" ; then
4386         for cf_add_libdir in $cf_cv_curses_dir/lib
4387         do
4388                 if test $cf_add_libdir = /usr/lib ; then
4389                         :
4390                 elif test -d $cf_add_libdir
4391                 then
4392                         cf_have_libdir=no
4393                         if test -n "$LDFLAGS$LIBS" ; then
4394                                 # a loop is needed to ensure we can add subdirs of existing dirs
4395                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
4396                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
4397                                                 cf_have_libdir=yes; break
4398                                         fi
4399                                 done
4400                         fi
4401                         if test "$cf_have_libdir" = no ; then
4402                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
4403
4404 echo "${as_me:-configure}:4404: testing adding $cf_add_libdir to library-path ..." 1>&5
4405
4406                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
4407                         fi
4408                 fi
4409         done
4410 fi
4411
4412         fi
4413 fi
4414
4415 cf_cv_screen=curses
4416
4417 echo "$as_me:4417: checking for specified curses library type" >&5
4418 echo $ECHO_N "checking for specified curses library type... $ECHO_C" >&6
4419
4420 # Check whether --with-screen or --without-screen was given.
4421 if test "${with_screen+set}" = set; then
4422   withval="$with_screen"
4423   cf_cv_screen=$withval
4424 else
4425
4426 # Check whether --with-ncursesw or --without-ncursesw was given.
4427 if test "${with_ncursesw+set}" = set; then
4428   withval="$with_ncursesw"
4429   cf_cv_screen=ncursesw
4430 else
4431
4432 # Check whether --with-ncurses or --without-ncurses was given.
4433 if test "${with_ncurses+set}" = set; then
4434   withval="$with_ncurses"
4435   cf_cv_screen=ncurses
4436 else
4437
4438 # Check whether --with-pdcurses or --without-pdcurses was given.
4439 if test "${with_pdcurses+set}" = set; then
4440   withval="$with_pdcurses"
4441   cf_cv_screen=pdcurses
4442 else
4443
4444 # Check whether --with-curses-colr or --without-curses-colr was given.
4445 if test "${with_curses_colr+set}" = set; then
4446   withval="$with_curses_colr"
4447   cf_cv_screen=curses_colr
4448 else
4449
4450 # Check whether --with-curses-5lib or --without-curses-5lib was given.
4451 if test "${with_curses_5lib+set}" = set; then
4452   withval="$with_curses_5lib"
4453   cf_cv_screen=curses_5lib
4454 fi;
4455 fi;
4456 fi;
4457 fi;
4458 fi;
4459 fi;
4460
4461 echo "$as_me:4461: result: $cf_cv_screen" >&5
4462 echo "${ECHO_T}$cf_cv_screen" >&6
4463
4464 case $cf_cv_screen in
4465 (curses|curses_*)
4466
4467 echo "$as_me:4467: checking for extra include directories" >&5
4468 echo $ECHO_N "checking for extra include directories... $ECHO_C" >&6
4469 if test "${cf_cv_curses_incdir+set}" = set; then
4470   echo $ECHO_N "(cached) $ECHO_C" >&6
4471 else
4472
4473 cf_cv_curses_incdir=no
4474 case $host_os in
4475 (hpux10.*)
4476         if test "x$cf_cv_screen" = "xcurses_colr"
4477         then
4478                 test -d /usr/include/curses_colr && \
4479                 cf_cv_curses_incdir="-I/usr/include/curses_colr"
4480         fi
4481         ;;
4482 (sunos3*|sunos4*)
4483         if test "x$cf_cv_screen" = "xcurses_5lib"
4484         then
4485                 test -d /usr/5lib && \
4486                 test -d /usr/5include && \
4487                 cf_cv_curses_incdir="-I/usr/5include"
4488         fi
4489         ;;
4490 esac
4491
4492 fi
4493 echo "$as_me:4493: result: $cf_cv_curses_incdir" >&5
4494 echo "${ECHO_T}$cf_cv_curses_incdir" >&6
4495 test "$cf_cv_curses_incdir" != no && CPPFLAGS="$CPPFLAGS $cf_cv_curses_incdir"
4496
4497 echo "$as_me:4497: checking if we have identified curses headers" >&5
4498 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
4499 if test "${cf_cv_ncurses_header+set}" = set; then
4500   echo $ECHO_N "(cached) $ECHO_C" >&6
4501 else
4502
4503 cf_cv_ncurses_header=none
4504 for cf_header in \
4505         ncurses.h  \
4506         curses.h  ncurses/ncurses.h ncurses/curses.h
4507 do
4508 cat >conftest.$ac_ext <<_ACEOF
4509 #line 4509 "configure"
4510 #include "confdefs.h"
4511 #include <${cf_header}>
4512 int
4513 main ()
4514 {
4515 initscr(); tgoto("?", 0,0)
4516   ;
4517   return 0;
4518 }
4519 _ACEOF
4520 rm -f conftest.$ac_objext
4521 if { (eval echo "$as_me:4521: \"$ac_compile\"") >&5
4522   (eval $ac_compile) 2>&5
4523   ac_status=$?
4524   echo "$as_me:4524: \$? = $ac_status" >&5
4525   (exit $ac_status); } &&
4526          { ac_try='test -s conftest.$ac_objext'
4527   { (eval echo "$as_me:4527: \"$ac_try\"") >&5
4528   (eval $ac_try) 2>&5
4529   ac_status=$?
4530   echo "$as_me:4530: \$? = $ac_status" >&5
4531   (exit $ac_status); }; }; then
4532   cf_cv_ncurses_header=$cf_header; break
4533 else
4534   echo "$as_me: failed program was:" >&5
4535 cat conftest.$ac_ext >&5
4536 fi
4537 rm -f conftest.$ac_objext conftest.$ac_ext
4538 done
4539
4540 fi
4541 echo "$as_me:4541: result: $cf_cv_ncurses_header" >&5
4542 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
4543
4544 if test "$cf_cv_ncurses_header" = none ; then
4545         { { echo "$as_me:4545: error: No curses header-files found" >&5
4546 echo "$as_me: error: No curses header-files found" >&2;}
4547    { (exit 1); exit 1; }; }
4548 fi
4549
4550 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
4551
4552 for ac_header in $cf_cv_ncurses_header
4553 do
4554 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
4555 echo "$as_me:4555: checking for $ac_header" >&5
4556 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
4557 if eval "test \"\${$as_ac_Header+set}\" = set"; then
4558   echo $ECHO_N "(cached) $ECHO_C" >&6
4559 else
4560   cat >conftest.$ac_ext <<_ACEOF
4561 #line 4561 "configure"
4562 #include "confdefs.h"
4563 #include <$ac_header>
4564 _ACEOF
4565 if { (eval echo "$as_me:4565: \"$ac_cpp conftest.$ac_ext\"") >&5
4566   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
4567   ac_status=$?
4568   egrep -v '^ *\+' conftest.er1 >conftest.err
4569   rm -f conftest.er1
4570   cat conftest.err >&5
4571   echo "$as_me:4571: \$? = $ac_status" >&5
4572   (exit $ac_status); } >/dev/null; then
4573   if test -s conftest.err; then
4574     ac_cpp_err=$ac_c_preproc_warn_flag
4575   else
4576     ac_cpp_err=
4577   fi
4578 else
4579   ac_cpp_err=yes
4580 fi
4581 if test -z "$ac_cpp_err"; then
4582   eval "$as_ac_Header=yes"
4583 else
4584   echo "$as_me: failed program was:" >&5
4585   cat conftest.$ac_ext >&5
4586   eval "$as_ac_Header=no"
4587 fi
4588 rm -f conftest.err conftest.$ac_ext
4589 fi
4590 echo "$as_me:4590: result: `eval echo '${'$as_ac_Header'}'`" >&5
4591 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
4592 if test `eval echo '${'$as_ac_Header'}'` = yes; then
4593   cat >>confdefs.h <<EOF
4594 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
4595 EOF
4596
4597 fi
4598 done
4599
4600 echo "$as_me:4600: checking for terminfo header" >&5
4601 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
4602 if test "${cf_cv_term_header+set}" = set; then
4603   echo $ECHO_N "(cached) $ECHO_C" >&6
4604 else
4605
4606 case ${cf_cv_ncurses_header} in
4607 (*/ncurses.h|*/ncursesw.h)
4608         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
4609         ;;
4610 (*)
4611         cf_term_header=term.h
4612         ;;
4613 esac
4614
4615 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
4616 do
4617 cat >conftest.$ac_ext <<_ACEOF
4618 #line 4618 "configure"
4619 #include "confdefs.h"
4620 #include <stdio.h>
4621 #include <${cf_cv_ncurses_header:-curses.h}>
4622 #include <$cf_test>
4623
4624 int
4625 main ()
4626 {
4627 int x = auto_left_margin
4628   ;
4629   return 0;
4630 }
4631 _ACEOF
4632 rm -f conftest.$ac_objext
4633 if { (eval echo "$as_me:4633: \"$ac_compile\"") >&5
4634   (eval $ac_compile) 2>&5
4635   ac_status=$?
4636   echo "$as_me:4636: \$? = $ac_status" >&5
4637   (exit $ac_status); } &&
4638          { ac_try='test -s conftest.$ac_objext'
4639   { (eval echo "$as_me:4639: \"$ac_try\"") >&5
4640   (eval $ac_try) 2>&5
4641   ac_status=$?
4642   echo "$as_me:4642: \$? = $ac_status" >&5
4643   (exit $ac_status); }; }; then
4644
4645         cf_cv_term_header="$cf_test"
4646 else
4647   echo "$as_me: failed program was:" >&5
4648 cat conftest.$ac_ext >&5
4649
4650         cf_cv_term_header=unknown
4651
4652 fi
4653 rm -f conftest.$ac_objext conftest.$ac_ext
4654         test "$cf_cv_term_header" != unknown && break
4655 done
4656
4657 fi
4658 echo "$as_me:4658: result: $cf_cv_term_header" >&5
4659 echo "${ECHO_T}$cf_cv_term_header" >&6
4660
4661 # Set definitions to allow ifdef'ing to accommodate subdirectories
4662
4663 case $cf_cv_term_header in
4664 (*term.h)
4665
4666 cat >>confdefs.h <<\EOF
4667 #define HAVE_TERM_H 1
4668 EOF
4669
4670         ;;
4671 esac
4672
4673 case $cf_cv_term_header in
4674 (ncurses/term.h)
4675
4676 cat >>confdefs.h <<\EOF
4677 #define HAVE_NCURSES_TERM_H 1
4678 EOF
4679
4680         ;;
4681 (ncursesw/term.h)
4682
4683 cat >>confdefs.h <<\EOF
4684 #define HAVE_NCURSESW_TERM_H 1
4685 EOF
4686
4687         ;;
4688 esac
4689
4690 echo "$as_me:4690: checking for ncurses version" >&5
4691 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
4692 if test "${cf_cv_ncurses_version+set}" = set; then
4693   echo $ECHO_N "(cached) $ECHO_C" >&6
4694 else
4695
4696         cf_cv_ncurses_version=no
4697         cf_tempfile=out$$
4698         rm -f $cf_tempfile
4699         if test "$cross_compiling" = yes; then
4700
4701         # This will not work if the preprocessor splits the line after the
4702         # Autoconf token.  The 'unproto' program does that.
4703         cat > conftest.$ac_ext <<EOF
4704 #include <${cf_cv_ncurses_header:-curses.h}>
4705 #undef Autoconf
4706 #ifdef NCURSES_VERSION
4707 Autoconf NCURSES_VERSION
4708 #else
4709 #ifdef __NCURSES_H
4710 Autoconf "old"
4711 #endif
4712 ;
4713 #endif
4714 EOF
4715         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
4716         { (eval echo "$as_me:4716: \"$cf_try\"") >&5
4717   (eval $cf_try) 2>&5
4718   ac_status=$?
4719   echo "$as_me:4719: \$? = $ac_status" >&5
4720   (exit $ac_status); }
4721         if test -f conftest.out ; then
4722                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
4723                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
4724                 rm -f conftest.out
4725         fi
4726
4727 else
4728   cat >conftest.$ac_ext <<_ACEOF
4729 #line 4729 "configure"
4730 #include "confdefs.h"
4731
4732 #include <${cf_cv_ncurses_header:-curses.h}>
4733 #include <stdio.h>
4734 int main()
4735 {
4736         FILE *fp = fopen("$cf_tempfile", "w");
4737 #ifdef NCURSES_VERSION
4738 # ifdef NCURSES_VERSION_PATCH
4739         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
4740 # else
4741         fprintf(fp, "%s\n", NCURSES_VERSION);
4742 # endif
4743 #else
4744 # ifdef __NCURSES_H
4745         fprintf(fp, "old\n");
4746 # else
4747         make an error
4748 # endif
4749 #endif
4750         ${cf_cv_main_return:-return}(0);
4751 }
4752 _ACEOF
4753 rm -f conftest$ac_exeext
4754 if { (eval echo "$as_me:4754: \"$ac_link\"") >&5
4755   (eval $ac_link) 2>&5
4756   ac_status=$?
4757   echo "$as_me:4757: \$? = $ac_status" >&5
4758   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
4759   { (eval echo "$as_me:4759: \"$ac_try\"") >&5
4760   (eval $ac_try) 2>&5
4761   ac_status=$?
4762   echo "$as_me:4762: \$? = $ac_status" >&5
4763   (exit $ac_status); }; }; then
4764
4765         cf_cv_ncurses_version=`cat $cf_tempfile`
4766 else
4767   echo "$as_me: program exited with status $ac_status" >&5
4768 echo "$as_me: failed program was:" >&5
4769 cat conftest.$ac_ext >&5
4770 fi
4771 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
4772 fi
4773         rm -f $cf_tempfile
4774
4775 fi
4776 echo "$as_me:4776: result: $cf_cv_ncurses_version" >&5
4777 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
4778 test "$cf_cv_ncurses_version" = no ||
4779 cat >>confdefs.h <<\EOF
4780 #define NCURSES 1
4781 EOF
4782
4783 echo "$as_me:4783: checking if we have identified curses libraries" >&5
4784 echo $ECHO_N "checking if we have identified curses libraries... $ECHO_C" >&6
4785 cat >conftest.$ac_ext <<_ACEOF
4786 #line 4786 "configure"
4787 #include "confdefs.h"
4788 #include <${cf_cv_ncurses_header:-curses.h}>
4789 int
4790 main ()
4791 {
4792 initscr(); tgoto("?", 0,0)
4793   ;
4794   return 0;
4795 }
4796 _ACEOF
4797 rm -f conftest.$ac_objext conftest$ac_exeext
4798 if { (eval echo "$as_me:4798: \"$ac_link\"") >&5
4799   (eval $ac_link) 2>&5
4800   ac_status=$?
4801   echo "$as_me:4801: \$? = $ac_status" >&5
4802   (exit $ac_status); } &&
4803          { ac_try='test -s conftest$ac_exeext'
4804   { (eval echo "$as_me:4804: \"$ac_try\"") >&5
4805   (eval $ac_try) 2>&5
4806   ac_status=$?
4807   echo "$as_me:4807: \$? = $ac_status" >&5
4808   (exit $ac_status); }; }; then
4809   cf_result=yes
4810 else
4811   echo "$as_me: failed program was:" >&5
4812 cat conftest.$ac_ext >&5
4813 cf_result=no
4814 fi
4815 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4816 echo "$as_me:4816: result: $cf_result" >&5
4817 echo "${ECHO_T}$cf_result" >&6
4818
4819 if test "$cf_result" = no ; then
4820 case $host_os in
4821 (freebsd*)
4822     echo "$as_me:4822: checking for tgoto in -lmytinfo" >&5
4823 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
4824 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
4825   echo $ECHO_N "(cached) $ECHO_C" >&6
4826 else
4827   ac_check_lib_save_LIBS=$LIBS
4828 LIBS="-lmytinfo  $LIBS"
4829 cat >conftest.$ac_ext <<_ACEOF
4830 #line 4830 "configure"
4831 #include "confdefs.h"
4832
4833 /* Override any gcc2 internal prototype to avoid an error.  */
4834 #ifdef __cplusplus
4835 extern "C"
4836 #endif
4837 /* We use char because int might match the return type of a gcc2
4838    builtin and then its argument prototype would still apply.  */
4839 char tgoto ();
4840 int
4841 main ()
4842 {
4843 tgoto ();
4844   ;
4845   return 0;
4846 }
4847 _ACEOF
4848 rm -f conftest.$ac_objext conftest$ac_exeext
4849 if { (eval echo "$as_me:4849: \"$ac_link\"") >&5
4850   (eval $ac_link) 2>&5
4851   ac_status=$?
4852   echo "$as_me:4852: \$? = $ac_status" >&5
4853   (exit $ac_status); } &&
4854          { ac_try='test -s conftest$ac_exeext'
4855   { (eval echo "$as_me:4855: \"$ac_try\"") >&5
4856   (eval $ac_try) 2>&5
4857   ac_status=$?
4858   echo "$as_me:4858: \$? = $ac_status" >&5
4859   (exit $ac_status); }; }; then
4860   ac_cv_lib_mytinfo_tgoto=yes
4861 else
4862   echo "$as_me: failed program was:" >&5
4863 cat conftest.$ac_ext >&5
4864 ac_cv_lib_mytinfo_tgoto=no
4865 fi
4866 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4867 LIBS=$ac_check_lib_save_LIBS
4868 fi
4869 echo "$as_me:4869: result: $ac_cv_lib_mytinfo_tgoto" >&5
4870 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
4871 if test $ac_cv_lib_mytinfo_tgoto = yes; then
4872
4873 cf_add_libs="-lmytinfo"
4874 # Filter out duplicates - this happens with badly-designed ".pc" files...
4875 for cf_add_1lib in $LIBS
4876 do
4877         for cf_add_2lib in $cf_add_libs
4878         do
4879                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
4880                 then
4881                         cf_add_1lib=
4882                         break
4883                 fi
4884         done
4885         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
4886 done
4887 LIBS="$cf_add_libs"
4888
4889 fi
4890
4891     ;;
4892 (hpux10.*)
4893         # Looking at HPUX 10.20, the Hcurses library is the oldest (1997), cur_colr
4894         # next (1998), and xcurses "newer" (2000).  There is no header file for
4895         # Hcurses; the subdirectory curses_colr has the headers (curses.h and
4896         # term.h) for cur_colr
4897         if test "x$cf_cv_screen" = "xcurses_colr"
4898         then
4899                 echo "$as_me:4899: checking for initscr in -lcur_colr" >&5
4900 echo $ECHO_N "checking for initscr in -lcur_colr... $ECHO_C" >&6
4901 if test "${ac_cv_lib_cur_colr_initscr+set}" = set; then
4902   echo $ECHO_N "(cached) $ECHO_C" >&6
4903 else
4904   ac_check_lib_save_LIBS=$LIBS
4905 LIBS="-lcur_colr  $LIBS"
4906 cat >conftest.$ac_ext <<_ACEOF
4907 #line 4907 "configure"
4908 #include "confdefs.h"
4909
4910 /* Override any gcc2 internal prototype to avoid an error.  */
4911 #ifdef __cplusplus
4912 extern "C"
4913 #endif
4914 /* We use char because int might match the return type of a gcc2
4915    builtin and then its argument prototype would still apply.  */
4916 char initscr ();
4917 int
4918 main ()
4919 {
4920 initscr ();
4921   ;
4922   return 0;
4923 }
4924 _ACEOF
4925 rm -f conftest.$ac_objext conftest$ac_exeext
4926 if { (eval echo "$as_me:4926: \"$ac_link\"") >&5
4927   (eval $ac_link) 2>&5
4928   ac_status=$?
4929   echo "$as_me:4929: \$? = $ac_status" >&5
4930   (exit $ac_status); } &&
4931          { ac_try='test -s conftest$ac_exeext'
4932   { (eval echo "$as_me:4932: \"$ac_try\"") >&5
4933   (eval $ac_try) 2>&5
4934   ac_status=$?
4935   echo "$as_me:4935: \$? = $ac_status" >&5
4936   (exit $ac_status); }; }; then
4937   ac_cv_lib_cur_colr_initscr=yes
4938 else
4939   echo "$as_me: failed program was:" >&5
4940 cat conftest.$ac_ext >&5
4941 ac_cv_lib_cur_colr_initscr=no
4942 fi
4943 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4944 LIBS=$ac_check_lib_save_LIBS
4945 fi
4946 echo "$as_me:4946: result: $ac_cv_lib_cur_colr_initscr" >&5
4947 echo "${ECHO_T}$ac_cv_lib_cur_colr_initscr" >&6
4948 if test $ac_cv_lib_cur_colr_initscr = yes; then
4949
4950 cf_add_libs="-lcur_colr"
4951 # Filter out duplicates - this happens with badly-designed ".pc" files...
4952 for cf_add_1lib in $LIBS
4953 do
4954         for cf_add_2lib in $cf_add_libs
4955         do
4956                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
4957                 then
4958                         cf_add_1lib=
4959                         break
4960                 fi
4961         done
4962         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
4963 done
4964 LIBS="$cf_add_libs"
4965
4966                         ac_cv_func_initscr=yes
4967
4968 else
4969
4970                 echo "$as_me:4970: checking for initscr in -lHcurses" >&5
4971 echo $ECHO_N "checking for initscr in -lHcurses... $ECHO_C" >&6
4972 if test "${ac_cv_lib_Hcurses_initscr+set}" = set; then
4973   echo $ECHO_N "(cached) $ECHO_C" >&6
4974 else
4975   ac_check_lib_save_LIBS=$LIBS
4976 LIBS="-lHcurses  $LIBS"
4977 cat >conftest.$ac_ext <<_ACEOF
4978 #line 4978 "configure"
4979 #include "confdefs.h"
4980
4981 /* Override any gcc2 internal prototype to avoid an error.  */
4982 #ifdef __cplusplus
4983 extern "C"
4984 #endif
4985 /* We use char because int might match the return type of a gcc2
4986    builtin and then its argument prototype would still apply.  */
4987 char initscr ();
4988 int
4989 main ()
4990 {
4991 initscr ();
4992   ;
4993   return 0;
4994 }
4995 _ACEOF
4996 rm -f conftest.$ac_objext conftest$ac_exeext
4997 if { (eval echo "$as_me:4997: \"$ac_link\"") >&5
4998   (eval $ac_link) 2>&5
4999   ac_status=$?
5000   echo "$as_me:5000: \$? = $ac_status" >&5
5001   (exit $ac_status); } &&
5002          { ac_try='test -s conftest$ac_exeext'
5003   { (eval echo "$as_me:5003: \"$ac_try\"") >&5
5004   (eval $ac_try) 2>&5
5005   ac_status=$?
5006   echo "$as_me:5006: \$? = $ac_status" >&5
5007   (exit $ac_status); }; }; then
5008   ac_cv_lib_Hcurses_initscr=yes
5009 else
5010   echo "$as_me: failed program was:" >&5
5011 cat conftest.$ac_ext >&5
5012 ac_cv_lib_Hcurses_initscr=no
5013 fi
5014 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5015 LIBS=$ac_check_lib_save_LIBS
5016 fi
5017 echo "$as_me:5017: result: $ac_cv_lib_Hcurses_initscr" >&5
5018 echo "${ECHO_T}$ac_cv_lib_Hcurses_initscr" >&6
5019 if test $ac_cv_lib_Hcurses_initscr = yes; then
5020
5021                         # HP's header uses __HP_CURSES, but user claims _HP_CURSES.
5022
5023 cf_add_libs="-lHcurses"
5024 # Filter out duplicates - this happens with badly-designed ".pc" files...
5025 for cf_add_1lib in $LIBS
5026 do
5027         for cf_add_2lib in $cf_add_libs
5028         do
5029                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5030                 then
5031                         cf_add_1lib=
5032                         break
5033                 fi
5034         done
5035         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5036 done
5037 LIBS="$cf_add_libs"
5038
5039                         CPPFLAGS="$CPPFLAGS -D__HP_CURSES -D_HP_CURSES"
5040                         ac_cv_func_initscr=yes
5041
5042 fi
5043
5044 fi
5045
5046         fi
5047         ;;
5048 (linux*)
5049         case `arch 2>/dev/null` in
5050         (x86_64)
5051                 if test -d /lib64
5052                 then
5053
5054 if test -n "/lib64" ; then
5055         for cf_add_libdir in /lib64
5056         do
5057                 if test $cf_add_libdir = /usr/lib ; then
5058                         :
5059                 elif test -d $cf_add_libdir
5060                 then
5061                         cf_have_libdir=no
5062                         if test -n "$LDFLAGS$LIBS" ; then
5063                                 # a loop is needed to ensure we can add subdirs of existing dirs
5064                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
5065                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5066                                                 cf_have_libdir=yes; break
5067                                         fi
5068                                 done
5069                         fi
5070                         if test "$cf_have_libdir" = no ; then
5071                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5072
5073 echo "${as_me:-configure}:5073: testing adding $cf_add_libdir to library-path ..." 1>&5
5074
5075                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5076                         fi
5077                 fi
5078         done
5079 fi
5080
5081                 else
5082
5083 if test -n "/lib" ; then
5084         for cf_add_libdir in /lib
5085         do
5086                 if test $cf_add_libdir = /usr/lib ; then
5087                         :
5088                 elif test -d $cf_add_libdir
5089                 then
5090                         cf_have_libdir=no
5091                         if test -n "$LDFLAGS$LIBS" ; then
5092                                 # a loop is needed to ensure we can add subdirs of existing dirs
5093                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
5094                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5095                                                 cf_have_libdir=yes; break
5096                                         fi
5097                                 done
5098                         fi
5099                         if test "$cf_have_libdir" = no ; then
5100                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5101
5102 echo "${as_me:-configure}:5102: testing adding $cf_add_libdir to library-path ..." 1>&5
5103
5104                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5105                         fi
5106                 fi
5107         done
5108 fi
5109
5110                 fi
5111                 ;;
5112         (*)
5113
5114 if test -n "/lib" ; then
5115         for cf_add_libdir in /lib
5116         do
5117                 if test $cf_add_libdir = /usr/lib ; then
5118                         :
5119                 elif test -d $cf_add_libdir
5120                 then
5121                         cf_have_libdir=no
5122                         if test -n "$LDFLAGS$LIBS" ; then
5123                                 # a loop is needed to ensure we can add subdirs of existing dirs
5124                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
5125                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5126                                                 cf_have_libdir=yes; break
5127                                         fi
5128                                 done
5129                         fi
5130                         if test "$cf_have_libdir" = no ; then
5131                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5132
5133 echo "${as_me:-configure}:5133: testing adding $cf_add_libdir to library-path ..." 1>&5
5134
5135                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5136                         fi
5137                 fi
5138         done
5139 fi
5140
5141                 ;;
5142         esac
5143         ;;
5144 (sunos3*|sunos4*)
5145         if test "x$cf_cv_screen" = "xcurses_5lib"
5146         then
5147                 if test -d /usr/5lib ; then
5148
5149 if test -n "/usr/5lib" ; then
5150         for cf_add_libdir in /usr/5lib
5151         do
5152                 if test $cf_add_libdir = /usr/lib ; then
5153                         :
5154                 elif test -d $cf_add_libdir
5155                 then
5156                         cf_have_libdir=no
5157                         if test -n "$LDFLAGS$LIBS" ; then
5158                                 # a loop is needed to ensure we can add subdirs of existing dirs
5159                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
5160                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5161                                                 cf_have_libdir=yes; break
5162                                         fi
5163                                 done
5164                         fi
5165                         if test "$cf_have_libdir" = no ; then
5166                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5167
5168 echo "${as_me:-configure}:5168: testing adding $cf_add_libdir to library-path ..." 1>&5
5169
5170                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5171                         fi
5172                 fi
5173         done
5174 fi
5175
5176 cf_add_libs="-lcurses -ltermcap"
5177 # Filter out duplicates - this happens with badly-designed ".pc" files...
5178 for cf_add_1lib in $LIBS
5179 do
5180         for cf_add_2lib in $cf_add_libs
5181         do
5182                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5183                 then
5184                         cf_add_1lib=
5185                         break
5186                 fi
5187         done
5188         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5189 done
5190 LIBS="$cf_add_libs"
5191
5192                 fi
5193     fi
5194     ac_cv_func_initscr=yes
5195     ;;
5196 esac
5197
5198 if test ".$ac_cv_func_initscr" != .yes ; then
5199         cf_save_LIBS="$LIBS"
5200
5201         if test ".${cf_cv_ncurses_version:-no}" != .no
5202         then
5203                 cf_check_list="ncurses curses cursesX"
5204         else
5205                 cf_check_list="cursesX curses ncurses"
5206         fi
5207
5208         # Check for library containing tgoto.  Do this before curses library
5209         # because it may be needed to link the test-case for initscr.
5210         if test "x$cf_term_lib" = x
5211         then
5212                 echo "$as_me:5212: checking for tgoto" >&5
5213 echo $ECHO_N "checking for tgoto... $ECHO_C" >&6
5214 if test "${ac_cv_func_tgoto+set}" = set; then
5215   echo $ECHO_N "(cached) $ECHO_C" >&6
5216 else
5217   cat >conftest.$ac_ext <<_ACEOF
5218 #line 5218 "configure"
5219 #include "confdefs.h"
5220 /* System header to define __stub macros and hopefully few prototypes,
5221     which can conflict with char tgoto (); below.  */
5222 #include <assert.h>
5223 /* Override any gcc2 internal prototype to avoid an error.  */
5224 #ifdef __cplusplus
5225 extern "C"
5226 #endif
5227 /* We use char because int might match the return type of a gcc2
5228    builtin and then its argument prototype would still apply.  */
5229 char tgoto ();
5230 char (*f) ();
5231
5232 int
5233 main ()
5234 {
5235 /* The GNU C library defines this for functions which it implements
5236     to always fail with ENOSYS.  Some functions are actually named
5237     something starting with __ and the normal name is an alias.  */
5238 #if defined (__stub_tgoto) || defined (__stub___tgoto)
5239 choke me
5240 #else
5241 f = tgoto; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
5242 #endif
5243
5244   ;
5245   return 0;
5246 }
5247 _ACEOF
5248 rm -f conftest.$ac_objext conftest$ac_exeext
5249 if { (eval echo "$as_me:5249: \"$ac_link\"") >&5
5250   (eval $ac_link) 2>&5
5251   ac_status=$?
5252   echo "$as_me:5252: \$? = $ac_status" >&5
5253   (exit $ac_status); } &&
5254          { ac_try='test -s conftest$ac_exeext'
5255   { (eval echo "$as_me:5255: \"$ac_try\"") >&5
5256   (eval $ac_try) 2>&5
5257   ac_status=$?
5258   echo "$as_me:5258: \$? = $ac_status" >&5
5259   (exit $ac_status); }; }; then
5260   ac_cv_func_tgoto=yes
5261 else
5262   echo "$as_me: failed program was:" >&5
5263 cat conftest.$ac_ext >&5
5264 ac_cv_func_tgoto=no
5265 fi
5266 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5267 fi
5268 echo "$as_me:5268: result: $ac_cv_func_tgoto" >&5
5269 echo "${ECHO_T}$ac_cv_func_tgoto" >&6
5270 if test $ac_cv_func_tgoto = yes; then
5271   cf_term_lib=predefined
5272 else
5273
5274                         for cf_term_lib in $cf_check_list otermcap termcap tinfo termlib unknown
5275                         do
5276                                 as_ac_Lib=`echo "ac_cv_lib_$cf_term_lib''_tgoto" | $as_tr_sh`
5277 echo "$as_me:5277: checking for tgoto in -l$cf_term_lib" >&5
5278 echo $ECHO_N "checking for tgoto in -l$cf_term_lib... $ECHO_C" >&6
5279 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
5280   echo $ECHO_N "(cached) $ECHO_C" >&6
5281 else
5282   ac_check_lib_save_LIBS=$LIBS
5283 LIBS="-l$cf_term_lib  $LIBS"
5284 cat >conftest.$ac_ext <<_ACEOF
5285 #line 5285 "configure"
5286 #include "confdefs.h"
5287
5288 /* Override any gcc2 internal prototype to avoid an error.  */
5289 #ifdef __cplusplus
5290 extern "C"
5291 #endif
5292 /* We use char because int might match the return type of a gcc2
5293    builtin and then its argument prototype would still apply.  */
5294 char tgoto ();
5295 int
5296 main ()
5297 {
5298 tgoto ();
5299   ;
5300   return 0;
5301 }
5302 _ACEOF
5303 rm -f conftest.$ac_objext conftest$ac_exeext
5304 if { (eval echo "$as_me:5304: \"$ac_link\"") >&5
5305   (eval $ac_link) 2>&5
5306   ac_status=$?
5307   echo "$as_me:5307: \$? = $ac_status" >&5
5308   (exit $ac_status); } &&
5309          { ac_try='test -s conftest$ac_exeext'
5310   { (eval echo "$as_me:5310: \"$ac_try\"") >&5
5311   (eval $ac_try) 2>&5
5312   ac_status=$?
5313   echo "$as_me:5313: \$? = $ac_status" >&5
5314   (exit $ac_status); }; }; then
5315   eval "$as_ac_Lib=yes"
5316 else
5317   echo "$as_me: failed program was:" >&5
5318 cat conftest.$ac_ext >&5
5319 eval "$as_ac_Lib=no"
5320 fi
5321 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5322 LIBS=$ac_check_lib_save_LIBS
5323 fi
5324 echo "$as_me:5324: result: `eval echo '${'$as_ac_Lib'}'`" >&5
5325 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
5326 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
5327   break
5328 fi
5329
5330                         done
5331
5332 fi
5333
5334         fi
5335
5336         # Check for library containing initscr
5337         test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS"
5338         if test "x$cf_curs_lib" = x
5339         then
5340                 for cf_curs_lib in $cf_check_list xcurses jcurses pdcurses unknown
5341                 do
5342                         as_ac_Lib=`echo "ac_cv_lib_$cf_curs_lib''_initscr" | $as_tr_sh`
5343 echo "$as_me:5343: checking for initscr in -l$cf_curs_lib" >&5
5344 echo $ECHO_N "checking for initscr in -l$cf_curs_lib... $ECHO_C" >&6
5345 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
5346   echo $ECHO_N "(cached) $ECHO_C" >&6
5347 else
5348   ac_check_lib_save_LIBS=$LIBS
5349 LIBS="-l$cf_curs_lib  $LIBS"
5350 cat >conftest.$ac_ext <<_ACEOF
5351 #line 5351 "configure"
5352 #include "confdefs.h"
5353
5354 /* Override any gcc2 internal prototype to avoid an error.  */
5355 #ifdef __cplusplus
5356 extern "C"
5357 #endif
5358 /* We use char because int might match the return type of a gcc2
5359    builtin and then its argument prototype would still apply.  */
5360 char initscr ();
5361 int
5362 main ()
5363 {
5364 initscr ();
5365   ;
5366   return 0;
5367 }
5368 _ACEOF
5369 rm -f conftest.$ac_objext conftest$ac_exeext
5370 if { (eval echo "$as_me:5370: \"$ac_link\"") >&5
5371   (eval $ac_link) 2>&5
5372   ac_status=$?
5373   echo "$as_me:5373: \$? = $ac_status" >&5
5374   (exit $ac_status); } &&
5375          { ac_try='test -s conftest$ac_exeext'
5376   { (eval echo "$as_me:5376: \"$ac_try\"") >&5
5377   (eval $ac_try) 2>&5
5378   ac_status=$?
5379   echo "$as_me:5379: \$? = $ac_status" >&5
5380   (exit $ac_status); }; }; then
5381   eval "$as_ac_Lib=yes"
5382 else
5383   echo "$as_me: failed program was:" >&5
5384 cat conftest.$ac_ext >&5
5385 eval "$as_ac_Lib=no"
5386 fi
5387 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5388 LIBS=$ac_check_lib_save_LIBS
5389 fi
5390 echo "$as_me:5390: result: `eval echo '${'$as_ac_Lib'}'`" >&5
5391 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
5392 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
5393   break
5394 fi
5395
5396                 done
5397         fi
5398         test $cf_curs_lib = unknown && { { echo "$as_me:5398: error: no curses library found" >&5
5399 echo "$as_me: error: no curses library found" >&2;}
5400    { (exit 1); exit 1; }; }
5401
5402         LIBS="-l$cf_curs_lib $cf_save_LIBS"
5403         if test "$cf_term_lib" = unknown ; then
5404                 echo "$as_me:5404: checking if we can link with $cf_curs_lib library" >&5
5405 echo $ECHO_N "checking if we can link with $cf_curs_lib library... $ECHO_C" >&6
5406                 cat >conftest.$ac_ext <<_ACEOF
5407 #line 5407 "configure"
5408 #include "confdefs.h"
5409 #include <${cf_cv_ncurses_header:-curses.h}>
5410 int
5411 main ()
5412 {
5413 initscr()
5414   ;
5415   return 0;
5416 }
5417 _ACEOF
5418 rm -f conftest.$ac_objext conftest$ac_exeext
5419 if { (eval echo "$as_me:5419: \"$ac_link\"") >&5
5420   (eval $ac_link) 2>&5
5421   ac_status=$?
5422   echo "$as_me:5422: \$? = $ac_status" >&5
5423   (exit $ac_status); } &&
5424          { ac_try='test -s conftest$ac_exeext'
5425   { (eval echo "$as_me:5425: \"$ac_try\"") >&5
5426   (eval $ac_try) 2>&5
5427   ac_status=$?
5428   echo "$as_me:5428: \$? = $ac_status" >&5
5429   (exit $ac_status); }; }; then
5430   cf_result=yes
5431 else
5432   echo "$as_me: failed program was:" >&5
5433 cat conftest.$ac_ext >&5
5434 cf_result=no
5435 fi
5436 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5437                 echo "$as_me:5437: result: $cf_result" >&5
5438 echo "${ECHO_T}$cf_result" >&6
5439                 test $cf_result = no && { { echo "$as_me:5439: error: Cannot link curses library" >&5
5440 echo "$as_me: error: Cannot link curses library" >&2;}
5441    { (exit 1); exit 1; }; }
5442         elif test "$cf_curs_lib" = "$cf_term_lib" ; then
5443                 :
5444         elif test "$cf_term_lib" != predefined ; then
5445                 echo "$as_me:5445: checking if we need both $cf_curs_lib and $cf_term_lib libraries" >&5
5446 echo $ECHO_N "checking if we need both $cf_curs_lib and $cf_term_lib libraries... $ECHO_C" >&6
5447                 cat >conftest.$ac_ext <<_ACEOF
5448 #line 5448 "configure"
5449 #include "confdefs.h"
5450 #include <${cf_cv_ncurses_header:-curses.h}>
5451 int
5452 main ()
5453 {
5454 initscr(); tgoto((char *)0, 0, 0);
5455   ;
5456   return 0;
5457 }
5458 _ACEOF
5459 rm -f conftest.$ac_objext conftest$ac_exeext
5460 if { (eval echo "$as_me:5460: \"$ac_link\"") >&5
5461   (eval $ac_link) 2>&5
5462   ac_status=$?
5463   echo "$as_me:5463: \$? = $ac_status" >&5
5464   (exit $ac_status); } &&
5465          { ac_try='test -s conftest$ac_exeext'
5466   { (eval echo "$as_me:5466: \"$ac_try\"") >&5
5467   (eval $ac_try) 2>&5
5468   ac_status=$?
5469   echo "$as_me:5469: \$? = $ac_status" >&5
5470   (exit $ac_status); }; }; then
5471   cf_result=no
5472 else
5473   echo "$as_me: failed program was:" >&5
5474 cat conftest.$ac_ext >&5
5475
5476                         LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
5477                         cat >conftest.$ac_ext <<_ACEOF
5478 #line 5478 "configure"
5479 #include "confdefs.h"
5480 #include <${cf_cv_ncurses_header:-curses.h}>
5481 int
5482 main ()
5483 {
5484 initscr()
5485   ;
5486   return 0;
5487 }
5488 _ACEOF
5489 rm -f conftest.$ac_objext conftest$ac_exeext
5490 if { (eval echo "$as_me:5490: \"$ac_link\"") >&5
5491   (eval $ac_link) 2>&5
5492   ac_status=$?
5493   echo "$as_me:5493: \$? = $ac_status" >&5
5494   (exit $ac_status); } &&
5495          { ac_try='test -s conftest$ac_exeext'
5496   { (eval echo "$as_me:5496: \"$ac_try\"") >&5
5497   (eval $ac_try) 2>&5
5498   ac_status=$?
5499   echo "$as_me:5499: \$? = $ac_status" >&5
5500   (exit $ac_status); }; }; then
5501   cf_result=yes
5502 else
5503   echo "$as_me: failed program was:" >&5
5504 cat conftest.$ac_ext >&5
5505 cf_result=error
5506 fi
5507 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5508
5509 fi
5510 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5511                 echo "$as_me:5511: result: $cf_result" >&5
5512 echo "${ECHO_T}$cf_result" >&6
5513         fi
5514 fi
5515 fi
5516
5517         ;;
5518 (ncursesw*)
5519
5520 echo "$as_me:5520: checking for multibyte character support" >&5
5521 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
5522 if test "${cf_cv_utf8_lib+set}" = set; then
5523   echo $ECHO_N "(cached) $ECHO_C" >&6
5524 else
5525
5526         cf_save_LIBS="$LIBS"
5527         cat >conftest.$ac_ext <<_ACEOF
5528 #line 5528 "configure"
5529 #include "confdefs.h"
5530
5531 #include <stdlib.h>
5532 int
5533 main ()
5534 {
5535 putwc(0,0);
5536   ;
5537   return 0;
5538 }
5539 _ACEOF
5540 rm -f conftest.$ac_objext conftest$ac_exeext
5541 if { (eval echo "$as_me:5541: \"$ac_link\"") >&5
5542   (eval $ac_link) 2>&5
5543   ac_status=$?
5544   echo "$as_me:5544: \$? = $ac_status" >&5
5545   (exit $ac_status); } &&
5546          { ac_try='test -s conftest$ac_exeext'
5547   { (eval echo "$as_me:5547: \"$ac_try\"") >&5
5548   (eval $ac_try) 2>&5
5549   ac_status=$?
5550   echo "$as_me:5550: \$? = $ac_status" >&5
5551   (exit $ac_status); }; }; then
5552   cf_cv_utf8_lib=yes
5553 else
5554   echo "$as_me: failed program was:" >&5
5555 cat conftest.$ac_ext >&5
5556
5557 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
5558 # will be set on completion of the AC_TRY_LINK below.
5559 cf_cv_header_path_utf8=
5560 cf_cv_library_path_utf8=
5561
5562 echo "${as_me:-configure}:5562: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
5563
5564 cf_save_LIBS="$LIBS"
5565
5566 cat >conftest.$ac_ext <<_ACEOF
5567 #line 5567 "configure"
5568 #include "confdefs.h"
5569
5570 #include <libutf8.h>
5571 int
5572 main ()
5573 {
5574 putwc(0,0);
5575   ;
5576   return 0;
5577 }
5578 _ACEOF
5579 rm -f conftest.$ac_objext conftest$ac_exeext
5580 if { (eval echo "$as_me:5580: \"$ac_link\"") >&5
5581   (eval $ac_link) 2>&5
5582   ac_status=$?
5583   echo "$as_me:5583: \$? = $ac_status" >&5
5584   (exit $ac_status); } &&
5585          { ac_try='test -s conftest$ac_exeext'
5586   { (eval echo "$as_me:5586: \"$ac_try\"") >&5
5587   (eval $ac_try) 2>&5
5588   ac_status=$?
5589   echo "$as_me:5589: \$? = $ac_status" >&5
5590   (exit $ac_status); }; }; then
5591
5592         cf_cv_find_linkage_utf8=yes
5593         cf_cv_header_path_utf8=/usr/include
5594         cf_cv_library_path_utf8=/usr/lib
5595
5596 else
5597   echo "$as_me: failed program was:" >&5
5598 cat conftest.$ac_ext >&5
5599
5600 LIBS="-lutf8  $cf_save_LIBS"
5601
5602 cat >conftest.$ac_ext <<_ACEOF
5603 #line 5603 "configure"
5604 #include "confdefs.h"
5605
5606 #include <libutf8.h>
5607 int
5608 main ()
5609 {
5610 putwc(0,0);
5611   ;
5612   return 0;
5613 }
5614 _ACEOF
5615 rm -f conftest.$ac_objext conftest$ac_exeext
5616 if { (eval echo "$as_me:5616: \"$ac_link\"") >&5
5617   (eval $ac_link) 2>&5
5618   ac_status=$?
5619   echo "$as_me:5619: \$? = $ac_status" >&5
5620   (exit $ac_status); } &&
5621          { ac_try='test -s conftest$ac_exeext'
5622   { (eval echo "$as_me:5622: \"$ac_try\"") >&5
5623   (eval $ac_try) 2>&5
5624   ac_status=$?
5625   echo "$as_me:5625: \$? = $ac_status" >&5
5626   (exit $ac_status); }; }; then
5627
5628         cf_cv_find_linkage_utf8=yes
5629         cf_cv_header_path_utf8=/usr/include
5630         cf_cv_library_path_utf8=/usr/lib
5631         cf_cv_library_file_utf8="-lutf8"
5632
5633 else
5634   echo "$as_me: failed program was:" >&5
5635 cat conftest.$ac_ext >&5
5636
5637         cf_cv_find_linkage_utf8=no
5638         LIBS="$cf_save_LIBS"
5639
5640         test -n "$verbose" && echo "    find linkage for utf8 library" 1>&6
5641
5642 echo "${as_me:-configure}:5642: testing find linkage for utf8 library ..." 1>&5
5643
5644 echo "${as_me:-configure}:5644: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
5645
5646         cf_save_CPPFLAGS="$CPPFLAGS"
5647         cf_test_CPPFLAGS="$CPPFLAGS"
5648
5649 cf_search=
5650
5651 # collect the current set of include-directories from compiler flags
5652 cf_header_path_list=""
5653 if test -n "${CFLAGS}${CPPFLAGS}" ; then
5654         for cf_header_path in $CPPFLAGS $CFLAGS
5655         do
5656                 case $cf_header_path in
5657                 (-I*)
5658                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
5659
5660 test "x$cf_header_path" != "xNONE" && \
5661 test -d "$cf_header_path" && \
5662  {
5663         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
5664         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
5665         test -d $cf_header_path/include/utf8 &&       cf_search="$cf_search $cf_header_path/include/utf8"
5666         test -d $cf_header_path/include/utf8/include &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
5667         test -d $cf_header_path/utf8/include &&       cf_search="$cf_search $cf_header_path/utf8/include"
5668         test -d $cf_header_path/utf8/include/utf8 &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
5669 }
5670
5671                         cf_header_path_list="$cf_header_path_list $cf_search"
5672                         ;;
5673                 esac
5674         done
5675 fi
5676
5677 # add the variations for the package we are looking for
5678
5679 cf_search=
5680
5681 test "x$prefix" != "xNONE" && \
5682 test -d "$prefix" && \
5683  {
5684         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
5685         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
5686         test -d $prefix/include/utf8 &&       cf_search="$cf_search $prefix/include/utf8"
5687         test -d $prefix/include/utf8/include &&    cf_search="$cf_search $prefix/include/utf8/include"
5688         test -d $prefix/utf8/include &&       cf_search="$cf_search $prefix/utf8/include"
5689         test -d $prefix/utf8/include/utf8 &&    cf_search="$cf_search $prefix/utf8/include/utf8"
5690 }
5691
5692 for cf_subdir_prefix in \
5693         /usr \
5694         /usr/local \
5695         /usr/pkg \
5696         /opt \
5697         /opt/local \
5698         $HOME
5699 do
5700
5701 test "x$cf_subdir_prefix" != "x$prefix" && \
5702 test -d "$cf_subdir_prefix" && \
5703 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
5704         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
5705         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
5706         test -d $cf_subdir_prefix/include/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/include/utf8"
5707         test -d $cf_subdir_prefix/include/utf8/include &&    cf_search="$cf_search $cf_subdir_prefix/include/utf8/include"
5708         test -d $cf_subdir_prefix/utf8/include &&       cf_search="$cf_search $cf_subdir_prefix/utf8/include"
5709         test -d $cf_subdir_prefix/utf8/include/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/include/utf8"
5710 }
5711
5712 done
5713
5714 test "$includedir" != NONE && \
5715 test "$includedir" != "/usr/include" && \
5716 test -d "$includedir" && {
5717         test -d $includedir &&    cf_search="$cf_search $includedir"
5718         test -d $includedir/utf8 && cf_search="$cf_search $includedir/utf8"
5719 }
5720
5721 test "$oldincludedir" != NONE && \
5722 test "$oldincludedir" != "/usr/include" && \
5723 test -d "$oldincludedir" && {
5724         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
5725         test -d $oldincludedir/utf8 && cf_search="$cf_search $oldincludedir/utf8"
5726 }
5727
5728 cf_search="$cf_search $cf_header_path_list"
5729
5730         for cf_cv_header_path_utf8 in $cf_search
5731         do
5732                 if test -d $cf_cv_header_path_utf8 ; then
5733                         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
5734
5735 echo "${as_me:-configure}:5735: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
5736
5737                         CPPFLAGS="$cf_save_CPPFLAGS -I$cf_cv_header_path_utf8"
5738                         cat >conftest.$ac_ext <<_ACEOF
5739 #line 5739 "configure"
5740 #include "confdefs.h"
5741
5742 #include <libutf8.h>
5743 int
5744 main ()
5745 {
5746 putwc(0,0);
5747   ;
5748   return 0;
5749 }
5750 _ACEOF
5751 rm -f conftest.$ac_objext
5752 if { (eval echo "$as_me:5752: \"$ac_compile\"") >&5
5753   (eval $ac_compile) 2>&5
5754   ac_status=$?
5755   echo "$as_me:5755: \$? = $ac_status" >&5
5756   (exit $ac_status); } &&
5757          { ac_try='test -s conftest.$ac_objext'
5758   { (eval echo "$as_me:5758: \"$ac_try\"") >&5
5759   (eval $ac_try) 2>&5
5760   ac_status=$?
5761   echo "$as_me:5761: \$? = $ac_status" >&5
5762   (exit $ac_status); }; }; then
5763
5764                                 test -n "$verbose" && echo "    ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
5765
5766 echo "${as_me:-configure}:5766: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
5767
5768                                 cf_cv_find_linkage_utf8=maybe
5769                                 cf_test_CPPFLAGS="$CPPFLAGS"
5770                                 break
5771 else
5772   echo "$as_me: failed program was:" >&5
5773 cat conftest.$ac_ext >&5
5774
5775                                 CPPFLAGS="$cf_save_CPPFLAGS"
5776
5777 fi
5778 rm -f conftest.$ac_objext conftest.$ac_ext
5779                 fi
5780         done
5781
5782         if test "$cf_cv_find_linkage_utf8" = maybe ; then
5783
5784 echo "${as_me:-configure}:5784: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
5785
5786                 cf_save_LIBS="$LIBS"
5787                 cf_save_LDFLAGS="$LDFLAGS"
5788
5789                 if test "$cf_cv_find_linkage_utf8" != yes ; then
5790
5791 cf_search=
5792 cf_library_path_list=""
5793 if test -n "${LDFLAGS}${LIBS}" ; then
5794         for cf_library_path in $LDFLAGS $LIBS
5795         do
5796                 case $cf_library_path in
5797                 (-L*)
5798                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
5799
5800 test "x$cf_library_path" != "xNONE" && \
5801 test -d "$cf_library_path" && \
5802  {
5803         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
5804         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
5805         test -d $cf_library_path/lib/utf8 &&       cf_search="$cf_search $cf_library_path/lib/utf8"
5806         test -d $cf_library_path/lib/utf8/lib &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
5807         test -d $cf_library_path/utf8/lib &&       cf_search="$cf_search $cf_library_path/utf8/lib"
5808         test -d $cf_library_path/utf8/lib/utf8 &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
5809 }
5810
5811                         cf_library_path_list="$cf_library_path_list $cf_search"
5812                         ;;
5813                 esac
5814         done
5815 fi
5816
5817 cf_search=
5818
5819 test "x$prefix" != "xNONE" && \
5820 test -d "$prefix" && \
5821  {
5822         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
5823         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
5824         test -d $prefix/lib/utf8 &&       cf_search="$cf_search $prefix/lib/utf8"
5825         test -d $prefix/lib/utf8/lib &&    cf_search="$cf_search $prefix/lib/utf8/lib"
5826         test -d $prefix/utf8/lib &&       cf_search="$cf_search $prefix/utf8/lib"
5827         test -d $prefix/utf8/lib/utf8 &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
5828 }
5829
5830 for cf_subdir_prefix in \
5831         /usr \
5832         /usr/local \
5833         /usr/pkg \
5834         /opt \
5835         /opt/local \
5836         $HOME
5837 do
5838
5839 test "x$cf_subdir_prefix" != "x$prefix" && \
5840 test -d "$cf_subdir_prefix" && \
5841 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
5842         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
5843         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
5844         test -d $cf_subdir_prefix/lib/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/lib/utf8"
5845         test -d $cf_subdir_prefix/lib/utf8/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/utf8/lib"
5846         test -d $cf_subdir_prefix/utf8/lib &&       cf_search="$cf_search $cf_subdir_prefix/utf8/lib"
5847         test -d $cf_subdir_prefix/utf8/lib/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/lib/utf8"
5848 }
5849
5850 done
5851
5852 cf_search="$cf_library_path_list $cf_search"
5853
5854                         for cf_cv_library_path_utf8 in $cf_search
5855                         do
5856                                 if test -d $cf_cv_library_path_utf8 ; then
5857                                         test -n "$verbose" && echo "    ... testing $cf_cv_library_path_utf8" 1>&6
5858
5859 echo "${as_me:-configure}:5859: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
5860
5861                                         CPPFLAGS="$cf_test_CPPFLAGS"
5862                                         LIBS="-lutf8  $cf_save_LIBS"
5863                                         LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
5864                                         cat >conftest.$ac_ext <<_ACEOF
5865 #line 5865 "configure"
5866 #include "confdefs.h"
5867
5868 #include <libutf8.h>
5869 int
5870 main ()
5871 {
5872 putwc(0,0);
5873   ;
5874   return 0;
5875 }
5876 _ACEOF
5877 rm -f conftest.$ac_objext conftest$ac_exeext
5878 if { (eval echo "$as_me:5878: \"$ac_link\"") >&5
5879   (eval $ac_link) 2>&5
5880   ac_status=$?
5881   echo "$as_me:5881: \$? = $ac_status" >&5
5882   (exit $ac_status); } &&
5883          { ac_try='test -s conftest$ac_exeext'
5884   { (eval echo "$as_me:5884: \"$ac_try\"") >&5
5885   (eval $ac_try) 2>&5
5886   ac_status=$?
5887   echo "$as_me:5887: \$? = $ac_status" >&5
5888   (exit $ac_status); }; }; then
5889
5890                                         test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
5891
5892 echo "${as_me:-configure}:5892: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
5893
5894                                         cf_cv_find_linkage_utf8=yes
5895                                         cf_cv_library_file_utf8="-lutf8"
5896                                         break
5897 else
5898   echo "$as_me: failed program was:" >&5
5899 cat conftest.$ac_ext >&5
5900
5901                                         CPPFLAGS="$cf_save_CPPFLAGS"
5902                                         LIBS="$cf_save_LIBS"
5903                                         LDFLAGS="$cf_save_LDFLAGS"
5904
5905 fi
5906 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5907                                 fi
5908                         done
5909                         CPPFLAGS="$cf_save_CPPFLAGS"
5910                         LDFLAGS="$cf_save_LDFLAGS"
5911                 fi
5912
5913         else
5914                 cf_cv_find_linkage_utf8=no
5915         fi
5916
5917 fi
5918 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5919
5920 fi
5921 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5922
5923 LIBS="$cf_save_LIBS"
5924
5925 if test "$cf_cv_find_linkage_utf8" = yes ; then
5926 cf_cv_utf8_lib=add-on
5927 else
5928 cf_cv_utf8_lib=no
5929 fi
5930
5931 fi
5932 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5933 fi
5934 echo "$as_me:5934: result: $cf_cv_utf8_lib" >&5
5935 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
5936
5937 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
5938 # ncurses/ncursesw:
5939 if test "$cf_cv_utf8_lib" = "add-on" ; then
5940
5941 cat >>confdefs.h <<\EOF
5942 #define HAVE_LIBUTF8_H 1
5943 EOF
5944
5945 if test -n "$cf_cv_header_path_utf8" ; then
5946   for cf_add_incdir in $cf_cv_header_path_utf8
5947   do
5948         while test $cf_add_incdir != /usr/include
5949         do
5950           if test -d $cf_add_incdir
5951           then
5952                 cf_have_incdir=no
5953                 if test -n "$CFLAGS$CPPFLAGS" ; then
5954                   # a loop is needed to ensure we can add subdirs of existing dirs
5955                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5956                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5957                           cf_have_incdir=yes; break
5958                         fi
5959                   done
5960                 fi
5961
5962                 if test "$cf_have_incdir" = no ; then
5963                   if test "$cf_add_incdir" = /usr/local/include ; then
5964                         if test "$GCC" = yes
5965                         then
5966                           cf_save_CPPFLAGS=$CPPFLAGS
5967                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5968                           cat >conftest.$ac_ext <<_ACEOF
5969 #line 5969 "configure"
5970 #include "confdefs.h"
5971 #include <stdio.h>
5972 int
5973 main ()
5974 {
5975 printf("Hello")
5976   ;
5977   return 0;
5978 }
5979 _ACEOF
5980 rm -f conftest.$ac_objext
5981 if { (eval echo "$as_me:5981: \"$ac_compile\"") >&5
5982   (eval $ac_compile) 2>&5
5983   ac_status=$?
5984   echo "$as_me:5984: \$? = $ac_status" >&5
5985   (exit $ac_status); } &&
5986          { ac_try='test -s conftest.$ac_objext'
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   :
5993 else
5994   echo "$as_me: failed program was:" >&5
5995 cat conftest.$ac_ext >&5
5996 cf_have_incdir=yes
5997 fi
5998 rm -f conftest.$ac_objext conftest.$ac_ext
5999                           CPPFLAGS=$cf_save_CPPFLAGS
6000                         fi
6001                   fi
6002                 fi
6003
6004                 if test "$cf_have_incdir" = no ; then
6005                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6006
6007 echo "${as_me:-configure}:6007: testing adding $cf_add_incdir to include-path ..." 1>&5
6008
6009                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6010
6011                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6012                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6013                   cf_add_incdir="$cf_top_incdir"
6014                 else
6015                   break
6016                 fi
6017           fi
6018         done
6019   done
6020 fi
6021
6022 if test -n "$cf_cv_library_path_utf8" ; then
6023         for cf_add_libdir in $cf_cv_library_path_utf8
6024         do
6025                 if test $cf_add_libdir = /usr/lib ; then
6026                         :
6027                 elif test -d $cf_add_libdir
6028                 then
6029                         cf_have_libdir=no
6030                         if test -n "$LDFLAGS$LIBS" ; then
6031                                 # a loop is needed to ensure we can add subdirs of existing dirs
6032                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6033                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6034                                                 cf_have_libdir=yes; break
6035                                         fi
6036                                 done
6037                         fi
6038                         if test "$cf_have_libdir" = no ; then
6039                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6040
6041 echo "${as_me:-configure}:6041: testing adding $cf_add_libdir to library-path ..." 1>&5
6042
6043                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6044                         fi
6045                 fi
6046         done
6047 fi
6048
6049 cf_add_libs="$cf_cv_library_file_utf8"
6050 # Filter out duplicates - this happens with badly-designed ".pc" files...
6051 for cf_add_1lib in $LIBS
6052 do
6053         for cf_add_2lib in $cf_add_libs
6054         do
6055                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6056                 then
6057                         cf_add_1lib=
6058                         break
6059                 fi
6060         done
6061         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6062 done
6063 LIBS="$cf_add_libs"
6064
6065 fi
6066
6067 cf_ncuconfig_root=$cf_cv_screen
6068 cf_have_ncuconfig=no
6069
6070 if test "x$PKG_CONFIG" != xnone; then
6071         echo "$as_me:6071: checking pkg-config for $cf_ncuconfig_root" >&5
6072 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
6073         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
6074                 echo "$as_me:6074: result: yes" >&5
6075 echo "${ECHO_T}yes" >&6
6076
6077                 echo "$as_me:6077: checking if the $cf_ncuconfig_root package files work" >&5
6078 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
6079                 cf_have_ncuconfig=unknown
6080
6081                 cf_save_CPPFLAGS="$CPPFLAGS"
6082                 cf_save_LIBS="$LIBS"
6083
6084                 CPPFLAGS="$CPPFLAGS `$PKG_CONFIG --cflags $cf_ncuconfig_root`"
6085
6086 cf_add_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
6087 # Filter out duplicates - this happens with badly-designed ".pc" files...
6088 for cf_add_1lib in $LIBS
6089 do
6090         for cf_add_2lib in $cf_add_libs
6091         do
6092                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6093                 then
6094                         cf_add_1lib=
6095                         break
6096                 fi
6097         done
6098         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6099 done
6100 LIBS="$cf_add_libs"
6101
6102                 cat >conftest.$ac_ext <<_ACEOF
6103 #line 6103 "configure"
6104 #include "confdefs.h"
6105 #include <${cf_cv_ncurses_header:-curses.h}>
6106 int
6107 main ()
6108 {
6109 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
6110   ;
6111   return 0;
6112 }
6113 _ACEOF
6114 rm -f conftest.$ac_objext conftest$ac_exeext
6115 if { (eval echo "$as_me:6115: \"$ac_link\"") >&5
6116   (eval $ac_link) 2>&5
6117   ac_status=$?
6118   echo "$as_me:6118: \$? = $ac_status" >&5
6119   (exit $ac_status); } &&
6120          { ac_try='test -s conftest$ac_exeext'
6121   { (eval echo "$as_me:6121: \"$ac_try\"") >&5
6122   (eval $ac_try) 2>&5
6123   ac_status=$?
6124   echo "$as_me:6124: \$? = $ac_status" >&5
6125   (exit $ac_status); }; }; then
6126   if test "$cross_compiling" = yes; then
6127   { { echo "$as_me:6127: error: cannot run test program while cross compiling" >&5
6128 echo "$as_me: error: cannot run test program while cross compiling" >&2;}
6129    { (exit 1); exit 1; }; }
6130 else
6131   cat >conftest.$ac_ext <<_ACEOF
6132 #line 6132 "configure"
6133 #include "confdefs.h"
6134 #include <${cf_cv_ncurses_header:-curses.h}>
6135                                 int main(void)
6136                                 { char *xx = curses_version(); return (xx == 0); }
6137 _ACEOF
6138 rm -f conftest$ac_exeext
6139 if { (eval echo "$as_me:6139: \"$ac_link\"") >&5
6140   (eval $ac_link) 2>&5
6141   ac_status=$?
6142   echo "$as_me:6142: \$? = $ac_status" >&5
6143   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
6144   { (eval echo "$as_me:6144: \"$ac_try\"") >&5
6145   (eval $ac_try) 2>&5
6146   ac_status=$?
6147   echo "$as_me:6147: \$? = $ac_status" >&5
6148   (exit $ac_status); }; }; then
6149   cf_have_ncuconfig=yes
6150 else
6151   echo "$as_me: program exited with status $ac_status" >&5
6152 echo "$as_me: failed program was:" >&5
6153 cat conftest.$ac_ext >&5
6154 cf_have_ncuconfig=no
6155 fi
6156 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
6157 fi
6158 else
6159   echo "$as_me: failed program was:" >&5
6160 cat conftest.$ac_ext >&5
6161 cf_have_ncuconfig=no
6162 fi
6163 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6164
6165                 echo "$as_me:6165: result: $cf_have_ncuconfig" >&5
6166 echo "${ECHO_T}$cf_have_ncuconfig" >&6
6167                 if test "$cf_have_ncuconfig" != "yes"
6168                 then
6169                         CPPFLAGS="$cf_save_CPPFLAGS"
6170                         LIBS="$cf_save_LIBS"
6171                 else
6172
6173 cat >>confdefs.h <<\EOF
6174 #define NCURSES 1
6175 EOF
6176
6177                 fi
6178
6179         else
6180                 echo "$as_me:6180: result: no" >&5
6181 echo "${ECHO_T}no" >&6
6182         fi
6183 fi
6184
6185 if test "x$cf_have_ncuconfig" = "xno"; then
6186         echo "Looking for ${cf_ncuconfig_root}-config"
6187
6188 if test -n "$ac_tool_prefix"; then
6189   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
6190   do
6191     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
6192 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
6193 echo "$as_me:6193: checking for $ac_word" >&5
6194 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
6195 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
6196   echo $ECHO_N "(cached) $ECHO_C" >&6
6197 else
6198   if test -n "$NCURSES_CONFIG"; then
6199   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
6200 else
6201   ac_save_IFS=$IFS; IFS=$ac_path_separator
6202 ac_dummy="$PATH"
6203 for ac_dir in $ac_dummy; do
6204   IFS=$ac_save_IFS
6205   test -z "$ac_dir" && ac_dir=.
6206   $as_executable_p "$ac_dir/$ac_word" || continue
6207 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
6208 echo "$as_me:6208: found $ac_dir/$ac_word" >&5
6209 break
6210 done
6211
6212 fi
6213 fi
6214 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
6215 if test -n "$NCURSES_CONFIG"; then
6216   echo "$as_me:6216: result: $NCURSES_CONFIG" >&5
6217 echo "${ECHO_T}$NCURSES_CONFIG" >&6
6218 else
6219   echo "$as_me:6219: result: no" >&5
6220 echo "${ECHO_T}no" >&6
6221 fi
6222
6223     test -n "$NCURSES_CONFIG" && break
6224   done
6225 fi
6226 if test -z "$NCURSES_CONFIG"; then
6227   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
6228   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
6229 do
6230   # Extract the first word of "$ac_prog", so it can be a program name with args.
6231 set dummy $ac_prog; ac_word=$2
6232 echo "$as_me:6232: checking for $ac_word" >&5
6233 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
6234 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
6235   echo $ECHO_N "(cached) $ECHO_C" >&6
6236 else
6237   if test -n "$ac_ct_NCURSES_CONFIG"; then
6238   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
6239 else
6240   ac_save_IFS=$IFS; IFS=$ac_path_separator
6241 ac_dummy="$PATH"
6242 for ac_dir in $ac_dummy; do
6243   IFS=$ac_save_IFS
6244   test -z "$ac_dir" && ac_dir=.
6245   $as_executable_p "$ac_dir/$ac_word" || continue
6246 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
6247 echo "$as_me:6247: found $ac_dir/$ac_word" >&5
6248 break
6249 done
6250
6251 fi
6252 fi
6253 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
6254 if test -n "$ac_ct_NCURSES_CONFIG"; then
6255   echo "$as_me:6255: result: $ac_ct_NCURSES_CONFIG" >&5
6256 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
6257 else
6258   echo "$as_me:6258: result: no" >&5
6259 echo "${ECHO_T}no" >&6
6260 fi
6261
6262   test -n "$ac_ct_NCURSES_CONFIG" && break
6263 done
6264 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
6265
6266   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
6267 fi
6268
6269         if test "$NCURSES_CONFIG" != none ; then
6270
6271                 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
6272
6273 cf_add_libs="`$NCURSES_CONFIG --libs`"
6274 # Filter out duplicates - this happens with badly-designed ".pc" files...
6275 for cf_add_1lib in $LIBS
6276 do
6277         for cf_add_2lib in $cf_add_libs
6278         do
6279                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6280                 then
6281                         cf_add_1lib=
6282                         break
6283                 fi
6284         done
6285         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6286 done
6287 LIBS="$cf_add_libs"
6288
6289                 # even with config script, some packages use no-override for curses.h
6290
6291 echo "$as_me:6291: checking if we have identified curses headers" >&5
6292 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
6293 if test "${cf_cv_ncurses_header+set}" = set; then
6294   echo $ECHO_N "(cached) $ECHO_C" >&6
6295 else
6296
6297 cf_cv_ncurses_header=none
6298 for cf_header in \
6299         ncurses.h $cf_cv_screen/ncurses.h \
6300         curses.h $cf_cv_screen/curses.h
6301 do
6302 cat >conftest.$ac_ext <<_ACEOF
6303 #line 6303 "configure"
6304 #include "confdefs.h"
6305 #include <${cf_header}>
6306 int
6307 main ()
6308 {
6309 initscr(); tgoto("?", 0,0)
6310   ;
6311   return 0;
6312 }
6313 _ACEOF
6314 rm -f conftest.$ac_objext
6315 if { (eval echo "$as_me:6315: \"$ac_compile\"") >&5
6316   (eval $ac_compile) 2>&5
6317   ac_status=$?
6318   echo "$as_me:6318: \$? = $ac_status" >&5
6319   (exit $ac_status); } &&
6320          { ac_try='test -s conftest.$ac_objext'
6321   { (eval echo "$as_me:6321: \"$ac_try\"") >&5
6322   (eval $ac_try) 2>&5
6323   ac_status=$?
6324   echo "$as_me:6324: \$? = $ac_status" >&5
6325   (exit $ac_status); }; }; then
6326   cf_cv_ncurses_header=$cf_header; break
6327 else
6328   echo "$as_me: failed program was:" >&5
6329 cat conftest.$ac_ext >&5
6330 fi
6331 rm -f conftest.$ac_objext conftest.$ac_ext
6332 done
6333
6334 fi
6335 echo "$as_me:6335: result: $cf_cv_ncurses_header" >&5
6336 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
6337
6338 if test "$cf_cv_ncurses_header" = none ; then
6339         { { echo "$as_me:6339: error: No curses header-files found" >&5
6340 echo "$as_me: error: No curses header-files found" >&2;}
6341    { (exit 1); exit 1; }; }
6342 fi
6343
6344 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
6345
6346 for ac_header in $cf_cv_ncurses_header
6347 do
6348 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
6349 echo "$as_me:6349: checking for $ac_header" >&5
6350 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
6351 if eval "test \"\${$as_ac_Header+set}\" = set"; then
6352   echo $ECHO_N "(cached) $ECHO_C" >&6
6353 else
6354   cat >conftest.$ac_ext <<_ACEOF
6355 #line 6355 "configure"
6356 #include "confdefs.h"
6357 #include <$ac_header>
6358 _ACEOF
6359 if { (eval echo "$as_me:6359: \"$ac_cpp conftest.$ac_ext\"") >&5
6360   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
6361   ac_status=$?
6362   egrep -v '^ *\+' conftest.er1 >conftest.err
6363   rm -f conftest.er1
6364   cat conftest.err >&5
6365   echo "$as_me:6365: \$? = $ac_status" >&5
6366   (exit $ac_status); } >/dev/null; then
6367   if test -s conftest.err; then
6368     ac_cpp_err=$ac_c_preproc_warn_flag
6369   else
6370     ac_cpp_err=
6371   fi
6372 else
6373   ac_cpp_err=yes
6374 fi
6375 if test -z "$ac_cpp_err"; then
6376   eval "$as_ac_Header=yes"
6377 else
6378   echo "$as_me: failed program was:" >&5
6379   cat conftest.$ac_ext >&5
6380   eval "$as_ac_Header=no"
6381 fi
6382 rm -f conftest.err conftest.$ac_ext
6383 fi
6384 echo "$as_me:6384: result: `eval echo '${'$as_ac_Header'}'`" >&5
6385 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
6386 if test `eval echo '${'$as_ac_Header'}'` = yes; then
6387   cat >>confdefs.h <<EOF
6388 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
6389 EOF
6390
6391 fi
6392 done
6393
6394 cat >>confdefs.h <<\EOF
6395 #define NCURSES 1
6396 EOF
6397
6398 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
6399
6400                 cat >>confdefs.h <<EOF
6401 #define $cf_nculib_ROOT 1
6402 EOF
6403
6404                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
6405
6406         else
6407
6408 cf_ncuhdr_root=$cf_cv_screen
6409
6410 test -n "$cf_cv_curses_dir" && \
6411 test "$cf_cv_curses_dir" != "no" && { \
6412
6413 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
6414   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
6415   do
6416         while test $cf_add_incdir != /usr/include
6417         do
6418           if test -d $cf_add_incdir
6419           then
6420                 cf_have_incdir=no
6421                 if test -n "$CFLAGS$CPPFLAGS" ; then
6422                   # a loop is needed to ensure we can add subdirs of existing dirs
6423                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6424                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6425                           cf_have_incdir=yes; break
6426                         fi
6427                   done
6428                 fi
6429
6430                 if test "$cf_have_incdir" = no ; then
6431                   if test "$cf_add_incdir" = /usr/local/include ; then
6432                         if test "$GCC" = yes
6433                         then
6434                           cf_save_CPPFLAGS=$CPPFLAGS
6435                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6436                           cat >conftest.$ac_ext <<_ACEOF
6437 #line 6437 "configure"
6438 #include "confdefs.h"
6439 #include <stdio.h>
6440 int
6441 main ()
6442 {
6443 printf("Hello")
6444   ;
6445   return 0;
6446 }
6447 _ACEOF
6448 rm -f conftest.$ac_objext
6449 if { (eval echo "$as_me:6449: \"$ac_compile\"") >&5
6450   (eval $ac_compile) 2>&5
6451   ac_status=$?
6452   echo "$as_me:6452: \$? = $ac_status" >&5
6453   (exit $ac_status); } &&
6454          { ac_try='test -s conftest.$ac_objext'
6455   { (eval echo "$as_me:6455: \"$ac_try\"") >&5
6456   (eval $ac_try) 2>&5
6457   ac_status=$?
6458   echo "$as_me:6458: \$? = $ac_status" >&5
6459   (exit $ac_status); }; }; then
6460   :
6461 else
6462   echo "$as_me: failed program was:" >&5
6463 cat conftest.$ac_ext >&5
6464 cf_have_incdir=yes
6465 fi
6466 rm -f conftest.$ac_objext conftest.$ac_ext
6467                           CPPFLAGS=$cf_save_CPPFLAGS
6468                         fi
6469                   fi
6470                 fi
6471
6472                 if test "$cf_have_incdir" = no ; then
6473                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6474
6475 echo "${as_me:-configure}:6475: testing adding $cf_add_incdir to include-path ..." 1>&5
6476
6477                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6478
6479                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6480                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6481                   cf_add_incdir="$cf_top_incdir"
6482                 else
6483                   break
6484                 fi
6485           fi
6486         done
6487   done
6488 fi
6489
6490 }
6491
6492 echo "$as_me:6492: checking for $cf_ncuhdr_root header in include-path" >&5
6493 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
6494 if test "${cf_cv_ncurses_h+set}" = set; then
6495   echo $ECHO_N "(cached) $ECHO_C" >&6
6496 else
6497
6498         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
6499         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
6500         for cf_header in $cf_header_list
6501         do
6502
6503         cat >conftest.$ac_ext <<_ACEOF
6504 #line 6504 "configure"
6505 #include "confdefs.h"
6506
6507 #include <$cf_header>
6508 int
6509 main ()
6510 {
6511
6512 #ifdef NCURSES_VERSION
6513
6514 printf("%s\n", NCURSES_VERSION);
6515 #else
6516 #ifdef __NCURSES_H
6517 printf("old\n");
6518 #else
6519         make an error
6520 #endif
6521 #endif
6522
6523   ;
6524   return 0;
6525 }
6526 _ACEOF
6527 rm -f conftest.$ac_objext
6528 if { (eval echo "$as_me:6528: \"$ac_compile\"") >&5
6529   (eval $ac_compile) 2>&5
6530   ac_status=$?
6531   echo "$as_me:6531: \$? = $ac_status" >&5
6532   (exit $ac_status); } &&
6533          { ac_try='test -s conftest.$ac_objext'
6534   { (eval echo "$as_me:6534: \"$ac_try\"") >&5
6535   (eval $ac_try) 2>&5
6536   ac_status=$?
6537   echo "$as_me:6537: \$? = $ac_status" >&5
6538   (exit $ac_status); }; }; then
6539   cf_cv_ncurses_h=$cf_header
6540
6541 else
6542   echo "$as_me: failed program was:" >&5
6543 cat conftest.$ac_ext >&5
6544 cf_cv_ncurses_h=no
6545 fi
6546 rm -f conftest.$ac_objext conftest.$ac_ext
6547
6548                 test "$cf_cv_ncurses_h" != no && break
6549         done
6550
6551 fi
6552 echo "$as_me:6552: result: $cf_cv_ncurses_h" >&5
6553 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
6554
6555 if test "$cf_cv_ncurses_h" != no ; then
6556         cf_cv_ncurses_header=$cf_cv_ncurses_h
6557 else
6558
6559 echo "$as_me:6559: checking for $cf_ncuhdr_root include-path" >&5
6560 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
6561 if test "${cf_cv_ncurses_h2+set}" = set; then
6562   echo $ECHO_N "(cached) $ECHO_C" >&6
6563 else
6564
6565         test -n "$verbose" && echo
6566
6567 cf_search=
6568
6569 # collect the current set of include-directories from compiler flags
6570 cf_header_path_list=""
6571 if test -n "${CFLAGS}${CPPFLAGS}" ; then
6572         for cf_header_path in $CPPFLAGS $CFLAGS
6573         do
6574                 case $cf_header_path in
6575                 (-I*)
6576                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
6577
6578 test "x$cf_header_path" != "xNONE" && \
6579 test -d "$cf_header_path" && \
6580  {
6581         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
6582         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
6583         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
6584         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
6585         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
6586         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"
6587 }
6588
6589                         cf_header_path_list="$cf_header_path_list $cf_search"
6590                         ;;
6591                 esac
6592         done
6593 fi
6594
6595 # add the variations for the package we are looking for
6596
6597 cf_search=
6598
6599 test "x$prefix" != "xNONE" && \
6600 test -d "$prefix" && \
6601  {
6602         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
6603         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
6604         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
6605         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
6606         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
6607         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
6608 }
6609
6610 for cf_subdir_prefix in \
6611         /usr \
6612         /usr/local \
6613         /usr/pkg \
6614         /opt \
6615         /opt/local \
6616         $HOME
6617 do
6618
6619 test "x$cf_subdir_prefix" != "x$prefix" && \
6620 test -d "$cf_subdir_prefix" && \
6621 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
6622         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
6623         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
6624         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
6625         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
6626         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
6627         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"
6628 }
6629
6630 done
6631
6632 test "$includedir" != NONE && \
6633 test "$includedir" != "/usr/include" && \
6634 test -d "$includedir" && {
6635         test -d $includedir &&    cf_search="$cf_search $includedir"
6636         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
6637 }
6638
6639 test "$oldincludedir" != NONE && \
6640 test "$oldincludedir" != "/usr/include" && \
6641 test -d "$oldincludedir" && {
6642         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
6643         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
6644 }
6645
6646 cf_search="$cf_search $cf_header_path_list"
6647
6648         test -n "$verbose" && echo search path $cf_search
6649         cf_save2_CPPFLAGS="$CPPFLAGS"
6650         for cf_incdir in $cf_search
6651         do
6652
6653 if test -n "$cf_incdir" ; then
6654   for cf_add_incdir in $cf_incdir
6655   do
6656         while test $cf_add_incdir != /usr/include
6657         do
6658           if test -d $cf_add_incdir
6659           then
6660                 cf_have_incdir=no
6661                 if test -n "$CFLAGS$CPPFLAGS" ; then
6662                   # a loop is needed to ensure we can add subdirs of existing dirs
6663                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6664                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6665                           cf_have_incdir=yes; break
6666                         fi
6667                   done
6668                 fi
6669
6670                 if test "$cf_have_incdir" = no ; then
6671                   if test "$cf_add_incdir" = /usr/local/include ; then
6672                         if test "$GCC" = yes
6673                         then
6674                           cf_save_CPPFLAGS=$CPPFLAGS
6675                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6676                           cat >conftest.$ac_ext <<_ACEOF
6677 #line 6677 "configure"
6678 #include "confdefs.h"
6679 #include <stdio.h>
6680 int
6681 main ()
6682 {
6683 printf("Hello")
6684   ;
6685   return 0;
6686 }
6687 _ACEOF
6688 rm -f conftest.$ac_objext
6689 if { (eval echo "$as_me:6689: \"$ac_compile\"") >&5
6690   (eval $ac_compile) 2>&5
6691   ac_status=$?
6692   echo "$as_me:6692: \$? = $ac_status" >&5
6693   (exit $ac_status); } &&
6694          { ac_try='test -s conftest.$ac_objext'
6695   { (eval echo "$as_me:6695: \"$ac_try\"") >&5
6696   (eval $ac_try) 2>&5
6697   ac_status=$?
6698   echo "$as_me:6698: \$? = $ac_status" >&5
6699   (exit $ac_status); }; }; then
6700   :
6701 else
6702   echo "$as_me: failed program was:" >&5
6703 cat conftest.$ac_ext >&5
6704 cf_have_incdir=yes
6705 fi
6706 rm -f conftest.$ac_objext conftest.$ac_ext
6707                           CPPFLAGS=$cf_save_CPPFLAGS
6708                         fi
6709                   fi
6710                 fi
6711
6712                 if test "$cf_have_incdir" = no ; then
6713                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6714
6715 echo "${as_me:-configure}:6715: testing adding $cf_add_incdir to include-path ..." 1>&5
6716
6717                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6718
6719                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6720                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6721                   cf_add_incdir="$cf_top_incdir"
6722                 else
6723                   break
6724                 fi
6725           fi
6726         done
6727   done
6728 fi
6729
6730                 for cf_header in \
6731                         ncurses.h \
6732                         curses.h
6733                 do
6734
6735         cat >conftest.$ac_ext <<_ACEOF
6736 #line 6736 "configure"
6737 #include "confdefs.h"
6738
6739 #include <$cf_header>
6740 int
6741 main ()
6742 {
6743
6744 #ifdef NCURSES_VERSION
6745
6746 printf("%s\n", NCURSES_VERSION);
6747 #else
6748 #ifdef __NCURSES_H
6749 printf("old\n");
6750 #else
6751         make an error
6752 #endif
6753 #endif
6754
6755   ;
6756   return 0;
6757 }
6758 _ACEOF
6759 rm -f conftest.$ac_objext
6760 if { (eval echo "$as_me:6760: \"$ac_compile\"") >&5
6761   (eval $ac_compile) 2>&5
6762   ac_status=$?
6763   echo "$as_me:6763: \$? = $ac_status" >&5
6764   (exit $ac_status); } &&
6765          { ac_try='test -s conftest.$ac_objext'
6766   { (eval echo "$as_me:6766: \"$ac_try\"") >&5
6767   (eval $ac_try) 2>&5
6768   ac_status=$?
6769   echo "$as_me:6769: \$? = $ac_status" >&5
6770   (exit $ac_status); }; }; then
6771   cf_cv_ncurses_h2=$cf_header
6772
6773 else
6774   echo "$as_me: failed program was:" >&5
6775 cat conftest.$ac_ext >&5
6776 cf_cv_ncurses_h2=no
6777 fi
6778 rm -f conftest.$ac_objext conftest.$ac_ext
6779
6780                         if test "$cf_cv_ncurses_h2" != no ; then
6781                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
6782                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
6783                                 break
6784                         fi
6785                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
6786                 done
6787                 CPPFLAGS="$cf_save2_CPPFLAGS"
6788                 test "$cf_cv_ncurses_h2" != no && break
6789         done
6790         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:6790: error: not found" >&5
6791 echo "$as_me: error: not found" >&2;}
6792    { (exit 1); exit 1; }; }
6793
6794 fi
6795 echo "$as_me:6795: result: $cf_cv_ncurses_h2" >&5
6796 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
6797
6798         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
6799         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
6800         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
6801                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
6802         fi
6803
6804 if test -n "$cf_1st_incdir" ; then
6805   for cf_add_incdir in $cf_1st_incdir
6806   do
6807         while test $cf_add_incdir != /usr/include
6808         do
6809           if test -d $cf_add_incdir
6810           then
6811                 cf_have_incdir=no
6812                 if test -n "$CFLAGS$CPPFLAGS" ; then
6813                   # a loop is needed to ensure we can add subdirs of existing dirs
6814                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6815                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6816                           cf_have_incdir=yes; break
6817                         fi
6818                   done
6819                 fi
6820
6821                 if test "$cf_have_incdir" = no ; then
6822                   if test "$cf_add_incdir" = /usr/local/include ; then
6823                         if test "$GCC" = yes
6824                         then
6825                           cf_save_CPPFLAGS=$CPPFLAGS
6826                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6827                           cat >conftest.$ac_ext <<_ACEOF
6828 #line 6828 "configure"
6829 #include "confdefs.h"
6830 #include <stdio.h>
6831 int
6832 main ()
6833 {
6834 printf("Hello")
6835   ;
6836   return 0;
6837 }
6838 _ACEOF
6839 rm -f conftest.$ac_objext
6840 if { (eval echo "$as_me:6840: \"$ac_compile\"") >&5
6841   (eval $ac_compile) 2>&5
6842   ac_status=$?
6843   echo "$as_me:6843: \$? = $ac_status" >&5
6844   (exit $ac_status); } &&
6845          { ac_try='test -s conftest.$ac_objext'
6846   { (eval echo "$as_me:6846: \"$ac_try\"") >&5
6847   (eval $ac_try) 2>&5
6848   ac_status=$?
6849   echo "$as_me:6849: \$? = $ac_status" >&5
6850   (exit $ac_status); }; }; then
6851   :
6852 else
6853   echo "$as_me: failed program was:" >&5
6854 cat conftest.$ac_ext >&5
6855 cf_have_incdir=yes
6856 fi
6857 rm -f conftest.$ac_objext conftest.$ac_ext
6858                           CPPFLAGS=$cf_save_CPPFLAGS
6859                         fi
6860                   fi
6861                 fi
6862
6863                 if test "$cf_have_incdir" = no ; then
6864                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6865
6866 echo "${as_me:-configure}:6866: testing adding $cf_add_incdir to include-path ..." 1>&5
6867
6868                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6869
6870                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6871                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6872                   cf_add_incdir="$cf_top_incdir"
6873                 else
6874                   break
6875                 fi
6876           fi
6877         done
6878   done
6879 fi
6880
6881 fi
6882
6883 # Set definitions to allow ifdef'ing for ncurses.h
6884
6885 case $cf_cv_ncurses_header in
6886 (*ncurses.h)
6887
6888 cat >>confdefs.h <<\EOF
6889 #define HAVE_NCURSES_H 1
6890 EOF
6891
6892         ;;
6893 esac
6894
6895 case $cf_cv_ncurses_header in
6896 (ncurses/curses.h|ncurses/ncurses.h)
6897
6898 cat >>confdefs.h <<\EOF
6899 #define HAVE_NCURSES_NCURSES_H 1
6900 EOF
6901
6902         ;;
6903 (ncursesw/curses.h|ncursesw/ncurses.h)
6904
6905 cat >>confdefs.h <<\EOF
6906 #define HAVE_NCURSESW_NCURSES_H 1
6907 EOF
6908
6909         ;;
6910 esac
6911
6912 echo "$as_me:6912: checking for terminfo header" >&5
6913 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
6914 if test "${cf_cv_term_header+set}" = set; then
6915   echo $ECHO_N "(cached) $ECHO_C" >&6
6916 else
6917
6918 case ${cf_cv_ncurses_header} in
6919 (*/ncurses.h|*/ncursesw.h)
6920         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
6921         ;;
6922 (*)
6923         cf_term_header=term.h
6924         ;;
6925 esac
6926
6927 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
6928 do
6929 cat >conftest.$ac_ext <<_ACEOF
6930 #line 6930 "configure"
6931 #include "confdefs.h"
6932 #include <stdio.h>
6933 #include <${cf_cv_ncurses_header:-curses.h}>
6934 #include <$cf_test>
6935
6936 int
6937 main ()
6938 {
6939 int x = auto_left_margin
6940   ;
6941   return 0;
6942 }
6943 _ACEOF
6944 rm -f conftest.$ac_objext
6945 if { (eval echo "$as_me:6945: \"$ac_compile\"") >&5
6946   (eval $ac_compile) 2>&5
6947   ac_status=$?
6948   echo "$as_me:6948: \$? = $ac_status" >&5
6949   (exit $ac_status); } &&
6950          { ac_try='test -s conftest.$ac_objext'
6951   { (eval echo "$as_me:6951: \"$ac_try\"") >&5
6952   (eval $ac_try) 2>&5
6953   ac_status=$?
6954   echo "$as_me:6954: \$? = $ac_status" >&5
6955   (exit $ac_status); }; }; then
6956
6957         cf_cv_term_header="$cf_test"
6958 else
6959   echo "$as_me: failed program was:" >&5
6960 cat conftest.$ac_ext >&5
6961
6962         cf_cv_term_header=unknown
6963
6964 fi
6965 rm -f conftest.$ac_objext conftest.$ac_ext
6966         test "$cf_cv_term_header" != unknown && break
6967 done
6968
6969 fi
6970 echo "$as_me:6970: result: $cf_cv_term_header" >&5
6971 echo "${ECHO_T}$cf_cv_term_header" >&6
6972
6973 # Set definitions to allow ifdef'ing to accommodate subdirectories
6974
6975 case $cf_cv_term_header in
6976 (*term.h)
6977
6978 cat >>confdefs.h <<\EOF
6979 #define HAVE_TERM_H 1
6980 EOF
6981
6982         ;;
6983 esac
6984
6985 case $cf_cv_term_header in
6986 (ncurses/term.h)
6987
6988 cat >>confdefs.h <<\EOF
6989 #define HAVE_NCURSES_TERM_H 1
6990 EOF
6991
6992         ;;
6993 (ncursesw/term.h)
6994
6995 cat >>confdefs.h <<\EOF
6996 #define HAVE_NCURSESW_TERM_H 1
6997 EOF
6998
6999         ;;
7000 esac
7001
7002 # some applications need this, but should check for NCURSES_VERSION
7003
7004 cat >>confdefs.h <<\EOF
7005 #define NCURSES 1
7006 EOF
7007
7008 echo "$as_me:7008: checking for ncurses version" >&5
7009 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
7010 if test "${cf_cv_ncurses_version+set}" = set; then
7011   echo $ECHO_N "(cached) $ECHO_C" >&6
7012 else
7013
7014         cf_cv_ncurses_version=no
7015         cf_tempfile=out$$
7016         rm -f $cf_tempfile
7017         if test "$cross_compiling" = yes; then
7018
7019         # This will not work if the preprocessor splits the line after the
7020         # Autoconf token.  The 'unproto' program does that.
7021         cat > conftest.$ac_ext <<EOF
7022 #include <${cf_cv_ncurses_header:-curses.h}>
7023 #undef Autoconf
7024 #ifdef NCURSES_VERSION
7025 Autoconf NCURSES_VERSION
7026 #else
7027 #ifdef __NCURSES_H
7028 Autoconf "old"
7029 #endif
7030 ;
7031 #endif
7032 EOF
7033         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
7034         { (eval echo "$as_me:7034: \"$cf_try\"") >&5
7035   (eval $cf_try) 2>&5
7036   ac_status=$?
7037   echo "$as_me:7037: \$? = $ac_status" >&5
7038   (exit $ac_status); }
7039         if test -f conftest.out ; then
7040                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
7041                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
7042                 rm -f conftest.out
7043         fi
7044
7045 else
7046   cat >conftest.$ac_ext <<_ACEOF
7047 #line 7047 "configure"
7048 #include "confdefs.h"
7049
7050 #include <${cf_cv_ncurses_header:-curses.h}>
7051 #include <stdio.h>
7052 int main()
7053 {
7054         FILE *fp = fopen("$cf_tempfile", "w");
7055 #ifdef NCURSES_VERSION
7056 # ifdef NCURSES_VERSION_PATCH
7057         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
7058 # else
7059         fprintf(fp, "%s\n", NCURSES_VERSION);
7060 # endif
7061 #else
7062 # ifdef __NCURSES_H
7063         fprintf(fp, "old\n");
7064 # else
7065         make an error
7066 # endif
7067 #endif
7068         ${cf_cv_main_return:-return}(0);
7069 }
7070 _ACEOF
7071 rm -f conftest$ac_exeext
7072 if { (eval echo "$as_me:7072: \"$ac_link\"") >&5
7073   (eval $ac_link) 2>&5
7074   ac_status=$?
7075   echo "$as_me:7075: \$? = $ac_status" >&5
7076   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
7077   { (eval echo "$as_me:7077: \"$ac_try\"") >&5
7078   (eval $ac_try) 2>&5
7079   ac_status=$?
7080   echo "$as_me:7080: \$? = $ac_status" >&5
7081   (exit $ac_status); }; }; then
7082
7083         cf_cv_ncurses_version=`cat $cf_tempfile`
7084 else
7085   echo "$as_me: program exited with status $ac_status" >&5
7086 echo "$as_me: failed program was:" >&5
7087 cat conftest.$ac_ext >&5
7088 fi
7089 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
7090 fi
7091         rm -f $cf_tempfile
7092
7093 fi
7094 echo "$as_me:7094: result: $cf_cv_ncurses_version" >&5
7095 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
7096 test "$cf_cv_ncurses_version" = no ||
7097 cat >>confdefs.h <<\EOF
7098 #define NCURSES 1
7099 EOF
7100
7101 cf_nculib_root=$cf_cv_screen
7102         # This works, except for the special case where we find gpm, but
7103         # ncurses is in a nonstandard location via $LIBS, and we really want
7104         # to link gpm.
7105 cf_ncurses_LIBS=""
7106 cf_ncurses_SAVE="$LIBS"
7107 echo "$as_me:7107: checking for Gpm_Open in -lgpm" >&5
7108 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
7109 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
7110   echo $ECHO_N "(cached) $ECHO_C" >&6
7111 else
7112   ac_check_lib_save_LIBS=$LIBS
7113 LIBS="-lgpm  $LIBS"
7114 cat >conftest.$ac_ext <<_ACEOF
7115 #line 7115 "configure"
7116 #include "confdefs.h"
7117
7118 /* Override any gcc2 internal prototype to avoid an error.  */
7119 #ifdef __cplusplus
7120 extern "C"
7121 #endif
7122 /* We use char because int might match the return type of a gcc2
7123    builtin and then its argument prototype would still apply.  */
7124 char Gpm_Open ();
7125 int
7126 main ()
7127 {
7128 Gpm_Open ();
7129   ;
7130   return 0;
7131 }
7132 _ACEOF
7133 rm -f conftest.$ac_objext conftest$ac_exeext
7134 if { (eval echo "$as_me:7134: \"$ac_link\"") >&5
7135   (eval $ac_link) 2>&5
7136   ac_status=$?
7137   echo "$as_me:7137: \$? = $ac_status" >&5
7138   (exit $ac_status); } &&
7139          { ac_try='test -s conftest$ac_exeext'
7140   { (eval echo "$as_me:7140: \"$ac_try\"") >&5
7141   (eval $ac_try) 2>&5
7142   ac_status=$?
7143   echo "$as_me:7143: \$? = $ac_status" >&5
7144   (exit $ac_status); }; }; then
7145   ac_cv_lib_gpm_Gpm_Open=yes
7146 else
7147   echo "$as_me: failed program was:" >&5
7148 cat conftest.$ac_ext >&5
7149 ac_cv_lib_gpm_Gpm_Open=no
7150 fi
7151 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7152 LIBS=$ac_check_lib_save_LIBS
7153 fi
7154 echo "$as_me:7154: result: $ac_cv_lib_gpm_Gpm_Open" >&5
7155 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
7156 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
7157   echo "$as_me:7157: checking for initscr in -lgpm" >&5
7158 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
7159 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
7160   echo $ECHO_N "(cached) $ECHO_C" >&6
7161 else
7162   ac_check_lib_save_LIBS=$LIBS
7163 LIBS="-lgpm  $LIBS"
7164 cat >conftest.$ac_ext <<_ACEOF
7165 #line 7165 "configure"
7166 #include "confdefs.h"
7167
7168 /* Override any gcc2 internal prototype to avoid an error.  */
7169 #ifdef __cplusplus
7170 extern "C"
7171 #endif
7172 /* We use char because int might match the return type of a gcc2
7173    builtin and then its argument prototype would still apply.  */
7174 char initscr ();
7175 int
7176 main ()
7177 {
7178 initscr ();
7179   ;
7180   return 0;
7181 }
7182 _ACEOF
7183 rm -f conftest.$ac_objext conftest$ac_exeext
7184 if { (eval echo "$as_me:7184: \"$ac_link\"") >&5
7185   (eval $ac_link) 2>&5
7186   ac_status=$?
7187   echo "$as_me:7187: \$? = $ac_status" >&5
7188   (exit $ac_status); } &&
7189          { ac_try='test -s conftest$ac_exeext'
7190   { (eval echo "$as_me:7190: \"$ac_try\"") >&5
7191   (eval $ac_try) 2>&5
7192   ac_status=$?
7193   echo "$as_me:7193: \$? = $ac_status" >&5
7194   (exit $ac_status); }; }; then
7195   ac_cv_lib_gpm_initscr=yes
7196 else
7197   echo "$as_me: failed program was:" >&5
7198 cat conftest.$ac_ext >&5
7199 ac_cv_lib_gpm_initscr=no
7200 fi
7201 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7202 LIBS=$ac_check_lib_save_LIBS
7203 fi
7204 echo "$as_me:7204: result: $ac_cv_lib_gpm_initscr" >&5
7205 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
7206 if test $ac_cv_lib_gpm_initscr = yes; then
7207   LIBS="$cf_ncurses_SAVE"
7208 else
7209   cf_ncurses_LIBS="-lgpm"
7210 fi
7211
7212 fi
7213
7214 case $host_os in
7215 (freebsd*)
7216         # This is only necessary if you are linking against an obsolete
7217         # version of ncurses (but it should do no harm, since it's static).
7218         if test "$cf_nculib_root" = ncurses ; then
7219                 echo "$as_me:7219: checking for tgoto in -lmytinfo" >&5
7220 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
7221 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
7222   echo $ECHO_N "(cached) $ECHO_C" >&6
7223 else
7224   ac_check_lib_save_LIBS=$LIBS
7225 LIBS="-lmytinfo  $LIBS"
7226 cat >conftest.$ac_ext <<_ACEOF
7227 #line 7227 "configure"
7228 #include "confdefs.h"
7229
7230 /* Override any gcc2 internal prototype to avoid an error.  */
7231 #ifdef __cplusplus
7232 extern "C"
7233 #endif
7234 /* We use char because int might match the return type of a gcc2
7235    builtin and then its argument prototype would still apply.  */
7236 char tgoto ();
7237 int
7238 main ()
7239 {
7240 tgoto ();
7241   ;
7242   return 0;
7243 }
7244 _ACEOF
7245 rm -f conftest.$ac_objext conftest$ac_exeext
7246 if { (eval echo "$as_me:7246: \"$ac_link\"") >&5
7247   (eval $ac_link) 2>&5
7248   ac_status=$?
7249   echo "$as_me:7249: \$? = $ac_status" >&5
7250   (exit $ac_status); } &&
7251          { ac_try='test -s conftest$ac_exeext'
7252   { (eval echo "$as_me:7252: \"$ac_try\"") >&5
7253   (eval $ac_try) 2>&5
7254   ac_status=$?
7255   echo "$as_me:7255: \$? = $ac_status" >&5
7256   (exit $ac_status); }; }; then
7257   ac_cv_lib_mytinfo_tgoto=yes
7258 else
7259   echo "$as_me: failed program was:" >&5
7260 cat conftest.$ac_ext >&5
7261 ac_cv_lib_mytinfo_tgoto=no
7262 fi
7263 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7264 LIBS=$ac_check_lib_save_LIBS
7265 fi
7266 echo "$as_me:7266: result: $ac_cv_lib_mytinfo_tgoto" >&5
7267 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
7268 if test $ac_cv_lib_mytinfo_tgoto = yes; then
7269   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
7270 fi
7271
7272         fi
7273         ;;
7274 esac
7275
7276 cf_add_libs="$cf_ncurses_LIBS"
7277 # Filter out duplicates - this happens with badly-designed ".pc" files...
7278 for cf_add_1lib in $LIBS
7279 do
7280         for cf_add_2lib in $cf_add_libs
7281         do
7282                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7283                 then
7284                         cf_add_1lib=
7285                         break
7286                 fi
7287         done
7288         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7289 done
7290 LIBS="$cf_add_libs"
7291
7292 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
7293 then
7294
7295 cf_add_libs="-l$cf_nculib_root"
7296 # Filter out duplicates - this happens with badly-designed ".pc" files...
7297 for cf_add_1lib in $LIBS
7298 do
7299         for cf_add_2lib in $cf_add_libs
7300         do
7301                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7302                 then
7303                         cf_add_1lib=
7304                         break
7305                 fi
7306         done
7307         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7308 done
7309 LIBS="$cf_add_libs"
7310
7311 else
7312
7313         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
7314         cf_libdir=""
7315         echo "$as_me:7315: checking for initscr" >&5
7316 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
7317 if test "${ac_cv_func_initscr+set}" = set; then
7318   echo $ECHO_N "(cached) $ECHO_C" >&6
7319 else
7320   cat >conftest.$ac_ext <<_ACEOF
7321 #line 7321 "configure"
7322 #include "confdefs.h"
7323 /* System header to define __stub macros and hopefully few prototypes,
7324     which can conflict with char initscr (); below.  */
7325 #include <assert.h>
7326 /* Override any gcc2 internal prototype to avoid an error.  */
7327 #ifdef __cplusplus
7328 extern "C"
7329 #endif
7330 /* We use char because int might match the return type of a gcc2
7331    builtin and then its argument prototype would still apply.  */
7332 char initscr ();
7333 char (*f) ();
7334
7335 int
7336 main ()
7337 {
7338 /* The GNU C library defines this for functions which it implements
7339     to always fail with ENOSYS.  Some functions are actually named
7340     something starting with __ and the normal name is an alias.  */
7341 #if defined (__stub_initscr) || defined (__stub___initscr)
7342 choke me
7343 #else
7344 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
7345 #endif
7346
7347   ;
7348   return 0;
7349 }
7350 _ACEOF
7351 rm -f conftest.$ac_objext conftest$ac_exeext
7352 if { (eval echo "$as_me:7352: \"$ac_link\"") >&5
7353   (eval $ac_link) 2>&5
7354   ac_status=$?
7355   echo "$as_me:7355: \$? = $ac_status" >&5
7356   (exit $ac_status); } &&
7357          { ac_try='test -s conftest$ac_exeext'
7358   { (eval echo "$as_me:7358: \"$ac_try\"") >&5
7359   (eval $ac_try) 2>&5
7360   ac_status=$?
7361   echo "$as_me:7361: \$? = $ac_status" >&5
7362   (exit $ac_status); }; }; then
7363   ac_cv_func_initscr=yes
7364 else
7365   echo "$as_me: failed program was:" >&5
7366 cat conftest.$ac_ext >&5
7367 ac_cv_func_initscr=no
7368 fi
7369 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7370 fi
7371 echo "$as_me:7371: result: $ac_cv_func_initscr" >&5
7372 echo "${ECHO_T}$ac_cv_func_initscr" >&6
7373 if test $ac_cv_func_initscr = yes; then
7374   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
7375 else
7376
7377                 cf_save_LIBS="$LIBS"
7378                 echo "$as_me:7378: checking for initscr in -l$cf_nculib_root" >&5
7379 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
7380                 LIBS="-l$cf_nculib_root $LIBS"
7381                 cat >conftest.$ac_ext <<_ACEOF
7382 #line 7382 "configure"
7383 #include "confdefs.h"
7384 #include <${cf_cv_ncurses_header:-curses.h}>
7385 int
7386 main ()
7387 {
7388 initscr()
7389   ;
7390   return 0;
7391 }
7392 _ACEOF
7393 rm -f conftest.$ac_objext conftest$ac_exeext
7394 if { (eval echo "$as_me:7394: \"$ac_link\"") >&5
7395   (eval $ac_link) 2>&5
7396   ac_status=$?
7397   echo "$as_me:7397: \$? = $ac_status" >&5
7398   (exit $ac_status); } &&
7399          { ac_try='test -s conftest$ac_exeext'
7400   { (eval echo "$as_me:7400: \"$ac_try\"") >&5
7401   (eval $ac_try) 2>&5
7402   ac_status=$?
7403   echo "$as_me:7403: \$? = $ac_status" >&5
7404   (exit $ac_status); }; }; then
7405   echo "$as_me:7405: result: yes" >&5
7406 echo "${ECHO_T}yes" >&6
7407                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
7408
7409 else
7410   echo "$as_me: failed program was:" >&5
7411 cat conftest.$ac_ext >&5
7412 echo "$as_me:7412: result: no" >&5
7413 echo "${ECHO_T}no" >&6
7414
7415 cf_search=
7416 cf_library_path_list=""
7417 if test -n "${LDFLAGS}${LIBS}" ; then
7418         for cf_library_path in $LDFLAGS $LIBS
7419         do
7420                 case $cf_library_path in
7421                 (-L*)
7422                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
7423
7424 test "x$cf_library_path" != "xNONE" && \
7425 test -d "$cf_library_path" && \
7426  {
7427         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
7428         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
7429         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
7430         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
7431         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
7432         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"
7433 }
7434
7435                         cf_library_path_list="$cf_library_path_list $cf_search"
7436                         ;;
7437                 esac
7438         done
7439 fi
7440
7441 cf_search=
7442
7443 test "x$prefix" != "xNONE" && \
7444 test -d "$prefix" && \
7445  {
7446         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
7447         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
7448         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
7449         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
7450         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
7451         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
7452 }
7453
7454 for cf_subdir_prefix in \
7455         /usr \
7456         /usr/local \
7457         /usr/pkg \
7458         /opt \
7459         /opt/local \
7460         $HOME
7461 do
7462
7463 test "x$cf_subdir_prefix" != "x$prefix" && \
7464 test -d "$cf_subdir_prefix" && \
7465 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
7466         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
7467         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
7468         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
7469         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
7470         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
7471         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"
7472 }
7473
7474 done
7475
7476 cf_search="$cf_library_path_list $cf_search"
7477
7478                         for cf_libdir in $cf_search
7479                         do
7480                                 echo "$as_me:7480: checking for -l$cf_nculib_root in $cf_libdir" >&5
7481 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
7482                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
7483                                 cat >conftest.$ac_ext <<_ACEOF
7484 #line 7484 "configure"
7485 #include "confdefs.h"
7486 #include <${cf_cv_ncurses_header:-curses.h}>
7487 int
7488 main ()
7489 {
7490 initscr()
7491   ;
7492   return 0;
7493 }
7494 _ACEOF
7495 rm -f conftest.$ac_objext conftest$ac_exeext
7496 if { (eval echo "$as_me:7496: \"$ac_link\"") >&5
7497   (eval $ac_link) 2>&5
7498   ac_status=$?
7499   echo "$as_me:7499: \$? = $ac_status" >&5
7500   (exit $ac_status); } &&
7501          { ac_try='test -s conftest$ac_exeext'
7502   { (eval echo "$as_me:7502: \"$ac_try\"") >&5
7503   (eval $ac_try) 2>&5
7504   ac_status=$?
7505   echo "$as_me:7505: \$? = $ac_status" >&5
7506   (exit $ac_status); }; }; then
7507   echo "$as_me:7507: result: yes" >&5
7508 echo "${ECHO_T}yes" >&6
7509                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
7510                                          break
7511 else
7512   echo "$as_me: failed program was:" >&5
7513 cat conftest.$ac_ext >&5
7514 echo "$as_me:7514: result: no" >&5
7515 echo "${ECHO_T}no" >&6
7516                                          LIBS="$cf_save_LIBS"
7517 fi
7518 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7519                         done
7520
7521 fi
7522 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7523
7524 fi
7525
7526 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
7527
7528 if test $cf_found_library = no ; then
7529         { { echo "$as_me:7529: error: Cannot link $cf_nculib_root library" >&5
7530 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
7531    { (exit 1); exit 1; }; }
7532 fi
7533
7534 fi
7535
7536 if test -n "$cf_ncurses_LIBS" ; then
7537         echo "$as_me:7537: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
7538 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
7539         cf_ncurses_SAVE="$LIBS"
7540         for p in $cf_ncurses_LIBS ; do
7541                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
7542                 if test "$q" != "$LIBS" ; then
7543                         LIBS="$q"
7544                 fi
7545         done
7546         cat >conftest.$ac_ext <<_ACEOF
7547 #line 7547 "configure"
7548 #include "confdefs.h"
7549 #include <${cf_cv_ncurses_header:-curses.h}>
7550 int
7551 main ()
7552 {
7553 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
7554   ;
7555   return 0;
7556 }
7557 _ACEOF
7558 rm -f conftest.$ac_objext conftest$ac_exeext
7559 if { (eval echo "$as_me:7559: \"$ac_link\"") >&5
7560   (eval $ac_link) 2>&5
7561   ac_status=$?
7562   echo "$as_me:7562: \$? = $ac_status" >&5
7563   (exit $ac_status); } &&
7564          { ac_try='test -s conftest$ac_exeext'
7565   { (eval echo "$as_me:7565: \"$ac_try\"") >&5
7566   (eval $ac_try) 2>&5
7567   ac_status=$?
7568   echo "$as_me:7568: \$? = $ac_status" >&5
7569   (exit $ac_status); }; }; then
7570   echo "$as_me:7570: result: yes" >&5
7571 echo "${ECHO_T}yes" >&6
7572 else
7573   echo "$as_me: failed program was:" >&5
7574 cat conftest.$ac_ext >&5
7575 echo "$as_me:7575: result: no" >&5
7576 echo "${ECHO_T}no" >&6
7577                  LIBS="$cf_ncurses_SAVE"
7578 fi
7579 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7580 fi
7581
7582 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
7583
7584 cat >>confdefs.h <<EOF
7585 #define $cf_nculib_ROOT 1
7586 EOF
7587
7588         fi
7589 fi
7590
7591         ;;
7592 (ncurses*)
7593
7594 cf_ncuconfig_root=$cf_cv_screen
7595 cf_have_ncuconfig=no
7596
7597 if test "x$PKG_CONFIG" != xnone; then
7598         echo "$as_me:7598: checking pkg-config for $cf_ncuconfig_root" >&5
7599 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
7600         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
7601                 echo "$as_me:7601: result: yes" >&5
7602 echo "${ECHO_T}yes" >&6
7603
7604                 echo "$as_me:7604: checking if the $cf_ncuconfig_root package files work" >&5
7605 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
7606                 cf_have_ncuconfig=unknown
7607
7608                 cf_save_CPPFLAGS="$CPPFLAGS"
7609                 cf_save_LIBS="$LIBS"
7610
7611                 CPPFLAGS="$CPPFLAGS `$PKG_CONFIG --cflags $cf_ncuconfig_root`"
7612
7613 cf_add_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
7614 # Filter out duplicates - this happens with badly-designed ".pc" files...
7615 for cf_add_1lib in $LIBS
7616 do
7617         for cf_add_2lib in $cf_add_libs
7618         do
7619                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7620                 then
7621                         cf_add_1lib=
7622                         break
7623                 fi
7624         done
7625         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7626 done
7627 LIBS="$cf_add_libs"
7628
7629                 cat >conftest.$ac_ext <<_ACEOF
7630 #line 7630 "configure"
7631 #include "confdefs.h"
7632 #include <${cf_cv_ncurses_header:-curses.h}>
7633 int
7634 main ()
7635 {
7636 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
7637   ;
7638   return 0;
7639 }
7640 _ACEOF
7641 rm -f conftest.$ac_objext conftest$ac_exeext
7642 if { (eval echo "$as_me:7642: \"$ac_link\"") >&5
7643   (eval $ac_link) 2>&5
7644   ac_status=$?
7645   echo "$as_me:7645: \$? = $ac_status" >&5
7646   (exit $ac_status); } &&
7647          { ac_try='test -s conftest$ac_exeext'
7648   { (eval echo "$as_me:7648: \"$ac_try\"") >&5
7649   (eval $ac_try) 2>&5
7650   ac_status=$?
7651   echo "$as_me:7651: \$? = $ac_status" >&5
7652   (exit $ac_status); }; }; then
7653   if test "$cross_compiling" = yes; then
7654   { { echo "$as_me:7654: error: cannot run test program while cross compiling" >&5
7655 echo "$as_me: error: cannot run test program while cross compiling" >&2;}
7656    { (exit 1); exit 1; }; }
7657 else
7658   cat >conftest.$ac_ext <<_ACEOF
7659 #line 7659 "configure"
7660 #include "confdefs.h"
7661 #include <${cf_cv_ncurses_header:-curses.h}>
7662                                 int main(void)
7663                                 { char *xx = curses_version(); return (xx == 0); }
7664 _ACEOF
7665 rm -f conftest$ac_exeext
7666 if { (eval echo "$as_me:7666: \"$ac_link\"") >&5
7667   (eval $ac_link) 2>&5
7668   ac_status=$?
7669   echo "$as_me:7669: \$? = $ac_status" >&5
7670   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
7671   { (eval echo "$as_me:7671: \"$ac_try\"") >&5
7672   (eval $ac_try) 2>&5
7673   ac_status=$?
7674   echo "$as_me:7674: \$? = $ac_status" >&5
7675   (exit $ac_status); }; }; then
7676   cf_have_ncuconfig=yes
7677 else
7678   echo "$as_me: program exited with status $ac_status" >&5
7679 echo "$as_me: failed program was:" >&5
7680 cat conftest.$ac_ext >&5
7681 cf_have_ncuconfig=no
7682 fi
7683 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
7684 fi
7685 else
7686   echo "$as_me: failed program was:" >&5
7687 cat conftest.$ac_ext >&5
7688 cf_have_ncuconfig=no
7689 fi
7690 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7691
7692                 echo "$as_me:7692: result: $cf_have_ncuconfig" >&5
7693 echo "${ECHO_T}$cf_have_ncuconfig" >&6
7694                 if test "$cf_have_ncuconfig" != "yes"
7695                 then
7696                         CPPFLAGS="$cf_save_CPPFLAGS"
7697                         LIBS="$cf_save_LIBS"
7698                 else
7699
7700 cat >>confdefs.h <<\EOF
7701 #define NCURSES 1
7702 EOF
7703
7704                 fi
7705
7706         else
7707                 echo "$as_me:7707: result: no" >&5
7708 echo "${ECHO_T}no" >&6
7709         fi
7710 fi
7711
7712 if test "x$cf_have_ncuconfig" = "xno"; then
7713         echo "Looking for ${cf_ncuconfig_root}-config"
7714
7715 if test -n "$ac_tool_prefix"; then
7716   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7717   do
7718     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
7719 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
7720 echo "$as_me:7720: checking for $ac_word" >&5
7721 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7722 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
7723   echo $ECHO_N "(cached) $ECHO_C" >&6
7724 else
7725   if test -n "$NCURSES_CONFIG"; then
7726   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
7727 else
7728   ac_save_IFS=$IFS; IFS=$ac_path_separator
7729 ac_dummy="$PATH"
7730 for ac_dir in $ac_dummy; do
7731   IFS=$ac_save_IFS
7732   test -z "$ac_dir" && ac_dir=.
7733   $as_executable_p "$ac_dir/$ac_word" || continue
7734 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
7735 echo "$as_me:7735: found $ac_dir/$ac_word" >&5
7736 break
7737 done
7738
7739 fi
7740 fi
7741 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
7742 if test -n "$NCURSES_CONFIG"; then
7743   echo "$as_me:7743: result: $NCURSES_CONFIG" >&5
7744 echo "${ECHO_T}$NCURSES_CONFIG" >&6
7745 else
7746   echo "$as_me:7746: result: no" >&5
7747 echo "${ECHO_T}no" >&6
7748 fi
7749
7750     test -n "$NCURSES_CONFIG" && break
7751   done
7752 fi
7753 if test -z "$NCURSES_CONFIG"; then
7754   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
7755   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7756 do
7757   # Extract the first word of "$ac_prog", so it can be a program name with args.
7758 set dummy $ac_prog; ac_word=$2
7759 echo "$as_me:7759: checking for $ac_word" >&5
7760 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7761 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
7762   echo $ECHO_N "(cached) $ECHO_C" >&6
7763 else
7764   if test -n "$ac_ct_NCURSES_CONFIG"; then
7765   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
7766 else
7767   ac_save_IFS=$IFS; IFS=$ac_path_separator
7768 ac_dummy="$PATH"
7769 for ac_dir in $ac_dummy; do
7770   IFS=$ac_save_IFS
7771   test -z "$ac_dir" && ac_dir=.
7772   $as_executable_p "$ac_dir/$ac_word" || continue
7773 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
7774 echo "$as_me:7774: found $ac_dir/$ac_word" >&5
7775 break
7776 done
7777
7778 fi
7779 fi
7780 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
7781 if test -n "$ac_ct_NCURSES_CONFIG"; then
7782   echo "$as_me:7782: result: $ac_ct_NCURSES_CONFIG" >&5
7783 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
7784 else
7785   echo "$as_me:7785: result: no" >&5
7786 echo "${ECHO_T}no" >&6
7787 fi
7788
7789   test -n "$ac_ct_NCURSES_CONFIG" && break
7790 done
7791 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
7792
7793   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
7794 fi
7795
7796         if test "$NCURSES_CONFIG" != none ; then
7797
7798                 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
7799
7800 cf_add_libs="`$NCURSES_CONFIG --libs`"
7801 # Filter out duplicates - this happens with badly-designed ".pc" files...
7802 for cf_add_1lib in $LIBS
7803 do
7804         for cf_add_2lib in $cf_add_libs
7805         do
7806                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7807                 then
7808                         cf_add_1lib=
7809                         break
7810                 fi
7811         done
7812         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7813 done
7814 LIBS="$cf_add_libs"
7815
7816                 # even with config script, some packages use no-override for curses.h
7817
7818 echo "$as_me:7818: checking if we have identified curses headers" >&5
7819 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
7820 if test "${cf_cv_ncurses_header+set}" = set; then
7821   echo $ECHO_N "(cached) $ECHO_C" >&6
7822 else
7823
7824 cf_cv_ncurses_header=none
7825 for cf_header in \
7826         ncurses.h $cf_cv_screen/ncurses.h \
7827         curses.h $cf_cv_screen/curses.h
7828 do
7829 cat >conftest.$ac_ext <<_ACEOF
7830 #line 7830 "configure"
7831 #include "confdefs.h"
7832 #include <${cf_header}>
7833 int
7834 main ()
7835 {
7836 initscr(); tgoto("?", 0,0)
7837   ;
7838   return 0;
7839 }
7840 _ACEOF
7841 rm -f conftest.$ac_objext
7842 if { (eval echo "$as_me:7842: \"$ac_compile\"") >&5
7843   (eval $ac_compile) 2>&5
7844   ac_status=$?
7845   echo "$as_me:7845: \$? = $ac_status" >&5
7846   (exit $ac_status); } &&
7847          { ac_try='test -s conftest.$ac_objext'
7848   { (eval echo "$as_me:7848: \"$ac_try\"") >&5
7849   (eval $ac_try) 2>&5
7850   ac_status=$?
7851   echo "$as_me:7851: \$? = $ac_status" >&5
7852   (exit $ac_status); }; }; then
7853   cf_cv_ncurses_header=$cf_header; break
7854 else
7855   echo "$as_me: failed program was:" >&5
7856 cat conftest.$ac_ext >&5
7857 fi
7858 rm -f conftest.$ac_objext conftest.$ac_ext
7859 done
7860
7861 fi
7862 echo "$as_me:7862: result: $cf_cv_ncurses_header" >&5
7863 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
7864
7865 if test "$cf_cv_ncurses_header" = none ; then
7866         { { echo "$as_me:7866: error: No curses header-files found" >&5
7867 echo "$as_me: error: No curses header-files found" >&2;}
7868    { (exit 1); exit 1; }; }
7869 fi
7870
7871 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
7872
7873 for ac_header in $cf_cv_ncurses_header
7874 do
7875 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
7876 echo "$as_me:7876: checking for $ac_header" >&5
7877 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
7878 if eval "test \"\${$as_ac_Header+set}\" = set"; then
7879   echo $ECHO_N "(cached) $ECHO_C" >&6
7880 else
7881   cat >conftest.$ac_ext <<_ACEOF
7882 #line 7882 "configure"
7883 #include "confdefs.h"
7884 #include <$ac_header>
7885 _ACEOF
7886 if { (eval echo "$as_me:7886: \"$ac_cpp conftest.$ac_ext\"") >&5
7887   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
7888   ac_status=$?
7889   egrep -v '^ *\+' conftest.er1 >conftest.err
7890   rm -f conftest.er1
7891   cat conftest.err >&5
7892   echo "$as_me:7892: \$? = $ac_status" >&5
7893   (exit $ac_status); } >/dev/null; then
7894   if test -s conftest.err; then
7895     ac_cpp_err=$ac_c_preproc_warn_flag
7896   else
7897     ac_cpp_err=
7898   fi
7899 else
7900   ac_cpp_err=yes
7901 fi
7902 if test -z "$ac_cpp_err"; then
7903   eval "$as_ac_Header=yes"
7904 else
7905   echo "$as_me: failed program was:" >&5
7906   cat conftest.$ac_ext >&5
7907   eval "$as_ac_Header=no"
7908 fi
7909 rm -f conftest.err conftest.$ac_ext
7910 fi
7911 echo "$as_me:7911: result: `eval echo '${'$as_ac_Header'}'`" >&5
7912 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
7913 if test `eval echo '${'$as_ac_Header'}'` = yes; then
7914   cat >>confdefs.h <<EOF
7915 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
7916 EOF
7917
7918 fi
7919 done
7920
7921 cat >>confdefs.h <<\EOF
7922 #define NCURSES 1
7923 EOF
7924
7925 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
7926
7927                 cat >>confdefs.h <<EOF
7928 #define $cf_nculib_ROOT 1
7929 EOF
7930
7931                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
7932
7933         else
7934
7935 cf_ncuhdr_root=$cf_cv_screen
7936
7937 test -n "$cf_cv_curses_dir" && \
7938 test "$cf_cv_curses_dir" != "no" && { \
7939
7940 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
7941   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
7942   do
7943         while test $cf_add_incdir != /usr/include
7944         do
7945           if test -d $cf_add_incdir
7946           then
7947                 cf_have_incdir=no
7948                 if test -n "$CFLAGS$CPPFLAGS" ; then
7949                   # a loop is needed to ensure we can add subdirs of existing dirs
7950                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7951                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7952                           cf_have_incdir=yes; break
7953                         fi
7954                   done
7955                 fi
7956
7957                 if test "$cf_have_incdir" = no ; then
7958                   if test "$cf_add_incdir" = /usr/local/include ; then
7959                         if test "$GCC" = yes
7960                         then
7961                           cf_save_CPPFLAGS=$CPPFLAGS
7962                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7963                           cat >conftest.$ac_ext <<_ACEOF
7964 #line 7964 "configure"
7965 #include "confdefs.h"
7966 #include <stdio.h>
7967 int
7968 main ()
7969 {
7970 printf("Hello")
7971   ;
7972   return 0;
7973 }
7974 _ACEOF
7975 rm -f conftest.$ac_objext
7976 if { (eval echo "$as_me:7976: \"$ac_compile\"") >&5
7977   (eval $ac_compile) 2>&5
7978   ac_status=$?
7979   echo "$as_me:7979: \$? = $ac_status" >&5
7980   (exit $ac_status); } &&
7981          { ac_try='test -s conftest.$ac_objext'
7982   { (eval echo "$as_me:7982: \"$ac_try\"") >&5
7983   (eval $ac_try) 2>&5
7984   ac_status=$?
7985   echo "$as_me:7985: \$? = $ac_status" >&5
7986   (exit $ac_status); }; }; then
7987   :
7988 else
7989   echo "$as_me: failed program was:" >&5
7990 cat conftest.$ac_ext >&5
7991 cf_have_incdir=yes
7992 fi
7993 rm -f conftest.$ac_objext conftest.$ac_ext
7994                           CPPFLAGS=$cf_save_CPPFLAGS
7995                         fi
7996                   fi
7997                 fi
7998
7999                 if test "$cf_have_incdir" = no ; then
8000                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8001
8002 echo "${as_me:-configure}:8002: testing adding $cf_add_incdir to include-path ..." 1>&5
8003
8004                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8005
8006                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8007                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8008                   cf_add_incdir="$cf_top_incdir"
8009                 else
8010                   break
8011                 fi
8012           fi
8013         done
8014   done
8015 fi
8016
8017 }
8018
8019 echo "$as_me:8019: checking for $cf_ncuhdr_root header in include-path" >&5
8020 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
8021 if test "${cf_cv_ncurses_h+set}" = set; then
8022   echo $ECHO_N "(cached) $ECHO_C" >&6
8023 else
8024
8025         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
8026         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
8027         for cf_header in $cf_header_list
8028         do
8029
8030         cat >conftest.$ac_ext <<_ACEOF
8031 #line 8031 "configure"
8032 #include "confdefs.h"
8033
8034 #include <$cf_header>
8035 int
8036 main ()
8037 {
8038
8039 #ifdef NCURSES_VERSION
8040
8041 printf("%s\n", NCURSES_VERSION);
8042 #else
8043 #ifdef __NCURSES_H
8044 printf("old\n");
8045 #else
8046         make an error
8047 #endif
8048 #endif
8049
8050   ;
8051   return 0;
8052 }
8053 _ACEOF
8054 rm -f conftest.$ac_objext
8055 if { (eval echo "$as_me:8055: \"$ac_compile\"") >&5
8056   (eval $ac_compile) 2>&5
8057   ac_status=$?
8058   echo "$as_me:8058: \$? = $ac_status" >&5
8059   (exit $ac_status); } &&
8060          { ac_try='test -s conftest.$ac_objext'
8061   { (eval echo "$as_me:8061: \"$ac_try\"") >&5
8062   (eval $ac_try) 2>&5
8063   ac_status=$?
8064   echo "$as_me:8064: \$? = $ac_status" >&5
8065   (exit $ac_status); }; }; then
8066   cf_cv_ncurses_h=$cf_header
8067
8068 else
8069   echo "$as_me: failed program was:" >&5
8070 cat conftest.$ac_ext >&5
8071 cf_cv_ncurses_h=no
8072 fi
8073 rm -f conftest.$ac_objext conftest.$ac_ext
8074
8075                 test "$cf_cv_ncurses_h" != no && break
8076         done
8077
8078 fi
8079 echo "$as_me:8079: result: $cf_cv_ncurses_h" >&5
8080 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
8081
8082 if test "$cf_cv_ncurses_h" != no ; then
8083         cf_cv_ncurses_header=$cf_cv_ncurses_h
8084 else
8085
8086 echo "$as_me:8086: checking for $cf_ncuhdr_root include-path" >&5
8087 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
8088 if test "${cf_cv_ncurses_h2+set}" = set; then
8089   echo $ECHO_N "(cached) $ECHO_C" >&6
8090 else
8091
8092         test -n "$verbose" && echo
8093
8094 cf_search=
8095
8096 # collect the current set of include-directories from compiler flags
8097 cf_header_path_list=""
8098 if test -n "${CFLAGS}${CPPFLAGS}" ; then
8099         for cf_header_path in $CPPFLAGS $CFLAGS
8100         do
8101                 case $cf_header_path in
8102                 (-I*)
8103                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
8104
8105 test "x$cf_header_path" != "xNONE" && \
8106 test -d "$cf_header_path" && \
8107  {
8108         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
8109         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
8110         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
8111         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
8112         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
8113         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"
8114 }
8115
8116                         cf_header_path_list="$cf_header_path_list $cf_search"
8117                         ;;
8118                 esac
8119         done
8120 fi
8121
8122 # add the variations for the package we are looking for
8123
8124 cf_search=
8125
8126 test "x$prefix" != "xNONE" && \
8127 test -d "$prefix" && \
8128  {
8129         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
8130         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
8131         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
8132         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
8133         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
8134         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8135 }
8136
8137 for cf_subdir_prefix in \
8138         /usr \
8139         /usr/local \
8140         /usr/pkg \
8141         /opt \
8142         /opt/local \
8143         $HOME
8144 do
8145
8146 test "x$cf_subdir_prefix" != "x$prefix" && \
8147 test -d "$cf_subdir_prefix" && \
8148 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
8149         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
8150         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
8151         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
8152         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
8153         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
8154         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"
8155 }
8156
8157 done
8158
8159 test "$includedir" != NONE && \
8160 test "$includedir" != "/usr/include" && \
8161 test -d "$includedir" && {
8162         test -d $includedir &&    cf_search="$cf_search $includedir"
8163         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
8164 }
8165
8166 test "$oldincludedir" != NONE && \
8167 test "$oldincludedir" != "/usr/include" && \
8168 test -d "$oldincludedir" && {
8169         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
8170         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
8171 }
8172
8173 cf_search="$cf_search $cf_header_path_list"
8174
8175         test -n "$verbose" && echo search path $cf_search
8176         cf_save2_CPPFLAGS="$CPPFLAGS"
8177         for cf_incdir in $cf_search
8178         do
8179
8180 if test -n "$cf_incdir" ; then
8181   for cf_add_incdir in $cf_incdir
8182   do
8183         while test $cf_add_incdir != /usr/include
8184         do
8185           if test -d $cf_add_incdir
8186           then
8187                 cf_have_incdir=no
8188                 if test -n "$CFLAGS$CPPFLAGS" ; then
8189                   # a loop is needed to ensure we can add subdirs of existing dirs
8190                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8191                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8192                           cf_have_incdir=yes; break
8193                         fi
8194                   done
8195                 fi
8196
8197                 if test "$cf_have_incdir" = no ; then
8198                   if test "$cf_add_incdir" = /usr/local/include ; then
8199                         if test "$GCC" = yes
8200                         then
8201                           cf_save_CPPFLAGS=$CPPFLAGS
8202                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8203                           cat >conftest.$ac_ext <<_ACEOF
8204 #line 8204 "configure"
8205 #include "confdefs.h"
8206 #include <stdio.h>
8207 int
8208 main ()
8209 {
8210 printf("Hello")
8211   ;
8212   return 0;
8213 }
8214 _ACEOF
8215 rm -f conftest.$ac_objext
8216 if { (eval echo "$as_me:8216: \"$ac_compile\"") >&5
8217   (eval $ac_compile) 2>&5
8218   ac_status=$?
8219   echo "$as_me:8219: \$? = $ac_status" >&5
8220   (exit $ac_status); } &&
8221          { ac_try='test -s conftest.$ac_objext'
8222   { (eval echo "$as_me:8222: \"$ac_try\"") >&5
8223   (eval $ac_try) 2>&5
8224   ac_status=$?
8225   echo "$as_me:8225: \$? = $ac_status" >&5
8226   (exit $ac_status); }; }; then
8227   :
8228 else
8229   echo "$as_me: failed program was:" >&5
8230 cat conftest.$ac_ext >&5
8231 cf_have_incdir=yes
8232 fi
8233 rm -f conftest.$ac_objext conftest.$ac_ext
8234                           CPPFLAGS=$cf_save_CPPFLAGS
8235                         fi
8236                   fi
8237                 fi
8238
8239                 if test "$cf_have_incdir" = no ; then
8240                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8241
8242 echo "${as_me:-configure}:8242: testing adding $cf_add_incdir to include-path ..." 1>&5
8243
8244                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8245
8246                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8247                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8248                   cf_add_incdir="$cf_top_incdir"
8249                 else
8250                   break
8251                 fi
8252           fi
8253         done
8254   done
8255 fi
8256
8257                 for cf_header in \
8258                         ncurses.h \
8259                         curses.h
8260                 do
8261
8262         cat >conftest.$ac_ext <<_ACEOF
8263 #line 8263 "configure"
8264 #include "confdefs.h"
8265
8266 #include <$cf_header>
8267 int
8268 main ()
8269 {
8270
8271 #ifdef NCURSES_VERSION
8272
8273 printf("%s\n", NCURSES_VERSION);
8274 #else
8275 #ifdef __NCURSES_H
8276 printf("old\n");
8277 #else
8278         make an error
8279 #endif
8280 #endif
8281
8282   ;
8283   return 0;
8284 }
8285 _ACEOF
8286 rm -f conftest.$ac_objext
8287 if { (eval echo "$as_me:8287: \"$ac_compile\"") >&5
8288   (eval $ac_compile) 2>&5
8289   ac_status=$?
8290   echo "$as_me:8290: \$? = $ac_status" >&5
8291   (exit $ac_status); } &&
8292          { ac_try='test -s conftest.$ac_objext'
8293   { (eval echo "$as_me:8293: \"$ac_try\"") >&5
8294   (eval $ac_try) 2>&5
8295   ac_status=$?
8296   echo "$as_me:8296: \$? = $ac_status" >&5
8297   (exit $ac_status); }; }; then
8298   cf_cv_ncurses_h2=$cf_header
8299
8300 else
8301   echo "$as_me: failed program was:" >&5
8302 cat conftest.$ac_ext >&5
8303 cf_cv_ncurses_h2=no
8304 fi
8305 rm -f conftest.$ac_objext conftest.$ac_ext
8306
8307                         if test "$cf_cv_ncurses_h2" != no ; then
8308                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
8309                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
8310                                 break
8311                         fi
8312                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
8313                 done
8314                 CPPFLAGS="$cf_save2_CPPFLAGS"
8315                 test "$cf_cv_ncurses_h2" != no && break
8316         done
8317         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:8317: error: not found" >&5
8318 echo "$as_me: error: not found" >&2;}
8319    { (exit 1); exit 1; }; }
8320
8321 fi
8322 echo "$as_me:8322: result: $cf_cv_ncurses_h2" >&5
8323 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
8324
8325         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
8326         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
8327         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
8328                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
8329         fi
8330
8331 if test -n "$cf_1st_incdir" ; then
8332   for cf_add_incdir in $cf_1st_incdir
8333   do
8334         while test $cf_add_incdir != /usr/include
8335         do
8336           if test -d $cf_add_incdir
8337           then
8338                 cf_have_incdir=no
8339                 if test -n "$CFLAGS$CPPFLAGS" ; then
8340                   # a loop is needed to ensure we can add subdirs of existing dirs
8341                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8342                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8343                           cf_have_incdir=yes; break
8344                         fi
8345                   done
8346                 fi
8347
8348                 if test "$cf_have_incdir" = no ; then
8349                   if test "$cf_add_incdir" = /usr/local/include ; then
8350                         if test "$GCC" = yes
8351                         then
8352                           cf_save_CPPFLAGS=$CPPFLAGS
8353                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8354                           cat >conftest.$ac_ext <<_ACEOF
8355 #line 8355 "configure"
8356 #include "confdefs.h"
8357 #include <stdio.h>
8358 int
8359 main ()
8360 {
8361 printf("Hello")
8362   ;
8363   return 0;
8364 }
8365 _ACEOF
8366 rm -f conftest.$ac_objext
8367 if { (eval echo "$as_me:8367: \"$ac_compile\"") >&5
8368   (eval $ac_compile) 2>&5
8369   ac_status=$?
8370   echo "$as_me:8370: \$? = $ac_status" >&5
8371   (exit $ac_status); } &&
8372          { ac_try='test -s conftest.$ac_objext'
8373   { (eval echo "$as_me:8373: \"$ac_try\"") >&5
8374   (eval $ac_try) 2>&5
8375   ac_status=$?
8376   echo "$as_me:8376: \$? = $ac_status" >&5
8377   (exit $ac_status); }; }; then
8378   :
8379 else
8380   echo "$as_me: failed program was:" >&5
8381 cat conftest.$ac_ext >&5
8382 cf_have_incdir=yes
8383 fi
8384 rm -f conftest.$ac_objext conftest.$ac_ext
8385                           CPPFLAGS=$cf_save_CPPFLAGS
8386                         fi
8387                   fi
8388                 fi
8389
8390                 if test "$cf_have_incdir" = no ; then
8391                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8392
8393 echo "${as_me:-configure}:8393: testing adding $cf_add_incdir to include-path ..." 1>&5
8394
8395                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8396
8397                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8398                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8399                   cf_add_incdir="$cf_top_incdir"
8400                 else
8401                   break
8402                 fi
8403           fi
8404         done
8405   done
8406 fi
8407
8408 fi
8409
8410 # Set definitions to allow ifdef'ing for ncurses.h
8411
8412 case $cf_cv_ncurses_header in
8413 (*ncurses.h)
8414
8415 cat >>confdefs.h <<\EOF
8416 #define HAVE_NCURSES_H 1
8417 EOF
8418
8419         ;;
8420 esac
8421
8422 case $cf_cv_ncurses_header in
8423 (ncurses/curses.h|ncurses/ncurses.h)
8424
8425 cat >>confdefs.h <<\EOF
8426 #define HAVE_NCURSES_NCURSES_H 1
8427 EOF
8428
8429         ;;
8430 (ncursesw/curses.h|ncursesw/ncurses.h)
8431
8432 cat >>confdefs.h <<\EOF
8433 #define HAVE_NCURSESW_NCURSES_H 1
8434 EOF
8435
8436         ;;
8437 esac
8438
8439 echo "$as_me:8439: checking for terminfo header" >&5
8440 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
8441 if test "${cf_cv_term_header+set}" = set; then
8442   echo $ECHO_N "(cached) $ECHO_C" >&6
8443 else
8444
8445 case ${cf_cv_ncurses_header} in
8446 (*/ncurses.h|*/ncursesw.h)
8447         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
8448         ;;
8449 (*)
8450         cf_term_header=term.h
8451         ;;
8452 esac
8453
8454 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
8455 do
8456 cat >conftest.$ac_ext <<_ACEOF
8457 #line 8457 "configure"
8458 #include "confdefs.h"
8459 #include <stdio.h>
8460 #include <${cf_cv_ncurses_header:-curses.h}>
8461 #include <$cf_test>
8462
8463 int
8464 main ()
8465 {
8466 int x = auto_left_margin
8467   ;
8468   return 0;
8469 }
8470 _ACEOF
8471 rm -f conftest.$ac_objext
8472 if { (eval echo "$as_me:8472: \"$ac_compile\"") >&5
8473   (eval $ac_compile) 2>&5
8474   ac_status=$?
8475   echo "$as_me:8475: \$? = $ac_status" >&5
8476   (exit $ac_status); } &&
8477          { ac_try='test -s conftest.$ac_objext'
8478   { (eval echo "$as_me:8478: \"$ac_try\"") >&5
8479   (eval $ac_try) 2>&5
8480   ac_status=$?
8481   echo "$as_me:8481: \$? = $ac_status" >&5
8482   (exit $ac_status); }; }; then
8483
8484         cf_cv_term_header="$cf_test"
8485 else
8486   echo "$as_me: failed program was:" >&5
8487 cat conftest.$ac_ext >&5
8488
8489         cf_cv_term_header=unknown
8490
8491 fi
8492 rm -f conftest.$ac_objext conftest.$ac_ext
8493         test "$cf_cv_term_header" != unknown && break
8494 done
8495
8496 fi
8497 echo "$as_me:8497: result: $cf_cv_term_header" >&5
8498 echo "${ECHO_T}$cf_cv_term_header" >&6
8499
8500 # Set definitions to allow ifdef'ing to accommodate subdirectories
8501
8502 case $cf_cv_term_header in
8503 (*term.h)
8504
8505 cat >>confdefs.h <<\EOF
8506 #define HAVE_TERM_H 1
8507 EOF
8508
8509         ;;
8510 esac
8511
8512 case $cf_cv_term_header in
8513 (ncurses/term.h)
8514
8515 cat >>confdefs.h <<\EOF
8516 #define HAVE_NCURSES_TERM_H 1
8517 EOF
8518
8519         ;;
8520 (ncursesw/term.h)
8521
8522 cat >>confdefs.h <<\EOF
8523 #define HAVE_NCURSESW_TERM_H 1
8524 EOF
8525
8526         ;;
8527 esac
8528
8529 # some applications need this, but should check for NCURSES_VERSION
8530
8531 cat >>confdefs.h <<\EOF
8532 #define NCURSES 1
8533 EOF
8534
8535 echo "$as_me:8535: checking for ncurses version" >&5
8536 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
8537 if test "${cf_cv_ncurses_version+set}" = set; then
8538   echo $ECHO_N "(cached) $ECHO_C" >&6
8539 else
8540
8541         cf_cv_ncurses_version=no
8542         cf_tempfile=out$$
8543         rm -f $cf_tempfile
8544         if test "$cross_compiling" = yes; then
8545
8546         # This will not work if the preprocessor splits the line after the
8547         # Autoconf token.  The 'unproto' program does that.
8548         cat > conftest.$ac_ext <<EOF
8549 #include <${cf_cv_ncurses_header:-curses.h}>
8550 #undef Autoconf
8551 #ifdef NCURSES_VERSION
8552 Autoconf NCURSES_VERSION
8553 #else
8554 #ifdef __NCURSES_H
8555 Autoconf "old"
8556 #endif
8557 ;
8558 #endif
8559 EOF
8560         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
8561         { (eval echo "$as_me:8561: \"$cf_try\"") >&5
8562   (eval $cf_try) 2>&5
8563   ac_status=$?
8564   echo "$as_me:8564: \$? = $ac_status" >&5
8565   (exit $ac_status); }
8566         if test -f conftest.out ; then
8567                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
8568                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
8569                 rm -f conftest.out
8570         fi
8571
8572 else
8573   cat >conftest.$ac_ext <<_ACEOF
8574 #line 8574 "configure"
8575 #include "confdefs.h"
8576
8577 #include <${cf_cv_ncurses_header:-curses.h}>
8578 #include <stdio.h>
8579 int main()
8580 {
8581         FILE *fp = fopen("$cf_tempfile", "w");
8582 #ifdef NCURSES_VERSION
8583 # ifdef NCURSES_VERSION_PATCH
8584         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
8585 # else
8586         fprintf(fp, "%s\n", NCURSES_VERSION);
8587 # endif
8588 #else
8589 # ifdef __NCURSES_H
8590         fprintf(fp, "old\n");
8591 # else
8592         make an error
8593 # endif
8594 #endif
8595         ${cf_cv_main_return:-return}(0);
8596 }
8597 _ACEOF
8598 rm -f conftest$ac_exeext
8599 if { (eval echo "$as_me:8599: \"$ac_link\"") >&5
8600   (eval $ac_link) 2>&5
8601   ac_status=$?
8602   echo "$as_me:8602: \$? = $ac_status" >&5
8603   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
8604   { (eval echo "$as_me:8604: \"$ac_try\"") >&5
8605   (eval $ac_try) 2>&5
8606   ac_status=$?
8607   echo "$as_me:8607: \$? = $ac_status" >&5
8608   (exit $ac_status); }; }; then
8609
8610         cf_cv_ncurses_version=`cat $cf_tempfile`
8611 else
8612   echo "$as_me: program exited with status $ac_status" >&5
8613 echo "$as_me: failed program was:" >&5
8614 cat conftest.$ac_ext >&5
8615 fi
8616 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
8617 fi
8618         rm -f $cf_tempfile
8619
8620 fi
8621 echo "$as_me:8621: result: $cf_cv_ncurses_version" >&5
8622 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
8623 test "$cf_cv_ncurses_version" = no ||
8624 cat >>confdefs.h <<\EOF
8625 #define NCURSES 1
8626 EOF
8627
8628 cf_nculib_root=$cf_cv_screen
8629         # This works, except for the special case where we find gpm, but
8630         # ncurses is in a nonstandard location via $LIBS, and we really want
8631         # to link gpm.
8632 cf_ncurses_LIBS=""
8633 cf_ncurses_SAVE="$LIBS"
8634 echo "$as_me:8634: checking for Gpm_Open in -lgpm" >&5
8635 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
8636 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
8637   echo $ECHO_N "(cached) $ECHO_C" >&6
8638 else
8639   ac_check_lib_save_LIBS=$LIBS
8640 LIBS="-lgpm  $LIBS"
8641 cat >conftest.$ac_ext <<_ACEOF
8642 #line 8642 "configure"
8643 #include "confdefs.h"
8644
8645 /* Override any gcc2 internal prototype to avoid an error.  */
8646 #ifdef __cplusplus
8647 extern "C"
8648 #endif
8649 /* We use char because int might match the return type of a gcc2
8650    builtin and then its argument prototype would still apply.  */
8651 char Gpm_Open ();
8652 int
8653 main ()
8654 {
8655 Gpm_Open ();
8656   ;
8657   return 0;
8658 }
8659 _ACEOF
8660 rm -f conftest.$ac_objext conftest$ac_exeext
8661 if { (eval echo "$as_me:8661: \"$ac_link\"") >&5
8662   (eval $ac_link) 2>&5
8663   ac_status=$?
8664   echo "$as_me:8664: \$? = $ac_status" >&5
8665   (exit $ac_status); } &&
8666          { ac_try='test -s conftest$ac_exeext'
8667   { (eval echo "$as_me:8667: \"$ac_try\"") >&5
8668   (eval $ac_try) 2>&5
8669   ac_status=$?
8670   echo "$as_me:8670: \$? = $ac_status" >&5
8671   (exit $ac_status); }; }; then
8672   ac_cv_lib_gpm_Gpm_Open=yes
8673 else
8674   echo "$as_me: failed program was:" >&5
8675 cat conftest.$ac_ext >&5
8676 ac_cv_lib_gpm_Gpm_Open=no
8677 fi
8678 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8679 LIBS=$ac_check_lib_save_LIBS
8680 fi
8681 echo "$as_me:8681: result: $ac_cv_lib_gpm_Gpm_Open" >&5
8682 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
8683 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
8684   echo "$as_me:8684: checking for initscr in -lgpm" >&5
8685 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
8686 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
8687   echo $ECHO_N "(cached) $ECHO_C" >&6
8688 else
8689   ac_check_lib_save_LIBS=$LIBS
8690 LIBS="-lgpm  $LIBS"
8691 cat >conftest.$ac_ext <<_ACEOF
8692 #line 8692 "configure"
8693 #include "confdefs.h"
8694
8695 /* Override any gcc2 internal prototype to avoid an error.  */
8696 #ifdef __cplusplus
8697 extern "C"
8698 #endif
8699 /* We use char because int might match the return type of a gcc2
8700    builtin and then its argument prototype would still apply.  */
8701 char initscr ();
8702 int
8703 main ()
8704 {
8705 initscr ();
8706   ;
8707   return 0;
8708 }
8709 _ACEOF
8710 rm -f conftest.$ac_objext conftest$ac_exeext
8711 if { (eval echo "$as_me:8711: \"$ac_link\"") >&5
8712   (eval $ac_link) 2>&5
8713   ac_status=$?
8714   echo "$as_me:8714: \$? = $ac_status" >&5
8715   (exit $ac_status); } &&
8716          { ac_try='test -s conftest$ac_exeext'
8717   { (eval echo "$as_me:8717: \"$ac_try\"") >&5
8718   (eval $ac_try) 2>&5
8719   ac_status=$?
8720   echo "$as_me:8720: \$? = $ac_status" >&5
8721   (exit $ac_status); }; }; then
8722   ac_cv_lib_gpm_initscr=yes
8723 else
8724   echo "$as_me: failed program was:" >&5
8725 cat conftest.$ac_ext >&5
8726 ac_cv_lib_gpm_initscr=no
8727 fi
8728 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8729 LIBS=$ac_check_lib_save_LIBS
8730 fi
8731 echo "$as_me:8731: result: $ac_cv_lib_gpm_initscr" >&5
8732 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
8733 if test $ac_cv_lib_gpm_initscr = yes; then
8734   LIBS="$cf_ncurses_SAVE"
8735 else
8736   cf_ncurses_LIBS="-lgpm"
8737 fi
8738
8739 fi
8740
8741 case $host_os in
8742 (freebsd*)
8743         # This is only necessary if you are linking against an obsolete
8744         # version of ncurses (but it should do no harm, since it's static).
8745         if test "$cf_nculib_root" = ncurses ; then
8746                 echo "$as_me:8746: checking for tgoto in -lmytinfo" >&5
8747 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
8748 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
8749   echo $ECHO_N "(cached) $ECHO_C" >&6
8750 else
8751   ac_check_lib_save_LIBS=$LIBS
8752 LIBS="-lmytinfo  $LIBS"
8753 cat >conftest.$ac_ext <<_ACEOF
8754 #line 8754 "configure"
8755 #include "confdefs.h"
8756
8757 /* Override any gcc2 internal prototype to avoid an error.  */
8758 #ifdef __cplusplus
8759 extern "C"
8760 #endif
8761 /* We use char because int might match the return type of a gcc2
8762    builtin and then its argument prototype would still apply.  */
8763 char tgoto ();
8764 int
8765 main ()
8766 {
8767 tgoto ();
8768   ;
8769   return 0;
8770 }
8771 _ACEOF
8772 rm -f conftest.$ac_objext conftest$ac_exeext
8773 if { (eval echo "$as_me:8773: \"$ac_link\"") >&5
8774   (eval $ac_link) 2>&5
8775   ac_status=$?
8776   echo "$as_me:8776: \$? = $ac_status" >&5
8777   (exit $ac_status); } &&
8778          { ac_try='test -s conftest$ac_exeext'
8779   { (eval echo "$as_me:8779: \"$ac_try\"") >&5
8780   (eval $ac_try) 2>&5
8781   ac_status=$?
8782   echo "$as_me:8782: \$? = $ac_status" >&5
8783   (exit $ac_status); }; }; then
8784   ac_cv_lib_mytinfo_tgoto=yes
8785 else
8786   echo "$as_me: failed program was:" >&5
8787 cat conftest.$ac_ext >&5
8788 ac_cv_lib_mytinfo_tgoto=no
8789 fi
8790 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8791 LIBS=$ac_check_lib_save_LIBS
8792 fi
8793 echo "$as_me:8793: result: $ac_cv_lib_mytinfo_tgoto" >&5
8794 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
8795 if test $ac_cv_lib_mytinfo_tgoto = yes; then
8796   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
8797 fi
8798
8799         fi
8800         ;;
8801 esac
8802
8803 cf_add_libs="$cf_ncurses_LIBS"
8804 # Filter out duplicates - this happens with badly-designed ".pc" files...
8805 for cf_add_1lib in $LIBS
8806 do
8807         for cf_add_2lib in $cf_add_libs
8808         do
8809                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
8810                 then
8811                         cf_add_1lib=
8812                         break
8813                 fi
8814         done
8815         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
8816 done
8817 LIBS="$cf_add_libs"
8818
8819 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
8820 then
8821
8822 cf_add_libs="-l$cf_nculib_root"
8823 # Filter out duplicates - this happens with badly-designed ".pc" files...
8824 for cf_add_1lib in $LIBS
8825 do
8826         for cf_add_2lib in $cf_add_libs
8827         do
8828                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
8829                 then
8830                         cf_add_1lib=
8831                         break
8832                 fi
8833         done
8834         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
8835 done
8836 LIBS="$cf_add_libs"
8837
8838 else
8839
8840         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
8841         cf_libdir=""
8842         echo "$as_me:8842: checking for initscr" >&5
8843 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
8844 if test "${ac_cv_func_initscr+set}" = set; then
8845   echo $ECHO_N "(cached) $ECHO_C" >&6
8846 else
8847   cat >conftest.$ac_ext <<_ACEOF
8848 #line 8848 "configure"
8849 #include "confdefs.h"
8850 /* System header to define __stub macros and hopefully few prototypes,
8851     which can conflict with char initscr (); below.  */
8852 #include <assert.h>
8853 /* Override any gcc2 internal prototype to avoid an error.  */
8854 #ifdef __cplusplus
8855 extern "C"
8856 #endif
8857 /* We use char because int might match the return type of a gcc2
8858    builtin and then its argument prototype would still apply.  */
8859 char initscr ();
8860 char (*f) ();
8861
8862 int
8863 main ()
8864 {
8865 /* The GNU C library defines this for functions which it implements
8866     to always fail with ENOSYS.  Some functions are actually named
8867     something starting with __ and the normal name is an alias.  */
8868 #if defined (__stub_initscr) || defined (__stub___initscr)
8869 choke me
8870 #else
8871 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
8872 #endif
8873
8874   ;
8875   return 0;
8876 }
8877 _ACEOF
8878 rm -f conftest.$ac_objext conftest$ac_exeext
8879 if { (eval echo "$as_me:8879: \"$ac_link\"") >&5
8880   (eval $ac_link) 2>&5
8881   ac_status=$?
8882   echo "$as_me:8882: \$? = $ac_status" >&5
8883   (exit $ac_status); } &&
8884          { ac_try='test -s conftest$ac_exeext'
8885   { (eval echo "$as_me:8885: \"$ac_try\"") >&5
8886   (eval $ac_try) 2>&5
8887   ac_status=$?
8888   echo "$as_me:8888: \$? = $ac_status" >&5
8889   (exit $ac_status); }; }; then
8890   ac_cv_func_initscr=yes
8891 else
8892   echo "$as_me: failed program was:" >&5
8893 cat conftest.$ac_ext >&5
8894 ac_cv_func_initscr=no
8895 fi
8896 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8897 fi
8898 echo "$as_me:8898: result: $ac_cv_func_initscr" >&5
8899 echo "${ECHO_T}$ac_cv_func_initscr" >&6
8900 if test $ac_cv_func_initscr = yes; then
8901   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8902 else
8903
8904                 cf_save_LIBS="$LIBS"
8905                 echo "$as_me:8905: checking for initscr in -l$cf_nculib_root" >&5
8906 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
8907                 LIBS="-l$cf_nculib_root $LIBS"
8908                 cat >conftest.$ac_ext <<_ACEOF
8909 #line 8909 "configure"
8910 #include "confdefs.h"
8911 #include <${cf_cv_ncurses_header:-curses.h}>
8912 int
8913 main ()
8914 {
8915 initscr()
8916   ;
8917   return 0;
8918 }
8919 _ACEOF
8920 rm -f conftest.$ac_objext conftest$ac_exeext
8921 if { (eval echo "$as_me:8921: \"$ac_link\"") >&5
8922   (eval $ac_link) 2>&5
8923   ac_status=$?
8924   echo "$as_me:8924: \$? = $ac_status" >&5
8925   (exit $ac_status); } &&
8926          { ac_try='test -s conftest$ac_exeext'
8927   { (eval echo "$as_me:8927: \"$ac_try\"") >&5
8928   (eval $ac_try) 2>&5
8929   ac_status=$?
8930   echo "$as_me:8930: \$? = $ac_status" >&5
8931   (exit $ac_status); }; }; then
8932   echo "$as_me:8932: result: yes" >&5
8933 echo "${ECHO_T}yes" >&6
8934                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8935
8936 else
8937   echo "$as_me: failed program was:" >&5
8938 cat conftest.$ac_ext >&5
8939 echo "$as_me:8939: result: no" >&5
8940 echo "${ECHO_T}no" >&6
8941
8942 cf_search=
8943 cf_library_path_list=""
8944 if test -n "${LDFLAGS}${LIBS}" ; then
8945         for cf_library_path in $LDFLAGS $LIBS
8946         do
8947                 case $cf_library_path in
8948                 (-L*)
8949                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
8950
8951 test "x$cf_library_path" != "xNONE" && \
8952 test -d "$cf_library_path" && \
8953  {
8954         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
8955         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
8956         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
8957         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
8958         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
8959         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"
8960 }
8961
8962                         cf_library_path_list="$cf_library_path_list $cf_search"
8963                         ;;
8964                 esac
8965         done
8966 fi
8967
8968 cf_search=
8969
8970 test "x$prefix" != "xNONE" && \
8971 test -d "$prefix" && \
8972  {
8973         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
8974         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
8975         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
8976         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
8977         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
8978         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
8979 }
8980
8981 for cf_subdir_prefix in \
8982         /usr \
8983         /usr/local \
8984         /usr/pkg \
8985         /opt \
8986         /opt/local \
8987         $HOME
8988 do
8989
8990 test "x$cf_subdir_prefix" != "x$prefix" && \
8991 test -d "$cf_subdir_prefix" && \
8992 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
8993         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
8994         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
8995         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
8996         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
8997         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
8998         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"
8999 }
9000
9001 done
9002
9003 cf_search="$cf_library_path_list $cf_search"
9004
9005                         for cf_libdir in $cf_search
9006                         do
9007                                 echo "$as_me:9007: checking for -l$cf_nculib_root in $cf_libdir" >&5
9008 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
9009                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
9010                                 cat >conftest.$ac_ext <<_ACEOF
9011 #line 9011 "configure"
9012 #include "confdefs.h"
9013 #include <${cf_cv_ncurses_header:-curses.h}>
9014 int
9015 main ()
9016 {
9017 initscr()
9018   ;
9019   return 0;
9020 }
9021 _ACEOF
9022 rm -f conftest.$ac_objext conftest$ac_exeext
9023 if { (eval echo "$as_me:9023: \"$ac_link\"") >&5
9024   (eval $ac_link) 2>&5
9025   ac_status=$?
9026   echo "$as_me:9026: \$? = $ac_status" >&5
9027   (exit $ac_status); } &&
9028          { ac_try='test -s conftest$ac_exeext'
9029   { (eval echo "$as_me:9029: \"$ac_try\"") >&5
9030   (eval $ac_try) 2>&5
9031   ac_status=$?
9032   echo "$as_me:9032: \$? = $ac_status" >&5
9033   (exit $ac_status); }; }; then
9034   echo "$as_me:9034: result: yes" >&5
9035 echo "${ECHO_T}yes" >&6
9036                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9037                                          break
9038 else
9039   echo "$as_me: failed program was:" >&5
9040 cat conftest.$ac_ext >&5
9041 echo "$as_me:9041: result: no" >&5
9042 echo "${ECHO_T}no" >&6
9043                                          LIBS="$cf_save_LIBS"
9044 fi
9045 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9046                         done
9047
9048 fi
9049 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9050
9051 fi
9052
9053 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
9054
9055 if test $cf_found_library = no ; then
9056         { { echo "$as_me:9056: error: Cannot link $cf_nculib_root library" >&5
9057 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
9058    { (exit 1); exit 1; }; }
9059 fi
9060
9061 fi
9062
9063 if test -n "$cf_ncurses_LIBS" ; then
9064         echo "$as_me:9064: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
9065 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
9066         cf_ncurses_SAVE="$LIBS"
9067         for p in $cf_ncurses_LIBS ; do
9068                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
9069                 if test "$q" != "$LIBS" ; then
9070                         LIBS="$q"
9071                 fi
9072         done
9073         cat >conftest.$ac_ext <<_ACEOF
9074 #line 9074 "configure"
9075 #include "confdefs.h"
9076 #include <${cf_cv_ncurses_header:-curses.h}>
9077 int
9078 main ()
9079 {
9080 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
9081   ;
9082   return 0;
9083 }
9084 _ACEOF
9085 rm -f conftest.$ac_objext conftest$ac_exeext
9086 if { (eval echo "$as_me:9086: \"$ac_link\"") >&5
9087   (eval $ac_link) 2>&5
9088   ac_status=$?
9089   echo "$as_me:9089: \$? = $ac_status" >&5
9090   (exit $ac_status); } &&
9091          { ac_try='test -s conftest$ac_exeext'
9092   { (eval echo "$as_me:9092: \"$ac_try\"") >&5
9093   (eval $ac_try) 2>&5
9094   ac_status=$?
9095   echo "$as_me:9095: \$? = $ac_status" >&5
9096   (exit $ac_status); }; }; then
9097   echo "$as_me:9097: result: yes" >&5
9098 echo "${ECHO_T}yes" >&6
9099 else
9100   echo "$as_me: failed program was:" >&5
9101 cat conftest.$ac_ext >&5
9102 echo "$as_me:9102: result: no" >&5
9103 echo "${ECHO_T}no" >&6
9104                  LIBS="$cf_ncurses_SAVE"
9105 fi
9106 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9107 fi
9108
9109 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9110
9111 cat >>confdefs.h <<EOF
9112 #define $cf_nculib_ROOT 1
9113 EOF
9114
9115         fi
9116 fi
9117
9118         ;;
9119 (pdcurses)
9120         echo "$as_me:9120: checking for X" >&5
9121 echo $ECHO_N "checking for X... $ECHO_C" >&6
9122
9123 # Check whether --with-x or --without-x was given.
9124 if test "${with_x+set}" = set; then
9125   withval="$with_x"
9126
9127 fi;
9128 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
9129 if test "x$with_x" = xno; then
9130   # The user explicitly disabled X.
9131   have_x=disabled
9132 else
9133   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
9134     # Both variables are already set.
9135     have_x=yes
9136   else
9137     if test "${ac_cv_have_x+set}" = set; then
9138   echo $ECHO_N "(cached) $ECHO_C" >&6
9139 else
9140   # One or both of the vars are not set, and there is no cached value.
9141 ac_x_includes=no ac_x_libraries=no
9142 rm -fr conftest.dir
9143 if mkdir conftest.dir; then
9144   cd conftest.dir
9145   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
9146   cat >Imakefile <<'EOF'
9147 acfindx:
9148         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
9149 EOF
9150   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
9151     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
9152     eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
9153     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
9154     for ac_extension in a so sl dylib dll; do
9155       if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
9156          test -f $ac_im_libdir/libX11.$ac_extension; then
9157         ac_im_usrlibdir=$ac_im_libdir; break
9158       fi
9159     done
9160     # Screen out bogus values from the imake configuration.  They are
9161     # bogus both because they are the default anyway, and because
9162     # using them would break gcc on systems where it needs fixed includes.
9163     case $ac_im_incroot in
9164         /usr/include) ;;
9165         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
9166     esac
9167     case $ac_im_usrlibdir in
9168         /usr/lib | /lib) ;;
9169         *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
9170     esac
9171   fi
9172   cd ..
9173   rm -fr conftest.dir
9174 fi
9175
9176 # Standard set of common directories for X headers.
9177 # Check X11 before X11Rn because it is often a symlink to the current release.
9178 ac_x_header_dirs='
9179 /usr/X11/include
9180 /usr/X11R6/include
9181 /usr/X11R5/include
9182 /usr/X11R4/include
9183
9184 /usr/include/X11
9185 /usr/include/X11R6
9186 /usr/include/X11R5
9187 /usr/include/X11R4
9188
9189 /usr/local/X11/include
9190 /usr/local/X11R6/include
9191 /usr/local/X11R5/include
9192 /usr/local/X11R4/include
9193
9194 /usr/local/include/X11
9195 /usr/local/include/X11R6
9196 /usr/local/include/X11R5
9197 /usr/local/include/X11R4
9198
9199 /usr/X386/include
9200 /usr/x386/include
9201 /usr/XFree86/include/X11
9202
9203 /usr/include
9204 /usr/local/include
9205 /usr/unsupported/include
9206 /usr/athena/include
9207 /usr/local/x11r5/include
9208 /usr/lpp/Xamples/include
9209
9210 /usr/openwin/include
9211 /usr/openwin/share/include'
9212
9213 if test "$ac_x_includes" = no; then
9214   # Guess where to find include files, by looking for Intrinsic.h.
9215   # First, try using that file with no special directory specified.
9216   cat >conftest.$ac_ext <<_ACEOF
9217 #line 9217 "configure"
9218 #include "confdefs.h"
9219 #include <X11/Intrinsic.h>
9220 _ACEOF
9221 if { (eval echo "$as_me:9221: \"$ac_cpp conftest.$ac_ext\"") >&5
9222   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
9223   ac_status=$?
9224   egrep -v '^ *\+' conftest.er1 >conftest.err
9225   rm -f conftest.er1
9226   cat conftest.err >&5
9227   echo "$as_me:9227: \$? = $ac_status" >&5
9228   (exit $ac_status); } >/dev/null; then
9229   if test -s conftest.err; then
9230     ac_cpp_err=$ac_c_preproc_warn_flag
9231   else
9232     ac_cpp_err=
9233   fi
9234 else
9235   ac_cpp_err=yes
9236 fi
9237 if test -z "$ac_cpp_err"; then
9238   # We can compile using X headers with no special include directory.
9239 ac_x_includes=
9240 else
9241   echo "$as_me: failed program was:" >&5
9242   cat conftest.$ac_ext >&5
9243   for ac_dir in $ac_x_header_dirs; do
9244   if test -r "$ac_dir/X11/Intrinsic.h"; then
9245     ac_x_includes=$ac_dir
9246     break
9247   fi
9248 done
9249 fi
9250 rm -f conftest.err conftest.$ac_ext
9251 fi # $ac_x_includes = no
9252
9253 if test "$ac_x_libraries" = no; then
9254   # Check for the libraries.
9255   # See if we find them without any special options.
9256   # Don't add to $LIBS permanently.
9257   ac_save_LIBS=$LIBS
9258   LIBS="-lXt $LIBS"
9259   cat >conftest.$ac_ext <<_ACEOF
9260 #line 9260 "configure"
9261 #include "confdefs.h"
9262 #include <X11/Intrinsic.h>
9263 int
9264 main ()
9265 {
9266 XtMalloc (0)
9267   ;
9268   return 0;
9269 }
9270 _ACEOF
9271 rm -f conftest.$ac_objext conftest$ac_exeext
9272 if { (eval echo "$as_me:9272: \"$ac_link\"") >&5
9273   (eval $ac_link) 2>&5
9274   ac_status=$?
9275   echo "$as_me:9275: \$? = $ac_status" >&5
9276   (exit $ac_status); } &&
9277          { ac_try='test -s conftest$ac_exeext'
9278   { (eval echo "$as_me:9278: \"$ac_try\"") >&5
9279   (eval $ac_try) 2>&5
9280   ac_status=$?
9281   echo "$as_me:9281: \$? = $ac_status" >&5
9282   (exit $ac_status); }; }; then
9283   LIBS=$ac_save_LIBS
9284 # We can link X programs with no special library path.
9285 ac_x_libraries=
9286 else
9287   echo "$as_me: failed program was:" >&5
9288 cat conftest.$ac_ext >&5
9289 LIBS=$ac_save_LIBS
9290 for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
9291 do
9292   # Don't even attempt the hair of trying to link an X program!
9293   for ac_extension in a so sl dylib dll; do
9294     if test -r $ac_dir/libXt.$ac_extension; then
9295       ac_x_libraries=$ac_dir
9296       break 2
9297     fi
9298   done
9299 done
9300 fi
9301 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9302 fi # $ac_x_libraries = no
9303
9304 if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then
9305   # Didn't find X anywhere.  Cache the known absence of X.
9306   ac_cv_have_x="have_x=no"
9307 else
9308   # Record where we found X for the cache.
9309   ac_cv_have_x="have_x=yes \
9310                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
9311 fi
9312 fi
9313
9314   fi
9315   eval "$ac_cv_have_x"
9316 fi # $with_x != no
9317
9318 if test "$have_x" != yes; then
9319   echo "$as_me:9319: result: $have_x" >&5
9320 echo "${ECHO_T}$have_x" >&6
9321   no_x=yes
9322 else
9323   # If each of the values was on the command line, it overrides each guess.
9324   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
9325   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
9326   # Update the cache value to reflect the command line values.
9327   ac_cv_have_x="have_x=yes \
9328                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
9329   echo "$as_me:9329: result: libraries $x_libraries, headers $x_includes" >&5
9330 echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6
9331 fi
9332
9333 if test "$no_x" = yes; then
9334   # Not all programs may use this symbol, but it does not hurt to define it.
9335
9336 cat >>confdefs.h <<\EOF
9337 #define X_DISPLAY_MISSING 1
9338 EOF
9339
9340   X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
9341 else
9342   if test -n "$x_includes"; then
9343     X_CFLAGS="$X_CFLAGS -I$x_includes"
9344   fi
9345
9346   # It would also be nice to do this for all -L options, not just this one.
9347   if test -n "$x_libraries"; then
9348     X_LIBS="$X_LIBS -L$x_libraries"
9349     # For Solaris; some versions of Sun CC require a space after -R and
9350     # others require no space.  Words are not sufficient . . . .
9351     case `(uname -sr) 2>/dev/null` in
9352     "SunOS 5"*)
9353       echo "$as_me:9353: checking whether -R must be followed by a space" >&5
9354 echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6
9355       ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
9356       cat >conftest.$ac_ext <<_ACEOF
9357 #line 9357 "configure"
9358 #include "confdefs.h"
9359
9360 int
9361 main ()
9362 {
9363
9364   ;
9365   return 0;
9366 }
9367 _ACEOF
9368 rm -f conftest.$ac_objext conftest$ac_exeext
9369 if { (eval echo "$as_me:9369: \"$ac_link\"") >&5
9370   (eval $ac_link) 2>&5
9371   ac_status=$?
9372   echo "$as_me:9372: \$? = $ac_status" >&5
9373   (exit $ac_status); } &&
9374          { ac_try='test -s conftest$ac_exeext'
9375   { (eval echo "$as_me:9375: \"$ac_try\"") >&5
9376   (eval $ac_try) 2>&5
9377   ac_status=$?
9378   echo "$as_me:9378: \$? = $ac_status" >&5
9379   (exit $ac_status); }; }; then
9380   ac_R_nospace=yes
9381 else
9382   echo "$as_me: failed program was:" >&5
9383 cat conftest.$ac_ext >&5
9384 ac_R_nospace=no
9385 fi
9386 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9387       if test $ac_R_nospace = yes; then
9388         echo "$as_me:9388: result: no" >&5
9389 echo "${ECHO_T}no" >&6
9390         X_LIBS="$X_LIBS -R$x_libraries"
9391       else
9392         LIBS="$ac_xsave_LIBS -R $x_libraries"
9393         cat >conftest.$ac_ext <<_ACEOF
9394 #line 9394 "configure"
9395 #include "confdefs.h"
9396
9397 int
9398 main ()
9399 {
9400
9401   ;
9402   return 0;
9403 }
9404 _ACEOF
9405 rm -f conftest.$ac_objext conftest$ac_exeext
9406 if { (eval echo "$as_me:9406: \"$ac_link\"") >&5
9407   (eval $ac_link) 2>&5
9408   ac_status=$?
9409   echo "$as_me:9409: \$? = $ac_status" >&5
9410   (exit $ac_status); } &&
9411          { ac_try='test -s conftest$ac_exeext'
9412   { (eval echo "$as_me:9412: \"$ac_try\"") >&5
9413   (eval $ac_try) 2>&5
9414   ac_status=$?
9415   echo "$as_me:9415: \$? = $ac_status" >&5
9416   (exit $ac_status); }; }; then
9417   ac_R_space=yes
9418 else
9419   echo "$as_me: failed program was:" >&5
9420 cat conftest.$ac_ext >&5
9421 ac_R_space=no
9422 fi
9423 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9424         if test $ac_R_space = yes; then
9425           echo "$as_me:9425: result: yes" >&5
9426 echo "${ECHO_T}yes" >&6
9427           X_LIBS="$X_LIBS -R $x_libraries"
9428         else
9429           echo "$as_me:9429: result: neither works" >&5
9430 echo "${ECHO_T}neither works" >&6
9431         fi
9432       fi
9433       LIBS=$ac_xsave_LIBS
9434     esac
9435   fi
9436
9437   # Check for system-dependent libraries X programs must link with.
9438   # Do this before checking for the system-independent R6 libraries
9439   # (-lICE), since we may need -lsocket or whatever for X linking.
9440
9441   if test "$ISC" = yes; then
9442     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
9443   else
9444     # Martyn Johnson says this is needed for Ultrix, if the X
9445     # libraries were built with DECnet support.  And Karl Berry says
9446     # the Alpha needs dnet_stub (dnet does not exist).
9447     ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
9448     cat >conftest.$ac_ext <<_ACEOF
9449 #line 9449 "configure"
9450 #include "confdefs.h"
9451
9452 /* Override any gcc2 internal prototype to avoid an error.  */
9453 #ifdef __cplusplus
9454 extern "C"
9455 #endif
9456 /* We use char because int might match the return type of a gcc2
9457    builtin and then its argument prototype would still apply.  */
9458 char XOpenDisplay ();
9459 int
9460 main ()
9461 {
9462 XOpenDisplay ();
9463   ;
9464   return 0;
9465 }
9466 _ACEOF
9467 rm -f conftest.$ac_objext conftest$ac_exeext
9468 if { (eval echo "$as_me:9468: \"$ac_link\"") >&5
9469   (eval $ac_link) 2>&5
9470   ac_status=$?
9471   echo "$as_me:9471: \$? = $ac_status" >&5
9472   (exit $ac_status); } &&
9473          { ac_try='test -s conftest$ac_exeext'
9474   { (eval echo "$as_me:9474: \"$ac_try\"") >&5
9475   (eval $ac_try) 2>&5
9476   ac_status=$?
9477   echo "$as_me:9477: \$? = $ac_status" >&5
9478   (exit $ac_status); }; }; then
9479   :
9480 else
9481   echo "$as_me: failed program was:" >&5
9482 cat conftest.$ac_ext >&5
9483 echo "$as_me:9483: checking for dnet_ntoa in -ldnet" >&5
9484 echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6
9485 if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then
9486   echo $ECHO_N "(cached) $ECHO_C" >&6
9487 else
9488   ac_check_lib_save_LIBS=$LIBS
9489 LIBS="-ldnet  $LIBS"
9490 cat >conftest.$ac_ext <<_ACEOF
9491 #line 9491 "configure"
9492 #include "confdefs.h"
9493
9494 /* Override any gcc2 internal prototype to avoid an error.  */
9495 #ifdef __cplusplus
9496 extern "C"
9497 #endif
9498 /* We use char because int might match the return type of a gcc2
9499    builtin and then its argument prototype would still apply.  */
9500 char dnet_ntoa ();
9501 int
9502 main ()
9503 {
9504 dnet_ntoa ();
9505   ;
9506   return 0;
9507 }
9508 _ACEOF
9509 rm -f conftest.$ac_objext conftest$ac_exeext
9510 if { (eval echo "$as_me:9510: \"$ac_link\"") >&5
9511   (eval $ac_link) 2>&5
9512   ac_status=$?
9513   echo "$as_me:9513: \$? = $ac_status" >&5
9514   (exit $ac_status); } &&
9515          { ac_try='test -s conftest$ac_exeext'
9516   { (eval echo "$as_me:9516: \"$ac_try\"") >&5
9517   (eval $ac_try) 2>&5
9518   ac_status=$?
9519   echo "$as_me:9519: \$? = $ac_status" >&5
9520   (exit $ac_status); }; }; then
9521   ac_cv_lib_dnet_dnet_ntoa=yes
9522 else
9523   echo "$as_me: failed program was:" >&5
9524 cat conftest.$ac_ext >&5
9525 ac_cv_lib_dnet_dnet_ntoa=no
9526 fi
9527 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9528 LIBS=$ac_check_lib_save_LIBS
9529 fi
9530 echo "$as_me:9530: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
9531 echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6
9532 if test $ac_cv_lib_dnet_dnet_ntoa = yes; then
9533   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
9534 fi
9535
9536     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
9537       echo "$as_me:9537: checking for dnet_ntoa in -ldnet_stub" >&5
9538 echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6
9539 if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then
9540   echo $ECHO_N "(cached) $ECHO_C" >&6
9541 else
9542   ac_check_lib_save_LIBS=$LIBS
9543 LIBS="-ldnet_stub  $LIBS"
9544 cat >conftest.$ac_ext <<_ACEOF
9545 #line 9545 "configure"
9546 #include "confdefs.h"
9547
9548 /* Override any gcc2 internal prototype to avoid an error.  */
9549 #ifdef __cplusplus
9550 extern "C"
9551 #endif
9552 /* We use char because int might match the return type of a gcc2
9553    builtin and then its argument prototype would still apply.  */
9554 char dnet_ntoa ();
9555 int
9556 main ()
9557 {
9558 dnet_ntoa ();
9559   ;
9560   return 0;
9561 }
9562 _ACEOF
9563 rm -f conftest.$ac_objext conftest$ac_exeext
9564 if { (eval echo "$as_me:9564: \"$ac_link\"") >&5
9565   (eval $ac_link) 2>&5
9566   ac_status=$?
9567   echo "$as_me:9567: \$? = $ac_status" >&5
9568   (exit $ac_status); } &&
9569          { ac_try='test -s conftest$ac_exeext'
9570   { (eval echo "$as_me:9570: \"$ac_try\"") >&5
9571   (eval $ac_try) 2>&5
9572   ac_status=$?
9573   echo "$as_me:9573: \$? = $ac_status" >&5
9574   (exit $ac_status); }; }; then
9575   ac_cv_lib_dnet_stub_dnet_ntoa=yes
9576 else
9577   echo "$as_me: failed program was:" >&5
9578 cat conftest.$ac_ext >&5
9579 ac_cv_lib_dnet_stub_dnet_ntoa=no
9580 fi
9581 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9582 LIBS=$ac_check_lib_save_LIBS
9583 fi
9584 echo "$as_me:9584: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
9585 echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6
9586 if test $ac_cv_lib_dnet_stub_dnet_ntoa = yes; then
9587   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
9588 fi
9589
9590     fi
9591 fi
9592 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9593     LIBS="$ac_xsave_LIBS"
9594
9595     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
9596     # to get the SysV transport functions.
9597     # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4)
9598     # needs -lnsl.
9599     # The nsl library prevents programs from opening the X display
9600     # on Irix 5.2, according to T.E. Dickey.
9601     # The functions gethostbyname, getservbyname, and inet_addr are
9602     # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
9603     echo "$as_me:9603: checking for gethostbyname" >&5
9604 echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6
9605 if test "${ac_cv_func_gethostbyname+set}" = set; then
9606   echo $ECHO_N "(cached) $ECHO_C" >&6
9607 else
9608   cat >conftest.$ac_ext <<_ACEOF
9609 #line 9609 "configure"
9610 #include "confdefs.h"
9611 /* System header to define __stub macros and hopefully few prototypes,
9612     which can conflict with char gethostbyname (); below.  */
9613 #include <assert.h>
9614 /* Override any gcc2 internal prototype to avoid an error.  */
9615 #ifdef __cplusplus
9616 extern "C"
9617 #endif
9618 /* We use char because int might match the return type of a gcc2
9619    builtin and then its argument prototype would still apply.  */
9620 char gethostbyname ();
9621 char (*f) ();
9622
9623 int
9624 main ()
9625 {
9626 /* The GNU C library defines this for functions which it implements
9627     to always fail with ENOSYS.  Some functions are actually named
9628     something starting with __ and the normal name is an alias.  */
9629 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
9630 choke me
9631 #else
9632 f = gethostbyname; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
9633 #endif
9634
9635   ;
9636   return 0;
9637 }
9638 _ACEOF
9639 rm -f conftest.$ac_objext conftest$ac_exeext
9640 if { (eval echo "$as_me:9640: \"$ac_link\"") >&5
9641   (eval $ac_link) 2>&5
9642   ac_status=$?
9643   echo "$as_me:9643: \$? = $ac_status" >&5
9644   (exit $ac_status); } &&
9645          { ac_try='test -s conftest$ac_exeext'
9646   { (eval echo "$as_me:9646: \"$ac_try\"") >&5
9647   (eval $ac_try) 2>&5
9648   ac_status=$?
9649   echo "$as_me:9649: \$? = $ac_status" >&5
9650   (exit $ac_status); }; }; then
9651   ac_cv_func_gethostbyname=yes
9652 else
9653   echo "$as_me: failed program was:" >&5
9654 cat conftest.$ac_ext >&5
9655 ac_cv_func_gethostbyname=no
9656 fi
9657 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9658 fi
9659 echo "$as_me:9659: result: $ac_cv_func_gethostbyname" >&5
9660 echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6
9661
9662     if test $ac_cv_func_gethostbyname = no; then
9663       echo "$as_me:9663: checking for gethostbyname in -lnsl" >&5
9664 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6
9665 if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
9666   echo $ECHO_N "(cached) $ECHO_C" >&6
9667 else
9668   ac_check_lib_save_LIBS=$LIBS
9669 LIBS="-lnsl  $LIBS"
9670 cat >conftest.$ac_ext <<_ACEOF
9671 #line 9671 "configure"
9672 #include "confdefs.h"
9673
9674 /* Override any gcc2 internal prototype to avoid an error.  */
9675 #ifdef __cplusplus
9676 extern "C"
9677 #endif
9678 /* We use char because int might match the return type of a gcc2
9679    builtin and then its argument prototype would still apply.  */
9680 char gethostbyname ();
9681 int
9682 main ()
9683 {
9684 gethostbyname ();
9685   ;
9686   return 0;
9687 }
9688 _ACEOF
9689 rm -f conftest.$ac_objext conftest$ac_exeext
9690 if { (eval echo "$as_me:9690: \"$ac_link\"") >&5
9691   (eval $ac_link) 2>&5
9692   ac_status=$?
9693   echo "$as_me:9693: \$? = $ac_status" >&5
9694   (exit $ac_status); } &&
9695          { ac_try='test -s conftest$ac_exeext'
9696   { (eval echo "$as_me:9696: \"$ac_try\"") >&5
9697   (eval $ac_try) 2>&5
9698   ac_status=$?
9699   echo "$as_me:9699: \$? = $ac_status" >&5
9700   (exit $ac_status); }; }; then
9701   ac_cv_lib_nsl_gethostbyname=yes
9702 else
9703   echo "$as_me: failed program was:" >&5
9704 cat conftest.$ac_ext >&5
9705 ac_cv_lib_nsl_gethostbyname=no
9706 fi
9707 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9708 LIBS=$ac_check_lib_save_LIBS
9709 fi
9710 echo "$as_me:9710: result: $ac_cv_lib_nsl_gethostbyname" >&5
9711 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6
9712 if test $ac_cv_lib_nsl_gethostbyname = yes; then
9713   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
9714 fi
9715
9716       if test $ac_cv_lib_nsl_gethostbyname = no; then
9717         echo "$as_me:9717: checking for gethostbyname in -lbsd" >&5
9718 echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6
9719 if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then
9720   echo $ECHO_N "(cached) $ECHO_C" >&6
9721 else
9722   ac_check_lib_save_LIBS=$LIBS
9723 LIBS="-lbsd  $LIBS"
9724 cat >conftest.$ac_ext <<_ACEOF
9725 #line 9725 "configure"
9726 #include "confdefs.h"
9727
9728 /* Override any gcc2 internal prototype to avoid an error.  */
9729 #ifdef __cplusplus
9730 extern "C"
9731 #endif
9732 /* We use char because int might match the return type of a gcc2
9733    builtin and then its argument prototype would still apply.  */
9734 char gethostbyname ();
9735 int
9736 main ()
9737 {
9738 gethostbyname ();
9739   ;
9740   return 0;
9741 }
9742 _ACEOF
9743 rm -f conftest.$ac_objext conftest$ac_exeext
9744 if { (eval echo "$as_me:9744: \"$ac_link\"") >&5
9745   (eval $ac_link) 2>&5
9746   ac_status=$?
9747   echo "$as_me:9747: \$? = $ac_status" >&5
9748   (exit $ac_status); } &&
9749          { ac_try='test -s conftest$ac_exeext'
9750   { (eval echo "$as_me:9750: \"$ac_try\"") >&5
9751   (eval $ac_try) 2>&5
9752   ac_status=$?
9753   echo "$as_me:9753: \$? = $ac_status" >&5
9754   (exit $ac_status); }; }; then
9755   ac_cv_lib_bsd_gethostbyname=yes
9756 else
9757   echo "$as_me: failed program was:" >&5
9758 cat conftest.$ac_ext >&5
9759 ac_cv_lib_bsd_gethostbyname=no
9760 fi
9761 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9762 LIBS=$ac_check_lib_save_LIBS
9763 fi
9764 echo "$as_me:9764: result: $ac_cv_lib_bsd_gethostbyname" >&5
9765 echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6
9766 if test $ac_cv_lib_bsd_gethostbyname = yes; then
9767   X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
9768 fi
9769
9770       fi
9771     fi
9772
9773     # lieder@skyler.mavd.honeywell.com says without -lsocket,
9774     # socket/setsockopt and other routines are undefined under SCO ODT
9775     # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
9776     # on later versions), says Simon Leinen: it contains gethostby*
9777     # variants that don't use the nameserver (or something).  -lsocket
9778     # must be given before -lnsl if both are needed.  We assume that
9779     # if connect needs -lnsl, so does gethostbyname.
9780     echo "$as_me:9780: checking for connect" >&5
9781 echo $ECHO_N "checking for connect... $ECHO_C" >&6
9782 if test "${ac_cv_func_connect+set}" = set; then
9783   echo $ECHO_N "(cached) $ECHO_C" >&6
9784 else
9785   cat >conftest.$ac_ext <<_ACEOF
9786 #line 9786 "configure"
9787 #include "confdefs.h"
9788 /* System header to define __stub macros and hopefully few prototypes,
9789     which can conflict with char connect (); below.  */
9790 #include <assert.h>
9791 /* Override any gcc2 internal prototype to avoid an error.  */
9792 #ifdef __cplusplus
9793 extern "C"
9794 #endif
9795 /* We use char because int might match the return type of a gcc2
9796    builtin and then its argument prototype would still apply.  */
9797 char connect ();
9798 char (*f) ();
9799
9800 int
9801 main ()
9802 {
9803 /* The GNU C library defines this for functions which it implements
9804     to always fail with ENOSYS.  Some functions are actually named
9805     something starting with __ and the normal name is an alias.  */
9806 #if defined (__stub_connect) || defined (__stub___connect)
9807 choke me
9808 #else
9809 f = connect; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
9810 #endif
9811
9812   ;
9813   return 0;
9814 }
9815 _ACEOF
9816 rm -f conftest.$ac_objext conftest$ac_exeext
9817 if { (eval echo "$as_me:9817: \"$ac_link\"") >&5
9818   (eval $ac_link) 2>&5
9819   ac_status=$?
9820   echo "$as_me:9820: \$? = $ac_status" >&5
9821   (exit $ac_status); } &&
9822          { ac_try='test -s conftest$ac_exeext'
9823   { (eval echo "$as_me:9823: \"$ac_try\"") >&5
9824   (eval $ac_try) 2>&5
9825   ac_status=$?
9826   echo "$as_me:9826: \$? = $ac_status" >&5
9827   (exit $ac_status); }; }; then
9828   ac_cv_func_connect=yes
9829 else
9830   echo "$as_me: failed program was:" >&5
9831 cat conftest.$ac_ext >&5
9832 ac_cv_func_connect=no
9833 fi
9834 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9835 fi
9836 echo "$as_me:9836: result: $ac_cv_func_connect" >&5
9837 echo "${ECHO_T}$ac_cv_func_connect" >&6
9838
9839     if test $ac_cv_func_connect = no; then
9840       echo "$as_me:9840: checking for connect in -lsocket" >&5
9841 echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6
9842 if test "${ac_cv_lib_socket_connect+set}" = set; then
9843   echo $ECHO_N "(cached) $ECHO_C" >&6
9844 else
9845   ac_check_lib_save_LIBS=$LIBS
9846 LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
9847 cat >conftest.$ac_ext <<_ACEOF
9848 #line 9848 "configure"
9849 #include "confdefs.h"
9850
9851 /* Override any gcc2 internal prototype to avoid an error.  */
9852 #ifdef __cplusplus
9853 extern "C"
9854 #endif
9855 /* We use char because int might match the return type of a gcc2
9856    builtin and then its argument prototype would still apply.  */
9857 char connect ();
9858 int
9859 main ()
9860 {
9861 connect ();
9862   ;
9863   return 0;
9864 }
9865 _ACEOF
9866 rm -f conftest.$ac_objext conftest$ac_exeext
9867 if { (eval echo "$as_me:9867: \"$ac_link\"") >&5
9868   (eval $ac_link) 2>&5
9869   ac_status=$?
9870   echo "$as_me:9870: \$? = $ac_status" >&5
9871   (exit $ac_status); } &&
9872          { ac_try='test -s conftest$ac_exeext'
9873   { (eval echo "$as_me:9873: \"$ac_try\"") >&5
9874   (eval $ac_try) 2>&5
9875   ac_status=$?
9876   echo "$as_me:9876: \$? = $ac_status" >&5
9877   (exit $ac_status); }; }; then
9878   ac_cv_lib_socket_connect=yes
9879 else
9880   echo "$as_me: failed program was:" >&5
9881 cat conftest.$ac_ext >&5
9882 ac_cv_lib_socket_connect=no
9883 fi
9884 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9885 LIBS=$ac_check_lib_save_LIBS
9886 fi
9887 echo "$as_me:9887: result: $ac_cv_lib_socket_connect" >&5
9888 echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6
9889 if test $ac_cv_lib_socket_connect = yes; then
9890   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
9891 fi
9892
9893     fi
9894
9895     # Guillermo Gomez says -lposix is necessary on A/UX.
9896     echo "$as_me:9896: checking for remove" >&5
9897 echo $ECHO_N "checking for remove... $ECHO_C" >&6
9898 if test "${ac_cv_func_remove+set}" = set; then
9899   echo $ECHO_N "(cached) $ECHO_C" >&6
9900 else
9901   cat >conftest.$ac_ext <<_ACEOF
9902 #line 9902 "configure"
9903 #include "confdefs.h"
9904 /* System header to define __stub macros and hopefully few prototypes,
9905     which can conflict with char remove (); below.  */
9906 #include <assert.h>
9907 /* Override any gcc2 internal prototype to avoid an error.  */
9908 #ifdef __cplusplus
9909 extern "C"
9910 #endif
9911 /* We use char because int might match the return type of a gcc2
9912    builtin and then its argument prototype would still apply.  */
9913 char remove ();
9914 char (*f) ();
9915
9916 int
9917 main ()
9918 {
9919 /* The GNU C library defines this for functions which it implements
9920     to always fail with ENOSYS.  Some functions are actually named
9921     something starting with __ and the normal name is an alias.  */
9922 #if defined (__stub_remove) || defined (__stub___remove)
9923 choke me
9924 #else
9925 f = remove; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
9926 #endif
9927
9928   ;
9929   return 0;
9930 }
9931 _ACEOF
9932 rm -f conftest.$ac_objext conftest$ac_exeext
9933 if { (eval echo "$as_me:9933: \"$ac_link\"") >&5
9934   (eval $ac_link) 2>&5
9935   ac_status=$?
9936   echo "$as_me:9936: \$? = $ac_status" >&5
9937   (exit $ac_status); } &&
9938          { ac_try='test -s conftest$ac_exeext'
9939   { (eval echo "$as_me:9939: \"$ac_try\"") >&5
9940   (eval $ac_try) 2>&5
9941   ac_status=$?
9942   echo "$as_me:9942: \$? = $ac_status" >&5
9943   (exit $ac_status); }; }; then
9944   ac_cv_func_remove=yes
9945 else
9946   echo "$as_me: failed program was:" >&5
9947 cat conftest.$ac_ext >&5
9948 ac_cv_func_remove=no
9949 fi
9950 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9951 fi
9952 echo "$as_me:9952: result: $ac_cv_func_remove" >&5
9953 echo "${ECHO_T}$ac_cv_func_remove" >&6
9954
9955     if test $ac_cv_func_remove = no; then
9956       echo "$as_me:9956: checking for remove in -lposix" >&5
9957 echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6
9958 if test "${ac_cv_lib_posix_remove+set}" = set; then
9959   echo $ECHO_N "(cached) $ECHO_C" >&6
9960 else
9961   ac_check_lib_save_LIBS=$LIBS
9962 LIBS="-lposix  $LIBS"
9963 cat >conftest.$ac_ext <<_ACEOF
9964 #line 9964 "configure"
9965 #include "confdefs.h"
9966
9967 /* Override any gcc2 internal prototype to avoid an error.  */
9968 #ifdef __cplusplus
9969 extern "C"
9970 #endif
9971 /* We use char because int might match the return type of a gcc2
9972    builtin and then its argument prototype would still apply.  */
9973 char remove ();
9974 int
9975 main ()
9976 {
9977 remove ();
9978   ;
9979   return 0;
9980 }
9981 _ACEOF
9982 rm -f conftest.$ac_objext conftest$ac_exeext
9983 if { (eval echo "$as_me:9983: \"$ac_link\"") >&5
9984   (eval $ac_link) 2>&5
9985   ac_status=$?
9986   echo "$as_me:9986: \$? = $ac_status" >&5
9987   (exit $ac_status); } &&
9988          { ac_try='test -s conftest$ac_exeext'
9989   { (eval echo "$as_me:9989: \"$ac_try\"") >&5
9990   (eval $ac_try) 2>&5
9991   ac_status=$?
9992   echo "$as_me:9992: \$? = $ac_status" >&5
9993   (exit $ac_status); }; }; then
9994   ac_cv_lib_posix_remove=yes
9995 else
9996   echo "$as_me: failed program was:" >&5
9997 cat conftest.$ac_ext >&5
9998 ac_cv_lib_posix_remove=no
9999 fi
10000 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10001 LIBS=$ac_check_lib_save_LIBS
10002 fi
10003 echo "$as_me:10003: result: $ac_cv_lib_posix_remove" >&5
10004 echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6
10005 if test $ac_cv_lib_posix_remove = yes; then
10006   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
10007 fi
10008
10009     fi
10010
10011     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
10012     echo "$as_me:10012: checking for shmat" >&5
10013 echo $ECHO_N "checking for shmat... $ECHO_C" >&6
10014 if test "${ac_cv_func_shmat+set}" = set; then
10015   echo $ECHO_N "(cached) $ECHO_C" >&6
10016 else
10017   cat >conftest.$ac_ext <<_ACEOF
10018 #line 10018 "configure"
10019 #include "confdefs.h"
10020 /* System header to define __stub macros and hopefully few prototypes,
10021     which can conflict with char shmat (); below.  */
10022 #include <assert.h>
10023 /* Override any gcc2 internal prototype to avoid an error.  */
10024 #ifdef __cplusplus
10025 extern "C"
10026 #endif
10027 /* We use char because int might match the return type of a gcc2
10028    builtin and then its argument prototype would still apply.  */
10029 char shmat ();
10030 char (*f) ();
10031
10032 int
10033 main ()
10034 {
10035 /* The GNU C library defines this for functions which it implements
10036     to always fail with ENOSYS.  Some functions are actually named
10037     something starting with __ and the normal name is an alias.  */
10038 #if defined (__stub_shmat) || defined (__stub___shmat)
10039 choke me
10040 #else
10041 f = shmat; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
10042 #endif
10043
10044   ;
10045   return 0;
10046 }
10047 _ACEOF
10048 rm -f conftest.$ac_objext conftest$ac_exeext
10049 if { (eval echo "$as_me:10049: \"$ac_link\"") >&5
10050   (eval $ac_link) 2>&5
10051   ac_status=$?
10052   echo "$as_me:10052: \$? = $ac_status" >&5
10053   (exit $ac_status); } &&
10054          { ac_try='test -s conftest$ac_exeext'
10055   { (eval echo "$as_me:10055: \"$ac_try\"") >&5
10056   (eval $ac_try) 2>&5
10057   ac_status=$?
10058   echo "$as_me:10058: \$? = $ac_status" >&5
10059   (exit $ac_status); }; }; then
10060   ac_cv_func_shmat=yes
10061 else
10062   echo "$as_me: failed program was:" >&5
10063 cat conftest.$ac_ext >&5
10064 ac_cv_func_shmat=no
10065 fi
10066 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10067 fi
10068 echo "$as_me:10068: result: $ac_cv_func_shmat" >&5
10069 echo "${ECHO_T}$ac_cv_func_shmat" >&6
10070
10071     if test $ac_cv_func_shmat = no; then
10072       echo "$as_me:10072: checking for shmat in -lipc" >&5
10073 echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6
10074 if test "${ac_cv_lib_ipc_shmat+set}" = set; then
10075   echo $ECHO_N "(cached) $ECHO_C" >&6
10076 else
10077   ac_check_lib_save_LIBS=$LIBS
10078 LIBS="-lipc  $LIBS"
10079 cat >conftest.$ac_ext <<_ACEOF
10080 #line 10080 "configure"
10081 #include "confdefs.h"
10082
10083 /* Override any gcc2 internal prototype to avoid an error.  */
10084 #ifdef __cplusplus
10085 extern "C"
10086 #endif
10087 /* We use char because int might match the return type of a gcc2
10088    builtin and then its argument prototype would still apply.  */
10089 char shmat ();
10090 int
10091 main ()
10092 {
10093 shmat ();
10094   ;
10095   return 0;
10096 }
10097 _ACEOF
10098 rm -f conftest.$ac_objext conftest$ac_exeext
10099 if { (eval echo "$as_me:10099: \"$ac_link\"") >&5
10100   (eval $ac_link) 2>&5
10101   ac_status=$?
10102   echo "$as_me:10102: \$? = $ac_status" >&5
10103   (exit $ac_status); } &&
10104          { ac_try='test -s conftest$ac_exeext'
10105   { (eval echo "$as_me:10105: \"$ac_try\"") >&5
10106   (eval $ac_try) 2>&5
10107   ac_status=$?
10108   echo "$as_me:10108: \$? = $ac_status" >&5
10109   (exit $ac_status); }; }; then
10110   ac_cv_lib_ipc_shmat=yes
10111 else
10112   echo "$as_me: failed program was:" >&5
10113 cat conftest.$ac_ext >&5
10114 ac_cv_lib_ipc_shmat=no
10115 fi
10116 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10117 LIBS=$ac_check_lib_save_LIBS
10118 fi
10119 echo "$as_me:10119: result: $ac_cv_lib_ipc_shmat" >&5
10120 echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6
10121 if test $ac_cv_lib_ipc_shmat = yes; then
10122   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
10123 fi
10124
10125     fi
10126   fi
10127
10128   # Check for libraries that X11R6 Xt/Xaw programs need.
10129   ac_save_LDFLAGS=$LDFLAGS
10130   test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
10131   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
10132   # check for ICE first), but we must link in the order -lSM -lICE or
10133   # we get undefined symbols.  So assume we have SM if we have ICE.
10134   # These have to be linked with before -lX11, unlike the other
10135   # libraries we check for below, so use a different variable.
10136   # John Interrante, Karl Berry
10137   echo "$as_me:10137: checking for IceConnectionNumber in -lICE" >&5
10138 echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6
10139 if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then
10140   echo $ECHO_N "(cached) $ECHO_C" >&6
10141 else
10142   ac_check_lib_save_LIBS=$LIBS
10143 LIBS="-lICE $X_EXTRA_LIBS $LIBS"
10144 cat >conftest.$ac_ext <<_ACEOF
10145 #line 10145 "configure"
10146 #include "confdefs.h"
10147
10148 /* Override any gcc2 internal prototype to avoid an error.  */
10149 #ifdef __cplusplus
10150 extern "C"
10151 #endif
10152 /* We use char because int might match the return type of a gcc2
10153    builtin and then its argument prototype would still apply.  */
10154 char IceConnectionNumber ();
10155 int
10156 main ()
10157 {
10158 IceConnectionNumber ();
10159   ;
10160   return 0;
10161 }
10162 _ACEOF
10163 rm -f conftest.$ac_objext conftest$ac_exeext
10164 if { (eval echo "$as_me:10164: \"$ac_link\"") >&5
10165   (eval $ac_link) 2>&5
10166   ac_status=$?
10167   echo "$as_me:10167: \$? = $ac_status" >&5
10168   (exit $ac_status); } &&
10169          { ac_try='test -s conftest$ac_exeext'
10170   { (eval echo "$as_me:10170: \"$ac_try\"") >&5
10171   (eval $ac_try) 2>&5
10172   ac_status=$?
10173   echo "$as_me:10173: \$? = $ac_status" >&5
10174   (exit $ac_status); }; }; then
10175   ac_cv_lib_ICE_IceConnectionNumber=yes
10176 else
10177   echo "$as_me: failed program was:" >&5
10178 cat conftest.$ac_ext >&5
10179 ac_cv_lib_ICE_IceConnectionNumber=no
10180 fi
10181 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10182 LIBS=$ac_check_lib_save_LIBS
10183 fi
10184 echo "$as_me:10184: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
10185 echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6
10186 if test $ac_cv_lib_ICE_IceConnectionNumber = yes; then
10187   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
10188 fi
10189
10190   LDFLAGS=$ac_save_LDFLAGS
10191
10192 fi
10193
10194 cf_x_athena=${cf_x_athena:-Xaw}
10195
10196 echo "$as_me:10196: checking if you want to link with Xaw 3d library" >&5
10197 echo $ECHO_N "checking if you want to link with Xaw 3d library... $ECHO_C" >&6
10198 withval=
10199
10200 # Check whether --with-Xaw3d or --without-Xaw3d was given.
10201 if test "${with_Xaw3d+set}" = set; then
10202   withval="$with_Xaw3d"
10203
10204 fi;
10205 if test "$withval" = yes ; then
10206         cf_x_athena=Xaw3d
10207         echo "$as_me:10207: result: yes" >&5
10208 echo "${ECHO_T}yes" >&6
10209 else
10210         echo "$as_me:10210: result: no" >&5
10211 echo "${ECHO_T}no" >&6
10212 fi
10213
10214 echo "$as_me:10214: checking if you want to link with Xaw 3d xft library" >&5
10215 echo $ECHO_N "checking if you want to link with Xaw 3d xft library... $ECHO_C" >&6
10216 withval=
10217
10218 # Check whether --with-Xaw3dxft or --without-Xaw3dxft was given.
10219 if test "${with_Xaw3dxft+set}" = set; then
10220   withval="$with_Xaw3dxft"
10221
10222 fi;
10223 if test "$withval" = yes ; then
10224         cf_x_athena=Xaw3dxft
10225         echo "$as_me:10225: result: yes" >&5
10226 echo "${ECHO_T}yes" >&6
10227 else
10228         echo "$as_me:10228: result: no" >&5
10229 echo "${ECHO_T}no" >&6
10230 fi
10231
10232 echo "$as_me:10232: checking if you want to link with neXT Athena library" >&5
10233 echo $ECHO_N "checking if you want to link with neXT Athena library... $ECHO_C" >&6
10234 withval=
10235
10236 # Check whether --with-neXtaw or --without-neXtaw was given.
10237 if test "${with_neXtaw+set}" = set; then
10238   withval="$with_neXtaw"
10239
10240 fi;
10241 if test "$withval" = yes ; then
10242         cf_x_athena=neXtaw
10243         echo "$as_me:10243: result: yes" >&5
10244 echo "${ECHO_T}yes" >&6
10245 else
10246         echo "$as_me:10246: result: no" >&5
10247 echo "${ECHO_T}no" >&6
10248 fi
10249
10250 echo "$as_me:10250: checking if you want to link with Athena-Plus library" >&5
10251 echo $ECHO_N "checking if you want to link with Athena-Plus library... $ECHO_C" >&6
10252 withval=
10253
10254 # Check whether --with-XawPlus or --without-XawPlus was given.
10255 if test "${with_XawPlus+set}" = set; then
10256   withval="$with_XawPlus"
10257
10258 fi;
10259 if test "$withval" = yes ; then
10260         cf_x_athena=XawPlus
10261         echo "$as_me:10261: result: yes" >&5
10262 echo "${ECHO_T}yes" >&6
10263 else
10264         echo "$as_me:10264: result: no" >&5
10265 echo "${ECHO_T}no" >&6
10266 fi
10267
10268 cf_x_athena_lib=""
10269
10270 if test "$PKG_CONFIG" != none ; then
10271         cf_athena_list=
10272         test "$cf_x_athena" = Xaw && cf_athena_list="xaw8 xaw7 xaw6"
10273         for cf_athena_pkg in \
10274                 $cf_athena_list \
10275                 ${cf_x_athena} \
10276                 ${cf_x_athena}-devel \
10277                 lib${cf_x_athena} \
10278                 lib${cf_x_athena}-devel
10279         do
10280
10281 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists $cf_athena_pkg; then
10282         test -n "$verbose" && echo "    found package $cf_athena_pkg" 1>&6
10283
10284 echo "${as_me:-configure}:10284: testing found package $cf_athena_pkg ..." 1>&5
10285
10286         cf_pkgconfig_incs="`$PKG_CONFIG --cflags $cf_athena_pkg 2>/dev/null`"
10287         cf_pkgconfig_libs="`$PKG_CONFIG --libs   $cf_athena_pkg 2>/dev/null`"
10288         test -n "$verbose" && echo "    package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs" 1>&6
10289
10290 echo "${as_me:-configure}:10290: testing package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs ..." 1>&5
10291
10292         test -n "$verbose" && echo "    package $cf_athena_pkg LIBS: $cf_pkgconfig_libs" 1>&6
10293
10294 echo "${as_me:-configure}:10294: testing package $cf_athena_pkg LIBS: $cf_pkgconfig_libs ..." 1>&5
10295
10296 cf_fix_cppflags=no
10297 cf_new_cflags=
10298 cf_new_cppflags=
10299 cf_new_extra_cppflags=
10300
10301 for cf_add_cflags in $cf_pkgconfig_incs
10302 do
10303 case $cf_fix_cppflags in
10304 (no)
10305         case $cf_add_cflags in
10306         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10307                 case $cf_add_cflags in
10308                 (-D*)
10309                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10310
10311                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10312                                 && test -z "${cf_tst_cflags}" \
10313                                 && cf_fix_cppflags=yes
10314
10315                         if test $cf_fix_cppflags = yes ; then
10316                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10317                                 continue
10318                         elif test "${cf_tst_cflags}" = "\"'" ; then
10319                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10320                                 continue
10321                         fi
10322                         ;;
10323                 esac
10324                 case "$CPPFLAGS" in
10325                 (*$cf_add_cflags)
10326                         ;;
10327                 (*)
10328                         case $cf_add_cflags in
10329                         (-D*)
10330                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10331
10332 CPPFLAGS=`echo "$CPPFLAGS" | \
10333         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10334                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10335
10336                                 ;;
10337                         esac
10338                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10339                         ;;
10340                 esac
10341                 ;;
10342         (*)
10343                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10344                 ;;
10345         esac
10346         ;;
10347 (yes)
10348         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10349
10350         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10351
10352         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10353                 && test -z "${cf_tst_cflags}" \
10354                 && cf_fix_cppflags=no
10355         ;;
10356 esac
10357 done
10358
10359 if test -n "$cf_new_cflags" ; then
10360
10361         CFLAGS="$CFLAGS $cf_new_cflags"
10362 fi
10363
10364 if test -n "$cf_new_cppflags" ; then
10365
10366         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10367 fi
10368
10369 if test -n "$cf_new_extra_cppflags" ; then
10370
10371         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10372 fi
10373
10374 cf_add_libs="$cf_pkgconfig_libs"
10375 # Filter out duplicates - this happens with badly-designed ".pc" files...
10376 for cf_add_1lib in $LIBS
10377 do
10378         for cf_add_2lib in $cf_add_libs
10379         do
10380                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
10381                 then
10382                         cf_add_1lib=
10383                         break
10384                 fi
10385         done
10386         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
10387 done
10388 LIBS="$cf_add_libs"
10389
10390                         cf_x_athena_lib="$cf_pkgconfig_libs"
10391
10392 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
10393
10394                         cat >>confdefs.h <<EOF
10395 #define $cf_x_athena_LIBS 1
10396 EOF
10397
10398         for cf_trim_lib in Xmu Xt X11
10399         do
10400                 case "$LIBS" in
10401                 (*-l$cf_trim_lib\ *-l$cf_trim_lib*)
10402                         LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
10403                         test -n "$verbose" && echo "    ..trimmed $LIBS" 1>&6
10404
10405 echo "${as_me:-configure}:10405: testing ..trimmed $LIBS ..." 1>&5
10406
10407                         ;;
10408                 esac
10409         done
10410
10411 echo "$as_me:10411: checking for usable $cf_x_athena/Xmu package" >&5
10412 echo $ECHO_N "checking for usable $cf_x_athena/Xmu package... $ECHO_C" >&6
10413 if test "${cf_cv_xaw_compat+set}" = set; then
10414   echo $ECHO_N "(cached) $ECHO_C" >&6
10415 else
10416
10417 cat >conftest.$ac_ext <<_ACEOF
10418 #line 10418 "configure"
10419 #include "confdefs.h"
10420
10421 #include <X11/Xmu/CharSet.h>
10422
10423 int
10424 main ()
10425 {
10426
10427 int check = XmuCompareISOLatin1("big", "small")
10428
10429   ;
10430   return 0;
10431 }
10432 _ACEOF
10433 rm -f conftest.$ac_objext conftest$ac_exeext
10434 if { (eval echo "$as_me:10434: \"$ac_link\"") >&5
10435   (eval $ac_link) 2>&5
10436   ac_status=$?
10437   echo "$as_me:10437: \$? = $ac_status" >&5
10438   (exit $ac_status); } &&
10439          { ac_try='test -s conftest$ac_exeext'
10440   { (eval echo "$as_me:10440: \"$ac_try\"") >&5
10441   (eval $ac_try) 2>&5
10442   ac_status=$?
10443   echo "$as_me:10443: \$? = $ac_status" >&5
10444   (exit $ac_status); }; }; then
10445   cf_cv_xaw_compat=yes
10446 else
10447   echo "$as_me: failed program was:" >&5
10448 cat conftest.$ac_ext >&5
10449 cf_cv_xaw_compat=no
10450 fi
10451 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10452 fi
10453 echo "$as_me:10453: result: $cf_cv_xaw_compat" >&5
10454 echo "${ECHO_T}$cf_cv_xaw_compat" >&6
10455
10456                         if test "$cf_cv_xaw_compat" = no
10457                         then
10458                                 # workaround for broken ".pc" files...
10459                                 case "$cf_x_athena_lib" in
10460                                 (*-lXmu*)
10461                                         ;;
10462                                 (*)
10463                                         test -n "$verbose" && echo "    work around broken package" 1>&6
10464
10465 echo "${as_me:-configure}:10465: testing work around broken package ..." 1>&5
10466
10467                                         cf_save_xmu="$LIBS"
10468                                         cf_first_lib=`echo "$cf_save_xmu" | sed -e 's/^  *//' -e 's/ .*//'`
10469
10470 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xmu; then
10471         test -n "$verbose" && echo "    found package xmu" 1>&6
10472
10473 echo "${as_me:-configure}:10473: testing found package xmu ..." 1>&5
10474
10475         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xmu 2>/dev/null`"
10476         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xmu 2>/dev/null`"
10477         test -n "$verbose" && echo "    package xmu CFLAGS: $cf_pkgconfig_incs" 1>&6
10478
10479 echo "${as_me:-configure}:10479: testing package xmu CFLAGS: $cf_pkgconfig_incs ..." 1>&5
10480
10481         test -n "$verbose" && echo "    package xmu LIBS: $cf_pkgconfig_libs" 1>&6
10482
10483 echo "${as_me:-configure}:10483: testing package xmu LIBS: $cf_pkgconfig_libs ..." 1>&5
10484
10485 cf_fix_cppflags=no
10486 cf_new_cflags=
10487 cf_new_cppflags=
10488 cf_new_extra_cppflags=
10489
10490 for cf_add_cflags in $cf_pkgconfig_incs
10491 do
10492 case $cf_fix_cppflags in
10493 (no)
10494         case $cf_add_cflags in
10495         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10496                 case $cf_add_cflags in
10497                 (-D*)
10498                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10499
10500                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10501                                 && test -z "${cf_tst_cflags}" \
10502                                 && cf_fix_cppflags=yes
10503
10504                         if test $cf_fix_cppflags = yes ; then
10505                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10506                                 continue
10507                         elif test "${cf_tst_cflags}" = "\"'" ; then
10508                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10509                                 continue
10510                         fi
10511                         ;;
10512                 esac
10513                 case "$CPPFLAGS" in
10514                 (*$cf_add_cflags)
10515                         ;;
10516                 (*)
10517                         case $cf_add_cflags in
10518                         (-D*)
10519                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10520
10521 CPPFLAGS=`echo "$CPPFLAGS" | \
10522         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10523                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10524
10525                                 ;;
10526                         esac
10527                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10528                         ;;
10529                 esac
10530                 ;;
10531         (*)
10532                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10533                 ;;
10534         esac
10535         ;;
10536 (yes)
10537         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10538
10539         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10540
10541         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10542                 && test -z "${cf_tst_cflags}" \
10543                 && cf_fix_cppflags=no
10544         ;;
10545 esac
10546 done
10547
10548 if test -n "$cf_new_cflags" ; then
10549
10550         CFLAGS="$CFLAGS $cf_new_cflags"
10551 fi
10552
10553 if test -n "$cf_new_cppflags" ; then
10554
10555         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10556 fi
10557
10558 if test -n "$cf_new_extra_cppflags" ; then
10559
10560         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10561 fi
10562
10563 cf_add_libs="$cf_pkgconfig_libs"
10564 # Filter out duplicates - this happens with badly-designed ".pc" files...
10565 for cf_add_1lib in $LIBS
10566 do
10567         for cf_add_2lib in $cf_add_libs
10568         do
10569                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
10570                 then
10571                         cf_add_1lib=
10572                         break
10573                 fi
10574         done
10575         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
10576 done
10577 LIBS="$cf_add_libs"
10578
10579                                                         LIBS="$cf_save_xmu"
10580
10581 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
10582
10583 echo "${as_me:-configure}:10583: testing ...before $LIBS ..." 1>&5
10584
10585 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib $cf_pkgconfig_libs %" -e 's%  % %g'`
10586 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
10587
10588 echo "${as_me:-configure}:10588: testing ...after  $LIBS ..." 1>&5
10589
10590 else
10591         cf_pkgconfig_incs=
10592         cf_pkgconfig_libs=
10593
10594 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
10595
10596 echo "${as_me:-configure}:10596: testing ...before $LIBS ..." 1>&5
10597
10598 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib -lXmu %" -e 's%  % %g'`
10599 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
10600
10601 echo "${as_me:-configure}:10601: testing ...after  $LIBS ..." 1>&5
10602
10603 fi
10604
10605         for cf_trim_lib in Xmu Xt X11
10606         do
10607                 case "$LIBS" in
10608                 (*-l$cf_trim_lib\ *-l$cf_trim_lib*)
10609                         LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
10610                         test -n "$verbose" && echo "    ..trimmed $LIBS" 1>&6
10611
10612 echo "${as_me:-configure}:10612: testing ..trimmed $LIBS ..." 1>&5
10613
10614                         ;;
10615                 esac
10616         done
10617
10618                                         ;;
10619                                 esac
10620                         fi
10621
10622                         break
10623 else
10624         cf_pkgconfig_incs=
10625         cf_pkgconfig_libs=
10626         :
10627 fi
10628
10629         done
10630 fi
10631
10632 if test -z "$cf_x_athena_lib" ; then
10633
10634 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists Xext; then
10635         test -n "$verbose" && echo "    found package Xext" 1>&6
10636
10637 echo "${as_me:-configure}:10637: testing found package Xext ..." 1>&5
10638
10639         cf_pkgconfig_incs="`$PKG_CONFIG --cflags Xext 2>/dev/null`"
10640         cf_pkgconfig_libs="`$PKG_CONFIG --libs   Xext 2>/dev/null`"
10641         test -n "$verbose" && echo "    package Xext CFLAGS: $cf_pkgconfig_incs" 1>&6
10642
10643 echo "${as_me:-configure}:10643: testing package Xext CFLAGS: $cf_pkgconfig_incs ..." 1>&5
10644
10645         test -n "$verbose" && echo "    package Xext LIBS: $cf_pkgconfig_libs" 1>&6
10646
10647 echo "${as_me:-configure}:10647: testing package Xext LIBS: $cf_pkgconfig_libs ..." 1>&5
10648
10649 cf_fix_cppflags=no
10650 cf_new_cflags=
10651 cf_new_cppflags=
10652 cf_new_extra_cppflags=
10653
10654 for cf_add_cflags in $cf_pkgconfig_incs
10655 do
10656 case $cf_fix_cppflags in
10657 (no)
10658         case $cf_add_cflags in
10659         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10660                 case $cf_add_cflags in
10661                 (-D*)
10662                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10663
10664                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10665                                 && test -z "${cf_tst_cflags}" \
10666                                 && cf_fix_cppflags=yes
10667
10668                         if test $cf_fix_cppflags = yes ; then
10669                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10670                                 continue
10671                         elif test "${cf_tst_cflags}" = "\"'" ; then
10672                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10673                                 continue
10674                         fi
10675                         ;;
10676                 esac
10677                 case "$CPPFLAGS" in
10678                 (*$cf_add_cflags)
10679                         ;;
10680                 (*)
10681                         case $cf_add_cflags in
10682                         (-D*)
10683                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10684
10685 CPPFLAGS=`echo "$CPPFLAGS" | \
10686         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10687                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10688
10689                                 ;;
10690                         esac
10691                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10692                         ;;
10693                 esac
10694                 ;;
10695         (*)
10696                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10697                 ;;
10698         esac
10699         ;;
10700 (yes)
10701         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10702
10703         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10704
10705         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10706                 && test -z "${cf_tst_cflags}" \
10707                 && cf_fix_cppflags=no
10708         ;;
10709 esac
10710 done
10711
10712 if test -n "$cf_new_cflags" ; then
10713
10714         CFLAGS="$CFLAGS $cf_new_cflags"
10715 fi
10716
10717 if test -n "$cf_new_cppflags" ; then
10718
10719         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10720 fi
10721
10722 if test -n "$cf_new_extra_cppflags" ; then
10723
10724         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10725 fi
10726
10727 cf_add_libs="$cf_pkgconfig_libs"
10728 # Filter out duplicates - this happens with badly-designed ".pc" files...
10729 for cf_add_1lib in $LIBS
10730 do
10731         for cf_add_2lib in $cf_add_libs
10732         do
10733                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
10734                 then
10735                         cf_add_1lib=
10736                         break
10737                 fi
10738         done
10739         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
10740 done
10741 LIBS="$cf_add_libs"
10742
10743         :
10744 else
10745         cf_pkgconfig_incs=
10746         cf_pkgconfig_libs=
10747
10748         echo "$as_me:10748: checking for XextCreateExtension in -lXext" >&5
10749 echo $ECHO_N "checking for XextCreateExtension in -lXext... $ECHO_C" >&6
10750 if test "${ac_cv_lib_Xext_XextCreateExtension+set}" = set; then
10751   echo $ECHO_N "(cached) $ECHO_C" >&6
10752 else
10753   ac_check_lib_save_LIBS=$LIBS
10754 LIBS="-lXext  $LIBS"
10755 cat >conftest.$ac_ext <<_ACEOF
10756 #line 10756 "configure"
10757 #include "confdefs.h"
10758
10759 /* Override any gcc2 internal prototype to avoid an error.  */
10760 #ifdef __cplusplus
10761 extern "C"
10762 #endif
10763 /* We use char because int might match the return type of a gcc2
10764    builtin and then its argument prototype would still apply.  */
10765 char XextCreateExtension ();
10766 int
10767 main ()
10768 {
10769 XextCreateExtension ();
10770   ;
10771   return 0;
10772 }
10773 _ACEOF
10774 rm -f conftest.$ac_objext conftest$ac_exeext
10775 if { (eval echo "$as_me:10775: \"$ac_link\"") >&5
10776   (eval $ac_link) 2>&5
10777   ac_status=$?
10778   echo "$as_me:10778: \$? = $ac_status" >&5
10779   (exit $ac_status); } &&
10780          { ac_try='test -s conftest$ac_exeext'
10781   { (eval echo "$as_me:10781: \"$ac_try\"") >&5
10782   (eval $ac_try) 2>&5
10783   ac_status=$?
10784   echo "$as_me:10784: \$? = $ac_status" >&5
10785   (exit $ac_status); }; }; then
10786   ac_cv_lib_Xext_XextCreateExtension=yes
10787 else
10788   echo "$as_me: failed program was:" >&5
10789 cat conftest.$ac_ext >&5
10790 ac_cv_lib_Xext_XextCreateExtension=no
10791 fi
10792 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10793 LIBS=$ac_check_lib_save_LIBS
10794 fi
10795 echo "$as_me:10795: result: $ac_cv_lib_Xext_XextCreateExtension" >&5
10796 echo "${ECHO_T}$ac_cv_lib_Xext_XextCreateExtension" >&6
10797 if test $ac_cv_lib_Xext_XextCreateExtension = yes; then
10798
10799 cf_add_libs="-lXext"
10800 # Filter out duplicates - this happens with badly-designed ".pc" files...
10801 for cf_add_1lib in $LIBS
10802 do
10803         for cf_add_2lib in $cf_add_libs
10804         do
10805                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
10806                 then
10807                         cf_add_1lib=
10808                         break
10809                 fi
10810         done
10811         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
10812 done
10813 LIBS="$cf_add_libs"
10814
10815 fi
10816
10817 fi
10818
10819 # OSX is schizoid about who owns /usr/X11 (old) versus /opt/X11 (new), and (and
10820 # in some cases has installed dummy files in the former, other cases replaced
10821 # it with a link to the new location).  This complicates the configure script.
10822 # Check for that pitfall, and recover using pkg-config
10823 #
10824 # If none of these are set, the configuration is almost certainly broken.
10825 if test -z "${X_CFLAGS}${X_PRE_LIBS}${X_LIBS}${X_EXTRA_LIBS}"
10826 then
10827
10828 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists x11; then
10829         test -n "$verbose" && echo "    found package x11" 1>&6
10830
10831 echo "${as_me:-configure}:10831: testing found package x11 ..." 1>&5
10832
10833         cf_pkgconfig_incs="`$PKG_CONFIG --cflags x11 2>/dev/null`"
10834         cf_pkgconfig_libs="`$PKG_CONFIG --libs   x11 2>/dev/null`"
10835         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
10836
10837 echo "${as_me:-configure}:10837: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
10838
10839         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
10840
10841 echo "${as_me:-configure}:10841: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
10842
10843 cf_fix_cppflags=no
10844 cf_new_cflags=
10845 cf_new_cppflags=
10846 cf_new_extra_cppflags=
10847
10848 for cf_add_cflags in $cf_pkgconfig_incs
10849 do
10850 case $cf_fix_cppflags in
10851 (no)
10852         case $cf_add_cflags in
10853         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10854                 case $cf_add_cflags in
10855                 (-D*)
10856                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10857
10858                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10859                                 && test -z "${cf_tst_cflags}" \
10860                                 && cf_fix_cppflags=yes
10861
10862                         if test $cf_fix_cppflags = yes ; then
10863                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10864                                 continue
10865                         elif test "${cf_tst_cflags}" = "\"'" ; then
10866                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10867                                 continue
10868                         fi
10869                         ;;
10870                 esac
10871                 case "$CPPFLAGS" in
10872                 (*$cf_add_cflags)
10873                         ;;
10874                 (*)
10875                         case $cf_add_cflags in
10876                         (-D*)
10877                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10878
10879 CPPFLAGS=`echo "$CPPFLAGS" | \
10880         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10881                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10882
10883                                 ;;
10884                         esac
10885                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10886                         ;;
10887                 esac
10888                 ;;
10889         (*)
10890                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10891                 ;;
10892         esac
10893         ;;
10894 (yes)
10895         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10896
10897         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10898
10899         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10900                 && test -z "${cf_tst_cflags}" \
10901                 && cf_fix_cppflags=no
10902         ;;
10903 esac
10904 done
10905
10906 if test -n "$cf_new_cflags" ; then
10907
10908         CFLAGS="$CFLAGS $cf_new_cflags"
10909 fi
10910
10911 if test -n "$cf_new_cppflags" ; then
10912
10913         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10914 fi
10915
10916 if test -n "$cf_new_extra_cppflags" ; then
10917
10918         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10919 fi
10920
10921 cf_add_libs="$cf_pkgconfig_libs"
10922 # Filter out duplicates - this happens with badly-designed ".pc" files...
10923 for cf_add_1lib in $LIBS
10924 do
10925         for cf_add_2lib in $cf_add_libs
10926         do
10927                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
10928                 then
10929                         cf_add_1lib=
10930                         break
10931                 fi
10932         done
10933         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
10934 done
10935 LIBS="$cf_add_libs"
10936
10937         :
10938 else
10939         cf_pkgconfig_incs=
10940         cf_pkgconfig_libs=
10941         { echo "$as_me:10941: WARNING: unable to find X11 library" >&5
10942 echo "$as_me: WARNING: unable to find X11 library" >&2;}
10943 fi
10944
10945 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists ice; then
10946         test -n "$verbose" && echo "    found package ice" 1>&6
10947
10948 echo "${as_me:-configure}:10948: testing found package ice ..." 1>&5
10949
10950         cf_pkgconfig_incs="`$PKG_CONFIG --cflags ice 2>/dev/null`"
10951         cf_pkgconfig_libs="`$PKG_CONFIG --libs   ice 2>/dev/null`"
10952         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
10953
10954 echo "${as_me:-configure}:10954: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
10955
10956         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
10957
10958 echo "${as_me:-configure}:10958: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
10959
10960 cf_fix_cppflags=no
10961 cf_new_cflags=
10962 cf_new_cppflags=
10963 cf_new_extra_cppflags=
10964
10965 for cf_add_cflags in $cf_pkgconfig_incs
10966 do
10967 case $cf_fix_cppflags in
10968 (no)
10969         case $cf_add_cflags in
10970         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10971                 case $cf_add_cflags in
10972                 (-D*)
10973                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10974
10975                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10976                                 && test -z "${cf_tst_cflags}" \
10977                                 && cf_fix_cppflags=yes
10978
10979                         if test $cf_fix_cppflags = yes ; then
10980                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10981                                 continue
10982                         elif test "${cf_tst_cflags}" = "\"'" ; then
10983                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10984                                 continue
10985                         fi
10986                         ;;
10987                 esac
10988                 case "$CPPFLAGS" in
10989                 (*$cf_add_cflags)
10990                         ;;
10991                 (*)
10992                         case $cf_add_cflags in
10993                         (-D*)
10994                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10995
10996 CPPFLAGS=`echo "$CPPFLAGS" | \
10997         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10998                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10999
11000                                 ;;
11001                         esac
11002                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11003                         ;;
11004                 esac
11005                 ;;
11006         (*)
11007                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11008                 ;;
11009         esac
11010         ;;
11011 (yes)
11012         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11013
11014         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11015
11016         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11017                 && test -z "${cf_tst_cflags}" \
11018                 && cf_fix_cppflags=no
11019         ;;
11020 esac
11021 done
11022
11023 if test -n "$cf_new_cflags" ; then
11024
11025         CFLAGS="$CFLAGS $cf_new_cflags"
11026 fi
11027
11028 if test -n "$cf_new_cppflags" ; then
11029
11030         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11031 fi
11032
11033 if test -n "$cf_new_extra_cppflags" ; then
11034
11035         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11036 fi
11037
11038 cf_add_libs="$cf_pkgconfig_libs"
11039 # Filter out duplicates - this happens with badly-designed ".pc" files...
11040 for cf_add_1lib in $LIBS
11041 do
11042         for cf_add_2lib in $cf_add_libs
11043         do
11044                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11045                 then
11046                         cf_add_1lib=
11047                         break
11048                 fi
11049         done
11050         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11051 done
11052 LIBS="$cf_add_libs"
11053
11054         :
11055 else
11056         cf_pkgconfig_incs=
11057         cf_pkgconfig_libs=
11058         { echo "$as_me:11058: WARNING: unable to find ICE library" >&5
11059 echo "$as_me: WARNING: unable to find ICE library" >&2;}
11060 fi
11061
11062 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists sm; then
11063         test -n "$verbose" && echo "    found package sm" 1>&6
11064
11065 echo "${as_me:-configure}:11065: testing found package sm ..." 1>&5
11066
11067         cf_pkgconfig_incs="`$PKG_CONFIG --cflags sm 2>/dev/null`"
11068         cf_pkgconfig_libs="`$PKG_CONFIG --libs   sm 2>/dev/null`"
11069         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
11070
11071 echo "${as_me:-configure}:11071: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11072
11073         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
11074
11075 echo "${as_me:-configure}:11075: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
11076
11077 cf_fix_cppflags=no
11078 cf_new_cflags=
11079 cf_new_cppflags=
11080 cf_new_extra_cppflags=
11081
11082 for cf_add_cflags in $cf_pkgconfig_incs
11083 do
11084 case $cf_fix_cppflags in
11085 (no)
11086         case $cf_add_cflags in
11087         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11088                 case $cf_add_cflags in
11089                 (-D*)
11090                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11091
11092                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11093                                 && test -z "${cf_tst_cflags}" \
11094                                 && cf_fix_cppflags=yes
11095
11096                         if test $cf_fix_cppflags = yes ; then
11097                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11098                                 continue
11099                         elif test "${cf_tst_cflags}" = "\"'" ; then
11100                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11101                                 continue
11102                         fi
11103                         ;;
11104                 esac
11105                 case "$CPPFLAGS" in
11106                 (*$cf_add_cflags)
11107                         ;;
11108                 (*)
11109                         case $cf_add_cflags in
11110                         (-D*)
11111                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11112
11113 CPPFLAGS=`echo "$CPPFLAGS" | \
11114         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11115                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11116
11117                                 ;;
11118                         esac
11119                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11120                         ;;
11121                 esac
11122                 ;;
11123         (*)
11124                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11125                 ;;
11126         esac
11127         ;;
11128 (yes)
11129         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11130
11131         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11132
11133         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11134                 && test -z "${cf_tst_cflags}" \
11135                 && cf_fix_cppflags=no
11136         ;;
11137 esac
11138 done
11139
11140 if test -n "$cf_new_cflags" ; then
11141
11142         CFLAGS="$CFLAGS $cf_new_cflags"
11143 fi
11144
11145 if test -n "$cf_new_cppflags" ; then
11146
11147         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11148 fi
11149
11150 if test -n "$cf_new_extra_cppflags" ; then
11151
11152         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11153 fi
11154
11155 cf_add_libs="$cf_pkgconfig_libs"
11156 # Filter out duplicates - this happens with badly-designed ".pc" files...
11157 for cf_add_1lib in $LIBS
11158 do
11159         for cf_add_2lib in $cf_add_libs
11160         do
11161                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11162                 then
11163                         cf_add_1lib=
11164                         break
11165                 fi
11166         done
11167         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11168 done
11169 LIBS="$cf_add_libs"
11170
11171         :
11172 else
11173         cf_pkgconfig_incs=
11174         cf_pkgconfig_libs=
11175         { echo "$as_me:11175: WARNING: unable to find SM library" >&5
11176 echo "$as_me: WARNING: unable to find SM library" >&2;}
11177 fi
11178
11179 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xt; then
11180         test -n "$verbose" && echo "    found package xt" 1>&6
11181
11182 echo "${as_me:-configure}:11182: testing found package xt ..." 1>&5
11183
11184         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xt 2>/dev/null`"
11185         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xt 2>/dev/null`"
11186         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
11187
11188 echo "${as_me:-configure}:11188: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11189
11190         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
11191
11192 echo "${as_me:-configure}:11192: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
11193
11194 cf_fix_cppflags=no
11195 cf_new_cflags=
11196 cf_new_cppflags=
11197 cf_new_extra_cppflags=
11198
11199 for cf_add_cflags in $cf_pkgconfig_incs
11200 do
11201 case $cf_fix_cppflags in
11202 (no)
11203         case $cf_add_cflags in
11204         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11205                 case $cf_add_cflags in
11206                 (-D*)
11207                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11208
11209                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11210                                 && test -z "${cf_tst_cflags}" \
11211                                 && cf_fix_cppflags=yes
11212
11213                         if test $cf_fix_cppflags = yes ; then
11214                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11215                                 continue
11216                         elif test "${cf_tst_cflags}" = "\"'" ; then
11217                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11218                                 continue
11219                         fi
11220                         ;;
11221                 esac
11222                 case "$CPPFLAGS" in
11223                 (*$cf_add_cflags)
11224                         ;;
11225                 (*)
11226                         case $cf_add_cflags in
11227                         (-D*)
11228                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11229
11230 CPPFLAGS=`echo "$CPPFLAGS" | \
11231         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11232                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11233
11234                                 ;;
11235                         esac
11236                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11237                         ;;
11238                 esac
11239                 ;;
11240         (*)
11241                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11242                 ;;
11243         esac
11244         ;;
11245 (yes)
11246         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11247
11248         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11249
11250         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11251                 && test -z "${cf_tst_cflags}" \
11252                 && cf_fix_cppflags=no
11253         ;;
11254 esac
11255 done
11256
11257 if test -n "$cf_new_cflags" ; then
11258
11259         CFLAGS="$CFLAGS $cf_new_cflags"
11260 fi
11261
11262 if test -n "$cf_new_cppflags" ; then
11263
11264         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11265 fi
11266
11267 if test -n "$cf_new_extra_cppflags" ; then
11268
11269         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11270 fi
11271
11272 cf_add_libs="$cf_pkgconfig_libs"
11273 # Filter out duplicates - this happens with badly-designed ".pc" files...
11274 for cf_add_1lib in $LIBS
11275 do
11276         for cf_add_2lib in $cf_add_libs
11277         do
11278                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11279                 then
11280                         cf_add_1lib=
11281                         break
11282                 fi
11283         done
11284         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11285 done
11286 LIBS="$cf_add_libs"
11287
11288         :
11289 else
11290         cf_pkgconfig_incs=
11291         cf_pkgconfig_libs=
11292         { echo "$as_me:11292: WARNING: unable to find Xt library" >&5
11293 echo "$as_me: WARNING: unable to find Xt library" >&2;}
11294 fi
11295
11296 fi
11297
11298 cf_have_X_LIBS=no
11299
11300 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xt; then
11301         test -n "$verbose" && echo "    found package xt" 1>&6
11302
11303 echo "${as_me:-configure}:11303: testing found package xt ..." 1>&5
11304
11305         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xt 2>/dev/null`"
11306         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xt 2>/dev/null`"
11307         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
11308
11309 echo "${as_me:-configure}:11309: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11310
11311         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
11312
11313 echo "${as_me:-configure}:11313: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
11314
11315 cf_fix_cppflags=no
11316 cf_new_cflags=
11317 cf_new_cppflags=
11318 cf_new_extra_cppflags=
11319
11320 for cf_add_cflags in $cf_pkgconfig_incs
11321 do
11322 case $cf_fix_cppflags in
11323 (no)
11324         case $cf_add_cflags in
11325         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11326                 case $cf_add_cflags in
11327                 (-D*)
11328                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11329
11330                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11331                                 && test -z "${cf_tst_cflags}" \
11332                                 && cf_fix_cppflags=yes
11333
11334                         if test $cf_fix_cppflags = yes ; then
11335                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11336                                 continue
11337                         elif test "${cf_tst_cflags}" = "\"'" ; then
11338                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11339                                 continue
11340                         fi
11341                         ;;
11342                 esac
11343                 case "$CPPFLAGS" in
11344                 (*$cf_add_cflags)
11345                         ;;
11346                 (*)
11347                         case $cf_add_cflags in
11348                         (-D*)
11349                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11350
11351 CPPFLAGS=`echo "$CPPFLAGS" | \
11352         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11353                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11354
11355                                 ;;
11356                         esac
11357                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11358                         ;;
11359                 esac
11360                 ;;
11361         (*)
11362                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11363                 ;;
11364         esac
11365         ;;
11366 (yes)
11367         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11368
11369         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11370
11371         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11372                 && test -z "${cf_tst_cflags}" \
11373                 && cf_fix_cppflags=no
11374         ;;
11375 esac
11376 done
11377
11378 if test -n "$cf_new_cflags" ; then
11379
11380         CFLAGS="$CFLAGS $cf_new_cflags"
11381 fi
11382
11383 if test -n "$cf_new_cppflags" ; then
11384
11385         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11386 fi
11387
11388 if test -n "$cf_new_extra_cppflags" ; then
11389
11390         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11391 fi
11392
11393 cf_add_libs="$cf_pkgconfig_libs"
11394 # Filter out duplicates - this happens with badly-designed ".pc" files...
11395 for cf_add_1lib in $LIBS
11396 do
11397         for cf_add_2lib in $cf_add_libs
11398         do
11399                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11400                 then
11401                         cf_add_1lib=
11402                         break
11403                 fi
11404         done
11405         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11406 done
11407 LIBS="$cf_add_libs"
11408
11409         case "x$LIBS" in
11410         (*-lX11*)
11411                 ;;
11412         (*)
11413 # we have an "xt" package, but it may omit Xt's dependency on X11
11414 echo "$as_me:11414: checking for usable X dependency" >&5
11415 echo $ECHO_N "checking for usable X dependency... $ECHO_C" >&6
11416 if test "${cf_cv_xt_x11_compat+set}" = set; then
11417   echo $ECHO_N "(cached) $ECHO_C" >&6
11418 else
11419
11420 cat >conftest.$ac_ext <<_ACEOF
11421 #line 11421 "configure"
11422 #include "confdefs.h"
11423
11424 #include <X11/Xlib.h>
11425
11426 int
11427 main ()
11428 {
11429
11430         int rc1 = XDrawLine((Display*) 0, (Drawable) 0, (GC) 0, 0, 0, 0, 0);
11431         int rc2 = XClearWindow((Display*) 0, (Window) 0);
11432         int rc3 = XMoveWindow((Display*) 0, (Window) 0, 0, 0);
11433         int rc4 = XMoveResizeWindow((Display*)0, (Window)0, 0, 0, 0, 0);
11434
11435   ;
11436   return 0;
11437 }
11438 _ACEOF
11439 rm -f conftest.$ac_objext conftest$ac_exeext
11440 if { (eval echo "$as_me:11440: \"$ac_link\"") >&5
11441   (eval $ac_link) 2>&5
11442   ac_status=$?
11443   echo "$as_me:11443: \$? = $ac_status" >&5
11444   (exit $ac_status); } &&
11445          { ac_try='test -s conftest$ac_exeext'
11446   { (eval echo "$as_me:11446: \"$ac_try\"") >&5
11447   (eval $ac_try) 2>&5
11448   ac_status=$?
11449   echo "$as_me:11449: \$? = $ac_status" >&5
11450   (exit $ac_status); }; }; then
11451   cf_cv_xt_x11_compat=yes
11452 else
11453   echo "$as_me: failed program was:" >&5
11454 cat conftest.$ac_ext >&5
11455 cf_cv_xt_x11_compat=no
11456 fi
11457 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11458 fi
11459 echo "$as_me:11459: result: $cf_cv_xt_x11_compat" >&5
11460 echo "${ECHO_T}$cf_cv_xt_x11_compat" >&6
11461                 if test "$cf_cv_xt_x11_compat" = no
11462                 then
11463                         test -n "$verbose" && echo "    work around broken X11 dependency" 1>&6
11464
11465 echo "${as_me:-configure}:11465: testing work around broken X11 dependency ..." 1>&5
11466
11467                         # 2010/11/19 - good enough until a working Xt on Xcb is delivered.
11468
11469 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists x11; then
11470         test -n "$verbose" && echo "    found package x11" 1>&6
11471
11472 echo "${as_me:-configure}:11472: testing found package x11 ..." 1>&5
11473
11474         cf_pkgconfig_incs="`$PKG_CONFIG --cflags x11 2>/dev/null`"
11475         cf_pkgconfig_libs="`$PKG_CONFIG --libs   x11 2>/dev/null`"
11476         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
11477
11478 echo "${as_me:-configure}:11478: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11479
11480         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
11481
11482 echo "${as_me:-configure}:11482: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
11483
11484 cf_fix_cppflags=no
11485 cf_new_cflags=
11486 cf_new_cppflags=
11487 cf_new_extra_cppflags=
11488
11489 for cf_add_cflags in $cf_pkgconfig_incs
11490 do
11491 case $cf_fix_cppflags in
11492 (no)
11493         case $cf_add_cflags in
11494         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11495                 case $cf_add_cflags in
11496                 (-D*)
11497                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11498
11499                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11500                                 && test -z "${cf_tst_cflags}" \
11501                                 && cf_fix_cppflags=yes
11502
11503                         if test $cf_fix_cppflags = yes ; then
11504                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11505                                 continue
11506                         elif test "${cf_tst_cflags}" = "\"'" ; then
11507                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11508                                 continue
11509                         fi
11510                         ;;
11511                 esac
11512                 case "$CPPFLAGS" in
11513                 (*$cf_add_cflags)
11514                         ;;
11515                 (*)
11516                         case $cf_add_cflags in
11517                         (-D*)
11518                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11519
11520 CPPFLAGS=`echo "$CPPFLAGS" | \
11521         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11522                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11523
11524                                 ;;
11525                         esac
11526                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11527                         ;;
11528                 esac
11529                 ;;
11530         (*)
11531                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11532                 ;;
11533         esac
11534         ;;
11535 (yes)
11536         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11537
11538         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11539
11540         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11541                 && test -z "${cf_tst_cflags}" \
11542                 && cf_fix_cppflags=no
11543         ;;
11544 esac
11545 done
11546
11547 if test -n "$cf_new_cflags" ; then
11548
11549         CFLAGS="$CFLAGS $cf_new_cflags"
11550 fi
11551
11552 if test -n "$cf_new_cppflags" ; then
11553
11554         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11555 fi
11556
11557 if test -n "$cf_new_extra_cppflags" ; then
11558
11559         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11560 fi
11561
11562 cf_add_libs="$cf_pkgconfig_libs"
11563 # Filter out duplicates - this happens with badly-designed ".pc" files...
11564 for cf_add_1lib in $LIBS
11565 do
11566         for cf_add_2lib in $cf_add_libs
11567         do
11568                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11569                 then
11570                         cf_add_1lib=
11571                         break
11572                 fi
11573         done
11574         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11575 done
11576 LIBS="$cf_add_libs"
11577
11578         :
11579 else
11580         cf_pkgconfig_incs=
11581         cf_pkgconfig_libs=
11582
11583 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
11584
11585 echo "${as_me:-configure}:11585: testing ...before $LIBS ..." 1>&5
11586
11587 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%-lXt %-lXt -lX11 %" -e 's%  % %g'`
11588 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
11589
11590 echo "${as_me:-configure}:11590: testing ...after  $LIBS ..." 1>&5
11591
11592 fi
11593
11594                 fi
11595                 ;;
11596         esac
11597
11598 echo "$as_me:11598: checking for usable X Toolkit package" >&5
11599 echo $ECHO_N "checking for usable X Toolkit package... $ECHO_C" >&6
11600 if test "${cf_cv_xt_ice_compat+set}" = set; then
11601   echo $ECHO_N "(cached) $ECHO_C" >&6
11602 else
11603
11604 cat >conftest.$ac_ext <<_ACEOF
11605 #line 11605 "configure"
11606 #include "confdefs.h"
11607
11608 #include <X11/Shell.h>
11609
11610 int
11611 main ()
11612 {
11613 int num = IceConnectionNumber(0)
11614
11615   ;
11616   return 0;
11617 }
11618 _ACEOF
11619 rm -f conftest.$ac_objext conftest$ac_exeext
11620 if { (eval echo "$as_me:11620: \"$ac_link\"") >&5
11621   (eval $ac_link) 2>&5
11622   ac_status=$?
11623   echo "$as_me:11623: \$? = $ac_status" >&5
11624   (exit $ac_status); } &&
11625          { ac_try='test -s conftest$ac_exeext'
11626   { (eval echo "$as_me:11626: \"$ac_try\"") >&5
11627   (eval $ac_try) 2>&5
11628   ac_status=$?
11629   echo "$as_me:11629: \$? = $ac_status" >&5
11630   (exit $ac_status); }; }; then
11631   cf_cv_xt_ice_compat=yes
11632 else
11633   echo "$as_me: failed program was:" >&5
11634 cat conftest.$ac_ext >&5
11635 cf_cv_xt_ice_compat=no
11636 fi
11637 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11638 fi
11639 echo "$as_me:11639: result: $cf_cv_xt_ice_compat" >&5
11640 echo "${ECHO_T}$cf_cv_xt_ice_compat" >&6
11641
11642         if test "$cf_cv_xt_ice_compat" = no
11643         then
11644                 # workaround for broken ".pc" files used for X Toolkit.
11645                 case "x$X_PRE_LIBS" in
11646                 (*-lICE*)
11647                         case "x$LIBS" in
11648                         (*-lICE*)
11649                                 ;;
11650                         (*)
11651                                 test -n "$verbose" && echo "    work around broken ICE dependency" 1>&6
11652
11653 echo "${as_me:-configure}:11653: testing work around broken ICE dependency ..." 1>&5
11654
11655 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists ice; then
11656         test -n "$verbose" && echo "    found package ice" 1>&6
11657
11658 echo "${as_me:-configure}:11658: testing found package ice ..." 1>&5
11659
11660         cf_pkgconfig_incs="`$PKG_CONFIG --cflags ice 2>/dev/null`"
11661         cf_pkgconfig_libs="`$PKG_CONFIG --libs   ice 2>/dev/null`"
11662         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
11663
11664 echo "${as_me:-configure}:11664: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11665
11666         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
11667
11668 echo "${as_me:-configure}:11668: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
11669
11670 cf_fix_cppflags=no
11671 cf_new_cflags=
11672 cf_new_cppflags=
11673 cf_new_extra_cppflags=
11674
11675 for cf_add_cflags in $cf_pkgconfig_incs
11676 do
11677 case $cf_fix_cppflags in
11678 (no)
11679         case $cf_add_cflags in
11680         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11681                 case $cf_add_cflags in
11682                 (-D*)
11683                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11684
11685                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11686                                 && test -z "${cf_tst_cflags}" \
11687                                 && cf_fix_cppflags=yes
11688
11689                         if test $cf_fix_cppflags = yes ; then
11690                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11691                                 continue
11692                         elif test "${cf_tst_cflags}" = "\"'" ; then
11693                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11694                                 continue
11695                         fi
11696                         ;;
11697                 esac
11698                 case "$CPPFLAGS" in
11699                 (*$cf_add_cflags)
11700                         ;;
11701                 (*)
11702                         case $cf_add_cflags in
11703                         (-D*)
11704                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11705
11706 CPPFLAGS=`echo "$CPPFLAGS" | \
11707         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11708                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11709
11710                                 ;;
11711                         esac
11712                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11713                         ;;
11714                 esac
11715                 ;;
11716         (*)
11717                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11718                 ;;
11719         esac
11720         ;;
11721 (yes)
11722         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11723
11724         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11725
11726         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11727                 && test -z "${cf_tst_cflags}" \
11728                 && cf_fix_cppflags=no
11729         ;;
11730 esac
11731 done
11732
11733 if test -n "$cf_new_cflags" ; then
11734
11735         CFLAGS="$CFLAGS $cf_new_cflags"
11736 fi
11737
11738 if test -n "$cf_new_cppflags" ; then
11739
11740         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11741 fi
11742
11743 if test -n "$cf_new_extra_cppflags" ; then
11744
11745         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11746 fi
11747
11748 cf_add_libs="$cf_pkgconfig_libs"
11749 # Filter out duplicates - this happens with badly-designed ".pc" files...
11750 for cf_add_1lib in $LIBS
11751 do
11752         for cf_add_2lib in $cf_add_libs
11753         do
11754                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11755                 then
11756                         cf_add_1lib=
11757                         break
11758                 fi
11759         done
11760         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11761 done
11762 LIBS="$cf_add_libs"
11763
11764 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists sm; then
11765         test -n "$verbose" && echo "    found package sm" 1>&6
11766
11767 echo "${as_me:-configure}:11767: testing found package sm ..." 1>&5
11768
11769         cf_pkgconfig_incs="`$PKG_CONFIG --cflags sm 2>/dev/null`"
11770         cf_pkgconfig_libs="`$PKG_CONFIG --libs   sm 2>/dev/null`"
11771         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
11772
11773 echo "${as_me:-configure}:11773: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11774
11775         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
11776
11777 echo "${as_me:-configure}:11777: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
11778
11779 cf_fix_cppflags=no
11780 cf_new_cflags=
11781 cf_new_cppflags=
11782 cf_new_extra_cppflags=
11783
11784 for cf_add_cflags in $cf_pkgconfig_incs
11785 do
11786 case $cf_fix_cppflags in
11787 (no)
11788         case $cf_add_cflags in
11789         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11790                 case $cf_add_cflags in
11791                 (-D*)
11792                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11793
11794                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11795                                 && test -z "${cf_tst_cflags}" \
11796                                 && cf_fix_cppflags=yes
11797
11798                         if test $cf_fix_cppflags = yes ; then
11799                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11800                                 continue
11801                         elif test "${cf_tst_cflags}" = "\"'" ; then
11802                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11803                                 continue
11804                         fi
11805                         ;;
11806                 esac
11807                 case "$CPPFLAGS" in
11808                 (*$cf_add_cflags)
11809                         ;;
11810                 (*)
11811                         case $cf_add_cflags in
11812                         (-D*)
11813                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11814
11815 CPPFLAGS=`echo "$CPPFLAGS" | \
11816         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11817                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11818
11819                                 ;;
11820                         esac
11821                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11822                         ;;
11823                 esac
11824                 ;;
11825         (*)
11826                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11827                 ;;
11828         esac
11829         ;;
11830 (yes)
11831         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11832
11833         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11834
11835         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11836                 && test -z "${cf_tst_cflags}" \
11837                 && cf_fix_cppflags=no
11838         ;;
11839 esac
11840 done
11841
11842 if test -n "$cf_new_cflags" ; then
11843
11844         CFLAGS="$CFLAGS $cf_new_cflags"
11845 fi
11846
11847 if test -n "$cf_new_cppflags" ; then
11848
11849         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11850 fi
11851
11852 if test -n "$cf_new_extra_cppflags" ; then
11853
11854         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11855 fi
11856
11857 cf_add_libs="$cf_pkgconfig_libs"
11858 # Filter out duplicates - this happens with badly-designed ".pc" files...
11859 for cf_add_1lib in $LIBS
11860 do
11861         for cf_add_2lib in $cf_add_libs
11862         do
11863                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11864                 then
11865                         cf_add_1lib=
11866                         break
11867                 fi
11868         done
11869         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11870 done
11871 LIBS="$cf_add_libs"
11872
11873         :
11874 else
11875         cf_pkgconfig_incs=
11876         cf_pkgconfig_libs=
11877         :
11878 fi
11879
11880 else
11881         cf_pkgconfig_incs=
11882         cf_pkgconfig_libs=
11883
11884 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
11885
11886 echo "${as_me:-configure}:11886: testing ...before $LIBS ..." 1>&5
11887
11888 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%-lXt %-lXt $X_PRE_LIBS %" -e 's%  % %g'`
11889 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
11890
11891 echo "${as_me:-configure}:11891: testing ...after  $LIBS ..." 1>&5
11892
11893 fi
11894
11895                                 ;;
11896                         esac
11897                         ;;
11898                 esac
11899         fi
11900
11901         cf_have_X_LIBS=yes
11902
11903 else
11904         cf_pkgconfig_incs=
11905         cf_pkgconfig_libs=
11906
11907         LDFLAGS="$X_LIBS $LDFLAGS"
11908
11909 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
11910
11911 echo "${as_me:-configure}:11911: testing checking additions to CFLAGS ..." 1>&5
11912
11913 cf_check_cflags="$CFLAGS"
11914 cf_check_cppflags="$CPPFLAGS"
11915
11916 cf_fix_cppflags=no
11917 cf_new_cflags=
11918 cf_new_cppflags=
11919 cf_new_extra_cppflags=
11920
11921 for cf_add_cflags in $X_CFLAGS
11922 do
11923 case $cf_fix_cppflags in
11924 (no)
11925         case $cf_add_cflags in
11926         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11927                 case $cf_add_cflags in
11928                 (-D*)
11929                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11930
11931                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11932                                 && test -z "${cf_tst_cflags}" \
11933                                 && cf_fix_cppflags=yes
11934
11935                         if test $cf_fix_cppflags = yes ; then
11936                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11937                                 continue
11938                         elif test "${cf_tst_cflags}" = "\"'" ; then
11939                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11940                                 continue
11941                         fi
11942                         ;;
11943                 esac
11944                 case "$CPPFLAGS" in
11945                 (*$cf_add_cflags)
11946                         ;;
11947                 (*)
11948                         case $cf_add_cflags in
11949                         (-D*)
11950                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11951
11952 CPPFLAGS=`echo "$CPPFLAGS" | \
11953         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11954                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11955
11956                                 ;;
11957                         esac
11958                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11959                         ;;
11960                 esac
11961                 ;;
11962         (*)
11963                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11964                 ;;
11965         esac
11966         ;;
11967 (yes)
11968         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11969
11970         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11971
11972         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11973                 && test -z "${cf_tst_cflags}" \
11974                 && cf_fix_cppflags=no
11975         ;;
11976 esac
11977 done
11978
11979 if test -n "$cf_new_cflags" ; then
11980         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
11981
11982 echo "${as_me:-configure}:11982: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
11983
11984         CFLAGS="$CFLAGS $cf_new_cflags"
11985 fi
11986
11987 if test -n "$cf_new_cppflags" ; then
11988         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
11989
11990 echo "${as_me:-configure}:11990: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
11991
11992         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11993 fi
11994
11995 if test -n "$cf_new_extra_cppflags" ; then
11996         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
11997
11998 echo "${as_me:-configure}:11998: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
11999
12000         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
12001 fi
12002
12003 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
12004 cat >conftest.$ac_ext <<_ACEOF
12005 #line 12005 "configure"
12006 #include "confdefs.h"
12007 #include <stdio.h>
12008 int
12009 main ()
12010 {
12011 printf("Hello world");
12012   ;
12013   return 0;
12014 }
12015 _ACEOF
12016 rm -f conftest.$ac_objext conftest$ac_exeext
12017 if { (eval echo "$as_me:12017: \"$ac_link\"") >&5
12018   (eval $ac_link) 2>&5
12019   ac_status=$?
12020   echo "$as_me:12020: \$? = $ac_status" >&5
12021   (exit $ac_status); } &&
12022          { ac_try='test -s conftest$ac_exeext'
12023   { (eval echo "$as_me:12023: \"$ac_try\"") >&5
12024   (eval $ac_try) 2>&5
12025   ac_status=$?
12026   echo "$as_me:12026: \$? = $ac_status" >&5
12027   (exit $ac_status); }; }; then
12028   :
12029 else
12030   echo "$as_me: failed program was:" >&5
12031 cat conftest.$ac_ext >&5
12032 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
12033
12034 echo "${as_me:-configure}:12034: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
12035
12036          if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
12037                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
12038
12039 echo "${as_me:-configure}:12039: testing but keeping change to \$CPPFLAGS ..." 1>&5
12040
12041          fi
12042          CFLAGS="$cf_check_flags"
12043 fi
12044 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12045 fi
12046
12047         echo "$as_me:12047: checking for XOpenDisplay" >&5
12048 echo $ECHO_N "checking for XOpenDisplay... $ECHO_C" >&6
12049 if test "${ac_cv_func_XOpenDisplay+set}" = set; then
12050   echo $ECHO_N "(cached) $ECHO_C" >&6
12051 else
12052   cat >conftest.$ac_ext <<_ACEOF
12053 #line 12053 "configure"
12054 #include "confdefs.h"
12055 /* System header to define __stub macros and hopefully few prototypes,
12056     which can conflict with char XOpenDisplay (); below.  */
12057 #include <assert.h>
12058 /* Override any gcc2 internal prototype to avoid an error.  */
12059 #ifdef __cplusplus
12060 extern "C"
12061 #endif
12062 /* We use char because int might match the return type of a gcc2
12063    builtin and then its argument prototype would still apply.  */
12064 char XOpenDisplay ();
12065 char (*f) ();
12066
12067 int
12068 main ()
12069 {
12070 /* The GNU C library defines this for functions which it implements
12071     to always fail with ENOSYS.  Some functions are actually named
12072     something starting with __ and the normal name is an alias.  */
12073 #if defined (__stub_XOpenDisplay) || defined (__stub___XOpenDisplay)
12074 choke me
12075 #else
12076 f = XOpenDisplay; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
12077 #endif
12078
12079   ;
12080   return 0;
12081 }
12082 _ACEOF
12083 rm -f conftest.$ac_objext conftest$ac_exeext
12084 if { (eval echo "$as_me:12084: \"$ac_link\"") >&5
12085   (eval $ac_link) 2>&5
12086   ac_status=$?
12087   echo "$as_me:12087: \$? = $ac_status" >&5
12088   (exit $ac_status); } &&
12089          { ac_try='test -s conftest$ac_exeext'
12090   { (eval echo "$as_me:12090: \"$ac_try\"") >&5
12091   (eval $ac_try) 2>&5
12092   ac_status=$?
12093   echo "$as_me:12093: \$? = $ac_status" >&5
12094   (exit $ac_status); }; }; then
12095   ac_cv_func_XOpenDisplay=yes
12096 else
12097   echo "$as_me: failed program was:" >&5
12098 cat conftest.$ac_ext >&5
12099 ac_cv_func_XOpenDisplay=no
12100 fi
12101 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12102 fi
12103 echo "$as_me:12103: result: $ac_cv_func_XOpenDisplay" >&5
12104 echo "${ECHO_T}$ac_cv_func_XOpenDisplay" >&6
12105 if test $ac_cv_func_XOpenDisplay = yes; then
12106   :
12107 else
12108
12109         echo "$as_me:12109: checking for XOpenDisplay in -lX11" >&5
12110 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
12111 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
12112   echo $ECHO_N "(cached) $ECHO_C" >&6
12113 else
12114   ac_check_lib_save_LIBS=$LIBS
12115 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
12116 cat >conftest.$ac_ext <<_ACEOF
12117 #line 12117 "configure"
12118 #include "confdefs.h"
12119
12120 /* Override any gcc2 internal prototype to avoid an error.  */
12121 #ifdef __cplusplus
12122 extern "C"
12123 #endif
12124 /* We use char because int might match the return type of a gcc2
12125    builtin and then its argument prototype would still apply.  */
12126 char XOpenDisplay ();
12127 int
12128 main ()
12129 {
12130 XOpenDisplay ();
12131   ;
12132   return 0;
12133 }
12134 _ACEOF
12135 rm -f conftest.$ac_objext conftest$ac_exeext
12136 if { (eval echo "$as_me:12136: \"$ac_link\"") >&5
12137   (eval $ac_link) 2>&5
12138   ac_status=$?
12139   echo "$as_me:12139: \$? = $ac_status" >&5
12140   (exit $ac_status); } &&
12141          { ac_try='test -s conftest$ac_exeext'
12142   { (eval echo "$as_me:12142: \"$ac_try\"") >&5
12143   (eval $ac_try) 2>&5
12144   ac_status=$?
12145   echo "$as_me:12145: \$? = $ac_status" >&5
12146   (exit $ac_status); }; }; then
12147   ac_cv_lib_X11_XOpenDisplay=yes
12148 else
12149   echo "$as_me: failed program was:" >&5
12150 cat conftest.$ac_ext >&5
12151 ac_cv_lib_X11_XOpenDisplay=no
12152 fi
12153 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12154 LIBS=$ac_check_lib_save_LIBS
12155 fi
12156 echo "$as_me:12156: result: $ac_cv_lib_X11_XOpenDisplay" >&5
12157 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
12158 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
12159
12160 cf_add_libs="-lX11"
12161 # Filter out duplicates - this happens with badly-designed ".pc" files...
12162 for cf_add_1lib in $LIBS
12163 do
12164         for cf_add_2lib in $cf_add_libs
12165         do
12166                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12167                 then
12168                         cf_add_1lib=
12169                         break
12170                 fi
12171         done
12172         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12173 done
12174 LIBS="$cf_add_libs"
12175
12176 fi
12177
12178 fi
12179
12180         echo "$as_me:12180: checking for XtAppInitialize" >&5
12181 echo $ECHO_N "checking for XtAppInitialize... $ECHO_C" >&6
12182 if test "${ac_cv_func_XtAppInitialize+set}" = set; then
12183   echo $ECHO_N "(cached) $ECHO_C" >&6
12184 else
12185   cat >conftest.$ac_ext <<_ACEOF
12186 #line 12186 "configure"
12187 #include "confdefs.h"
12188 /* System header to define __stub macros and hopefully few prototypes,
12189     which can conflict with char XtAppInitialize (); below.  */
12190 #include <assert.h>
12191 /* Override any gcc2 internal prototype to avoid an error.  */
12192 #ifdef __cplusplus
12193 extern "C"
12194 #endif
12195 /* We use char because int might match the return type of a gcc2
12196    builtin and then its argument prototype would still apply.  */
12197 char XtAppInitialize ();
12198 char (*f) ();
12199
12200 int
12201 main ()
12202 {
12203 /* The GNU C library defines this for functions which it implements
12204     to always fail with ENOSYS.  Some functions are actually named
12205     something starting with __ and the normal name is an alias.  */
12206 #if defined (__stub_XtAppInitialize) || defined (__stub___XtAppInitialize)
12207 choke me
12208 #else
12209 f = XtAppInitialize; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
12210 #endif
12211
12212   ;
12213   return 0;
12214 }
12215 _ACEOF
12216 rm -f conftest.$ac_objext conftest$ac_exeext
12217 if { (eval echo "$as_me:12217: \"$ac_link\"") >&5
12218   (eval $ac_link) 2>&5
12219   ac_status=$?
12220   echo "$as_me:12220: \$? = $ac_status" >&5
12221   (exit $ac_status); } &&
12222          { ac_try='test -s conftest$ac_exeext'
12223   { (eval echo "$as_me:12223: \"$ac_try\"") >&5
12224   (eval $ac_try) 2>&5
12225   ac_status=$?
12226   echo "$as_me:12226: \$? = $ac_status" >&5
12227   (exit $ac_status); }; }; then
12228   ac_cv_func_XtAppInitialize=yes
12229 else
12230   echo "$as_me: failed program was:" >&5
12231 cat conftest.$ac_ext >&5
12232 ac_cv_func_XtAppInitialize=no
12233 fi
12234 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12235 fi
12236 echo "$as_me:12236: result: $ac_cv_func_XtAppInitialize" >&5
12237 echo "${ECHO_T}$ac_cv_func_XtAppInitialize" >&6
12238 if test $ac_cv_func_XtAppInitialize = yes; then
12239   :
12240 else
12241
12242         echo "$as_me:12242: checking for XtAppInitialize in -lXt" >&5
12243 echo $ECHO_N "checking for XtAppInitialize in -lXt... $ECHO_C" >&6
12244 if test "${ac_cv_lib_Xt_XtAppInitialize+set}" = set; then
12245   echo $ECHO_N "(cached) $ECHO_C" >&6
12246 else
12247   ac_check_lib_save_LIBS=$LIBS
12248 LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
12249 cat >conftest.$ac_ext <<_ACEOF
12250 #line 12250 "configure"
12251 #include "confdefs.h"
12252
12253 /* Override any gcc2 internal prototype to avoid an error.  */
12254 #ifdef __cplusplus
12255 extern "C"
12256 #endif
12257 /* We use char because int might match the return type of a gcc2
12258    builtin and then its argument prototype would still apply.  */
12259 char XtAppInitialize ();
12260 int
12261 main ()
12262 {
12263 XtAppInitialize ();
12264   ;
12265   return 0;
12266 }
12267 _ACEOF
12268 rm -f conftest.$ac_objext conftest$ac_exeext
12269 if { (eval echo "$as_me:12269: \"$ac_link\"") >&5
12270   (eval $ac_link) 2>&5
12271   ac_status=$?
12272   echo "$as_me:12272: \$? = $ac_status" >&5
12273   (exit $ac_status); } &&
12274          { ac_try='test -s conftest$ac_exeext'
12275   { (eval echo "$as_me:12275: \"$ac_try\"") >&5
12276   (eval $ac_try) 2>&5
12277   ac_status=$?
12278   echo "$as_me:12278: \$? = $ac_status" >&5
12279   (exit $ac_status); }; }; then
12280   ac_cv_lib_Xt_XtAppInitialize=yes
12281 else
12282   echo "$as_me: failed program was:" >&5
12283 cat conftest.$ac_ext >&5
12284 ac_cv_lib_Xt_XtAppInitialize=no
12285 fi
12286 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12287 LIBS=$ac_check_lib_save_LIBS
12288 fi
12289 echo "$as_me:12289: result: $ac_cv_lib_Xt_XtAppInitialize" >&5
12290 echo "${ECHO_T}$ac_cv_lib_Xt_XtAppInitialize" >&6
12291 if test $ac_cv_lib_Xt_XtAppInitialize = yes; then
12292
12293 cat >>confdefs.h <<\EOF
12294 #define HAVE_LIBXT 1
12295 EOF
12296
12297                  cf_have_X_LIBS=Xt
12298                  LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS"
12299 fi
12300
12301 fi
12302
12303 fi
12304
12305 if test $cf_have_X_LIBS = no ; then
12306         { echo "$as_me:12306: WARNING: Unable to successfully link X Toolkit library (-lXt) with
12307 test program.  You will have to check and add the proper libraries by hand
12308 to makefile." >&5
12309 echo "$as_me: WARNING: Unable to successfully link X Toolkit library (-lXt) with
12310 test program.  You will have to check and add the proper libraries by hand
12311 to makefile." >&2;}
12312 fi
12313
12314 cf_x_athena_root=$cf_x_athena
12315 cf_x_athena_inc=""
12316
12317 for cf_path in default \
12318         /usr/contrib/X11R6 \
12319         /usr/contrib/X11R5 \
12320         /usr/lib/X11R5 \
12321         /usr/local
12322 do
12323         if test -z "$cf_x_athena_inc" ; then
12324                 cf_save="$CPPFLAGS"
12325                 cf_test=X11/$cf_x_athena_root/SimpleMenu.h
12326                 if test $cf_path != default ; then
12327                         CPPFLAGS="$cf_save -I$cf_path/include"
12328                         echo "$as_me:12328: checking for $cf_test in $cf_path" >&5
12329 echo $ECHO_N "checking for $cf_test in $cf_path... $ECHO_C" >&6
12330                 else
12331                         echo "$as_me:12331: checking for $cf_test" >&5
12332 echo $ECHO_N "checking for $cf_test... $ECHO_C" >&6
12333                 fi
12334                 cat >conftest.$ac_ext <<_ACEOF
12335 #line 12335 "configure"
12336 #include "confdefs.h"
12337
12338 #include <X11/Intrinsic.h>
12339 #include <$cf_test>
12340 int
12341 main ()
12342 {
12343
12344   ;
12345   return 0;
12346 }
12347 _ACEOF
12348 rm -f conftest.$ac_objext
12349 if { (eval echo "$as_me:12349: \"$ac_compile\"") >&5
12350   (eval $ac_compile) 2>&5
12351   ac_status=$?
12352   echo "$as_me:12352: \$? = $ac_status" >&5
12353   (exit $ac_status); } &&
12354          { ac_try='test -s conftest.$ac_objext'
12355   { (eval echo "$as_me:12355: \"$ac_try\"") >&5
12356   (eval $ac_try) 2>&5
12357   ac_status=$?
12358   echo "$as_me:12358: \$? = $ac_status" >&5
12359   (exit $ac_status); }; }; then
12360   cf_result=yes
12361 else
12362   echo "$as_me: failed program was:" >&5
12363 cat conftest.$ac_ext >&5
12364 cf_result=no
12365 fi
12366 rm -f conftest.$ac_objext conftest.$ac_ext
12367                 echo "$as_me:12367: result: $cf_result" >&5
12368 echo "${ECHO_T}$cf_result" >&6
12369                 if test "$cf_result" = yes ; then
12370                         cf_x_athena_inc=$cf_path
12371                         break
12372                 else
12373                         CPPFLAGS="$cf_save"
12374                 fi
12375         fi
12376 done
12377
12378 if test -z "$cf_x_athena_inc" ; then
12379         { echo "$as_me:12379: WARNING: Unable to successfully find Athena header files with test program" >&5
12380 echo "$as_me: WARNING: Unable to successfully find Athena header files with test program" >&2;}
12381 elif test "$cf_x_athena_inc" != default ; then
12382         CPPFLAGS="$CPPFLAGS -I$cf_x_athena_inc"
12383 fi
12384
12385 cf_x_athena_root=$cf_x_athena
12386 cf_x_athena_lib=""
12387
12388 for cf_path in default \
12389         /usr/contrib/X11R6 \
12390         /usr/contrib/X11R5 \
12391         /usr/lib/X11R5 \
12392         /usr/local
12393 do
12394         for cf_lib in \
12395                 ${cf_x_athena_root} \
12396                 ${cf_x_athena_root}7 \
12397                 ${cf_x_athena_root}6
12398         do
12399         for cf_libs in \
12400                 "-l$cf_lib -lXmu" \
12401                 "-l$cf_lib -lXpm -lXmu" \
12402                 "-l${cf_lib}_s -lXmu_s"
12403         do
12404                 if test -z "$cf_x_athena_lib" ; then
12405                         cf_save="$LIBS"
12406                         cf_test=XawSimpleMenuAddGlobalActions
12407                         if test $cf_path != default ; then
12408
12409 cf_add_libs="-L$cf_path/lib $cf_libs"
12410 # Filter out duplicates - this happens with badly-designed ".pc" files...
12411 for cf_add_1lib in $LIBS
12412 do
12413         for cf_add_2lib in $cf_add_libs
12414         do
12415                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12416                 then
12417                         cf_add_1lib=
12418                         break
12419                 fi
12420         done
12421         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12422 done
12423 LIBS="$cf_add_libs"
12424
12425                                 echo "$as_me:12425: checking for $cf_libs in $cf_path" >&5
12426 echo $ECHO_N "checking for $cf_libs in $cf_path... $ECHO_C" >&6
12427                         else
12428
12429 cf_add_libs="$cf_libs"
12430 # Filter out duplicates - this happens with badly-designed ".pc" files...
12431 for cf_add_1lib in $LIBS
12432 do
12433         for cf_add_2lib in $cf_add_libs
12434         do
12435                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12436                 then
12437                         cf_add_1lib=
12438                         break
12439                 fi
12440         done
12441         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12442 done
12443 LIBS="$cf_add_libs"
12444
12445                                 echo "$as_me:12445: checking for $cf_test in $cf_libs" >&5
12446 echo $ECHO_N "checking for $cf_test in $cf_libs... $ECHO_C" >&6
12447                         fi
12448                         cat >conftest.$ac_ext <<_ACEOF
12449 #line 12449 "configure"
12450 #include "confdefs.h"
12451
12452 #include <X11/Intrinsic.h>
12453 #include <X11/$cf_x_athena_root/SimpleMenu.h>
12454
12455 int
12456 main ()
12457 {
12458
12459 $cf_test((XtAppContext) 0)
12460   ;
12461   return 0;
12462 }
12463 _ACEOF
12464 rm -f conftest.$ac_objext conftest$ac_exeext
12465 if { (eval echo "$as_me:12465: \"$ac_link\"") >&5
12466   (eval $ac_link) 2>&5
12467   ac_status=$?
12468   echo "$as_me:12468: \$? = $ac_status" >&5
12469   (exit $ac_status); } &&
12470          { ac_try='test -s conftest$ac_exeext'
12471   { (eval echo "$as_me:12471: \"$ac_try\"") >&5
12472   (eval $ac_try) 2>&5
12473   ac_status=$?
12474   echo "$as_me:12474: \$? = $ac_status" >&5
12475   (exit $ac_status); }; }; then
12476   cf_result=yes
12477 else
12478   echo "$as_me: failed program was:" >&5
12479 cat conftest.$ac_ext >&5
12480 cf_result=no
12481 fi
12482 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12483                         echo "$as_me:12483: result: $cf_result" >&5
12484 echo "${ECHO_T}$cf_result" >&6
12485                         if test "$cf_result" = yes ; then
12486                                 cf_x_athena_lib="$cf_libs"
12487                                 break
12488                         fi
12489                         LIBS="$cf_save"
12490                 fi
12491         done # cf_libs
12492                 test -n "$cf_x_athena_lib" && break
12493         done # cf_lib
12494 done
12495
12496 if test -z "$cf_x_athena_lib" ; then
12497         { { echo "$as_me:12497: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&5
12498 echo "$as_me: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&2;}
12499    { (exit 1); exit 1; }; }
12500 fi
12501
12502 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
12503
12504 cat >>confdefs.h <<EOF
12505 #define $cf_x_athena_LIBS 1
12506 EOF
12507
12508 fi
12509
12510 if test -n "$ac_tool_prefix"; then
12511   for ac_prog in xcurses-config
12512   do
12513     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
12514 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
12515 echo "$as_me:12515: checking for $ac_word" >&5
12516 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
12517 if test "${ac_cv_prog_XCURSES_CONFIG+set}" = set; then
12518   echo $ECHO_N "(cached) $ECHO_C" >&6
12519 else
12520   if test -n "$XCURSES_CONFIG"; then
12521   ac_cv_prog_XCURSES_CONFIG="$XCURSES_CONFIG" # Let the user override the test.
12522 else
12523   ac_save_IFS=$IFS; IFS=$ac_path_separator
12524 ac_dummy="$PATH"
12525 for ac_dir in $ac_dummy; do
12526   IFS=$ac_save_IFS
12527   test -z "$ac_dir" && ac_dir=.
12528   $as_executable_p "$ac_dir/$ac_word" || continue
12529 ac_cv_prog_XCURSES_CONFIG="$ac_tool_prefix$ac_prog"
12530 echo "$as_me:12530: found $ac_dir/$ac_word" >&5
12531 break
12532 done
12533
12534 fi
12535 fi
12536 XCURSES_CONFIG=$ac_cv_prog_XCURSES_CONFIG
12537 if test -n "$XCURSES_CONFIG"; then
12538   echo "$as_me:12538: result: $XCURSES_CONFIG" >&5
12539 echo "${ECHO_T}$XCURSES_CONFIG" >&6
12540 else
12541   echo "$as_me:12541: result: no" >&5
12542 echo "${ECHO_T}no" >&6
12543 fi
12544
12545     test -n "$XCURSES_CONFIG" && break
12546   done
12547 fi
12548 if test -z "$XCURSES_CONFIG"; then
12549   ac_ct_XCURSES_CONFIG=$XCURSES_CONFIG
12550   for ac_prog in xcurses-config
12551 do
12552   # Extract the first word of "$ac_prog", so it can be a program name with args.
12553 set dummy $ac_prog; ac_word=$2
12554 echo "$as_me:12554: checking for $ac_word" >&5
12555 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
12556 if test "${ac_cv_prog_ac_ct_XCURSES_CONFIG+set}" = set; then
12557   echo $ECHO_N "(cached) $ECHO_C" >&6
12558 else
12559   if test -n "$ac_ct_XCURSES_CONFIG"; then
12560   ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_ct_XCURSES_CONFIG" # Let the user override the test.
12561 else
12562   ac_save_IFS=$IFS; IFS=$ac_path_separator
12563 ac_dummy="$PATH"
12564 for ac_dir in $ac_dummy; do
12565   IFS=$ac_save_IFS
12566   test -z "$ac_dir" && ac_dir=.
12567   $as_executable_p "$ac_dir/$ac_word" || continue
12568 ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_prog"
12569 echo "$as_me:12569: found $ac_dir/$ac_word" >&5
12570 break
12571 done
12572
12573 fi
12574 fi
12575 ac_ct_XCURSES_CONFIG=$ac_cv_prog_ac_ct_XCURSES_CONFIG
12576 if test -n "$ac_ct_XCURSES_CONFIG"; then
12577   echo "$as_me:12577: result: $ac_ct_XCURSES_CONFIG" >&5
12578 echo "${ECHO_T}$ac_ct_XCURSES_CONFIG" >&6
12579 else
12580   echo "$as_me:12580: result: no" >&5
12581 echo "${ECHO_T}no" >&6
12582 fi
12583
12584   test -n "$ac_ct_XCURSES_CONFIG" && break
12585 done
12586 test -n "$ac_ct_XCURSES_CONFIG" || ac_ct_XCURSES_CONFIG="none"
12587
12588   XCURSES_CONFIG=$ac_ct_XCURSES_CONFIG
12589 fi
12590
12591 if test "$XCURSES_CONFIG" != none ; then
12592
12593 CPPFLAGS="$CPPFLAGS `$XCURSES_CONFIG --cflags`"
12594
12595 cf_add_libs="`$XCURSES_CONFIG --libs`"
12596 # Filter out duplicates - this happens with badly-designed ".pc" files...
12597 for cf_add_1lib in $LIBS
12598 do
12599         for cf_add_2lib in $cf_add_libs
12600         do
12601                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12602                 then
12603                         cf_add_1lib=
12604                         break
12605                 fi
12606         done
12607         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12608 done
12609 LIBS="$cf_add_libs"
12610
12611 cf_cv_lib_XCurses=yes
12612
12613 else
12614
12615 LDFLAGS="$LDFLAGS $X_LIBS"
12616
12617 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
12618
12619 echo "${as_me:-configure}:12619: testing checking additions to CFLAGS ..." 1>&5
12620
12621 cf_check_cflags="$CFLAGS"
12622 cf_check_cppflags="$CPPFLAGS"
12623
12624 cf_fix_cppflags=no
12625 cf_new_cflags=
12626 cf_new_cppflags=
12627 cf_new_extra_cppflags=
12628
12629 for cf_add_cflags in $X_CFLAGS
12630 do
12631 case $cf_fix_cppflags in
12632 (no)
12633         case $cf_add_cflags in
12634         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12635                 case $cf_add_cflags in
12636                 (-D*)
12637                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12638
12639                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12640                                 && test -z "${cf_tst_cflags}" \
12641                                 && cf_fix_cppflags=yes
12642
12643                         if test $cf_fix_cppflags = yes ; then
12644                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12645                                 continue
12646                         elif test "${cf_tst_cflags}" = "\"'" ; then
12647                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12648                                 continue
12649                         fi
12650                         ;;
12651                 esac
12652                 case "$CPPFLAGS" in
12653                 (*$cf_add_cflags)
12654                         ;;
12655                 (*)
12656                         case $cf_add_cflags in
12657                         (-D*)
12658                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12659
12660 CPPFLAGS=`echo "$CPPFLAGS" | \
12661         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12662                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12663
12664                                 ;;
12665                         esac
12666                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
12667                         ;;
12668                 esac
12669                 ;;
12670         (*)
12671                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
12672                 ;;
12673         esac
12674         ;;
12675 (yes)
12676         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12677
12678         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12679
12680         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12681                 && test -z "${cf_tst_cflags}" \
12682                 && cf_fix_cppflags=no
12683         ;;
12684 esac
12685 done
12686
12687 if test -n "$cf_new_cflags" ; then
12688         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
12689
12690 echo "${as_me:-configure}:12690: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
12691
12692         CFLAGS="$CFLAGS $cf_new_cflags"
12693 fi
12694
12695 if test -n "$cf_new_cppflags" ; then
12696         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
12697
12698 echo "${as_me:-configure}:12698: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
12699
12700         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
12701 fi
12702
12703 if test -n "$cf_new_extra_cppflags" ; then
12704         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
12705
12706 echo "${as_me:-configure}:12706: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
12707
12708         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
12709 fi
12710
12711 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
12712 cat >conftest.$ac_ext <<_ACEOF
12713 #line 12713 "configure"
12714 #include "confdefs.h"
12715 #include <stdio.h>
12716 int
12717 main ()
12718 {
12719 printf("Hello world");
12720   ;
12721   return 0;
12722 }
12723 _ACEOF
12724 rm -f conftest.$ac_objext conftest$ac_exeext
12725 if { (eval echo "$as_me:12725: \"$ac_link\"") >&5
12726   (eval $ac_link) 2>&5
12727   ac_status=$?
12728   echo "$as_me:12728: \$? = $ac_status" >&5
12729   (exit $ac_status); } &&
12730          { ac_try='test -s conftest$ac_exeext'
12731   { (eval echo "$as_me:12731: \"$ac_try\"") >&5
12732   (eval $ac_try) 2>&5
12733   ac_status=$?
12734   echo "$as_me:12734: \$? = $ac_status" >&5
12735   (exit $ac_status); }; }; then
12736   :
12737 else
12738   echo "$as_me: failed program was:" >&5
12739 cat conftest.$ac_ext >&5
12740 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
12741
12742 echo "${as_me:-configure}:12742: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
12743
12744          if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
12745                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
12746
12747 echo "${as_me:-configure}:12747: testing but keeping change to \$CPPFLAGS ..." 1>&5
12748
12749          fi
12750          CFLAGS="$cf_check_flags"
12751 fi
12752 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12753 fi
12754
12755 echo "$as_me:12755: checking for XOpenDisplay in -lX11" >&5
12756 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
12757 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
12758   echo $ECHO_N "(cached) $ECHO_C" >&6
12759 else
12760   ac_check_lib_save_LIBS=$LIBS
12761 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
12762 cat >conftest.$ac_ext <<_ACEOF
12763 #line 12763 "configure"
12764 #include "confdefs.h"
12765
12766 /* Override any gcc2 internal prototype to avoid an error.  */
12767 #ifdef __cplusplus
12768 extern "C"
12769 #endif
12770 /* We use char because int might match the return type of a gcc2
12771    builtin and then its argument prototype would still apply.  */
12772 char XOpenDisplay ();
12773 int
12774 main ()
12775 {
12776 XOpenDisplay ();
12777   ;
12778   return 0;
12779 }
12780 _ACEOF
12781 rm -f conftest.$ac_objext conftest$ac_exeext
12782 if { (eval echo "$as_me:12782: \"$ac_link\"") >&5
12783   (eval $ac_link) 2>&5
12784   ac_status=$?
12785   echo "$as_me:12785: \$? = $ac_status" >&5
12786   (exit $ac_status); } &&
12787          { ac_try='test -s conftest$ac_exeext'
12788   { (eval echo "$as_me:12788: \"$ac_try\"") >&5
12789   (eval $ac_try) 2>&5
12790   ac_status=$?
12791   echo "$as_me:12791: \$? = $ac_status" >&5
12792   (exit $ac_status); }; }; then
12793   ac_cv_lib_X11_XOpenDisplay=yes
12794 else
12795   echo "$as_me: failed program was:" >&5
12796 cat conftest.$ac_ext >&5
12797 ac_cv_lib_X11_XOpenDisplay=no
12798 fi
12799 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12800 LIBS=$ac_check_lib_save_LIBS
12801 fi
12802 echo "$as_me:12802: result: $ac_cv_lib_X11_XOpenDisplay" >&5
12803 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
12804 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
12805
12806 cf_add_libs="-lX11"
12807 # Filter out duplicates - this happens with badly-designed ".pc" files...
12808 for cf_add_1lib in $LIBS
12809 do
12810         for cf_add_2lib in $cf_add_libs
12811         do
12812                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12813                 then
12814                         cf_add_1lib=
12815                         break
12816                 fi
12817         done
12818         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12819 done
12820 LIBS="$cf_add_libs"
12821
12822 fi
12823
12824 echo "$as_me:12824: checking for XCurses library" >&5
12825 echo $ECHO_N "checking for XCurses library... $ECHO_C" >&6
12826 if test "${cf_cv_lib_XCurses+set}" = set; then
12827   echo $ECHO_N "(cached) $ECHO_C" >&6
12828 else
12829
12830 cf_add_libs="-lXCurses"
12831 # Filter out duplicates - this happens with badly-designed ".pc" files...
12832 for cf_add_1lib in $LIBS
12833 do
12834         for cf_add_2lib in $cf_add_libs
12835         do
12836                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12837                 then
12838                         cf_add_1lib=
12839                         break
12840                 fi
12841         done
12842         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12843 done
12844 LIBS="$cf_add_libs"
12845
12846 cat >conftest.$ac_ext <<_ACEOF
12847 #line 12847 "configure"
12848 #include "confdefs.h"
12849
12850 #include <xcurses.h>
12851 char *XCursesProgramName = "test";
12852
12853 int
12854 main ()
12855 {
12856 XCursesExit();
12857   ;
12858   return 0;
12859 }
12860 _ACEOF
12861 rm -f conftest.$ac_objext conftest$ac_exeext
12862 if { (eval echo "$as_me:12862: \"$ac_link\"") >&5
12863   (eval $ac_link) 2>&5
12864   ac_status=$?
12865   echo "$as_me:12865: \$? = $ac_status" >&5
12866   (exit $ac_status); } &&
12867          { ac_try='test -s conftest$ac_exeext'
12868   { (eval echo "$as_me:12868: \"$ac_try\"") >&5
12869   (eval $ac_try) 2>&5
12870   ac_status=$?
12871   echo "$as_me:12871: \$? = $ac_status" >&5
12872   (exit $ac_status); }; }; then
12873   cf_cv_lib_XCurses=yes
12874 else
12875   echo "$as_me: failed program was:" >&5
12876 cat conftest.$ac_ext >&5
12877 cf_cv_lib_XCurses=no
12878 fi
12879 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12880
12881 fi
12882 echo "$as_me:12882: result: $cf_cv_lib_XCurses" >&5
12883 echo "${ECHO_T}$cf_cv_lib_XCurses" >&6
12884
12885 fi
12886
12887 if test $cf_cv_lib_XCurses = yes ; then
12888
12889 cat >>confdefs.h <<\EOF
12890 #define UNIX 1
12891 EOF
12892
12893 cat >>confdefs.h <<\EOF
12894 #define XCURSES 1
12895 EOF
12896
12897         echo "$as_me:12897: checking for xcurses.h" >&5
12898 echo $ECHO_N "checking for xcurses.h... $ECHO_C" >&6
12899 if test "${ac_cv_header_xcurses_h+set}" = set; then
12900   echo $ECHO_N "(cached) $ECHO_C" >&6
12901 else
12902   cat >conftest.$ac_ext <<_ACEOF
12903 #line 12903 "configure"
12904 #include "confdefs.h"
12905 #include <xcurses.h>
12906 _ACEOF
12907 if { (eval echo "$as_me:12907: \"$ac_cpp conftest.$ac_ext\"") >&5
12908   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
12909   ac_status=$?
12910   egrep -v '^ *\+' conftest.er1 >conftest.err
12911   rm -f conftest.er1
12912   cat conftest.err >&5
12913   echo "$as_me:12913: \$? = $ac_status" >&5
12914   (exit $ac_status); } >/dev/null; then
12915   if test -s conftest.err; then
12916     ac_cpp_err=$ac_c_preproc_warn_flag
12917   else
12918     ac_cpp_err=
12919   fi
12920 else
12921   ac_cpp_err=yes
12922 fi
12923 if test -z "$ac_cpp_err"; then
12924   ac_cv_header_xcurses_h=yes
12925 else
12926   echo "$as_me: failed program was:" >&5
12927   cat conftest.$ac_ext >&5
12928   ac_cv_header_xcurses_h=no
12929 fi
12930 rm -f conftest.err conftest.$ac_ext
12931 fi
12932 echo "$as_me:12932: result: $ac_cv_header_xcurses_h" >&5
12933 echo "${ECHO_T}$ac_cv_header_xcurses_h" >&6
12934 if test $ac_cv_header_xcurses_h = yes; then
12935
12936 cat >>confdefs.h <<\EOF
12937 #define HAVE_XCURSES 1
12938 EOF
12939
12940 fi
12941
12942 else
12943         { { echo "$as_me:12943: error: Cannot link with XCurses" >&5
12944 echo "$as_me: error: Cannot link with XCurses" >&2;}
12945    { (exit 1); exit 1; }; }
12946 fi
12947
12948         ;;
12949 (*)
12950         { { echo "$as_me:12950: error: unexpected screen-value: $cf_cv_screen" >&5
12951 echo "$as_me: error: unexpected screen-value: $cf_cv_screen" >&2;}
12952    { (exit 1); exit 1; }; }
12953         ;;
12954 esac
12955
12956 case $cf_cv_screen in
12957 (ncurses*)
12958         cf_cv_libtype=`echo "$cf_cv_screen" | sed -e 's/^ncurses//'`
12959         ;;
12960 (curses|curses_*)
12961
12962 echo "$as_me:12962: checking for NetBSD form.h" >&5
12963 echo $ECHO_N "checking for NetBSD form.h... $ECHO_C" >&6
12964 if test "${cf_cv_netbsd_form_h+set}" = set; then
12965   echo $ECHO_N "(cached) $ECHO_C" >&6
12966 else
12967
12968 cat >conftest.$ac_ext <<_ACEOF
12969 #line 12969 "configure"
12970 #include "confdefs.h"
12971
12972 #include <${cf_cv_ncurses_header:-curses.h}>
12973 #include <form.h>
12974
12975 int
12976 main ()
12977 {
12978
12979         FORM *form;
12980         int y = current_field(form)->cursor_ypos;
12981         int x = current_field(form)->cursor_xpos;
12982
12983   ;
12984   return 0;
12985 }
12986 _ACEOF
12987 rm -f conftest.$ac_objext
12988 if { (eval echo "$as_me:12988: \"$ac_compile\"") >&5
12989   (eval $ac_compile) 2>&5
12990   ac_status=$?
12991   echo "$as_me:12991: \$? = $ac_status" >&5
12992   (exit $ac_status); } &&
12993          { ac_try='test -s conftest.$ac_objext'
12994   { (eval echo "$as_me:12994: \"$ac_try\"") >&5
12995   (eval $ac_try) 2>&5
12996   ac_status=$?
12997   echo "$as_me:12997: \$? = $ac_status" >&5
12998   (exit $ac_status); }; }; then
12999   cf_cv_netbsd_form_h=yes
13000
13001 else
13002   echo "$as_me: failed program was:" >&5
13003 cat conftest.$ac_ext >&5
13004 cf_cv_netbsd_form_h=no
13005 fi
13006 rm -f conftest.$ac_objext conftest.$ac_ext
13007
13008 fi
13009 echo "$as_me:13009: result: $cf_cv_netbsd_form_h" >&5
13010 echo "${ECHO_T}$cf_cv_netbsd_form_h" >&6
13011
13012 test "$cf_cv_netbsd_form_h" = yes &&
13013 cat >>confdefs.h <<\EOF
13014 #define HAVE_NETBSD_FORM_H 1
13015 EOF
13016
13017 echo "$as_me:13017: checking for NetBSD menu.h" >&5
13018 echo $ECHO_N "checking for NetBSD menu.h... $ECHO_C" >&6
13019 if test "${cf_cv_netbsd_menu_h+set}" = set; then
13020   echo $ECHO_N "(cached) $ECHO_C" >&6
13021 else
13022
13023 cat >conftest.$ac_ext <<_ACEOF
13024 #line 13024 "configure"
13025 #include "confdefs.h"
13026
13027 #include <${cf_cv_ncurses_header:-curses.h}>
13028 #include <menu.h>
13029
13030 int
13031 main ()
13032 {
13033
13034         MENU *menu;
13035         int y = menu->max_item_width;
13036
13037   ;
13038   return 0;
13039 }
13040 _ACEOF
13041 rm -f conftest.$ac_objext
13042 if { (eval echo "$as_me:13042: \"$ac_compile\"") >&5
13043   (eval $ac_compile) 2>&5
13044   ac_status=$?
13045   echo "$as_me:13045: \$? = $ac_status" >&5
13046   (exit $ac_status); } &&
13047          { ac_try='test -s conftest.$ac_objext'
13048   { (eval echo "$as_me:13048: \"$ac_try\"") >&5
13049   (eval $ac_try) 2>&5
13050   ac_status=$?
13051   echo "$as_me:13051: \$? = $ac_status" >&5
13052   (exit $ac_status); }; }; then
13053   cf_cv_netbsd_menu_h=yes
13054
13055 else
13056   echo "$as_me: failed program was:" >&5
13057 cat conftest.$ac_ext >&5
13058 cf_cv_netbsd_menu_h=no
13059 fi
13060 rm -f conftest.$ac_objext conftest.$ac_ext
13061
13062 fi
13063 echo "$as_me:13063: result: $cf_cv_netbsd_menu_h" >&5
13064 echo "${ECHO_T}$cf_cv_netbsd_menu_h" >&6
13065
13066 test "$cf_cv_netbsd_menu_h" = yes &&
13067 cat >>confdefs.h <<\EOF
13068 #define HAVE_NETBSD_MENU_H 1
13069 EOF
13070
13071         ;;
13072 esac
13073
13074 case $cf_cv_screen in
13075 (pdcurses)
13076         ;;
13077 (*)
13078         # look for curses-related libraries
13079
13080 as_ac_Lib=`echo "ac_cv_lib_panel$cf_cv_libtype''_new_panel" | $as_tr_sh`
13081 echo "$as_me:13081: checking for new_panel in -lpanel$cf_cv_libtype" >&5
13082 echo $ECHO_N "checking for new_panel in -lpanel$cf_cv_libtype... $ECHO_C" >&6
13083 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
13084   echo $ECHO_N "(cached) $ECHO_C" >&6
13085 else
13086   ac_check_lib_save_LIBS=$LIBS
13087 LIBS="-lpanel$cf_cv_libtype  $LIBS"
13088 cat >conftest.$ac_ext <<_ACEOF
13089 #line 13089 "configure"
13090 #include "confdefs.h"
13091
13092 /* Override any gcc2 internal prototype to avoid an error.  */
13093 #ifdef __cplusplus
13094 extern "C"
13095 #endif
13096 /* We use char because int might match the return type of a gcc2
13097    builtin and then its argument prototype would still apply.  */
13098 char new_panel ();
13099 int
13100 main ()
13101 {
13102 new_panel ();
13103   ;
13104   return 0;
13105 }
13106 _ACEOF
13107 rm -f conftest.$ac_objext conftest$ac_exeext
13108 if { (eval echo "$as_me:13108: \"$ac_link\"") >&5
13109   (eval $ac_link) 2>&5
13110   ac_status=$?
13111   echo "$as_me:13111: \$? = $ac_status" >&5
13112   (exit $ac_status); } &&
13113          { ac_try='test -s conftest$ac_exeext'
13114   { (eval echo "$as_me:13114: \"$ac_try\"") >&5
13115   (eval $ac_try) 2>&5
13116   ac_status=$?
13117   echo "$as_me:13117: \$? = $ac_status" >&5
13118   (exit $ac_status); }; }; then
13119   eval "$as_ac_Lib=yes"
13120 else
13121   echo "$as_me: failed program was:" >&5
13122 cat conftest.$ac_ext >&5
13123 eval "$as_ac_Lib=no"
13124 fi
13125 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13126 LIBS=$ac_check_lib_save_LIBS
13127 fi
13128 echo "$as_me:13128: result: `eval echo '${'$as_ac_Lib'}'`" >&5
13129 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
13130 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
13131
13132 cf_upper=`echo "have_libpanel" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
13133
13134 cf_add_libs="-lpanel$cf_cv_libtype"
13135 # Filter out duplicates - this happens with badly-designed ".pc" files...
13136 for cf_add_1lib in $LIBS
13137 do
13138         for cf_add_2lib in $cf_add_libs
13139         do
13140                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13141                 then
13142                         cf_add_1lib=
13143                         break
13144                 fi
13145         done
13146         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13147 done
13148 LIBS="$cf_add_libs"
13149
13150 cat >>confdefs.h <<EOF
13151 #define $cf_upper 1
13152 EOF
13153
13154 fi
13155
13156 as_ac_Lib=`echo "ac_cv_lib_menu$cf_cv_libtype''_menu_driver" | $as_tr_sh`
13157 echo "$as_me:13157: checking for menu_driver in -lmenu$cf_cv_libtype" >&5
13158 echo $ECHO_N "checking for menu_driver in -lmenu$cf_cv_libtype... $ECHO_C" >&6
13159 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
13160   echo $ECHO_N "(cached) $ECHO_C" >&6
13161 else
13162   ac_check_lib_save_LIBS=$LIBS
13163 LIBS="-lmenu$cf_cv_libtype  $LIBS"
13164 cat >conftest.$ac_ext <<_ACEOF
13165 #line 13165 "configure"
13166 #include "confdefs.h"
13167
13168 /* Override any gcc2 internal prototype to avoid an error.  */
13169 #ifdef __cplusplus
13170 extern "C"
13171 #endif
13172 /* We use char because int might match the return type of a gcc2
13173    builtin and then its argument prototype would still apply.  */
13174 char menu_driver ();
13175 int
13176 main ()
13177 {
13178 menu_driver ();
13179   ;
13180   return 0;
13181 }
13182 _ACEOF
13183 rm -f conftest.$ac_objext conftest$ac_exeext
13184 if { (eval echo "$as_me:13184: \"$ac_link\"") >&5
13185   (eval $ac_link) 2>&5
13186   ac_status=$?
13187   echo "$as_me:13187: \$? = $ac_status" >&5
13188   (exit $ac_status); } &&
13189          { ac_try='test -s conftest$ac_exeext'
13190   { (eval echo "$as_me:13190: \"$ac_try\"") >&5
13191   (eval $ac_try) 2>&5
13192   ac_status=$?
13193   echo "$as_me:13193: \$? = $ac_status" >&5
13194   (exit $ac_status); }; }; then
13195   eval "$as_ac_Lib=yes"
13196 else
13197   echo "$as_me: failed program was:" >&5
13198 cat conftest.$ac_ext >&5
13199 eval "$as_ac_Lib=no"
13200 fi
13201 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13202 LIBS=$ac_check_lib_save_LIBS
13203 fi
13204 echo "$as_me:13204: result: `eval echo '${'$as_ac_Lib'}'`" >&5
13205 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
13206 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
13207
13208 cf_upper=`echo "have_libmenu" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
13209
13210 cf_add_libs="-lmenu$cf_cv_libtype"
13211 # Filter out duplicates - this happens with badly-designed ".pc" files...
13212 for cf_add_1lib in $LIBS
13213 do
13214         for cf_add_2lib in $cf_add_libs
13215         do
13216                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13217                 then
13218                         cf_add_1lib=
13219                         break
13220                 fi
13221         done
13222         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13223 done
13224 LIBS="$cf_add_libs"
13225
13226 cat >>confdefs.h <<EOF
13227 #define $cf_upper 1
13228 EOF
13229
13230 fi
13231
13232 as_ac_Lib=`echo "ac_cv_lib_form$cf_cv_libtype''_form_driver" | $as_tr_sh`
13233 echo "$as_me:13233: checking for form_driver in -lform$cf_cv_libtype" >&5
13234 echo $ECHO_N "checking for form_driver in -lform$cf_cv_libtype... $ECHO_C" >&6
13235 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
13236   echo $ECHO_N "(cached) $ECHO_C" >&6
13237 else
13238   ac_check_lib_save_LIBS=$LIBS
13239 LIBS="-lform$cf_cv_libtype  $LIBS"
13240 cat >conftest.$ac_ext <<_ACEOF
13241 #line 13241 "configure"
13242 #include "confdefs.h"
13243
13244 /* Override any gcc2 internal prototype to avoid an error.  */
13245 #ifdef __cplusplus
13246 extern "C"
13247 #endif
13248 /* We use char because int might match the return type of a gcc2
13249    builtin and then its argument prototype would still apply.  */
13250 char form_driver ();
13251 int
13252 main ()
13253 {
13254 form_driver ();
13255   ;
13256   return 0;
13257 }
13258 _ACEOF
13259 rm -f conftest.$ac_objext conftest$ac_exeext
13260 if { (eval echo "$as_me:13260: \"$ac_link\"") >&5
13261   (eval $ac_link) 2>&5
13262   ac_status=$?
13263   echo "$as_me:13263: \$? = $ac_status" >&5
13264   (exit $ac_status); } &&
13265          { ac_try='test -s conftest$ac_exeext'
13266   { (eval echo "$as_me:13266: \"$ac_try\"") >&5
13267   (eval $ac_try) 2>&5
13268   ac_status=$?
13269   echo "$as_me:13269: \$? = $ac_status" >&5
13270   (exit $ac_status); }; }; then
13271   eval "$as_ac_Lib=yes"
13272 else
13273   echo "$as_me: failed program was:" >&5
13274 cat conftest.$ac_ext >&5
13275 eval "$as_ac_Lib=no"
13276 fi
13277 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13278 LIBS=$ac_check_lib_save_LIBS
13279 fi
13280 echo "$as_me:13280: result: `eval echo '${'$as_ac_Lib'}'`" >&5
13281 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
13282 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
13283
13284 cf_upper=`echo "have_libform" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
13285
13286 cf_add_libs="-lform$cf_cv_libtype"
13287 # Filter out duplicates - this happens with badly-designed ".pc" files...
13288 for cf_add_1lib in $LIBS
13289 do
13290         for cf_add_2lib in $cf_add_libs
13291         do
13292                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13293                 then
13294                         cf_add_1lib=
13295                         break
13296                 fi
13297         done
13298         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13299 done
13300 LIBS="$cf_add_libs"
13301
13302 cat >>confdefs.h <<EOF
13303 #define $cf_upper 1
13304 EOF
13305
13306 fi
13307
13308         # look for curses-related headers
13309
13310 for ac_header in \
13311                 nc_alloc.h \
13312                 nomacros.h \
13313                 form.h \
13314                 menu.h \
13315                 panel.h \
13316                 term_entry.h \
13317
13318 do
13319 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
13320 echo "$as_me:13320: checking for $ac_header" >&5
13321 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
13322 if eval "test \"\${$as_ac_Header+set}\" = set"; then
13323   echo $ECHO_N "(cached) $ECHO_C" >&6
13324 else
13325   cat >conftest.$ac_ext <<_ACEOF
13326 #line 13326 "configure"
13327 #include "confdefs.h"
13328 #include <$ac_header>
13329 _ACEOF
13330 if { (eval echo "$as_me:13330: \"$ac_cpp conftest.$ac_ext\"") >&5
13331   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13332   ac_status=$?
13333   egrep -v '^ *\+' conftest.er1 >conftest.err
13334   rm -f conftest.er1
13335   cat conftest.err >&5
13336   echo "$as_me:13336: \$? = $ac_status" >&5
13337   (exit $ac_status); } >/dev/null; then
13338   if test -s conftest.err; then
13339     ac_cpp_err=$ac_c_preproc_warn_flag
13340   else
13341     ac_cpp_err=
13342   fi
13343 else
13344   ac_cpp_err=yes
13345 fi
13346 if test -z "$ac_cpp_err"; then
13347   eval "$as_ac_Header=yes"
13348 else
13349   echo "$as_me: failed program was:" >&5
13350   cat conftest.$ac_ext >&5
13351   eval "$as_ac_Header=no"
13352 fi
13353 rm -f conftest.err conftest.$ac_ext
13354 fi
13355 echo "$as_me:13355: result: `eval echo '${'$as_ac_Header'}'`" >&5
13356 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
13357 if test `eval echo '${'$as_ac_Header'}'` = yes; then
13358   cat >>confdefs.h <<EOF
13359 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
13360 EOF
13361
13362 fi
13363 done
13364
13365         ;;
13366 esac
13367
13368 echo "$as_me:13368: checking for ANSI C header files" >&5
13369 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
13370 if test "${ac_cv_header_stdc+set}" = set; then
13371   echo $ECHO_N "(cached) $ECHO_C" >&6
13372 else
13373   cat >conftest.$ac_ext <<_ACEOF
13374 #line 13374 "configure"
13375 #include "confdefs.h"
13376 #include <stdlib.h>
13377 #include <stdarg.h>
13378 #include <string.h>
13379 #include <float.h>
13380
13381 _ACEOF
13382 if { (eval echo "$as_me:13382: \"$ac_cpp conftest.$ac_ext\"") >&5
13383   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13384   ac_status=$?
13385   egrep -v '^ *\+' conftest.er1 >conftest.err
13386   rm -f conftest.er1
13387   cat conftest.err >&5
13388   echo "$as_me:13388: \$? = $ac_status" >&5
13389   (exit $ac_status); } >/dev/null; then
13390   if test -s conftest.err; then
13391     ac_cpp_err=$ac_c_preproc_warn_flag
13392   else
13393     ac_cpp_err=
13394   fi
13395 else
13396   ac_cpp_err=yes
13397 fi
13398 if test -z "$ac_cpp_err"; then
13399   ac_cv_header_stdc=yes
13400 else
13401   echo "$as_me: failed program was:" >&5
13402   cat conftest.$ac_ext >&5
13403   ac_cv_header_stdc=no
13404 fi
13405 rm -f conftest.err conftest.$ac_ext
13406
13407 if test $ac_cv_header_stdc = yes; then
13408   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
13409   cat >conftest.$ac_ext <<_ACEOF
13410 #line 13410 "configure"
13411 #include "confdefs.h"
13412 #include <string.h>
13413
13414 _ACEOF
13415 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13416   egrep "memchr" >/dev/null 2>&1; then
13417   :
13418 else
13419   ac_cv_header_stdc=no
13420 fi
13421 rm -rf conftest*
13422
13423 fi
13424
13425 if test $ac_cv_header_stdc = yes; then
13426   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
13427   cat >conftest.$ac_ext <<_ACEOF
13428 #line 13428 "configure"
13429 #include "confdefs.h"
13430 #include <stdlib.h>
13431
13432 _ACEOF
13433 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13434   egrep "free" >/dev/null 2>&1; then
13435   :
13436 else
13437   ac_cv_header_stdc=no
13438 fi
13439 rm -rf conftest*
13440
13441 fi
13442
13443 if test $ac_cv_header_stdc = yes; then
13444   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
13445   if test "$cross_compiling" = yes; then
13446   :
13447 else
13448   cat >conftest.$ac_ext <<_ACEOF
13449 #line 13449 "configure"
13450 #include "confdefs.h"
13451 #include <ctype.h>
13452 #if ((' ' & 0x0FF) == 0x020)
13453 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
13454 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
13455 #else
13456 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
13457                      || ('j' <= (c) && (c) <= 'r') \
13458                      || ('s' <= (c) && (c) <= 'z'))
13459 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
13460 #endif
13461
13462 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
13463 int
13464 main ()
13465 {
13466   int i;
13467   for (i = 0; i < 256; i++)
13468     if (XOR (islower (i), ISLOWER (i))
13469         || toupper (i) != TOUPPER (i))
13470       $ac_main_return(2);
13471   $ac_main_return (0);
13472 }
13473 _ACEOF
13474 rm -f conftest$ac_exeext
13475 if { (eval echo "$as_me:13475: \"$ac_link\"") >&5
13476   (eval $ac_link) 2>&5
13477   ac_status=$?
13478   echo "$as_me:13478: \$? = $ac_status" >&5
13479   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
13480   { (eval echo "$as_me:13480: \"$ac_try\"") >&5
13481   (eval $ac_try) 2>&5
13482   ac_status=$?
13483   echo "$as_me:13483: \$? = $ac_status" >&5
13484   (exit $ac_status); }; }; then
13485   :
13486 else
13487   echo "$as_me: program exited with status $ac_status" >&5
13488 echo "$as_me: failed program was:" >&5
13489 cat conftest.$ac_ext >&5
13490 ac_cv_header_stdc=no
13491 fi
13492 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
13493 fi
13494 fi
13495 fi
13496 echo "$as_me:13496: result: $ac_cv_header_stdc" >&5
13497 echo "${ECHO_T}$ac_cv_header_stdc" >&6
13498 if test $ac_cv_header_stdc = yes; then
13499
13500 cat >>confdefs.h <<\EOF
13501 #define STDC_HEADERS 1
13502 EOF
13503
13504 fi
13505
13506 echo "$as_me:13506: checking whether time.h and sys/time.h may both be included" >&5
13507 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
13508 if test "${ac_cv_header_time+set}" = set; then
13509   echo $ECHO_N "(cached) $ECHO_C" >&6
13510 else
13511   cat >conftest.$ac_ext <<_ACEOF
13512 #line 13512 "configure"
13513 #include "confdefs.h"
13514 #include <sys/types.h>
13515 #include <sys/time.h>
13516 #include <time.h>
13517
13518 int
13519 main ()
13520 {
13521 if ((struct tm *) 0)
13522 return 0;
13523   ;
13524   return 0;
13525 }
13526 _ACEOF
13527 rm -f conftest.$ac_objext
13528 if { (eval echo "$as_me:13528: \"$ac_compile\"") >&5
13529   (eval $ac_compile) 2>&5
13530   ac_status=$?
13531   echo "$as_me:13531: \$? = $ac_status" >&5
13532   (exit $ac_status); } &&
13533          { ac_try='test -s conftest.$ac_objext'
13534   { (eval echo "$as_me:13534: \"$ac_try\"") >&5
13535   (eval $ac_try) 2>&5
13536   ac_status=$?
13537   echo "$as_me:13537: \$? = $ac_status" >&5
13538   (exit $ac_status); }; }; then
13539   ac_cv_header_time=yes
13540 else
13541   echo "$as_me: failed program was:" >&5
13542 cat conftest.$ac_ext >&5
13543 ac_cv_header_time=no
13544 fi
13545 rm -f conftest.$ac_objext conftest.$ac_ext
13546 fi
13547 echo "$as_me:13547: result: $ac_cv_header_time" >&5
13548 echo "${ECHO_T}$ac_cv_header_time" >&6
13549 if test $ac_cv_header_time = yes; then
13550
13551 cat >>confdefs.h <<\EOF
13552 #define TIME_WITH_SYS_TIME 1
13553 EOF
13554
13555 fi
13556
13557 for ac_header in \
13558 getopt.h \
13559 locale.h \
13560 math.h \
13561 stdarg.h \
13562 sys/ioctl.h \
13563 sys/select.h \
13564 sys/time.h \
13565 termios.h \
13566 unistd.h \
13567
13568 do
13569 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
13570 echo "$as_me:13570: checking for $ac_header" >&5
13571 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
13572 if eval "test \"\${$as_ac_Header+set}\" = set"; then
13573   echo $ECHO_N "(cached) $ECHO_C" >&6
13574 else
13575   cat >conftest.$ac_ext <<_ACEOF
13576 #line 13576 "configure"
13577 #include "confdefs.h"
13578 #include <$ac_header>
13579 _ACEOF
13580 if { (eval echo "$as_me:13580: \"$ac_cpp conftest.$ac_ext\"") >&5
13581   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13582   ac_status=$?
13583   egrep -v '^ *\+' conftest.er1 >conftest.err
13584   rm -f conftest.er1
13585   cat conftest.err >&5
13586   echo "$as_me:13586: \$? = $ac_status" >&5
13587   (exit $ac_status); } >/dev/null; then
13588   if test -s conftest.err; then
13589     ac_cpp_err=$ac_c_preproc_warn_flag
13590   else
13591     ac_cpp_err=
13592   fi
13593 else
13594   ac_cpp_err=yes
13595 fi
13596 if test -z "$ac_cpp_err"; then
13597   eval "$as_ac_Header=yes"
13598 else
13599   echo "$as_me: failed program was:" >&5
13600   cat conftest.$ac_ext >&5
13601   eval "$as_ac_Header=no"
13602 fi
13603 rm -f conftest.err conftest.$ac_ext
13604 fi
13605 echo "$as_me:13605: result: `eval echo '${'$as_ac_Header'}'`" >&5
13606 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
13607 if test `eval echo '${'$as_ac_Header'}'` = yes; then
13608   cat >>confdefs.h <<EOF
13609 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
13610 EOF
13611
13612 fi
13613 done
13614
13615 for ac_header in unistd.h getopt.h
13616 do
13617 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
13618 echo "$as_me:13618: checking for $ac_header" >&5
13619 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
13620 if eval "test \"\${$as_ac_Header+set}\" = set"; then
13621   echo $ECHO_N "(cached) $ECHO_C" >&6
13622 else
13623   cat >conftest.$ac_ext <<_ACEOF
13624 #line 13624 "configure"
13625 #include "confdefs.h"
13626 #include <$ac_header>
13627 _ACEOF
13628 if { (eval echo "$as_me:13628: \"$ac_cpp conftest.$ac_ext\"") >&5
13629   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13630   ac_status=$?
13631   egrep -v '^ *\+' conftest.er1 >conftest.err
13632   rm -f conftest.er1
13633   cat conftest.err >&5
13634   echo "$as_me:13634: \$? = $ac_status" >&5
13635   (exit $ac_status); } >/dev/null; then
13636   if test -s conftest.err; then
13637     ac_cpp_err=$ac_c_preproc_warn_flag
13638   else
13639     ac_cpp_err=
13640   fi
13641 else
13642   ac_cpp_err=yes
13643 fi
13644 if test -z "$ac_cpp_err"; then
13645   eval "$as_ac_Header=yes"
13646 else
13647   echo "$as_me: failed program was:" >&5
13648   cat conftest.$ac_ext >&5
13649   eval "$as_ac_Header=no"
13650 fi
13651 rm -f conftest.err conftest.$ac_ext
13652 fi
13653 echo "$as_me:13653: result: `eval echo '${'$as_ac_Header'}'`" >&5
13654 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
13655 if test `eval echo '${'$as_ac_Header'}'` = yes; then
13656   cat >>confdefs.h <<EOF
13657 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
13658 EOF
13659
13660 fi
13661 done
13662
13663 echo "$as_me:13663: checking for header declaring getopt variables" >&5
13664 echo $ECHO_N "checking for header declaring getopt variables... $ECHO_C" >&6
13665 if test "${cf_cv_getopt_header+set}" = set; then
13666   echo $ECHO_N "(cached) $ECHO_C" >&6
13667 else
13668
13669 cf_cv_getopt_header=none
13670 for cf_header in stdio.h stdlib.h unistd.h getopt.h
13671 do
13672 cat >conftest.$ac_ext <<_ACEOF
13673 #line 13673 "configure"
13674 #include "confdefs.h"
13675
13676 #include <$cf_header>
13677 int
13678 main ()
13679 {
13680 int x = optind; char *y = optarg
13681   ;
13682   return 0;
13683 }
13684 _ACEOF
13685 rm -f conftest.$ac_objext
13686 if { (eval echo "$as_me:13686: \"$ac_compile\"") >&5
13687   (eval $ac_compile) 2>&5
13688   ac_status=$?
13689   echo "$as_me:13689: \$? = $ac_status" >&5
13690   (exit $ac_status); } &&
13691          { ac_try='test -s conftest.$ac_objext'
13692   { (eval echo "$as_me:13692: \"$ac_try\"") >&5
13693   (eval $ac_try) 2>&5
13694   ac_status=$?
13695   echo "$as_me:13695: \$? = $ac_status" >&5
13696   (exit $ac_status); }; }; then
13697   cf_cv_getopt_header=$cf_header
13698  break
13699 else
13700   echo "$as_me: failed program was:" >&5
13701 cat conftest.$ac_ext >&5
13702 fi
13703 rm -f conftest.$ac_objext conftest.$ac_ext
13704 done
13705
13706 fi
13707 echo "$as_me:13707: result: $cf_cv_getopt_header" >&5
13708 echo "${ECHO_T}$cf_cv_getopt_header" >&6
13709 if test $cf_cv_getopt_header != none ; then
13710
13711 cat >>confdefs.h <<\EOF
13712 #define HAVE_GETOPT_HEADER 1
13713 EOF
13714
13715 fi
13716 if test $cf_cv_getopt_header = getopt.h ; then
13717
13718 cat >>confdefs.h <<\EOF
13719 #define NEED_GETOPT_H 1
13720 EOF
13721
13722 fi
13723
13724 for ac_func in \
13725 getopt \
13726 gettimeofday \
13727
13728 do
13729 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
13730 echo "$as_me:13730: checking for $ac_func" >&5
13731 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
13732 if eval "test \"\${$as_ac_var+set}\" = set"; then
13733   echo $ECHO_N "(cached) $ECHO_C" >&6
13734 else
13735   cat >conftest.$ac_ext <<_ACEOF
13736 #line 13736 "configure"
13737 #include "confdefs.h"
13738 /* System header to define __stub macros and hopefully few prototypes,
13739     which can conflict with char $ac_func (); below.  */
13740 #include <assert.h>
13741 /* Override any gcc2 internal prototype to avoid an error.  */
13742 #ifdef __cplusplus
13743 extern "C"
13744 #endif
13745 /* We use char because int might match the return type of a gcc2
13746    builtin and then its argument prototype would still apply.  */
13747 char $ac_func ();
13748 char (*f) ();
13749
13750 int
13751 main ()
13752 {
13753 /* The GNU C library defines this for functions which it implements
13754     to always fail with ENOSYS.  Some functions are actually named
13755     something starting with __ and the normal name is an alias.  */
13756 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
13757 choke me
13758 #else
13759 f = $ac_func; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
13760 #endif
13761
13762   ;
13763   return 0;
13764 }
13765 _ACEOF
13766 rm -f conftest.$ac_objext conftest$ac_exeext
13767 if { (eval echo "$as_me:13767: \"$ac_link\"") >&5
13768   (eval $ac_link) 2>&5
13769   ac_status=$?
13770   echo "$as_me:13770: \$? = $ac_status" >&5
13771   (exit $ac_status); } &&
13772          { ac_try='test -s conftest$ac_exeext'
13773   { (eval echo "$as_me:13773: \"$ac_try\"") >&5
13774   (eval $ac_try) 2>&5
13775   ac_status=$?
13776   echo "$as_me:13776: \$? = $ac_status" >&5
13777   (exit $ac_status); }; }; then
13778   eval "$as_ac_var=yes"
13779 else
13780   echo "$as_me: failed program was:" >&5
13781 cat conftest.$ac_ext >&5
13782 eval "$as_ac_var=no"
13783 fi
13784 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13785 fi
13786 echo "$as_me:13786: result: `eval echo '${'$as_ac_var'}'`" >&5
13787 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
13788 if test `eval echo '${'$as_ac_var'}'` = yes; then
13789   cat >>confdefs.h <<EOF
13790 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
13791 EOF
13792
13793 fi
13794 done
13795
13796 if test "x$ac_cv_func_getopt" = xno; then
13797         { { echo "$as_me:13797: error: getopt is required for building programs" >&5
13798 echo "$as_me: error: getopt is required for building programs" >&2;}
13799    { (exit 1); exit 1; }; }
13800 fi
13801
13802 if test "$cf_enable_widec" = yes; then
13803
13804 for ac_func in \
13805 mblen \
13806 mbrlen \
13807 mbrtowc \
13808 mbsrtowcs \
13809 mbstowcs \
13810 mbtowc \
13811 wcsrtombs \
13812 wcstombs \
13813
13814 do
13815 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
13816 echo "$as_me:13816: checking for $ac_func" >&5
13817 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
13818 if eval "test \"\${$as_ac_var+set}\" = set"; then
13819   echo $ECHO_N "(cached) $ECHO_C" >&6
13820 else
13821   cat >conftest.$ac_ext <<_ACEOF
13822 #line 13822 "configure"
13823 #include "confdefs.h"
13824 /* System header to define __stub macros and hopefully few prototypes,
13825     which can conflict with char $ac_func (); below.  */
13826 #include <assert.h>
13827 /* Override any gcc2 internal prototype to avoid an error.  */
13828 #ifdef __cplusplus
13829 extern "C"
13830 #endif
13831 /* We use char because int might match the return type of a gcc2
13832    builtin and then its argument prototype would still apply.  */
13833 char $ac_func ();
13834 char (*f) ();
13835
13836 int
13837 main ()
13838 {
13839 /* The GNU C library defines this for functions which it implements
13840     to always fail with ENOSYS.  Some functions are actually named
13841     something starting with __ and the normal name is an alias.  */
13842 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
13843 choke me
13844 #else
13845 f = $ac_func; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
13846 #endif
13847
13848   ;
13849   return 0;
13850 }
13851 _ACEOF
13852 rm -f conftest.$ac_objext conftest$ac_exeext
13853 if { (eval echo "$as_me:13853: \"$ac_link\"") >&5
13854   (eval $ac_link) 2>&5
13855   ac_status=$?
13856   echo "$as_me:13856: \$? = $ac_status" >&5
13857   (exit $ac_status); } &&
13858          { ac_try='test -s conftest$ac_exeext'
13859   { (eval echo "$as_me:13859: \"$ac_try\"") >&5
13860   (eval $ac_try) 2>&5
13861   ac_status=$?
13862   echo "$as_me:13862: \$? = $ac_status" >&5
13863   (exit $ac_status); }; }; then
13864   eval "$as_ac_var=yes"
13865 else
13866   echo "$as_me: failed program was:" >&5
13867 cat conftest.$ac_ext >&5
13868 eval "$as_ac_var=no"
13869 fi
13870 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13871 fi
13872 echo "$as_me:13872: result: `eval echo '${'$as_ac_var'}'`" >&5
13873 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
13874 if test `eval echo '${'$as_ac_var'}'` = yes; then
13875   cat >>confdefs.h <<EOF
13876 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
13877 EOF
13878
13879 fi
13880 done
13881
13882 fi
13883
13884 echo "$as_me:13884: checking if we must define _XOPEN_SOURCE_EXTENDED" >&5
13885 echo $ECHO_N "checking if we must define _XOPEN_SOURCE_EXTENDED... $ECHO_C" >&6
13886 if test "${cf_cv_need_xopen_extension+set}" = set; then
13887   echo $ECHO_N "(cached) $ECHO_C" >&6
13888 else
13889
13890 cat >conftest.$ac_ext <<_ACEOF
13891 #line 13891 "configure"
13892 #include "confdefs.h"
13893
13894 #include <stdlib.h>
13895 #include <${cf_cv_ncurses_header:-curses.h}>
13896 int
13897 main ()
13898 {
13899
13900 #if defined(NCURSES_VERSION_PATCH)
13901 #if (NCURSES_VERSION_PATCH < 20100501) && (NCURSES_VERSION_PATCH >= 20100403)
13902         make an error
13903 #endif
13904 #endif
13905         long x = winnstr(stdscr, "", 0);
13906         int x1, y1;
13907         getbegyx(stdscr, y1, x1)
13908   ;
13909   return 0;
13910 }
13911 _ACEOF
13912 rm -f conftest.$ac_objext conftest$ac_exeext
13913 if { (eval echo "$as_me:13913: \"$ac_link\"") >&5
13914   (eval $ac_link) 2>&5
13915   ac_status=$?
13916   echo "$as_me:13916: \$? = $ac_status" >&5
13917   (exit $ac_status); } &&
13918          { ac_try='test -s conftest$ac_exeext'
13919   { (eval echo "$as_me:13919: \"$ac_try\"") >&5
13920   (eval $ac_try) 2>&5
13921   ac_status=$?
13922   echo "$as_me:13922: \$? = $ac_status" >&5
13923   (exit $ac_status); }; }; then
13924   cf_cv_need_xopen_extension=no
13925 else
13926   echo "$as_me: failed program was:" >&5
13927 cat conftest.$ac_ext >&5
13928 cat >conftest.$ac_ext <<_ACEOF
13929 #line 13929 "configure"
13930 #include "confdefs.h"
13931
13932 #define _XOPEN_SOURCE_EXTENDED
13933 #include <stdlib.h>
13934 #include <${cf_cv_ncurses_header:-curses.h}>
13935 int
13936 main ()
13937 {
13938
13939 #ifdef NCURSES_VERSION
13940         cchar_t check;
13941         int check2 = curs_set((int)sizeof(check));
13942 #endif
13943         long x = winnstr(stdscr, "", 0);
13944         int x1, y1;
13945         getbegyx(stdscr, y1, x1)
13946   ;
13947   return 0;
13948 }
13949 _ACEOF
13950 rm -f conftest.$ac_objext conftest$ac_exeext
13951 if { (eval echo "$as_me:13951: \"$ac_link\"") >&5
13952   (eval $ac_link) 2>&5
13953   ac_status=$?
13954   echo "$as_me:13954: \$? = $ac_status" >&5
13955   (exit $ac_status); } &&
13956          { ac_try='test -s conftest$ac_exeext'
13957   { (eval echo "$as_me:13957: \"$ac_try\"") >&5
13958   (eval $ac_try) 2>&5
13959   ac_status=$?
13960   echo "$as_me:13960: \$? = $ac_status" >&5
13961   (exit $ac_status); }; }; then
13962   cf_cv_need_xopen_extension=yes
13963 else
13964   echo "$as_me: failed program was:" >&5
13965 cat conftest.$ac_ext >&5
13966 cf_cv_need_xopen_extension=unknown
13967 fi
13968 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13969 fi
13970 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13971 fi
13972 echo "$as_me:13972: result: $cf_cv_need_xopen_extension" >&5
13973 echo "${ECHO_T}$cf_cv_need_xopen_extension" >&6
13974 test $cf_cv_need_xopen_extension = yes && CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED"
13975
13976 echo "$as_me:13976: checking for term.h" >&5
13977 echo $ECHO_N "checking for term.h... $ECHO_C" >&6
13978 if test "${cf_cv_term_header+set}" = set; then
13979   echo $ECHO_N "(cached) $ECHO_C" >&6
13980 else
13981
13982 # If we found <ncurses/curses.h>, look for <ncurses/term.h>, but always look
13983 # for <term.h> if we do not find the variant.
13984
13985 cf_header_list="term.h ncurses/term.h ncursesw/term.h"
13986
13987 case ${cf_cv_ncurses_header:-curses.h} in
13988 (*/*)
13989         cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`term.h
13990         cf_header_list="$cf_header_item $cf_header_list"
13991         ;;
13992 esac
13993
13994 for cf_header in $cf_header_list
13995 do
13996         cat >conftest.$ac_ext <<_ACEOF
13997 #line 13997 "configure"
13998 #include "confdefs.h"
13999
14000 #include <${cf_cv_ncurses_header:-curses.h}>
14001 #include <${cf_header}>
14002 int
14003 main ()
14004 {
14005 WINDOW *x
14006   ;
14007   return 0;
14008 }
14009 _ACEOF
14010 rm -f conftest.$ac_objext
14011 if { (eval echo "$as_me:14011: \"$ac_compile\"") >&5
14012   (eval $ac_compile) 2>&5
14013   ac_status=$?
14014   echo "$as_me:14014: \$? = $ac_status" >&5
14015   (exit $ac_status); } &&
14016          { ac_try='test -s conftest.$ac_objext'
14017   { (eval echo "$as_me:14017: \"$ac_try\"") >&5
14018   (eval $ac_try) 2>&5
14019   ac_status=$?
14020   echo "$as_me:14020: \$? = $ac_status" >&5
14021   (exit $ac_status); }; }; then
14022   cf_cv_term_header=$cf_header
14023          break
14024 else
14025   echo "$as_me: failed program was:" >&5
14026 cat conftest.$ac_ext >&5
14027 cf_cv_term_header=no
14028 fi
14029 rm -f conftest.$ac_objext conftest.$ac_ext
14030 done
14031
14032 case $cf_cv_term_header in
14033 (no)
14034         # If curses is ncurses, some packagers still mess it up by trying to make
14035         # us use GNU termcap.  This handles the most common case.
14036         for cf_header in ncurses/term.h ncursesw/term.h
14037         do
14038                 cat >conftest.$ac_ext <<_ACEOF
14039 #line 14039 "configure"
14040 #include "confdefs.h"
14041
14042 #include <${cf_cv_ncurses_header:-curses.h}>
14043 #ifdef NCURSES_VERSION
14044 #include <${cf_header}>
14045 #else
14046 make an error
14047 #endif
14048 int
14049 main ()
14050 {
14051 WINDOW *x
14052   ;
14053   return 0;
14054 }
14055 _ACEOF
14056 rm -f conftest.$ac_objext
14057 if { (eval echo "$as_me:14057: \"$ac_compile\"") >&5
14058   (eval $ac_compile) 2>&5
14059   ac_status=$?
14060   echo "$as_me:14060: \$? = $ac_status" >&5
14061   (exit $ac_status); } &&
14062          { ac_try='test -s conftest.$ac_objext'
14063   { (eval echo "$as_me:14063: \"$ac_try\"") >&5
14064   (eval $ac_try) 2>&5
14065   ac_status=$?
14066   echo "$as_me:14066: \$? = $ac_status" >&5
14067   (exit $ac_status); }; }; then
14068   cf_cv_term_header=$cf_header
14069                          break
14070 else
14071   echo "$as_me: failed program was:" >&5
14072 cat conftest.$ac_ext >&5
14073 cf_cv_term_header=no
14074 fi
14075 rm -f conftest.$ac_objext conftest.$ac_ext
14076         done
14077         ;;
14078 esac
14079
14080 fi
14081 echo "$as_me:14081: result: $cf_cv_term_header" >&5
14082 echo "${ECHO_T}$cf_cv_term_header" >&6
14083
14084 case $cf_cv_term_header in
14085 (term.h)
14086
14087 cat >>confdefs.h <<\EOF
14088 #define HAVE_TERM_H 1
14089 EOF
14090
14091         ;;
14092 (ncurses/term.h)
14093
14094 cat >>confdefs.h <<\EOF
14095 #define HAVE_NCURSES_TERM_H 1
14096 EOF
14097
14098         ;;
14099 (ncursesw/term.h)
14100
14101 cat >>confdefs.h <<\EOF
14102 #define HAVE_NCURSESW_TERM_H 1
14103 EOF
14104
14105         ;;
14106 esac
14107
14108 echo "$as_me:14108: checking for unctrl.h" >&5
14109 echo $ECHO_N "checking for unctrl.h... $ECHO_C" >&6
14110 if test "${cf_cv_unctrl_header+set}" = set; then
14111   echo $ECHO_N "(cached) $ECHO_C" >&6
14112 else
14113
14114 # If we found <ncurses/curses.h>, look for <ncurses/unctrl.h>, but always look
14115 # for <unctrl.h> if we do not find the variant.
14116
14117 cf_header_list="unctrl.h ncurses/unctrl.h ncursesw/unctrl.h"
14118
14119 case ${cf_cv_ncurses_header:-curses.h} in
14120 (*/*)
14121         cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`unctrl.h
14122         cf_header_list="$cf_header_item $cf_header_list"
14123         ;;
14124 esac
14125
14126 for cf_header in $cf_header_list
14127 do
14128         cat >conftest.$ac_ext <<_ACEOF
14129 #line 14129 "configure"
14130 #include "confdefs.h"
14131
14132 #include <${cf_cv_ncurses_header:-curses.h}>
14133 #include <${cf_header}>
14134 int
14135 main ()
14136 {
14137 WINDOW *x
14138   ;
14139   return 0;
14140 }
14141 _ACEOF
14142 rm -f conftest.$ac_objext
14143 if { (eval echo "$as_me:14143: \"$ac_compile\"") >&5
14144   (eval $ac_compile) 2>&5
14145   ac_status=$?
14146   echo "$as_me:14146: \$? = $ac_status" >&5
14147   (exit $ac_status); } &&
14148          { ac_try='test -s conftest.$ac_objext'
14149   { (eval echo "$as_me:14149: \"$ac_try\"") >&5
14150   (eval $ac_try) 2>&5
14151   ac_status=$?
14152   echo "$as_me:14152: \$? = $ac_status" >&5
14153   (exit $ac_status); }; }; then
14154   cf_cv_unctrl_header=$cf_header
14155          break
14156 else
14157   echo "$as_me: failed program was:" >&5
14158 cat conftest.$ac_ext >&5
14159 cf_cv_unctrl_header=no
14160 fi
14161 rm -f conftest.$ac_objext conftest.$ac_ext
14162 done
14163
14164 fi
14165 echo "$as_me:14165: result: $cf_cv_unctrl_header" >&5
14166 echo "${ECHO_T}$cf_cv_unctrl_header" >&6
14167
14168 case $cf_cv_unctrl_header in
14169 (no)
14170         { echo "$as_me:14170: WARNING: unctrl.h header not found" >&5
14171 echo "$as_me: WARNING: unctrl.h header not found" >&2;}
14172         ;;
14173 esac
14174
14175 case $cf_cv_unctrl_header in
14176 (unctrl.h)
14177
14178 cat >>confdefs.h <<\EOF
14179 #define HAVE_UNCTRL_H 1
14180 EOF
14181
14182         ;;
14183 (ncurses/unctrl.h)
14184
14185 cat >>confdefs.h <<\EOF
14186 #define HAVE_NCURSES_UNCTRL_H 1
14187 EOF
14188
14189         ;;
14190 (ncursesw/unctrl.h)
14191
14192 cat >>confdefs.h <<\EOF
14193 #define HAVE_NCURSESW_UNCTRL_H 1
14194 EOF
14195
14196         ;;
14197 esac
14198
14199 for cf_func in \
14200 assume_default_colors \
14201 chgat \
14202 color_set \
14203 filter \
14204 getbegx \
14205 getcurx \
14206 getmaxx \
14207 getnstr \
14208 getparx \
14209 getwin \
14210 mvvline \
14211 mvwvline \
14212 napms \
14213 putwin \
14214 resize_term \
14215 resizeterm \
14216 ripoffline \
14217 scr_dump \
14218 setupterm \
14219 slk_color \
14220 slk_init \
14221 termattrs \
14222 tgetent \
14223 tigetnum \
14224 tigetstr \
14225 typeahead \
14226 use_default_colors \
14227 use_env \
14228 use_extended_names \
14229 use_screen \
14230 use_window \
14231 vid_puts \
14232 vidputs \
14233 vsscanf \
14234 vw_printw \
14235 wchgat \
14236 winsstr \
14237 wresize \
14238 wsyncdown \
14239
14240 do
14241
14242 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14243
14244         echo "$as_me:14244: checking for ${cf_func}" >&5
14245 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
14246
14247 echo "${as_me:-configure}:14247: testing ${cf_func} ..." 1>&5
14248
14249         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
14250   echo $ECHO_N "(cached) $ECHO_C" >&6
14251 else
14252
14253                 eval cf_result='$ac_cv_func_'$cf_func
14254                 if test ".$cf_result" != ".no"; then
14255                         cat >conftest.$ac_ext <<_ACEOF
14256 #line 14256 "configure"
14257 #include "confdefs.h"
14258
14259 #ifdef HAVE_XCURSES
14260 #include <xcurses.h>
14261 char * XCursesProgramName = "test";
14262 #else
14263 #include <${cf_cv_ncurses_header:-curses.h}>
14264 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
14265 #include <ncursesw/term.h>
14266 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
14267 #include <ncurses/term.h>
14268 #elif defined(HAVE_TERM_H)
14269 #include <term.h>
14270 #endif
14271 #endif
14272
14273 int
14274 main ()
14275 {
14276
14277 #ifndef ${cf_func}
14278 long foo = (long)(&${cf_func});
14279 fprintf(stderr, "testing linkage of $cf_func:%p\n", foo);
14280 if (foo + 1234 > 5678)
14281         ${cf_cv_main_return:-return}(foo);
14282 #endif
14283
14284   ;
14285   return 0;
14286 }
14287 _ACEOF
14288 rm -f conftest.$ac_objext conftest$ac_exeext
14289 if { (eval echo "$as_me:14289: \"$ac_link\"") >&5
14290   (eval $ac_link) 2>&5
14291   ac_status=$?
14292   echo "$as_me:14292: \$? = $ac_status" >&5
14293   (exit $ac_status); } &&
14294          { ac_try='test -s conftest$ac_exeext'
14295   { (eval echo "$as_me:14295: \"$ac_try\"") >&5
14296   (eval $ac_try) 2>&5
14297   ac_status=$?
14298   echo "$as_me:14298: \$? = $ac_status" >&5
14299   (exit $ac_status); }; }; then
14300   cf_result=yes
14301 else
14302   echo "$as_me: failed program was:" >&5
14303 cat conftest.$ac_ext >&5
14304 cf_result=no
14305 fi
14306 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14307                 fi
14308                 eval 'cf_cv_func_'$cf_func'=$cf_result'
14309
14310 fi
14311
14312         # use the computed/retrieved cache-value:
14313         eval 'cf_result=$cf_cv_func_'$cf_func
14314         echo "$as_me:14314: result: $cf_result" >&5
14315 echo "${ECHO_T}$cf_result" >&6
14316         if test $cf_result != no; then
14317                 cat >>confdefs.h <<EOF
14318 #define HAVE_${cf_tr_func} 1
14319 EOF
14320
14321         fi
14322 done
14323
14324 for cf_func in tputs
14325 do
14326
14327 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14328
14329         echo "$as_me:14329: checking for ${cf_func}" >&5
14330 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
14331
14332 echo "${as_me:-configure}:14332: testing ${cf_func} ..." 1>&5
14333
14334         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
14335   echo $ECHO_N "(cached) $ECHO_C" >&6
14336 else
14337
14338                 eval cf_result='$ac_cv_func_'$cf_func
14339                 if test ".$cf_result" != ".no"; then
14340                         cat >conftest.$ac_ext <<_ACEOF
14341 #line 14341 "configure"
14342 #include "confdefs.h"
14343
14344 #ifdef HAVE_XCURSES
14345 #include <xcurses.h>
14346 char * XCursesProgramName = "test";
14347 #else
14348 #include <${cf_cv_ncurses_header:-curses.h}>
14349 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
14350 #include <ncursesw/term.h>
14351 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
14352 #include <ncurses/term.h>
14353 #elif defined(HAVE_TERM_H)
14354 #include <term.h>
14355 #endif
14356 #endif
14357
14358 int
14359 main ()
14360 {
14361
14362 #ifndef ${cf_func}
14363 long foo = (long)(&${cf_func});
14364 fprintf(stderr, "testing linkage of $cf_func:%p\n", foo);
14365 if (foo + 1234 > 5678)
14366         ${cf_cv_main_return:-return}(foo);
14367 #endif
14368
14369   ;
14370   return 0;
14371 }
14372 _ACEOF
14373 rm -f conftest.$ac_objext conftest$ac_exeext
14374 if { (eval echo "$as_me:14374: \"$ac_link\"") >&5
14375   (eval $ac_link) 2>&5
14376   ac_status=$?
14377   echo "$as_me:14377: \$? = $ac_status" >&5
14378   (exit $ac_status); } &&
14379          { ac_try='test -s conftest$ac_exeext'
14380   { (eval echo "$as_me:14380: \"$ac_try\"") >&5
14381   (eval $ac_try) 2>&5
14382   ac_status=$?
14383   echo "$as_me:14383: \$? = $ac_status" >&5
14384   (exit $ac_status); }; }; then
14385   cf_result=yes
14386 else
14387   echo "$as_me: failed program was:" >&5
14388 cat conftest.$ac_ext >&5
14389 cf_result=no
14390 fi
14391 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14392                 fi
14393                 eval 'cf_cv_func_'$cf_func'=$cf_result'
14394
14395 fi
14396
14397         # use the computed/retrieved cache-value:
14398         eval 'cf_result=$cf_cv_func_'$cf_func
14399         echo "$as_me:14399: result: $cf_result" >&5
14400 echo "${ECHO_T}$cf_result" >&6
14401         if test $cf_result != no; then
14402                 cat >>confdefs.h <<EOF
14403 #define HAVE_${cf_tr_func} 1
14404 EOF
14405
14406         fi
14407 done
14408
14409 if test x$cf_cv_func_tputs = xyes
14410 then
14411         cf_done=no
14412         for cf_arg in int char
14413         do
14414                 for cf_ret in int void
14415                 do
14416                         if test $cf_ret = void
14417                         then
14418                                 cf_return="/* nothing */"
14419                         else
14420                                 cf_return="return value"
14421                         fi
14422                         cat >conftest.$ac_ext <<_ACEOF
14423 #line 14423 "configure"
14424 #include "confdefs.h"
14425
14426 #include <${cf_cv_ncurses_header:-curses.h}>
14427 #include <$cf_cv_term_header>
14428
14429 static $cf_ret outc($cf_arg value) { $cf_return; }
14430
14431 int
14432 main ()
14433 {
14434
14435         tputs("hello", 0, outc);
14436         ${cf_cv_main_return:-return}(0);
14437
14438   ;
14439   return 0;
14440 }
14441 _ACEOF
14442 rm -f conftest.$ac_objext
14443 if { (eval echo "$as_me:14443: \"$ac_compile\"") >&5
14444   (eval $ac_compile) 2>&5
14445   ac_status=$?
14446   echo "$as_me:14446: \$? = $ac_status" >&5
14447   (exit $ac_status); } &&
14448          { ac_try='test -s conftest.$ac_objext'
14449   { (eval echo "$as_me:14449: \"$ac_try\"") >&5
14450   (eval $ac_try) 2>&5
14451   ac_status=$?
14452   echo "$as_me:14452: \$? = $ac_status" >&5
14453   (exit $ac_status); }; }; then
14454
14455                 test -n "$verbose" && echo "    prototype $cf_ret func($cf_arg value)" 1>&6
14456
14457 echo "${as_me:-configure}:14457: testing prototype $cf_ret func($cf_arg value) ..." 1>&5
14458
14459                 cat >>confdefs.h <<EOF
14460 #define TPUTS_ARG               $cf_arg
14461 #define TPUTS_PROTO(func,value) $cf_ret func(TPUTS_ARG value)
14462 #define TPUTS_RETURN(value)     $cf_return
14463 EOF
14464                 cf_done=yes
14465                 break
14466
14467 else
14468   echo "$as_me: failed program was:" >&5
14469 cat conftest.$ac_ext >&5
14470 fi
14471 rm -f conftest.$ac_objext conftest.$ac_ext
14472                 done
14473                 test $cf_done = yes && break
14474         done
14475 fi
14476
14477 echo "$as_me:14477: checking for ncurses extended functions" >&5
14478 echo $ECHO_N "checking for ncurses extended functions... $ECHO_C" >&6
14479 if test "${cf_cv_ncurses_ext_funcs+set}" = set; then
14480   echo $ECHO_N "(cached) $ECHO_C" >&6
14481 else
14482
14483 cat >conftest.$ac_ext <<_ACEOF
14484 #line 14484 "configure"
14485 #include "confdefs.h"
14486
14487 #include <${cf_cv_ncurses_header:-curses.h}>
14488 int
14489 main ()
14490 {
14491
14492 int x = NCURSES_EXT_FUNCS
14493
14494   ;
14495   return 0;
14496 }
14497 _ACEOF
14498 rm -f conftest.$ac_objext
14499 if { (eval echo "$as_me:14499: \"$ac_compile\"") >&5
14500   (eval $ac_compile) 2>&5
14501   ac_status=$?
14502   echo "$as_me:14502: \$? = $ac_status" >&5
14503   (exit $ac_status); } &&
14504          { ac_try='test -s conftest.$ac_objext'
14505   { (eval echo "$as_me:14505: \"$ac_try\"") >&5
14506   (eval $ac_try) 2>&5
14507   ac_status=$?
14508   echo "$as_me:14508: \$? = $ac_status" >&5
14509   (exit $ac_status); }; }; then
14510   cf_cv_ncurses_ext_funcs=defined
14511 else
14512   echo "$as_me: failed program was:" >&5
14513 cat conftest.$ac_ext >&5
14514
14515 cat >conftest.$ac_ext <<_ACEOF
14516 #line 14516 "configure"
14517 #include "confdefs.h"
14518
14519 #include <${cf_cv_ncurses_header:-curses.h}>
14520 int
14521 main ()
14522 {
14523
14524         (void) assume_default_colors (0, 0);
14525         (void) curses_version ();
14526         (void) define_key (0, 0);
14527         (void) is_term_resized (0, 0);
14528         (void) key_defined (0);
14529         (void) keybound (0, 0);
14530         (void) keyok (0, 0);
14531         (void) resize_term (0, 0);
14532         (void) resizeterm (0, 0);
14533         (void) use_default_colors ();
14534         (void) use_extended_names (0);
14535         (void) wresize (0, 0, 0);
14536   ;
14537   return 0;
14538 }
14539 _ACEOF
14540 rm -f conftest.$ac_objext conftest$ac_exeext
14541 if { (eval echo "$as_me:14541: \"$ac_link\"") >&5
14542   (eval $ac_link) 2>&5
14543   ac_status=$?
14544   echo "$as_me:14544: \$? = $ac_status" >&5
14545   (exit $ac_status); } &&
14546          { ac_try='test -s conftest$ac_exeext'
14547   { (eval echo "$as_me:14547: \"$ac_try\"") >&5
14548   (eval $ac_try) 2>&5
14549   ac_status=$?
14550   echo "$as_me:14550: \$? = $ac_status" >&5
14551   (exit $ac_status); }; }; then
14552   cf_cv_ncurses_ext_funcs=yes
14553 else
14554   echo "$as_me: failed program was:" >&5
14555 cat conftest.$ac_ext >&5
14556 cf_cv_ncurses_ext_funcs=no
14557 fi
14558 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14559
14560 fi
14561 rm -f conftest.$ac_objext conftest.$ac_ext
14562
14563 fi
14564 echo "$as_me:14564: result: $cf_cv_ncurses_ext_funcs" >&5
14565 echo "${ECHO_T}$cf_cv_ncurses_ext_funcs" >&6
14566 test "$cf_cv_ncurses_ext_funcs" = yes &&
14567 cat >>confdefs.h <<\EOF
14568 #define NCURSES_EXT_FUNCS 1
14569 EOF
14570
14571 if test "$cf_enable_widec" = yes
14572 then
14573         # workaround for systems with ncurses before 20111029, due to change of
14574         # feature test macro from _XPG5 to _XOPEN_SOURCE
14575         if test -n "$cf_cv_ncurses_version" && test "x$cf_cv_ncurses_version" != xno
14576         then
14577                 cf_define_xpg5=no
14578                 echo "$as_me:14578: checking if _XPG5 should be defined to enable wide-characters" >&5
14579 echo $ECHO_N "checking if _XPG5 should be defined to enable wide-characters... $ECHO_C" >&6
14580
14581                 cat >conftest.$ac_ext <<_ACEOF
14582 #line 14582 "configure"
14583 #include "confdefs.h"
14584
14585 #include <${cf_cv_ncurses_header:-curses.h}>
14586 int
14587 main ()
14588 {
14589 int x = _XPG5
14590   ;
14591   return 0;
14592 }
14593 _ACEOF
14594 rm -f conftest.$ac_objext
14595 if { (eval echo "$as_me:14595: \"$ac_compile\"") >&5
14596   (eval $ac_compile) 2>&5
14597   ac_status=$?
14598   echo "$as_me:14598: \$? = $ac_status" >&5
14599   (exit $ac_status); } &&
14600          { ac_try='test -s conftest.$ac_objext'
14601   { (eval echo "$as_me:14601: \"$ac_try\"") >&5
14602   (eval $ac_try) 2>&5
14603   ac_status=$?
14604   echo "$as_me:14604: \$? = $ac_status" >&5
14605   (exit $ac_status); }; }; then
14606   :
14607 else
14608   echo "$as_me: failed program was:" >&5
14609 cat conftest.$ac_ext >&5
14610 cf_save_cppflags="$CPPFLAGS"
14611                          CPPFLAGS="$CPPFLAGS -D_XPG5"
14612                          cat >conftest.$ac_ext <<_ACEOF
14613 #line 14613 "configure"
14614 #include "confdefs.h"
14615
14616 #include <${cf_cv_ncurses_header:-curses.h}>
14617 int
14618 main ()
14619 {
14620 int x = _XPG5
14621   ;
14622   return 0;
14623 }
14624 _ACEOF
14625 rm -f conftest.$ac_objext
14626 if { (eval echo "$as_me:14626: \"$ac_compile\"") >&5
14627   (eval $ac_compile) 2>&5
14628   ac_status=$?
14629   echo "$as_me:14629: \$? = $ac_status" >&5
14630   (exit $ac_status); } &&
14631          { ac_try='test -s conftest.$ac_objext'
14632   { (eval echo "$as_me:14632: \"$ac_try\"") >&5
14633   (eval $ac_try) 2>&5
14634   ac_status=$?
14635   echo "$as_me:14635: \$? = $ac_status" >&5
14636   (exit $ac_status); }; }; then
14637   cf_define_xpg5=yes
14638 else
14639   echo "$as_me: failed program was:" >&5
14640 cat conftest.$ac_ext >&5
14641 fi
14642 rm -f conftest.$ac_objext conftest.$ac_ext
14643                          CPPFLAGS="$cf_save_cppflags"
14644 fi
14645 rm -f conftest.$ac_objext conftest.$ac_ext
14646                 echo "$as_me:14646: result: $cf_define_xpg5" >&5
14647 echo "${ECHO_T}$cf_define_xpg5" >&6
14648
14649                 if test "$cf_define_xpg5" = yes
14650                 then
14651                         CPPFLAGS="$CPPFLAGS -D_XPG5"
14652                 fi
14653         fi
14654
14655         echo "$as_me:14655: checking for wide-character functions" >&5
14656 echo $ECHO_N "checking for wide-character functions... $ECHO_C" >&6
14657 if test "${cf_cv_widechar_funcs+set}" = set; then
14658   echo $ECHO_N "(cached) $ECHO_C" >&6
14659 else
14660
14661         cat >conftest.$ac_ext <<_ACEOF
14662 #line 14662 "configure"
14663 #include "confdefs.h"
14664
14665 #include <${cf_cv_ncurses_header:-curses.h}>
14666 int
14667 main ()
14668 {
14669
14670                 static wchar_t src_wchar[2];
14671                 static cchar_t dst_cchar;
14672                 setcchar(&dst_cchar, src_wchar, A_NORMAL, 0, (void *) 0);
14673
14674   ;
14675   return 0;
14676 }
14677 _ACEOF
14678 rm -f conftest.$ac_objext conftest$ac_exeext
14679 if { (eval echo "$as_me:14679: \"$ac_link\"") >&5
14680   (eval $ac_link) 2>&5
14681   ac_status=$?
14682   echo "$as_me:14682: \$? = $ac_status" >&5
14683   (exit $ac_status); } &&
14684          { ac_try='test -s conftest$ac_exeext'
14685   { (eval echo "$as_me:14685: \"$ac_try\"") >&5
14686   (eval $ac_try) 2>&5
14687   ac_status=$?
14688   echo "$as_me:14688: \$? = $ac_status" >&5
14689   (exit $ac_status); }; }; then
14690   cf_cv_widechar_funcs=yes
14691 else
14692   echo "$as_me: failed program was:" >&5
14693 cat conftest.$ac_ext >&5
14694 cf_cv_widechar_funcs=no
14695 fi
14696 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14697
14698 fi
14699 echo "$as_me:14699: result: $cf_cv_widechar_funcs" >&5
14700 echo "${ECHO_T}$cf_cv_widechar_funcs" >&6
14701         if test "$cf_cv_widechar_funcs" != no ; then
14702
14703 cat >>confdefs.h <<\EOF
14704 #define USE_WIDEC_SUPPORT 1
14705 EOF
14706
14707         else
14708                 cat >>confdefs.h <<\EOF
14709 #define USE_WIDEC_SUPPORT 0
14710 EOF
14711
14712         fi
14713 else
14714         cat >>confdefs.h <<\EOF
14715 #define USE_WIDEC_SUPPORT 0
14716 EOF
14717
14718 fi
14719
14720 echo "$as_me:14720: checking if sys/time.h works with sys/select.h" >&5
14721 echo $ECHO_N "checking if sys/time.h works with sys/select.h... $ECHO_C" >&6
14722 if test "${cf_cv_sys_time_select+set}" = set; then
14723   echo $ECHO_N "(cached) $ECHO_C" >&6
14724 else
14725
14726 cat >conftest.$ac_ext <<_ACEOF
14727 #line 14727 "configure"
14728 #include "confdefs.h"
14729
14730 #include <sys/types.h>
14731 #ifdef HAVE_SYS_TIME_H
14732 #include <sys/time.h>
14733 #endif
14734 #ifdef HAVE_SYS_SELECT_H
14735 #include <sys/select.h>
14736 #endif
14737
14738 int
14739 main ()
14740 {
14741
14742   ;
14743   return 0;
14744 }
14745 _ACEOF
14746 rm -f conftest.$ac_objext
14747 if { (eval echo "$as_me:14747: \"$ac_compile\"") >&5
14748   (eval $ac_compile) 2>&5
14749   ac_status=$?
14750   echo "$as_me:14750: \$? = $ac_status" >&5
14751   (exit $ac_status); } &&
14752          { ac_try='test -s conftest.$ac_objext'
14753   { (eval echo "$as_me:14753: \"$ac_try\"") >&5
14754   (eval $ac_try) 2>&5
14755   ac_status=$?
14756   echo "$as_me:14756: \$? = $ac_status" >&5
14757   (exit $ac_status); }; }; then
14758   cf_cv_sys_time_select=yes
14759 else
14760   echo "$as_me: failed program was:" >&5
14761 cat conftest.$ac_ext >&5
14762 cf_cv_sys_time_select=no
14763 fi
14764 rm -f conftest.$ac_objext conftest.$ac_ext
14765
14766 fi
14767
14768 echo "$as_me:14768: result: $cf_cv_sys_time_select" >&5
14769 echo "${ECHO_T}$cf_cv_sys_time_select" >&6
14770 test "$cf_cv_sys_time_select" = yes &&
14771 cat >>confdefs.h <<\EOF
14772 #define HAVE_SYS_TIME_SELECT 1
14773 EOF
14774
14775 echo "$as_me:14775: checking for function curses_version" >&5
14776 echo $ECHO_N "checking for function curses_version... $ECHO_C" >&6
14777 if test "${cf_cv_func_curses_version+set}" = set; then
14778   echo $ECHO_N "(cached) $ECHO_C" >&6
14779 else
14780
14781 if test "$cross_compiling" = yes; then
14782   cf_cv_func_curses_version=unknown
14783 else
14784   cat >conftest.$ac_ext <<_ACEOF
14785 #line 14785 "configure"
14786 #include "confdefs.h"
14787
14788 #include <${cf_cv_ncurses_header:-curses.h}>
14789 int main()
14790 {
14791         char temp[1024];
14792         sprintf(temp, "%s\n", curses_version());
14793         ${cf_cv_main_return:-return}(0);
14794 }
14795
14796 _ACEOF
14797 rm -f conftest$ac_exeext
14798 if { (eval echo "$as_me:14798: \"$ac_link\"") >&5
14799   (eval $ac_link) 2>&5
14800   ac_status=$?
14801   echo "$as_me:14801: \$? = $ac_status" >&5
14802   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
14803   { (eval echo "$as_me:14803: \"$ac_try\"") >&5
14804   (eval $ac_try) 2>&5
14805   ac_status=$?
14806   echo "$as_me:14806: \$? = $ac_status" >&5
14807   (exit $ac_status); }; }; then
14808   cf_cv_func_curses_version=yes
14809
14810 else
14811   echo "$as_me: program exited with status $ac_status" >&5
14812 echo "$as_me: failed program was:" >&5
14813 cat conftest.$ac_ext >&5
14814 cf_cv_func_curses_version=no
14815
14816 fi
14817 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
14818 fi
14819 rm -f core
14820 fi
14821 echo "$as_me:14821: result: $cf_cv_func_curses_version" >&5
14822 echo "${ECHO_T}$cf_cv_func_curses_version" >&6
14823 test "$cf_cv_func_curses_version" = yes &&
14824 cat >>confdefs.h <<\EOF
14825 #define HAVE_CURSES_VERSION 1
14826 EOF
14827
14828 echo "$as_me:14828: checking for alternate character set array" >&5
14829 echo $ECHO_N "checking for alternate character set array... $ECHO_C" >&6
14830 if test "${cf_cv_curses_acs_map+set}" = set; then
14831   echo $ECHO_N "(cached) $ECHO_C" >&6
14832 else
14833
14834 cf_cv_curses_acs_map=unknown
14835 for name in acs_map _acs_map __acs_map ${NCURSES_WRAP_PREFIX}acs_map
14836 do
14837 cat >conftest.$ac_ext <<_ACEOF
14838 #line 14838 "configure"
14839 #include "confdefs.h"
14840
14841 #include <${cf_cv_ncurses_header:-curses.h}>
14842
14843 int
14844 main ()
14845 {
14846
14847 $name['k'] = ACS_PLUS
14848
14849   ;
14850   return 0;
14851 }
14852 _ACEOF
14853 rm -f conftest.$ac_objext conftest$ac_exeext
14854 if { (eval echo "$as_me:14854: \"$ac_link\"") >&5
14855   (eval $ac_link) 2>&5
14856   ac_status=$?
14857   echo "$as_me:14857: \$? = $ac_status" >&5
14858   (exit $ac_status); } &&
14859          { ac_try='test -s conftest$ac_exeext'
14860   { (eval echo "$as_me:14860: \"$ac_try\"") >&5
14861   (eval $ac_try) 2>&5
14862   ac_status=$?
14863   echo "$as_me:14863: \$? = $ac_status" >&5
14864   (exit $ac_status); }; }; then
14865   cf_cv_curses_acs_map=$name; break
14866 else
14867   echo "$as_me: failed program was:" >&5
14868 cat conftest.$ac_ext >&5
14869 fi
14870 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14871 done
14872
14873 fi
14874 echo "$as_me:14874: result: $cf_cv_curses_acs_map" >&5
14875 echo "${ECHO_T}$cf_cv_curses_acs_map" >&6
14876
14877 test "$cf_cv_curses_acs_map" != unknown &&
14878 cat >>confdefs.h <<EOF
14879 #define CURSES_ACS_ARRAY $cf_cv_curses_acs_map
14880 EOF
14881
14882 if test "$cf_enable_widec" = yes; then
14883
14884 echo "$as_me:14884: checking for wide alternate character set array" >&5
14885 echo $ECHO_N "checking for wide alternate character set array... $ECHO_C" >&6
14886 if test "${cf_cv_curses_wacs_map+set}" = set; then
14887   echo $ECHO_N "(cached) $ECHO_C" >&6
14888 else
14889
14890         cf_cv_curses_wacs_map=unknown
14891         for name in wacs_map _wacs_map __wacs_map _nc_wacs _wacs_char
14892         do
14893         cat >conftest.$ac_ext <<_ACEOF
14894 #line 14894 "configure"
14895 #include "confdefs.h"
14896
14897 #ifndef _XOPEN_SOURCE_EXTENDED
14898 #define _XOPEN_SOURCE_EXTENDED
14899 #endif
14900 #include <${cf_cv_ncurses_header:-curses.h}>
14901 int
14902 main ()
14903 {
14904 void *foo = &($name['k'])
14905   ;
14906   return 0;
14907 }
14908 _ACEOF
14909 rm -f conftest.$ac_objext conftest$ac_exeext
14910 if { (eval echo "$as_me:14910: \"$ac_link\"") >&5
14911   (eval $ac_link) 2>&5
14912   ac_status=$?
14913   echo "$as_me:14913: \$? = $ac_status" >&5
14914   (exit $ac_status); } &&
14915          { ac_try='test -s conftest$ac_exeext'
14916   { (eval echo "$as_me:14916: \"$ac_try\"") >&5
14917   (eval $ac_try) 2>&5
14918   ac_status=$?
14919   echo "$as_me:14919: \$? = $ac_status" >&5
14920   (exit $ac_status); }; }; then
14921   cf_cv_curses_wacs_map=$name
14922          break
14923 else
14924   echo "$as_me: failed program was:" >&5
14925 cat conftest.$ac_ext >&5
14926 fi
14927 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14928         done
14929 fi
14930 echo "$as_me:14930: result: $cf_cv_curses_wacs_map" >&5
14931 echo "${ECHO_T}$cf_cv_curses_wacs_map" >&6
14932
14933 test "$cf_cv_curses_wacs_map" != unknown &&
14934 cat >>confdefs.h <<EOF
14935 #define CURSES_WACS_ARRAY $cf_cv_curses_wacs_map
14936 EOF
14937
14938 echo "$as_me:14938: checking for wide alternate character constants" >&5
14939 echo $ECHO_N "checking for wide alternate character constants... $ECHO_C" >&6
14940 if test "${cf_cv_curses_wacs_symbols+set}" = set; then
14941   echo $ECHO_N "(cached) $ECHO_C" >&6
14942 else
14943
14944 cf_cv_curses_wacs_symbols=no
14945 if test "$cf_cv_curses_wacs_map" != unknown
14946 then
14947         cat >conftest.$ac_ext <<_ACEOF
14948 #line 14948 "configure"
14949 #include "confdefs.h"
14950
14951 #ifndef _XOPEN_SOURCE_EXTENDED
14952 #define _XOPEN_SOURCE_EXTENDED
14953 #endif
14954 #include <${cf_cv_ncurses_header:-curses.h}>
14955 int
14956 main ()
14957 {
14958 cchar_t *foo = WACS_PLUS;
14959          $cf_cv_curses_wacs_map['k'] = *WACS_PLUS
14960   ;
14961   return 0;
14962 }
14963 _ACEOF
14964 rm -f conftest.$ac_objext conftest$ac_exeext
14965 if { (eval echo "$as_me:14965: \"$ac_link\"") >&5
14966   (eval $ac_link) 2>&5
14967   ac_status=$?
14968   echo "$as_me:14968: \$? = $ac_status" >&5
14969   (exit $ac_status); } &&
14970          { ac_try='test -s conftest$ac_exeext'
14971   { (eval echo "$as_me:14971: \"$ac_try\"") >&5
14972   (eval $ac_try) 2>&5
14973   ac_status=$?
14974   echo "$as_me:14974: \$? = $ac_status" >&5
14975   (exit $ac_status); }; }; then
14976   cf_cv_curses_wacs_symbols=yes
14977 else
14978   echo "$as_me: failed program was:" >&5
14979 cat conftest.$ac_ext >&5
14980 fi
14981 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14982 else
14983         cat >conftest.$ac_ext <<_ACEOF
14984 #line 14984 "configure"
14985 #include "confdefs.h"
14986
14987 #ifndef _XOPEN_SOURCE_EXTENDED
14988 #define _XOPEN_SOURCE_EXTENDED
14989 #endif
14990 #include <${cf_cv_ncurses_header:-curses.h}>
14991 int
14992 main ()
14993 {
14994 cchar_t *foo = WACS_PLUS
14995   ;
14996   return 0;
14997 }
14998 _ACEOF
14999 rm -f conftest.$ac_objext conftest$ac_exeext
15000 if { (eval echo "$as_me:15000: \"$ac_link\"") >&5
15001   (eval $ac_link) 2>&5
15002   ac_status=$?
15003   echo "$as_me:15003: \$? = $ac_status" >&5
15004   (exit $ac_status); } &&
15005          { ac_try='test -s conftest$ac_exeext'
15006   { (eval echo "$as_me:15006: \"$ac_try\"") >&5
15007   (eval $ac_try) 2>&5
15008   ac_status=$?
15009   echo "$as_me:15009: \$? = $ac_status" >&5
15010   (exit $ac_status); }; }; then
15011   cf_cv_curses_wacs_symbols=yes
15012 else
15013   echo "$as_me: failed program was:" >&5
15014 cat conftest.$ac_ext >&5
15015 fi
15016 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15017 fi
15018
15019 fi
15020 echo "$as_me:15020: result: $cf_cv_curses_wacs_symbols" >&5
15021 echo "${ECHO_T}$cf_cv_curses_wacs_symbols" >&6
15022
15023 test "$cf_cv_curses_wacs_symbols" != no &&
15024 cat >>confdefs.h <<\EOF
15025 #define CURSES_WACS_SYMBOLS 1
15026 EOF
15027
15028 fi
15029
15030 echo "$as_me:15030: checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}" >&5
15031 echo $ECHO_N "checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
15032 cat >conftest.$ac_ext <<_ACEOF
15033 #line 15033 "configure"
15034 #include "confdefs.h"
15035
15036 #ifndef _XOPEN_SOURCE_EXTENDED
15037 #define _XOPEN_SOURCE_EXTENDED
15038 #endif
15039 #include <${cf_cv_ncurses_header:-curses.h}>
15040 int
15041 main ()
15042 {
15043
15044 attr_t foo
15045
15046   ;
15047   return 0;
15048 }
15049 _ACEOF
15050 rm -f conftest.$ac_objext
15051 if { (eval echo "$as_me:15051: \"$ac_compile\"") >&5
15052   (eval $ac_compile) 2>&5
15053   ac_status=$?
15054   echo "$as_me:15054: \$? = $ac_status" >&5
15055   (exit $ac_status); } &&
15056          { ac_try='test -s conftest.$ac_objext'
15057   { (eval echo "$as_me:15057: \"$ac_try\"") >&5
15058   (eval $ac_try) 2>&5
15059   ac_status=$?
15060   echo "$as_me:15060: \$? = $ac_status" >&5
15061   (exit $ac_status); }; }; then
15062   cf_result=yes
15063 else
15064   echo "$as_me: failed program was:" >&5
15065 cat conftest.$ac_ext >&5
15066 cf_result=no
15067 fi
15068 rm -f conftest.$ac_objext conftest.$ac_ext
15069 echo "$as_me:15069: result: $cf_result" >&5
15070 echo "${ECHO_T}$cf_result" >&6
15071 if test $cf_result = yes ; then
15072
15073 cf_result=`echo "have_type_attr_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15074
15075 cat >>confdefs.h <<EOF
15076 #define $cf_result 1
15077 EOF
15078
15079 else
15080
15081 cat >>confdefs.h <<EOF
15082 #define attr_t long
15083 EOF
15084
15085 fi
15086
15087 if test "$cf_enable_widec" = yes; then
15088
15089 # This is needed on Tru64 5.0 to declare mbstate_t
15090 echo "$as_me:15090: checking if we must include wchar.h to declare mbstate_t" >&5
15091 echo $ECHO_N "checking if we must include wchar.h to declare mbstate_t... $ECHO_C" >&6
15092 if test "${cf_cv_mbstate_t+set}" = set; then
15093   echo $ECHO_N "(cached) $ECHO_C" >&6
15094 else
15095
15096 cat >conftest.$ac_ext <<_ACEOF
15097 #line 15097 "configure"
15098 #include "confdefs.h"
15099
15100 #include <stdlib.h>
15101 #include <stdarg.h>
15102 #include <stdio.h>
15103 #ifdef HAVE_LIBUTF8_H
15104 #include <libutf8.h>
15105 #endif
15106 int
15107 main ()
15108 {
15109 mbstate_t state
15110   ;
15111   return 0;
15112 }
15113 _ACEOF
15114 rm -f conftest.$ac_objext
15115 if { (eval echo "$as_me:15115: \"$ac_compile\"") >&5
15116   (eval $ac_compile) 2>&5
15117   ac_status=$?
15118   echo "$as_me:15118: \$? = $ac_status" >&5
15119   (exit $ac_status); } &&
15120          { ac_try='test -s conftest.$ac_objext'
15121   { (eval echo "$as_me:15121: \"$ac_try\"") >&5
15122   (eval $ac_try) 2>&5
15123   ac_status=$?
15124   echo "$as_me:15124: \$? = $ac_status" >&5
15125   (exit $ac_status); }; }; then
15126   cf_cv_mbstate_t=no
15127 else
15128   echo "$as_me: failed program was:" >&5
15129 cat conftest.$ac_ext >&5
15130 cat >conftest.$ac_ext <<_ACEOF
15131 #line 15131 "configure"
15132 #include "confdefs.h"
15133
15134 #include <stdlib.h>
15135 #include <stdarg.h>
15136 #include <stdio.h>
15137 #include <wchar.h>
15138 #ifdef HAVE_LIBUTF8_H
15139 #include <libutf8.h>
15140 #endif
15141 int
15142 main ()
15143 {
15144 mbstate_t value
15145   ;
15146   return 0;
15147 }
15148 _ACEOF
15149 rm -f conftest.$ac_objext
15150 if { (eval echo "$as_me:15150: \"$ac_compile\"") >&5
15151   (eval $ac_compile) 2>&5
15152   ac_status=$?
15153   echo "$as_me:15153: \$? = $ac_status" >&5
15154   (exit $ac_status); } &&
15155          { ac_try='test -s conftest.$ac_objext'
15156   { (eval echo "$as_me:15156: \"$ac_try\"") >&5
15157   (eval $ac_try) 2>&5
15158   ac_status=$?
15159   echo "$as_me:15159: \$? = $ac_status" >&5
15160   (exit $ac_status); }; }; then
15161   cf_cv_mbstate_t=yes
15162 else
15163   echo "$as_me: failed program was:" >&5
15164 cat conftest.$ac_ext >&5
15165 cf_cv_mbstate_t=unknown
15166 fi
15167 rm -f conftest.$ac_objext conftest.$ac_ext
15168 fi
15169 rm -f conftest.$ac_objext conftest.$ac_ext
15170 fi
15171 echo "$as_me:15171: result: $cf_cv_mbstate_t" >&5
15172 echo "${ECHO_T}$cf_cv_mbstate_t" >&6
15173
15174 if test "$cf_cv_mbstate_t" = yes ; then
15175
15176 cat >>confdefs.h <<\EOF
15177 #define NEED_WCHAR_H 1
15178 EOF
15179
15180         NEED_WCHAR_H=1
15181 fi
15182
15183 # if we do not find mbstate_t in either place, use substitution to provide a fallback.
15184 if test "$cf_cv_mbstate_t" = unknown ; then
15185         NCURSES_MBSTATE_T=1
15186 fi
15187
15188 # if we find mbstate_t in either place, use substitution to provide a fallback.
15189 if test "$cf_cv_mbstate_t" != unknown ; then
15190         NCURSES_OK_MBSTATE_T=1
15191 fi
15192
15193 # This is needed on Tru64 5.0 to declare wchar_t
15194 echo "$as_me:15194: checking if we must include wchar.h to declare wchar_t" >&5
15195 echo $ECHO_N "checking if we must include wchar.h to declare wchar_t... $ECHO_C" >&6
15196 if test "${cf_cv_wchar_t+set}" = set; then
15197   echo $ECHO_N "(cached) $ECHO_C" >&6
15198 else
15199
15200 cat >conftest.$ac_ext <<_ACEOF
15201 #line 15201 "configure"
15202 #include "confdefs.h"
15203
15204 #include <stdlib.h>
15205 #include <stdarg.h>
15206 #include <stdio.h>
15207 #ifdef HAVE_LIBUTF8_H
15208 #include <libutf8.h>
15209 #endif
15210 int
15211 main ()
15212 {
15213 wchar_t state
15214   ;
15215   return 0;
15216 }
15217 _ACEOF
15218 rm -f conftest.$ac_objext
15219 if { (eval echo "$as_me:15219: \"$ac_compile\"") >&5
15220   (eval $ac_compile) 2>&5
15221   ac_status=$?
15222   echo "$as_me:15222: \$? = $ac_status" >&5
15223   (exit $ac_status); } &&
15224          { ac_try='test -s conftest.$ac_objext'
15225   { (eval echo "$as_me:15225: \"$ac_try\"") >&5
15226   (eval $ac_try) 2>&5
15227   ac_status=$?
15228   echo "$as_me:15228: \$? = $ac_status" >&5
15229   (exit $ac_status); }; }; then
15230   cf_cv_wchar_t=no
15231 else
15232   echo "$as_me: failed program was:" >&5
15233 cat conftest.$ac_ext >&5
15234 cat >conftest.$ac_ext <<_ACEOF
15235 #line 15235 "configure"
15236 #include "confdefs.h"
15237
15238 #include <stdlib.h>
15239 #include <stdarg.h>
15240 #include <stdio.h>
15241 #include <wchar.h>
15242 #ifdef HAVE_LIBUTF8_H
15243 #include <libutf8.h>
15244 #endif
15245 int
15246 main ()
15247 {
15248 wchar_t value
15249   ;
15250   return 0;
15251 }
15252 _ACEOF
15253 rm -f conftest.$ac_objext
15254 if { (eval echo "$as_me:15254: \"$ac_compile\"") >&5
15255   (eval $ac_compile) 2>&5
15256   ac_status=$?
15257   echo "$as_me:15257: \$? = $ac_status" >&5
15258   (exit $ac_status); } &&
15259          { ac_try='test -s conftest.$ac_objext'
15260   { (eval echo "$as_me:15260: \"$ac_try\"") >&5
15261   (eval $ac_try) 2>&5
15262   ac_status=$?
15263   echo "$as_me:15263: \$? = $ac_status" >&5
15264   (exit $ac_status); }; }; then
15265   cf_cv_wchar_t=yes
15266 else
15267   echo "$as_me: failed program was:" >&5
15268 cat conftest.$ac_ext >&5
15269 cf_cv_wchar_t=unknown
15270 fi
15271 rm -f conftest.$ac_objext conftest.$ac_ext
15272 fi
15273 rm -f conftest.$ac_objext conftest.$ac_ext
15274 fi
15275 echo "$as_me:15275: result: $cf_cv_wchar_t" >&5
15276 echo "${ECHO_T}$cf_cv_wchar_t" >&6
15277
15278 if test "$cf_cv_wchar_t" = yes ; then
15279
15280 cat >>confdefs.h <<\EOF
15281 #define NEED_WCHAR_H 1
15282 EOF
15283
15284         NEED_WCHAR_H=1
15285 fi
15286
15287 # if we do not find wchar_t in either place, use substitution to provide a fallback.
15288 if test "$cf_cv_wchar_t" = unknown ; then
15289         NCURSES_WCHAR_T=1
15290 fi
15291
15292 # if we find wchar_t in either place, use substitution to provide a fallback.
15293 if test "$cf_cv_wchar_t" != unknown ; then
15294         NCURSES_OK_WCHAR_T=1
15295 fi
15296
15297 # This is needed on Tru64 5.0 to declare wint_t
15298 echo "$as_me:15298: checking if we must include wchar.h to declare wint_t" >&5
15299 echo $ECHO_N "checking if we must include wchar.h to declare wint_t... $ECHO_C" >&6
15300 if test "${cf_cv_wint_t+set}" = set; then
15301   echo $ECHO_N "(cached) $ECHO_C" >&6
15302 else
15303
15304 cat >conftest.$ac_ext <<_ACEOF
15305 #line 15305 "configure"
15306 #include "confdefs.h"
15307
15308 #include <stdlib.h>
15309 #include <stdarg.h>
15310 #include <stdio.h>
15311 #ifdef HAVE_LIBUTF8_H
15312 #include <libutf8.h>
15313 #endif
15314 int
15315 main ()
15316 {
15317 wint_t state
15318   ;
15319   return 0;
15320 }
15321 _ACEOF
15322 rm -f conftest.$ac_objext
15323 if { (eval echo "$as_me:15323: \"$ac_compile\"") >&5
15324   (eval $ac_compile) 2>&5
15325   ac_status=$?
15326   echo "$as_me:15326: \$? = $ac_status" >&5
15327   (exit $ac_status); } &&
15328          { ac_try='test -s conftest.$ac_objext'
15329   { (eval echo "$as_me:15329: \"$ac_try\"") >&5
15330   (eval $ac_try) 2>&5
15331   ac_status=$?
15332   echo "$as_me:15332: \$? = $ac_status" >&5
15333   (exit $ac_status); }; }; then
15334   cf_cv_wint_t=no
15335 else
15336   echo "$as_me: failed program was:" >&5
15337 cat conftest.$ac_ext >&5
15338 cat >conftest.$ac_ext <<_ACEOF
15339 #line 15339 "configure"
15340 #include "confdefs.h"
15341
15342 #include <stdlib.h>
15343 #include <stdarg.h>
15344 #include <stdio.h>
15345 #include <wchar.h>
15346 #ifdef HAVE_LIBUTF8_H
15347 #include <libutf8.h>
15348 #endif
15349 int
15350 main ()
15351 {
15352 wint_t value
15353   ;
15354   return 0;
15355 }
15356 _ACEOF
15357 rm -f conftest.$ac_objext
15358 if { (eval echo "$as_me:15358: \"$ac_compile\"") >&5
15359   (eval $ac_compile) 2>&5
15360   ac_status=$?
15361   echo "$as_me:15361: \$? = $ac_status" >&5
15362   (exit $ac_status); } &&
15363          { ac_try='test -s conftest.$ac_objext'
15364   { (eval echo "$as_me:15364: \"$ac_try\"") >&5
15365   (eval $ac_try) 2>&5
15366   ac_status=$?
15367   echo "$as_me:15367: \$? = $ac_status" >&5
15368   (exit $ac_status); }; }; then
15369   cf_cv_wint_t=yes
15370 else
15371   echo "$as_me: failed program was:" >&5
15372 cat conftest.$ac_ext >&5
15373 cf_cv_wint_t=unknown
15374 fi
15375 rm -f conftest.$ac_objext conftest.$ac_ext
15376 fi
15377 rm -f conftest.$ac_objext conftest.$ac_ext
15378 fi
15379 echo "$as_me:15379: result: $cf_cv_wint_t" >&5
15380 echo "${ECHO_T}$cf_cv_wint_t" >&6
15381
15382 if test "$cf_cv_wint_t" = yes ; then
15383
15384 cat >>confdefs.h <<\EOF
15385 #define NEED_WCHAR_H 1
15386 EOF
15387
15388         NEED_WCHAR_H=1
15389 fi
15390
15391 # if we do not find wint_t in either place, use substitution to provide a fallback.
15392 if test "$cf_cv_wint_t" = unknown ; then
15393         NCURSES_WINT_T=1
15394 fi
15395
15396 # if we find wint_t in either place, use substitution to provide a fallback.
15397 if test "$cf_cv_wint_t" != unknown ; then
15398         NCURSES_OK_WINT_T=1
15399 fi
15400
15401         if test "$NCURSES_OK_MBSTATE_T" = 0 ; then
15402
15403 echo "$as_me:15403: checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}" >&5
15404 echo $ECHO_N "checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
15405 cat >conftest.$ac_ext <<_ACEOF
15406 #line 15406 "configure"
15407 #include "confdefs.h"
15408
15409 #ifndef _XOPEN_SOURCE_EXTENDED
15410 #define _XOPEN_SOURCE_EXTENDED
15411 #endif
15412 #include <${cf_cv_ncurses_header:-curses.h}>
15413 int
15414 main ()
15415 {
15416
15417 mbstate_t foo
15418
15419   ;
15420   return 0;
15421 }
15422 _ACEOF
15423 rm -f conftest.$ac_objext
15424 if { (eval echo "$as_me:15424: \"$ac_compile\"") >&5
15425   (eval $ac_compile) 2>&5
15426   ac_status=$?
15427   echo "$as_me:15427: \$? = $ac_status" >&5
15428   (exit $ac_status); } &&
15429          { ac_try='test -s conftest.$ac_objext'
15430   { (eval echo "$as_me:15430: \"$ac_try\"") >&5
15431   (eval $ac_try) 2>&5
15432   ac_status=$?
15433   echo "$as_me:15433: \$? = $ac_status" >&5
15434   (exit $ac_status); }; }; then
15435   cf_result=yes
15436 else
15437   echo "$as_me: failed program was:" >&5
15438 cat conftest.$ac_ext >&5
15439 cf_result=no
15440 fi
15441 rm -f conftest.$ac_objext conftest.$ac_ext
15442 echo "$as_me:15442: result: $cf_result" >&5
15443 echo "${ECHO_T}$cf_result" >&6
15444 if test $cf_result = yes ; then
15445
15446 cf_result=`echo "have_type_mbstate_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15447
15448 cat >>confdefs.h <<EOF
15449 #define $cf_result 1
15450 EOF
15451
15452 else
15453
15454 cat >>confdefs.h <<EOF
15455 #define mbstate_t long
15456 EOF
15457
15458 fi
15459
15460         fi
15461
15462         if test "$NCURSES_OK_WCHAR_T" = 0 ; then
15463
15464 echo "$as_me:15464: checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}" >&5
15465 echo $ECHO_N "checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
15466 cat >conftest.$ac_ext <<_ACEOF
15467 #line 15467 "configure"
15468 #include "confdefs.h"
15469
15470 #ifndef _XOPEN_SOURCE_EXTENDED
15471 #define _XOPEN_SOURCE_EXTENDED
15472 #endif
15473 #include <${cf_cv_ncurses_header:-curses.h}>
15474 int
15475 main ()
15476 {
15477
15478 wchar_t foo
15479
15480   ;
15481   return 0;
15482 }
15483 _ACEOF
15484 rm -f conftest.$ac_objext
15485 if { (eval echo "$as_me:15485: \"$ac_compile\"") >&5
15486   (eval $ac_compile) 2>&5
15487   ac_status=$?
15488   echo "$as_me:15488: \$? = $ac_status" >&5
15489   (exit $ac_status); } &&
15490          { ac_try='test -s conftest.$ac_objext'
15491   { (eval echo "$as_me:15491: \"$ac_try\"") >&5
15492   (eval $ac_try) 2>&5
15493   ac_status=$?
15494   echo "$as_me:15494: \$? = $ac_status" >&5
15495   (exit $ac_status); }; }; then
15496   cf_result=yes
15497 else
15498   echo "$as_me: failed program was:" >&5
15499 cat conftest.$ac_ext >&5
15500 cf_result=no
15501 fi
15502 rm -f conftest.$ac_objext conftest.$ac_ext
15503 echo "$as_me:15503: result: $cf_result" >&5
15504 echo "${ECHO_T}$cf_result" >&6
15505 if test $cf_result = yes ; then
15506
15507 cf_result=`echo "have_type_wchar_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15508
15509 cat >>confdefs.h <<EOF
15510 #define $cf_result 1
15511 EOF
15512
15513 else
15514
15515 cat >>confdefs.h <<EOF
15516 #define wchar_t long
15517 EOF
15518
15519 fi
15520
15521         fi
15522
15523         if test "$NCURSES_OK_WINT_T" = 0 ; then
15524
15525 echo "$as_me:15525: checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}" >&5
15526 echo $ECHO_N "checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
15527 cat >conftest.$ac_ext <<_ACEOF
15528 #line 15528 "configure"
15529 #include "confdefs.h"
15530
15531 #ifndef _XOPEN_SOURCE_EXTENDED
15532 #define _XOPEN_SOURCE_EXTENDED
15533 #endif
15534 #include <${cf_cv_ncurses_header:-curses.h}>
15535 int
15536 main ()
15537 {
15538
15539 wint_t foo
15540
15541   ;
15542   return 0;
15543 }
15544 _ACEOF
15545 rm -f conftest.$ac_objext
15546 if { (eval echo "$as_me:15546: \"$ac_compile\"") >&5
15547   (eval $ac_compile) 2>&5
15548   ac_status=$?
15549   echo "$as_me:15549: \$? = $ac_status" >&5
15550   (exit $ac_status); } &&
15551          { ac_try='test -s conftest.$ac_objext'
15552   { (eval echo "$as_me:15552: \"$ac_try\"") >&5
15553   (eval $ac_try) 2>&5
15554   ac_status=$?
15555   echo "$as_me:15555: \$? = $ac_status" >&5
15556   (exit $ac_status); }; }; then
15557   cf_result=yes
15558 else
15559   echo "$as_me: failed program was:" >&5
15560 cat conftest.$ac_ext >&5
15561 cf_result=no
15562 fi
15563 rm -f conftest.$ac_objext conftest.$ac_ext
15564 echo "$as_me:15564: result: $cf_result" >&5
15565 echo "${ECHO_T}$cf_result" >&6
15566 if test $cf_result = yes ; then
15567
15568 cf_result=`echo "have_type_wint_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15569
15570 cat >>confdefs.h <<EOF
15571 #define $cf_result 1
15572 EOF
15573
15574 else
15575
15576 cat >>confdefs.h <<EOF
15577 #define wint_t long
15578 EOF
15579
15580 fi
15581
15582         fi
15583 fi
15584
15585 echo "$as_me:15585: checking for data boolnames declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
15586 echo $ECHO_N "checking for data boolnames declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
15587
15588 cat >conftest.$ac_ext <<_ACEOF
15589 #line 15589 "configure"
15590 #include "confdefs.h"
15591
15592 #ifdef HAVE_XCURSES
15593 #include <xcurses.h>
15594 char * XCursesProgramName = "test";
15595 #else
15596 #include <${cf_cv_ncurses_header:-curses.h}>
15597 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
15598 #include <ncursesw/term.h>
15599 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
15600 #include <ncurses/term.h>
15601 #elif defined(HAVE_TERM_H)
15602 #include <term.h>
15603 #endif
15604 #endif
15605
15606 int
15607 main ()
15608 {
15609
15610 void *foo = &(boolnames)
15611
15612   ;
15613   return 0;
15614 }
15615 _ACEOF
15616 rm -f conftest.$ac_objext
15617 if { (eval echo "$as_me:15617: \"$ac_compile\"") >&5
15618   (eval $ac_compile) 2>&5
15619   ac_status=$?
15620   echo "$as_me:15620: \$? = $ac_status" >&5
15621   (exit $ac_status); } &&
15622          { ac_try='test -s conftest.$ac_objext'
15623   { (eval echo "$as_me:15623: \"$ac_try\"") >&5
15624   (eval $ac_try) 2>&5
15625   ac_status=$?
15626   echo "$as_me:15626: \$? = $ac_status" >&5
15627   (exit $ac_status); }; }; then
15628   cf_result=yes
15629 else
15630   echo "$as_me: failed program was:" >&5
15631 cat conftest.$ac_ext >&5
15632 cf_result=no
15633 fi
15634 rm -f conftest.$ac_objext conftest.$ac_ext
15635 echo "$as_me:15635: result: $cf_result" >&5
15636 echo "${ECHO_T}$cf_result" >&6
15637
15638 if test $cf_result = yes ; then
15639
15640 cf_result=`echo "have_curses_data_boolnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15641
15642         cat >>confdefs.h <<EOF
15643 #define $cf_result 1
15644 EOF
15645
15646 else
15647         echo "$as_me:15647: checking for data boolnames in library" >&5
15648 echo $ECHO_N "checking for data boolnames in library... $ECHO_C" >&6
15649         # BSD linkers insist on making weak linkage, but resolve at runtime.
15650         if test "$cross_compiling" = yes; then
15651
15652         # cross-compiling
15653         cat >conftest.$ac_ext <<_ACEOF
15654 #line 15654 "configure"
15655 #include "confdefs.h"
15656
15657 #ifdef HAVE_XCURSES
15658 #include <xcurses.h>
15659 char * XCursesProgramName = "test";
15660 #else
15661 #include <${cf_cv_ncurses_header:-curses.h}>
15662 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
15663 #include <ncursesw/term.h>
15664 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
15665 #include <ncurses/term.h>
15666 #elif defined(HAVE_TERM_H)
15667 #include <term.h>
15668 #endif
15669 #endif
15670
15671 extern char boolnames;
15672 int
15673 main ()
15674 {
15675
15676         do {
15677                 void *foo = &(boolnames);
15678                 fprintf(stderr, "testing linkage of boolnames:%p\n", foo);
15679                 ${cf_cv_main_return:-return}(foo == 0);
15680         } while (0)
15681
15682   ;
15683   return 0;
15684 }
15685 _ACEOF
15686 rm -f conftest.$ac_objext conftest$ac_exeext
15687 if { (eval echo "$as_me:15687: \"$ac_link\"") >&5
15688   (eval $ac_link) 2>&5
15689   ac_status=$?
15690   echo "$as_me:15690: \$? = $ac_status" >&5
15691   (exit $ac_status); } &&
15692          { ac_try='test -s conftest$ac_exeext'
15693   { (eval echo "$as_me:15693: \"$ac_try\"") >&5
15694   (eval $ac_try) 2>&5
15695   ac_status=$?
15696   echo "$as_me:15696: \$? = $ac_status" >&5
15697   (exit $ac_status); }; }; then
15698   cf_result=yes
15699 else
15700   echo "$as_me: failed program was:" >&5
15701 cat conftest.$ac_ext >&5
15702 cf_result=no
15703 fi
15704 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15705
15706 else
15707   cat >conftest.$ac_ext <<_ACEOF
15708 #line 15708 "configure"
15709 #include "confdefs.h"
15710
15711 #ifdef HAVE_XCURSES
15712 #include <xcurses.h>
15713 char * XCursesProgramName = "test";
15714 #else
15715 #include <${cf_cv_ncurses_header:-curses.h}>
15716 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
15717 #include <ncursesw/term.h>
15718 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
15719 #include <ncurses/term.h>
15720 #elif defined(HAVE_TERM_H)
15721 #include <term.h>
15722 #endif
15723 #endif
15724
15725 extern char boolnames;
15726 int main(void)
15727 {
15728         void *foo = &(boolnames);
15729         fprintf(stderr, "testing linkage of boolnames:%p\n", foo);
15730         ${cf_cv_main_return:-return}(foo == 0);
15731 }
15732 _ACEOF
15733 rm -f conftest$ac_exeext
15734 if { (eval echo "$as_me:15734: \"$ac_link\"") >&5
15735   (eval $ac_link) 2>&5
15736   ac_status=$?
15737   echo "$as_me:15737: \$? = $ac_status" >&5
15738   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
15739   { (eval echo "$as_me:15739: \"$ac_try\"") >&5
15740   (eval $ac_try) 2>&5
15741   ac_status=$?
15742   echo "$as_me:15742: \$? = $ac_status" >&5
15743   (exit $ac_status); }; }; then
15744   cf_result=yes
15745 else
15746   echo "$as_me: program exited with status $ac_status" >&5
15747 echo "$as_me: failed program was:" >&5
15748 cat conftest.$ac_ext >&5
15749 cf_result=no
15750 fi
15751 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
15752 fi
15753         echo "$as_me:15753: result: $cf_result" >&5
15754 echo "${ECHO_T}$cf_result" >&6
15755         if test $cf_result = yes ; then
15756
15757 cf_result=`echo "decl_curses_data_boolnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15758
15759                 cat >>confdefs.h <<EOF
15760 #define $cf_result 1
15761 EOF
15762
15763         fi
15764 fi
15765
15766 echo "$as_me:15766: checking for data boolfnames declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
15767 echo $ECHO_N "checking for data boolfnames declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
15768
15769 cat >conftest.$ac_ext <<_ACEOF
15770 #line 15770 "configure"
15771 #include "confdefs.h"
15772
15773 #ifdef HAVE_XCURSES
15774 #include <xcurses.h>
15775 char * XCursesProgramName = "test";
15776 #else
15777 #include <${cf_cv_ncurses_header:-curses.h}>
15778 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
15779 #include <ncursesw/term.h>
15780 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
15781 #include <ncurses/term.h>
15782 #elif defined(HAVE_TERM_H)
15783 #include <term.h>
15784 #endif
15785 #endif
15786
15787 int
15788 main ()
15789 {
15790
15791 void *foo = &(boolfnames)
15792
15793   ;
15794   return 0;
15795 }
15796 _ACEOF
15797 rm -f conftest.$ac_objext
15798 if { (eval echo "$as_me:15798: \"$ac_compile\"") >&5
15799   (eval $ac_compile) 2>&5
15800   ac_status=$?
15801   echo "$as_me:15801: \$? = $ac_status" >&5
15802   (exit $ac_status); } &&
15803          { ac_try='test -s conftest.$ac_objext'
15804   { (eval echo "$as_me:15804: \"$ac_try\"") >&5
15805   (eval $ac_try) 2>&5
15806   ac_status=$?
15807   echo "$as_me:15807: \$? = $ac_status" >&5
15808   (exit $ac_status); }; }; then
15809   cf_result=yes
15810 else
15811   echo "$as_me: failed program was:" >&5
15812 cat conftest.$ac_ext >&5
15813 cf_result=no
15814 fi
15815 rm -f conftest.$ac_objext conftest.$ac_ext
15816 echo "$as_me:15816: result: $cf_result" >&5
15817 echo "${ECHO_T}$cf_result" >&6
15818
15819 if test $cf_result = yes ; then
15820
15821 cf_result=`echo "have_curses_data_boolfnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15822
15823         cat >>confdefs.h <<EOF
15824 #define $cf_result 1
15825 EOF
15826
15827 else
15828         echo "$as_me:15828: checking for data boolfnames in library" >&5
15829 echo $ECHO_N "checking for data boolfnames in library... $ECHO_C" >&6
15830         # BSD linkers insist on making weak linkage, but resolve at runtime.
15831         if test "$cross_compiling" = yes; then
15832
15833         # cross-compiling
15834         cat >conftest.$ac_ext <<_ACEOF
15835 #line 15835 "configure"
15836 #include "confdefs.h"
15837
15838 #ifdef HAVE_XCURSES
15839 #include <xcurses.h>
15840 char * XCursesProgramName = "test";
15841 #else
15842 #include <${cf_cv_ncurses_header:-curses.h}>
15843 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
15844 #include <ncursesw/term.h>
15845 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
15846 #include <ncurses/term.h>
15847 #elif defined(HAVE_TERM_H)
15848 #include <term.h>
15849 #endif
15850 #endif
15851
15852 extern char boolfnames;
15853 int
15854 main ()
15855 {
15856
15857         do {
15858                 void *foo = &(boolfnames);
15859                 fprintf(stderr, "testing linkage of boolfnames:%p\n", foo);
15860                 ${cf_cv_main_return:-return}(foo == 0);
15861         } while (0)
15862
15863   ;
15864   return 0;
15865 }
15866 _ACEOF
15867 rm -f conftest.$ac_objext conftest$ac_exeext
15868 if { (eval echo "$as_me:15868: \"$ac_link\"") >&5
15869   (eval $ac_link) 2>&5
15870   ac_status=$?
15871   echo "$as_me:15871: \$? = $ac_status" >&5
15872   (exit $ac_status); } &&
15873          { ac_try='test -s conftest$ac_exeext'
15874   { (eval echo "$as_me:15874: \"$ac_try\"") >&5
15875   (eval $ac_try) 2>&5
15876   ac_status=$?
15877   echo "$as_me:15877: \$? = $ac_status" >&5
15878   (exit $ac_status); }; }; then
15879   cf_result=yes
15880 else
15881   echo "$as_me: failed program was:" >&5
15882 cat conftest.$ac_ext >&5
15883 cf_result=no
15884 fi
15885 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15886
15887 else
15888   cat >conftest.$ac_ext <<_ACEOF
15889 #line 15889 "configure"
15890 #include "confdefs.h"
15891
15892 #ifdef HAVE_XCURSES
15893 #include <xcurses.h>
15894 char * XCursesProgramName = "test";
15895 #else
15896 #include <${cf_cv_ncurses_header:-curses.h}>
15897 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
15898 #include <ncursesw/term.h>
15899 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
15900 #include <ncurses/term.h>
15901 #elif defined(HAVE_TERM_H)
15902 #include <term.h>
15903 #endif
15904 #endif
15905
15906 extern char boolfnames;
15907 int main(void)
15908 {
15909         void *foo = &(boolfnames);
15910         fprintf(stderr, "testing linkage of boolfnames:%p\n", foo);
15911         ${cf_cv_main_return:-return}(foo == 0);
15912 }
15913 _ACEOF
15914 rm -f conftest$ac_exeext
15915 if { (eval echo "$as_me:15915: \"$ac_link\"") >&5
15916   (eval $ac_link) 2>&5
15917   ac_status=$?
15918   echo "$as_me:15918: \$? = $ac_status" >&5
15919   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
15920   { (eval echo "$as_me:15920: \"$ac_try\"") >&5
15921   (eval $ac_try) 2>&5
15922   ac_status=$?
15923   echo "$as_me:15923: \$? = $ac_status" >&5
15924   (exit $ac_status); }; }; then
15925   cf_result=yes
15926 else
15927   echo "$as_me: program exited with status $ac_status" >&5
15928 echo "$as_me: failed program was:" >&5
15929 cat conftest.$ac_ext >&5
15930 cf_result=no
15931 fi
15932 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
15933 fi
15934         echo "$as_me:15934: result: $cf_result" >&5
15935 echo "${ECHO_T}$cf_result" >&6
15936         if test $cf_result = yes ; then
15937
15938 cf_result=`echo "decl_curses_data_boolfnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15939
15940                 cat >>confdefs.h <<EOF
15941 #define $cf_result 1
15942 EOF
15943
15944         fi
15945 fi
15946
15947 if ( test "$GCC" = yes || test "$GXX" = yes )
15948 then
15949 echo "$as_me:15949: checking if you want to turn on gcc warnings" >&5
15950 echo $ECHO_N "checking if you want to turn on gcc warnings... $ECHO_C" >&6
15951
15952 # Check whether --enable-warnings or --disable-warnings was given.
15953 if test "${enable_warnings+set}" = set; then
15954   enableval="$enable_warnings"
15955   test "$enableval" != yes && enableval=no
15956   if test "$enableval" != "no" ; then
15957     with_warnings=yes
15958   else
15959     with_warnings=no
15960   fi
15961 else
15962   enableval=no
15963   with_warnings=no
15964
15965 fi;
15966 echo "$as_me:15966: result: $with_warnings" >&5
15967 echo "${ECHO_T}$with_warnings" >&6
15968 if test "$with_warnings" = "yes"
15969 then
15970
15971 if test "$GCC" = yes
15972 then
15973 cat > conftest.i <<EOF
15974 #ifndef GCC_PRINTF
15975 #define GCC_PRINTF 0
15976 #endif
15977 #ifndef GCC_SCANF
15978 #define GCC_SCANF 0
15979 #endif
15980 #ifndef GCC_NORETURN
15981 #define GCC_NORETURN /* nothing */
15982 #endif
15983 #ifndef GCC_UNUSED
15984 #define GCC_UNUSED /* nothing */
15985 #endif
15986 EOF
15987 if test "$GCC" = yes
15988 then
15989         { echo "$as_me:15989: checking for $CC __attribute__ directives..." >&5
15990 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
15991 cat > conftest.$ac_ext <<EOF
15992 #line 15992 "${as_me:-configure}"
15993 #include "confdefs.h"
15994 #include "conftest.h"
15995 #include "conftest.i"
15996 #if     GCC_PRINTF
15997 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
15998 #else
15999 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
16000 #endif
16001 #if     GCC_SCANF
16002 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
16003 #else
16004 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
16005 #endif
16006 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
16007 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
16008 extern void foo(void) GCC_NORETURN;
16009 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
16010 EOF
16011         cf_printf_attribute=no
16012         cf_scanf_attribute=no
16013         for cf_attribute in scanf printf unused noreturn
16014         do
16015
16016 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16017
16018                 cf_directive="__attribute__(($cf_attribute))"
16019                 echo "checking for $CC $cf_directive" 1>&5
16020
16021                 case $cf_attribute in
16022                 (printf)
16023                         cf_printf_attribute=yes
16024                         cat >conftest.h <<EOF
16025 #define GCC_$cf_ATTRIBUTE 1
16026 EOF
16027                         ;;
16028                 (scanf)
16029                         cf_scanf_attribute=yes
16030                         cat >conftest.h <<EOF
16031 #define GCC_$cf_ATTRIBUTE 1
16032 EOF
16033                         ;;
16034                 (*)
16035                         cat >conftest.h <<EOF
16036 #define GCC_$cf_ATTRIBUTE $cf_directive
16037 EOF
16038                         ;;
16039                 esac
16040
16041                 if { (eval echo "$as_me:16041: \"$ac_compile\"") >&5
16042   (eval $ac_compile) 2>&5
16043   ac_status=$?
16044   echo "$as_me:16044: \$? = $ac_status" >&5
16045   (exit $ac_status); }; then
16046                         test -n "$verbose" && echo "$as_me:16046: result: ... $cf_attribute" >&5
16047 echo "${ECHO_T}... $cf_attribute" >&6
16048                         cat conftest.h >>confdefs.h
16049                         case $cf_attribute in
16050                         (noreturn)
16051
16052 cat >>confdefs.h <<EOF
16053 #define GCC_NORETURN $cf_directive
16054 EOF
16055
16056                                 ;;
16057                         (printf)
16058                                 cf_value='/* nothing */'
16059                                 if test "$cf_printf_attribute" != no ; then
16060                                         cf_value='__attribute__((format(printf,fmt,var)))'
16061
16062 cat >>confdefs.h <<\EOF
16063 #define GCC_PRINTF 1
16064 EOF
16065
16066                                 fi
16067
16068 cat >>confdefs.h <<EOF
16069 #define GCC_PRINTFLIKE(fmt,var) $cf_value
16070 EOF
16071
16072                                 ;;
16073                         (scanf)
16074                                 cf_value='/* nothing */'
16075                                 if test "$cf_scanf_attribute" != no ; then
16076                                         cf_value='__attribute__((format(scanf,fmt,var)))'
16077
16078 cat >>confdefs.h <<\EOF
16079 #define GCC_SCANF 1
16080 EOF
16081
16082                                 fi
16083
16084 cat >>confdefs.h <<EOF
16085 #define GCC_SCANFLIKE(fmt,var) $cf_value
16086 EOF
16087
16088                                 ;;
16089                         (unused)
16090
16091 cat >>confdefs.h <<EOF
16092 #define GCC_UNUSED $cf_directive
16093 EOF
16094
16095                                 ;;
16096                         esac
16097                 fi
16098         done
16099 else
16100         fgrep define conftest.i >>confdefs.h
16101 fi
16102 rm -rf conftest*
16103 fi
16104
16105 INTEL_COMPILER=no
16106
16107 if test "$GCC" = yes ; then
16108         case $host_os in
16109         (linux*|gnu*)
16110                 echo "$as_me:16110: checking if this is really Intel C compiler" >&5
16111 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
16112                 cf_save_CFLAGS="$CFLAGS"
16113                 CFLAGS="$CFLAGS -no-gcc"
16114                 cat >conftest.$ac_ext <<_ACEOF
16115 #line 16115 "configure"
16116 #include "confdefs.h"
16117
16118 int
16119 main ()
16120 {
16121
16122 #ifdef __INTEL_COMPILER
16123 #else
16124 make an error
16125 #endif
16126
16127   ;
16128   return 0;
16129 }
16130 _ACEOF
16131 rm -f conftest.$ac_objext
16132 if { (eval echo "$as_me:16132: \"$ac_compile\"") >&5
16133   (eval $ac_compile) 2>&5
16134   ac_status=$?
16135   echo "$as_me:16135: \$? = $ac_status" >&5
16136   (exit $ac_status); } &&
16137          { ac_try='test -s conftest.$ac_objext'
16138   { (eval echo "$as_me:16138: \"$ac_try\"") >&5
16139   (eval $ac_try) 2>&5
16140   ac_status=$?
16141   echo "$as_me:16141: \$? = $ac_status" >&5
16142   (exit $ac_status); }; }; then
16143   INTEL_COMPILER=yes
16144 cf_save_CFLAGS="$cf_save_CFLAGS -we147"
16145
16146 else
16147   echo "$as_me: failed program was:" >&5
16148 cat conftest.$ac_ext >&5
16149 fi
16150 rm -f conftest.$ac_objext conftest.$ac_ext
16151                 CFLAGS="$cf_save_CFLAGS"
16152                 echo "$as_me:16152: result: $INTEL_COMPILER" >&5
16153 echo "${ECHO_T}$INTEL_COMPILER" >&6
16154                 ;;
16155         esac
16156 fi
16157
16158 CLANG_COMPILER=no
16159
16160 if test "$GCC" = yes ; then
16161         echo "$as_me:16161: checking if this is really Clang C compiler" >&5
16162 echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6
16163         cf_save_CFLAGS="$CFLAGS"
16164         CFLAGS="$CFLAGS -Qunused-arguments"
16165         cat >conftest.$ac_ext <<_ACEOF
16166 #line 16166 "configure"
16167 #include "confdefs.h"
16168
16169 int
16170 main ()
16171 {
16172
16173 #ifdef __clang__
16174 #else
16175 make an error
16176 #endif
16177
16178   ;
16179   return 0;
16180 }
16181 _ACEOF
16182 rm -f conftest.$ac_objext
16183 if { (eval echo "$as_me:16183: \"$ac_compile\"") >&5
16184   (eval $ac_compile) 2>&5
16185   ac_status=$?
16186   echo "$as_me:16186: \$? = $ac_status" >&5
16187   (exit $ac_status); } &&
16188          { ac_try='test -s conftest.$ac_objext'
16189   { (eval echo "$as_me:16189: \"$ac_try\"") >&5
16190   (eval $ac_try) 2>&5
16191   ac_status=$?
16192   echo "$as_me:16192: \$? = $ac_status" >&5
16193   (exit $ac_status); }; }; then
16194   CLANG_COMPILER=yes
16195 cf_save_CFLAGS="$cf_save_CFLAGS -Qunused-arguments"
16196
16197 else
16198   echo "$as_me: failed program was:" >&5
16199 cat conftest.$ac_ext >&5
16200 fi
16201 rm -f conftest.$ac_objext conftest.$ac_ext
16202         CFLAGS="$cf_save_CFLAGS"
16203         echo "$as_me:16203: result: $CLANG_COMPILER" >&5
16204 echo "${ECHO_T}$CLANG_COMPILER" >&6
16205 fi
16206
16207 cat > conftest.$ac_ext <<EOF
16208 #line 16208 "${as_me:-configure}"
16209 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
16210 EOF
16211
16212 if test "$INTEL_COMPILER" = yes
16213 then
16214 # The "-wdXXX" options suppress warnings:
16215 # remark #1419: external declaration in primary source file
16216 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
16217 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
16218 # remark #193: zero used for undefined preprocessing identifier
16219 # remark #593: variable "curs_sb_left_arrow" was set but never used
16220 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
16221 # remark #869: parameter "tw" was never referenced
16222 # remark #981: operands are evaluated in unspecified order
16223 # warning #279: controlling expression is constant
16224
16225         { echo "$as_me:16225: checking for $CC warning options..." >&5
16226 echo "$as_me: checking for $CC warning options..." >&6;}
16227         cf_save_CFLAGS="$CFLAGS"
16228         EXTRA_CFLAGS="-Wall"
16229         for cf_opt in \
16230                 wd1419 \
16231                 wd1683 \
16232                 wd1684 \
16233                 wd193 \
16234                 wd593 \
16235                 wd279 \
16236                 wd810 \
16237                 wd869 \
16238                 wd981
16239         do
16240                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
16241                 if { (eval echo "$as_me:16241: \"$ac_compile\"") >&5
16242   (eval $ac_compile) 2>&5
16243   ac_status=$?
16244   echo "$as_me:16244: \$? = $ac_status" >&5
16245   (exit $ac_status); }; then
16246                         test -n "$verbose" && echo "$as_me:16246: result: ... -$cf_opt" >&5
16247 echo "${ECHO_T}... -$cf_opt" >&6
16248                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
16249                 fi
16250         done
16251         CFLAGS="$cf_save_CFLAGS"
16252
16253 elif test "$GCC" = yes
16254 then
16255         { echo "$as_me:16255: checking for $CC warning options..." >&5
16256 echo "$as_me: checking for $CC warning options..." >&6;}
16257         cf_save_CFLAGS="$CFLAGS"
16258         EXTRA_CFLAGS=
16259         cf_warn_CONST=""
16260         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
16261         cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
16262         test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
16263         for cf_opt in W Wall \
16264                 Wbad-function-cast \
16265                 Wcast-align \
16266                 Wcast-qual \
16267                 Wdeclaration-after-statement \
16268                 Wextra \
16269                 Winline \
16270                 Wmissing-declarations \
16271                 Wmissing-prototypes \
16272                 Wnested-externs \
16273                 Wpointer-arith \
16274                 Wshadow \
16275                 Wstrict-prototypes \
16276                 Wundef $cf_gcc_warnings $cf_warn_CONST
16277         do
16278                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
16279                 if { (eval echo "$as_me:16279: \"$ac_compile\"") >&5
16280   (eval $ac_compile) 2>&5
16281   ac_status=$?
16282   echo "$as_me:16282: \$? = $ac_status" >&5
16283   (exit $ac_status); }; then
16284                         test -n "$verbose" && echo "$as_me:16284: result: ... -$cf_opt" >&5
16285 echo "${ECHO_T}... -$cf_opt" >&6
16286                         case $cf_opt in
16287                         (Wcast-qual)
16288                                 CPPFLAGS="$CPPFLAGS -DXTSTRINGDEFINES"
16289                                 ;;
16290                         (Winline)
16291                                 case $GCC_VERSION in
16292                                 ([34].*)
16293                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
16294
16295 echo "${as_me:-configure}:16295: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
16296
16297                                         continue;;
16298                                 esac
16299                                 ;;
16300                         (Wpointer-arith)
16301                                 case $GCC_VERSION in
16302                                 ([12].*)
16303                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
16304
16305 echo "${as_me:-configure}:16305: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
16306
16307                                         continue;;
16308                                 esac
16309                                 ;;
16310                         esac
16311                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
16312                 fi
16313         done
16314         CFLAGS="$cf_save_CFLAGS"
16315 fi
16316 rm -rf conftest*
16317
16318 fi
16319 fi
16320
16321 echo "$as_me:16321: checking if you want to use dmalloc for testing" >&5
16322 echo $ECHO_N "checking if you want to use dmalloc for testing... $ECHO_C" >&6
16323
16324 # Check whether --with-dmalloc or --without-dmalloc was given.
16325 if test "${with_dmalloc+set}" = set; then
16326   withval="$with_dmalloc"
16327
16328 cat >>confdefs.h <<EOF
16329 #define USE_DMALLOC 1
16330 EOF
16331
16332         : ${with_cflags:=-g}
16333         : ${with_no_leaks:=yes}
16334          with_dmalloc=yes
16335 else
16336   with_dmalloc=
16337 fi;
16338 echo "$as_me:16338: result: ${with_dmalloc:-no}" >&5
16339 echo "${ECHO_T}${with_dmalloc:-no}" >&6
16340
16341 case .$with_cflags in
16342 (.*-g*)
16343         case .$CFLAGS in
16344         (.*-g*)
16345                 ;;
16346         (*)
16347
16348 cf_fix_cppflags=no
16349 cf_new_cflags=
16350 cf_new_cppflags=
16351 cf_new_extra_cppflags=
16352
16353 for cf_add_cflags in -g
16354 do
16355 case $cf_fix_cppflags in
16356 (no)
16357         case $cf_add_cflags in
16358         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
16359                 case $cf_add_cflags in
16360                 (-D*)
16361                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
16362
16363                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16364                                 && test -z "${cf_tst_cflags}" \
16365                                 && cf_fix_cppflags=yes
16366
16367                         if test $cf_fix_cppflags = yes ; then
16368                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
16369                                 continue
16370                         elif test "${cf_tst_cflags}" = "\"'" ; then
16371                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
16372                                 continue
16373                         fi
16374                         ;;
16375                 esac
16376                 case "$CPPFLAGS" in
16377                 (*$cf_add_cflags)
16378                         ;;
16379                 (*)
16380                         case $cf_add_cflags in
16381                         (-D*)
16382                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
16383
16384 CPPFLAGS=`echo "$CPPFLAGS" | \
16385         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
16386                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
16387
16388                                 ;;
16389                         esac
16390                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
16391                         ;;
16392                 esac
16393                 ;;
16394         (*)
16395                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
16396                 ;;
16397         esac
16398         ;;
16399 (yes)
16400         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
16401
16402         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
16403
16404         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16405                 && test -z "${cf_tst_cflags}" \
16406                 && cf_fix_cppflags=no
16407         ;;
16408 esac
16409 done
16410
16411 if test -n "$cf_new_cflags" ; then
16412
16413         CFLAGS="$CFLAGS $cf_new_cflags"
16414 fi
16415
16416 if test -n "$cf_new_cppflags" ; then
16417
16418         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
16419 fi
16420
16421 if test -n "$cf_new_extra_cppflags" ; then
16422
16423         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
16424 fi
16425
16426                 ;;
16427         esac
16428         ;;
16429 esac
16430
16431 if test "$with_dmalloc" = yes ; then
16432         echo "$as_me:16432: checking for dmalloc.h" >&5
16433 echo $ECHO_N "checking for dmalloc.h... $ECHO_C" >&6
16434 if test "${ac_cv_header_dmalloc_h+set}" = set; then
16435   echo $ECHO_N "(cached) $ECHO_C" >&6
16436 else
16437   cat >conftest.$ac_ext <<_ACEOF
16438 #line 16438 "configure"
16439 #include "confdefs.h"
16440 #include <dmalloc.h>
16441 _ACEOF
16442 if { (eval echo "$as_me:16442: \"$ac_cpp conftest.$ac_ext\"") >&5
16443   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
16444   ac_status=$?
16445   egrep -v '^ *\+' conftest.er1 >conftest.err
16446   rm -f conftest.er1
16447   cat conftest.err >&5
16448   echo "$as_me:16448: \$? = $ac_status" >&5
16449   (exit $ac_status); } >/dev/null; then
16450   if test -s conftest.err; then
16451     ac_cpp_err=$ac_c_preproc_warn_flag
16452   else
16453     ac_cpp_err=
16454   fi
16455 else
16456   ac_cpp_err=yes
16457 fi
16458 if test -z "$ac_cpp_err"; then
16459   ac_cv_header_dmalloc_h=yes
16460 else
16461   echo "$as_me: failed program was:" >&5
16462   cat conftest.$ac_ext >&5
16463   ac_cv_header_dmalloc_h=no
16464 fi
16465 rm -f conftest.err conftest.$ac_ext
16466 fi
16467 echo "$as_me:16467: result: $ac_cv_header_dmalloc_h" >&5
16468 echo "${ECHO_T}$ac_cv_header_dmalloc_h" >&6
16469 if test $ac_cv_header_dmalloc_h = yes; then
16470
16471 echo "$as_me:16471: checking for dmalloc_debug in -ldmalloc" >&5
16472 echo $ECHO_N "checking for dmalloc_debug in -ldmalloc... $ECHO_C" >&6
16473 if test "${ac_cv_lib_dmalloc_dmalloc_debug+set}" = set; then
16474   echo $ECHO_N "(cached) $ECHO_C" >&6
16475 else
16476   ac_check_lib_save_LIBS=$LIBS
16477 LIBS="-ldmalloc  $LIBS"
16478 cat >conftest.$ac_ext <<_ACEOF
16479 #line 16479 "configure"
16480 #include "confdefs.h"
16481
16482 /* Override any gcc2 internal prototype to avoid an error.  */
16483 #ifdef __cplusplus
16484 extern "C"
16485 #endif
16486 /* We use char because int might match the return type of a gcc2
16487    builtin and then its argument prototype would still apply.  */
16488 char dmalloc_debug ();
16489 int
16490 main ()
16491 {
16492 dmalloc_debug ();
16493   ;
16494   return 0;
16495 }
16496 _ACEOF
16497 rm -f conftest.$ac_objext conftest$ac_exeext
16498 if { (eval echo "$as_me:16498: \"$ac_link\"") >&5
16499   (eval $ac_link) 2>&5
16500   ac_status=$?
16501   echo "$as_me:16501: \$? = $ac_status" >&5
16502   (exit $ac_status); } &&
16503          { ac_try='test -s conftest$ac_exeext'
16504   { (eval echo "$as_me:16504: \"$ac_try\"") >&5
16505   (eval $ac_try) 2>&5
16506   ac_status=$?
16507   echo "$as_me:16507: \$? = $ac_status" >&5
16508   (exit $ac_status); }; }; then
16509   ac_cv_lib_dmalloc_dmalloc_debug=yes
16510 else
16511   echo "$as_me: failed program was:" >&5
16512 cat conftest.$ac_ext >&5
16513 ac_cv_lib_dmalloc_dmalloc_debug=no
16514 fi
16515 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16516 LIBS=$ac_check_lib_save_LIBS
16517 fi
16518 echo "$as_me:16518: result: $ac_cv_lib_dmalloc_dmalloc_debug" >&5
16519 echo "${ECHO_T}$ac_cv_lib_dmalloc_dmalloc_debug" >&6
16520 if test $ac_cv_lib_dmalloc_dmalloc_debug = yes; then
16521   cat >>confdefs.h <<EOF
16522 #define HAVE_LIBDMALLOC 1
16523 EOF
16524
16525   LIBS="-ldmalloc $LIBS"
16526
16527 fi
16528
16529 fi
16530
16531 fi
16532
16533 echo "$as_me:16533: checking if you want to use dbmalloc for testing" >&5
16534 echo $ECHO_N "checking if you want to use dbmalloc for testing... $ECHO_C" >&6
16535
16536 # Check whether --with-dbmalloc or --without-dbmalloc was given.
16537 if test "${with_dbmalloc+set}" = set; then
16538   withval="$with_dbmalloc"
16539
16540 cat >>confdefs.h <<EOF
16541 #define USE_DBMALLOC 1
16542 EOF
16543
16544         : ${with_cflags:=-g}
16545         : ${with_no_leaks:=yes}
16546          with_dbmalloc=yes
16547 else
16548   with_dbmalloc=
16549 fi;
16550 echo "$as_me:16550: result: ${with_dbmalloc:-no}" >&5
16551 echo "${ECHO_T}${with_dbmalloc:-no}" >&6
16552
16553 case .$with_cflags in
16554 (.*-g*)
16555         case .$CFLAGS in
16556         (.*-g*)
16557                 ;;
16558         (*)
16559
16560 cf_fix_cppflags=no
16561 cf_new_cflags=
16562 cf_new_cppflags=
16563 cf_new_extra_cppflags=
16564
16565 for cf_add_cflags in -g
16566 do
16567 case $cf_fix_cppflags in
16568 (no)
16569         case $cf_add_cflags in
16570         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
16571                 case $cf_add_cflags in
16572                 (-D*)
16573                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
16574
16575                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16576                                 && test -z "${cf_tst_cflags}" \
16577                                 && cf_fix_cppflags=yes
16578
16579                         if test $cf_fix_cppflags = yes ; then
16580                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
16581                                 continue
16582                         elif test "${cf_tst_cflags}" = "\"'" ; then
16583                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
16584                                 continue
16585                         fi
16586                         ;;
16587                 esac
16588                 case "$CPPFLAGS" in
16589                 (*$cf_add_cflags)
16590                         ;;
16591                 (*)
16592                         case $cf_add_cflags in
16593                         (-D*)
16594                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
16595
16596 CPPFLAGS=`echo "$CPPFLAGS" | \
16597         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
16598                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
16599
16600                                 ;;
16601                         esac
16602                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
16603                         ;;
16604                 esac
16605                 ;;
16606         (*)
16607                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
16608                 ;;
16609         esac
16610         ;;
16611 (yes)
16612         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
16613
16614         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
16615
16616         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16617                 && test -z "${cf_tst_cflags}" \
16618                 && cf_fix_cppflags=no
16619         ;;
16620 esac
16621 done
16622
16623 if test -n "$cf_new_cflags" ; then
16624
16625         CFLAGS="$CFLAGS $cf_new_cflags"
16626 fi
16627
16628 if test -n "$cf_new_cppflags" ; then
16629
16630         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
16631 fi
16632
16633 if test -n "$cf_new_extra_cppflags" ; then
16634
16635         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
16636 fi
16637
16638                 ;;
16639         esac
16640         ;;
16641 esac
16642
16643 if test "$with_dbmalloc" = yes ; then
16644         echo "$as_me:16644: checking for dbmalloc.h" >&5
16645 echo $ECHO_N "checking for dbmalloc.h... $ECHO_C" >&6
16646 if test "${ac_cv_header_dbmalloc_h+set}" = set; then
16647   echo $ECHO_N "(cached) $ECHO_C" >&6
16648 else
16649   cat >conftest.$ac_ext <<_ACEOF
16650 #line 16650 "configure"
16651 #include "confdefs.h"
16652 #include <dbmalloc.h>
16653 _ACEOF
16654 if { (eval echo "$as_me:16654: \"$ac_cpp conftest.$ac_ext\"") >&5
16655   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
16656   ac_status=$?
16657   egrep -v '^ *\+' conftest.er1 >conftest.err
16658   rm -f conftest.er1
16659   cat conftest.err >&5
16660   echo "$as_me:16660: \$? = $ac_status" >&5
16661   (exit $ac_status); } >/dev/null; then
16662   if test -s conftest.err; then
16663     ac_cpp_err=$ac_c_preproc_warn_flag
16664   else
16665     ac_cpp_err=
16666   fi
16667 else
16668   ac_cpp_err=yes
16669 fi
16670 if test -z "$ac_cpp_err"; then
16671   ac_cv_header_dbmalloc_h=yes
16672 else
16673   echo "$as_me: failed program was:" >&5
16674   cat conftest.$ac_ext >&5
16675   ac_cv_header_dbmalloc_h=no
16676 fi
16677 rm -f conftest.err conftest.$ac_ext
16678 fi
16679 echo "$as_me:16679: result: $ac_cv_header_dbmalloc_h" >&5
16680 echo "${ECHO_T}$ac_cv_header_dbmalloc_h" >&6
16681 if test $ac_cv_header_dbmalloc_h = yes; then
16682
16683 echo "$as_me:16683: checking for debug_malloc in -ldbmalloc" >&5
16684 echo $ECHO_N "checking for debug_malloc in -ldbmalloc... $ECHO_C" >&6
16685 if test "${ac_cv_lib_dbmalloc_debug_malloc+set}" = set; then
16686   echo $ECHO_N "(cached) $ECHO_C" >&6
16687 else
16688   ac_check_lib_save_LIBS=$LIBS
16689 LIBS="-ldbmalloc  $LIBS"
16690 cat >conftest.$ac_ext <<_ACEOF
16691 #line 16691 "configure"
16692 #include "confdefs.h"
16693
16694 /* Override any gcc2 internal prototype to avoid an error.  */
16695 #ifdef __cplusplus
16696 extern "C"
16697 #endif
16698 /* We use char because int might match the return type of a gcc2
16699    builtin and then its argument prototype would still apply.  */
16700 char debug_malloc ();
16701 int
16702 main ()
16703 {
16704 debug_malloc ();
16705   ;
16706   return 0;
16707 }
16708 _ACEOF
16709 rm -f conftest.$ac_objext conftest$ac_exeext
16710 if { (eval echo "$as_me:16710: \"$ac_link\"") >&5
16711   (eval $ac_link) 2>&5
16712   ac_status=$?
16713   echo "$as_me:16713: \$? = $ac_status" >&5
16714   (exit $ac_status); } &&
16715          { ac_try='test -s conftest$ac_exeext'
16716   { (eval echo "$as_me:16716: \"$ac_try\"") >&5
16717   (eval $ac_try) 2>&5
16718   ac_status=$?
16719   echo "$as_me:16719: \$? = $ac_status" >&5
16720   (exit $ac_status); }; }; then
16721   ac_cv_lib_dbmalloc_debug_malloc=yes
16722 else
16723   echo "$as_me: failed program was:" >&5
16724 cat conftest.$ac_ext >&5
16725 ac_cv_lib_dbmalloc_debug_malloc=no
16726 fi
16727 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16728 LIBS=$ac_check_lib_save_LIBS
16729 fi
16730 echo "$as_me:16730: result: $ac_cv_lib_dbmalloc_debug_malloc" >&5
16731 echo "${ECHO_T}$ac_cv_lib_dbmalloc_debug_malloc" >&6
16732 if test $ac_cv_lib_dbmalloc_debug_malloc = yes; then
16733   cat >>confdefs.h <<EOF
16734 #define HAVE_LIBDBMALLOC 1
16735 EOF
16736
16737   LIBS="-ldbmalloc $LIBS"
16738
16739 fi
16740
16741 fi
16742
16743 fi
16744
16745 echo "$as_me:16745: checking if you want to use valgrind for testing" >&5
16746 echo $ECHO_N "checking if you want to use valgrind for testing... $ECHO_C" >&6
16747
16748 # Check whether --with-valgrind or --without-valgrind was given.
16749 if test "${with_valgrind+set}" = set; then
16750   withval="$with_valgrind"
16751
16752 cat >>confdefs.h <<EOF
16753 #define USE_VALGRIND 1
16754 EOF
16755
16756         : ${with_cflags:=-g}
16757         : ${with_no_leaks:=yes}
16758          with_valgrind=yes
16759 else
16760   with_valgrind=
16761 fi;
16762 echo "$as_me:16762: result: ${with_valgrind:-no}" >&5
16763 echo "${ECHO_T}${with_valgrind:-no}" >&6
16764
16765 case .$with_cflags in
16766 (.*-g*)
16767         case .$CFLAGS in
16768         (.*-g*)
16769                 ;;
16770         (*)
16771
16772 cf_fix_cppflags=no
16773 cf_new_cflags=
16774 cf_new_cppflags=
16775 cf_new_extra_cppflags=
16776
16777 for cf_add_cflags in -g
16778 do
16779 case $cf_fix_cppflags in
16780 (no)
16781         case $cf_add_cflags in
16782         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
16783                 case $cf_add_cflags in
16784                 (-D*)
16785                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
16786
16787                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16788                                 && test -z "${cf_tst_cflags}" \
16789                                 && cf_fix_cppflags=yes
16790
16791                         if test $cf_fix_cppflags = yes ; then
16792                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
16793                                 continue
16794                         elif test "${cf_tst_cflags}" = "\"'" ; then
16795                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
16796                                 continue
16797                         fi
16798                         ;;
16799                 esac
16800                 case "$CPPFLAGS" in
16801                 (*$cf_add_cflags)
16802                         ;;
16803                 (*)
16804                         case $cf_add_cflags in
16805                         (-D*)
16806                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
16807
16808 CPPFLAGS=`echo "$CPPFLAGS" | \
16809         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
16810                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
16811
16812                                 ;;
16813                         esac
16814                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
16815                         ;;
16816                 esac
16817                 ;;
16818         (*)
16819                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
16820                 ;;
16821         esac
16822         ;;
16823 (yes)
16824         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
16825
16826         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
16827
16828         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16829                 && test -z "${cf_tst_cflags}" \
16830                 && cf_fix_cppflags=no
16831         ;;
16832 esac
16833 done
16834
16835 if test -n "$cf_new_cflags" ; then
16836
16837         CFLAGS="$CFLAGS $cf_new_cflags"
16838 fi
16839
16840 if test -n "$cf_new_cppflags" ; then
16841
16842         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
16843 fi
16844
16845 if test -n "$cf_new_extra_cppflags" ; then
16846
16847         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
16848 fi
16849
16850                 ;;
16851         esac
16852         ;;
16853 esac
16854
16855 echo "$as_me:16855: checking if you want to perform memory-leak testing" >&5
16856 echo $ECHO_N "checking if you want to perform memory-leak testing... $ECHO_C" >&6
16857
16858 # Check whether --enable-leaks or --disable-leaks was given.
16859 if test "${enable_leaks+set}" = set; then
16860   enableval="$enable_leaks"
16861   if test "x$enableval" = xno; then with_no_leaks=yes; else with_no_leaks=no; fi
16862 else
16863   : ${with_no_leaks:=no}
16864 fi;
16865 echo "$as_me:16865: result: $with_no_leaks" >&5
16866 echo "${ECHO_T}$with_no_leaks" >&6
16867
16868 if test "$with_no_leaks" = yes ; then
16869
16870 cat >>confdefs.h <<\EOF
16871 #define NO_LEAKS 1
16872 EOF
16873
16874 cat >>confdefs.h <<\EOF
16875 #define YY_NO_LEAKS 1
16876 EOF
16877
16878 fi
16879
16880 LD_RPATH_OPT=
16881 echo "$as_me:16881: checking for an rpath option" >&5
16882 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
16883 case $cf_cv_system_name in
16884 (irix*)
16885         if test "$GCC" = yes; then
16886                 LD_RPATH_OPT="-Wl,-rpath,"
16887         else
16888                 LD_RPATH_OPT="-rpath "
16889         fi
16890         ;;
16891 (linux*|gnu*|k*bsd*-gnu)
16892         LD_RPATH_OPT="-Wl,-rpath,"
16893         ;;
16894 (openbsd[2-9].*|mirbsd*)
16895         LD_RPATH_OPT="-Wl,-rpath,"
16896         ;;
16897 (dragonfly*|freebsd*)
16898         LD_RPATH_OPT="-rpath "
16899         ;;
16900 (netbsd*)
16901         LD_RPATH_OPT="-Wl,-rpath,"
16902         ;;
16903 (osf*|mls+*)
16904         LD_RPATH_OPT="-rpath "
16905         ;;
16906 (solaris2*)
16907         LD_RPATH_OPT="-R"
16908         ;;
16909 (*)
16910         ;;
16911 esac
16912 echo "$as_me:16912: result: $LD_RPATH_OPT" >&5
16913 echo "${ECHO_T}$LD_RPATH_OPT" >&6
16914
16915 case "x$LD_RPATH_OPT" in
16916 (x-R*)
16917         echo "$as_me:16917: checking if we need a space after rpath option" >&5
16918 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
16919         cf_save_LIBS="$LIBS"
16920
16921 cf_add_libs="${LD_RPATH_OPT}$libdir"
16922 # Filter out duplicates - this happens with badly-designed ".pc" files...
16923 for cf_add_1lib in $LIBS
16924 do
16925         for cf_add_2lib in $cf_add_libs
16926         do
16927                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
16928                 then
16929                         cf_add_1lib=
16930                         break
16931                 fi
16932         done
16933         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
16934 done
16935 LIBS="$cf_add_libs"
16936
16937         cat >conftest.$ac_ext <<_ACEOF
16938 #line 16938 "configure"
16939 #include "confdefs.h"
16940
16941 int
16942 main ()
16943 {
16944
16945   ;
16946   return 0;
16947 }
16948 _ACEOF
16949 rm -f conftest.$ac_objext conftest$ac_exeext
16950 if { (eval echo "$as_me:16950: \"$ac_link\"") >&5
16951   (eval $ac_link) 2>&5
16952   ac_status=$?
16953   echo "$as_me:16953: \$? = $ac_status" >&5
16954   (exit $ac_status); } &&
16955          { ac_try='test -s conftest$ac_exeext'
16956   { (eval echo "$as_me:16956: \"$ac_try\"") >&5
16957   (eval $ac_try) 2>&5
16958   ac_status=$?
16959   echo "$as_me:16959: \$? = $ac_status" >&5
16960   (exit $ac_status); }; }; then
16961   cf_rpath_space=no
16962 else
16963   echo "$as_me: failed program was:" >&5
16964 cat conftest.$ac_ext >&5
16965 cf_rpath_space=yes
16966 fi
16967 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16968         LIBS="$cf_save_LIBS"
16969         echo "$as_me:16969: result: $cf_rpath_space" >&5
16970 echo "${ECHO_T}$cf_rpath_space" >&6
16971         test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
16972         ;;
16973 esac
16974
16975 echo "$as_me:16975: checking if rpath-hack should be disabled" >&5
16976 echo $ECHO_N "checking if rpath-hack should be disabled... $ECHO_C" >&6
16977
16978 # Check whether --enable-rpath-hack or --disable-rpath-hack was given.
16979 if test "${enable_rpath_hack+set}" = set; then
16980   enableval="$enable_rpath_hack"
16981   test "$enableval" != no && enableval=yes
16982   if test "$enableval" != "yes" ; then
16983     cf_disable_rpath_hack=yes
16984   else
16985     cf_disable_rpath_hack=no
16986   fi
16987 else
16988   enableval=yes
16989   cf_disable_rpath_hack=no
16990
16991 fi;
16992 echo "$as_me:16992: result: $cf_disable_rpath_hack" >&5
16993 echo "${ECHO_T}$cf_disable_rpath_hack" >&6
16994 if test "$cf_disable_rpath_hack" = no ; then
16995
16996 echo "$as_me:16996: checking for updated LDFLAGS" >&5
16997 echo $ECHO_N "checking for updated LDFLAGS... $ECHO_C" >&6
16998 if test -n "$LD_RPATH_OPT" ; then
16999         echo "$as_me:16999: result: maybe" >&5
17000 echo "${ECHO_T}maybe" >&6
17001
17002         for ac_prog in ldd
17003 do
17004   # Extract the first word of "$ac_prog", so it can be a program name with args.
17005 set dummy $ac_prog; ac_word=$2
17006 echo "$as_me:17006: checking for $ac_word" >&5
17007 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
17008 if test "${ac_cv_prog_cf_ldd_prog+set}" = set; then
17009   echo $ECHO_N "(cached) $ECHO_C" >&6
17010 else
17011   if test -n "$cf_ldd_prog"; then
17012   ac_cv_prog_cf_ldd_prog="$cf_ldd_prog" # Let the user override the test.
17013 else
17014   ac_save_IFS=$IFS; IFS=$ac_path_separator
17015 ac_dummy="$PATH"
17016 for ac_dir in $ac_dummy; do
17017   IFS=$ac_save_IFS
17018   test -z "$ac_dir" && ac_dir=.
17019   $as_executable_p "$ac_dir/$ac_word" || continue
17020 ac_cv_prog_cf_ldd_prog="$ac_prog"
17021 echo "$as_me:17021: found $ac_dir/$ac_word" >&5
17022 break
17023 done
17024
17025 fi
17026 fi
17027 cf_ldd_prog=$ac_cv_prog_cf_ldd_prog
17028 if test -n "$cf_ldd_prog"; then
17029   echo "$as_me:17029: result: $cf_ldd_prog" >&5
17030 echo "${ECHO_T}$cf_ldd_prog" >&6
17031 else
17032   echo "$as_me:17032: result: no" >&5
17033 echo "${ECHO_T}no" >&6
17034 fi
17035
17036   test -n "$cf_ldd_prog" && break
17037 done
17038 test -n "$cf_ldd_prog" || cf_ldd_prog="no"
17039
17040         cf_rpath_list="/usr/lib /lib"
17041         if test "$cf_ldd_prog" != no
17042         then
17043                 cf_rpath_oops=
17044
17045 cat >conftest.$ac_ext <<_ACEOF
17046 #line 17046 "configure"
17047 #include "confdefs.h"
17048 #include <stdio.h>
17049 int
17050 main ()
17051 {
17052 printf("Hello");
17053   ;
17054   return 0;
17055 }
17056 _ACEOF
17057 rm -f conftest.$ac_objext conftest$ac_exeext
17058 if { (eval echo "$as_me:17058: \"$ac_link\"") >&5
17059   (eval $ac_link) 2>&5
17060   ac_status=$?
17061   echo "$as_me:17061: \$? = $ac_status" >&5
17062   (exit $ac_status); } &&
17063          { ac_try='test -s conftest$ac_exeext'
17064   { (eval echo "$as_me:17064: \"$ac_try\"") >&5
17065   (eval $ac_try) 2>&5
17066   ac_status=$?
17067   echo "$as_me:17067: \$? = $ac_status" >&5
17068   (exit $ac_status); }; }; then
17069   cf_rpath_oops=`$cf_ldd_prog conftest$ac_exeext | fgrep ' not found' | sed -e 's% =>.*$%%' |sort | uniq`
17070                  cf_rpath_list=`$cf_ldd_prog conftest$ac_exeext | fgrep / | sed -e 's%^.*[      ]/%/%' -e 's%/[^/][^/]*$%%' |sort | uniq`
17071 else
17072   echo "$as_me: failed program was:" >&5
17073 cat conftest.$ac_ext >&5
17074 fi
17075 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17076
17077                 # If we passed the link-test, but get a "not found" on a given library,
17078                 # this could be due to inept reconfiguration of gcc to make it only
17079                 # partly honor /usr/local/lib (or whatever).  Sometimes this behavior
17080                 # is intentional, e.g., installing gcc in /usr/bin and suppressing the
17081                 # /usr/local libraries.
17082                 if test -n "$cf_rpath_oops"
17083                 then
17084                         for cf_rpath_src in $cf_rpath_oops
17085                         do
17086                                 for cf_rpath_dir in \
17087                                         /usr/local \
17088                                         /usr/pkg \
17089                                         /opt/sfw
17090                                 do
17091                                         if test -f $cf_rpath_dir/lib/$cf_rpath_src
17092                                         then
17093                                                 test -n "$verbose" && echo "    ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src" 1>&6
17094
17095 echo "${as_me:-configure}:17095: testing ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src ..." 1>&5
17096
17097                                                 LDFLAGS="$LDFLAGS -L$cf_rpath_dir/lib"
17098                                                 break
17099                                         fi
17100                                 done
17101                         done
17102                 fi
17103         fi
17104
17105         test -n "$verbose" && echo "    ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
17106
17107 echo "${as_me:-configure}:17107: testing ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
17108
17109 test -n "$verbose" && echo "    ...checking LDFLAGS $LDFLAGS" 1>&6
17110
17111 echo "${as_me:-configure}:17111: testing ...checking LDFLAGS $LDFLAGS ..." 1>&5
17112
17113 cf_rpath_dst=
17114 for cf_rpath_src in $LDFLAGS
17115 do
17116         case $cf_rpath_src in
17117         (-L*)
17118
17119                 # check if this refers to a directory which we will ignore
17120                 cf_rpath_skip=no
17121                 if test -n "$cf_rpath_list"
17122                 then
17123                         for cf_rpath_item in $cf_rpath_list
17124                         do
17125                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
17126                                 then
17127                                         cf_rpath_skip=yes
17128                                         break
17129                                 fi
17130                         done
17131                 fi
17132
17133                 if test "$cf_rpath_skip" = no
17134                 then
17135                         # transform the option
17136                         if test "$LD_RPATH_OPT" = "-R " ; then
17137                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
17138                         else
17139                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
17140                         fi
17141
17142                         # if we have not already added this, add it now
17143                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
17144                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
17145                         then
17146                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
17147
17148 echo "${as_me:-configure}:17148: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
17149
17150                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
17151                         fi
17152                 fi
17153                 ;;
17154         esac
17155         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
17156 done
17157 LDFLAGS=$cf_rpath_dst
17158
17159 test -n "$verbose" && echo "    ...checked LDFLAGS $LDFLAGS" 1>&6
17160
17161 echo "${as_me:-configure}:17161: testing ...checked LDFLAGS $LDFLAGS ..." 1>&5
17162
17163 test -n "$verbose" && echo "    ...checking LIBS $LIBS" 1>&6
17164
17165 echo "${as_me:-configure}:17165: testing ...checking LIBS $LIBS ..." 1>&5
17166
17167 cf_rpath_dst=
17168 for cf_rpath_src in $LIBS
17169 do
17170         case $cf_rpath_src in
17171         (-L*)
17172
17173                 # check if this refers to a directory which we will ignore
17174                 cf_rpath_skip=no
17175                 if test -n "$cf_rpath_list"
17176                 then
17177                         for cf_rpath_item in $cf_rpath_list
17178                         do
17179                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
17180                                 then
17181                                         cf_rpath_skip=yes
17182                                         break
17183                                 fi
17184                         done
17185                 fi
17186
17187                 if test "$cf_rpath_skip" = no
17188                 then
17189                         # transform the option
17190                         if test "$LD_RPATH_OPT" = "-R " ; then
17191                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
17192                         else
17193                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
17194                         fi
17195
17196                         # if we have not already added this, add it now
17197                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
17198                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
17199                         then
17200                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
17201
17202 echo "${as_me:-configure}:17202: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
17203
17204                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
17205                         fi
17206                 fi
17207                 ;;
17208         esac
17209         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
17210 done
17211 LIBS=$cf_rpath_dst
17212
17213 test -n "$verbose" && echo "    ...checked LIBS $LIBS" 1>&6
17214
17215 echo "${as_me:-configure}:17215: testing ...checked LIBS $LIBS ..." 1>&5
17216
17217         test -n "$verbose" && echo "    ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
17218
17219 echo "${as_me:-configure}:17219: testing ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
17220
17221 else
17222         echo "$as_me:17222: result: no" >&5
17223 echo "${ECHO_T}no" >&6
17224 fi
17225
17226 fi
17227
17228 TEST_ARGS="$LIBS"
17229 LIBS=
17230
17231 ac_config_files="$ac_config_files Makefile"
17232 ac_config_commands="$ac_config_commands default"
17233 cat >confcache <<\_ACEOF
17234 # This file is a shell script that caches the results of configure
17235 # tests run on this system so they can be shared between configure
17236 # scripts and configure runs, see configure's option --config-cache.
17237 # It is not useful on other systems.  If it contains results you don't
17238 # want to keep, you may remove or edit it.
17239 #
17240 # config.status only pays attention to the cache file if you give it
17241 # the --recheck option to rerun configure.
17242 #
17243 # `ac_cv_env_foo' variables (set or unset) will be overriden when
17244 # loading this file, other *unset* `ac_cv_foo' will be assigned the
17245 # following values.
17246
17247 _ACEOF
17248
17249 # The following way of writing the cache mishandles newlines in values,
17250 # but we know of no workaround that is simple, portable, and efficient.
17251 # So, don't put newlines in cache variables' values.
17252 # Ultrix sh set writes to stderr and can't be redirected directly,
17253 # and sets the high bit in the cache file unless we assign to the vars.
17254 {
17255   (set) 2>&1 |
17256     case `(ac_space=' '; set | grep ac_space) 2>&1` in
17257     *ac_space=\ *)
17258       # `set' does not quote correctly, so add quotes (double-quote
17259       # substitution turns \\\\ into \\, and sed turns \\ into \).
17260       sed -n \
17261         "s/'/'\\\\''/g;
17262           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
17263       ;;
17264     *)
17265       # `set' quotes correctly as required by POSIX, so do not add quotes.
17266       sed -n \
17267         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
17268       ;;
17269     esac;
17270 } |
17271   sed '
17272      t clear
17273      : clear
17274      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
17275      t end
17276      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
17277      : end' >>confcache
17278 if cmp -s $cache_file confcache; then :; else
17279   if test -w $cache_file; then
17280     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
17281     cat confcache >$cache_file
17282   else
17283     echo "not updating unwritable cache $cache_file"
17284   fi
17285 fi
17286 rm -f confcache
17287
17288 test "x$prefix" = xNONE && prefix=$ac_default_prefix
17289 # Let make expand exec_prefix.
17290 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
17291
17292 # VPATH may cause trouble with some makes, so we remove $(srcdir),
17293 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
17294 # trailing colons and then remove the whole line if VPATH becomes empty
17295 # (actually we leave an empty line to preserve line numbers).
17296 if test "x$srcdir" = x.; then
17297   ac_vpsub='/^[         ]*VPATH[        ]*=/{
17298 s/:*\$(srcdir):*/:/;
17299 s/:*\${srcdir}:*/:/;
17300 s/:*@srcdir@:*/:/;
17301 s/^\([^=]*=[    ]*\):*/\1/;
17302 s/:*$//;
17303 s/^[^=]*=[      ]*$//;
17304 }'
17305 fi
17306
17307 DEFS=-DHAVE_CONFIG_H
17308
17309 : ${CONFIG_STATUS=./config.status}
17310 ac_clean_files_save=$ac_clean_files
17311 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
17312 { echo "$as_me:17312: creating $CONFIG_STATUS" >&5
17313 echo "$as_me: creating $CONFIG_STATUS" >&6;}
17314 cat >$CONFIG_STATUS <<_ACEOF
17315 #! $SHELL
17316 # Generated automatically by configure.
17317 # Run this file to recreate the current configuration.
17318 # Compiler output produced by configure, useful for debugging
17319 # configure, is in config.log if it exists.
17320
17321 debug=false
17322 SHELL=\${CONFIG_SHELL-$SHELL}
17323 ac_cs_invocation="\$0 \$@"
17324
17325 _ACEOF
17326
17327 cat >>$CONFIG_STATUS <<\_ACEOF
17328 # Be Bourne compatible
17329 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
17330   emulate sh
17331   NULLCMD=:
17332 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
17333   set -o posix
17334 fi
17335
17336 # Name of the executable.
17337 as_me=`echo "$0" |sed 's,.*[\\/],,'`
17338
17339 if expr a : '\(a\)' >/dev/null 2>&1; then
17340   as_expr=expr
17341 else
17342   as_expr=false
17343 fi
17344
17345 rm -f conf$$ conf$$.exe conf$$.file
17346 echo >conf$$.file
17347 if ln -s conf$$.file conf$$ 2>/dev/null; then
17348   # We could just check for DJGPP; but this test a) works b) is more generic
17349   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
17350   if test -f conf$$.exe; then
17351     # Don't use ln at all; we don't have any links
17352     as_ln_s='cp -p'
17353   else
17354     as_ln_s='ln -s'
17355   fi
17356 elif ln conf$$.file conf$$ 2>/dev/null; then
17357   as_ln_s=ln
17358 else
17359   as_ln_s='cp -p'
17360 fi
17361 rm -f conf$$ conf$$.exe conf$$.file
17362
17363 as_executable_p="test -f"
17364
17365 # Support unset when possible.
17366 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
17367   as_unset=unset
17368 else
17369   as_unset=false
17370 fi
17371
17372 # NLS nuisances.
17373 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
17374 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
17375 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
17376 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
17377 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
17378 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
17379 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
17380 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
17381
17382 # IFS
17383 # We need space, tab and new line, in precisely that order.
17384 as_nl='
17385 '
17386 IFS="   $as_nl"
17387
17388 # CDPATH.
17389 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
17390
17391 exec 6>&1
17392
17393 _ACEOF
17394
17395 # Files that config.status was made for.
17396 if test -n "$ac_config_files"; then
17397   echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
17398 fi
17399
17400 if test -n "$ac_config_headers"; then
17401   echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
17402 fi
17403
17404 if test -n "$ac_config_links"; then
17405   echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
17406 fi
17407
17408 if test -n "$ac_config_commands"; then
17409   echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
17410 fi
17411
17412 cat >>$CONFIG_STATUS <<\EOF
17413
17414 ac_cs_usage="\
17415 \`$as_me' instantiates files from templates according to the
17416 current configuration.
17417
17418 Usage: $0 [OPTIONS] [FILE]...
17419
17420   -h, --help       print this help, then exit
17421   -V, --version    print version number, then exit
17422   -d, --debug      don't remove temporary files
17423       --recheck    update $as_me by reconfiguring in the same conditions
17424   --file=FILE[:TEMPLATE]
17425                    instantiate the configuration file FILE
17426   --header=FILE[:TEMPLATE]
17427                    instantiate the configuration header FILE
17428
17429 Configuration files:
17430 $config_files
17431
17432 Configuration headers:
17433 $config_headers
17434
17435 Configuration commands:
17436 $config_commands
17437
17438 Report bugs to <dickey@invisible-island.net>."
17439 EOF
17440
17441 cat >>$CONFIG_STATUS <<EOF
17442 ac_cs_version="\\
17443 config.status
17444 configured by $0, generated by GNU Autoconf 2.52.20141204,
17445   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
17446
17447 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
17448 Free Software Foundation, Inc.
17449 This config.status script is free software; the Free Software Foundation
17450 gives unlimited permission to copy, distribute and modify it."
17451 srcdir=$srcdir
17452 INSTALL="$INSTALL"
17453 EOF
17454
17455 cat >>$CONFIG_STATUS <<\EOF
17456 # If no file are specified by the user, then we need to provide default
17457 # value.  By we need to know if files were specified by the user.
17458 ac_need_defaults=:
17459 while test $# != 0
17460 do
17461   case $1 in
17462   --*=*)
17463     ac_option=`expr "x$1" : 'x\([^=]*\)='`
17464     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
17465     shift
17466     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
17467     shift
17468     ;;
17469   -*);;
17470   *) # This is not an option, so the user has probably given explicit
17471      # arguments.
17472      ac_need_defaults=false;;
17473   esac
17474
17475   case $1 in
17476   # Handling of the options.
17477 EOF
17478 cat >>$CONFIG_STATUS <<EOF
17479   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
17480     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
17481     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
17482 EOF
17483 cat >>$CONFIG_STATUS <<\EOF
17484   --version | --vers* | -V )
17485     echo "$ac_cs_version"; exit 0 ;;
17486   --he | --h)
17487     # Conflict between --help and --header
17488     { { echo "$as_me:17488: error: ambiguous option: $1
17489 Try \`$0 --help' for more information." >&5
17490 echo "$as_me: error: ambiguous option: $1
17491 Try \`$0 --help' for more information." >&2;}
17492    { (exit 1); exit 1; }; };;
17493   --help | --hel | -h )
17494     echo "$ac_cs_usage"; exit 0 ;;
17495   --debug | --d* | -d )
17496     debug=: ;;
17497   --file | --fil | --fi | --f )
17498     shift
17499     CONFIG_FILES="$CONFIG_FILES $1"
17500     ac_need_defaults=false;;
17501   --header | --heade | --head | --hea )
17502     shift
17503     CONFIG_HEADERS="$CONFIG_HEADERS $1"
17504     ac_need_defaults=false;;
17505
17506   # This is an error.
17507   -*) { { echo "$as_me:17507: error: unrecognized option: $1
17508 Try \`$0 --help' for more information." >&5
17509 echo "$as_me: error: unrecognized option: $1
17510 Try \`$0 --help' for more information." >&2;}
17511    { (exit 1); exit 1; }; } ;;
17512
17513   *) ac_config_targets="$ac_config_targets $1" ;;
17514
17515   esac
17516   shift
17517 done
17518
17519 exec 5>>config.log
17520 cat >&5 << _ACEOF
17521
17522 ## ----------------------- ##
17523 ## Running config.status.  ##
17524 ## ----------------------- ##
17525
17526 This file was extended by $as_me 2.52.20141204, executed with
17527   CONFIG_FILES    = $CONFIG_FILES
17528   CONFIG_HEADERS  = $CONFIG_HEADERS
17529   CONFIG_LINKS    = $CONFIG_LINKS
17530   CONFIG_COMMANDS = $CONFIG_COMMANDS
17531   > $ac_cs_invocation
17532 on `(hostname || uname -n) 2>/dev/null | sed 1q`
17533
17534 _ACEOF
17535 EOF
17536
17537 cat >>$CONFIG_STATUS <<EOF
17538 #
17539 # INIT-COMMANDS section.
17540 #
17541
17542 AWK="$AWK"
17543 ECHO_CC="$ECHO_CC"
17544 ECHO_LD="$ECHO_LD"
17545 SHOW_CC="$SHOW_LD"
17546
17547 EOF
17548
17549 cat >>$CONFIG_STATUS <<\EOF
17550 for ac_config_target in $ac_config_targets
17551 do
17552   case "$ac_config_target" in
17553   # Handling of arguments.
17554   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
17555   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
17556   "ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS ncurses_cfg.h:ncurses_tst.hin" ;;
17557   *) { { echo "$as_me:17557: error: invalid argument: $ac_config_target" >&5
17558 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
17559    { (exit 1); exit 1; }; };;
17560   esac
17561 done
17562
17563 # If the user did not use the arguments to specify the items to instantiate,
17564 # then the envvar interface is used.  Set only those that are not.
17565 # We use the long form for the default assignment because of an extremely
17566 # bizarre bug on SunOS 4.1.3.
17567 if $ac_need_defaults; then
17568   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
17569   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
17570   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
17571 fi
17572
17573 # Create a temporary directory, and hook for its removal unless debugging.
17574 $debug ||
17575 {
17576   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
17577   trap '{ (exit 1); exit 1; }' 1 2 13 15
17578 }
17579
17580 # Create a (secure) tmp directory for tmp files.
17581 : ${TMPDIR=/tmp}
17582 {
17583   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
17584   test -n "$tmp" && test -d "$tmp"
17585 }  ||
17586 {
17587   tmp=$TMPDIR/cs$$-$RANDOM
17588   (umask 077 && mkdir $tmp)
17589 } ||
17590 {
17591    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
17592    { (exit 1); exit 1; }
17593 }
17594
17595 EOF
17596
17597 cat >>$CONFIG_STATUS <<EOF
17598
17599 #
17600 # CONFIG_FILES section.
17601 #
17602
17603 # No need to generate the scripts if there are no CONFIG_FILES.
17604 # This happens for instance when ./config.status config.h
17605 if test -n "\$CONFIG_FILES"; then
17606   # Protect against being on the right side of a sed subst in config.status.
17607   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
17608    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
17609 s,@SHELL@,$SHELL,;t t
17610 s,@exec_prefix@,$exec_prefix,;t t
17611 s,@prefix@,$prefix,;t t
17612 s,@program_transform_name@,$program_transform_name,;t t
17613 s,@bindir@,$bindir,;t t
17614 s,@sbindir@,$sbindir,;t t
17615 s,@libexecdir@,$libexecdir,;t t
17616 s,@datarootdir@,$datarootdir,;t t
17617 s,@datadir@,$datadir,;t t
17618 s,@sysconfdir@,$sysconfdir,;t t
17619 s,@sharedstatedir@,$sharedstatedir,;t t
17620 s,@localstatedir@,$localstatedir,;t t
17621 s,@libdir@,$libdir,;t t
17622 s,@includedir@,$includedir,;t t
17623 s,@oldincludedir@,$oldincludedir,;t t
17624 s,@infodir@,$infodir,;t t
17625 s,@mandir@,$mandir,;t t
17626 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
17627 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
17628 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
17629 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
17630 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
17631 s,@build_alias@,$build_alias,;t t
17632 s,@host_alias@,$host_alias,;t t
17633 s,@target_alias@,$target_alias,;t t
17634 s,@ECHO_C@,$ECHO_C,;t t
17635 s,@ECHO_N@,$ECHO_N,;t t
17636 s,@ECHO_T@,$ECHO_T,;t t
17637 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
17638 s,@DEFS@,$DEFS,;t t
17639 s,@LIBS@,$LIBS,;t t
17640 s,@build@,$build,;t t
17641 s,@build_cpu@,$build_cpu,;t t
17642 s,@build_vendor@,$build_vendor,;t t
17643 s,@build_os@,$build_os,;t t
17644 s,@host@,$host,;t t
17645 s,@host_cpu@,$host_cpu,;t t
17646 s,@host_vendor@,$host_vendor,;t t
17647 s,@host_os@,$host_os,;t t
17648 s,@SET_MAKE@,$SET_MAKE,;t t
17649 s,@CC@,$CC,;t t
17650 s,@CFLAGS@,$CFLAGS,;t t
17651 s,@LDFLAGS@,$LDFLAGS,;t t
17652 s,@CPPFLAGS@,$CPPFLAGS,;t t
17653 s,@ac_ct_CC@,$ac_ct_CC,;t t
17654 s,@EXEEXT@,$EXEEXT,;t t
17655 s,@OBJEXT@,$OBJEXT,;t t
17656 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
17657 s,@CPP@,$CPP,;t t
17658 s,@AWK@,$AWK,;t t
17659 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
17660 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
17661 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
17662 s,@LINT@,$LINT,;t t
17663 s,@LINT_OPTS@,$LINT_OPTS,;t t
17664 s,@CTAGS@,$CTAGS,;t t
17665 s,@ETAGS@,$ETAGS,;t t
17666 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
17667 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
17668 s,@MATH_LIB@,$MATH_LIB,;t t
17669 s,@top_builddir@,$top_builddir,;t t
17670 s,@CC_G_OPT@,$CC_G_OPT,;t t
17671 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
17672 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
17673 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
17674 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
17675 s,@LD@,$LD,;t t
17676 s,@LDFLAGS_SHARED@,$LDFLAGS_SHARED,;t t
17677 s,@LDFLAGS_STATIC@,$LDFLAGS_STATIC,;t t
17678 s,@LD_MODEL@,$LD_MODEL,;t t
17679 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
17680 s,@LIBTOOL@,$LIBTOOL,;t t
17681 s,@LIBTOOL_OPTS@,$LIBTOOL_OPTS,;t t
17682 s,@LIB_CLEAN@,$LIB_CLEAN,;t t
17683 s,@LIB_COMPILE@,$LIB_COMPILE,;t t
17684 s,@LIB_LINK@,$LIB_LINK,;t t
17685 s,@LINK_TESTS@,$LINK_TESTS,;t t
17686 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
17687 s,@PACKAGE@,$PACKAGE,;t t
17688 s,@PTHREAD@,$PTHREAD,;t t
17689 s,@TEST_ARGS@,$TEST_ARGS,;t t
17690 s,@TEST_DEPS@,$TEST_DEPS,;t t
17691 s,@TEST_LIBS@,$TEST_LIBS,;t t
17692 s,@TINFO_LDFLAGS@,$TINFO_LDFLAGS,;t t
17693 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
17694 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
17695 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
17696 s,@includesubdir@,$includesubdir,;t t
17697 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
17698 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
17699 s,@ECHO_LT@,$ECHO_LT,;t t
17700 s,@ECHO_LD@,$ECHO_LD,;t t
17701 s,@RULE_CC@,$RULE_CC,;t t
17702 s,@SHOW_CC@,$SHOW_CC,;t t
17703 s,@ECHO_CC@,$ECHO_CC,;t t
17704 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
17705 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
17706 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
17707 s,@X_CFLAGS@,$X_CFLAGS,;t t
17708 s,@X_PRE_LIBS@,$X_PRE_LIBS,;t t
17709 s,@X_LIBS@,$X_LIBS,;t t
17710 s,@X_EXTRA_LIBS@,$X_EXTRA_LIBS,;t t
17711 s,@XCURSES_CONFIG@,$XCURSES_CONFIG,;t t
17712 s,@ac_ct_XCURSES_CONFIG@,$ac_ct_XCURSES_CONFIG,;t t
17713 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
17714 s,@cf_ldd_prog@,$cf_ldd_prog,;t t
17715 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
17716 CEOF
17717
17718 EOF
17719
17720   cat >>$CONFIG_STATUS <<\EOF
17721   # Split the substitutions into bite-sized pieces for seds with
17722   # small command number limits, like on Digital OSF/1 and HP-UX.
17723   ac_max_sed_lines=48
17724   ac_sed_frag=1 # Number of current file.
17725   ac_beg=1 # First line for current file.
17726   ac_end=$ac_max_sed_lines # Line after last line for current file.
17727   ac_more_lines=:
17728   ac_sed_cmds=
17729   while $ac_more_lines; do
17730     if test $ac_beg -gt 1; then
17731       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
17732     else
17733       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
17734     fi
17735     if test ! -s $tmp/subs.frag; then
17736       ac_more_lines=false
17737     else
17738       # The purpose of the label and of the branching condition is to
17739       # speed up the sed processing (if there are no `@' at all, there
17740       # is no need to browse any of the substitutions).
17741       # These are the two extra sed commands mentioned above.
17742       (echo ':t
17743   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
17744       if test -z "$ac_sed_cmds"; then
17745         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
17746       else
17747         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
17748       fi
17749       ac_sed_frag=`expr $ac_sed_frag + 1`
17750       ac_beg=$ac_end
17751       ac_end=`expr $ac_end + $ac_max_sed_lines`
17752     fi
17753   done
17754   if test -z "$ac_sed_cmds"; then
17755     ac_sed_cmds=cat
17756   fi
17757 fi # test -n "$CONFIG_FILES"
17758
17759 EOF
17760 cat >>$CONFIG_STATUS <<\EOF
17761 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
17762   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
17763   case $ac_file in
17764   - | *:- | *:-:* ) # input from stdin
17765         cat >$tmp/stdin
17766         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
17767         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
17768   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
17769         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
17770   * )   ac_file_in=$ac_file.in ;;
17771   esac
17772
17773   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
17774   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
17775          X"$ac_file" : 'X\(//\)[^/]' \| \
17776          X"$ac_file" : 'X\(//\)$' \| \
17777          X"$ac_file" : 'X\(/\)' \| \
17778          .     : '\(.\)' 2>/dev/null ||
17779 echo X"$ac_file" |
17780     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
17781           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
17782           /^X\(\/\/\)$/{ s//\1/; q; }
17783           /^X\(\/\).*/{ s//\1/; q; }
17784           s/.*/./; q'`
17785   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
17786     { case "$ac_dir" in
17787   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
17788   *)                      as_incr_dir=.;;
17789 esac
17790 as_dummy="$ac_dir"
17791 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
17792   case $as_mkdir_dir in
17793     # Skip DOS drivespec
17794     ?:) as_incr_dir=$as_mkdir_dir ;;
17795     *)
17796       as_incr_dir=$as_incr_dir/$as_mkdir_dir
17797       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
17798     ;;
17799   esac
17800 done; }
17801
17802     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
17803     # A "../" for each directory in $ac_dir_suffix.
17804     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
17805   else
17806     ac_dir_suffix= ac_dots=
17807   fi
17808
17809   case $srcdir in
17810   .)  ac_srcdir=.
17811       if test -z "$ac_dots"; then
17812          ac_top_srcdir=.
17813       else
17814          ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'`
17815       fi ;;
17816   [\\/]* | ?:[\\/]* )
17817       ac_srcdir=$srcdir$ac_dir_suffix;
17818       ac_top_srcdir=$srcdir ;;
17819   *) # Relative path.
17820     ac_srcdir=$ac_dots$srcdir$ac_dir_suffix
17821     ac_top_srcdir=$ac_dots$srcdir ;;
17822   esac
17823
17824   case $INSTALL in
17825   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
17826   *) ac_INSTALL=$ac_dots$INSTALL ;;
17827   esac
17828
17829   if test x"$ac_file" != x-; then
17830     { echo "$as_me:17830: creating $ac_file" >&5
17831 echo "$as_me: creating $ac_file" >&6;}
17832     rm -f "$ac_file"
17833   fi
17834   # Let's still pretend it is `configure' which instantiates (i.e., don't
17835   # use $as_me), people would be surprised to read:
17836   #    /* config.h.  Generated automatically by config.status.  */
17837   configure_input="Generated automatically from `echo $ac_file_in |
17838                                                  sed 's,.*/,,'` by configure."
17839
17840   # First look for the input files in the build tree, otherwise in the
17841   # src tree.
17842   ac_file_inputs=`IFS=:
17843     for f in $ac_file_in; do
17844       case $f in
17845       -) echo $tmp/stdin ;;
17846       [\\/$]*)
17847          # Absolute (can't be DOS-style, as IFS=:)
17848          test -f "$f" || { { echo "$as_me:17848: error: cannot find input file: $f" >&5
17849 echo "$as_me: error: cannot find input file: $f" >&2;}
17850    { (exit 1); exit 1; }; }
17851          echo $f;;
17852       *) # Relative
17853          if test -f "$f"; then
17854            # Build tree
17855            echo $f
17856          elif test -f "$srcdir/$f"; then
17857            # Source tree
17858            echo $srcdir/$f
17859          else
17860            # /dev/null tree
17861            { { echo "$as_me:17861: error: cannot find input file: $f" >&5
17862 echo "$as_me: error: cannot find input file: $f" >&2;}
17863    { (exit 1); exit 1; }; }
17864          fi;;
17865       esac
17866     done` || { (exit 1); exit 1; }
17867 EOF
17868 cat >>$CONFIG_STATUS <<\EOF
17869   ac_warn_datarootdir=no
17870   if test x"$ac_file" != x-; then
17871     for ac_item in $ac_file_inputs
17872     do
17873       ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' $ac_item`
17874       if test -n "$ac_seen"; then
17875         ac_used=`grep '@datarootdir@' $ac_item`
17876         if test -z "$ac_used"; then
17877           { echo "$as_me:17877: WARNING: datarootdir was used implicitly but not set:
17878 $ac_seen" >&5
17879 echo "$as_me: WARNING: datarootdir was used implicitly but not set:
17880 $ac_seen" >&2;}
17881           ac_warn_datarootdir=yes
17882         fi
17883       fi
17884       ac_seen=`grep '${datarootdir}' $ac_item`
17885       if test -n "$ac_seen"; then
17886         { echo "$as_me:17886: WARNING: datarootdir was used explicitly but not set:
17887 $ac_seen" >&5
17888 echo "$as_me: WARNING: datarootdir was used explicitly but not set:
17889 $ac_seen" >&2;}
17890         ac_warn_datarootdir=yes
17891       fi
17892     done
17893   fi
17894
17895 if test "x$ac_warn_datarootdir" = xyes; then
17896   ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
17897 fi
17898
17899 EOF
17900 cat >>$CONFIG_STATUS <<EOF
17901   sed "$ac_vpsub
17902 $extrasub
17903 EOF
17904 cat >>$CONFIG_STATUS <<\EOF
17905 :t
17906 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
17907 s,@configure_input@,$configure_input,;t t
17908 s,@srcdir@,$ac_srcdir,;t t
17909 s,@top_srcdir@,$ac_top_srcdir,;t t
17910 s,@INSTALL@,$ac_INSTALL,;t t
17911 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
17912   rm -f $tmp/stdin
17913   if test x"$ac_file" != x-; then
17914     cp $tmp/out $ac_file
17915
17916     for ac_name in prefix exec_prefix datarootdir
17917     do
17918         ac_seen=`fgrep -n '${'$ac_name'[:=].*}' $ac_file`
17919         if test -n "$ac_seen"; then
17920             ac_init=`egrep '[   ]*'$ac_name'[   ]*=' $ac_file`
17921             if test -z "$ac_init"; then
17922               ac_seen=`echo "$ac_seen" |sed -e 's,^,'$ac_file':,'`
17923               { echo "$as_me:17923: WARNING: Variable $ac_name is used but was not set:
17924 $ac_seen" >&5
17925 echo "$as_me: WARNING: Variable $ac_name is used but was not set:
17926 $ac_seen" >&2;}
17927             fi
17928         fi
17929     done
17930     egrep -n '@[a-z_][a-z_0-9]+@' $ac_file >$tmp/out
17931     egrep -n '@[A-Z_][A-Z_0-9]+@' $ac_file >>$tmp/out
17932     if test -s $tmp/out; then
17933       ac_seen=`sed -e 's,^,'$ac_file':,' < $tmp/out`
17934       { echo "$as_me:17934: WARNING: Some variables may not be substituted:
17935 $ac_seen" >&5
17936 echo "$as_me: WARNING: Some variables may not be substituted:
17937 $ac_seen" >&2;}
17938     fi
17939   else
17940     cat $tmp/out
17941   fi
17942   rm -f $tmp/out
17943
17944 done
17945 EOF
17946 cat >>$CONFIG_STATUS <<\EOF
17947
17948 #
17949 # CONFIG_HEADER section.
17950 #
17951
17952 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
17953 # NAME is the cpp macro being defined and VALUE is the value it is being given.
17954 #
17955 # ac_d sets the value in "#define NAME VALUE" lines.
17956 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
17957 ac_dB='[        ].*$,\1#\2'
17958 ac_dC=' '
17959 ac_dD=',;t'
17960 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
17961 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
17962 ac_iB='\([      ]\),\1#\2define\3'
17963 ac_iC=' '
17964 ac_iD='\4,;t'
17965 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
17966 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
17967 ac_uB='$,\1#\2define\3'
17968 ac_uC=' '
17969 ac_uD=',;t'
17970
17971 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
17972   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
17973   case $ac_file in
17974   - | *:- | *:-:* ) # input from stdin
17975         cat >$tmp/stdin
17976         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
17977         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
17978   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
17979         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
17980   * )   ac_file_in=$ac_file.in ;;
17981   esac
17982
17983   test x"$ac_file" != x- && { echo "$as_me:17983: creating $ac_file" >&5
17984 echo "$as_me: creating $ac_file" >&6;}
17985
17986   # First look for the input files in the build tree, otherwise in the
17987   # src tree.
17988   ac_file_inputs=`IFS=:
17989     for f in $ac_file_in; do
17990       case $f in
17991       -) echo $tmp/stdin ;;
17992       [\\/$]*)
17993          # Absolute (can't be DOS-style, as IFS=:)
17994          test -f "$f" || { { echo "$as_me:17994: error: cannot find input file: $f" >&5
17995 echo "$as_me: error: cannot find input file: $f" >&2;}
17996    { (exit 1); exit 1; }; }
17997          echo $f;;
17998       *) # Relative
17999          if test -f "$f"; then
18000            # Build tree
18001            echo $f
18002          elif test -f "$srcdir/$f"; then
18003            # Source tree
18004            echo $srcdir/$f
18005          else
18006            # /dev/null tree
18007            { { echo "$as_me:18007: error: cannot find input file: $f" >&5
18008 echo "$as_me: error: cannot find input file: $f" >&2;}
18009    { (exit 1); exit 1; }; }
18010          fi;;
18011       esac
18012     done` || { (exit 1); exit 1; }
18013   # Remove the trailing spaces.
18014   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
18015
18016 EOF
18017
18018 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
18019 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
18020 # be either 'cat' or 'sort'.
18021 cat confdefs.h | uniq >conftest.vals
18022
18023 # Break up conftest.vals because some shells have a limit on
18024 # the size of here documents, and old seds have small limits too.
18025
18026 rm -f conftest.tail
18027 echo '  rm -f conftest.frag' >> $CONFIG_STATUS
18028 while grep . conftest.vals >/dev/null
18029 do
18030   # Write chunks of a limited-size here document to conftest.frag.
18031   echo '  cat >> conftest.frag <<CEOF' >> $CONFIG_STATUS
18032   sed ${ac_max_here_lines}q conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> $CONFIG_STATUS
18033   echo 'CEOF' >> $CONFIG_STATUS
18034   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
18035   rm -f conftest.vals
18036   mv conftest.tail conftest.vals
18037 done
18038 rm -f conftest.vals
18039
18040 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
18041 # marker @DEFS@.
18042 echo '  cat >> conftest.edit <<CEOF
18043 /@DEFS@/r conftest.frag
18044 /@DEFS@/d
18045 CEOF
18046 sed -f conftest.edit $tmp/in > $tmp/out
18047 rm -f $tmp/in
18048 mv $tmp/out $tmp/in
18049 rm -f conftest.edit conftest.frag
18050 ' >> $CONFIG_STATUS
18051
18052 cat >>$CONFIG_STATUS <<\EOF
18053   # Let's still pretend it is `configure' which instantiates (i.e., don't
18054   # use $as_me), people would be surprised to read:
18055   #    /* config.h.  Generated automatically by config.status.  */
18056   if test x"$ac_file" = x-; then
18057     echo "/* Generated automatically by configure.  */" >$tmp/config.h
18058   else
18059     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
18060   fi
18061   cat $tmp/in >>$tmp/config.h
18062   rm -f $tmp/in
18063   if test x"$ac_file" != x-; then
18064     if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
18065       { echo "$as_me:18065: $ac_file is unchanged" >&5
18066 echo "$as_me: $ac_file is unchanged" >&6;}
18067     else
18068       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
18069          X"$ac_file" : 'X\(//\)[^/]' \| \
18070          X"$ac_file" : 'X\(//\)$' \| \
18071          X"$ac_file" : 'X\(/\)' \| \
18072          .     : '\(.\)' 2>/dev/null ||
18073 echo X"$ac_file" |
18074     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
18075           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
18076           /^X\(\/\/\)$/{ s//\1/; q; }
18077           /^X\(\/\).*/{ s//\1/; q; }
18078           s/.*/./; q'`
18079       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
18080         { case "$ac_dir" in
18081   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
18082   *)                      as_incr_dir=.;;
18083 esac
18084 as_dummy="$ac_dir"
18085 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
18086   case $as_mkdir_dir in
18087     # Skip DOS drivespec
18088     ?:) as_incr_dir=$as_mkdir_dir ;;
18089     *)
18090       as_incr_dir=$as_incr_dir/$as_mkdir_dir
18091       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
18092     ;;
18093   esac
18094 done; }
18095
18096       fi
18097       rm -f $ac_file
18098       mv $tmp/config.h $ac_file
18099     fi
18100   else
18101     cat $tmp/config.h
18102     rm -f $tmp/config.h
18103   fi
18104 done
18105 EOF
18106 cat >>$CONFIG_STATUS <<\EOF
18107 #
18108 # CONFIG_COMMANDS section.
18109 #
18110 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
18111   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
18112   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
18113
18114   case $ac_dest in
18115     default )
18116
18117 for cf_dir in .
18118 do
18119         if test ! -d $srcdir/$cf_dir; then
18120                 continue
18121         elif test -f $srcdir/$cf_dir/programs; then
18122                 $AWK -f $srcdir/mk-test.awk INSTALL=yes ECHO_LINK="$ECHO_LD" $srcdir/$cf_dir/programs >>$cf_dir/Makefile
18123         fi
18124 done
18125
18126         cat >>Makefile <<TEST_EOF
18127
18128 # These rules are generated so we do not rely on suffix rules, which do not
18129 # work consistently for different make-programs (the '\$(MODEL)/' confuses
18130 # some, and the '\$x' confuses others).
18131 TEST_EOF
18132
18133 LIST=`sed -e 's/[       ].*//' -e '/^[#@]/d' $srcdir/modules`
18134 for N in $LIST
18135 do
18136         cat >>Makefile <<TEST_EOF
18137
18138 \$(MODEL)/$N.o : \$(srcdir)/$N.c \\
18139         \$(srcdir)/test.priv.h \\
18140         ncurses_cfg.h
18141         $SHOW_CC
18142         $ECHO_CC\$(CC) -c \$(CFLAGS_DEFAULT) \$(srcdir)/$N.c
18143 TEST_EOF
18144 done
18145
18146 if test -f ../config.guess && test -f ../config.sub
18147 then
18148         cat >>Makefile <<TEST_EOF
18149
18150 # if we used CF_INHERIT for getting these files, we can remove them
18151 distclean::
18152         rm -f config.guess config.sub
18153 TEST_EOF
18154 fi
18155  ;;
18156   esac
18157 done
18158 EOF
18159
18160 cat >>$CONFIG_STATUS <<\EOF
18161
18162 { (exit 0); exit 0; }
18163 EOF
18164 chmod +x $CONFIG_STATUS
18165 ac_clean_files=$ac_clean_files_save
18166
18167 # configure is writing to config.log, and then calls config.status.
18168 # config.status does its own redirection, appending to config.log.
18169 # Unfortunately, on DOS this fails, as config.log is still kept open
18170 # by configure, so config.status won't be able to write to it; its
18171 # output is simply discarded.  So we exec the FD to /dev/null,
18172 # effectively closing config.log, so it can be properly (re)opened and
18173 # appended to by config.status.  When coming back to configure, we
18174 # need to make the FD available again.
18175 if test "$no_create" != yes; then
18176   ac_cs_success=:
18177   exec 5>/dev/null
18178   $SHELL $CONFIG_STATUS || ac_cs_success=false
18179   exec 5>>config.log
18180   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
18181   # would make configure fail if this is the last instruction.
18182   $ac_cs_success || { (exit 1); exit 1; }
18183 fi
18184