]> ncurses.scripts.mit.edu Git - ncurses.git/blob - test/configure
ncurses 5.9 - patch 20150516
[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 elif test "x$cf_pkg_config" != xno ; then
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                         NCURSES_CONFIG_PKG=none
6172                 else
6173
6174 cat >>confdefs.h <<\EOF
6175 #define NCURSES 1
6176 EOF
6177
6178                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
6179                 fi
6180
6181         else
6182                 echo "$as_me:6182: result: no" >&5
6183 echo "${ECHO_T}no" >&6
6184                 NCURSES_CONFIG_PKG=none
6185         fi
6186 else
6187         NCURSES_CONFIG_PKG=none
6188 fi
6189
6190 if test "x$cf_have_ncuconfig" = "xno"; then
6191         echo "Looking for ${cf_ncuconfig_root}-config"
6192
6193 if test -n "$ac_tool_prefix"; then
6194   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
6195   do
6196     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
6197 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
6198 echo "$as_me:6198: checking for $ac_word" >&5
6199 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
6200 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
6201   echo $ECHO_N "(cached) $ECHO_C" >&6
6202 else
6203   if test -n "$NCURSES_CONFIG"; then
6204   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
6205 else
6206   ac_save_IFS=$IFS; IFS=$ac_path_separator
6207 ac_dummy="$PATH"
6208 for ac_dir in $ac_dummy; do
6209   IFS=$ac_save_IFS
6210   test -z "$ac_dir" && ac_dir=.
6211   $as_executable_p "$ac_dir/$ac_word" || continue
6212 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
6213 echo "$as_me:6213: found $ac_dir/$ac_word" >&5
6214 break
6215 done
6216
6217 fi
6218 fi
6219 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
6220 if test -n "$NCURSES_CONFIG"; then
6221   echo "$as_me:6221: result: $NCURSES_CONFIG" >&5
6222 echo "${ECHO_T}$NCURSES_CONFIG" >&6
6223 else
6224   echo "$as_me:6224: result: no" >&5
6225 echo "${ECHO_T}no" >&6
6226 fi
6227
6228     test -n "$NCURSES_CONFIG" && break
6229   done
6230 fi
6231 if test -z "$NCURSES_CONFIG"; then
6232   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
6233   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
6234 do
6235   # Extract the first word of "$ac_prog", so it can be a program name with args.
6236 set dummy $ac_prog; ac_word=$2
6237 echo "$as_me:6237: checking for $ac_word" >&5
6238 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
6239 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
6240   echo $ECHO_N "(cached) $ECHO_C" >&6
6241 else
6242   if test -n "$ac_ct_NCURSES_CONFIG"; then
6243   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
6244 else
6245   ac_save_IFS=$IFS; IFS=$ac_path_separator
6246 ac_dummy="$PATH"
6247 for ac_dir in $ac_dummy; do
6248   IFS=$ac_save_IFS
6249   test -z "$ac_dir" && ac_dir=.
6250   $as_executable_p "$ac_dir/$ac_word" || continue
6251 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
6252 echo "$as_me:6252: found $ac_dir/$ac_word" >&5
6253 break
6254 done
6255
6256 fi
6257 fi
6258 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
6259 if test -n "$ac_ct_NCURSES_CONFIG"; then
6260   echo "$as_me:6260: result: $ac_ct_NCURSES_CONFIG" >&5
6261 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
6262 else
6263   echo "$as_me:6263: result: no" >&5
6264 echo "${ECHO_T}no" >&6
6265 fi
6266
6267   test -n "$ac_ct_NCURSES_CONFIG" && break
6268 done
6269 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
6270
6271   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
6272 fi
6273
6274         if test "$NCURSES_CONFIG" != none ; then
6275
6276                 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
6277
6278 cf_add_libs="`$NCURSES_CONFIG --libs`"
6279 # Filter out duplicates - this happens with badly-designed ".pc" files...
6280 for cf_add_1lib in $LIBS
6281 do
6282         for cf_add_2lib in $cf_add_libs
6283         do
6284                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6285                 then
6286                         cf_add_1lib=
6287                         break
6288                 fi
6289         done
6290         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6291 done
6292 LIBS="$cf_add_libs"
6293
6294                 # even with config script, some packages use no-override for curses.h
6295
6296 echo "$as_me:6296: checking if we have identified curses headers" >&5
6297 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
6298 if test "${cf_cv_ncurses_header+set}" = set; then
6299   echo $ECHO_N "(cached) $ECHO_C" >&6
6300 else
6301
6302 cf_cv_ncurses_header=none
6303 for cf_header in \
6304         ncurses.h $cf_cv_screen/ncurses.h \
6305         curses.h $cf_cv_screen/curses.h
6306 do
6307 cat >conftest.$ac_ext <<_ACEOF
6308 #line 6308 "configure"
6309 #include "confdefs.h"
6310 #include <${cf_header}>
6311 int
6312 main ()
6313 {
6314 initscr(); tgoto("?", 0,0)
6315   ;
6316   return 0;
6317 }
6318 _ACEOF
6319 rm -f conftest.$ac_objext
6320 if { (eval echo "$as_me:6320: \"$ac_compile\"") >&5
6321   (eval $ac_compile) 2>&5
6322   ac_status=$?
6323   echo "$as_me:6323: \$? = $ac_status" >&5
6324   (exit $ac_status); } &&
6325          { ac_try='test -s conftest.$ac_objext'
6326   { (eval echo "$as_me:6326: \"$ac_try\"") >&5
6327   (eval $ac_try) 2>&5
6328   ac_status=$?
6329   echo "$as_me:6329: \$? = $ac_status" >&5
6330   (exit $ac_status); }; }; then
6331   cf_cv_ncurses_header=$cf_header; break
6332 else
6333   echo "$as_me: failed program was:" >&5
6334 cat conftest.$ac_ext >&5
6335 fi
6336 rm -f conftest.$ac_objext conftest.$ac_ext
6337 done
6338
6339 fi
6340 echo "$as_me:6340: result: $cf_cv_ncurses_header" >&5
6341 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
6342
6343 if test "$cf_cv_ncurses_header" = none ; then
6344         { { echo "$as_me:6344: error: No curses header-files found" >&5
6345 echo "$as_me: error: No curses header-files found" >&2;}
6346    { (exit 1); exit 1; }; }
6347 fi
6348
6349 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
6350
6351 for ac_header in $cf_cv_ncurses_header
6352 do
6353 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
6354 echo "$as_me:6354: checking for $ac_header" >&5
6355 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
6356 if eval "test \"\${$as_ac_Header+set}\" = set"; then
6357   echo $ECHO_N "(cached) $ECHO_C" >&6
6358 else
6359   cat >conftest.$ac_ext <<_ACEOF
6360 #line 6360 "configure"
6361 #include "confdefs.h"
6362 #include <$ac_header>
6363 _ACEOF
6364 if { (eval echo "$as_me:6364: \"$ac_cpp conftest.$ac_ext\"") >&5
6365   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
6366   ac_status=$?
6367   egrep -v '^ *\+' conftest.er1 >conftest.err
6368   rm -f conftest.er1
6369   cat conftest.err >&5
6370   echo "$as_me:6370: \$? = $ac_status" >&5
6371   (exit $ac_status); } >/dev/null; then
6372   if test -s conftest.err; then
6373     ac_cpp_err=$ac_c_preproc_warn_flag
6374   else
6375     ac_cpp_err=
6376   fi
6377 else
6378   ac_cpp_err=yes
6379 fi
6380 if test -z "$ac_cpp_err"; then
6381   eval "$as_ac_Header=yes"
6382 else
6383   echo "$as_me: failed program was:" >&5
6384   cat conftest.$ac_ext >&5
6385   eval "$as_ac_Header=no"
6386 fi
6387 rm -f conftest.err conftest.$ac_ext
6388 fi
6389 echo "$as_me:6389: result: `eval echo '${'$as_ac_Header'}'`" >&5
6390 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
6391 if test `eval echo '${'$as_ac_Header'}'` = yes; then
6392   cat >>confdefs.h <<EOF
6393 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
6394 EOF
6395
6396 fi
6397 done
6398
6399 cat >>confdefs.h <<\EOF
6400 #define NCURSES 1
6401 EOF
6402
6403 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
6404
6405                 cat >>confdefs.h <<EOF
6406 #define $cf_nculib_ROOT 1
6407 EOF
6408
6409                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
6410
6411         else
6412
6413 cf_ncuhdr_root=$cf_cv_screen
6414
6415 test -n "$cf_cv_curses_dir" && \
6416 test "$cf_cv_curses_dir" != "no" && { \
6417
6418 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
6419   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
6420   do
6421         while test $cf_add_incdir != /usr/include
6422         do
6423           if test -d $cf_add_incdir
6424           then
6425                 cf_have_incdir=no
6426                 if test -n "$CFLAGS$CPPFLAGS" ; then
6427                   # a loop is needed to ensure we can add subdirs of existing dirs
6428                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6429                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6430                           cf_have_incdir=yes; break
6431                         fi
6432                   done
6433                 fi
6434
6435                 if test "$cf_have_incdir" = no ; then
6436                   if test "$cf_add_incdir" = /usr/local/include ; then
6437                         if test "$GCC" = yes
6438                         then
6439                           cf_save_CPPFLAGS=$CPPFLAGS
6440                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6441                           cat >conftest.$ac_ext <<_ACEOF
6442 #line 6442 "configure"
6443 #include "confdefs.h"
6444 #include <stdio.h>
6445 int
6446 main ()
6447 {
6448 printf("Hello")
6449   ;
6450   return 0;
6451 }
6452 _ACEOF
6453 rm -f conftest.$ac_objext
6454 if { (eval echo "$as_me:6454: \"$ac_compile\"") >&5
6455   (eval $ac_compile) 2>&5
6456   ac_status=$?
6457   echo "$as_me:6457: \$? = $ac_status" >&5
6458   (exit $ac_status); } &&
6459          { ac_try='test -s conftest.$ac_objext'
6460   { (eval echo "$as_me:6460: \"$ac_try\"") >&5
6461   (eval $ac_try) 2>&5
6462   ac_status=$?
6463   echo "$as_me:6463: \$? = $ac_status" >&5
6464   (exit $ac_status); }; }; then
6465   :
6466 else
6467   echo "$as_me: failed program was:" >&5
6468 cat conftest.$ac_ext >&5
6469 cf_have_incdir=yes
6470 fi
6471 rm -f conftest.$ac_objext conftest.$ac_ext
6472                           CPPFLAGS=$cf_save_CPPFLAGS
6473                         fi
6474                   fi
6475                 fi
6476
6477                 if test "$cf_have_incdir" = no ; then
6478                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6479
6480 echo "${as_me:-configure}:6480: testing adding $cf_add_incdir to include-path ..." 1>&5
6481
6482                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6483
6484                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6485                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6486                   cf_add_incdir="$cf_top_incdir"
6487                 else
6488                   break
6489                 fi
6490           fi
6491         done
6492   done
6493 fi
6494
6495 }
6496
6497 echo "$as_me:6497: checking for $cf_ncuhdr_root header in include-path" >&5
6498 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
6499 if test "${cf_cv_ncurses_h+set}" = set; then
6500   echo $ECHO_N "(cached) $ECHO_C" >&6
6501 else
6502
6503         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
6504         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
6505         for cf_header in $cf_header_list
6506         do
6507
6508         cat >conftest.$ac_ext <<_ACEOF
6509 #line 6509 "configure"
6510 #include "confdefs.h"
6511
6512 #include <$cf_header>
6513 int
6514 main ()
6515 {
6516
6517 #ifdef NCURSES_VERSION
6518
6519 printf("%s\n", NCURSES_VERSION);
6520 #else
6521 #ifdef __NCURSES_H
6522 printf("old\n");
6523 #else
6524         make an error
6525 #endif
6526 #endif
6527
6528   ;
6529   return 0;
6530 }
6531 _ACEOF
6532 rm -f conftest.$ac_objext
6533 if { (eval echo "$as_me:6533: \"$ac_compile\"") >&5
6534   (eval $ac_compile) 2>&5
6535   ac_status=$?
6536   echo "$as_me:6536: \$? = $ac_status" >&5
6537   (exit $ac_status); } &&
6538          { ac_try='test -s conftest.$ac_objext'
6539   { (eval echo "$as_me:6539: \"$ac_try\"") >&5
6540   (eval $ac_try) 2>&5
6541   ac_status=$?
6542   echo "$as_me:6542: \$? = $ac_status" >&5
6543   (exit $ac_status); }; }; then
6544   cf_cv_ncurses_h=$cf_header
6545
6546 else
6547   echo "$as_me: failed program was:" >&5
6548 cat conftest.$ac_ext >&5
6549 cf_cv_ncurses_h=no
6550 fi
6551 rm -f conftest.$ac_objext conftest.$ac_ext
6552
6553                 test "$cf_cv_ncurses_h" != no && break
6554         done
6555
6556 fi
6557 echo "$as_me:6557: result: $cf_cv_ncurses_h" >&5
6558 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
6559
6560 if test "$cf_cv_ncurses_h" != no ; then
6561         cf_cv_ncurses_header=$cf_cv_ncurses_h
6562 else
6563
6564 echo "$as_me:6564: checking for $cf_ncuhdr_root include-path" >&5
6565 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
6566 if test "${cf_cv_ncurses_h2+set}" = set; then
6567   echo $ECHO_N "(cached) $ECHO_C" >&6
6568 else
6569
6570         test -n "$verbose" && echo
6571
6572 cf_search=
6573
6574 # collect the current set of include-directories from compiler flags
6575 cf_header_path_list=""
6576 if test -n "${CFLAGS}${CPPFLAGS}" ; then
6577         for cf_header_path in $CPPFLAGS $CFLAGS
6578         do
6579                 case $cf_header_path in
6580                 (-I*)
6581                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
6582
6583 test "x$cf_header_path" != "xNONE" && \
6584 test -d "$cf_header_path" && \
6585  {
6586         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
6587         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
6588         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
6589         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
6590         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
6591         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"
6592 }
6593
6594                         cf_header_path_list="$cf_header_path_list $cf_search"
6595                         ;;
6596                 esac
6597         done
6598 fi
6599
6600 # add the variations for the package we are looking for
6601
6602 cf_search=
6603
6604 test "x$prefix" != "xNONE" && \
6605 test -d "$prefix" && \
6606  {
6607         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
6608         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
6609         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
6610         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
6611         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
6612         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
6613 }
6614
6615 for cf_subdir_prefix in \
6616         /usr \
6617         /usr/local \
6618         /usr/pkg \
6619         /opt \
6620         /opt/local \
6621         $HOME
6622 do
6623
6624 test "x$cf_subdir_prefix" != "x$prefix" && \
6625 test -d "$cf_subdir_prefix" && \
6626 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
6627         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
6628         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
6629         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
6630         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
6631         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
6632         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"
6633 }
6634
6635 done
6636
6637 test "$includedir" != NONE && \
6638 test "$includedir" != "/usr/include" && \
6639 test -d "$includedir" && {
6640         test -d $includedir &&    cf_search="$cf_search $includedir"
6641         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
6642 }
6643
6644 test "$oldincludedir" != NONE && \
6645 test "$oldincludedir" != "/usr/include" && \
6646 test -d "$oldincludedir" && {
6647         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
6648         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
6649 }
6650
6651 cf_search="$cf_search $cf_header_path_list"
6652
6653         test -n "$verbose" && echo search path $cf_search
6654         cf_save2_CPPFLAGS="$CPPFLAGS"
6655         for cf_incdir in $cf_search
6656         do
6657
6658 if test -n "$cf_incdir" ; then
6659   for cf_add_incdir in $cf_incdir
6660   do
6661         while test $cf_add_incdir != /usr/include
6662         do
6663           if test -d $cf_add_incdir
6664           then
6665                 cf_have_incdir=no
6666                 if test -n "$CFLAGS$CPPFLAGS" ; then
6667                   # a loop is needed to ensure we can add subdirs of existing dirs
6668                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6669                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6670                           cf_have_incdir=yes; break
6671                         fi
6672                   done
6673                 fi
6674
6675                 if test "$cf_have_incdir" = no ; then
6676                   if test "$cf_add_incdir" = /usr/local/include ; then
6677                         if test "$GCC" = yes
6678                         then
6679                           cf_save_CPPFLAGS=$CPPFLAGS
6680                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6681                           cat >conftest.$ac_ext <<_ACEOF
6682 #line 6682 "configure"
6683 #include "confdefs.h"
6684 #include <stdio.h>
6685 int
6686 main ()
6687 {
6688 printf("Hello")
6689   ;
6690   return 0;
6691 }
6692 _ACEOF
6693 rm -f conftest.$ac_objext
6694 if { (eval echo "$as_me:6694: \"$ac_compile\"") >&5
6695   (eval $ac_compile) 2>&5
6696   ac_status=$?
6697   echo "$as_me:6697: \$? = $ac_status" >&5
6698   (exit $ac_status); } &&
6699          { ac_try='test -s conftest.$ac_objext'
6700   { (eval echo "$as_me:6700: \"$ac_try\"") >&5
6701   (eval $ac_try) 2>&5
6702   ac_status=$?
6703   echo "$as_me:6703: \$? = $ac_status" >&5
6704   (exit $ac_status); }; }; then
6705   :
6706 else
6707   echo "$as_me: failed program was:" >&5
6708 cat conftest.$ac_ext >&5
6709 cf_have_incdir=yes
6710 fi
6711 rm -f conftest.$ac_objext conftest.$ac_ext
6712                           CPPFLAGS=$cf_save_CPPFLAGS
6713                         fi
6714                   fi
6715                 fi
6716
6717                 if test "$cf_have_incdir" = no ; then
6718                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6719
6720 echo "${as_me:-configure}:6720: testing adding $cf_add_incdir to include-path ..." 1>&5
6721
6722                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6723
6724                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6725                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6726                   cf_add_incdir="$cf_top_incdir"
6727                 else
6728                   break
6729                 fi
6730           fi
6731         done
6732   done
6733 fi
6734
6735                 for cf_header in \
6736                         ncurses.h \
6737                         curses.h
6738                 do
6739
6740         cat >conftest.$ac_ext <<_ACEOF
6741 #line 6741 "configure"
6742 #include "confdefs.h"
6743
6744 #include <$cf_header>
6745 int
6746 main ()
6747 {
6748
6749 #ifdef NCURSES_VERSION
6750
6751 printf("%s\n", NCURSES_VERSION);
6752 #else
6753 #ifdef __NCURSES_H
6754 printf("old\n");
6755 #else
6756         make an error
6757 #endif
6758 #endif
6759
6760   ;
6761   return 0;
6762 }
6763 _ACEOF
6764 rm -f conftest.$ac_objext
6765 if { (eval echo "$as_me:6765: \"$ac_compile\"") >&5
6766   (eval $ac_compile) 2>&5
6767   ac_status=$?
6768   echo "$as_me:6768: \$? = $ac_status" >&5
6769   (exit $ac_status); } &&
6770          { ac_try='test -s conftest.$ac_objext'
6771   { (eval echo "$as_me:6771: \"$ac_try\"") >&5
6772   (eval $ac_try) 2>&5
6773   ac_status=$?
6774   echo "$as_me:6774: \$? = $ac_status" >&5
6775   (exit $ac_status); }; }; then
6776   cf_cv_ncurses_h2=$cf_header
6777
6778 else
6779   echo "$as_me: failed program was:" >&5
6780 cat conftest.$ac_ext >&5
6781 cf_cv_ncurses_h2=no
6782 fi
6783 rm -f conftest.$ac_objext conftest.$ac_ext
6784
6785                         if test "$cf_cv_ncurses_h2" != no ; then
6786                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
6787                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
6788                                 break
6789                         fi
6790                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
6791                 done
6792                 CPPFLAGS="$cf_save2_CPPFLAGS"
6793                 test "$cf_cv_ncurses_h2" != no && break
6794         done
6795         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:6795: error: not found" >&5
6796 echo "$as_me: error: not found" >&2;}
6797    { (exit 1); exit 1; }; }
6798
6799 fi
6800 echo "$as_me:6800: result: $cf_cv_ncurses_h2" >&5
6801 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
6802
6803         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
6804         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
6805         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
6806                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
6807         fi
6808
6809 if test -n "$cf_1st_incdir" ; then
6810   for cf_add_incdir in $cf_1st_incdir
6811   do
6812         while test $cf_add_incdir != /usr/include
6813         do
6814           if test -d $cf_add_incdir
6815           then
6816                 cf_have_incdir=no
6817                 if test -n "$CFLAGS$CPPFLAGS" ; then
6818                   # a loop is needed to ensure we can add subdirs of existing dirs
6819                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6820                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6821                           cf_have_incdir=yes; break
6822                         fi
6823                   done
6824                 fi
6825
6826                 if test "$cf_have_incdir" = no ; then
6827                   if test "$cf_add_incdir" = /usr/local/include ; then
6828                         if test "$GCC" = yes
6829                         then
6830                           cf_save_CPPFLAGS=$CPPFLAGS
6831                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6832                           cat >conftest.$ac_ext <<_ACEOF
6833 #line 6833 "configure"
6834 #include "confdefs.h"
6835 #include <stdio.h>
6836 int
6837 main ()
6838 {
6839 printf("Hello")
6840   ;
6841   return 0;
6842 }
6843 _ACEOF
6844 rm -f conftest.$ac_objext
6845 if { (eval echo "$as_me:6845: \"$ac_compile\"") >&5
6846   (eval $ac_compile) 2>&5
6847   ac_status=$?
6848   echo "$as_me:6848: \$? = $ac_status" >&5
6849   (exit $ac_status); } &&
6850          { ac_try='test -s conftest.$ac_objext'
6851   { (eval echo "$as_me:6851: \"$ac_try\"") >&5
6852   (eval $ac_try) 2>&5
6853   ac_status=$?
6854   echo "$as_me:6854: \$? = $ac_status" >&5
6855   (exit $ac_status); }; }; then
6856   :
6857 else
6858   echo "$as_me: failed program was:" >&5
6859 cat conftest.$ac_ext >&5
6860 cf_have_incdir=yes
6861 fi
6862 rm -f conftest.$ac_objext conftest.$ac_ext
6863                           CPPFLAGS=$cf_save_CPPFLAGS
6864                         fi
6865                   fi
6866                 fi
6867
6868                 if test "$cf_have_incdir" = no ; then
6869                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6870
6871 echo "${as_me:-configure}:6871: testing adding $cf_add_incdir to include-path ..." 1>&5
6872
6873                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6874
6875                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6876                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6877                   cf_add_incdir="$cf_top_incdir"
6878                 else
6879                   break
6880                 fi
6881           fi
6882         done
6883   done
6884 fi
6885
6886 fi
6887
6888 # Set definitions to allow ifdef'ing for ncurses.h
6889
6890 case $cf_cv_ncurses_header in
6891 (*ncurses.h)
6892
6893 cat >>confdefs.h <<\EOF
6894 #define HAVE_NCURSES_H 1
6895 EOF
6896
6897         ;;
6898 esac
6899
6900 case $cf_cv_ncurses_header in
6901 (ncurses/curses.h|ncurses/ncurses.h)
6902
6903 cat >>confdefs.h <<\EOF
6904 #define HAVE_NCURSES_NCURSES_H 1
6905 EOF
6906
6907         ;;
6908 (ncursesw/curses.h|ncursesw/ncurses.h)
6909
6910 cat >>confdefs.h <<\EOF
6911 #define HAVE_NCURSESW_NCURSES_H 1
6912 EOF
6913
6914         ;;
6915 esac
6916
6917 echo "$as_me:6917: checking for terminfo header" >&5
6918 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
6919 if test "${cf_cv_term_header+set}" = set; then
6920   echo $ECHO_N "(cached) $ECHO_C" >&6
6921 else
6922
6923 case ${cf_cv_ncurses_header} in
6924 (*/ncurses.h|*/ncursesw.h)
6925         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
6926         ;;
6927 (*)
6928         cf_term_header=term.h
6929         ;;
6930 esac
6931
6932 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
6933 do
6934 cat >conftest.$ac_ext <<_ACEOF
6935 #line 6935 "configure"
6936 #include "confdefs.h"
6937 #include <stdio.h>
6938 #include <${cf_cv_ncurses_header:-curses.h}>
6939 #include <$cf_test>
6940
6941 int
6942 main ()
6943 {
6944 int x = auto_left_margin
6945   ;
6946   return 0;
6947 }
6948 _ACEOF
6949 rm -f conftest.$ac_objext
6950 if { (eval echo "$as_me:6950: \"$ac_compile\"") >&5
6951   (eval $ac_compile) 2>&5
6952   ac_status=$?
6953   echo "$as_me:6953: \$? = $ac_status" >&5
6954   (exit $ac_status); } &&
6955          { ac_try='test -s conftest.$ac_objext'
6956   { (eval echo "$as_me:6956: \"$ac_try\"") >&5
6957   (eval $ac_try) 2>&5
6958   ac_status=$?
6959   echo "$as_me:6959: \$? = $ac_status" >&5
6960   (exit $ac_status); }; }; then
6961
6962         cf_cv_term_header="$cf_test"
6963 else
6964   echo "$as_me: failed program was:" >&5
6965 cat conftest.$ac_ext >&5
6966
6967         cf_cv_term_header=unknown
6968
6969 fi
6970 rm -f conftest.$ac_objext conftest.$ac_ext
6971         test "$cf_cv_term_header" != unknown && break
6972 done
6973
6974 fi
6975 echo "$as_me:6975: result: $cf_cv_term_header" >&5
6976 echo "${ECHO_T}$cf_cv_term_header" >&6
6977
6978 # Set definitions to allow ifdef'ing to accommodate subdirectories
6979
6980 case $cf_cv_term_header in
6981 (*term.h)
6982
6983 cat >>confdefs.h <<\EOF
6984 #define HAVE_TERM_H 1
6985 EOF
6986
6987         ;;
6988 esac
6989
6990 case $cf_cv_term_header in
6991 (ncurses/term.h)
6992
6993 cat >>confdefs.h <<\EOF
6994 #define HAVE_NCURSES_TERM_H 1
6995 EOF
6996
6997         ;;
6998 (ncursesw/term.h)
6999
7000 cat >>confdefs.h <<\EOF
7001 #define HAVE_NCURSESW_TERM_H 1
7002 EOF
7003
7004         ;;
7005 esac
7006
7007 # some applications need this, but should check for NCURSES_VERSION
7008
7009 cat >>confdefs.h <<\EOF
7010 #define NCURSES 1
7011 EOF
7012
7013 echo "$as_me:7013: checking for ncurses version" >&5
7014 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
7015 if test "${cf_cv_ncurses_version+set}" = set; then
7016   echo $ECHO_N "(cached) $ECHO_C" >&6
7017 else
7018
7019         cf_cv_ncurses_version=no
7020         cf_tempfile=out$$
7021         rm -f $cf_tempfile
7022         if test "$cross_compiling" = yes; then
7023
7024         # This will not work if the preprocessor splits the line after the
7025         # Autoconf token.  The 'unproto' program does that.
7026         cat > conftest.$ac_ext <<EOF
7027 #include <${cf_cv_ncurses_header:-curses.h}>
7028 #undef Autoconf
7029 #ifdef NCURSES_VERSION
7030 Autoconf NCURSES_VERSION
7031 #else
7032 #ifdef __NCURSES_H
7033 Autoconf "old"
7034 #endif
7035 ;
7036 #endif
7037 EOF
7038         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
7039         { (eval echo "$as_me:7039: \"$cf_try\"") >&5
7040   (eval $cf_try) 2>&5
7041   ac_status=$?
7042   echo "$as_me:7042: \$? = $ac_status" >&5
7043   (exit $ac_status); }
7044         if test -f conftest.out ; then
7045                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
7046                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
7047                 rm -f conftest.out
7048         fi
7049
7050 else
7051   cat >conftest.$ac_ext <<_ACEOF
7052 #line 7052 "configure"
7053 #include "confdefs.h"
7054
7055 #include <${cf_cv_ncurses_header:-curses.h}>
7056 #include <stdio.h>
7057 int main()
7058 {
7059         FILE *fp = fopen("$cf_tempfile", "w");
7060 #ifdef NCURSES_VERSION
7061 # ifdef NCURSES_VERSION_PATCH
7062         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
7063 # else
7064         fprintf(fp, "%s\n", NCURSES_VERSION);
7065 # endif
7066 #else
7067 # ifdef __NCURSES_H
7068         fprintf(fp, "old\n");
7069 # else
7070         make an error
7071 # endif
7072 #endif
7073         ${cf_cv_main_return:-return}(0);
7074 }
7075 _ACEOF
7076 rm -f conftest$ac_exeext
7077 if { (eval echo "$as_me:7077: \"$ac_link\"") >&5
7078   (eval $ac_link) 2>&5
7079   ac_status=$?
7080   echo "$as_me:7080: \$? = $ac_status" >&5
7081   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
7082   { (eval echo "$as_me:7082: \"$ac_try\"") >&5
7083   (eval $ac_try) 2>&5
7084   ac_status=$?
7085   echo "$as_me:7085: \$? = $ac_status" >&5
7086   (exit $ac_status); }; }; then
7087
7088         cf_cv_ncurses_version=`cat $cf_tempfile`
7089 else
7090   echo "$as_me: program exited with status $ac_status" >&5
7091 echo "$as_me: failed program was:" >&5
7092 cat conftest.$ac_ext >&5
7093 fi
7094 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
7095 fi
7096         rm -f $cf_tempfile
7097
7098 fi
7099 echo "$as_me:7099: result: $cf_cv_ncurses_version" >&5
7100 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
7101 test "$cf_cv_ncurses_version" = no ||
7102 cat >>confdefs.h <<\EOF
7103 #define NCURSES 1
7104 EOF
7105
7106 cf_nculib_root=$cf_cv_screen
7107         # This works, except for the special case where we find gpm, but
7108         # ncurses is in a nonstandard location via $LIBS, and we really want
7109         # to link gpm.
7110 cf_ncurses_LIBS=""
7111 cf_ncurses_SAVE="$LIBS"
7112 echo "$as_me:7112: checking for Gpm_Open in -lgpm" >&5
7113 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
7114 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
7115   echo $ECHO_N "(cached) $ECHO_C" >&6
7116 else
7117   ac_check_lib_save_LIBS=$LIBS
7118 LIBS="-lgpm  $LIBS"
7119 cat >conftest.$ac_ext <<_ACEOF
7120 #line 7120 "configure"
7121 #include "confdefs.h"
7122
7123 /* Override any gcc2 internal prototype to avoid an error.  */
7124 #ifdef __cplusplus
7125 extern "C"
7126 #endif
7127 /* We use char because int might match the return type of a gcc2
7128    builtin and then its argument prototype would still apply.  */
7129 char Gpm_Open ();
7130 int
7131 main ()
7132 {
7133 Gpm_Open ();
7134   ;
7135   return 0;
7136 }
7137 _ACEOF
7138 rm -f conftest.$ac_objext conftest$ac_exeext
7139 if { (eval echo "$as_me:7139: \"$ac_link\"") >&5
7140   (eval $ac_link) 2>&5
7141   ac_status=$?
7142   echo "$as_me:7142: \$? = $ac_status" >&5
7143   (exit $ac_status); } &&
7144          { ac_try='test -s conftest$ac_exeext'
7145   { (eval echo "$as_me:7145: \"$ac_try\"") >&5
7146   (eval $ac_try) 2>&5
7147   ac_status=$?
7148   echo "$as_me:7148: \$? = $ac_status" >&5
7149   (exit $ac_status); }; }; then
7150   ac_cv_lib_gpm_Gpm_Open=yes
7151 else
7152   echo "$as_me: failed program was:" >&5
7153 cat conftest.$ac_ext >&5
7154 ac_cv_lib_gpm_Gpm_Open=no
7155 fi
7156 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7157 LIBS=$ac_check_lib_save_LIBS
7158 fi
7159 echo "$as_me:7159: result: $ac_cv_lib_gpm_Gpm_Open" >&5
7160 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
7161 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
7162   echo "$as_me:7162: checking for initscr in -lgpm" >&5
7163 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
7164 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
7165   echo $ECHO_N "(cached) $ECHO_C" >&6
7166 else
7167   ac_check_lib_save_LIBS=$LIBS
7168 LIBS="-lgpm  $LIBS"
7169 cat >conftest.$ac_ext <<_ACEOF
7170 #line 7170 "configure"
7171 #include "confdefs.h"
7172
7173 /* Override any gcc2 internal prototype to avoid an error.  */
7174 #ifdef __cplusplus
7175 extern "C"
7176 #endif
7177 /* We use char because int might match the return type of a gcc2
7178    builtin and then its argument prototype would still apply.  */
7179 char initscr ();
7180 int
7181 main ()
7182 {
7183 initscr ();
7184   ;
7185   return 0;
7186 }
7187 _ACEOF
7188 rm -f conftest.$ac_objext conftest$ac_exeext
7189 if { (eval echo "$as_me:7189: \"$ac_link\"") >&5
7190   (eval $ac_link) 2>&5
7191   ac_status=$?
7192   echo "$as_me:7192: \$? = $ac_status" >&5
7193   (exit $ac_status); } &&
7194          { ac_try='test -s conftest$ac_exeext'
7195   { (eval echo "$as_me:7195: \"$ac_try\"") >&5
7196   (eval $ac_try) 2>&5
7197   ac_status=$?
7198   echo "$as_me:7198: \$? = $ac_status" >&5
7199   (exit $ac_status); }; }; then
7200   ac_cv_lib_gpm_initscr=yes
7201 else
7202   echo "$as_me: failed program was:" >&5
7203 cat conftest.$ac_ext >&5
7204 ac_cv_lib_gpm_initscr=no
7205 fi
7206 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7207 LIBS=$ac_check_lib_save_LIBS
7208 fi
7209 echo "$as_me:7209: result: $ac_cv_lib_gpm_initscr" >&5
7210 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
7211 if test $ac_cv_lib_gpm_initscr = yes; then
7212   LIBS="$cf_ncurses_SAVE"
7213 else
7214   cf_ncurses_LIBS="-lgpm"
7215 fi
7216
7217 fi
7218
7219 case $host_os in
7220 (freebsd*)
7221         # This is only necessary if you are linking against an obsolete
7222         # version of ncurses (but it should do no harm, since it's static).
7223         if test "$cf_nculib_root" = ncurses ; then
7224                 echo "$as_me:7224: checking for tgoto in -lmytinfo" >&5
7225 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
7226 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
7227   echo $ECHO_N "(cached) $ECHO_C" >&6
7228 else
7229   ac_check_lib_save_LIBS=$LIBS
7230 LIBS="-lmytinfo  $LIBS"
7231 cat >conftest.$ac_ext <<_ACEOF
7232 #line 7232 "configure"
7233 #include "confdefs.h"
7234
7235 /* Override any gcc2 internal prototype to avoid an error.  */
7236 #ifdef __cplusplus
7237 extern "C"
7238 #endif
7239 /* We use char because int might match the return type of a gcc2
7240    builtin and then its argument prototype would still apply.  */
7241 char tgoto ();
7242 int
7243 main ()
7244 {
7245 tgoto ();
7246   ;
7247   return 0;
7248 }
7249 _ACEOF
7250 rm -f conftest.$ac_objext conftest$ac_exeext
7251 if { (eval echo "$as_me:7251: \"$ac_link\"") >&5
7252   (eval $ac_link) 2>&5
7253   ac_status=$?
7254   echo "$as_me:7254: \$? = $ac_status" >&5
7255   (exit $ac_status); } &&
7256          { ac_try='test -s conftest$ac_exeext'
7257   { (eval echo "$as_me:7257: \"$ac_try\"") >&5
7258   (eval $ac_try) 2>&5
7259   ac_status=$?
7260   echo "$as_me:7260: \$? = $ac_status" >&5
7261   (exit $ac_status); }; }; then
7262   ac_cv_lib_mytinfo_tgoto=yes
7263 else
7264   echo "$as_me: failed program was:" >&5
7265 cat conftest.$ac_ext >&5
7266 ac_cv_lib_mytinfo_tgoto=no
7267 fi
7268 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7269 LIBS=$ac_check_lib_save_LIBS
7270 fi
7271 echo "$as_me:7271: result: $ac_cv_lib_mytinfo_tgoto" >&5
7272 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
7273 if test $ac_cv_lib_mytinfo_tgoto = yes; then
7274   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
7275 fi
7276
7277         fi
7278         ;;
7279 esac
7280
7281 cf_add_libs="$cf_ncurses_LIBS"
7282 # Filter out duplicates - this happens with badly-designed ".pc" files...
7283 for cf_add_1lib in $LIBS
7284 do
7285         for cf_add_2lib in $cf_add_libs
7286         do
7287                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7288                 then
7289                         cf_add_1lib=
7290                         break
7291                 fi
7292         done
7293         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7294 done
7295 LIBS="$cf_add_libs"
7296
7297 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
7298 then
7299
7300 cf_add_libs="-l$cf_nculib_root"
7301 # Filter out duplicates - this happens with badly-designed ".pc" files...
7302 for cf_add_1lib in $LIBS
7303 do
7304         for cf_add_2lib in $cf_add_libs
7305         do
7306                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7307                 then
7308                         cf_add_1lib=
7309                         break
7310                 fi
7311         done
7312         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7313 done
7314 LIBS="$cf_add_libs"
7315
7316 else
7317
7318         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
7319         cf_libdir=""
7320         echo "$as_me:7320: checking for initscr" >&5
7321 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
7322 if test "${ac_cv_func_initscr+set}" = set; then
7323   echo $ECHO_N "(cached) $ECHO_C" >&6
7324 else
7325   cat >conftest.$ac_ext <<_ACEOF
7326 #line 7326 "configure"
7327 #include "confdefs.h"
7328 /* System header to define __stub macros and hopefully few prototypes,
7329     which can conflict with char initscr (); below.  */
7330 #include <assert.h>
7331 /* Override any gcc2 internal prototype to avoid an error.  */
7332 #ifdef __cplusplus
7333 extern "C"
7334 #endif
7335 /* We use char because int might match the return type of a gcc2
7336    builtin and then its argument prototype would still apply.  */
7337 char initscr ();
7338 char (*f) ();
7339
7340 int
7341 main ()
7342 {
7343 /* The GNU C library defines this for functions which it implements
7344     to always fail with ENOSYS.  Some functions are actually named
7345     something starting with __ and the normal name is an alias.  */
7346 #if defined (__stub_initscr) || defined (__stub___initscr)
7347 choke me
7348 #else
7349 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
7350 #endif
7351
7352   ;
7353   return 0;
7354 }
7355 _ACEOF
7356 rm -f conftest.$ac_objext conftest$ac_exeext
7357 if { (eval echo "$as_me:7357: \"$ac_link\"") >&5
7358   (eval $ac_link) 2>&5
7359   ac_status=$?
7360   echo "$as_me:7360: \$? = $ac_status" >&5
7361   (exit $ac_status); } &&
7362          { ac_try='test -s conftest$ac_exeext'
7363   { (eval echo "$as_me:7363: \"$ac_try\"") >&5
7364   (eval $ac_try) 2>&5
7365   ac_status=$?
7366   echo "$as_me:7366: \$? = $ac_status" >&5
7367   (exit $ac_status); }; }; then
7368   ac_cv_func_initscr=yes
7369 else
7370   echo "$as_me: failed program was:" >&5
7371 cat conftest.$ac_ext >&5
7372 ac_cv_func_initscr=no
7373 fi
7374 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7375 fi
7376 echo "$as_me:7376: result: $ac_cv_func_initscr" >&5
7377 echo "${ECHO_T}$ac_cv_func_initscr" >&6
7378 if test $ac_cv_func_initscr = yes; then
7379   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
7380 else
7381
7382                 cf_save_LIBS="$LIBS"
7383                 echo "$as_me:7383: checking for initscr in -l$cf_nculib_root" >&5
7384 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
7385                 LIBS="-l$cf_nculib_root $LIBS"
7386                 cat >conftest.$ac_ext <<_ACEOF
7387 #line 7387 "configure"
7388 #include "confdefs.h"
7389 #include <${cf_cv_ncurses_header:-curses.h}>
7390 int
7391 main ()
7392 {
7393 initscr()
7394   ;
7395   return 0;
7396 }
7397 _ACEOF
7398 rm -f conftest.$ac_objext conftest$ac_exeext
7399 if { (eval echo "$as_me:7399: \"$ac_link\"") >&5
7400   (eval $ac_link) 2>&5
7401   ac_status=$?
7402   echo "$as_me:7402: \$? = $ac_status" >&5
7403   (exit $ac_status); } &&
7404          { ac_try='test -s conftest$ac_exeext'
7405   { (eval echo "$as_me:7405: \"$ac_try\"") >&5
7406   (eval $ac_try) 2>&5
7407   ac_status=$?
7408   echo "$as_me:7408: \$? = $ac_status" >&5
7409   (exit $ac_status); }; }; then
7410   echo "$as_me:7410: result: yes" >&5
7411 echo "${ECHO_T}yes" >&6
7412                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
7413
7414 else
7415   echo "$as_me: failed program was:" >&5
7416 cat conftest.$ac_ext >&5
7417 echo "$as_me:7417: result: no" >&5
7418 echo "${ECHO_T}no" >&6
7419
7420 cf_search=
7421 cf_library_path_list=""
7422 if test -n "${LDFLAGS}${LIBS}" ; then
7423         for cf_library_path in $LDFLAGS $LIBS
7424         do
7425                 case $cf_library_path in
7426                 (-L*)
7427                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
7428
7429 test "x$cf_library_path" != "xNONE" && \
7430 test -d "$cf_library_path" && \
7431  {
7432         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
7433         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
7434         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
7435         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
7436         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
7437         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"
7438 }
7439
7440                         cf_library_path_list="$cf_library_path_list $cf_search"
7441                         ;;
7442                 esac
7443         done
7444 fi
7445
7446 cf_search=
7447
7448 test "x$prefix" != "xNONE" && \
7449 test -d "$prefix" && \
7450  {
7451         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
7452         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
7453         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
7454         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
7455         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
7456         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
7457 }
7458
7459 for cf_subdir_prefix in \
7460         /usr \
7461         /usr/local \
7462         /usr/pkg \
7463         /opt \
7464         /opt/local \
7465         $HOME
7466 do
7467
7468 test "x$cf_subdir_prefix" != "x$prefix" && \
7469 test -d "$cf_subdir_prefix" && \
7470 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
7471         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
7472         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
7473         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
7474         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
7475         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
7476         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"
7477 }
7478
7479 done
7480
7481 cf_search="$cf_library_path_list $cf_search"
7482
7483                         for cf_libdir in $cf_search
7484                         do
7485                                 echo "$as_me:7485: checking for -l$cf_nculib_root in $cf_libdir" >&5
7486 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
7487                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
7488                                 cat >conftest.$ac_ext <<_ACEOF
7489 #line 7489 "configure"
7490 #include "confdefs.h"
7491 #include <${cf_cv_ncurses_header:-curses.h}>
7492 int
7493 main ()
7494 {
7495 initscr()
7496   ;
7497   return 0;
7498 }
7499 _ACEOF
7500 rm -f conftest.$ac_objext conftest$ac_exeext
7501 if { (eval echo "$as_me:7501: \"$ac_link\"") >&5
7502   (eval $ac_link) 2>&5
7503   ac_status=$?
7504   echo "$as_me:7504: \$? = $ac_status" >&5
7505   (exit $ac_status); } &&
7506          { ac_try='test -s conftest$ac_exeext'
7507   { (eval echo "$as_me:7507: \"$ac_try\"") >&5
7508   (eval $ac_try) 2>&5
7509   ac_status=$?
7510   echo "$as_me:7510: \$? = $ac_status" >&5
7511   (exit $ac_status); }; }; then
7512   echo "$as_me:7512: result: yes" >&5
7513 echo "${ECHO_T}yes" >&6
7514                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
7515                                          break
7516 else
7517   echo "$as_me: failed program was:" >&5
7518 cat conftest.$ac_ext >&5
7519 echo "$as_me:7519: result: no" >&5
7520 echo "${ECHO_T}no" >&6
7521                                          LIBS="$cf_save_LIBS"
7522 fi
7523 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7524                         done
7525
7526 fi
7527 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7528
7529 fi
7530
7531 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
7532
7533 if test $cf_found_library = no ; then
7534         { { echo "$as_me:7534: error: Cannot link $cf_nculib_root library" >&5
7535 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
7536    { (exit 1); exit 1; }; }
7537 fi
7538
7539 fi
7540
7541 if test -n "$cf_ncurses_LIBS" ; then
7542         echo "$as_me:7542: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
7543 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
7544         cf_ncurses_SAVE="$LIBS"
7545         for p in $cf_ncurses_LIBS ; do
7546                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
7547                 if test "$q" != "$LIBS" ; then
7548                         LIBS="$q"
7549                 fi
7550         done
7551         cat >conftest.$ac_ext <<_ACEOF
7552 #line 7552 "configure"
7553 #include "confdefs.h"
7554 #include <${cf_cv_ncurses_header:-curses.h}>
7555 int
7556 main ()
7557 {
7558 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
7559   ;
7560   return 0;
7561 }
7562 _ACEOF
7563 rm -f conftest.$ac_objext conftest$ac_exeext
7564 if { (eval echo "$as_me:7564: \"$ac_link\"") >&5
7565   (eval $ac_link) 2>&5
7566   ac_status=$?
7567   echo "$as_me:7567: \$? = $ac_status" >&5
7568   (exit $ac_status); } &&
7569          { ac_try='test -s conftest$ac_exeext'
7570   { (eval echo "$as_me:7570: \"$ac_try\"") >&5
7571   (eval $ac_try) 2>&5
7572   ac_status=$?
7573   echo "$as_me:7573: \$? = $ac_status" >&5
7574   (exit $ac_status); }; }; then
7575   echo "$as_me:7575: result: yes" >&5
7576 echo "${ECHO_T}yes" >&6
7577 else
7578   echo "$as_me: failed program was:" >&5
7579 cat conftest.$ac_ext >&5
7580 echo "$as_me:7580: result: no" >&5
7581 echo "${ECHO_T}no" >&6
7582                  LIBS="$cf_ncurses_SAVE"
7583 fi
7584 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7585 fi
7586
7587 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
7588
7589 cat >>confdefs.h <<EOF
7590 #define $cf_nculib_ROOT 1
7591 EOF
7592
7593         fi
7594 else
7595         NCURSES_CONFIG=none
7596 fi
7597
7598         ;;
7599 (ncurses*)
7600
7601 cf_ncuconfig_root=$cf_cv_screen
7602 cf_have_ncuconfig=no
7603
7604 if test "x$PKG_CONFIG" != xnone; then
7605         echo "$as_me:7605: checking pkg-config for $cf_ncuconfig_root" >&5
7606 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
7607         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
7608                 echo "$as_me:7608: result: yes" >&5
7609 echo "${ECHO_T}yes" >&6
7610
7611                 echo "$as_me:7611: checking if the $cf_ncuconfig_root package files work" >&5
7612 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
7613                 cf_have_ncuconfig=unknown
7614
7615                 cf_save_CPPFLAGS="$CPPFLAGS"
7616                 cf_save_LIBS="$LIBS"
7617
7618                 CPPFLAGS="$CPPFLAGS `$PKG_CONFIG --cflags $cf_ncuconfig_root`"
7619
7620 cf_add_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
7621 # Filter out duplicates - this happens with badly-designed ".pc" files...
7622 for cf_add_1lib in $LIBS
7623 do
7624         for cf_add_2lib in $cf_add_libs
7625         do
7626                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7627                 then
7628                         cf_add_1lib=
7629                         break
7630                 fi
7631         done
7632         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7633 done
7634 LIBS="$cf_add_libs"
7635
7636                 cat >conftest.$ac_ext <<_ACEOF
7637 #line 7637 "configure"
7638 #include "confdefs.h"
7639 #include <${cf_cv_ncurses_header:-curses.h}>
7640 int
7641 main ()
7642 {
7643 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
7644   ;
7645   return 0;
7646 }
7647 _ACEOF
7648 rm -f conftest.$ac_objext conftest$ac_exeext
7649 if { (eval echo "$as_me:7649: \"$ac_link\"") >&5
7650   (eval $ac_link) 2>&5
7651   ac_status=$?
7652   echo "$as_me:7652: \$? = $ac_status" >&5
7653   (exit $ac_status); } &&
7654          { ac_try='test -s conftest$ac_exeext'
7655   { (eval echo "$as_me:7655: \"$ac_try\"") >&5
7656   (eval $ac_try) 2>&5
7657   ac_status=$?
7658   echo "$as_me:7658: \$? = $ac_status" >&5
7659   (exit $ac_status); }; }; then
7660   if test "$cross_compiling" = yes; then
7661   { { echo "$as_me:7661: error: cannot run test program while cross compiling" >&5
7662 echo "$as_me: error: cannot run test program while cross compiling" >&2;}
7663    { (exit 1); exit 1; }; }
7664 else
7665   cat >conftest.$ac_ext <<_ACEOF
7666 #line 7666 "configure"
7667 #include "confdefs.h"
7668 #include <${cf_cv_ncurses_header:-curses.h}>
7669                                 int main(void)
7670                                 { char *xx = curses_version(); return (xx == 0); }
7671 _ACEOF
7672 rm -f conftest$ac_exeext
7673 if { (eval echo "$as_me:7673: \"$ac_link\"") >&5
7674   (eval $ac_link) 2>&5
7675   ac_status=$?
7676   echo "$as_me:7676: \$? = $ac_status" >&5
7677   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
7678   { (eval echo "$as_me:7678: \"$ac_try\"") >&5
7679   (eval $ac_try) 2>&5
7680   ac_status=$?
7681   echo "$as_me:7681: \$? = $ac_status" >&5
7682   (exit $ac_status); }; }; then
7683   cf_have_ncuconfig=yes
7684 else
7685   echo "$as_me: program exited with status $ac_status" >&5
7686 echo "$as_me: failed program was:" >&5
7687 cat conftest.$ac_ext >&5
7688 cf_have_ncuconfig=no
7689 fi
7690 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
7691 fi
7692 else
7693   echo "$as_me: failed program was:" >&5
7694 cat conftest.$ac_ext >&5
7695 cf_have_ncuconfig=no
7696 fi
7697 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7698
7699                 echo "$as_me:7699: result: $cf_have_ncuconfig" >&5
7700 echo "${ECHO_T}$cf_have_ncuconfig" >&6
7701                 if test "$cf_have_ncuconfig" != "yes"
7702                 then
7703                         CPPFLAGS="$cf_save_CPPFLAGS"
7704                         LIBS="$cf_save_LIBS"
7705                         NCURSES_CONFIG_PKG=none
7706                 else
7707
7708 cat >>confdefs.h <<\EOF
7709 #define NCURSES 1
7710 EOF
7711
7712                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
7713                 fi
7714
7715         else
7716                 echo "$as_me:7716: result: no" >&5
7717 echo "${ECHO_T}no" >&6
7718                 NCURSES_CONFIG_PKG=none
7719         fi
7720 else
7721         NCURSES_CONFIG_PKG=none
7722 fi
7723
7724 if test "x$cf_have_ncuconfig" = "xno"; then
7725         echo "Looking for ${cf_ncuconfig_root}-config"
7726
7727 if test -n "$ac_tool_prefix"; then
7728   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7729   do
7730     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
7731 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
7732 echo "$as_me:7732: checking for $ac_word" >&5
7733 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7734 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
7735   echo $ECHO_N "(cached) $ECHO_C" >&6
7736 else
7737   if test -n "$NCURSES_CONFIG"; then
7738   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
7739 else
7740   ac_save_IFS=$IFS; IFS=$ac_path_separator
7741 ac_dummy="$PATH"
7742 for ac_dir in $ac_dummy; do
7743   IFS=$ac_save_IFS
7744   test -z "$ac_dir" && ac_dir=.
7745   $as_executable_p "$ac_dir/$ac_word" || continue
7746 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
7747 echo "$as_me:7747: found $ac_dir/$ac_word" >&5
7748 break
7749 done
7750
7751 fi
7752 fi
7753 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
7754 if test -n "$NCURSES_CONFIG"; then
7755   echo "$as_me:7755: result: $NCURSES_CONFIG" >&5
7756 echo "${ECHO_T}$NCURSES_CONFIG" >&6
7757 else
7758   echo "$as_me:7758: result: no" >&5
7759 echo "${ECHO_T}no" >&6
7760 fi
7761
7762     test -n "$NCURSES_CONFIG" && break
7763   done
7764 fi
7765 if test -z "$NCURSES_CONFIG"; then
7766   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
7767   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7768 do
7769   # Extract the first word of "$ac_prog", so it can be a program name with args.
7770 set dummy $ac_prog; ac_word=$2
7771 echo "$as_me:7771: checking for $ac_word" >&5
7772 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7773 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
7774   echo $ECHO_N "(cached) $ECHO_C" >&6
7775 else
7776   if test -n "$ac_ct_NCURSES_CONFIG"; then
7777   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
7778 else
7779   ac_save_IFS=$IFS; IFS=$ac_path_separator
7780 ac_dummy="$PATH"
7781 for ac_dir in $ac_dummy; do
7782   IFS=$ac_save_IFS
7783   test -z "$ac_dir" && ac_dir=.
7784   $as_executable_p "$ac_dir/$ac_word" || continue
7785 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
7786 echo "$as_me:7786: found $ac_dir/$ac_word" >&5
7787 break
7788 done
7789
7790 fi
7791 fi
7792 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
7793 if test -n "$ac_ct_NCURSES_CONFIG"; then
7794   echo "$as_me:7794: result: $ac_ct_NCURSES_CONFIG" >&5
7795 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
7796 else
7797   echo "$as_me:7797: result: no" >&5
7798 echo "${ECHO_T}no" >&6
7799 fi
7800
7801   test -n "$ac_ct_NCURSES_CONFIG" && break
7802 done
7803 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
7804
7805   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
7806 fi
7807
7808         if test "$NCURSES_CONFIG" != none ; then
7809
7810                 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
7811
7812 cf_add_libs="`$NCURSES_CONFIG --libs`"
7813 # Filter out duplicates - this happens with badly-designed ".pc" files...
7814 for cf_add_1lib in $LIBS
7815 do
7816         for cf_add_2lib in $cf_add_libs
7817         do
7818                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7819                 then
7820                         cf_add_1lib=
7821                         break
7822                 fi
7823         done
7824         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7825 done
7826 LIBS="$cf_add_libs"
7827
7828                 # even with config script, some packages use no-override for curses.h
7829
7830 echo "$as_me:7830: checking if we have identified curses headers" >&5
7831 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
7832 if test "${cf_cv_ncurses_header+set}" = set; then
7833   echo $ECHO_N "(cached) $ECHO_C" >&6
7834 else
7835
7836 cf_cv_ncurses_header=none
7837 for cf_header in \
7838         ncurses.h $cf_cv_screen/ncurses.h \
7839         curses.h $cf_cv_screen/curses.h
7840 do
7841 cat >conftest.$ac_ext <<_ACEOF
7842 #line 7842 "configure"
7843 #include "confdefs.h"
7844 #include <${cf_header}>
7845 int
7846 main ()
7847 {
7848 initscr(); tgoto("?", 0,0)
7849   ;
7850   return 0;
7851 }
7852 _ACEOF
7853 rm -f conftest.$ac_objext
7854 if { (eval echo "$as_me:7854: \"$ac_compile\"") >&5
7855   (eval $ac_compile) 2>&5
7856   ac_status=$?
7857   echo "$as_me:7857: \$? = $ac_status" >&5
7858   (exit $ac_status); } &&
7859          { ac_try='test -s conftest.$ac_objext'
7860   { (eval echo "$as_me:7860: \"$ac_try\"") >&5
7861   (eval $ac_try) 2>&5
7862   ac_status=$?
7863   echo "$as_me:7863: \$? = $ac_status" >&5
7864   (exit $ac_status); }; }; then
7865   cf_cv_ncurses_header=$cf_header; break
7866 else
7867   echo "$as_me: failed program was:" >&5
7868 cat conftest.$ac_ext >&5
7869 fi
7870 rm -f conftest.$ac_objext conftest.$ac_ext
7871 done
7872
7873 fi
7874 echo "$as_me:7874: result: $cf_cv_ncurses_header" >&5
7875 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
7876
7877 if test "$cf_cv_ncurses_header" = none ; then
7878         { { echo "$as_me:7878: error: No curses header-files found" >&5
7879 echo "$as_me: error: No curses header-files found" >&2;}
7880    { (exit 1); exit 1; }; }
7881 fi
7882
7883 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
7884
7885 for ac_header in $cf_cv_ncurses_header
7886 do
7887 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
7888 echo "$as_me:7888: checking for $ac_header" >&5
7889 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
7890 if eval "test \"\${$as_ac_Header+set}\" = set"; then
7891   echo $ECHO_N "(cached) $ECHO_C" >&6
7892 else
7893   cat >conftest.$ac_ext <<_ACEOF
7894 #line 7894 "configure"
7895 #include "confdefs.h"
7896 #include <$ac_header>
7897 _ACEOF
7898 if { (eval echo "$as_me:7898: \"$ac_cpp conftest.$ac_ext\"") >&5
7899   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
7900   ac_status=$?
7901   egrep -v '^ *\+' conftest.er1 >conftest.err
7902   rm -f conftest.er1
7903   cat conftest.err >&5
7904   echo "$as_me:7904: \$? = $ac_status" >&5
7905   (exit $ac_status); } >/dev/null; then
7906   if test -s conftest.err; then
7907     ac_cpp_err=$ac_c_preproc_warn_flag
7908   else
7909     ac_cpp_err=
7910   fi
7911 else
7912   ac_cpp_err=yes
7913 fi
7914 if test -z "$ac_cpp_err"; then
7915   eval "$as_ac_Header=yes"
7916 else
7917   echo "$as_me: failed program was:" >&5
7918   cat conftest.$ac_ext >&5
7919   eval "$as_ac_Header=no"
7920 fi
7921 rm -f conftest.err conftest.$ac_ext
7922 fi
7923 echo "$as_me:7923: result: `eval echo '${'$as_ac_Header'}'`" >&5
7924 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
7925 if test `eval echo '${'$as_ac_Header'}'` = yes; then
7926   cat >>confdefs.h <<EOF
7927 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
7928 EOF
7929
7930 fi
7931 done
7932
7933 cat >>confdefs.h <<\EOF
7934 #define NCURSES 1
7935 EOF
7936
7937 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
7938
7939                 cat >>confdefs.h <<EOF
7940 #define $cf_nculib_ROOT 1
7941 EOF
7942
7943                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
7944
7945         else
7946
7947 cf_ncuhdr_root=$cf_cv_screen
7948
7949 test -n "$cf_cv_curses_dir" && \
7950 test "$cf_cv_curses_dir" != "no" && { \
7951
7952 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
7953   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
7954   do
7955         while test $cf_add_incdir != /usr/include
7956         do
7957           if test -d $cf_add_incdir
7958           then
7959                 cf_have_incdir=no
7960                 if test -n "$CFLAGS$CPPFLAGS" ; then
7961                   # a loop is needed to ensure we can add subdirs of existing dirs
7962                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7963                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7964                           cf_have_incdir=yes; break
7965                         fi
7966                   done
7967                 fi
7968
7969                 if test "$cf_have_incdir" = no ; then
7970                   if test "$cf_add_incdir" = /usr/local/include ; then
7971                         if test "$GCC" = yes
7972                         then
7973                           cf_save_CPPFLAGS=$CPPFLAGS
7974                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7975                           cat >conftest.$ac_ext <<_ACEOF
7976 #line 7976 "configure"
7977 #include "confdefs.h"
7978 #include <stdio.h>
7979 int
7980 main ()
7981 {
7982 printf("Hello")
7983   ;
7984   return 0;
7985 }
7986 _ACEOF
7987 rm -f conftest.$ac_objext
7988 if { (eval echo "$as_me:7988: \"$ac_compile\"") >&5
7989   (eval $ac_compile) 2>&5
7990   ac_status=$?
7991   echo "$as_me:7991: \$? = $ac_status" >&5
7992   (exit $ac_status); } &&
7993          { ac_try='test -s conftest.$ac_objext'
7994   { (eval echo "$as_me:7994: \"$ac_try\"") >&5
7995   (eval $ac_try) 2>&5
7996   ac_status=$?
7997   echo "$as_me:7997: \$? = $ac_status" >&5
7998   (exit $ac_status); }; }; then
7999   :
8000 else
8001   echo "$as_me: failed program was:" >&5
8002 cat conftest.$ac_ext >&5
8003 cf_have_incdir=yes
8004 fi
8005 rm -f conftest.$ac_objext conftest.$ac_ext
8006                           CPPFLAGS=$cf_save_CPPFLAGS
8007                         fi
8008                   fi
8009                 fi
8010
8011                 if test "$cf_have_incdir" = no ; then
8012                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8013
8014 echo "${as_me:-configure}:8014: testing adding $cf_add_incdir to include-path ..." 1>&5
8015
8016                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8017
8018                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8019                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8020                   cf_add_incdir="$cf_top_incdir"
8021                 else
8022                   break
8023                 fi
8024           fi
8025         done
8026   done
8027 fi
8028
8029 }
8030
8031 echo "$as_me:8031: checking for $cf_ncuhdr_root header in include-path" >&5
8032 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
8033 if test "${cf_cv_ncurses_h+set}" = set; then
8034   echo $ECHO_N "(cached) $ECHO_C" >&6
8035 else
8036
8037         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
8038         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
8039         for cf_header in $cf_header_list
8040         do
8041
8042         cat >conftest.$ac_ext <<_ACEOF
8043 #line 8043 "configure"
8044 #include "confdefs.h"
8045
8046 #include <$cf_header>
8047 int
8048 main ()
8049 {
8050
8051 #ifdef NCURSES_VERSION
8052
8053 printf("%s\n", NCURSES_VERSION);
8054 #else
8055 #ifdef __NCURSES_H
8056 printf("old\n");
8057 #else
8058         make an error
8059 #endif
8060 #endif
8061
8062   ;
8063   return 0;
8064 }
8065 _ACEOF
8066 rm -f conftest.$ac_objext
8067 if { (eval echo "$as_me:8067: \"$ac_compile\"") >&5
8068   (eval $ac_compile) 2>&5
8069   ac_status=$?
8070   echo "$as_me:8070: \$? = $ac_status" >&5
8071   (exit $ac_status); } &&
8072          { ac_try='test -s conftest.$ac_objext'
8073   { (eval echo "$as_me:8073: \"$ac_try\"") >&5
8074   (eval $ac_try) 2>&5
8075   ac_status=$?
8076   echo "$as_me:8076: \$? = $ac_status" >&5
8077   (exit $ac_status); }; }; then
8078   cf_cv_ncurses_h=$cf_header
8079
8080 else
8081   echo "$as_me: failed program was:" >&5
8082 cat conftest.$ac_ext >&5
8083 cf_cv_ncurses_h=no
8084 fi
8085 rm -f conftest.$ac_objext conftest.$ac_ext
8086
8087                 test "$cf_cv_ncurses_h" != no && break
8088         done
8089
8090 fi
8091 echo "$as_me:8091: result: $cf_cv_ncurses_h" >&5
8092 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
8093
8094 if test "$cf_cv_ncurses_h" != no ; then
8095         cf_cv_ncurses_header=$cf_cv_ncurses_h
8096 else
8097
8098 echo "$as_me:8098: checking for $cf_ncuhdr_root include-path" >&5
8099 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
8100 if test "${cf_cv_ncurses_h2+set}" = set; then
8101   echo $ECHO_N "(cached) $ECHO_C" >&6
8102 else
8103
8104         test -n "$verbose" && echo
8105
8106 cf_search=
8107
8108 # collect the current set of include-directories from compiler flags
8109 cf_header_path_list=""
8110 if test -n "${CFLAGS}${CPPFLAGS}" ; then
8111         for cf_header_path in $CPPFLAGS $CFLAGS
8112         do
8113                 case $cf_header_path in
8114                 (-I*)
8115                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
8116
8117 test "x$cf_header_path" != "xNONE" && \
8118 test -d "$cf_header_path" && \
8119  {
8120         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
8121         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
8122         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
8123         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
8124         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
8125         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"
8126 }
8127
8128                         cf_header_path_list="$cf_header_path_list $cf_search"
8129                         ;;
8130                 esac
8131         done
8132 fi
8133
8134 # add the variations for the package we are looking for
8135
8136 cf_search=
8137
8138 test "x$prefix" != "xNONE" && \
8139 test -d "$prefix" && \
8140  {
8141         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
8142         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
8143         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
8144         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
8145         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
8146         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8147 }
8148
8149 for cf_subdir_prefix in \
8150         /usr \
8151         /usr/local \
8152         /usr/pkg \
8153         /opt \
8154         /opt/local \
8155         $HOME
8156 do
8157
8158 test "x$cf_subdir_prefix" != "x$prefix" && \
8159 test -d "$cf_subdir_prefix" && \
8160 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
8161         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
8162         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
8163         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
8164         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
8165         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
8166         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"
8167 }
8168
8169 done
8170
8171 test "$includedir" != NONE && \
8172 test "$includedir" != "/usr/include" && \
8173 test -d "$includedir" && {
8174         test -d $includedir &&    cf_search="$cf_search $includedir"
8175         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
8176 }
8177
8178 test "$oldincludedir" != NONE && \
8179 test "$oldincludedir" != "/usr/include" && \
8180 test -d "$oldincludedir" && {
8181         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
8182         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
8183 }
8184
8185 cf_search="$cf_search $cf_header_path_list"
8186
8187         test -n "$verbose" && echo search path $cf_search
8188         cf_save2_CPPFLAGS="$CPPFLAGS"
8189         for cf_incdir in $cf_search
8190         do
8191
8192 if test -n "$cf_incdir" ; then
8193   for cf_add_incdir in $cf_incdir
8194   do
8195         while test $cf_add_incdir != /usr/include
8196         do
8197           if test -d $cf_add_incdir
8198           then
8199                 cf_have_incdir=no
8200                 if test -n "$CFLAGS$CPPFLAGS" ; then
8201                   # a loop is needed to ensure we can add subdirs of existing dirs
8202                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8203                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8204                           cf_have_incdir=yes; break
8205                         fi
8206                   done
8207                 fi
8208
8209                 if test "$cf_have_incdir" = no ; then
8210                   if test "$cf_add_incdir" = /usr/local/include ; then
8211                         if test "$GCC" = yes
8212                         then
8213                           cf_save_CPPFLAGS=$CPPFLAGS
8214                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8215                           cat >conftest.$ac_ext <<_ACEOF
8216 #line 8216 "configure"
8217 #include "confdefs.h"
8218 #include <stdio.h>
8219 int
8220 main ()
8221 {
8222 printf("Hello")
8223   ;
8224   return 0;
8225 }
8226 _ACEOF
8227 rm -f conftest.$ac_objext
8228 if { (eval echo "$as_me:8228: \"$ac_compile\"") >&5
8229   (eval $ac_compile) 2>&5
8230   ac_status=$?
8231   echo "$as_me:8231: \$? = $ac_status" >&5
8232   (exit $ac_status); } &&
8233          { ac_try='test -s conftest.$ac_objext'
8234   { (eval echo "$as_me:8234: \"$ac_try\"") >&5
8235   (eval $ac_try) 2>&5
8236   ac_status=$?
8237   echo "$as_me:8237: \$? = $ac_status" >&5
8238   (exit $ac_status); }; }; then
8239   :
8240 else
8241   echo "$as_me: failed program was:" >&5
8242 cat conftest.$ac_ext >&5
8243 cf_have_incdir=yes
8244 fi
8245 rm -f conftest.$ac_objext conftest.$ac_ext
8246                           CPPFLAGS=$cf_save_CPPFLAGS
8247                         fi
8248                   fi
8249                 fi
8250
8251                 if test "$cf_have_incdir" = no ; then
8252                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8253
8254 echo "${as_me:-configure}:8254: testing adding $cf_add_incdir to include-path ..." 1>&5
8255
8256                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8257
8258                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8259                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8260                   cf_add_incdir="$cf_top_incdir"
8261                 else
8262                   break
8263                 fi
8264           fi
8265         done
8266   done
8267 fi
8268
8269                 for cf_header in \
8270                         ncurses.h \
8271                         curses.h
8272                 do
8273
8274         cat >conftest.$ac_ext <<_ACEOF
8275 #line 8275 "configure"
8276 #include "confdefs.h"
8277
8278 #include <$cf_header>
8279 int
8280 main ()
8281 {
8282
8283 #ifdef NCURSES_VERSION
8284
8285 printf("%s\n", NCURSES_VERSION);
8286 #else
8287 #ifdef __NCURSES_H
8288 printf("old\n");
8289 #else
8290         make an error
8291 #endif
8292 #endif
8293
8294   ;
8295   return 0;
8296 }
8297 _ACEOF
8298 rm -f conftest.$ac_objext
8299 if { (eval echo "$as_me:8299: \"$ac_compile\"") >&5
8300   (eval $ac_compile) 2>&5
8301   ac_status=$?
8302   echo "$as_me:8302: \$? = $ac_status" >&5
8303   (exit $ac_status); } &&
8304          { ac_try='test -s conftest.$ac_objext'
8305   { (eval echo "$as_me:8305: \"$ac_try\"") >&5
8306   (eval $ac_try) 2>&5
8307   ac_status=$?
8308   echo "$as_me:8308: \$? = $ac_status" >&5
8309   (exit $ac_status); }; }; then
8310   cf_cv_ncurses_h2=$cf_header
8311
8312 else
8313   echo "$as_me: failed program was:" >&5
8314 cat conftest.$ac_ext >&5
8315 cf_cv_ncurses_h2=no
8316 fi
8317 rm -f conftest.$ac_objext conftest.$ac_ext
8318
8319                         if test "$cf_cv_ncurses_h2" != no ; then
8320                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
8321                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
8322                                 break
8323                         fi
8324                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
8325                 done
8326                 CPPFLAGS="$cf_save2_CPPFLAGS"
8327                 test "$cf_cv_ncurses_h2" != no && break
8328         done
8329         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:8329: error: not found" >&5
8330 echo "$as_me: error: not found" >&2;}
8331    { (exit 1); exit 1; }; }
8332
8333 fi
8334 echo "$as_me:8334: result: $cf_cv_ncurses_h2" >&5
8335 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
8336
8337         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
8338         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
8339         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
8340                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
8341         fi
8342
8343 if test -n "$cf_1st_incdir" ; then
8344   for cf_add_incdir in $cf_1st_incdir
8345   do
8346         while test $cf_add_incdir != /usr/include
8347         do
8348           if test -d $cf_add_incdir
8349           then
8350                 cf_have_incdir=no
8351                 if test -n "$CFLAGS$CPPFLAGS" ; then
8352                   # a loop is needed to ensure we can add subdirs of existing dirs
8353                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8354                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8355                           cf_have_incdir=yes; break
8356                         fi
8357                   done
8358                 fi
8359
8360                 if test "$cf_have_incdir" = no ; then
8361                   if test "$cf_add_incdir" = /usr/local/include ; then
8362                         if test "$GCC" = yes
8363                         then
8364                           cf_save_CPPFLAGS=$CPPFLAGS
8365                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8366                           cat >conftest.$ac_ext <<_ACEOF
8367 #line 8367 "configure"
8368 #include "confdefs.h"
8369 #include <stdio.h>
8370 int
8371 main ()
8372 {
8373 printf("Hello")
8374   ;
8375   return 0;
8376 }
8377 _ACEOF
8378 rm -f conftest.$ac_objext
8379 if { (eval echo "$as_me:8379: \"$ac_compile\"") >&5
8380   (eval $ac_compile) 2>&5
8381   ac_status=$?
8382   echo "$as_me:8382: \$? = $ac_status" >&5
8383   (exit $ac_status); } &&
8384          { ac_try='test -s conftest.$ac_objext'
8385   { (eval echo "$as_me:8385: \"$ac_try\"") >&5
8386   (eval $ac_try) 2>&5
8387   ac_status=$?
8388   echo "$as_me:8388: \$? = $ac_status" >&5
8389   (exit $ac_status); }; }; then
8390   :
8391 else
8392   echo "$as_me: failed program was:" >&5
8393 cat conftest.$ac_ext >&5
8394 cf_have_incdir=yes
8395 fi
8396 rm -f conftest.$ac_objext conftest.$ac_ext
8397                           CPPFLAGS=$cf_save_CPPFLAGS
8398                         fi
8399                   fi
8400                 fi
8401
8402                 if test "$cf_have_incdir" = no ; then
8403                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8404
8405 echo "${as_me:-configure}:8405: testing adding $cf_add_incdir to include-path ..." 1>&5
8406
8407                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8408
8409                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8410                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8411                   cf_add_incdir="$cf_top_incdir"
8412                 else
8413                   break
8414                 fi
8415           fi
8416         done
8417   done
8418 fi
8419
8420 fi
8421
8422 # Set definitions to allow ifdef'ing for ncurses.h
8423
8424 case $cf_cv_ncurses_header in
8425 (*ncurses.h)
8426
8427 cat >>confdefs.h <<\EOF
8428 #define HAVE_NCURSES_H 1
8429 EOF
8430
8431         ;;
8432 esac
8433
8434 case $cf_cv_ncurses_header in
8435 (ncurses/curses.h|ncurses/ncurses.h)
8436
8437 cat >>confdefs.h <<\EOF
8438 #define HAVE_NCURSES_NCURSES_H 1
8439 EOF
8440
8441         ;;
8442 (ncursesw/curses.h|ncursesw/ncurses.h)
8443
8444 cat >>confdefs.h <<\EOF
8445 #define HAVE_NCURSESW_NCURSES_H 1
8446 EOF
8447
8448         ;;
8449 esac
8450
8451 echo "$as_me:8451: checking for terminfo header" >&5
8452 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
8453 if test "${cf_cv_term_header+set}" = set; then
8454   echo $ECHO_N "(cached) $ECHO_C" >&6
8455 else
8456
8457 case ${cf_cv_ncurses_header} in
8458 (*/ncurses.h|*/ncursesw.h)
8459         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
8460         ;;
8461 (*)
8462         cf_term_header=term.h
8463         ;;
8464 esac
8465
8466 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
8467 do
8468 cat >conftest.$ac_ext <<_ACEOF
8469 #line 8469 "configure"
8470 #include "confdefs.h"
8471 #include <stdio.h>
8472 #include <${cf_cv_ncurses_header:-curses.h}>
8473 #include <$cf_test>
8474
8475 int
8476 main ()
8477 {
8478 int x = auto_left_margin
8479   ;
8480   return 0;
8481 }
8482 _ACEOF
8483 rm -f conftest.$ac_objext
8484 if { (eval echo "$as_me:8484: \"$ac_compile\"") >&5
8485   (eval $ac_compile) 2>&5
8486   ac_status=$?
8487   echo "$as_me:8487: \$? = $ac_status" >&5
8488   (exit $ac_status); } &&
8489          { ac_try='test -s conftest.$ac_objext'
8490   { (eval echo "$as_me:8490: \"$ac_try\"") >&5
8491   (eval $ac_try) 2>&5
8492   ac_status=$?
8493   echo "$as_me:8493: \$? = $ac_status" >&5
8494   (exit $ac_status); }; }; then
8495
8496         cf_cv_term_header="$cf_test"
8497 else
8498   echo "$as_me: failed program was:" >&5
8499 cat conftest.$ac_ext >&5
8500
8501         cf_cv_term_header=unknown
8502
8503 fi
8504 rm -f conftest.$ac_objext conftest.$ac_ext
8505         test "$cf_cv_term_header" != unknown && break
8506 done
8507
8508 fi
8509 echo "$as_me:8509: result: $cf_cv_term_header" >&5
8510 echo "${ECHO_T}$cf_cv_term_header" >&6
8511
8512 # Set definitions to allow ifdef'ing to accommodate subdirectories
8513
8514 case $cf_cv_term_header in
8515 (*term.h)
8516
8517 cat >>confdefs.h <<\EOF
8518 #define HAVE_TERM_H 1
8519 EOF
8520
8521         ;;
8522 esac
8523
8524 case $cf_cv_term_header in
8525 (ncurses/term.h)
8526
8527 cat >>confdefs.h <<\EOF
8528 #define HAVE_NCURSES_TERM_H 1
8529 EOF
8530
8531         ;;
8532 (ncursesw/term.h)
8533
8534 cat >>confdefs.h <<\EOF
8535 #define HAVE_NCURSESW_TERM_H 1
8536 EOF
8537
8538         ;;
8539 esac
8540
8541 # some applications need this, but should check for NCURSES_VERSION
8542
8543 cat >>confdefs.h <<\EOF
8544 #define NCURSES 1
8545 EOF
8546
8547 echo "$as_me:8547: checking for ncurses version" >&5
8548 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
8549 if test "${cf_cv_ncurses_version+set}" = set; then
8550   echo $ECHO_N "(cached) $ECHO_C" >&6
8551 else
8552
8553         cf_cv_ncurses_version=no
8554         cf_tempfile=out$$
8555         rm -f $cf_tempfile
8556         if test "$cross_compiling" = yes; then
8557
8558         # This will not work if the preprocessor splits the line after the
8559         # Autoconf token.  The 'unproto' program does that.
8560         cat > conftest.$ac_ext <<EOF
8561 #include <${cf_cv_ncurses_header:-curses.h}>
8562 #undef Autoconf
8563 #ifdef NCURSES_VERSION
8564 Autoconf NCURSES_VERSION
8565 #else
8566 #ifdef __NCURSES_H
8567 Autoconf "old"
8568 #endif
8569 ;
8570 #endif
8571 EOF
8572         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
8573         { (eval echo "$as_me:8573: \"$cf_try\"") >&5
8574   (eval $cf_try) 2>&5
8575   ac_status=$?
8576   echo "$as_me:8576: \$? = $ac_status" >&5
8577   (exit $ac_status); }
8578         if test -f conftest.out ; then
8579                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
8580                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
8581                 rm -f conftest.out
8582         fi
8583
8584 else
8585   cat >conftest.$ac_ext <<_ACEOF
8586 #line 8586 "configure"
8587 #include "confdefs.h"
8588
8589 #include <${cf_cv_ncurses_header:-curses.h}>
8590 #include <stdio.h>
8591 int main()
8592 {
8593         FILE *fp = fopen("$cf_tempfile", "w");
8594 #ifdef NCURSES_VERSION
8595 # ifdef NCURSES_VERSION_PATCH
8596         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
8597 # else
8598         fprintf(fp, "%s\n", NCURSES_VERSION);
8599 # endif
8600 #else
8601 # ifdef __NCURSES_H
8602         fprintf(fp, "old\n");
8603 # else
8604         make an error
8605 # endif
8606 #endif
8607         ${cf_cv_main_return:-return}(0);
8608 }
8609 _ACEOF
8610 rm -f conftest$ac_exeext
8611 if { (eval echo "$as_me:8611: \"$ac_link\"") >&5
8612   (eval $ac_link) 2>&5
8613   ac_status=$?
8614   echo "$as_me:8614: \$? = $ac_status" >&5
8615   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
8616   { (eval echo "$as_me:8616: \"$ac_try\"") >&5
8617   (eval $ac_try) 2>&5
8618   ac_status=$?
8619   echo "$as_me:8619: \$? = $ac_status" >&5
8620   (exit $ac_status); }; }; then
8621
8622         cf_cv_ncurses_version=`cat $cf_tempfile`
8623 else
8624   echo "$as_me: program exited with status $ac_status" >&5
8625 echo "$as_me: failed program was:" >&5
8626 cat conftest.$ac_ext >&5
8627 fi
8628 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
8629 fi
8630         rm -f $cf_tempfile
8631
8632 fi
8633 echo "$as_me:8633: result: $cf_cv_ncurses_version" >&5
8634 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
8635 test "$cf_cv_ncurses_version" = no ||
8636 cat >>confdefs.h <<\EOF
8637 #define NCURSES 1
8638 EOF
8639
8640 cf_nculib_root=$cf_cv_screen
8641         # This works, except for the special case where we find gpm, but
8642         # ncurses is in a nonstandard location via $LIBS, and we really want
8643         # to link gpm.
8644 cf_ncurses_LIBS=""
8645 cf_ncurses_SAVE="$LIBS"
8646 echo "$as_me:8646: checking for Gpm_Open in -lgpm" >&5
8647 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
8648 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
8649   echo $ECHO_N "(cached) $ECHO_C" >&6
8650 else
8651   ac_check_lib_save_LIBS=$LIBS
8652 LIBS="-lgpm  $LIBS"
8653 cat >conftest.$ac_ext <<_ACEOF
8654 #line 8654 "configure"
8655 #include "confdefs.h"
8656
8657 /* Override any gcc2 internal prototype to avoid an error.  */
8658 #ifdef __cplusplus
8659 extern "C"
8660 #endif
8661 /* We use char because int might match the return type of a gcc2
8662    builtin and then its argument prototype would still apply.  */
8663 char Gpm_Open ();
8664 int
8665 main ()
8666 {
8667 Gpm_Open ();
8668   ;
8669   return 0;
8670 }
8671 _ACEOF
8672 rm -f conftest.$ac_objext conftest$ac_exeext
8673 if { (eval echo "$as_me:8673: \"$ac_link\"") >&5
8674   (eval $ac_link) 2>&5
8675   ac_status=$?
8676   echo "$as_me:8676: \$? = $ac_status" >&5
8677   (exit $ac_status); } &&
8678          { ac_try='test -s conftest$ac_exeext'
8679   { (eval echo "$as_me:8679: \"$ac_try\"") >&5
8680   (eval $ac_try) 2>&5
8681   ac_status=$?
8682   echo "$as_me:8682: \$? = $ac_status" >&5
8683   (exit $ac_status); }; }; then
8684   ac_cv_lib_gpm_Gpm_Open=yes
8685 else
8686   echo "$as_me: failed program was:" >&5
8687 cat conftest.$ac_ext >&5
8688 ac_cv_lib_gpm_Gpm_Open=no
8689 fi
8690 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8691 LIBS=$ac_check_lib_save_LIBS
8692 fi
8693 echo "$as_me:8693: result: $ac_cv_lib_gpm_Gpm_Open" >&5
8694 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
8695 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
8696   echo "$as_me:8696: checking for initscr in -lgpm" >&5
8697 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
8698 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
8699   echo $ECHO_N "(cached) $ECHO_C" >&6
8700 else
8701   ac_check_lib_save_LIBS=$LIBS
8702 LIBS="-lgpm  $LIBS"
8703 cat >conftest.$ac_ext <<_ACEOF
8704 #line 8704 "configure"
8705 #include "confdefs.h"
8706
8707 /* Override any gcc2 internal prototype to avoid an error.  */
8708 #ifdef __cplusplus
8709 extern "C"
8710 #endif
8711 /* We use char because int might match the return type of a gcc2
8712    builtin and then its argument prototype would still apply.  */
8713 char initscr ();
8714 int
8715 main ()
8716 {
8717 initscr ();
8718   ;
8719   return 0;
8720 }
8721 _ACEOF
8722 rm -f conftest.$ac_objext conftest$ac_exeext
8723 if { (eval echo "$as_me:8723: \"$ac_link\"") >&5
8724   (eval $ac_link) 2>&5
8725   ac_status=$?
8726   echo "$as_me:8726: \$? = $ac_status" >&5
8727   (exit $ac_status); } &&
8728          { ac_try='test -s conftest$ac_exeext'
8729   { (eval echo "$as_me:8729: \"$ac_try\"") >&5
8730   (eval $ac_try) 2>&5
8731   ac_status=$?
8732   echo "$as_me:8732: \$? = $ac_status" >&5
8733   (exit $ac_status); }; }; then
8734   ac_cv_lib_gpm_initscr=yes
8735 else
8736   echo "$as_me: failed program was:" >&5
8737 cat conftest.$ac_ext >&5
8738 ac_cv_lib_gpm_initscr=no
8739 fi
8740 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8741 LIBS=$ac_check_lib_save_LIBS
8742 fi
8743 echo "$as_me:8743: result: $ac_cv_lib_gpm_initscr" >&5
8744 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
8745 if test $ac_cv_lib_gpm_initscr = yes; then
8746   LIBS="$cf_ncurses_SAVE"
8747 else
8748   cf_ncurses_LIBS="-lgpm"
8749 fi
8750
8751 fi
8752
8753 case $host_os in
8754 (freebsd*)
8755         # This is only necessary if you are linking against an obsolete
8756         # version of ncurses (but it should do no harm, since it's static).
8757         if test "$cf_nculib_root" = ncurses ; then
8758                 echo "$as_me:8758: checking for tgoto in -lmytinfo" >&5
8759 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
8760 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
8761   echo $ECHO_N "(cached) $ECHO_C" >&6
8762 else
8763   ac_check_lib_save_LIBS=$LIBS
8764 LIBS="-lmytinfo  $LIBS"
8765 cat >conftest.$ac_ext <<_ACEOF
8766 #line 8766 "configure"
8767 #include "confdefs.h"
8768
8769 /* Override any gcc2 internal prototype to avoid an error.  */
8770 #ifdef __cplusplus
8771 extern "C"
8772 #endif
8773 /* We use char because int might match the return type of a gcc2
8774    builtin and then its argument prototype would still apply.  */
8775 char tgoto ();
8776 int
8777 main ()
8778 {
8779 tgoto ();
8780   ;
8781   return 0;
8782 }
8783 _ACEOF
8784 rm -f conftest.$ac_objext conftest$ac_exeext
8785 if { (eval echo "$as_me:8785: \"$ac_link\"") >&5
8786   (eval $ac_link) 2>&5
8787   ac_status=$?
8788   echo "$as_me:8788: \$? = $ac_status" >&5
8789   (exit $ac_status); } &&
8790          { ac_try='test -s conftest$ac_exeext'
8791   { (eval echo "$as_me:8791: \"$ac_try\"") >&5
8792   (eval $ac_try) 2>&5
8793   ac_status=$?
8794   echo "$as_me:8794: \$? = $ac_status" >&5
8795   (exit $ac_status); }; }; then
8796   ac_cv_lib_mytinfo_tgoto=yes
8797 else
8798   echo "$as_me: failed program was:" >&5
8799 cat conftest.$ac_ext >&5
8800 ac_cv_lib_mytinfo_tgoto=no
8801 fi
8802 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8803 LIBS=$ac_check_lib_save_LIBS
8804 fi
8805 echo "$as_me:8805: result: $ac_cv_lib_mytinfo_tgoto" >&5
8806 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
8807 if test $ac_cv_lib_mytinfo_tgoto = yes; then
8808   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
8809 fi
8810
8811         fi
8812         ;;
8813 esac
8814
8815 cf_add_libs="$cf_ncurses_LIBS"
8816 # Filter out duplicates - this happens with badly-designed ".pc" files...
8817 for cf_add_1lib in $LIBS
8818 do
8819         for cf_add_2lib in $cf_add_libs
8820         do
8821                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
8822                 then
8823                         cf_add_1lib=
8824                         break
8825                 fi
8826         done
8827         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
8828 done
8829 LIBS="$cf_add_libs"
8830
8831 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
8832 then
8833
8834 cf_add_libs="-l$cf_nculib_root"
8835 # Filter out duplicates - this happens with badly-designed ".pc" files...
8836 for cf_add_1lib in $LIBS
8837 do
8838         for cf_add_2lib in $cf_add_libs
8839         do
8840                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
8841                 then
8842                         cf_add_1lib=
8843                         break
8844                 fi
8845         done
8846         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
8847 done
8848 LIBS="$cf_add_libs"
8849
8850 else
8851
8852         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
8853         cf_libdir=""
8854         echo "$as_me:8854: checking for initscr" >&5
8855 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
8856 if test "${ac_cv_func_initscr+set}" = set; then
8857   echo $ECHO_N "(cached) $ECHO_C" >&6
8858 else
8859   cat >conftest.$ac_ext <<_ACEOF
8860 #line 8860 "configure"
8861 #include "confdefs.h"
8862 /* System header to define __stub macros and hopefully few prototypes,
8863     which can conflict with char initscr (); below.  */
8864 #include <assert.h>
8865 /* Override any gcc2 internal prototype to avoid an error.  */
8866 #ifdef __cplusplus
8867 extern "C"
8868 #endif
8869 /* We use char because int might match the return type of a gcc2
8870    builtin and then its argument prototype would still apply.  */
8871 char initscr ();
8872 char (*f) ();
8873
8874 int
8875 main ()
8876 {
8877 /* The GNU C library defines this for functions which it implements
8878     to always fail with ENOSYS.  Some functions are actually named
8879     something starting with __ and the normal name is an alias.  */
8880 #if defined (__stub_initscr) || defined (__stub___initscr)
8881 choke me
8882 #else
8883 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
8884 #endif
8885
8886   ;
8887   return 0;
8888 }
8889 _ACEOF
8890 rm -f conftest.$ac_objext conftest$ac_exeext
8891 if { (eval echo "$as_me:8891: \"$ac_link\"") >&5
8892   (eval $ac_link) 2>&5
8893   ac_status=$?
8894   echo "$as_me:8894: \$? = $ac_status" >&5
8895   (exit $ac_status); } &&
8896          { ac_try='test -s conftest$ac_exeext'
8897   { (eval echo "$as_me:8897: \"$ac_try\"") >&5
8898   (eval $ac_try) 2>&5
8899   ac_status=$?
8900   echo "$as_me:8900: \$? = $ac_status" >&5
8901   (exit $ac_status); }; }; then
8902   ac_cv_func_initscr=yes
8903 else
8904   echo "$as_me: failed program was:" >&5
8905 cat conftest.$ac_ext >&5
8906 ac_cv_func_initscr=no
8907 fi
8908 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8909 fi
8910 echo "$as_me:8910: result: $ac_cv_func_initscr" >&5
8911 echo "${ECHO_T}$ac_cv_func_initscr" >&6
8912 if test $ac_cv_func_initscr = yes; then
8913   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8914 else
8915
8916                 cf_save_LIBS="$LIBS"
8917                 echo "$as_me:8917: checking for initscr in -l$cf_nculib_root" >&5
8918 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
8919                 LIBS="-l$cf_nculib_root $LIBS"
8920                 cat >conftest.$ac_ext <<_ACEOF
8921 #line 8921 "configure"
8922 #include "confdefs.h"
8923 #include <${cf_cv_ncurses_header:-curses.h}>
8924 int
8925 main ()
8926 {
8927 initscr()
8928   ;
8929   return 0;
8930 }
8931 _ACEOF
8932 rm -f conftest.$ac_objext conftest$ac_exeext
8933 if { (eval echo "$as_me:8933: \"$ac_link\"") >&5
8934   (eval $ac_link) 2>&5
8935   ac_status=$?
8936   echo "$as_me:8936: \$? = $ac_status" >&5
8937   (exit $ac_status); } &&
8938          { ac_try='test -s conftest$ac_exeext'
8939   { (eval echo "$as_me:8939: \"$ac_try\"") >&5
8940   (eval $ac_try) 2>&5
8941   ac_status=$?
8942   echo "$as_me:8942: \$? = $ac_status" >&5
8943   (exit $ac_status); }; }; then
8944   echo "$as_me:8944: result: yes" >&5
8945 echo "${ECHO_T}yes" >&6
8946                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8947
8948 else
8949   echo "$as_me: failed program was:" >&5
8950 cat conftest.$ac_ext >&5
8951 echo "$as_me:8951: result: no" >&5
8952 echo "${ECHO_T}no" >&6
8953
8954 cf_search=
8955 cf_library_path_list=""
8956 if test -n "${LDFLAGS}${LIBS}" ; then
8957         for cf_library_path in $LDFLAGS $LIBS
8958         do
8959                 case $cf_library_path in
8960                 (-L*)
8961                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
8962
8963 test "x$cf_library_path" != "xNONE" && \
8964 test -d "$cf_library_path" && \
8965  {
8966         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
8967         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
8968         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
8969         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
8970         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
8971         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"
8972 }
8973
8974                         cf_library_path_list="$cf_library_path_list $cf_search"
8975                         ;;
8976                 esac
8977         done
8978 fi
8979
8980 cf_search=
8981
8982 test "x$prefix" != "xNONE" && \
8983 test -d "$prefix" && \
8984  {
8985         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
8986         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
8987         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
8988         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
8989         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
8990         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
8991 }
8992
8993 for cf_subdir_prefix in \
8994         /usr \
8995         /usr/local \
8996         /usr/pkg \
8997         /opt \
8998         /opt/local \
8999         $HOME
9000 do
9001
9002 test "x$cf_subdir_prefix" != "x$prefix" && \
9003 test -d "$cf_subdir_prefix" && \
9004 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
9005         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
9006         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
9007         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
9008         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
9009         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
9010         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"
9011 }
9012
9013 done
9014
9015 cf_search="$cf_library_path_list $cf_search"
9016
9017                         for cf_libdir in $cf_search
9018                         do
9019                                 echo "$as_me:9019: checking for -l$cf_nculib_root in $cf_libdir" >&5
9020 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
9021                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
9022                                 cat >conftest.$ac_ext <<_ACEOF
9023 #line 9023 "configure"
9024 #include "confdefs.h"
9025 #include <${cf_cv_ncurses_header:-curses.h}>
9026 int
9027 main ()
9028 {
9029 initscr()
9030   ;
9031   return 0;
9032 }
9033 _ACEOF
9034 rm -f conftest.$ac_objext conftest$ac_exeext
9035 if { (eval echo "$as_me:9035: \"$ac_link\"") >&5
9036   (eval $ac_link) 2>&5
9037   ac_status=$?
9038   echo "$as_me:9038: \$? = $ac_status" >&5
9039   (exit $ac_status); } &&
9040          { ac_try='test -s conftest$ac_exeext'
9041   { (eval echo "$as_me:9041: \"$ac_try\"") >&5
9042   (eval $ac_try) 2>&5
9043   ac_status=$?
9044   echo "$as_me:9044: \$? = $ac_status" >&5
9045   (exit $ac_status); }; }; then
9046   echo "$as_me:9046: result: yes" >&5
9047 echo "${ECHO_T}yes" >&6
9048                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9049                                          break
9050 else
9051   echo "$as_me: failed program was:" >&5
9052 cat conftest.$ac_ext >&5
9053 echo "$as_me:9053: result: no" >&5
9054 echo "${ECHO_T}no" >&6
9055                                          LIBS="$cf_save_LIBS"
9056 fi
9057 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9058                         done
9059
9060 fi
9061 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9062
9063 fi
9064
9065 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
9066
9067 if test $cf_found_library = no ; then
9068         { { echo "$as_me:9068: error: Cannot link $cf_nculib_root library" >&5
9069 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
9070    { (exit 1); exit 1; }; }
9071 fi
9072
9073 fi
9074
9075 if test -n "$cf_ncurses_LIBS" ; then
9076         echo "$as_me:9076: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
9077 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
9078         cf_ncurses_SAVE="$LIBS"
9079         for p in $cf_ncurses_LIBS ; do
9080                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
9081                 if test "$q" != "$LIBS" ; then
9082                         LIBS="$q"
9083                 fi
9084         done
9085         cat >conftest.$ac_ext <<_ACEOF
9086 #line 9086 "configure"
9087 #include "confdefs.h"
9088 #include <${cf_cv_ncurses_header:-curses.h}>
9089 int
9090 main ()
9091 {
9092 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
9093   ;
9094   return 0;
9095 }
9096 _ACEOF
9097 rm -f conftest.$ac_objext conftest$ac_exeext
9098 if { (eval echo "$as_me:9098: \"$ac_link\"") >&5
9099   (eval $ac_link) 2>&5
9100   ac_status=$?
9101   echo "$as_me:9101: \$? = $ac_status" >&5
9102   (exit $ac_status); } &&
9103          { ac_try='test -s conftest$ac_exeext'
9104   { (eval echo "$as_me:9104: \"$ac_try\"") >&5
9105   (eval $ac_try) 2>&5
9106   ac_status=$?
9107   echo "$as_me:9107: \$? = $ac_status" >&5
9108   (exit $ac_status); }; }; then
9109   echo "$as_me:9109: result: yes" >&5
9110 echo "${ECHO_T}yes" >&6
9111 else
9112   echo "$as_me: failed program was:" >&5
9113 cat conftest.$ac_ext >&5
9114 echo "$as_me:9114: result: no" >&5
9115 echo "${ECHO_T}no" >&6
9116                  LIBS="$cf_ncurses_SAVE"
9117 fi
9118 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9119 fi
9120
9121 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9122
9123 cat >>confdefs.h <<EOF
9124 #define $cf_nculib_ROOT 1
9125 EOF
9126
9127         fi
9128 else
9129         NCURSES_CONFIG=none
9130 fi
9131
9132         ;;
9133 (pdcurses)
9134         echo "$as_me:9134: checking for X" >&5
9135 echo $ECHO_N "checking for X... $ECHO_C" >&6
9136
9137 # Check whether --with-x or --without-x was given.
9138 if test "${with_x+set}" = set; then
9139   withval="$with_x"
9140
9141 fi;
9142 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
9143 if test "x$with_x" = xno; then
9144   # The user explicitly disabled X.
9145   have_x=disabled
9146 else
9147   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
9148     # Both variables are already set.
9149     have_x=yes
9150   else
9151     if test "${ac_cv_have_x+set}" = set; then
9152   echo $ECHO_N "(cached) $ECHO_C" >&6
9153 else
9154   # One or both of the vars are not set, and there is no cached value.
9155 ac_x_includes=no ac_x_libraries=no
9156 rm -fr conftest.dir
9157 if mkdir conftest.dir; then
9158   cd conftest.dir
9159   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
9160   cat >Imakefile <<'EOF'
9161 acfindx:
9162         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
9163 EOF
9164   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
9165     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
9166     eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
9167     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
9168     for ac_extension in a so sl dylib dll; do
9169       if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
9170          test -f $ac_im_libdir/libX11.$ac_extension; then
9171         ac_im_usrlibdir=$ac_im_libdir; break
9172       fi
9173     done
9174     # Screen out bogus values from the imake configuration.  They are
9175     # bogus both because they are the default anyway, and because
9176     # using them would break gcc on systems where it needs fixed includes.
9177     case $ac_im_incroot in
9178         /usr/include) ;;
9179         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
9180     esac
9181     case $ac_im_usrlibdir in
9182         /usr/lib | /lib) ;;
9183         *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
9184     esac
9185   fi
9186   cd ..
9187   rm -fr conftest.dir
9188 fi
9189
9190 # Standard set of common directories for X headers.
9191 # Check X11 before X11Rn because it is often a symlink to the current release.
9192 ac_x_header_dirs='
9193 /usr/X11/include
9194 /usr/X11R6/include
9195 /usr/X11R5/include
9196 /usr/X11R4/include
9197
9198 /usr/include/X11
9199 /usr/include/X11R6
9200 /usr/include/X11R5
9201 /usr/include/X11R4
9202
9203 /usr/local/X11/include
9204 /usr/local/X11R6/include
9205 /usr/local/X11R5/include
9206 /usr/local/X11R4/include
9207
9208 /usr/local/include/X11
9209 /usr/local/include/X11R6
9210 /usr/local/include/X11R5
9211 /usr/local/include/X11R4
9212
9213 /usr/X386/include
9214 /usr/x386/include
9215 /usr/XFree86/include/X11
9216
9217 /usr/include
9218 /usr/local/include
9219 /usr/unsupported/include
9220 /usr/athena/include
9221 /usr/local/x11r5/include
9222 /usr/lpp/Xamples/include
9223
9224 /usr/openwin/include
9225 /usr/openwin/share/include'
9226
9227 if test "$ac_x_includes" = no; then
9228   # Guess where to find include files, by looking for Intrinsic.h.
9229   # First, try using that file with no special directory specified.
9230   cat >conftest.$ac_ext <<_ACEOF
9231 #line 9231 "configure"
9232 #include "confdefs.h"
9233 #include <X11/Intrinsic.h>
9234 _ACEOF
9235 if { (eval echo "$as_me:9235: \"$ac_cpp conftest.$ac_ext\"") >&5
9236   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
9237   ac_status=$?
9238   egrep -v '^ *\+' conftest.er1 >conftest.err
9239   rm -f conftest.er1
9240   cat conftest.err >&5
9241   echo "$as_me:9241: \$? = $ac_status" >&5
9242   (exit $ac_status); } >/dev/null; then
9243   if test -s conftest.err; then
9244     ac_cpp_err=$ac_c_preproc_warn_flag
9245   else
9246     ac_cpp_err=
9247   fi
9248 else
9249   ac_cpp_err=yes
9250 fi
9251 if test -z "$ac_cpp_err"; then
9252   # We can compile using X headers with no special include directory.
9253 ac_x_includes=
9254 else
9255   echo "$as_me: failed program was:" >&5
9256   cat conftest.$ac_ext >&5
9257   for ac_dir in $ac_x_header_dirs; do
9258   if test -r "$ac_dir/X11/Intrinsic.h"; then
9259     ac_x_includes=$ac_dir
9260     break
9261   fi
9262 done
9263 fi
9264 rm -f conftest.err conftest.$ac_ext
9265 fi # $ac_x_includes = no
9266
9267 if test "$ac_x_libraries" = no; then
9268   # Check for the libraries.
9269   # See if we find them without any special options.
9270   # Don't add to $LIBS permanently.
9271   ac_save_LIBS=$LIBS
9272   LIBS="-lXt $LIBS"
9273   cat >conftest.$ac_ext <<_ACEOF
9274 #line 9274 "configure"
9275 #include "confdefs.h"
9276 #include <X11/Intrinsic.h>
9277 int
9278 main ()
9279 {
9280 XtMalloc (0)
9281   ;
9282   return 0;
9283 }
9284 _ACEOF
9285 rm -f conftest.$ac_objext conftest$ac_exeext
9286 if { (eval echo "$as_me:9286: \"$ac_link\"") >&5
9287   (eval $ac_link) 2>&5
9288   ac_status=$?
9289   echo "$as_me:9289: \$? = $ac_status" >&5
9290   (exit $ac_status); } &&
9291          { ac_try='test -s conftest$ac_exeext'
9292   { (eval echo "$as_me:9292: \"$ac_try\"") >&5
9293   (eval $ac_try) 2>&5
9294   ac_status=$?
9295   echo "$as_me:9295: \$? = $ac_status" >&5
9296   (exit $ac_status); }; }; then
9297   LIBS=$ac_save_LIBS
9298 # We can link X programs with no special library path.
9299 ac_x_libraries=
9300 else
9301   echo "$as_me: failed program was:" >&5
9302 cat conftest.$ac_ext >&5
9303 LIBS=$ac_save_LIBS
9304 for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
9305 do
9306   # Don't even attempt the hair of trying to link an X program!
9307   for ac_extension in a so sl dylib dll; do
9308     if test -r $ac_dir/libXt.$ac_extension; then
9309       ac_x_libraries=$ac_dir
9310       break 2
9311     fi
9312   done
9313 done
9314 fi
9315 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9316 fi # $ac_x_libraries = no
9317
9318 if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then
9319   # Didn't find X anywhere.  Cache the known absence of X.
9320   ac_cv_have_x="have_x=no"
9321 else
9322   # Record where we found X for the cache.
9323   ac_cv_have_x="have_x=yes \
9324                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
9325 fi
9326 fi
9327
9328   fi
9329   eval "$ac_cv_have_x"
9330 fi # $with_x != no
9331
9332 if test "$have_x" != yes; then
9333   echo "$as_me:9333: result: $have_x" >&5
9334 echo "${ECHO_T}$have_x" >&6
9335   no_x=yes
9336 else
9337   # If each of the values was on the command line, it overrides each guess.
9338   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
9339   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
9340   # Update the cache value to reflect the command line values.
9341   ac_cv_have_x="have_x=yes \
9342                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
9343   echo "$as_me:9343: result: libraries $x_libraries, headers $x_includes" >&5
9344 echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6
9345 fi
9346
9347 if test "$no_x" = yes; then
9348   # Not all programs may use this symbol, but it does not hurt to define it.
9349
9350 cat >>confdefs.h <<\EOF
9351 #define X_DISPLAY_MISSING 1
9352 EOF
9353
9354   X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
9355 else
9356   if test -n "$x_includes"; then
9357     X_CFLAGS="$X_CFLAGS -I$x_includes"
9358   fi
9359
9360   # It would also be nice to do this for all -L options, not just this one.
9361   if test -n "$x_libraries"; then
9362     X_LIBS="$X_LIBS -L$x_libraries"
9363     # For Solaris; some versions of Sun CC require a space after -R and
9364     # others require no space.  Words are not sufficient . . . .
9365     case `(uname -sr) 2>/dev/null` in
9366     "SunOS 5"*)
9367       echo "$as_me:9367: checking whether -R must be followed by a space" >&5
9368 echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6
9369       ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
9370       cat >conftest.$ac_ext <<_ACEOF
9371 #line 9371 "configure"
9372 #include "confdefs.h"
9373
9374 int
9375 main ()
9376 {
9377
9378   ;
9379   return 0;
9380 }
9381 _ACEOF
9382 rm -f conftest.$ac_objext conftest$ac_exeext
9383 if { (eval echo "$as_me:9383: \"$ac_link\"") >&5
9384   (eval $ac_link) 2>&5
9385   ac_status=$?
9386   echo "$as_me:9386: \$? = $ac_status" >&5
9387   (exit $ac_status); } &&
9388          { ac_try='test -s conftest$ac_exeext'
9389   { (eval echo "$as_me:9389: \"$ac_try\"") >&5
9390   (eval $ac_try) 2>&5
9391   ac_status=$?
9392   echo "$as_me:9392: \$? = $ac_status" >&5
9393   (exit $ac_status); }; }; then
9394   ac_R_nospace=yes
9395 else
9396   echo "$as_me: failed program was:" >&5
9397 cat conftest.$ac_ext >&5
9398 ac_R_nospace=no
9399 fi
9400 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9401       if test $ac_R_nospace = yes; then
9402         echo "$as_me:9402: result: no" >&5
9403 echo "${ECHO_T}no" >&6
9404         X_LIBS="$X_LIBS -R$x_libraries"
9405       else
9406         LIBS="$ac_xsave_LIBS -R $x_libraries"
9407         cat >conftest.$ac_ext <<_ACEOF
9408 #line 9408 "configure"
9409 #include "confdefs.h"
9410
9411 int
9412 main ()
9413 {
9414
9415   ;
9416   return 0;
9417 }
9418 _ACEOF
9419 rm -f conftest.$ac_objext conftest$ac_exeext
9420 if { (eval echo "$as_me:9420: \"$ac_link\"") >&5
9421   (eval $ac_link) 2>&5
9422   ac_status=$?
9423   echo "$as_me:9423: \$? = $ac_status" >&5
9424   (exit $ac_status); } &&
9425          { ac_try='test -s conftest$ac_exeext'
9426   { (eval echo "$as_me:9426: \"$ac_try\"") >&5
9427   (eval $ac_try) 2>&5
9428   ac_status=$?
9429   echo "$as_me:9429: \$? = $ac_status" >&5
9430   (exit $ac_status); }; }; then
9431   ac_R_space=yes
9432 else
9433   echo "$as_me: failed program was:" >&5
9434 cat conftest.$ac_ext >&5
9435 ac_R_space=no
9436 fi
9437 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9438         if test $ac_R_space = yes; then
9439           echo "$as_me:9439: result: yes" >&5
9440 echo "${ECHO_T}yes" >&6
9441           X_LIBS="$X_LIBS -R $x_libraries"
9442         else
9443           echo "$as_me:9443: result: neither works" >&5
9444 echo "${ECHO_T}neither works" >&6
9445         fi
9446       fi
9447       LIBS=$ac_xsave_LIBS
9448     esac
9449   fi
9450
9451   # Check for system-dependent libraries X programs must link with.
9452   # Do this before checking for the system-independent R6 libraries
9453   # (-lICE), since we may need -lsocket or whatever for X linking.
9454
9455   if test "$ISC" = yes; then
9456     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
9457   else
9458     # Martyn Johnson says this is needed for Ultrix, if the X
9459     # libraries were built with DECnet support.  And Karl Berry says
9460     # the Alpha needs dnet_stub (dnet does not exist).
9461     ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
9462     cat >conftest.$ac_ext <<_ACEOF
9463 #line 9463 "configure"
9464 #include "confdefs.h"
9465
9466 /* Override any gcc2 internal prototype to avoid an error.  */
9467 #ifdef __cplusplus
9468 extern "C"
9469 #endif
9470 /* We use char because int might match the return type of a gcc2
9471    builtin and then its argument prototype would still apply.  */
9472 char XOpenDisplay ();
9473 int
9474 main ()
9475 {
9476 XOpenDisplay ();
9477   ;
9478   return 0;
9479 }
9480 _ACEOF
9481 rm -f conftest.$ac_objext conftest$ac_exeext
9482 if { (eval echo "$as_me:9482: \"$ac_link\"") >&5
9483   (eval $ac_link) 2>&5
9484   ac_status=$?
9485   echo "$as_me:9485: \$? = $ac_status" >&5
9486   (exit $ac_status); } &&
9487          { ac_try='test -s conftest$ac_exeext'
9488   { (eval echo "$as_me:9488: \"$ac_try\"") >&5
9489   (eval $ac_try) 2>&5
9490   ac_status=$?
9491   echo "$as_me:9491: \$? = $ac_status" >&5
9492   (exit $ac_status); }; }; then
9493   :
9494 else
9495   echo "$as_me: failed program was:" >&5
9496 cat conftest.$ac_ext >&5
9497 echo "$as_me:9497: checking for dnet_ntoa in -ldnet" >&5
9498 echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6
9499 if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then
9500   echo $ECHO_N "(cached) $ECHO_C" >&6
9501 else
9502   ac_check_lib_save_LIBS=$LIBS
9503 LIBS="-ldnet  $LIBS"
9504 cat >conftest.$ac_ext <<_ACEOF
9505 #line 9505 "configure"
9506 #include "confdefs.h"
9507
9508 /* Override any gcc2 internal prototype to avoid an error.  */
9509 #ifdef __cplusplus
9510 extern "C"
9511 #endif
9512 /* We use char because int might match the return type of a gcc2
9513    builtin and then its argument prototype would still apply.  */
9514 char dnet_ntoa ();
9515 int
9516 main ()
9517 {
9518 dnet_ntoa ();
9519   ;
9520   return 0;
9521 }
9522 _ACEOF
9523 rm -f conftest.$ac_objext conftest$ac_exeext
9524 if { (eval echo "$as_me:9524: \"$ac_link\"") >&5
9525   (eval $ac_link) 2>&5
9526   ac_status=$?
9527   echo "$as_me:9527: \$? = $ac_status" >&5
9528   (exit $ac_status); } &&
9529          { ac_try='test -s conftest$ac_exeext'
9530   { (eval echo "$as_me:9530: \"$ac_try\"") >&5
9531   (eval $ac_try) 2>&5
9532   ac_status=$?
9533   echo "$as_me:9533: \$? = $ac_status" >&5
9534   (exit $ac_status); }; }; then
9535   ac_cv_lib_dnet_dnet_ntoa=yes
9536 else
9537   echo "$as_me: failed program was:" >&5
9538 cat conftest.$ac_ext >&5
9539 ac_cv_lib_dnet_dnet_ntoa=no
9540 fi
9541 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9542 LIBS=$ac_check_lib_save_LIBS
9543 fi
9544 echo "$as_me:9544: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
9545 echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6
9546 if test $ac_cv_lib_dnet_dnet_ntoa = yes; then
9547   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
9548 fi
9549
9550     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
9551       echo "$as_me:9551: checking for dnet_ntoa in -ldnet_stub" >&5
9552 echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6
9553 if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then
9554   echo $ECHO_N "(cached) $ECHO_C" >&6
9555 else
9556   ac_check_lib_save_LIBS=$LIBS
9557 LIBS="-ldnet_stub  $LIBS"
9558 cat >conftest.$ac_ext <<_ACEOF
9559 #line 9559 "configure"
9560 #include "confdefs.h"
9561
9562 /* Override any gcc2 internal prototype to avoid an error.  */
9563 #ifdef __cplusplus
9564 extern "C"
9565 #endif
9566 /* We use char because int might match the return type of a gcc2
9567    builtin and then its argument prototype would still apply.  */
9568 char dnet_ntoa ();
9569 int
9570 main ()
9571 {
9572 dnet_ntoa ();
9573   ;
9574   return 0;
9575 }
9576 _ACEOF
9577 rm -f conftest.$ac_objext conftest$ac_exeext
9578 if { (eval echo "$as_me:9578: \"$ac_link\"") >&5
9579   (eval $ac_link) 2>&5
9580   ac_status=$?
9581   echo "$as_me:9581: \$? = $ac_status" >&5
9582   (exit $ac_status); } &&
9583          { ac_try='test -s conftest$ac_exeext'
9584   { (eval echo "$as_me:9584: \"$ac_try\"") >&5
9585   (eval $ac_try) 2>&5
9586   ac_status=$?
9587   echo "$as_me:9587: \$? = $ac_status" >&5
9588   (exit $ac_status); }; }; then
9589   ac_cv_lib_dnet_stub_dnet_ntoa=yes
9590 else
9591   echo "$as_me: failed program was:" >&5
9592 cat conftest.$ac_ext >&5
9593 ac_cv_lib_dnet_stub_dnet_ntoa=no
9594 fi
9595 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9596 LIBS=$ac_check_lib_save_LIBS
9597 fi
9598 echo "$as_me:9598: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
9599 echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6
9600 if test $ac_cv_lib_dnet_stub_dnet_ntoa = yes; then
9601   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
9602 fi
9603
9604     fi
9605 fi
9606 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9607     LIBS="$ac_xsave_LIBS"
9608
9609     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
9610     # to get the SysV transport functions.
9611     # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4)
9612     # needs -lnsl.
9613     # The nsl library prevents programs from opening the X display
9614     # on Irix 5.2, according to T.E. Dickey.
9615     # The functions gethostbyname, getservbyname, and inet_addr are
9616     # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
9617     echo "$as_me:9617: checking for gethostbyname" >&5
9618 echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6
9619 if test "${ac_cv_func_gethostbyname+set}" = set; then
9620   echo $ECHO_N "(cached) $ECHO_C" >&6
9621 else
9622   cat >conftest.$ac_ext <<_ACEOF
9623 #line 9623 "configure"
9624 #include "confdefs.h"
9625 /* System header to define __stub macros and hopefully few prototypes,
9626     which can conflict with char gethostbyname (); below.  */
9627 #include <assert.h>
9628 /* Override any gcc2 internal prototype to avoid an error.  */
9629 #ifdef __cplusplus
9630 extern "C"
9631 #endif
9632 /* We use char because int might match the return type of a gcc2
9633    builtin and then its argument prototype would still apply.  */
9634 char gethostbyname ();
9635 char (*f) ();
9636
9637 int
9638 main ()
9639 {
9640 /* The GNU C library defines this for functions which it implements
9641     to always fail with ENOSYS.  Some functions are actually named
9642     something starting with __ and the normal name is an alias.  */
9643 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
9644 choke me
9645 #else
9646 f = gethostbyname; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
9647 #endif
9648
9649   ;
9650   return 0;
9651 }
9652 _ACEOF
9653 rm -f conftest.$ac_objext conftest$ac_exeext
9654 if { (eval echo "$as_me:9654: \"$ac_link\"") >&5
9655   (eval $ac_link) 2>&5
9656   ac_status=$?
9657   echo "$as_me:9657: \$? = $ac_status" >&5
9658   (exit $ac_status); } &&
9659          { ac_try='test -s conftest$ac_exeext'
9660   { (eval echo "$as_me:9660: \"$ac_try\"") >&5
9661   (eval $ac_try) 2>&5
9662   ac_status=$?
9663   echo "$as_me:9663: \$? = $ac_status" >&5
9664   (exit $ac_status); }; }; then
9665   ac_cv_func_gethostbyname=yes
9666 else
9667   echo "$as_me: failed program was:" >&5
9668 cat conftest.$ac_ext >&5
9669 ac_cv_func_gethostbyname=no
9670 fi
9671 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9672 fi
9673 echo "$as_me:9673: result: $ac_cv_func_gethostbyname" >&5
9674 echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6
9675
9676     if test $ac_cv_func_gethostbyname = no; then
9677       echo "$as_me:9677: checking for gethostbyname in -lnsl" >&5
9678 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6
9679 if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
9680   echo $ECHO_N "(cached) $ECHO_C" >&6
9681 else
9682   ac_check_lib_save_LIBS=$LIBS
9683 LIBS="-lnsl  $LIBS"
9684 cat >conftest.$ac_ext <<_ACEOF
9685 #line 9685 "configure"
9686 #include "confdefs.h"
9687
9688 /* Override any gcc2 internal prototype to avoid an error.  */
9689 #ifdef __cplusplus
9690 extern "C"
9691 #endif
9692 /* We use char because int might match the return type of a gcc2
9693    builtin and then its argument prototype would still apply.  */
9694 char gethostbyname ();
9695 int
9696 main ()
9697 {
9698 gethostbyname ();
9699   ;
9700   return 0;
9701 }
9702 _ACEOF
9703 rm -f conftest.$ac_objext conftest$ac_exeext
9704 if { (eval echo "$as_me:9704: \"$ac_link\"") >&5
9705   (eval $ac_link) 2>&5
9706   ac_status=$?
9707   echo "$as_me:9707: \$? = $ac_status" >&5
9708   (exit $ac_status); } &&
9709          { ac_try='test -s conftest$ac_exeext'
9710   { (eval echo "$as_me:9710: \"$ac_try\"") >&5
9711   (eval $ac_try) 2>&5
9712   ac_status=$?
9713   echo "$as_me:9713: \$? = $ac_status" >&5
9714   (exit $ac_status); }; }; then
9715   ac_cv_lib_nsl_gethostbyname=yes
9716 else
9717   echo "$as_me: failed program was:" >&5
9718 cat conftest.$ac_ext >&5
9719 ac_cv_lib_nsl_gethostbyname=no
9720 fi
9721 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9722 LIBS=$ac_check_lib_save_LIBS
9723 fi
9724 echo "$as_me:9724: result: $ac_cv_lib_nsl_gethostbyname" >&5
9725 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6
9726 if test $ac_cv_lib_nsl_gethostbyname = yes; then
9727   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
9728 fi
9729
9730       if test $ac_cv_lib_nsl_gethostbyname = no; then
9731         echo "$as_me:9731: checking for gethostbyname in -lbsd" >&5
9732 echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6
9733 if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then
9734   echo $ECHO_N "(cached) $ECHO_C" >&6
9735 else
9736   ac_check_lib_save_LIBS=$LIBS
9737 LIBS="-lbsd  $LIBS"
9738 cat >conftest.$ac_ext <<_ACEOF
9739 #line 9739 "configure"
9740 #include "confdefs.h"
9741
9742 /* Override any gcc2 internal prototype to avoid an error.  */
9743 #ifdef __cplusplus
9744 extern "C"
9745 #endif
9746 /* We use char because int might match the return type of a gcc2
9747    builtin and then its argument prototype would still apply.  */
9748 char gethostbyname ();
9749 int
9750 main ()
9751 {
9752 gethostbyname ();
9753   ;
9754   return 0;
9755 }
9756 _ACEOF
9757 rm -f conftest.$ac_objext conftest$ac_exeext
9758 if { (eval echo "$as_me:9758: \"$ac_link\"") >&5
9759   (eval $ac_link) 2>&5
9760   ac_status=$?
9761   echo "$as_me:9761: \$? = $ac_status" >&5
9762   (exit $ac_status); } &&
9763          { ac_try='test -s conftest$ac_exeext'
9764   { (eval echo "$as_me:9764: \"$ac_try\"") >&5
9765   (eval $ac_try) 2>&5
9766   ac_status=$?
9767   echo "$as_me:9767: \$? = $ac_status" >&5
9768   (exit $ac_status); }; }; then
9769   ac_cv_lib_bsd_gethostbyname=yes
9770 else
9771   echo "$as_me: failed program was:" >&5
9772 cat conftest.$ac_ext >&5
9773 ac_cv_lib_bsd_gethostbyname=no
9774 fi
9775 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9776 LIBS=$ac_check_lib_save_LIBS
9777 fi
9778 echo "$as_me:9778: result: $ac_cv_lib_bsd_gethostbyname" >&5
9779 echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6
9780 if test $ac_cv_lib_bsd_gethostbyname = yes; then
9781   X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
9782 fi
9783
9784       fi
9785     fi
9786
9787     # lieder@skyler.mavd.honeywell.com says without -lsocket,
9788     # socket/setsockopt and other routines are undefined under SCO ODT
9789     # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
9790     # on later versions), says Simon Leinen: it contains gethostby*
9791     # variants that don't use the nameserver (or something).  -lsocket
9792     # must be given before -lnsl if both are needed.  We assume that
9793     # if connect needs -lnsl, so does gethostbyname.
9794     echo "$as_me:9794: checking for connect" >&5
9795 echo $ECHO_N "checking for connect... $ECHO_C" >&6
9796 if test "${ac_cv_func_connect+set}" = set; then
9797   echo $ECHO_N "(cached) $ECHO_C" >&6
9798 else
9799   cat >conftest.$ac_ext <<_ACEOF
9800 #line 9800 "configure"
9801 #include "confdefs.h"
9802 /* System header to define __stub macros and hopefully few prototypes,
9803     which can conflict with char connect (); below.  */
9804 #include <assert.h>
9805 /* Override any gcc2 internal prototype to avoid an error.  */
9806 #ifdef __cplusplus
9807 extern "C"
9808 #endif
9809 /* We use char because int might match the return type of a gcc2
9810    builtin and then its argument prototype would still apply.  */
9811 char connect ();
9812 char (*f) ();
9813
9814 int
9815 main ()
9816 {
9817 /* The GNU C library defines this for functions which it implements
9818     to always fail with ENOSYS.  Some functions are actually named
9819     something starting with __ and the normal name is an alias.  */
9820 #if defined (__stub_connect) || defined (__stub___connect)
9821 choke me
9822 #else
9823 f = connect; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
9824 #endif
9825
9826   ;
9827   return 0;
9828 }
9829 _ACEOF
9830 rm -f conftest.$ac_objext conftest$ac_exeext
9831 if { (eval echo "$as_me:9831: \"$ac_link\"") >&5
9832   (eval $ac_link) 2>&5
9833   ac_status=$?
9834   echo "$as_me:9834: \$? = $ac_status" >&5
9835   (exit $ac_status); } &&
9836          { ac_try='test -s conftest$ac_exeext'
9837   { (eval echo "$as_me:9837: \"$ac_try\"") >&5
9838   (eval $ac_try) 2>&5
9839   ac_status=$?
9840   echo "$as_me:9840: \$? = $ac_status" >&5
9841   (exit $ac_status); }; }; then
9842   ac_cv_func_connect=yes
9843 else
9844   echo "$as_me: failed program was:" >&5
9845 cat conftest.$ac_ext >&5
9846 ac_cv_func_connect=no
9847 fi
9848 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9849 fi
9850 echo "$as_me:9850: result: $ac_cv_func_connect" >&5
9851 echo "${ECHO_T}$ac_cv_func_connect" >&6
9852
9853     if test $ac_cv_func_connect = no; then
9854       echo "$as_me:9854: checking for connect in -lsocket" >&5
9855 echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6
9856 if test "${ac_cv_lib_socket_connect+set}" = set; then
9857   echo $ECHO_N "(cached) $ECHO_C" >&6
9858 else
9859   ac_check_lib_save_LIBS=$LIBS
9860 LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
9861 cat >conftest.$ac_ext <<_ACEOF
9862 #line 9862 "configure"
9863 #include "confdefs.h"
9864
9865 /* Override any gcc2 internal prototype to avoid an error.  */
9866 #ifdef __cplusplus
9867 extern "C"
9868 #endif
9869 /* We use char because int might match the return type of a gcc2
9870    builtin and then its argument prototype would still apply.  */
9871 char connect ();
9872 int
9873 main ()
9874 {
9875 connect ();
9876   ;
9877   return 0;
9878 }
9879 _ACEOF
9880 rm -f conftest.$ac_objext conftest$ac_exeext
9881 if { (eval echo "$as_me:9881: \"$ac_link\"") >&5
9882   (eval $ac_link) 2>&5
9883   ac_status=$?
9884   echo "$as_me:9884: \$? = $ac_status" >&5
9885   (exit $ac_status); } &&
9886          { ac_try='test -s conftest$ac_exeext'
9887   { (eval echo "$as_me:9887: \"$ac_try\"") >&5
9888   (eval $ac_try) 2>&5
9889   ac_status=$?
9890   echo "$as_me:9890: \$? = $ac_status" >&5
9891   (exit $ac_status); }; }; then
9892   ac_cv_lib_socket_connect=yes
9893 else
9894   echo "$as_me: failed program was:" >&5
9895 cat conftest.$ac_ext >&5
9896 ac_cv_lib_socket_connect=no
9897 fi
9898 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9899 LIBS=$ac_check_lib_save_LIBS
9900 fi
9901 echo "$as_me:9901: result: $ac_cv_lib_socket_connect" >&5
9902 echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6
9903 if test $ac_cv_lib_socket_connect = yes; then
9904   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
9905 fi
9906
9907     fi
9908
9909     # Guillermo Gomez says -lposix is necessary on A/UX.
9910     echo "$as_me:9910: checking for remove" >&5
9911 echo $ECHO_N "checking for remove... $ECHO_C" >&6
9912 if test "${ac_cv_func_remove+set}" = set; then
9913   echo $ECHO_N "(cached) $ECHO_C" >&6
9914 else
9915   cat >conftest.$ac_ext <<_ACEOF
9916 #line 9916 "configure"
9917 #include "confdefs.h"
9918 /* System header to define __stub macros and hopefully few prototypes,
9919     which can conflict with char remove (); below.  */
9920 #include <assert.h>
9921 /* Override any gcc2 internal prototype to avoid an error.  */
9922 #ifdef __cplusplus
9923 extern "C"
9924 #endif
9925 /* We use char because int might match the return type of a gcc2
9926    builtin and then its argument prototype would still apply.  */
9927 char remove ();
9928 char (*f) ();
9929
9930 int
9931 main ()
9932 {
9933 /* The GNU C library defines this for functions which it implements
9934     to always fail with ENOSYS.  Some functions are actually named
9935     something starting with __ and the normal name is an alias.  */
9936 #if defined (__stub_remove) || defined (__stub___remove)
9937 choke me
9938 #else
9939 f = remove; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
9940 #endif
9941
9942   ;
9943   return 0;
9944 }
9945 _ACEOF
9946 rm -f conftest.$ac_objext conftest$ac_exeext
9947 if { (eval echo "$as_me:9947: \"$ac_link\"") >&5
9948   (eval $ac_link) 2>&5
9949   ac_status=$?
9950   echo "$as_me:9950: \$? = $ac_status" >&5
9951   (exit $ac_status); } &&
9952          { ac_try='test -s conftest$ac_exeext'
9953   { (eval echo "$as_me:9953: \"$ac_try\"") >&5
9954   (eval $ac_try) 2>&5
9955   ac_status=$?
9956   echo "$as_me:9956: \$? = $ac_status" >&5
9957   (exit $ac_status); }; }; then
9958   ac_cv_func_remove=yes
9959 else
9960   echo "$as_me: failed program was:" >&5
9961 cat conftest.$ac_ext >&5
9962 ac_cv_func_remove=no
9963 fi
9964 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9965 fi
9966 echo "$as_me:9966: result: $ac_cv_func_remove" >&5
9967 echo "${ECHO_T}$ac_cv_func_remove" >&6
9968
9969     if test $ac_cv_func_remove = no; then
9970       echo "$as_me:9970: checking for remove in -lposix" >&5
9971 echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6
9972 if test "${ac_cv_lib_posix_remove+set}" = set; then
9973   echo $ECHO_N "(cached) $ECHO_C" >&6
9974 else
9975   ac_check_lib_save_LIBS=$LIBS
9976 LIBS="-lposix  $LIBS"
9977 cat >conftest.$ac_ext <<_ACEOF
9978 #line 9978 "configure"
9979 #include "confdefs.h"
9980
9981 /* Override any gcc2 internal prototype to avoid an error.  */
9982 #ifdef __cplusplus
9983 extern "C"
9984 #endif
9985 /* We use char because int might match the return type of a gcc2
9986    builtin and then its argument prototype would still apply.  */
9987 char remove ();
9988 int
9989 main ()
9990 {
9991 remove ();
9992   ;
9993   return 0;
9994 }
9995 _ACEOF
9996 rm -f conftest.$ac_objext conftest$ac_exeext
9997 if { (eval echo "$as_me:9997: \"$ac_link\"") >&5
9998   (eval $ac_link) 2>&5
9999   ac_status=$?
10000   echo "$as_me:10000: \$? = $ac_status" >&5
10001   (exit $ac_status); } &&
10002          { ac_try='test -s conftest$ac_exeext'
10003   { (eval echo "$as_me:10003: \"$ac_try\"") >&5
10004   (eval $ac_try) 2>&5
10005   ac_status=$?
10006   echo "$as_me:10006: \$? = $ac_status" >&5
10007   (exit $ac_status); }; }; then
10008   ac_cv_lib_posix_remove=yes
10009 else
10010   echo "$as_me: failed program was:" >&5
10011 cat conftest.$ac_ext >&5
10012 ac_cv_lib_posix_remove=no
10013 fi
10014 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10015 LIBS=$ac_check_lib_save_LIBS
10016 fi
10017 echo "$as_me:10017: result: $ac_cv_lib_posix_remove" >&5
10018 echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6
10019 if test $ac_cv_lib_posix_remove = yes; then
10020   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
10021 fi
10022
10023     fi
10024
10025     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
10026     echo "$as_me:10026: checking for shmat" >&5
10027 echo $ECHO_N "checking for shmat... $ECHO_C" >&6
10028 if test "${ac_cv_func_shmat+set}" = set; then
10029   echo $ECHO_N "(cached) $ECHO_C" >&6
10030 else
10031   cat >conftest.$ac_ext <<_ACEOF
10032 #line 10032 "configure"
10033 #include "confdefs.h"
10034 /* System header to define __stub macros and hopefully few prototypes,
10035     which can conflict with char shmat (); below.  */
10036 #include <assert.h>
10037 /* Override any gcc2 internal prototype to avoid an error.  */
10038 #ifdef __cplusplus
10039 extern "C"
10040 #endif
10041 /* We use char because int might match the return type of a gcc2
10042    builtin and then its argument prototype would still apply.  */
10043 char shmat ();
10044 char (*f) ();
10045
10046 int
10047 main ()
10048 {
10049 /* The GNU C library defines this for functions which it implements
10050     to always fail with ENOSYS.  Some functions are actually named
10051     something starting with __ and the normal name is an alias.  */
10052 #if defined (__stub_shmat) || defined (__stub___shmat)
10053 choke me
10054 #else
10055 f = shmat; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
10056 #endif
10057
10058   ;
10059   return 0;
10060 }
10061 _ACEOF
10062 rm -f conftest.$ac_objext conftest$ac_exeext
10063 if { (eval echo "$as_me:10063: \"$ac_link\"") >&5
10064   (eval $ac_link) 2>&5
10065   ac_status=$?
10066   echo "$as_me:10066: \$? = $ac_status" >&5
10067   (exit $ac_status); } &&
10068          { ac_try='test -s conftest$ac_exeext'
10069   { (eval echo "$as_me:10069: \"$ac_try\"") >&5
10070   (eval $ac_try) 2>&5
10071   ac_status=$?
10072   echo "$as_me:10072: \$? = $ac_status" >&5
10073   (exit $ac_status); }; }; then
10074   ac_cv_func_shmat=yes
10075 else
10076   echo "$as_me: failed program was:" >&5
10077 cat conftest.$ac_ext >&5
10078 ac_cv_func_shmat=no
10079 fi
10080 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10081 fi
10082 echo "$as_me:10082: result: $ac_cv_func_shmat" >&5
10083 echo "${ECHO_T}$ac_cv_func_shmat" >&6
10084
10085     if test $ac_cv_func_shmat = no; then
10086       echo "$as_me:10086: checking for shmat in -lipc" >&5
10087 echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6
10088 if test "${ac_cv_lib_ipc_shmat+set}" = set; then
10089   echo $ECHO_N "(cached) $ECHO_C" >&6
10090 else
10091   ac_check_lib_save_LIBS=$LIBS
10092 LIBS="-lipc  $LIBS"
10093 cat >conftest.$ac_ext <<_ACEOF
10094 #line 10094 "configure"
10095 #include "confdefs.h"
10096
10097 /* Override any gcc2 internal prototype to avoid an error.  */
10098 #ifdef __cplusplus
10099 extern "C"
10100 #endif
10101 /* We use char because int might match the return type of a gcc2
10102    builtin and then its argument prototype would still apply.  */
10103 char shmat ();
10104 int
10105 main ()
10106 {
10107 shmat ();
10108   ;
10109   return 0;
10110 }
10111 _ACEOF
10112 rm -f conftest.$ac_objext conftest$ac_exeext
10113 if { (eval echo "$as_me:10113: \"$ac_link\"") >&5
10114   (eval $ac_link) 2>&5
10115   ac_status=$?
10116   echo "$as_me:10116: \$? = $ac_status" >&5
10117   (exit $ac_status); } &&
10118          { ac_try='test -s conftest$ac_exeext'
10119   { (eval echo "$as_me:10119: \"$ac_try\"") >&5
10120   (eval $ac_try) 2>&5
10121   ac_status=$?
10122   echo "$as_me:10122: \$? = $ac_status" >&5
10123   (exit $ac_status); }; }; then
10124   ac_cv_lib_ipc_shmat=yes
10125 else
10126   echo "$as_me: failed program was:" >&5
10127 cat conftest.$ac_ext >&5
10128 ac_cv_lib_ipc_shmat=no
10129 fi
10130 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10131 LIBS=$ac_check_lib_save_LIBS
10132 fi
10133 echo "$as_me:10133: result: $ac_cv_lib_ipc_shmat" >&5
10134 echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6
10135 if test $ac_cv_lib_ipc_shmat = yes; then
10136   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
10137 fi
10138
10139     fi
10140   fi
10141
10142   # Check for libraries that X11R6 Xt/Xaw programs need.
10143   ac_save_LDFLAGS=$LDFLAGS
10144   test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
10145   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
10146   # check for ICE first), but we must link in the order -lSM -lICE or
10147   # we get undefined symbols.  So assume we have SM if we have ICE.
10148   # These have to be linked with before -lX11, unlike the other
10149   # libraries we check for below, so use a different variable.
10150   # John Interrante, Karl Berry
10151   echo "$as_me:10151: checking for IceConnectionNumber in -lICE" >&5
10152 echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6
10153 if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then
10154   echo $ECHO_N "(cached) $ECHO_C" >&6
10155 else
10156   ac_check_lib_save_LIBS=$LIBS
10157 LIBS="-lICE $X_EXTRA_LIBS $LIBS"
10158 cat >conftest.$ac_ext <<_ACEOF
10159 #line 10159 "configure"
10160 #include "confdefs.h"
10161
10162 /* Override any gcc2 internal prototype to avoid an error.  */
10163 #ifdef __cplusplus
10164 extern "C"
10165 #endif
10166 /* We use char because int might match the return type of a gcc2
10167    builtin and then its argument prototype would still apply.  */
10168 char IceConnectionNumber ();
10169 int
10170 main ()
10171 {
10172 IceConnectionNumber ();
10173   ;
10174   return 0;
10175 }
10176 _ACEOF
10177 rm -f conftest.$ac_objext conftest$ac_exeext
10178 if { (eval echo "$as_me:10178: \"$ac_link\"") >&5
10179   (eval $ac_link) 2>&5
10180   ac_status=$?
10181   echo "$as_me:10181: \$? = $ac_status" >&5
10182   (exit $ac_status); } &&
10183          { ac_try='test -s conftest$ac_exeext'
10184   { (eval echo "$as_me:10184: \"$ac_try\"") >&5
10185   (eval $ac_try) 2>&5
10186   ac_status=$?
10187   echo "$as_me:10187: \$? = $ac_status" >&5
10188   (exit $ac_status); }; }; then
10189   ac_cv_lib_ICE_IceConnectionNumber=yes
10190 else
10191   echo "$as_me: failed program was:" >&5
10192 cat conftest.$ac_ext >&5
10193 ac_cv_lib_ICE_IceConnectionNumber=no
10194 fi
10195 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10196 LIBS=$ac_check_lib_save_LIBS
10197 fi
10198 echo "$as_me:10198: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
10199 echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6
10200 if test $ac_cv_lib_ICE_IceConnectionNumber = yes; then
10201   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
10202 fi
10203
10204   LDFLAGS=$ac_save_LDFLAGS
10205
10206 fi
10207
10208 cf_x_athena=${cf_x_athena:-Xaw}
10209
10210 echo "$as_me:10210: checking if you want to link with Xaw 3d library" >&5
10211 echo $ECHO_N "checking if you want to link with Xaw 3d library... $ECHO_C" >&6
10212 withval=
10213
10214 # Check whether --with-Xaw3d or --without-Xaw3d was given.
10215 if test "${with_Xaw3d+set}" = set; then
10216   withval="$with_Xaw3d"
10217
10218 fi;
10219 if test "$withval" = yes ; then
10220         cf_x_athena=Xaw3d
10221         echo "$as_me:10221: result: yes" >&5
10222 echo "${ECHO_T}yes" >&6
10223 else
10224         echo "$as_me:10224: result: no" >&5
10225 echo "${ECHO_T}no" >&6
10226 fi
10227
10228 echo "$as_me:10228: checking if you want to link with Xaw 3d xft library" >&5
10229 echo $ECHO_N "checking if you want to link with Xaw 3d xft library... $ECHO_C" >&6
10230 withval=
10231
10232 # Check whether --with-Xaw3dxft or --without-Xaw3dxft was given.
10233 if test "${with_Xaw3dxft+set}" = set; then
10234   withval="$with_Xaw3dxft"
10235
10236 fi;
10237 if test "$withval" = yes ; then
10238         cf_x_athena=Xaw3dxft
10239         echo "$as_me:10239: result: yes" >&5
10240 echo "${ECHO_T}yes" >&6
10241 else
10242         echo "$as_me:10242: result: no" >&5
10243 echo "${ECHO_T}no" >&6
10244 fi
10245
10246 echo "$as_me:10246: checking if you want to link with neXT Athena library" >&5
10247 echo $ECHO_N "checking if you want to link with neXT Athena library... $ECHO_C" >&6
10248 withval=
10249
10250 # Check whether --with-neXtaw or --without-neXtaw was given.
10251 if test "${with_neXtaw+set}" = set; then
10252   withval="$with_neXtaw"
10253
10254 fi;
10255 if test "$withval" = yes ; then
10256         cf_x_athena=neXtaw
10257         echo "$as_me:10257: result: yes" >&5
10258 echo "${ECHO_T}yes" >&6
10259 else
10260         echo "$as_me:10260: result: no" >&5
10261 echo "${ECHO_T}no" >&6
10262 fi
10263
10264 echo "$as_me:10264: checking if you want to link with Athena-Plus library" >&5
10265 echo $ECHO_N "checking if you want to link with Athena-Plus library... $ECHO_C" >&6
10266 withval=
10267
10268 # Check whether --with-XawPlus or --without-XawPlus was given.
10269 if test "${with_XawPlus+set}" = set; then
10270   withval="$with_XawPlus"
10271
10272 fi;
10273 if test "$withval" = yes ; then
10274         cf_x_athena=XawPlus
10275         echo "$as_me:10275: result: yes" >&5
10276 echo "${ECHO_T}yes" >&6
10277 else
10278         echo "$as_me:10278: result: no" >&5
10279 echo "${ECHO_T}no" >&6
10280 fi
10281
10282 cf_x_athena_lib=""
10283
10284 if test "$PKG_CONFIG" != none ; then
10285         cf_athena_list=
10286         test "$cf_x_athena" = Xaw && cf_athena_list="xaw8 xaw7 xaw6"
10287         for cf_athena_pkg in \
10288                 $cf_athena_list \
10289                 ${cf_x_athena} \
10290                 ${cf_x_athena}-devel \
10291                 lib${cf_x_athena} \
10292                 lib${cf_x_athena}-devel
10293         do
10294
10295 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists $cf_athena_pkg; then
10296         test -n "$verbose" && echo "    found package $cf_athena_pkg" 1>&6
10297
10298 echo "${as_me:-configure}:10298: testing found package $cf_athena_pkg ..." 1>&5
10299
10300         cf_pkgconfig_incs="`$PKG_CONFIG --cflags $cf_athena_pkg 2>/dev/null`"
10301         cf_pkgconfig_libs="`$PKG_CONFIG --libs   $cf_athena_pkg 2>/dev/null`"
10302         test -n "$verbose" && echo "    package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs" 1>&6
10303
10304 echo "${as_me:-configure}:10304: testing package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs ..." 1>&5
10305
10306         test -n "$verbose" && echo "    package $cf_athena_pkg LIBS: $cf_pkgconfig_libs" 1>&6
10307
10308 echo "${as_me:-configure}:10308: testing package $cf_athena_pkg LIBS: $cf_pkgconfig_libs ..." 1>&5
10309
10310 cf_fix_cppflags=no
10311 cf_new_cflags=
10312 cf_new_cppflags=
10313 cf_new_extra_cppflags=
10314
10315 for cf_add_cflags in $cf_pkgconfig_incs
10316 do
10317 case $cf_fix_cppflags in
10318 (no)
10319         case $cf_add_cflags in
10320         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10321                 case $cf_add_cflags in
10322                 (-D*)
10323                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10324
10325                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10326                                 && test -z "${cf_tst_cflags}" \
10327                                 && cf_fix_cppflags=yes
10328
10329                         if test $cf_fix_cppflags = yes ; then
10330                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10331                                 continue
10332                         elif test "${cf_tst_cflags}" = "\"'" ; then
10333                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10334                                 continue
10335                         fi
10336                         ;;
10337                 esac
10338                 case "$CPPFLAGS" in
10339                 (*$cf_add_cflags)
10340                         ;;
10341                 (*)
10342                         case $cf_add_cflags in
10343                         (-D*)
10344                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10345
10346 CPPFLAGS=`echo "$CPPFLAGS" | \
10347         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10348                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10349
10350                                 ;;
10351                         esac
10352                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10353                         ;;
10354                 esac
10355                 ;;
10356         (*)
10357                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10358                 ;;
10359         esac
10360         ;;
10361 (yes)
10362         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10363
10364         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10365
10366         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10367                 && test -z "${cf_tst_cflags}" \
10368                 && cf_fix_cppflags=no
10369         ;;
10370 esac
10371 done
10372
10373 if test -n "$cf_new_cflags" ; then
10374
10375         CFLAGS="$CFLAGS $cf_new_cflags"
10376 fi
10377
10378 if test -n "$cf_new_cppflags" ; then
10379
10380         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10381 fi
10382
10383 if test -n "$cf_new_extra_cppflags" ; then
10384
10385         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10386 fi
10387
10388 cf_add_libs="$cf_pkgconfig_libs"
10389 # Filter out duplicates - this happens with badly-designed ".pc" files...
10390 for cf_add_1lib in $LIBS
10391 do
10392         for cf_add_2lib in $cf_add_libs
10393         do
10394                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
10395                 then
10396                         cf_add_1lib=
10397                         break
10398                 fi
10399         done
10400         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
10401 done
10402 LIBS="$cf_add_libs"
10403
10404                         cf_x_athena_lib="$cf_pkgconfig_libs"
10405
10406 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
10407
10408                         cat >>confdefs.h <<EOF
10409 #define $cf_x_athena_LIBS 1
10410 EOF
10411
10412         for cf_trim_lib in Xmu Xt X11
10413         do
10414                 case "$LIBS" in
10415                 (*-l$cf_trim_lib\ *-l$cf_trim_lib*)
10416                         LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
10417                         test -n "$verbose" && echo "    ..trimmed $LIBS" 1>&6
10418
10419 echo "${as_me:-configure}:10419: testing ..trimmed $LIBS ..." 1>&5
10420
10421                         ;;
10422                 esac
10423         done
10424
10425 echo "$as_me:10425: checking for usable $cf_x_athena/Xmu package" >&5
10426 echo $ECHO_N "checking for usable $cf_x_athena/Xmu package... $ECHO_C" >&6
10427 if test "${cf_cv_xaw_compat+set}" = set; then
10428   echo $ECHO_N "(cached) $ECHO_C" >&6
10429 else
10430
10431 cat >conftest.$ac_ext <<_ACEOF
10432 #line 10432 "configure"
10433 #include "confdefs.h"
10434
10435 #include <X11/Xmu/CharSet.h>
10436
10437 int
10438 main ()
10439 {
10440
10441 int check = XmuCompareISOLatin1("big", "small")
10442
10443   ;
10444   return 0;
10445 }
10446 _ACEOF
10447 rm -f conftest.$ac_objext conftest$ac_exeext
10448 if { (eval echo "$as_me:10448: \"$ac_link\"") >&5
10449   (eval $ac_link) 2>&5
10450   ac_status=$?
10451   echo "$as_me:10451: \$? = $ac_status" >&5
10452   (exit $ac_status); } &&
10453          { ac_try='test -s conftest$ac_exeext'
10454   { (eval echo "$as_me:10454: \"$ac_try\"") >&5
10455   (eval $ac_try) 2>&5
10456   ac_status=$?
10457   echo "$as_me:10457: \$? = $ac_status" >&5
10458   (exit $ac_status); }; }; then
10459   cf_cv_xaw_compat=yes
10460 else
10461   echo "$as_me: failed program was:" >&5
10462 cat conftest.$ac_ext >&5
10463 cf_cv_xaw_compat=no
10464 fi
10465 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10466 fi
10467 echo "$as_me:10467: result: $cf_cv_xaw_compat" >&5
10468 echo "${ECHO_T}$cf_cv_xaw_compat" >&6
10469
10470                         if test "$cf_cv_xaw_compat" = no
10471                         then
10472                                 # workaround for broken ".pc" files...
10473                                 case "$cf_x_athena_lib" in
10474                                 (*-lXmu*)
10475                                         ;;
10476                                 (*)
10477                                         test -n "$verbose" && echo "    work around broken package" 1>&6
10478
10479 echo "${as_me:-configure}:10479: testing work around broken package ..." 1>&5
10480
10481                                         cf_save_xmu="$LIBS"
10482                                         cf_first_lib=`echo "$cf_save_xmu" | sed -e 's/^  *//' -e 's/ .*//'`
10483
10484 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xmu; then
10485         test -n "$verbose" && echo "    found package xmu" 1>&6
10486
10487 echo "${as_me:-configure}:10487: testing found package xmu ..." 1>&5
10488
10489         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xmu 2>/dev/null`"
10490         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xmu 2>/dev/null`"
10491         test -n "$verbose" && echo "    package xmu CFLAGS: $cf_pkgconfig_incs" 1>&6
10492
10493 echo "${as_me:-configure}:10493: testing package xmu CFLAGS: $cf_pkgconfig_incs ..." 1>&5
10494
10495         test -n "$verbose" && echo "    package xmu LIBS: $cf_pkgconfig_libs" 1>&6
10496
10497 echo "${as_me:-configure}:10497: testing package xmu LIBS: $cf_pkgconfig_libs ..." 1>&5
10498
10499 cf_fix_cppflags=no
10500 cf_new_cflags=
10501 cf_new_cppflags=
10502 cf_new_extra_cppflags=
10503
10504 for cf_add_cflags in $cf_pkgconfig_incs
10505 do
10506 case $cf_fix_cppflags in
10507 (no)
10508         case $cf_add_cflags in
10509         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10510                 case $cf_add_cflags in
10511                 (-D*)
10512                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10513
10514                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10515                                 && test -z "${cf_tst_cflags}" \
10516                                 && cf_fix_cppflags=yes
10517
10518                         if test $cf_fix_cppflags = yes ; then
10519                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10520                                 continue
10521                         elif test "${cf_tst_cflags}" = "\"'" ; then
10522                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10523                                 continue
10524                         fi
10525                         ;;
10526                 esac
10527                 case "$CPPFLAGS" in
10528                 (*$cf_add_cflags)
10529                         ;;
10530                 (*)
10531                         case $cf_add_cflags in
10532                         (-D*)
10533                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10534
10535 CPPFLAGS=`echo "$CPPFLAGS" | \
10536         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10537                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10538
10539                                 ;;
10540                         esac
10541                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10542                         ;;
10543                 esac
10544                 ;;
10545         (*)
10546                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10547                 ;;
10548         esac
10549         ;;
10550 (yes)
10551         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10552
10553         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10554
10555         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10556                 && test -z "${cf_tst_cflags}" \
10557                 && cf_fix_cppflags=no
10558         ;;
10559 esac
10560 done
10561
10562 if test -n "$cf_new_cflags" ; then
10563
10564         CFLAGS="$CFLAGS $cf_new_cflags"
10565 fi
10566
10567 if test -n "$cf_new_cppflags" ; then
10568
10569         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10570 fi
10571
10572 if test -n "$cf_new_extra_cppflags" ; then
10573
10574         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10575 fi
10576
10577 cf_add_libs="$cf_pkgconfig_libs"
10578 # Filter out duplicates - this happens with badly-designed ".pc" files...
10579 for cf_add_1lib in $LIBS
10580 do
10581         for cf_add_2lib in $cf_add_libs
10582         do
10583                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
10584                 then
10585                         cf_add_1lib=
10586                         break
10587                 fi
10588         done
10589         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
10590 done
10591 LIBS="$cf_add_libs"
10592
10593                                                         LIBS="$cf_save_xmu"
10594
10595 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
10596
10597 echo "${as_me:-configure}:10597: testing ...before $LIBS ..." 1>&5
10598
10599 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib $cf_pkgconfig_libs %" -e 's%  % %g'`
10600 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
10601
10602 echo "${as_me:-configure}:10602: testing ...after  $LIBS ..." 1>&5
10603
10604 else
10605         cf_pkgconfig_incs=
10606         cf_pkgconfig_libs=
10607
10608 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
10609
10610 echo "${as_me:-configure}:10610: testing ...before $LIBS ..." 1>&5
10611
10612 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib -lXmu %" -e 's%  % %g'`
10613 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
10614
10615 echo "${as_me:-configure}:10615: testing ...after  $LIBS ..." 1>&5
10616
10617 fi
10618
10619         for cf_trim_lib in Xmu Xt X11
10620         do
10621                 case "$LIBS" in
10622                 (*-l$cf_trim_lib\ *-l$cf_trim_lib*)
10623                         LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
10624                         test -n "$verbose" && echo "    ..trimmed $LIBS" 1>&6
10625
10626 echo "${as_me:-configure}:10626: testing ..trimmed $LIBS ..." 1>&5
10627
10628                         ;;
10629                 esac
10630         done
10631
10632                                         ;;
10633                                 esac
10634                         fi
10635
10636                         break
10637 else
10638         cf_pkgconfig_incs=
10639         cf_pkgconfig_libs=
10640         :
10641 fi
10642
10643         done
10644 fi
10645
10646 if test -z "$cf_x_athena_lib" ; then
10647
10648 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists Xext; then
10649         test -n "$verbose" && echo "    found package Xext" 1>&6
10650
10651 echo "${as_me:-configure}:10651: testing found package Xext ..." 1>&5
10652
10653         cf_pkgconfig_incs="`$PKG_CONFIG --cflags Xext 2>/dev/null`"
10654         cf_pkgconfig_libs="`$PKG_CONFIG --libs   Xext 2>/dev/null`"
10655         test -n "$verbose" && echo "    package Xext CFLAGS: $cf_pkgconfig_incs" 1>&6
10656
10657 echo "${as_me:-configure}:10657: testing package Xext CFLAGS: $cf_pkgconfig_incs ..." 1>&5
10658
10659         test -n "$verbose" && echo "    package Xext LIBS: $cf_pkgconfig_libs" 1>&6
10660
10661 echo "${as_me:-configure}:10661: testing package Xext LIBS: $cf_pkgconfig_libs ..." 1>&5
10662
10663 cf_fix_cppflags=no
10664 cf_new_cflags=
10665 cf_new_cppflags=
10666 cf_new_extra_cppflags=
10667
10668 for cf_add_cflags in $cf_pkgconfig_incs
10669 do
10670 case $cf_fix_cppflags in
10671 (no)
10672         case $cf_add_cflags in
10673         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10674                 case $cf_add_cflags in
10675                 (-D*)
10676                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10677
10678                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10679                                 && test -z "${cf_tst_cflags}" \
10680                                 && cf_fix_cppflags=yes
10681
10682                         if test $cf_fix_cppflags = yes ; then
10683                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10684                                 continue
10685                         elif test "${cf_tst_cflags}" = "\"'" ; then
10686                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10687                                 continue
10688                         fi
10689                         ;;
10690                 esac
10691                 case "$CPPFLAGS" in
10692                 (*$cf_add_cflags)
10693                         ;;
10694                 (*)
10695                         case $cf_add_cflags in
10696                         (-D*)
10697                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10698
10699 CPPFLAGS=`echo "$CPPFLAGS" | \
10700         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10701                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10702
10703                                 ;;
10704                         esac
10705                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10706                         ;;
10707                 esac
10708                 ;;
10709         (*)
10710                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10711                 ;;
10712         esac
10713         ;;
10714 (yes)
10715         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10716
10717         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10718
10719         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10720                 && test -z "${cf_tst_cflags}" \
10721                 && cf_fix_cppflags=no
10722         ;;
10723 esac
10724 done
10725
10726 if test -n "$cf_new_cflags" ; then
10727
10728         CFLAGS="$CFLAGS $cf_new_cflags"
10729 fi
10730
10731 if test -n "$cf_new_cppflags" ; then
10732
10733         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10734 fi
10735
10736 if test -n "$cf_new_extra_cppflags" ; then
10737
10738         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10739 fi
10740
10741 cf_add_libs="$cf_pkgconfig_libs"
10742 # Filter out duplicates - this happens with badly-designed ".pc" files...
10743 for cf_add_1lib in $LIBS
10744 do
10745         for cf_add_2lib in $cf_add_libs
10746         do
10747                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
10748                 then
10749                         cf_add_1lib=
10750                         break
10751                 fi
10752         done
10753         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
10754 done
10755 LIBS="$cf_add_libs"
10756
10757         :
10758 else
10759         cf_pkgconfig_incs=
10760         cf_pkgconfig_libs=
10761
10762         echo "$as_me:10762: checking for XextCreateExtension in -lXext" >&5
10763 echo $ECHO_N "checking for XextCreateExtension in -lXext... $ECHO_C" >&6
10764 if test "${ac_cv_lib_Xext_XextCreateExtension+set}" = set; then
10765   echo $ECHO_N "(cached) $ECHO_C" >&6
10766 else
10767   ac_check_lib_save_LIBS=$LIBS
10768 LIBS="-lXext  $LIBS"
10769 cat >conftest.$ac_ext <<_ACEOF
10770 #line 10770 "configure"
10771 #include "confdefs.h"
10772
10773 /* Override any gcc2 internal prototype to avoid an error.  */
10774 #ifdef __cplusplus
10775 extern "C"
10776 #endif
10777 /* We use char because int might match the return type of a gcc2
10778    builtin and then its argument prototype would still apply.  */
10779 char XextCreateExtension ();
10780 int
10781 main ()
10782 {
10783 XextCreateExtension ();
10784   ;
10785   return 0;
10786 }
10787 _ACEOF
10788 rm -f conftest.$ac_objext conftest$ac_exeext
10789 if { (eval echo "$as_me:10789: \"$ac_link\"") >&5
10790   (eval $ac_link) 2>&5
10791   ac_status=$?
10792   echo "$as_me:10792: \$? = $ac_status" >&5
10793   (exit $ac_status); } &&
10794          { ac_try='test -s conftest$ac_exeext'
10795   { (eval echo "$as_me:10795: \"$ac_try\"") >&5
10796   (eval $ac_try) 2>&5
10797   ac_status=$?
10798   echo "$as_me:10798: \$? = $ac_status" >&5
10799   (exit $ac_status); }; }; then
10800   ac_cv_lib_Xext_XextCreateExtension=yes
10801 else
10802   echo "$as_me: failed program was:" >&5
10803 cat conftest.$ac_ext >&5
10804 ac_cv_lib_Xext_XextCreateExtension=no
10805 fi
10806 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10807 LIBS=$ac_check_lib_save_LIBS
10808 fi
10809 echo "$as_me:10809: result: $ac_cv_lib_Xext_XextCreateExtension" >&5
10810 echo "${ECHO_T}$ac_cv_lib_Xext_XextCreateExtension" >&6
10811 if test $ac_cv_lib_Xext_XextCreateExtension = yes; then
10812
10813 cf_add_libs="-lXext"
10814 # Filter out duplicates - this happens with badly-designed ".pc" files...
10815 for cf_add_1lib in $LIBS
10816 do
10817         for cf_add_2lib in $cf_add_libs
10818         do
10819                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
10820                 then
10821                         cf_add_1lib=
10822                         break
10823                 fi
10824         done
10825         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
10826 done
10827 LIBS="$cf_add_libs"
10828
10829 fi
10830
10831 fi
10832
10833 # OSX is schizoid about who owns /usr/X11 (old) versus /opt/X11 (new), and (and
10834 # in some cases has installed dummy files in the former, other cases replaced
10835 # it with a link to the new location).  This complicates the configure script.
10836 # Check for that pitfall, and recover using pkg-config
10837 #
10838 # If none of these are set, the configuration is almost certainly broken.
10839 if test -z "${X_CFLAGS}${X_PRE_LIBS}${X_LIBS}${X_EXTRA_LIBS}"
10840 then
10841
10842 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists x11; then
10843         test -n "$verbose" && echo "    found package x11" 1>&6
10844
10845 echo "${as_me:-configure}:10845: testing found package x11 ..." 1>&5
10846
10847         cf_pkgconfig_incs="`$PKG_CONFIG --cflags x11 2>/dev/null`"
10848         cf_pkgconfig_libs="`$PKG_CONFIG --libs   x11 2>/dev/null`"
10849         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
10850
10851 echo "${as_me:-configure}:10851: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
10852
10853         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
10854
10855 echo "${as_me:-configure}:10855: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
10856
10857 cf_fix_cppflags=no
10858 cf_new_cflags=
10859 cf_new_cppflags=
10860 cf_new_extra_cppflags=
10861
10862 for cf_add_cflags in $cf_pkgconfig_incs
10863 do
10864 case $cf_fix_cppflags in
10865 (no)
10866         case $cf_add_cflags in
10867         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10868                 case $cf_add_cflags in
10869                 (-D*)
10870                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10871
10872                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10873                                 && test -z "${cf_tst_cflags}" \
10874                                 && cf_fix_cppflags=yes
10875
10876                         if test $cf_fix_cppflags = yes ; then
10877                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10878                                 continue
10879                         elif test "${cf_tst_cflags}" = "\"'" ; then
10880                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10881                                 continue
10882                         fi
10883                         ;;
10884                 esac
10885                 case "$CPPFLAGS" in
10886                 (*$cf_add_cflags)
10887                         ;;
10888                 (*)
10889                         case $cf_add_cflags in
10890                         (-D*)
10891                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10892
10893 CPPFLAGS=`echo "$CPPFLAGS" | \
10894         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10895                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10896
10897                                 ;;
10898                         esac
10899                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10900                         ;;
10901                 esac
10902                 ;;
10903         (*)
10904                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10905                 ;;
10906         esac
10907         ;;
10908 (yes)
10909         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10910
10911         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10912
10913         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10914                 && test -z "${cf_tst_cflags}" \
10915                 && cf_fix_cppflags=no
10916         ;;
10917 esac
10918 done
10919
10920 if test -n "$cf_new_cflags" ; then
10921
10922         CFLAGS="$CFLAGS $cf_new_cflags"
10923 fi
10924
10925 if test -n "$cf_new_cppflags" ; then
10926
10927         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10928 fi
10929
10930 if test -n "$cf_new_extra_cppflags" ; then
10931
10932         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10933 fi
10934
10935 cf_add_libs="$cf_pkgconfig_libs"
10936 # Filter out duplicates - this happens with badly-designed ".pc" files...
10937 for cf_add_1lib in $LIBS
10938 do
10939         for cf_add_2lib in $cf_add_libs
10940         do
10941                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
10942                 then
10943                         cf_add_1lib=
10944                         break
10945                 fi
10946         done
10947         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
10948 done
10949 LIBS="$cf_add_libs"
10950
10951         :
10952 else
10953         cf_pkgconfig_incs=
10954         cf_pkgconfig_libs=
10955         { echo "$as_me:10955: WARNING: unable to find X11 library" >&5
10956 echo "$as_me: WARNING: unable to find X11 library" >&2;}
10957 fi
10958
10959 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists ice; then
10960         test -n "$verbose" && echo "    found package ice" 1>&6
10961
10962 echo "${as_me:-configure}:10962: testing found package ice ..." 1>&5
10963
10964         cf_pkgconfig_incs="`$PKG_CONFIG --cflags ice 2>/dev/null`"
10965         cf_pkgconfig_libs="`$PKG_CONFIG --libs   ice 2>/dev/null`"
10966         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
10967
10968 echo "${as_me:-configure}:10968: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
10969
10970         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
10971
10972 echo "${as_me:-configure}:10972: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
10973
10974 cf_fix_cppflags=no
10975 cf_new_cflags=
10976 cf_new_cppflags=
10977 cf_new_extra_cppflags=
10978
10979 for cf_add_cflags in $cf_pkgconfig_incs
10980 do
10981 case $cf_fix_cppflags in
10982 (no)
10983         case $cf_add_cflags in
10984         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10985                 case $cf_add_cflags in
10986                 (-D*)
10987                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10988
10989                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10990                                 && test -z "${cf_tst_cflags}" \
10991                                 && cf_fix_cppflags=yes
10992
10993                         if test $cf_fix_cppflags = yes ; then
10994                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10995                                 continue
10996                         elif test "${cf_tst_cflags}" = "\"'" ; then
10997                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10998                                 continue
10999                         fi
11000                         ;;
11001                 esac
11002                 case "$CPPFLAGS" in
11003                 (*$cf_add_cflags)
11004                         ;;
11005                 (*)
11006                         case $cf_add_cflags in
11007                         (-D*)
11008                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11009
11010 CPPFLAGS=`echo "$CPPFLAGS" | \
11011         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11012                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11013
11014                                 ;;
11015                         esac
11016                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11017                         ;;
11018                 esac
11019                 ;;
11020         (*)
11021                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11022                 ;;
11023         esac
11024         ;;
11025 (yes)
11026         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11027
11028         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11029
11030         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11031                 && test -z "${cf_tst_cflags}" \
11032                 && cf_fix_cppflags=no
11033         ;;
11034 esac
11035 done
11036
11037 if test -n "$cf_new_cflags" ; then
11038
11039         CFLAGS="$CFLAGS $cf_new_cflags"
11040 fi
11041
11042 if test -n "$cf_new_cppflags" ; then
11043
11044         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11045 fi
11046
11047 if test -n "$cf_new_extra_cppflags" ; then
11048
11049         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11050 fi
11051
11052 cf_add_libs="$cf_pkgconfig_libs"
11053 # Filter out duplicates - this happens with badly-designed ".pc" files...
11054 for cf_add_1lib in $LIBS
11055 do
11056         for cf_add_2lib in $cf_add_libs
11057         do
11058                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11059                 then
11060                         cf_add_1lib=
11061                         break
11062                 fi
11063         done
11064         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11065 done
11066 LIBS="$cf_add_libs"
11067
11068         :
11069 else
11070         cf_pkgconfig_incs=
11071         cf_pkgconfig_libs=
11072         { echo "$as_me:11072: WARNING: unable to find ICE library" >&5
11073 echo "$as_me: WARNING: unable to find ICE library" >&2;}
11074 fi
11075
11076 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists sm; then
11077         test -n "$verbose" && echo "    found package sm" 1>&6
11078
11079 echo "${as_me:-configure}:11079: testing found package sm ..." 1>&5
11080
11081         cf_pkgconfig_incs="`$PKG_CONFIG --cflags sm 2>/dev/null`"
11082         cf_pkgconfig_libs="`$PKG_CONFIG --libs   sm 2>/dev/null`"
11083         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
11084
11085 echo "${as_me:-configure}:11085: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11086
11087         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
11088
11089 echo "${as_me:-configure}:11089: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
11090
11091 cf_fix_cppflags=no
11092 cf_new_cflags=
11093 cf_new_cppflags=
11094 cf_new_extra_cppflags=
11095
11096 for cf_add_cflags in $cf_pkgconfig_incs
11097 do
11098 case $cf_fix_cppflags in
11099 (no)
11100         case $cf_add_cflags in
11101         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11102                 case $cf_add_cflags in
11103                 (-D*)
11104                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11105
11106                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11107                                 && test -z "${cf_tst_cflags}" \
11108                                 && cf_fix_cppflags=yes
11109
11110                         if test $cf_fix_cppflags = yes ; then
11111                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11112                                 continue
11113                         elif test "${cf_tst_cflags}" = "\"'" ; then
11114                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11115                                 continue
11116                         fi
11117                         ;;
11118                 esac
11119                 case "$CPPFLAGS" in
11120                 (*$cf_add_cflags)
11121                         ;;
11122                 (*)
11123                         case $cf_add_cflags in
11124                         (-D*)
11125                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11126
11127 CPPFLAGS=`echo "$CPPFLAGS" | \
11128         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11129                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11130
11131                                 ;;
11132                         esac
11133                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11134                         ;;
11135                 esac
11136                 ;;
11137         (*)
11138                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11139                 ;;
11140         esac
11141         ;;
11142 (yes)
11143         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11144
11145         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11146
11147         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11148                 && test -z "${cf_tst_cflags}" \
11149                 && cf_fix_cppflags=no
11150         ;;
11151 esac
11152 done
11153
11154 if test -n "$cf_new_cflags" ; then
11155
11156         CFLAGS="$CFLAGS $cf_new_cflags"
11157 fi
11158
11159 if test -n "$cf_new_cppflags" ; then
11160
11161         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11162 fi
11163
11164 if test -n "$cf_new_extra_cppflags" ; then
11165
11166         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11167 fi
11168
11169 cf_add_libs="$cf_pkgconfig_libs"
11170 # Filter out duplicates - this happens with badly-designed ".pc" files...
11171 for cf_add_1lib in $LIBS
11172 do
11173         for cf_add_2lib in $cf_add_libs
11174         do
11175                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11176                 then
11177                         cf_add_1lib=
11178                         break
11179                 fi
11180         done
11181         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11182 done
11183 LIBS="$cf_add_libs"
11184
11185         :
11186 else
11187         cf_pkgconfig_incs=
11188         cf_pkgconfig_libs=
11189         { echo "$as_me:11189: WARNING: unable to find SM library" >&5
11190 echo "$as_me: WARNING: unable to find SM library" >&2;}
11191 fi
11192
11193 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xt; then
11194         test -n "$verbose" && echo "    found package xt" 1>&6
11195
11196 echo "${as_me:-configure}:11196: testing found package xt ..." 1>&5
11197
11198         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xt 2>/dev/null`"
11199         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xt 2>/dev/null`"
11200         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
11201
11202 echo "${as_me:-configure}:11202: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11203
11204         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
11205
11206 echo "${as_me:-configure}:11206: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
11207
11208 cf_fix_cppflags=no
11209 cf_new_cflags=
11210 cf_new_cppflags=
11211 cf_new_extra_cppflags=
11212
11213 for cf_add_cflags in $cf_pkgconfig_incs
11214 do
11215 case $cf_fix_cppflags in
11216 (no)
11217         case $cf_add_cflags in
11218         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11219                 case $cf_add_cflags in
11220                 (-D*)
11221                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11222
11223                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11224                                 && test -z "${cf_tst_cflags}" \
11225                                 && cf_fix_cppflags=yes
11226
11227                         if test $cf_fix_cppflags = yes ; then
11228                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11229                                 continue
11230                         elif test "${cf_tst_cflags}" = "\"'" ; then
11231                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11232                                 continue
11233                         fi
11234                         ;;
11235                 esac
11236                 case "$CPPFLAGS" in
11237                 (*$cf_add_cflags)
11238                         ;;
11239                 (*)
11240                         case $cf_add_cflags in
11241                         (-D*)
11242                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11243
11244 CPPFLAGS=`echo "$CPPFLAGS" | \
11245         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11246                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11247
11248                                 ;;
11249                         esac
11250                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11251                         ;;
11252                 esac
11253                 ;;
11254         (*)
11255                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11256                 ;;
11257         esac
11258         ;;
11259 (yes)
11260         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11261
11262         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11263
11264         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11265                 && test -z "${cf_tst_cflags}" \
11266                 && cf_fix_cppflags=no
11267         ;;
11268 esac
11269 done
11270
11271 if test -n "$cf_new_cflags" ; then
11272
11273         CFLAGS="$CFLAGS $cf_new_cflags"
11274 fi
11275
11276 if test -n "$cf_new_cppflags" ; then
11277
11278         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11279 fi
11280
11281 if test -n "$cf_new_extra_cppflags" ; then
11282
11283         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11284 fi
11285
11286 cf_add_libs="$cf_pkgconfig_libs"
11287 # Filter out duplicates - this happens with badly-designed ".pc" files...
11288 for cf_add_1lib in $LIBS
11289 do
11290         for cf_add_2lib in $cf_add_libs
11291         do
11292                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11293                 then
11294                         cf_add_1lib=
11295                         break
11296                 fi
11297         done
11298         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11299 done
11300 LIBS="$cf_add_libs"
11301
11302         :
11303 else
11304         cf_pkgconfig_incs=
11305         cf_pkgconfig_libs=
11306         { echo "$as_me:11306: WARNING: unable to find Xt library" >&5
11307 echo "$as_me: WARNING: unable to find Xt library" >&2;}
11308 fi
11309
11310 fi
11311
11312 cf_have_X_LIBS=no
11313
11314 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xt; then
11315         test -n "$verbose" && echo "    found package xt" 1>&6
11316
11317 echo "${as_me:-configure}:11317: testing found package xt ..." 1>&5
11318
11319         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xt 2>/dev/null`"
11320         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xt 2>/dev/null`"
11321         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
11322
11323 echo "${as_me:-configure}:11323: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11324
11325         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
11326
11327 echo "${as_me:-configure}:11327: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
11328
11329 cf_fix_cppflags=no
11330 cf_new_cflags=
11331 cf_new_cppflags=
11332 cf_new_extra_cppflags=
11333
11334 for cf_add_cflags in $cf_pkgconfig_incs
11335 do
11336 case $cf_fix_cppflags in
11337 (no)
11338         case $cf_add_cflags in
11339         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11340                 case $cf_add_cflags in
11341                 (-D*)
11342                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11343
11344                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11345                                 && test -z "${cf_tst_cflags}" \
11346                                 && cf_fix_cppflags=yes
11347
11348                         if test $cf_fix_cppflags = yes ; then
11349                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11350                                 continue
11351                         elif test "${cf_tst_cflags}" = "\"'" ; then
11352                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11353                                 continue
11354                         fi
11355                         ;;
11356                 esac
11357                 case "$CPPFLAGS" in
11358                 (*$cf_add_cflags)
11359                         ;;
11360                 (*)
11361                         case $cf_add_cflags in
11362                         (-D*)
11363                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11364
11365 CPPFLAGS=`echo "$CPPFLAGS" | \
11366         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11367                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11368
11369                                 ;;
11370                         esac
11371                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11372                         ;;
11373                 esac
11374                 ;;
11375         (*)
11376                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11377                 ;;
11378         esac
11379         ;;
11380 (yes)
11381         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11382
11383         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11384
11385         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11386                 && test -z "${cf_tst_cflags}" \
11387                 && cf_fix_cppflags=no
11388         ;;
11389 esac
11390 done
11391
11392 if test -n "$cf_new_cflags" ; then
11393
11394         CFLAGS="$CFLAGS $cf_new_cflags"
11395 fi
11396
11397 if test -n "$cf_new_cppflags" ; then
11398
11399         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11400 fi
11401
11402 if test -n "$cf_new_extra_cppflags" ; then
11403
11404         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11405 fi
11406
11407 cf_add_libs="$cf_pkgconfig_libs"
11408 # Filter out duplicates - this happens with badly-designed ".pc" files...
11409 for cf_add_1lib in $LIBS
11410 do
11411         for cf_add_2lib in $cf_add_libs
11412         do
11413                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11414                 then
11415                         cf_add_1lib=
11416                         break
11417                 fi
11418         done
11419         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11420 done
11421 LIBS="$cf_add_libs"
11422
11423         case "x$LIBS" in
11424         (*-lX11*)
11425                 ;;
11426         (*)
11427 # we have an "xt" package, but it may omit Xt's dependency on X11
11428 echo "$as_me:11428: checking for usable X dependency" >&5
11429 echo $ECHO_N "checking for usable X dependency... $ECHO_C" >&6
11430 if test "${cf_cv_xt_x11_compat+set}" = set; then
11431   echo $ECHO_N "(cached) $ECHO_C" >&6
11432 else
11433
11434 cat >conftest.$ac_ext <<_ACEOF
11435 #line 11435 "configure"
11436 #include "confdefs.h"
11437
11438 #include <X11/Xlib.h>
11439
11440 int
11441 main ()
11442 {
11443
11444         int rc1 = XDrawLine((Display*) 0, (Drawable) 0, (GC) 0, 0, 0, 0, 0);
11445         int rc2 = XClearWindow((Display*) 0, (Window) 0);
11446         int rc3 = XMoveWindow((Display*) 0, (Window) 0, 0, 0);
11447         int rc4 = XMoveResizeWindow((Display*)0, (Window)0, 0, 0, 0, 0);
11448
11449   ;
11450   return 0;
11451 }
11452 _ACEOF
11453 rm -f conftest.$ac_objext conftest$ac_exeext
11454 if { (eval echo "$as_me:11454: \"$ac_link\"") >&5
11455   (eval $ac_link) 2>&5
11456   ac_status=$?
11457   echo "$as_me:11457: \$? = $ac_status" >&5
11458   (exit $ac_status); } &&
11459          { ac_try='test -s conftest$ac_exeext'
11460   { (eval echo "$as_me:11460: \"$ac_try\"") >&5
11461   (eval $ac_try) 2>&5
11462   ac_status=$?
11463   echo "$as_me:11463: \$? = $ac_status" >&5
11464   (exit $ac_status); }; }; then
11465   cf_cv_xt_x11_compat=yes
11466 else
11467   echo "$as_me: failed program was:" >&5
11468 cat conftest.$ac_ext >&5
11469 cf_cv_xt_x11_compat=no
11470 fi
11471 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11472 fi
11473 echo "$as_me:11473: result: $cf_cv_xt_x11_compat" >&5
11474 echo "${ECHO_T}$cf_cv_xt_x11_compat" >&6
11475                 if test "$cf_cv_xt_x11_compat" = no
11476                 then
11477                         test -n "$verbose" && echo "    work around broken X11 dependency" 1>&6
11478
11479 echo "${as_me:-configure}:11479: testing work around broken X11 dependency ..." 1>&5
11480
11481                         # 2010/11/19 - good enough until a working Xt on Xcb is delivered.
11482
11483 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists x11; then
11484         test -n "$verbose" && echo "    found package x11" 1>&6
11485
11486 echo "${as_me:-configure}:11486: testing found package x11 ..." 1>&5
11487
11488         cf_pkgconfig_incs="`$PKG_CONFIG --cflags x11 2>/dev/null`"
11489         cf_pkgconfig_libs="`$PKG_CONFIG --libs   x11 2>/dev/null`"
11490         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
11491
11492 echo "${as_me:-configure}:11492: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11493
11494         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
11495
11496 echo "${as_me:-configure}:11496: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
11497
11498 cf_fix_cppflags=no
11499 cf_new_cflags=
11500 cf_new_cppflags=
11501 cf_new_extra_cppflags=
11502
11503 for cf_add_cflags in $cf_pkgconfig_incs
11504 do
11505 case $cf_fix_cppflags in
11506 (no)
11507         case $cf_add_cflags in
11508         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11509                 case $cf_add_cflags in
11510                 (-D*)
11511                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11512
11513                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11514                                 && test -z "${cf_tst_cflags}" \
11515                                 && cf_fix_cppflags=yes
11516
11517                         if test $cf_fix_cppflags = yes ; then
11518                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11519                                 continue
11520                         elif test "${cf_tst_cflags}" = "\"'" ; then
11521                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11522                                 continue
11523                         fi
11524                         ;;
11525                 esac
11526                 case "$CPPFLAGS" in
11527                 (*$cf_add_cflags)
11528                         ;;
11529                 (*)
11530                         case $cf_add_cflags in
11531                         (-D*)
11532                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11533
11534 CPPFLAGS=`echo "$CPPFLAGS" | \
11535         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11536                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11537
11538                                 ;;
11539                         esac
11540                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11541                         ;;
11542                 esac
11543                 ;;
11544         (*)
11545                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11546                 ;;
11547         esac
11548         ;;
11549 (yes)
11550         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11551
11552         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11553
11554         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11555                 && test -z "${cf_tst_cflags}" \
11556                 && cf_fix_cppflags=no
11557         ;;
11558 esac
11559 done
11560
11561 if test -n "$cf_new_cflags" ; then
11562
11563         CFLAGS="$CFLAGS $cf_new_cflags"
11564 fi
11565
11566 if test -n "$cf_new_cppflags" ; then
11567
11568         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11569 fi
11570
11571 if test -n "$cf_new_extra_cppflags" ; then
11572
11573         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11574 fi
11575
11576 cf_add_libs="$cf_pkgconfig_libs"
11577 # Filter out duplicates - this happens with badly-designed ".pc" files...
11578 for cf_add_1lib in $LIBS
11579 do
11580         for cf_add_2lib in $cf_add_libs
11581         do
11582                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11583                 then
11584                         cf_add_1lib=
11585                         break
11586                 fi
11587         done
11588         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11589 done
11590 LIBS="$cf_add_libs"
11591
11592         :
11593 else
11594         cf_pkgconfig_incs=
11595         cf_pkgconfig_libs=
11596
11597 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
11598
11599 echo "${as_me:-configure}:11599: testing ...before $LIBS ..." 1>&5
11600
11601 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%-lXt %-lXt -lX11 %" -e 's%  % %g'`
11602 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
11603
11604 echo "${as_me:-configure}:11604: testing ...after  $LIBS ..." 1>&5
11605
11606 fi
11607
11608                 fi
11609                 ;;
11610         esac
11611
11612 echo "$as_me:11612: checking for usable X Toolkit package" >&5
11613 echo $ECHO_N "checking for usable X Toolkit package... $ECHO_C" >&6
11614 if test "${cf_cv_xt_ice_compat+set}" = set; then
11615   echo $ECHO_N "(cached) $ECHO_C" >&6
11616 else
11617
11618 cat >conftest.$ac_ext <<_ACEOF
11619 #line 11619 "configure"
11620 #include "confdefs.h"
11621
11622 #include <X11/Shell.h>
11623
11624 int
11625 main ()
11626 {
11627 int num = IceConnectionNumber(0)
11628
11629   ;
11630   return 0;
11631 }
11632 _ACEOF
11633 rm -f conftest.$ac_objext conftest$ac_exeext
11634 if { (eval echo "$as_me:11634: \"$ac_link\"") >&5
11635   (eval $ac_link) 2>&5
11636   ac_status=$?
11637   echo "$as_me:11637: \$? = $ac_status" >&5
11638   (exit $ac_status); } &&
11639          { ac_try='test -s conftest$ac_exeext'
11640   { (eval echo "$as_me:11640: \"$ac_try\"") >&5
11641   (eval $ac_try) 2>&5
11642   ac_status=$?
11643   echo "$as_me:11643: \$? = $ac_status" >&5
11644   (exit $ac_status); }; }; then
11645   cf_cv_xt_ice_compat=yes
11646 else
11647   echo "$as_me: failed program was:" >&5
11648 cat conftest.$ac_ext >&5
11649 cf_cv_xt_ice_compat=no
11650 fi
11651 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11652 fi
11653 echo "$as_me:11653: result: $cf_cv_xt_ice_compat" >&5
11654 echo "${ECHO_T}$cf_cv_xt_ice_compat" >&6
11655
11656         if test "$cf_cv_xt_ice_compat" = no
11657         then
11658                 # workaround for broken ".pc" files used for X Toolkit.
11659                 case "x$X_PRE_LIBS" in
11660                 (*-lICE*)
11661                         case "x$LIBS" in
11662                         (*-lICE*)
11663                                 ;;
11664                         (*)
11665                                 test -n "$verbose" && echo "    work around broken ICE dependency" 1>&6
11666
11667 echo "${as_me:-configure}:11667: testing work around broken ICE dependency ..." 1>&5
11668
11669 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists ice; then
11670         test -n "$verbose" && echo "    found package ice" 1>&6
11671
11672 echo "${as_me:-configure}:11672: testing found package ice ..." 1>&5
11673
11674         cf_pkgconfig_incs="`$PKG_CONFIG --cflags ice 2>/dev/null`"
11675         cf_pkgconfig_libs="`$PKG_CONFIG --libs   ice 2>/dev/null`"
11676         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
11677
11678 echo "${as_me:-configure}:11678: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11679
11680         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
11681
11682 echo "${as_me:-configure}:11682: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
11683
11684 cf_fix_cppflags=no
11685 cf_new_cflags=
11686 cf_new_cppflags=
11687 cf_new_extra_cppflags=
11688
11689 for cf_add_cflags in $cf_pkgconfig_incs
11690 do
11691 case $cf_fix_cppflags in
11692 (no)
11693         case $cf_add_cflags in
11694         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11695                 case $cf_add_cflags in
11696                 (-D*)
11697                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11698
11699                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11700                                 && test -z "${cf_tst_cflags}" \
11701                                 && cf_fix_cppflags=yes
11702
11703                         if test $cf_fix_cppflags = yes ; then
11704                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11705                                 continue
11706                         elif test "${cf_tst_cflags}" = "\"'" ; then
11707                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11708                                 continue
11709                         fi
11710                         ;;
11711                 esac
11712                 case "$CPPFLAGS" in
11713                 (*$cf_add_cflags)
11714                         ;;
11715                 (*)
11716                         case $cf_add_cflags in
11717                         (-D*)
11718                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11719
11720 CPPFLAGS=`echo "$CPPFLAGS" | \
11721         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11722                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11723
11724                                 ;;
11725                         esac
11726                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11727                         ;;
11728                 esac
11729                 ;;
11730         (*)
11731                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11732                 ;;
11733         esac
11734         ;;
11735 (yes)
11736         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11737
11738         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11739
11740         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11741                 && test -z "${cf_tst_cflags}" \
11742                 && cf_fix_cppflags=no
11743         ;;
11744 esac
11745 done
11746
11747 if test -n "$cf_new_cflags" ; then
11748
11749         CFLAGS="$CFLAGS $cf_new_cflags"
11750 fi
11751
11752 if test -n "$cf_new_cppflags" ; then
11753
11754         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11755 fi
11756
11757 if test -n "$cf_new_extra_cppflags" ; then
11758
11759         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11760 fi
11761
11762 cf_add_libs="$cf_pkgconfig_libs"
11763 # Filter out duplicates - this happens with badly-designed ".pc" files...
11764 for cf_add_1lib in $LIBS
11765 do
11766         for cf_add_2lib in $cf_add_libs
11767         do
11768                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11769                 then
11770                         cf_add_1lib=
11771                         break
11772                 fi
11773         done
11774         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11775 done
11776 LIBS="$cf_add_libs"
11777
11778 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists sm; then
11779         test -n "$verbose" && echo "    found package sm" 1>&6
11780
11781 echo "${as_me:-configure}:11781: testing found package sm ..." 1>&5
11782
11783         cf_pkgconfig_incs="`$PKG_CONFIG --cflags sm 2>/dev/null`"
11784         cf_pkgconfig_libs="`$PKG_CONFIG --libs   sm 2>/dev/null`"
11785         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
11786
11787 echo "${as_me:-configure}:11787: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11788
11789         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
11790
11791 echo "${as_me:-configure}:11791: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
11792
11793 cf_fix_cppflags=no
11794 cf_new_cflags=
11795 cf_new_cppflags=
11796 cf_new_extra_cppflags=
11797
11798 for cf_add_cflags in $cf_pkgconfig_incs
11799 do
11800 case $cf_fix_cppflags in
11801 (no)
11802         case $cf_add_cflags in
11803         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11804                 case $cf_add_cflags in
11805                 (-D*)
11806                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11807
11808                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11809                                 && test -z "${cf_tst_cflags}" \
11810                                 && cf_fix_cppflags=yes
11811
11812                         if test $cf_fix_cppflags = yes ; then
11813                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11814                                 continue
11815                         elif test "${cf_tst_cflags}" = "\"'" ; then
11816                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11817                                 continue
11818                         fi
11819                         ;;
11820                 esac
11821                 case "$CPPFLAGS" in
11822                 (*$cf_add_cflags)
11823                         ;;
11824                 (*)
11825                         case $cf_add_cflags in
11826                         (-D*)
11827                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11828
11829 CPPFLAGS=`echo "$CPPFLAGS" | \
11830         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11831                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11832
11833                                 ;;
11834                         esac
11835                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11836                         ;;
11837                 esac
11838                 ;;
11839         (*)
11840                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11841                 ;;
11842         esac
11843         ;;
11844 (yes)
11845         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11846
11847         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11848
11849         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11850                 && test -z "${cf_tst_cflags}" \
11851                 && cf_fix_cppflags=no
11852         ;;
11853 esac
11854 done
11855
11856 if test -n "$cf_new_cflags" ; then
11857
11858         CFLAGS="$CFLAGS $cf_new_cflags"
11859 fi
11860
11861 if test -n "$cf_new_cppflags" ; then
11862
11863         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11864 fi
11865
11866 if test -n "$cf_new_extra_cppflags" ; then
11867
11868         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11869 fi
11870
11871 cf_add_libs="$cf_pkgconfig_libs"
11872 # Filter out duplicates - this happens with badly-designed ".pc" files...
11873 for cf_add_1lib in $LIBS
11874 do
11875         for cf_add_2lib in $cf_add_libs
11876         do
11877                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11878                 then
11879                         cf_add_1lib=
11880                         break
11881                 fi
11882         done
11883         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11884 done
11885 LIBS="$cf_add_libs"
11886
11887         :
11888 else
11889         cf_pkgconfig_incs=
11890         cf_pkgconfig_libs=
11891         :
11892 fi
11893
11894 else
11895         cf_pkgconfig_incs=
11896         cf_pkgconfig_libs=
11897
11898 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
11899
11900 echo "${as_me:-configure}:11900: testing ...before $LIBS ..." 1>&5
11901
11902 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%-lXt %-lXt $X_PRE_LIBS %" -e 's%  % %g'`
11903 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
11904
11905 echo "${as_me:-configure}:11905: testing ...after  $LIBS ..." 1>&5
11906
11907 fi
11908
11909                                 ;;
11910                         esac
11911                         ;;
11912                 esac
11913         fi
11914
11915         cf_have_X_LIBS=yes
11916
11917 else
11918         cf_pkgconfig_incs=
11919         cf_pkgconfig_libs=
11920
11921         LDFLAGS="$X_LIBS $LDFLAGS"
11922
11923 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
11924
11925 echo "${as_me:-configure}:11925: testing checking additions to CFLAGS ..." 1>&5
11926
11927 cf_check_cflags="$CFLAGS"
11928 cf_check_cppflags="$CPPFLAGS"
11929
11930 cf_fix_cppflags=no
11931 cf_new_cflags=
11932 cf_new_cppflags=
11933 cf_new_extra_cppflags=
11934
11935 for cf_add_cflags in $X_CFLAGS
11936 do
11937 case $cf_fix_cppflags in
11938 (no)
11939         case $cf_add_cflags in
11940         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11941                 case $cf_add_cflags in
11942                 (-D*)
11943                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11944
11945                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11946                                 && test -z "${cf_tst_cflags}" \
11947                                 && cf_fix_cppflags=yes
11948
11949                         if test $cf_fix_cppflags = yes ; then
11950                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11951                                 continue
11952                         elif test "${cf_tst_cflags}" = "\"'" ; then
11953                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11954                                 continue
11955                         fi
11956                         ;;
11957                 esac
11958                 case "$CPPFLAGS" in
11959                 (*$cf_add_cflags)
11960                         ;;
11961                 (*)
11962                         case $cf_add_cflags in
11963                         (-D*)
11964                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11965
11966 CPPFLAGS=`echo "$CPPFLAGS" | \
11967         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11968                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11969
11970                                 ;;
11971                         esac
11972                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11973                         ;;
11974                 esac
11975                 ;;
11976         (*)
11977                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11978                 ;;
11979         esac
11980         ;;
11981 (yes)
11982         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11983
11984         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11985
11986         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11987                 && test -z "${cf_tst_cflags}" \
11988                 && cf_fix_cppflags=no
11989         ;;
11990 esac
11991 done
11992
11993 if test -n "$cf_new_cflags" ; then
11994         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
11995
11996 echo "${as_me:-configure}:11996: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
11997
11998         CFLAGS="$CFLAGS $cf_new_cflags"
11999 fi
12000
12001 if test -n "$cf_new_cppflags" ; then
12002         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
12003
12004 echo "${as_me:-configure}:12004: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
12005
12006         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
12007 fi
12008
12009 if test -n "$cf_new_extra_cppflags" ; then
12010         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
12011
12012 echo "${as_me:-configure}:12012: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
12013
12014         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
12015 fi
12016
12017 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
12018 cat >conftest.$ac_ext <<_ACEOF
12019 #line 12019 "configure"
12020 #include "confdefs.h"
12021 #include <stdio.h>
12022 int
12023 main ()
12024 {
12025 printf("Hello world");
12026   ;
12027   return 0;
12028 }
12029 _ACEOF
12030 rm -f conftest.$ac_objext conftest$ac_exeext
12031 if { (eval echo "$as_me:12031: \"$ac_link\"") >&5
12032   (eval $ac_link) 2>&5
12033   ac_status=$?
12034   echo "$as_me:12034: \$? = $ac_status" >&5
12035   (exit $ac_status); } &&
12036          { ac_try='test -s conftest$ac_exeext'
12037   { (eval echo "$as_me:12037: \"$ac_try\"") >&5
12038   (eval $ac_try) 2>&5
12039   ac_status=$?
12040   echo "$as_me:12040: \$? = $ac_status" >&5
12041   (exit $ac_status); }; }; then
12042   :
12043 else
12044   echo "$as_me: failed program was:" >&5
12045 cat conftest.$ac_ext >&5
12046 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
12047
12048 echo "${as_me:-configure}:12048: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
12049
12050          if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
12051                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
12052
12053 echo "${as_me:-configure}:12053: testing but keeping change to \$CPPFLAGS ..." 1>&5
12054
12055          fi
12056          CFLAGS="$cf_check_flags"
12057 fi
12058 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12059 fi
12060
12061         echo "$as_me:12061: checking for XOpenDisplay" >&5
12062 echo $ECHO_N "checking for XOpenDisplay... $ECHO_C" >&6
12063 if test "${ac_cv_func_XOpenDisplay+set}" = set; then
12064   echo $ECHO_N "(cached) $ECHO_C" >&6
12065 else
12066   cat >conftest.$ac_ext <<_ACEOF
12067 #line 12067 "configure"
12068 #include "confdefs.h"
12069 /* System header to define __stub macros and hopefully few prototypes,
12070     which can conflict with char XOpenDisplay (); below.  */
12071 #include <assert.h>
12072 /* Override any gcc2 internal prototype to avoid an error.  */
12073 #ifdef __cplusplus
12074 extern "C"
12075 #endif
12076 /* We use char because int might match the return type of a gcc2
12077    builtin and then its argument prototype would still apply.  */
12078 char XOpenDisplay ();
12079 char (*f) ();
12080
12081 int
12082 main ()
12083 {
12084 /* The GNU C library defines this for functions which it implements
12085     to always fail with ENOSYS.  Some functions are actually named
12086     something starting with __ and the normal name is an alias.  */
12087 #if defined (__stub_XOpenDisplay) || defined (__stub___XOpenDisplay)
12088 choke me
12089 #else
12090 f = XOpenDisplay; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
12091 #endif
12092
12093   ;
12094   return 0;
12095 }
12096 _ACEOF
12097 rm -f conftest.$ac_objext conftest$ac_exeext
12098 if { (eval echo "$as_me:12098: \"$ac_link\"") >&5
12099   (eval $ac_link) 2>&5
12100   ac_status=$?
12101   echo "$as_me:12101: \$? = $ac_status" >&5
12102   (exit $ac_status); } &&
12103          { ac_try='test -s conftest$ac_exeext'
12104   { (eval echo "$as_me:12104: \"$ac_try\"") >&5
12105   (eval $ac_try) 2>&5
12106   ac_status=$?
12107   echo "$as_me:12107: \$? = $ac_status" >&5
12108   (exit $ac_status); }; }; then
12109   ac_cv_func_XOpenDisplay=yes
12110 else
12111   echo "$as_me: failed program was:" >&5
12112 cat conftest.$ac_ext >&5
12113 ac_cv_func_XOpenDisplay=no
12114 fi
12115 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12116 fi
12117 echo "$as_me:12117: result: $ac_cv_func_XOpenDisplay" >&5
12118 echo "${ECHO_T}$ac_cv_func_XOpenDisplay" >&6
12119 if test $ac_cv_func_XOpenDisplay = yes; then
12120   :
12121 else
12122
12123         echo "$as_me:12123: checking for XOpenDisplay in -lX11" >&5
12124 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
12125 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
12126   echo $ECHO_N "(cached) $ECHO_C" >&6
12127 else
12128   ac_check_lib_save_LIBS=$LIBS
12129 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
12130 cat >conftest.$ac_ext <<_ACEOF
12131 #line 12131 "configure"
12132 #include "confdefs.h"
12133
12134 /* Override any gcc2 internal prototype to avoid an error.  */
12135 #ifdef __cplusplus
12136 extern "C"
12137 #endif
12138 /* We use char because int might match the return type of a gcc2
12139    builtin and then its argument prototype would still apply.  */
12140 char XOpenDisplay ();
12141 int
12142 main ()
12143 {
12144 XOpenDisplay ();
12145   ;
12146   return 0;
12147 }
12148 _ACEOF
12149 rm -f conftest.$ac_objext conftest$ac_exeext
12150 if { (eval echo "$as_me:12150: \"$ac_link\"") >&5
12151   (eval $ac_link) 2>&5
12152   ac_status=$?
12153   echo "$as_me:12153: \$? = $ac_status" >&5
12154   (exit $ac_status); } &&
12155          { ac_try='test -s conftest$ac_exeext'
12156   { (eval echo "$as_me:12156: \"$ac_try\"") >&5
12157   (eval $ac_try) 2>&5
12158   ac_status=$?
12159   echo "$as_me:12159: \$? = $ac_status" >&5
12160   (exit $ac_status); }; }; then
12161   ac_cv_lib_X11_XOpenDisplay=yes
12162 else
12163   echo "$as_me: failed program was:" >&5
12164 cat conftest.$ac_ext >&5
12165 ac_cv_lib_X11_XOpenDisplay=no
12166 fi
12167 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12168 LIBS=$ac_check_lib_save_LIBS
12169 fi
12170 echo "$as_me:12170: result: $ac_cv_lib_X11_XOpenDisplay" >&5
12171 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
12172 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
12173
12174 cf_add_libs="-lX11"
12175 # Filter out duplicates - this happens with badly-designed ".pc" files...
12176 for cf_add_1lib in $LIBS
12177 do
12178         for cf_add_2lib in $cf_add_libs
12179         do
12180                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12181                 then
12182                         cf_add_1lib=
12183                         break
12184                 fi
12185         done
12186         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12187 done
12188 LIBS="$cf_add_libs"
12189
12190 fi
12191
12192 fi
12193
12194         echo "$as_me:12194: checking for XtAppInitialize" >&5
12195 echo $ECHO_N "checking for XtAppInitialize... $ECHO_C" >&6
12196 if test "${ac_cv_func_XtAppInitialize+set}" = set; then
12197   echo $ECHO_N "(cached) $ECHO_C" >&6
12198 else
12199   cat >conftest.$ac_ext <<_ACEOF
12200 #line 12200 "configure"
12201 #include "confdefs.h"
12202 /* System header to define __stub macros and hopefully few prototypes,
12203     which can conflict with char XtAppInitialize (); below.  */
12204 #include <assert.h>
12205 /* Override any gcc2 internal prototype to avoid an error.  */
12206 #ifdef __cplusplus
12207 extern "C"
12208 #endif
12209 /* We use char because int might match the return type of a gcc2
12210    builtin and then its argument prototype would still apply.  */
12211 char XtAppInitialize ();
12212 char (*f) ();
12213
12214 int
12215 main ()
12216 {
12217 /* The GNU C library defines this for functions which it implements
12218     to always fail with ENOSYS.  Some functions are actually named
12219     something starting with __ and the normal name is an alias.  */
12220 #if defined (__stub_XtAppInitialize) || defined (__stub___XtAppInitialize)
12221 choke me
12222 #else
12223 f = XtAppInitialize; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
12224 #endif
12225
12226   ;
12227   return 0;
12228 }
12229 _ACEOF
12230 rm -f conftest.$ac_objext conftest$ac_exeext
12231 if { (eval echo "$as_me:12231: \"$ac_link\"") >&5
12232   (eval $ac_link) 2>&5
12233   ac_status=$?
12234   echo "$as_me:12234: \$? = $ac_status" >&5
12235   (exit $ac_status); } &&
12236          { ac_try='test -s conftest$ac_exeext'
12237   { (eval echo "$as_me:12237: \"$ac_try\"") >&5
12238   (eval $ac_try) 2>&5
12239   ac_status=$?
12240   echo "$as_me:12240: \$? = $ac_status" >&5
12241   (exit $ac_status); }; }; then
12242   ac_cv_func_XtAppInitialize=yes
12243 else
12244   echo "$as_me: failed program was:" >&5
12245 cat conftest.$ac_ext >&5
12246 ac_cv_func_XtAppInitialize=no
12247 fi
12248 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12249 fi
12250 echo "$as_me:12250: result: $ac_cv_func_XtAppInitialize" >&5
12251 echo "${ECHO_T}$ac_cv_func_XtAppInitialize" >&6
12252 if test $ac_cv_func_XtAppInitialize = yes; then
12253   :
12254 else
12255
12256         echo "$as_me:12256: checking for XtAppInitialize in -lXt" >&5
12257 echo $ECHO_N "checking for XtAppInitialize in -lXt... $ECHO_C" >&6
12258 if test "${ac_cv_lib_Xt_XtAppInitialize+set}" = set; then
12259   echo $ECHO_N "(cached) $ECHO_C" >&6
12260 else
12261   ac_check_lib_save_LIBS=$LIBS
12262 LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
12263 cat >conftest.$ac_ext <<_ACEOF
12264 #line 12264 "configure"
12265 #include "confdefs.h"
12266
12267 /* Override any gcc2 internal prototype to avoid an error.  */
12268 #ifdef __cplusplus
12269 extern "C"
12270 #endif
12271 /* We use char because int might match the return type of a gcc2
12272    builtin and then its argument prototype would still apply.  */
12273 char XtAppInitialize ();
12274 int
12275 main ()
12276 {
12277 XtAppInitialize ();
12278   ;
12279   return 0;
12280 }
12281 _ACEOF
12282 rm -f conftest.$ac_objext conftest$ac_exeext
12283 if { (eval echo "$as_me:12283: \"$ac_link\"") >&5
12284   (eval $ac_link) 2>&5
12285   ac_status=$?
12286   echo "$as_me:12286: \$? = $ac_status" >&5
12287   (exit $ac_status); } &&
12288          { ac_try='test -s conftest$ac_exeext'
12289   { (eval echo "$as_me:12289: \"$ac_try\"") >&5
12290   (eval $ac_try) 2>&5
12291   ac_status=$?
12292   echo "$as_me:12292: \$? = $ac_status" >&5
12293   (exit $ac_status); }; }; then
12294   ac_cv_lib_Xt_XtAppInitialize=yes
12295 else
12296   echo "$as_me: failed program was:" >&5
12297 cat conftest.$ac_ext >&5
12298 ac_cv_lib_Xt_XtAppInitialize=no
12299 fi
12300 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12301 LIBS=$ac_check_lib_save_LIBS
12302 fi
12303 echo "$as_me:12303: result: $ac_cv_lib_Xt_XtAppInitialize" >&5
12304 echo "${ECHO_T}$ac_cv_lib_Xt_XtAppInitialize" >&6
12305 if test $ac_cv_lib_Xt_XtAppInitialize = yes; then
12306
12307 cat >>confdefs.h <<\EOF
12308 #define HAVE_LIBXT 1
12309 EOF
12310
12311                  cf_have_X_LIBS=Xt
12312                  LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS"
12313 fi
12314
12315 fi
12316
12317 fi
12318
12319 if test $cf_have_X_LIBS = no ; then
12320         { echo "$as_me:12320: WARNING: Unable to successfully link X Toolkit library (-lXt) with
12321 test program.  You will have to check and add the proper libraries by hand
12322 to makefile." >&5
12323 echo "$as_me: WARNING: Unable to successfully link X Toolkit library (-lXt) with
12324 test program.  You will have to check and add the proper libraries by hand
12325 to makefile." >&2;}
12326 fi
12327
12328 cf_x_athena_root=$cf_x_athena
12329 cf_x_athena_inc=""
12330
12331 for cf_path in default \
12332         /usr/contrib/X11R6 \
12333         /usr/contrib/X11R5 \
12334         /usr/lib/X11R5 \
12335         /usr/local
12336 do
12337         if test -z "$cf_x_athena_inc" ; then
12338                 cf_save="$CPPFLAGS"
12339                 cf_test=X11/$cf_x_athena_root/SimpleMenu.h
12340                 if test $cf_path != default ; then
12341                         CPPFLAGS="$cf_save -I$cf_path/include"
12342                         echo "$as_me:12342: checking for $cf_test in $cf_path" >&5
12343 echo $ECHO_N "checking for $cf_test in $cf_path... $ECHO_C" >&6
12344                 else
12345                         echo "$as_me:12345: checking for $cf_test" >&5
12346 echo $ECHO_N "checking for $cf_test... $ECHO_C" >&6
12347                 fi
12348                 cat >conftest.$ac_ext <<_ACEOF
12349 #line 12349 "configure"
12350 #include "confdefs.h"
12351
12352 #include <X11/Intrinsic.h>
12353 #include <$cf_test>
12354 int
12355 main ()
12356 {
12357
12358   ;
12359   return 0;
12360 }
12361 _ACEOF
12362 rm -f conftest.$ac_objext
12363 if { (eval echo "$as_me:12363: \"$ac_compile\"") >&5
12364   (eval $ac_compile) 2>&5
12365   ac_status=$?
12366   echo "$as_me:12366: \$? = $ac_status" >&5
12367   (exit $ac_status); } &&
12368          { ac_try='test -s conftest.$ac_objext'
12369   { (eval echo "$as_me:12369: \"$ac_try\"") >&5
12370   (eval $ac_try) 2>&5
12371   ac_status=$?
12372   echo "$as_me:12372: \$? = $ac_status" >&5
12373   (exit $ac_status); }; }; then
12374   cf_result=yes
12375 else
12376   echo "$as_me: failed program was:" >&5
12377 cat conftest.$ac_ext >&5
12378 cf_result=no
12379 fi
12380 rm -f conftest.$ac_objext conftest.$ac_ext
12381                 echo "$as_me:12381: result: $cf_result" >&5
12382 echo "${ECHO_T}$cf_result" >&6
12383                 if test "$cf_result" = yes ; then
12384                         cf_x_athena_inc=$cf_path
12385                         break
12386                 else
12387                         CPPFLAGS="$cf_save"
12388                 fi
12389         fi
12390 done
12391
12392 if test -z "$cf_x_athena_inc" ; then
12393         { echo "$as_me:12393: WARNING: Unable to successfully find Athena header files with test program" >&5
12394 echo "$as_me: WARNING: Unable to successfully find Athena header files with test program" >&2;}
12395 elif test "$cf_x_athena_inc" != default ; then
12396         CPPFLAGS="$CPPFLAGS -I$cf_x_athena_inc"
12397 fi
12398
12399 cf_x_athena_root=$cf_x_athena
12400 cf_x_athena_lib=""
12401
12402 for cf_path in default \
12403         /usr/contrib/X11R6 \
12404         /usr/contrib/X11R5 \
12405         /usr/lib/X11R5 \
12406         /usr/local
12407 do
12408         for cf_lib in \
12409                 ${cf_x_athena_root} \
12410                 ${cf_x_athena_root}7 \
12411                 ${cf_x_athena_root}6
12412         do
12413         for cf_libs in \
12414                 "-l$cf_lib -lXmu" \
12415                 "-l$cf_lib -lXpm -lXmu" \
12416                 "-l${cf_lib}_s -lXmu_s"
12417         do
12418                 if test -z "$cf_x_athena_lib" ; then
12419                         cf_save="$LIBS"
12420                         cf_test=XawSimpleMenuAddGlobalActions
12421                         if test $cf_path != default ; then
12422
12423 cf_add_libs="-L$cf_path/lib $cf_libs"
12424 # Filter out duplicates - this happens with badly-designed ".pc" files...
12425 for cf_add_1lib in $LIBS
12426 do
12427         for cf_add_2lib in $cf_add_libs
12428         do
12429                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12430                 then
12431                         cf_add_1lib=
12432                         break
12433                 fi
12434         done
12435         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12436 done
12437 LIBS="$cf_add_libs"
12438
12439                                 echo "$as_me:12439: checking for $cf_libs in $cf_path" >&5
12440 echo $ECHO_N "checking for $cf_libs in $cf_path... $ECHO_C" >&6
12441                         else
12442
12443 cf_add_libs="$cf_libs"
12444 # Filter out duplicates - this happens with badly-designed ".pc" files...
12445 for cf_add_1lib in $LIBS
12446 do
12447         for cf_add_2lib in $cf_add_libs
12448         do
12449                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12450                 then
12451                         cf_add_1lib=
12452                         break
12453                 fi
12454         done
12455         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12456 done
12457 LIBS="$cf_add_libs"
12458
12459                                 echo "$as_me:12459: checking for $cf_test in $cf_libs" >&5
12460 echo $ECHO_N "checking for $cf_test in $cf_libs... $ECHO_C" >&6
12461                         fi
12462                         cat >conftest.$ac_ext <<_ACEOF
12463 #line 12463 "configure"
12464 #include "confdefs.h"
12465
12466 #include <X11/Intrinsic.h>
12467 #include <X11/$cf_x_athena_root/SimpleMenu.h>
12468
12469 int
12470 main ()
12471 {
12472
12473 $cf_test((XtAppContext) 0)
12474   ;
12475   return 0;
12476 }
12477 _ACEOF
12478 rm -f conftest.$ac_objext conftest$ac_exeext
12479 if { (eval echo "$as_me:12479: \"$ac_link\"") >&5
12480   (eval $ac_link) 2>&5
12481   ac_status=$?
12482   echo "$as_me:12482: \$? = $ac_status" >&5
12483   (exit $ac_status); } &&
12484          { ac_try='test -s conftest$ac_exeext'
12485   { (eval echo "$as_me:12485: \"$ac_try\"") >&5
12486   (eval $ac_try) 2>&5
12487   ac_status=$?
12488   echo "$as_me:12488: \$? = $ac_status" >&5
12489   (exit $ac_status); }; }; then
12490   cf_result=yes
12491 else
12492   echo "$as_me: failed program was:" >&5
12493 cat conftest.$ac_ext >&5
12494 cf_result=no
12495 fi
12496 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12497                         echo "$as_me:12497: result: $cf_result" >&5
12498 echo "${ECHO_T}$cf_result" >&6
12499                         if test "$cf_result" = yes ; then
12500                                 cf_x_athena_lib="$cf_libs"
12501                                 break
12502                         fi
12503                         LIBS="$cf_save"
12504                 fi
12505         done # cf_libs
12506                 test -n "$cf_x_athena_lib" && break
12507         done # cf_lib
12508 done
12509
12510 if test -z "$cf_x_athena_lib" ; then
12511         { { echo "$as_me:12511: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&5
12512 echo "$as_me: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&2;}
12513    { (exit 1); exit 1; }; }
12514 fi
12515
12516 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
12517
12518 cat >>confdefs.h <<EOF
12519 #define $cf_x_athena_LIBS 1
12520 EOF
12521
12522 fi
12523
12524 if test -n "$ac_tool_prefix"; then
12525   for ac_prog in xcurses-config
12526   do
12527     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
12528 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
12529 echo "$as_me:12529: checking for $ac_word" >&5
12530 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
12531 if test "${ac_cv_prog_XCURSES_CONFIG+set}" = set; then
12532   echo $ECHO_N "(cached) $ECHO_C" >&6
12533 else
12534   if test -n "$XCURSES_CONFIG"; then
12535   ac_cv_prog_XCURSES_CONFIG="$XCURSES_CONFIG" # Let the user override the test.
12536 else
12537   ac_save_IFS=$IFS; IFS=$ac_path_separator
12538 ac_dummy="$PATH"
12539 for ac_dir in $ac_dummy; do
12540   IFS=$ac_save_IFS
12541   test -z "$ac_dir" && ac_dir=.
12542   $as_executable_p "$ac_dir/$ac_word" || continue
12543 ac_cv_prog_XCURSES_CONFIG="$ac_tool_prefix$ac_prog"
12544 echo "$as_me:12544: found $ac_dir/$ac_word" >&5
12545 break
12546 done
12547
12548 fi
12549 fi
12550 XCURSES_CONFIG=$ac_cv_prog_XCURSES_CONFIG
12551 if test -n "$XCURSES_CONFIG"; then
12552   echo "$as_me:12552: result: $XCURSES_CONFIG" >&5
12553 echo "${ECHO_T}$XCURSES_CONFIG" >&6
12554 else
12555   echo "$as_me:12555: result: no" >&5
12556 echo "${ECHO_T}no" >&6
12557 fi
12558
12559     test -n "$XCURSES_CONFIG" && break
12560   done
12561 fi
12562 if test -z "$XCURSES_CONFIG"; then
12563   ac_ct_XCURSES_CONFIG=$XCURSES_CONFIG
12564   for ac_prog in xcurses-config
12565 do
12566   # Extract the first word of "$ac_prog", so it can be a program name with args.
12567 set dummy $ac_prog; ac_word=$2
12568 echo "$as_me:12568: checking for $ac_word" >&5
12569 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
12570 if test "${ac_cv_prog_ac_ct_XCURSES_CONFIG+set}" = set; then
12571   echo $ECHO_N "(cached) $ECHO_C" >&6
12572 else
12573   if test -n "$ac_ct_XCURSES_CONFIG"; then
12574   ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_ct_XCURSES_CONFIG" # Let the user override the test.
12575 else
12576   ac_save_IFS=$IFS; IFS=$ac_path_separator
12577 ac_dummy="$PATH"
12578 for ac_dir in $ac_dummy; do
12579   IFS=$ac_save_IFS
12580   test -z "$ac_dir" && ac_dir=.
12581   $as_executable_p "$ac_dir/$ac_word" || continue
12582 ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_prog"
12583 echo "$as_me:12583: found $ac_dir/$ac_word" >&5
12584 break
12585 done
12586
12587 fi
12588 fi
12589 ac_ct_XCURSES_CONFIG=$ac_cv_prog_ac_ct_XCURSES_CONFIG
12590 if test -n "$ac_ct_XCURSES_CONFIG"; then
12591   echo "$as_me:12591: result: $ac_ct_XCURSES_CONFIG" >&5
12592 echo "${ECHO_T}$ac_ct_XCURSES_CONFIG" >&6
12593 else
12594   echo "$as_me:12594: result: no" >&5
12595 echo "${ECHO_T}no" >&6
12596 fi
12597
12598   test -n "$ac_ct_XCURSES_CONFIG" && break
12599 done
12600 test -n "$ac_ct_XCURSES_CONFIG" || ac_ct_XCURSES_CONFIG="none"
12601
12602   XCURSES_CONFIG=$ac_ct_XCURSES_CONFIG
12603 fi
12604
12605 if test "$XCURSES_CONFIG" != none ; then
12606
12607 CPPFLAGS="$CPPFLAGS `$XCURSES_CONFIG --cflags`"
12608
12609 cf_add_libs="`$XCURSES_CONFIG --libs`"
12610 # Filter out duplicates - this happens with badly-designed ".pc" files...
12611 for cf_add_1lib in $LIBS
12612 do
12613         for cf_add_2lib in $cf_add_libs
12614         do
12615                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12616                 then
12617                         cf_add_1lib=
12618                         break
12619                 fi
12620         done
12621         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12622 done
12623 LIBS="$cf_add_libs"
12624
12625 cf_cv_lib_XCurses=yes
12626
12627 else
12628
12629 LDFLAGS="$LDFLAGS $X_LIBS"
12630
12631 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
12632
12633 echo "${as_me:-configure}:12633: testing checking additions to CFLAGS ..." 1>&5
12634
12635 cf_check_cflags="$CFLAGS"
12636 cf_check_cppflags="$CPPFLAGS"
12637
12638 cf_fix_cppflags=no
12639 cf_new_cflags=
12640 cf_new_cppflags=
12641 cf_new_extra_cppflags=
12642
12643 for cf_add_cflags in $X_CFLAGS
12644 do
12645 case $cf_fix_cppflags in
12646 (no)
12647         case $cf_add_cflags in
12648         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12649                 case $cf_add_cflags in
12650                 (-D*)
12651                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12652
12653                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12654                                 && test -z "${cf_tst_cflags}" \
12655                                 && cf_fix_cppflags=yes
12656
12657                         if test $cf_fix_cppflags = yes ; then
12658                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12659                                 continue
12660                         elif test "${cf_tst_cflags}" = "\"'" ; then
12661                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12662                                 continue
12663                         fi
12664                         ;;
12665                 esac
12666                 case "$CPPFLAGS" in
12667                 (*$cf_add_cflags)
12668                         ;;
12669                 (*)
12670                         case $cf_add_cflags in
12671                         (-D*)
12672                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12673
12674 CPPFLAGS=`echo "$CPPFLAGS" | \
12675         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12676                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12677
12678                                 ;;
12679                         esac
12680                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
12681                         ;;
12682                 esac
12683                 ;;
12684         (*)
12685                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
12686                 ;;
12687         esac
12688         ;;
12689 (yes)
12690         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12691
12692         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12693
12694         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12695                 && test -z "${cf_tst_cflags}" \
12696                 && cf_fix_cppflags=no
12697         ;;
12698 esac
12699 done
12700
12701 if test -n "$cf_new_cflags" ; then
12702         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
12703
12704 echo "${as_me:-configure}:12704: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
12705
12706         CFLAGS="$CFLAGS $cf_new_cflags"
12707 fi
12708
12709 if test -n "$cf_new_cppflags" ; then
12710         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
12711
12712 echo "${as_me:-configure}:12712: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
12713
12714         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
12715 fi
12716
12717 if test -n "$cf_new_extra_cppflags" ; then
12718         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
12719
12720 echo "${as_me:-configure}:12720: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
12721
12722         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
12723 fi
12724
12725 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
12726 cat >conftest.$ac_ext <<_ACEOF
12727 #line 12727 "configure"
12728 #include "confdefs.h"
12729 #include <stdio.h>
12730 int
12731 main ()
12732 {
12733 printf("Hello world");
12734   ;
12735   return 0;
12736 }
12737 _ACEOF
12738 rm -f conftest.$ac_objext conftest$ac_exeext
12739 if { (eval echo "$as_me:12739: \"$ac_link\"") >&5
12740   (eval $ac_link) 2>&5
12741   ac_status=$?
12742   echo "$as_me:12742: \$? = $ac_status" >&5
12743   (exit $ac_status); } &&
12744          { ac_try='test -s conftest$ac_exeext'
12745   { (eval echo "$as_me:12745: \"$ac_try\"") >&5
12746   (eval $ac_try) 2>&5
12747   ac_status=$?
12748   echo "$as_me:12748: \$? = $ac_status" >&5
12749   (exit $ac_status); }; }; then
12750   :
12751 else
12752   echo "$as_me: failed program was:" >&5
12753 cat conftest.$ac_ext >&5
12754 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
12755
12756 echo "${as_me:-configure}:12756: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
12757
12758          if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
12759                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
12760
12761 echo "${as_me:-configure}:12761: testing but keeping change to \$CPPFLAGS ..." 1>&5
12762
12763          fi
12764          CFLAGS="$cf_check_flags"
12765 fi
12766 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12767 fi
12768
12769 echo "$as_me:12769: checking for XOpenDisplay in -lX11" >&5
12770 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
12771 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
12772   echo $ECHO_N "(cached) $ECHO_C" >&6
12773 else
12774   ac_check_lib_save_LIBS=$LIBS
12775 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
12776 cat >conftest.$ac_ext <<_ACEOF
12777 #line 12777 "configure"
12778 #include "confdefs.h"
12779
12780 /* Override any gcc2 internal prototype to avoid an error.  */
12781 #ifdef __cplusplus
12782 extern "C"
12783 #endif
12784 /* We use char because int might match the return type of a gcc2
12785    builtin and then its argument prototype would still apply.  */
12786 char XOpenDisplay ();
12787 int
12788 main ()
12789 {
12790 XOpenDisplay ();
12791   ;
12792   return 0;
12793 }
12794 _ACEOF
12795 rm -f conftest.$ac_objext conftest$ac_exeext
12796 if { (eval echo "$as_me:12796: \"$ac_link\"") >&5
12797   (eval $ac_link) 2>&5
12798   ac_status=$?
12799   echo "$as_me:12799: \$? = $ac_status" >&5
12800   (exit $ac_status); } &&
12801          { ac_try='test -s conftest$ac_exeext'
12802   { (eval echo "$as_me:12802: \"$ac_try\"") >&5
12803   (eval $ac_try) 2>&5
12804   ac_status=$?
12805   echo "$as_me:12805: \$? = $ac_status" >&5
12806   (exit $ac_status); }; }; then
12807   ac_cv_lib_X11_XOpenDisplay=yes
12808 else
12809   echo "$as_me: failed program was:" >&5
12810 cat conftest.$ac_ext >&5
12811 ac_cv_lib_X11_XOpenDisplay=no
12812 fi
12813 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12814 LIBS=$ac_check_lib_save_LIBS
12815 fi
12816 echo "$as_me:12816: result: $ac_cv_lib_X11_XOpenDisplay" >&5
12817 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
12818 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
12819
12820 cf_add_libs="-lX11"
12821 # Filter out duplicates - this happens with badly-designed ".pc" files...
12822 for cf_add_1lib in $LIBS
12823 do
12824         for cf_add_2lib in $cf_add_libs
12825         do
12826                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12827                 then
12828                         cf_add_1lib=
12829                         break
12830                 fi
12831         done
12832         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12833 done
12834 LIBS="$cf_add_libs"
12835
12836 fi
12837
12838 echo "$as_me:12838: checking for XCurses library" >&5
12839 echo $ECHO_N "checking for XCurses library... $ECHO_C" >&6
12840 if test "${cf_cv_lib_XCurses+set}" = set; then
12841   echo $ECHO_N "(cached) $ECHO_C" >&6
12842 else
12843
12844 cf_add_libs="-lXCurses"
12845 # Filter out duplicates - this happens with badly-designed ".pc" files...
12846 for cf_add_1lib in $LIBS
12847 do
12848         for cf_add_2lib in $cf_add_libs
12849         do
12850                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12851                 then
12852                         cf_add_1lib=
12853                         break
12854                 fi
12855         done
12856         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12857 done
12858 LIBS="$cf_add_libs"
12859
12860 cat >conftest.$ac_ext <<_ACEOF
12861 #line 12861 "configure"
12862 #include "confdefs.h"
12863
12864 #include <xcurses.h>
12865 char *XCursesProgramName = "test";
12866
12867 int
12868 main ()
12869 {
12870 XCursesExit();
12871   ;
12872   return 0;
12873 }
12874 _ACEOF
12875 rm -f conftest.$ac_objext conftest$ac_exeext
12876 if { (eval echo "$as_me:12876: \"$ac_link\"") >&5
12877   (eval $ac_link) 2>&5
12878   ac_status=$?
12879   echo "$as_me:12879: \$? = $ac_status" >&5
12880   (exit $ac_status); } &&
12881          { ac_try='test -s conftest$ac_exeext'
12882   { (eval echo "$as_me:12882: \"$ac_try\"") >&5
12883   (eval $ac_try) 2>&5
12884   ac_status=$?
12885   echo "$as_me:12885: \$? = $ac_status" >&5
12886   (exit $ac_status); }; }; then
12887   cf_cv_lib_XCurses=yes
12888 else
12889   echo "$as_me: failed program was:" >&5
12890 cat conftest.$ac_ext >&5
12891 cf_cv_lib_XCurses=no
12892 fi
12893 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12894
12895 fi
12896 echo "$as_me:12896: result: $cf_cv_lib_XCurses" >&5
12897 echo "${ECHO_T}$cf_cv_lib_XCurses" >&6
12898
12899 fi
12900
12901 if test $cf_cv_lib_XCurses = yes ; then
12902
12903 cat >>confdefs.h <<\EOF
12904 #define UNIX 1
12905 EOF
12906
12907 cat >>confdefs.h <<\EOF
12908 #define XCURSES 1
12909 EOF
12910
12911         echo "$as_me:12911: checking for xcurses.h" >&5
12912 echo $ECHO_N "checking for xcurses.h... $ECHO_C" >&6
12913 if test "${ac_cv_header_xcurses_h+set}" = set; then
12914   echo $ECHO_N "(cached) $ECHO_C" >&6
12915 else
12916   cat >conftest.$ac_ext <<_ACEOF
12917 #line 12917 "configure"
12918 #include "confdefs.h"
12919 #include <xcurses.h>
12920 _ACEOF
12921 if { (eval echo "$as_me:12921: \"$ac_cpp conftest.$ac_ext\"") >&5
12922   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
12923   ac_status=$?
12924   egrep -v '^ *\+' conftest.er1 >conftest.err
12925   rm -f conftest.er1
12926   cat conftest.err >&5
12927   echo "$as_me:12927: \$? = $ac_status" >&5
12928   (exit $ac_status); } >/dev/null; then
12929   if test -s conftest.err; then
12930     ac_cpp_err=$ac_c_preproc_warn_flag
12931   else
12932     ac_cpp_err=
12933   fi
12934 else
12935   ac_cpp_err=yes
12936 fi
12937 if test -z "$ac_cpp_err"; then
12938   ac_cv_header_xcurses_h=yes
12939 else
12940   echo "$as_me: failed program was:" >&5
12941   cat conftest.$ac_ext >&5
12942   ac_cv_header_xcurses_h=no
12943 fi
12944 rm -f conftest.err conftest.$ac_ext
12945 fi
12946 echo "$as_me:12946: result: $ac_cv_header_xcurses_h" >&5
12947 echo "${ECHO_T}$ac_cv_header_xcurses_h" >&6
12948 if test $ac_cv_header_xcurses_h = yes; then
12949
12950 cat >>confdefs.h <<\EOF
12951 #define HAVE_XCURSES 1
12952 EOF
12953
12954 fi
12955
12956 else
12957         { { echo "$as_me:12957: error: Cannot link with XCurses" >&5
12958 echo "$as_me: error: Cannot link with XCurses" >&2;}
12959    { (exit 1); exit 1; }; }
12960 fi
12961
12962         ;;
12963 (*)
12964         { { echo "$as_me:12964: error: unexpected screen-value: $cf_cv_screen" >&5
12965 echo "$as_me: error: unexpected screen-value: $cf_cv_screen" >&2;}
12966    { (exit 1); exit 1; }; }
12967         ;;
12968 esac
12969
12970 case $cf_cv_screen in
12971 (ncurses*)
12972         cf_cv_libtype=`echo "$cf_cv_screen" | sed -e 's/^ncurses//'`
12973         ;;
12974 (curses|curses_*)
12975
12976 echo "$as_me:12976: checking for NetBSD form.h" >&5
12977 echo $ECHO_N "checking for NetBSD form.h... $ECHO_C" >&6
12978 if test "${cf_cv_netbsd_form_h+set}" = set; then
12979   echo $ECHO_N "(cached) $ECHO_C" >&6
12980 else
12981
12982 cat >conftest.$ac_ext <<_ACEOF
12983 #line 12983 "configure"
12984 #include "confdefs.h"
12985
12986 #include <${cf_cv_ncurses_header:-curses.h}>
12987 #include <form.h>
12988
12989 int
12990 main ()
12991 {
12992
12993         FORM *form;
12994         int y = current_field(form)->cursor_ypos;
12995         int x = current_field(form)->cursor_xpos;
12996
12997   ;
12998   return 0;
12999 }
13000 _ACEOF
13001 rm -f conftest.$ac_objext
13002 if { (eval echo "$as_me:13002: \"$ac_compile\"") >&5
13003   (eval $ac_compile) 2>&5
13004   ac_status=$?
13005   echo "$as_me:13005: \$? = $ac_status" >&5
13006   (exit $ac_status); } &&
13007          { ac_try='test -s conftest.$ac_objext'
13008   { (eval echo "$as_me:13008: \"$ac_try\"") >&5
13009   (eval $ac_try) 2>&5
13010   ac_status=$?
13011   echo "$as_me:13011: \$? = $ac_status" >&5
13012   (exit $ac_status); }; }; then
13013   cf_cv_netbsd_form_h=yes
13014
13015 else
13016   echo "$as_me: failed program was:" >&5
13017 cat conftest.$ac_ext >&5
13018 cf_cv_netbsd_form_h=no
13019 fi
13020 rm -f conftest.$ac_objext conftest.$ac_ext
13021
13022 fi
13023 echo "$as_me:13023: result: $cf_cv_netbsd_form_h" >&5
13024 echo "${ECHO_T}$cf_cv_netbsd_form_h" >&6
13025
13026 test "$cf_cv_netbsd_form_h" = yes &&
13027 cat >>confdefs.h <<\EOF
13028 #define HAVE_NETBSD_FORM_H 1
13029 EOF
13030
13031 echo "$as_me:13031: checking for NetBSD menu.h" >&5
13032 echo $ECHO_N "checking for NetBSD menu.h... $ECHO_C" >&6
13033 if test "${cf_cv_netbsd_menu_h+set}" = set; then
13034   echo $ECHO_N "(cached) $ECHO_C" >&6
13035 else
13036
13037 cat >conftest.$ac_ext <<_ACEOF
13038 #line 13038 "configure"
13039 #include "confdefs.h"
13040
13041 #include <${cf_cv_ncurses_header:-curses.h}>
13042 #include <menu.h>
13043
13044 int
13045 main ()
13046 {
13047
13048         MENU *menu;
13049         int y = menu->max_item_width;
13050
13051   ;
13052   return 0;
13053 }
13054 _ACEOF
13055 rm -f conftest.$ac_objext
13056 if { (eval echo "$as_me:13056: \"$ac_compile\"") >&5
13057   (eval $ac_compile) 2>&5
13058   ac_status=$?
13059   echo "$as_me:13059: \$? = $ac_status" >&5
13060   (exit $ac_status); } &&
13061          { ac_try='test -s conftest.$ac_objext'
13062   { (eval echo "$as_me:13062: \"$ac_try\"") >&5
13063   (eval $ac_try) 2>&5
13064   ac_status=$?
13065   echo "$as_me:13065: \$? = $ac_status" >&5
13066   (exit $ac_status); }; }; then
13067   cf_cv_netbsd_menu_h=yes
13068
13069 else
13070   echo "$as_me: failed program was:" >&5
13071 cat conftest.$ac_ext >&5
13072 cf_cv_netbsd_menu_h=no
13073 fi
13074 rm -f conftest.$ac_objext conftest.$ac_ext
13075
13076 fi
13077 echo "$as_me:13077: result: $cf_cv_netbsd_menu_h" >&5
13078 echo "${ECHO_T}$cf_cv_netbsd_menu_h" >&6
13079
13080 test "$cf_cv_netbsd_menu_h" = yes &&
13081 cat >>confdefs.h <<\EOF
13082 #define HAVE_NETBSD_MENU_H 1
13083 EOF
13084
13085         ;;
13086 esac
13087
13088 case $cf_cv_screen in
13089 (pdcurses)
13090         ;;
13091 (*)
13092         # look for curses-related libraries
13093
13094 as_ac_Lib=`echo "ac_cv_lib_panel$cf_cv_libtype''_new_panel" | $as_tr_sh`
13095 echo "$as_me:13095: checking for new_panel in -lpanel$cf_cv_libtype" >&5
13096 echo $ECHO_N "checking for new_panel in -lpanel$cf_cv_libtype... $ECHO_C" >&6
13097 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
13098   echo $ECHO_N "(cached) $ECHO_C" >&6
13099 else
13100   ac_check_lib_save_LIBS=$LIBS
13101 LIBS="-lpanel$cf_cv_libtype  $LIBS"
13102 cat >conftest.$ac_ext <<_ACEOF
13103 #line 13103 "configure"
13104 #include "confdefs.h"
13105
13106 /* Override any gcc2 internal prototype to avoid an error.  */
13107 #ifdef __cplusplus
13108 extern "C"
13109 #endif
13110 /* We use char because int might match the return type of a gcc2
13111    builtin and then its argument prototype would still apply.  */
13112 char new_panel ();
13113 int
13114 main ()
13115 {
13116 new_panel ();
13117   ;
13118   return 0;
13119 }
13120 _ACEOF
13121 rm -f conftest.$ac_objext conftest$ac_exeext
13122 if { (eval echo "$as_me:13122: \"$ac_link\"") >&5
13123   (eval $ac_link) 2>&5
13124   ac_status=$?
13125   echo "$as_me:13125: \$? = $ac_status" >&5
13126   (exit $ac_status); } &&
13127          { ac_try='test -s conftest$ac_exeext'
13128   { (eval echo "$as_me:13128: \"$ac_try\"") >&5
13129   (eval $ac_try) 2>&5
13130   ac_status=$?
13131   echo "$as_me:13131: \$? = $ac_status" >&5
13132   (exit $ac_status); }; }; then
13133   eval "$as_ac_Lib=yes"
13134 else
13135   echo "$as_me: failed program was:" >&5
13136 cat conftest.$ac_ext >&5
13137 eval "$as_ac_Lib=no"
13138 fi
13139 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13140 LIBS=$ac_check_lib_save_LIBS
13141 fi
13142 echo "$as_me:13142: result: `eval echo '${'$as_ac_Lib'}'`" >&5
13143 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
13144 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
13145
13146 cf_upper=`echo "have_libpanel" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
13147
13148 cf_add_libs="-lpanel$cf_cv_libtype"
13149 # Filter out duplicates - this happens with badly-designed ".pc" files...
13150 for cf_add_1lib in $LIBS
13151 do
13152         for cf_add_2lib in $cf_add_libs
13153         do
13154                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13155                 then
13156                         cf_add_1lib=
13157                         break
13158                 fi
13159         done
13160         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13161 done
13162 LIBS="$cf_add_libs"
13163
13164 cat >>confdefs.h <<EOF
13165 #define $cf_upper 1
13166 EOF
13167
13168 fi
13169
13170 as_ac_Lib=`echo "ac_cv_lib_menu$cf_cv_libtype''_menu_driver" | $as_tr_sh`
13171 echo "$as_me:13171: checking for menu_driver in -lmenu$cf_cv_libtype" >&5
13172 echo $ECHO_N "checking for menu_driver in -lmenu$cf_cv_libtype... $ECHO_C" >&6
13173 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
13174   echo $ECHO_N "(cached) $ECHO_C" >&6
13175 else
13176   ac_check_lib_save_LIBS=$LIBS
13177 LIBS="-lmenu$cf_cv_libtype  $LIBS"
13178 cat >conftest.$ac_ext <<_ACEOF
13179 #line 13179 "configure"
13180 #include "confdefs.h"
13181
13182 /* Override any gcc2 internal prototype to avoid an error.  */
13183 #ifdef __cplusplus
13184 extern "C"
13185 #endif
13186 /* We use char because int might match the return type of a gcc2
13187    builtin and then its argument prototype would still apply.  */
13188 char menu_driver ();
13189 int
13190 main ()
13191 {
13192 menu_driver ();
13193   ;
13194   return 0;
13195 }
13196 _ACEOF
13197 rm -f conftest.$ac_objext conftest$ac_exeext
13198 if { (eval echo "$as_me:13198: \"$ac_link\"") >&5
13199   (eval $ac_link) 2>&5
13200   ac_status=$?
13201   echo "$as_me:13201: \$? = $ac_status" >&5
13202   (exit $ac_status); } &&
13203          { ac_try='test -s conftest$ac_exeext'
13204   { (eval echo "$as_me:13204: \"$ac_try\"") >&5
13205   (eval $ac_try) 2>&5
13206   ac_status=$?
13207   echo "$as_me:13207: \$? = $ac_status" >&5
13208   (exit $ac_status); }; }; then
13209   eval "$as_ac_Lib=yes"
13210 else
13211   echo "$as_me: failed program was:" >&5
13212 cat conftest.$ac_ext >&5
13213 eval "$as_ac_Lib=no"
13214 fi
13215 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13216 LIBS=$ac_check_lib_save_LIBS
13217 fi
13218 echo "$as_me:13218: result: `eval echo '${'$as_ac_Lib'}'`" >&5
13219 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
13220 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
13221
13222 cf_upper=`echo "have_libmenu" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
13223
13224 cf_add_libs="-lmenu$cf_cv_libtype"
13225 # Filter out duplicates - this happens with badly-designed ".pc" files...
13226 for cf_add_1lib in $LIBS
13227 do
13228         for cf_add_2lib in $cf_add_libs
13229         do
13230                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13231                 then
13232                         cf_add_1lib=
13233                         break
13234                 fi
13235         done
13236         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13237 done
13238 LIBS="$cf_add_libs"
13239
13240 cat >>confdefs.h <<EOF
13241 #define $cf_upper 1
13242 EOF
13243
13244 fi
13245
13246 as_ac_Lib=`echo "ac_cv_lib_form$cf_cv_libtype''_form_driver" | $as_tr_sh`
13247 echo "$as_me:13247: checking for form_driver in -lform$cf_cv_libtype" >&5
13248 echo $ECHO_N "checking for form_driver in -lform$cf_cv_libtype... $ECHO_C" >&6
13249 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
13250   echo $ECHO_N "(cached) $ECHO_C" >&6
13251 else
13252   ac_check_lib_save_LIBS=$LIBS
13253 LIBS="-lform$cf_cv_libtype  $LIBS"
13254 cat >conftest.$ac_ext <<_ACEOF
13255 #line 13255 "configure"
13256 #include "confdefs.h"
13257
13258 /* Override any gcc2 internal prototype to avoid an error.  */
13259 #ifdef __cplusplus
13260 extern "C"
13261 #endif
13262 /* We use char because int might match the return type of a gcc2
13263    builtin and then its argument prototype would still apply.  */
13264 char form_driver ();
13265 int
13266 main ()
13267 {
13268 form_driver ();
13269   ;
13270   return 0;
13271 }
13272 _ACEOF
13273 rm -f conftest.$ac_objext conftest$ac_exeext
13274 if { (eval echo "$as_me:13274: \"$ac_link\"") >&5
13275   (eval $ac_link) 2>&5
13276   ac_status=$?
13277   echo "$as_me:13277: \$? = $ac_status" >&5
13278   (exit $ac_status); } &&
13279          { ac_try='test -s conftest$ac_exeext'
13280   { (eval echo "$as_me:13280: \"$ac_try\"") >&5
13281   (eval $ac_try) 2>&5
13282   ac_status=$?
13283   echo "$as_me:13283: \$? = $ac_status" >&5
13284   (exit $ac_status); }; }; then
13285   eval "$as_ac_Lib=yes"
13286 else
13287   echo "$as_me: failed program was:" >&5
13288 cat conftest.$ac_ext >&5
13289 eval "$as_ac_Lib=no"
13290 fi
13291 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13292 LIBS=$ac_check_lib_save_LIBS
13293 fi
13294 echo "$as_me:13294: result: `eval echo '${'$as_ac_Lib'}'`" >&5
13295 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
13296 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
13297
13298 cf_upper=`echo "have_libform" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
13299
13300 cf_add_libs="-lform$cf_cv_libtype"
13301 # Filter out duplicates - this happens with badly-designed ".pc" files...
13302 for cf_add_1lib in $LIBS
13303 do
13304         for cf_add_2lib in $cf_add_libs
13305         do
13306                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13307                 then
13308                         cf_add_1lib=
13309                         break
13310                 fi
13311         done
13312         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13313 done
13314 LIBS="$cf_add_libs"
13315
13316 cat >>confdefs.h <<EOF
13317 #define $cf_upper 1
13318 EOF
13319
13320 fi
13321
13322         # look for curses-related headers
13323
13324 for ac_header in \
13325                 nc_alloc.h \
13326                 nomacros.h \
13327                 form.h \
13328                 menu.h \
13329                 panel.h \
13330                 term_entry.h \
13331
13332 do
13333 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
13334 echo "$as_me:13334: checking for $ac_header" >&5
13335 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
13336 if eval "test \"\${$as_ac_Header+set}\" = set"; then
13337   echo $ECHO_N "(cached) $ECHO_C" >&6
13338 else
13339   cat >conftest.$ac_ext <<_ACEOF
13340 #line 13340 "configure"
13341 #include "confdefs.h"
13342 #include <$ac_header>
13343 _ACEOF
13344 if { (eval echo "$as_me:13344: \"$ac_cpp conftest.$ac_ext\"") >&5
13345   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13346   ac_status=$?
13347   egrep -v '^ *\+' conftest.er1 >conftest.err
13348   rm -f conftest.er1
13349   cat conftest.err >&5
13350   echo "$as_me:13350: \$? = $ac_status" >&5
13351   (exit $ac_status); } >/dev/null; then
13352   if test -s conftest.err; then
13353     ac_cpp_err=$ac_c_preproc_warn_flag
13354   else
13355     ac_cpp_err=
13356   fi
13357 else
13358   ac_cpp_err=yes
13359 fi
13360 if test -z "$ac_cpp_err"; then
13361   eval "$as_ac_Header=yes"
13362 else
13363   echo "$as_me: failed program was:" >&5
13364   cat conftest.$ac_ext >&5
13365   eval "$as_ac_Header=no"
13366 fi
13367 rm -f conftest.err conftest.$ac_ext
13368 fi
13369 echo "$as_me:13369: result: `eval echo '${'$as_ac_Header'}'`" >&5
13370 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
13371 if test `eval echo '${'$as_ac_Header'}'` = yes; then
13372   cat >>confdefs.h <<EOF
13373 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
13374 EOF
13375
13376 fi
13377 done
13378
13379         ;;
13380 esac
13381
13382 echo "$as_me:13382: checking for ANSI C header files" >&5
13383 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
13384 if test "${ac_cv_header_stdc+set}" = set; then
13385   echo $ECHO_N "(cached) $ECHO_C" >&6
13386 else
13387   cat >conftest.$ac_ext <<_ACEOF
13388 #line 13388 "configure"
13389 #include "confdefs.h"
13390 #include <stdlib.h>
13391 #include <stdarg.h>
13392 #include <string.h>
13393 #include <float.h>
13394
13395 _ACEOF
13396 if { (eval echo "$as_me:13396: \"$ac_cpp conftest.$ac_ext\"") >&5
13397   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13398   ac_status=$?
13399   egrep -v '^ *\+' conftest.er1 >conftest.err
13400   rm -f conftest.er1
13401   cat conftest.err >&5
13402   echo "$as_me:13402: \$? = $ac_status" >&5
13403   (exit $ac_status); } >/dev/null; then
13404   if test -s conftest.err; then
13405     ac_cpp_err=$ac_c_preproc_warn_flag
13406   else
13407     ac_cpp_err=
13408   fi
13409 else
13410   ac_cpp_err=yes
13411 fi
13412 if test -z "$ac_cpp_err"; then
13413   ac_cv_header_stdc=yes
13414 else
13415   echo "$as_me: failed program was:" >&5
13416   cat conftest.$ac_ext >&5
13417   ac_cv_header_stdc=no
13418 fi
13419 rm -f conftest.err conftest.$ac_ext
13420
13421 if test $ac_cv_header_stdc = yes; then
13422   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
13423   cat >conftest.$ac_ext <<_ACEOF
13424 #line 13424 "configure"
13425 #include "confdefs.h"
13426 #include <string.h>
13427
13428 _ACEOF
13429 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13430   egrep "memchr" >/dev/null 2>&1; then
13431   :
13432 else
13433   ac_cv_header_stdc=no
13434 fi
13435 rm -rf conftest*
13436
13437 fi
13438
13439 if test $ac_cv_header_stdc = yes; then
13440   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
13441   cat >conftest.$ac_ext <<_ACEOF
13442 #line 13442 "configure"
13443 #include "confdefs.h"
13444 #include <stdlib.h>
13445
13446 _ACEOF
13447 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13448   egrep "free" >/dev/null 2>&1; then
13449   :
13450 else
13451   ac_cv_header_stdc=no
13452 fi
13453 rm -rf conftest*
13454
13455 fi
13456
13457 if test $ac_cv_header_stdc = yes; then
13458   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
13459   if test "$cross_compiling" = yes; then
13460   :
13461 else
13462   cat >conftest.$ac_ext <<_ACEOF
13463 #line 13463 "configure"
13464 #include "confdefs.h"
13465 #include <ctype.h>
13466 #if ((' ' & 0x0FF) == 0x020)
13467 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
13468 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
13469 #else
13470 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
13471                      || ('j' <= (c) && (c) <= 'r') \
13472                      || ('s' <= (c) && (c) <= 'z'))
13473 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
13474 #endif
13475
13476 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
13477 int
13478 main ()
13479 {
13480   int i;
13481   for (i = 0; i < 256; i++)
13482     if (XOR (islower (i), ISLOWER (i))
13483         || toupper (i) != TOUPPER (i))
13484       $ac_main_return(2);
13485   $ac_main_return (0);
13486 }
13487 _ACEOF
13488 rm -f conftest$ac_exeext
13489 if { (eval echo "$as_me:13489: \"$ac_link\"") >&5
13490   (eval $ac_link) 2>&5
13491   ac_status=$?
13492   echo "$as_me:13492: \$? = $ac_status" >&5
13493   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
13494   { (eval echo "$as_me:13494: \"$ac_try\"") >&5
13495   (eval $ac_try) 2>&5
13496   ac_status=$?
13497   echo "$as_me:13497: \$? = $ac_status" >&5
13498   (exit $ac_status); }; }; then
13499   :
13500 else
13501   echo "$as_me: program exited with status $ac_status" >&5
13502 echo "$as_me: failed program was:" >&5
13503 cat conftest.$ac_ext >&5
13504 ac_cv_header_stdc=no
13505 fi
13506 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
13507 fi
13508 fi
13509 fi
13510 echo "$as_me:13510: result: $ac_cv_header_stdc" >&5
13511 echo "${ECHO_T}$ac_cv_header_stdc" >&6
13512 if test $ac_cv_header_stdc = yes; then
13513
13514 cat >>confdefs.h <<\EOF
13515 #define STDC_HEADERS 1
13516 EOF
13517
13518 fi
13519
13520 echo "$as_me:13520: checking whether time.h and sys/time.h may both be included" >&5
13521 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
13522 if test "${ac_cv_header_time+set}" = set; then
13523   echo $ECHO_N "(cached) $ECHO_C" >&6
13524 else
13525   cat >conftest.$ac_ext <<_ACEOF
13526 #line 13526 "configure"
13527 #include "confdefs.h"
13528 #include <sys/types.h>
13529 #include <sys/time.h>
13530 #include <time.h>
13531
13532 int
13533 main ()
13534 {
13535 if ((struct tm *) 0)
13536 return 0;
13537   ;
13538   return 0;
13539 }
13540 _ACEOF
13541 rm -f conftest.$ac_objext
13542 if { (eval echo "$as_me:13542: \"$ac_compile\"") >&5
13543   (eval $ac_compile) 2>&5
13544   ac_status=$?
13545   echo "$as_me:13545: \$? = $ac_status" >&5
13546   (exit $ac_status); } &&
13547          { ac_try='test -s conftest.$ac_objext'
13548   { (eval echo "$as_me:13548: \"$ac_try\"") >&5
13549   (eval $ac_try) 2>&5
13550   ac_status=$?
13551   echo "$as_me:13551: \$? = $ac_status" >&5
13552   (exit $ac_status); }; }; then
13553   ac_cv_header_time=yes
13554 else
13555   echo "$as_me: failed program was:" >&5
13556 cat conftest.$ac_ext >&5
13557 ac_cv_header_time=no
13558 fi
13559 rm -f conftest.$ac_objext conftest.$ac_ext
13560 fi
13561 echo "$as_me:13561: result: $ac_cv_header_time" >&5
13562 echo "${ECHO_T}$ac_cv_header_time" >&6
13563 if test $ac_cv_header_time = yes; then
13564
13565 cat >>confdefs.h <<\EOF
13566 #define TIME_WITH_SYS_TIME 1
13567 EOF
13568
13569 fi
13570
13571 for ac_header in \
13572 getopt.h \
13573 locale.h \
13574 math.h \
13575 stdarg.h \
13576 sys/ioctl.h \
13577 sys/select.h \
13578 sys/time.h \
13579 termios.h \
13580 unistd.h \
13581
13582 do
13583 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
13584 echo "$as_me:13584: checking for $ac_header" >&5
13585 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
13586 if eval "test \"\${$as_ac_Header+set}\" = set"; then
13587   echo $ECHO_N "(cached) $ECHO_C" >&6
13588 else
13589   cat >conftest.$ac_ext <<_ACEOF
13590 #line 13590 "configure"
13591 #include "confdefs.h"
13592 #include <$ac_header>
13593 _ACEOF
13594 if { (eval echo "$as_me:13594: \"$ac_cpp conftest.$ac_ext\"") >&5
13595   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13596   ac_status=$?
13597   egrep -v '^ *\+' conftest.er1 >conftest.err
13598   rm -f conftest.er1
13599   cat conftest.err >&5
13600   echo "$as_me:13600: \$? = $ac_status" >&5
13601   (exit $ac_status); } >/dev/null; then
13602   if test -s conftest.err; then
13603     ac_cpp_err=$ac_c_preproc_warn_flag
13604   else
13605     ac_cpp_err=
13606   fi
13607 else
13608   ac_cpp_err=yes
13609 fi
13610 if test -z "$ac_cpp_err"; then
13611   eval "$as_ac_Header=yes"
13612 else
13613   echo "$as_me: failed program was:" >&5
13614   cat conftest.$ac_ext >&5
13615   eval "$as_ac_Header=no"
13616 fi
13617 rm -f conftest.err conftest.$ac_ext
13618 fi
13619 echo "$as_me:13619: result: `eval echo '${'$as_ac_Header'}'`" >&5
13620 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
13621 if test `eval echo '${'$as_ac_Header'}'` = yes; then
13622   cat >>confdefs.h <<EOF
13623 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
13624 EOF
13625
13626 fi
13627 done
13628
13629 for ac_header in unistd.h getopt.h
13630 do
13631 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
13632 echo "$as_me:13632: checking for $ac_header" >&5
13633 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
13634 if eval "test \"\${$as_ac_Header+set}\" = set"; then
13635   echo $ECHO_N "(cached) $ECHO_C" >&6
13636 else
13637   cat >conftest.$ac_ext <<_ACEOF
13638 #line 13638 "configure"
13639 #include "confdefs.h"
13640 #include <$ac_header>
13641 _ACEOF
13642 if { (eval echo "$as_me:13642: \"$ac_cpp conftest.$ac_ext\"") >&5
13643   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13644   ac_status=$?
13645   egrep -v '^ *\+' conftest.er1 >conftest.err
13646   rm -f conftest.er1
13647   cat conftest.err >&5
13648   echo "$as_me:13648: \$? = $ac_status" >&5
13649   (exit $ac_status); } >/dev/null; then
13650   if test -s conftest.err; then
13651     ac_cpp_err=$ac_c_preproc_warn_flag
13652   else
13653     ac_cpp_err=
13654   fi
13655 else
13656   ac_cpp_err=yes
13657 fi
13658 if test -z "$ac_cpp_err"; then
13659   eval "$as_ac_Header=yes"
13660 else
13661   echo "$as_me: failed program was:" >&5
13662   cat conftest.$ac_ext >&5
13663   eval "$as_ac_Header=no"
13664 fi
13665 rm -f conftest.err conftest.$ac_ext
13666 fi
13667 echo "$as_me:13667: result: `eval echo '${'$as_ac_Header'}'`" >&5
13668 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
13669 if test `eval echo '${'$as_ac_Header'}'` = yes; then
13670   cat >>confdefs.h <<EOF
13671 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
13672 EOF
13673
13674 fi
13675 done
13676
13677 echo "$as_me:13677: checking for header declaring getopt variables" >&5
13678 echo $ECHO_N "checking for header declaring getopt variables... $ECHO_C" >&6
13679 if test "${cf_cv_getopt_header+set}" = set; then
13680   echo $ECHO_N "(cached) $ECHO_C" >&6
13681 else
13682
13683 cf_cv_getopt_header=none
13684 for cf_header in stdio.h stdlib.h unistd.h getopt.h
13685 do
13686 cat >conftest.$ac_ext <<_ACEOF
13687 #line 13687 "configure"
13688 #include "confdefs.h"
13689
13690 #include <$cf_header>
13691 int
13692 main ()
13693 {
13694 int x = optind; char *y = optarg
13695   ;
13696   return 0;
13697 }
13698 _ACEOF
13699 rm -f conftest.$ac_objext
13700 if { (eval echo "$as_me:13700: \"$ac_compile\"") >&5
13701   (eval $ac_compile) 2>&5
13702   ac_status=$?
13703   echo "$as_me:13703: \$? = $ac_status" >&5
13704   (exit $ac_status); } &&
13705          { ac_try='test -s conftest.$ac_objext'
13706   { (eval echo "$as_me:13706: \"$ac_try\"") >&5
13707   (eval $ac_try) 2>&5
13708   ac_status=$?
13709   echo "$as_me:13709: \$? = $ac_status" >&5
13710   (exit $ac_status); }; }; then
13711   cf_cv_getopt_header=$cf_header
13712  break
13713 else
13714   echo "$as_me: failed program was:" >&5
13715 cat conftest.$ac_ext >&5
13716 fi
13717 rm -f conftest.$ac_objext conftest.$ac_ext
13718 done
13719
13720 fi
13721 echo "$as_me:13721: result: $cf_cv_getopt_header" >&5
13722 echo "${ECHO_T}$cf_cv_getopt_header" >&6
13723 if test $cf_cv_getopt_header != none ; then
13724
13725 cat >>confdefs.h <<\EOF
13726 #define HAVE_GETOPT_HEADER 1
13727 EOF
13728
13729 fi
13730 if test $cf_cv_getopt_header = getopt.h ; then
13731
13732 cat >>confdefs.h <<\EOF
13733 #define NEED_GETOPT_H 1
13734 EOF
13735
13736 fi
13737
13738 for ac_func in \
13739 getopt \
13740 gettimeofday \
13741
13742 do
13743 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
13744 echo "$as_me:13744: checking for $ac_func" >&5
13745 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
13746 if eval "test \"\${$as_ac_var+set}\" = set"; then
13747   echo $ECHO_N "(cached) $ECHO_C" >&6
13748 else
13749   cat >conftest.$ac_ext <<_ACEOF
13750 #line 13750 "configure"
13751 #include "confdefs.h"
13752 /* System header to define __stub macros and hopefully few prototypes,
13753     which can conflict with char $ac_func (); below.  */
13754 #include <assert.h>
13755 /* Override any gcc2 internal prototype to avoid an error.  */
13756 #ifdef __cplusplus
13757 extern "C"
13758 #endif
13759 /* We use char because int might match the return type of a gcc2
13760    builtin and then its argument prototype would still apply.  */
13761 char $ac_func ();
13762 char (*f) ();
13763
13764 int
13765 main ()
13766 {
13767 /* The GNU C library defines this for functions which it implements
13768     to always fail with ENOSYS.  Some functions are actually named
13769     something starting with __ and the normal name is an alias.  */
13770 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
13771 choke me
13772 #else
13773 f = $ac_func; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
13774 #endif
13775
13776   ;
13777   return 0;
13778 }
13779 _ACEOF
13780 rm -f conftest.$ac_objext conftest$ac_exeext
13781 if { (eval echo "$as_me:13781: \"$ac_link\"") >&5
13782   (eval $ac_link) 2>&5
13783   ac_status=$?
13784   echo "$as_me:13784: \$? = $ac_status" >&5
13785   (exit $ac_status); } &&
13786          { ac_try='test -s conftest$ac_exeext'
13787   { (eval echo "$as_me:13787: \"$ac_try\"") >&5
13788   (eval $ac_try) 2>&5
13789   ac_status=$?
13790   echo "$as_me:13790: \$? = $ac_status" >&5
13791   (exit $ac_status); }; }; then
13792   eval "$as_ac_var=yes"
13793 else
13794   echo "$as_me: failed program was:" >&5
13795 cat conftest.$ac_ext >&5
13796 eval "$as_ac_var=no"
13797 fi
13798 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13799 fi
13800 echo "$as_me:13800: result: `eval echo '${'$as_ac_var'}'`" >&5
13801 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
13802 if test `eval echo '${'$as_ac_var'}'` = yes; then
13803   cat >>confdefs.h <<EOF
13804 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
13805 EOF
13806
13807 fi
13808 done
13809
13810 if test "x$ac_cv_func_getopt" = xno; then
13811         { { echo "$as_me:13811: error: getopt is required for building programs" >&5
13812 echo "$as_me: error: getopt is required for building programs" >&2;}
13813    { (exit 1); exit 1; }; }
13814 fi
13815
13816 if test "$cf_enable_widec" = yes; then
13817
13818 for ac_func in \
13819 mblen \
13820 mbrlen \
13821 mbrtowc \
13822 mbsrtowcs \
13823 mbstowcs \
13824 mbtowc \
13825 wcsrtombs \
13826 wcstombs \
13827
13828 do
13829 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
13830 echo "$as_me:13830: checking for $ac_func" >&5
13831 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
13832 if eval "test \"\${$as_ac_var+set}\" = set"; then
13833   echo $ECHO_N "(cached) $ECHO_C" >&6
13834 else
13835   cat >conftest.$ac_ext <<_ACEOF
13836 #line 13836 "configure"
13837 #include "confdefs.h"
13838 /* System header to define __stub macros and hopefully few prototypes,
13839     which can conflict with char $ac_func (); below.  */
13840 #include <assert.h>
13841 /* Override any gcc2 internal prototype to avoid an error.  */
13842 #ifdef __cplusplus
13843 extern "C"
13844 #endif
13845 /* We use char because int might match the return type of a gcc2
13846    builtin and then its argument prototype would still apply.  */
13847 char $ac_func ();
13848 char (*f) ();
13849
13850 int
13851 main ()
13852 {
13853 /* The GNU C library defines this for functions which it implements
13854     to always fail with ENOSYS.  Some functions are actually named
13855     something starting with __ and the normal name is an alias.  */
13856 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
13857 choke me
13858 #else
13859 f = $ac_func; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
13860 #endif
13861
13862   ;
13863   return 0;
13864 }
13865 _ACEOF
13866 rm -f conftest.$ac_objext conftest$ac_exeext
13867 if { (eval echo "$as_me:13867: \"$ac_link\"") >&5
13868   (eval $ac_link) 2>&5
13869   ac_status=$?
13870   echo "$as_me:13870: \$? = $ac_status" >&5
13871   (exit $ac_status); } &&
13872          { ac_try='test -s conftest$ac_exeext'
13873   { (eval echo "$as_me:13873: \"$ac_try\"") >&5
13874   (eval $ac_try) 2>&5
13875   ac_status=$?
13876   echo "$as_me:13876: \$? = $ac_status" >&5
13877   (exit $ac_status); }; }; then
13878   eval "$as_ac_var=yes"
13879 else
13880   echo "$as_me: failed program was:" >&5
13881 cat conftest.$ac_ext >&5
13882 eval "$as_ac_var=no"
13883 fi
13884 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13885 fi
13886 echo "$as_me:13886: result: `eval echo '${'$as_ac_var'}'`" >&5
13887 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
13888 if test `eval echo '${'$as_ac_var'}'` = yes; then
13889   cat >>confdefs.h <<EOF
13890 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
13891 EOF
13892
13893 fi
13894 done
13895
13896 fi
13897
13898 echo "$as_me:13898: checking if we must define _XOPEN_SOURCE_EXTENDED" >&5
13899 echo $ECHO_N "checking if we must define _XOPEN_SOURCE_EXTENDED... $ECHO_C" >&6
13900 if test "${cf_cv_need_xopen_extension+set}" = set; then
13901   echo $ECHO_N "(cached) $ECHO_C" >&6
13902 else
13903
13904 cat >conftest.$ac_ext <<_ACEOF
13905 #line 13905 "configure"
13906 #include "confdefs.h"
13907
13908 #include <stdlib.h>
13909 #include <${cf_cv_ncurses_header:-curses.h}>
13910 int
13911 main ()
13912 {
13913
13914 #if defined(NCURSES_VERSION_PATCH)
13915 #if (NCURSES_VERSION_PATCH < 20100501) && (NCURSES_VERSION_PATCH >= 20100403)
13916         make an error
13917 #endif
13918 #endif
13919         long x = winnstr(stdscr, "", 0);
13920         int x1, y1;
13921         getbegyx(stdscr, y1, x1)
13922   ;
13923   return 0;
13924 }
13925 _ACEOF
13926 rm -f conftest.$ac_objext conftest$ac_exeext
13927 if { (eval echo "$as_me:13927: \"$ac_link\"") >&5
13928   (eval $ac_link) 2>&5
13929   ac_status=$?
13930   echo "$as_me:13930: \$? = $ac_status" >&5
13931   (exit $ac_status); } &&
13932          { ac_try='test -s conftest$ac_exeext'
13933   { (eval echo "$as_me:13933: \"$ac_try\"") >&5
13934   (eval $ac_try) 2>&5
13935   ac_status=$?
13936   echo "$as_me:13936: \$? = $ac_status" >&5
13937   (exit $ac_status); }; }; then
13938   cf_cv_need_xopen_extension=no
13939 else
13940   echo "$as_me: failed program was:" >&5
13941 cat conftest.$ac_ext >&5
13942 cat >conftest.$ac_ext <<_ACEOF
13943 #line 13943 "configure"
13944 #include "confdefs.h"
13945
13946 #define _XOPEN_SOURCE_EXTENDED
13947 #include <stdlib.h>
13948 #include <${cf_cv_ncurses_header:-curses.h}>
13949 int
13950 main ()
13951 {
13952
13953 #ifdef NCURSES_VERSION
13954         cchar_t check;
13955         int check2 = curs_set((int)sizeof(check));
13956 #endif
13957         long x = winnstr(stdscr, "", 0);
13958         int x1, y1;
13959         getbegyx(stdscr, y1, x1)
13960   ;
13961   return 0;
13962 }
13963 _ACEOF
13964 rm -f conftest.$ac_objext conftest$ac_exeext
13965 if { (eval echo "$as_me:13965: \"$ac_link\"") >&5
13966   (eval $ac_link) 2>&5
13967   ac_status=$?
13968   echo "$as_me:13968: \$? = $ac_status" >&5
13969   (exit $ac_status); } &&
13970          { ac_try='test -s conftest$ac_exeext'
13971   { (eval echo "$as_me:13971: \"$ac_try\"") >&5
13972   (eval $ac_try) 2>&5
13973   ac_status=$?
13974   echo "$as_me:13974: \$? = $ac_status" >&5
13975   (exit $ac_status); }; }; then
13976   cf_cv_need_xopen_extension=yes
13977 else
13978   echo "$as_me: failed program was:" >&5
13979 cat conftest.$ac_ext >&5
13980 cf_cv_need_xopen_extension=unknown
13981 fi
13982 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13983 fi
13984 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13985 fi
13986 echo "$as_me:13986: result: $cf_cv_need_xopen_extension" >&5
13987 echo "${ECHO_T}$cf_cv_need_xopen_extension" >&6
13988 test $cf_cv_need_xopen_extension = yes && CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED"
13989
13990 echo "$as_me:13990: checking for term.h" >&5
13991 echo $ECHO_N "checking for term.h... $ECHO_C" >&6
13992 if test "${cf_cv_term_header+set}" = set; then
13993   echo $ECHO_N "(cached) $ECHO_C" >&6
13994 else
13995
13996 # If we found <ncurses/curses.h>, look for <ncurses/term.h>, but always look
13997 # for <term.h> if we do not find the variant.
13998
13999 cf_header_list="term.h ncurses/term.h ncursesw/term.h"
14000
14001 case ${cf_cv_ncurses_header:-curses.h} in
14002 (*/*)
14003         cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`term.h
14004         cf_header_list="$cf_header_item $cf_header_list"
14005         ;;
14006 esac
14007
14008 for cf_header in $cf_header_list
14009 do
14010         cat >conftest.$ac_ext <<_ACEOF
14011 #line 14011 "configure"
14012 #include "confdefs.h"
14013
14014 #include <${cf_cv_ncurses_header:-curses.h}>
14015 #include <${cf_header}>
14016 int
14017 main ()
14018 {
14019 WINDOW *x
14020   ;
14021   return 0;
14022 }
14023 _ACEOF
14024 rm -f conftest.$ac_objext
14025 if { (eval echo "$as_me:14025: \"$ac_compile\"") >&5
14026   (eval $ac_compile) 2>&5
14027   ac_status=$?
14028   echo "$as_me:14028: \$? = $ac_status" >&5
14029   (exit $ac_status); } &&
14030          { ac_try='test -s conftest.$ac_objext'
14031   { (eval echo "$as_me:14031: \"$ac_try\"") >&5
14032   (eval $ac_try) 2>&5
14033   ac_status=$?
14034   echo "$as_me:14034: \$? = $ac_status" >&5
14035   (exit $ac_status); }; }; then
14036   cf_cv_term_header=$cf_header
14037          break
14038 else
14039   echo "$as_me: failed program was:" >&5
14040 cat conftest.$ac_ext >&5
14041 cf_cv_term_header=no
14042 fi
14043 rm -f conftest.$ac_objext conftest.$ac_ext
14044 done
14045
14046 case $cf_cv_term_header in
14047 (no)
14048         # If curses is ncurses, some packagers still mess it up by trying to make
14049         # us use GNU termcap.  This handles the most common case.
14050         for cf_header in ncurses/term.h ncursesw/term.h
14051         do
14052                 cat >conftest.$ac_ext <<_ACEOF
14053 #line 14053 "configure"
14054 #include "confdefs.h"
14055
14056 #include <${cf_cv_ncurses_header:-curses.h}>
14057 #ifdef NCURSES_VERSION
14058 #include <${cf_header}>
14059 #else
14060 make an error
14061 #endif
14062 int
14063 main ()
14064 {
14065 WINDOW *x
14066   ;
14067   return 0;
14068 }
14069 _ACEOF
14070 rm -f conftest.$ac_objext
14071 if { (eval echo "$as_me:14071: \"$ac_compile\"") >&5
14072   (eval $ac_compile) 2>&5
14073   ac_status=$?
14074   echo "$as_me:14074: \$? = $ac_status" >&5
14075   (exit $ac_status); } &&
14076          { ac_try='test -s conftest.$ac_objext'
14077   { (eval echo "$as_me:14077: \"$ac_try\"") >&5
14078   (eval $ac_try) 2>&5
14079   ac_status=$?
14080   echo "$as_me:14080: \$? = $ac_status" >&5
14081   (exit $ac_status); }; }; then
14082   cf_cv_term_header=$cf_header
14083                          break
14084 else
14085   echo "$as_me: failed program was:" >&5
14086 cat conftest.$ac_ext >&5
14087 cf_cv_term_header=no
14088 fi
14089 rm -f conftest.$ac_objext conftest.$ac_ext
14090         done
14091         ;;
14092 esac
14093
14094 fi
14095 echo "$as_me:14095: result: $cf_cv_term_header" >&5
14096 echo "${ECHO_T}$cf_cv_term_header" >&6
14097
14098 case $cf_cv_term_header in
14099 (term.h)
14100
14101 cat >>confdefs.h <<\EOF
14102 #define HAVE_TERM_H 1
14103 EOF
14104
14105         ;;
14106 (ncurses/term.h)
14107
14108 cat >>confdefs.h <<\EOF
14109 #define HAVE_NCURSES_TERM_H 1
14110 EOF
14111
14112         ;;
14113 (ncursesw/term.h)
14114
14115 cat >>confdefs.h <<\EOF
14116 #define HAVE_NCURSESW_TERM_H 1
14117 EOF
14118
14119         ;;
14120 esac
14121
14122 echo "$as_me:14122: checking for unctrl.h" >&5
14123 echo $ECHO_N "checking for unctrl.h... $ECHO_C" >&6
14124 if test "${cf_cv_unctrl_header+set}" = set; then
14125   echo $ECHO_N "(cached) $ECHO_C" >&6
14126 else
14127
14128 # If we found <ncurses/curses.h>, look for <ncurses/unctrl.h>, but always look
14129 # for <unctrl.h> if we do not find the variant.
14130
14131 cf_header_list="unctrl.h ncurses/unctrl.h ncursesw/unctrl.h"
14132
14133 case ${cf_cv_ncurses_header:-curses.h} in
14134 (*/*)
14135         cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`unctrl.h
14136         cf_header_list="$cf_header_item $cf_header_list"
14137         ;;
14138 esac
14139
14140 for cf_header in $cf_header_list
14141 do
14142         cat >conftest.$ac_ext <<_ACEOF
14143 #line 14143 "configure"
14144 #include "confdefs.h"
14145
14146 #include <${cf_cv_ncurses_header:-curses.h}>
14147 #include <${cf_header}>
14148 int
14149 main ()
14150 {
14151 WINDOW *x
14152   ;
14153   return 0;
14154 }
14155 _ACEOF
14156 rm -f conftest.$ac_objext
14157 if { (eval echo "$as_me:14157: \"$ac_compile\"") >&5
14158   (eval $ac_compile) 2>&5
14159   ac_status=$?
14160   echo "$as_me:14160: \$? = $ac_status" >&5
14161   (exit $ac_status); } &&
14162          { ac_try='test -s conftest.$ac_objext'
14163   { (eval echo "$as_me:14163: \"$ac_try\"") >&5
14164   (eval $ac_try) 2>&5
14165   ac_status=$?
14166   echo "$as_me:14166: \$? = $ac_status" >&5
14167   (exit $ac_status); }; }; then
14168   cf_cv_unctrl_header=$cf_header
14169          break
14170 else
14171   echo "$as_me: failed program was:" >&5
14172 cat conftest.$ac_ext >&5
14173 cf_cv_unctrl_header=no
14174 fi
14175 rm -f conftest.$ac_objext conftest.$ac_ext
14176 done
14177
14178 fi
14179 echo "$as_me:14179: result: $cf_cv_unctrl_header" >&5
14180 echo "${ECHO_T}$cf_cv_unctrl_header" >&6
14181
14182 case $cf_cv_unctrl_header in
14183 (no)
14184         { echo "$as_me:14184: WARNING: unctrl.h header not found" >&5
14185 echo "$as_me: WARNING: unctrl.h header not found" >&2;}
14186         ;;
14187 esac
14188
14189 case $cf_cv_unctrl_header in
14190 (unctrl.h)
14191
14192 cat >>confdefs.h <<\EOF
14193 #define HAVE_UNCTRL_H 1
14194 EOF
14195
14196         ;;
14197 (ncurses/unctrl.h)
14198
14199 cat >>confdefs.h <<\EOF
14200 #define HAVE_NCURSES_UNCTRL_H 1
14201 EOF
14202
14203         ;;
14204 (ncursesw/unctrl.h)
14205
14206 cat >>confdefs.h <<\EOF
14207 #define HAVE_NCURSESW_UNCTRL_H 1
14208 EOF
14209
14210         ;;
14211 esac
14212
14213 for cf_func in \
14214 assume_default_colors \
14215 chgat \
14216 color_set \
14217 filter \
14218 getbegx \
14219 getcurx \
14220 getmaxx \
14221 getnstr \
14222 getparx \
14223 getwin \
14224 mvvline \
14225 mvwvline \
14226 napms \
14227 putwin \
14228 resize_term \
14229 resizeterm \
14230 ripoffline \
14231 scr_dump \
14232 setupterm \
14233 slk_color \
14234 slk_init \
14235 termattrs \
14236 tgetent \
14237 tigetnum \
14238 tigetstr \
14239 typeahead \
14240 use_default_colors \
14241 use_env \
14242 use_extended_names \
14243 use_screen \
14244 use_window \
14245 vid_puts \
14246 vidputs \
14247 vsscanf \
14248 vw_printw \
14249 wchgat \
14250 winsstr \
14251 wresize \
14252 wsyncdown \
14253
14254 do
14255
14256 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14257
14258         echo "$as_me:14258: checking for ${cf_func}" >&5
14259 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
14260
14261 echo "${as_me:-configure}:14261: testing ${cf_func} ..." 1>&5
14262
14263         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
14264   echo $ECHO_N "(cached) $ECHO_C" >&6
14265 else
14266
14267                 eval cf_result='$ac_cv_func_'$cf_func
14268                 if test ".$cf_result" != ".no"; then
14269                         cat >conftest.$ac_ext <<_ACEOF
14270 #line 14270 "configure"
14271 #include "confdefs.h"
14272
14273 #ifdef HAVE_XCURSES
14274 #include <xcurses.h>
14275 char * XCursesProgramName = "test";
14276 #else
14277 #include <${cf_cv_ncurses_header:-curses.h}>
14278 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
14279 #include <ncursesw/term.h>
14280 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
14281 #include <ncurses/term.h>
14282 #elif defined(HAVE_TERM_H)
14283 #include <term.h>
14284 #endif
14285 #endif
14286
14287 int
14288 main ()
14289 {
14290
14291 #ifndef ${cf_func}
14292 long foo = (long)(&${cf_func});
14293 fprintf(stderr, "testing linkage of $cf_func:%p\n", foo);
14294 if (foo + 1234 > 5678)
14295         ${cf_cv_main_return:-return}(foo);
14296 #endif
14297
14298   ;
14299   return 0;
14300 }
14301 _ACEOF
14302 rm -f conftest.$ac_objext conftest$ac_exeext
14303 if { (eval echo "$as_me:14303: \"$ac_link\"") >&5
14304   (eval $ac_link) 2>&5
14305   ac_status=$?
14306   echo "$as_me:14306: \$? = $ac_status" >&5
14307   (exit $ac_status); } &&
14308          { ac_try='test -s conftest$ac_exeext'
14309   { (eval echo "$as_me:14309: \"$ac_try\"") >&5
14310   (eval $ac_try) 2>&5
14311   ac_status=$?
14312   echo "$as_me:14312: \$? = $ac_status" >&5
14313   (exit $ac_status); }; }; then
14314   cf_result=yes
14315 else
14316   echo "$as_me: failed program was:" >&5
14317 cat conftest.$ac_ext >&5
14318 cf_result=no
14319 fi
14320 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14321                 fi
14322                 eval 'cf_cv_func_'$cf_func'=$cf_result'
14323
14324 fi
14325
14326         # use the computed/retrieved cache-value:
14327         eval 'cf_result=$cf_cv_func_'$cf_func
14328         echo "$as_me:14328: result: $cf_result" >&5
14329 echo "${ECHO_T}$cf_result" >&6
14330         if test $cf_result != no; then
14331                 cat >>confdefs.h <<EOF
14332 #define HAVE_${cf_tr_func} 1
14333 EOF
14334
14335         fi
14336 done
14337
14338 for cf_func in tputs
14339 do
14340
14341 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14342
14343         echo "$as_me:14343: checking for ${cf_func}" >&5
14344 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
14345
14346 echo "${as_me:-configure}:14346: testing ${cf_func} ..." 1>&5
14347
14348         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
14349   echo $ECHO_N "(cached) $ECHO_C" >&6
14350 else
14351
14352                 eval cf_result='$ac_cv_func_'$cf_func
14353                 if test ".$cf_result" != ".no"; then
14354                         cat >conftest.$ac_ext <<_ACEOF
14355 #line 14355 "configure"
14356 #include "confdefs.h"
14357
14358 #ifdef HAVE_XCURSES
14359 #include <xcurses.h>
14360 char * XCursesProgramName = "test";
14361 #else
14362 #include <${cf_cv_ncurses_header:-curses.h}>
14363 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
14364 #include <ncursesw/term.h>
14365 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
14366 #include <ncurses/term.h>
14367 #elif defined(HAVE_TERM_H)
14368 #include <term.h>
14369 #endif
14370 #endif
14371
14372 int
14373 main ()
14374 {
14375
14376 #ifndef ${cf_func}
14377 long foo = (long)(&${cf_func});
14378 fprintf(stderr, "testing linkage of $cf_func:%p\n", foo);
14379 if (foo + 1234 > 5678)
14380         ${cf_cv_main_return:-return}(foo);
14381 #endif
14382
14383   ;
14384   return 0;
14385 }
14386 _ACEOF
14387 rm -f conftest.$ac_objext conftest$ac_exeext
14388 if { (eval echo "$as_me:14388: \"$ac_link\"") >&5
14389   (eval $ac_link) 2>&5
14390   ac_status=$?
14391   echo "$as_me:14391: \$? = $ac_status" >&5
14392   (exit $ac_status); } &&
14393          { ac_try='test -s conftest$ac_exeext'
14394   { (eval echo "$as_me:14394: \"$ac_try\"") >&5
14395   (eval $ac_try) 2>&5
14396   ac_status=$?
14397   echo "$as_me:14397: \$? = $ac_status" >&5
14398   (exit $ac_status); }; }; then
14399   cf_result=yes
14400 else
14401   echo "$as_me: failed program was:" >&5
14402 cat conftest.$ac_ext >&5
14403 cf_result=no
14404 fi
14405 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14406                 fi
14407                 eval 'cf_cv_func_'$cf_func'=$cf_result'
14408
14409 fi
14410
14411         # use the computed/retrieved cache-value:
14412         eval 'cf_result=$cf_cv_func_'$cf_func
14413         echo "$as_me:14413: result: $cf_result" >&5
14414 echo "${ECHO_T}$cf_result" >&6
14415         if test $cf_result != no; then
14416                 cat >>confdefs.h <<EOF
14417 #define HAVE_${cf_tr_func} 1
14418 EOF
14419
14420         fi
14421 done
14422
14423 if test x$cf_cv_func_tputs = xyes
14424 then
14425         cf_done=no
14426         for cf_arg in int char
14427         do
14428                 for cf_ret in int void
14429                 do
14430                         if test $cf_ret = void
14431                         then
14432                                 cf_return="/* nothing */"
14433                         else
14434                                 cf_return="return value"
14435                         fi
14436                         cat >conftest.$ac_ext <<_ACEOF
14437 #line 14437 "configure"
14438 #include "confdefs.h"
14439
14440 #include <${cf_cv_ncurses_header:-curses.h}>
14441 #include <$cf_cv_term_header>
14442
14443 static $cf_ret outc($cf_arg value) { $cf_return; }
14444
14445 int
14446 main ()
14447 {
14448
14449         tputs("hello", 0, outc);
14450         ${cf_cv_main_return:-return}(0);
14451
14452   ;
14453   return 0;
14454 }
14455 _ACEOF
14456 rm -f conftest.$ac_objext
14457 if { (eval echo "$as_me:14457: \"$ac_compile\"") >&5
14458   (eval $ac_compile) 2>&5
14459   ac_status=$?
14460   echo "$as_me:14460: \$? = $ac_status" >&5
14461   (exit $ac_status); } &&
14462          { ac_try='test -s conftest.$ac_objext'
14463   { (eval echo "$as_me:14463: \"$ac_try\"") >&5
14464   (eval $ac_try) 2>&5
14465   ac_status=$?
14466   echo "$as_me:14466: \$? = $ac_status" >&5
14467   (exit $ac_status); }; }; then
14468
14469                 test -n "$verbose" && echo "    prototype $cf_ret func($cf_arg value)" 1>&6
14470
14471 echo "${as_me:-configure}:14471: testing prototype $cf_ret func($cf_arg value) ..." 1>&5
14472
14473                 cat >>confdefs.h <<EOF
14474 #define TPUTS_ARG               $cf_arg
14475 #define TPUTS_PROTO(func,value) $cf_ret func(TPUTS_ARG value)
14476 #define TPUTS_RETURN(value)     $cf_return
14477 EOF
14478                 cf_done=yes
14479                 break
14480
14481 else
14482   echo "$as_me: failed program was:" >&5
14483 cat conftest.$ac_ext >&5
14484 fi
14485 rm -f conftest.$ac_objext conftest.$ac_ext
14486                 done
14487                 test $cf_done = yes && break
14488         done
14489 fi
14490
14491 echo "$as_me:14491: checking for ncurses extended functions" >&5
14492 echo $ECHO_N "checking for ncurses extended functions... $ECHO_C" >&6
14493 if test "${cf_cv_ncurses_ext_funcs+set}" = set; then
14494   echo $ECHO_N "(cached) $ECHO_C" >&6
14495 else
14496
14497 cat >conftest.$ac_ext <<_ACEOF
14498 #line 14498 "configure"
14499 #include "confdefs.h"
14500
14501 #include <${cf_cv_ncurses_header:-curses.h}>
14502 int
14503 main ()
14504 {
14505
14506 int x = NCURSES_EXT_FUNCS
14507
14508   ;
14509   return 0;
14510 }
14511 _ACEOF
14512 rm -f conftest.$ac_objext
14513 if { (eval echo "$as_me:14513: \"$ac_compile\"") >&5
14514   (eval $ac_compile) 2>&5
14515   ac_status=$?
14516   echo "$as_me:14516: \$? = $ac_status" >&5
14517   (exit $ac_status); } &&
14518          { ac_try='test -s conftest.$ac_objext'
14519   { (eval echo "$as_me:14519: \"$ac_try\"") >&5
14520   (eval $ac_try) 2>&5
14521   ac_status=$?
14522   echo "$as_me:14522: \$? = $ac_status" >&5
14523   (exit $ac_status); }; }; then
14524   cf_cv_ncurses_ext_funcs=defined
14525 else
14526   echo "$as_me: failed program was:" >&5
14527 cat conftest.$ac_ext >&5
14528
14529 cat >conftest.$ac_ext <<_ACEOF
14530 #line 14530 "configure"
14531 #include "confdefs.h"
14532
14533 #include <${cf_cv_ncurses_header:-curses.h}>
14534 int
14535 main ()
14536 {
14537
14538         (void) assume_default_colors (0, 0);
14539         (void) curses_version ();
14540         (void) define_key (0, 0);
14541         (void) is_term_resized (0, 0);
14542         (void) key_defined (0);
14543         (void) keybound (0, 0);
14544         (void) keyok (0, 0);
14545         (void) resize_term (0, 0);
14546         (void) resizeterm (0, 0);
14547         (void) use_default_colors ();
14548         (void) use_extended_names (0);
14549         (void) wresize (0, 0, 0);
14550   ;
14551   return 0;
14552 }
14553 _ACEOF
14554 rm -f conftest.$ac_objext conftest$ac_exeext
14555 if { (eval echo "$as_me:14555: \"$ac_link\"") >&5
14556   (eval $ac_link) 2>&5
14557   ac_status=$?
14558   echo "$as_me:14558: \$? = $ac_status" >&5
14559   (exit $ac_status); } &&
14560          { ac_try='test -s conftest$ac_exeext'
14561   { (eval echo "$as_me:14561: \"$ac_try\"") >&5
14562   (eval $ac_try) 2>&5
14563   ac_status=$?
14564   echo "$as_me:14564: \$? = $ac_status" >&5
14565   (exit $ac_status); }; }; then
14566   cf_cv_ncurses_ext_funcs=yes
14567 else
14568   echo "$as_me: failed program was:" >&5
14569 cat conftest.$ac_ext >&5
14570 cf_cv_ncurses_ext_funcs=no
14571 fi
14572 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14573
14574 fi
14575 rm -f conftest.$ac_objext conftest.$ac_ext
14576
14577 fi
14578 echo "$as_me:14578: result: $cf_cv_ncurses_ext_funcs" >&5
14579 echo "${ECHO_T}$cf_cv_ncurses_ext_funcs" >&6
14580 test "$cf_cv_ncurses_ext_funcs" = yes &&
14581 cat >>confdefs.h <<\EOF
14582 #define NCURSES_EXT_FUNCS 1
14583 EOF
14584
14585 if test "$cf_enable_widec" = yes
14586 then
14587         # workaround for systems with ncurses before 20111029, due to change of
14588         # feature test macro from _XPG5 to _XOPEN_SOURCE
14589         if test -n "$cf_cv_ncurses_version" && test "x$cf_cv_ncurses_version" != xno
14590         then
14591                 cf_define_xpg5=no
14592                 echo "$as_me:14592: checking if _XPG5 should be defined to enable wide-characters" >&5
14593 echo $ECHO_N "checking if _XPG5 should be defined to enable wide-characters... $ECHO_C" >&6
14594
14595                 cat >conftest.$ac_ext <<_ACEOF
14596 #line 14596 "configure"
14597 #include "confdefs.h"
14598
14599 #include <${cf_cv_ncurses_header:-curses.h}>
14600 int
14601 main ()
14602 {
14603 int x = _XPG5
14604   ;
14605   return 0;
14606 }
14607 _ACEOF
14608 rm -f conftest.$ac_objext
14609 if { (eval echo "$as_me:14609: \"$ac_compile\"") >&5
14610   (eval $ac_compile) 2>&5
14611   ac_status=$?
14612   echo "$as_me:14612: \$? = $ac_status" >&5
14613   (exit $ac_status); } &&
14614          { ac_try='test -s conftest.$ac_objext'
14615   { (eval echo "$as_me:14615: \"$ac_try\"") >&5
14616   (eval $ac_try) 2>&5
14617   ac_status=$?
14618   echo "$as_me:14618: \$? = $ac_status" >&5
14619   (exit $ac_status); }; }; then
14620   :
14621 else
14622   echo "$as_me: failed program was:" >&5
14623 cat conftest.$ac_ext >&5
14624 cf_save_cppflags="$CPPFLAGS"
14625                          CPPFLAGS="$CPPFLAGS -D_XPG5"
14626                          cat >conftest.$ac_ext <<_ACEOF
14627 #line 14627 "configure"
14628 #include "confdefs.h"
14629
14630 #include <${cf_cv_ncurses_header:-curses.h}>
14631 int
14632 main ()
14633 {
14634 int x = _XPG5
14635   ;
14636   return 0;
14637 }
14638 _ACEOF
14639 rm -f conftest.$ac_objext
14640 if { (eval echo "$as_me:14640: \"$ac_compile\"") >&5
14641   (eval $ac_compile) 2>&5
14642   ac_status=$?
14643   echo "$as_me:14643: \$? = $ac_status" >&5
14644   (exit $ac_status); } &&
14645          { ac_try='test -s conftest.$ac_objext'
14646   { (eval echo "$as_me:14646: \"$ac_try\"") >&5
14647   (eval $ac_try) 2>&5
14648   ac_status=$?
14649   echo "$as_me:14649: \$? = $ac_status" >&5
14650   (exit $ac_status); }; }; then
14651   cf_define_xpg5=yes
14652 else
14653   echo "$as_me: failed program was:" >&5
14654 cat conftest.$ac_ext >&5
14655 fi
14656 rm -f conftest.$ac_objext conftest.$ac_ext
14657                          CPPFLAGS="$cf_save_cppflags"
14658 fi
14659 rm -f conftest.$ac_objext conftest.$ac_ext
14660                 echo "$as_me:14660: result: $cf_define_xpg5" >&5
14661 echo "${ECHO_T}$cf_define_xpg5" >&6
14662
14663                 if test "$cf_define_xpg5" = yes
14664                 then
14665                         CPPFLAGS="$CPPFLAGS -D_XPG5"
14666                 fi
14667         fi
14668
14669         echo "$as_me:14669: checking for wide-character functions" >&5
14670 echo $ECHO_N "checking for wide-character functions... $ECHO_C" >&6
14671 if test "${cf_cv_widechar_funcs+set}" = set; then
14672   echo $ECHO_N "(cached) $ECHO_C" >&6
14673 else
14674
14675         cat >conftest.$ac_ext <<_ACEOF
14676 #line 14676 "configure"
14677 #include "confdefs.h"
14678
14679 #include <${cf_cv_ncurses_header:-curses.h}>
14680 int
14681 main ()
14682 {
14683
14684                 static wchar_t src_wchar[2];
14685                 static cchar_t dst_cchar;
14686                 setcchar(&dst_cchar, src_wchar, A_NORMAL, 0, (void *) 0);
14687
14688   ;
14689   return 0;
14690 }
14691 _ACEOF
14692 rm -f conftest.$ac_objext conftest$ac_exeext
14693 if { (eval echo "$as_me:14693: \"$ac_link\"") >&5
14694   (eval $ac_link) 2>&5
14695   ac_status=$?
14696   echo "$as_me:14696: \$? = $ac_status" >&5
14697   (exit $ac_status); } &&
14698          { ac_try='test -s conftest$ac_exeext'
14699   { (eval echo "$as_me:14699: \"$ac_try\"") >&5
14700   (eval $ac_try) 2>&5
14701   ac_status=$?
14702   echo "$as_me:14702: \$? = $ac_status" >&5
14703   (exit $ac_status); }; }; then
14704   cf_cv_widechar_funcs=yes
14705 else
14706   echo "$as_me: failed program was:" >&5
14707 cat conftest.$ac_ext >&5
14708 cf_cv_widechar_funcs=no
14709 fi
14710 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14711
14712 fi
14713 echo "$as_me:14713: result: $cf_cv_widechar_funcs" >&5
14714 echo "${ECHO_T}$cf_cv_widechar_funcs" >&6
14715         if test "$cf_cv_widechar_funcs" != no ; then
14716
14717 cat >>confdefs.h <<\EOF
14718 #define USE_WIDEC_SUPPORT 1
14719 EOF
14720
14721         else
14722                 cat >>confdefs.h <<\EOF
14723 #define USE_WIDEC_SUPPORT 0
14724 EOF
14725
14726         fi
14727 else
14728         cat >>confdefs.h <<\EOF
14729 #define USE_WIDEC_SUPPORT 0
14730 EOF
14731
14732 fi
14733
14734 echo "$as_me:14734: checking if sys/time.h works with sys/select.h" >&5
14735 echo $ECHO_N "checking if sys/time.h works with sys/select.h... $ECHO_C" >&6
14736 if test "${cf_cv_sys_time_select+set}" = set; then
14737   echo $ECHO_N "(cached) $ECHO_C" >&6
14738 else
14739
14740 cat >conftest.$ac_ext <<_ACEOF
14741 #line 14741 "configure"
14742 #include "confdefs.h"
14743
14744 #include <sys/types.h>
14745 #ifdef HAVE_SYS_TIME_H
14746 #include <sys/time.h>
14747 #endif
14748 #ifdef HAVE_SYS_SELECT_H
14749 #include <sys/select.h>
14750 #endif
14751
14752 int
14753 main ()
14754 {
14755
14756   ;
14757   return 0;
14758 }
14759 _ACEOF
14760 rm -f conftest.$ac_objext
14761 if { (eval echo "$as_me:14761: \"$ac_compile\"") >&5
14762   (eval $ac_compile) 2>&5
14763   ac_status=$?
14764   echo "$as_me:14764: \$? = $ac_status" >&5
14765   (exit $ac_status); } &&
14766          { ac_try='test -s conftest.$ac_objext'
14767   { (eval echo "$as_me:14767: \"$ac_try\"") >&5
14768   (eval $ac_try) 2>&5
14769   ac_status=$?
14770   echo "$as_me:14770: \$? = $ac_status" >&5
14771   (exit $ac_status); }; }; then
14772   cf_cv_sys_time_select=yes
14773 else
14774   echo "$as_me: failed program was:" >&5
14775 cat conftest.$ac_ext >&5
14776 cf_cv_sys_time_select=no
14777 fi
14778 rm -f conftest.$ac_objext conftest.$ac_ext
14779
14780 fi
14781
14782 echo "$as_me:14782: result: $cf_cv_sys_time_select" >&5
14783 echo "${ECHO_T}$cf_cv_sys_time_select" >&6
14784 test "$cf_cv_sys_time_select" = yes &&
14785 cat >>confdefs.h <<\EOF
14786 #define HAVE_SYS_TIME_SELECT 1
14787 EOF
14788
14789 echo "$as_me:14789: checking for function curses_version" >&5
14790 echo $ECHO_N "checking for function curses_version... $ECHO_C" >&6
14791 if test "${cf_cv_func_curses_version+set}" = set; then
14792   echo $ECHO_N "(cached) $ECHO_C" >&6
14793 else
14794
14795 if test "$cross_compiling" = yes; then
14796   cf_cv_func_curses_version=unknown
14797 else
14798   cat >conftest.$ac_ext <<_ACEOF
14799 #line 14799 "configure"
14800 #include "confdefs.h"
14801
14802 #include <${cf_cv_ncurses_header:-curses.h}>
14803 int main()
14804 {
14805         char temp[1024];
14806         sprintf(temp, "%s\n", curses_version());
14807         ${cf_cv_main_return:-return}(0);
14808 }
14809
14810 _ACEOF
14811 rm -f conftest$ac_exeext
14812 if { (eval echo "$as_me:14812: \"$ac_link\"") >&5
14813   (eval $ac_link) 2>&5
14814   ac_status=$?
14815   echo "$as_me:14815: \$? = $ac_status" >&5
14816   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
14817   { (eval echo "$as_me:14817: \"$ac_try\"") >&5
14818   (eval $ac_try) 2>&5
14819   ac_status=$?
14820   echo "$as_me:14820: \$? = $ac_status" >&5
14821   (exit $ac_status); }; }; then
14822   cf_cv_func_curses_version=yes
14823
14824 else
14825   echo "$as_me: program exited with status $ac_status" >&5
14826 echo "$as_me: failed program was:" >&5
14827 cat conftest.$ac_ext >&5
14828 cf_cv_func_curses_version=no
14829
14830 fi
14831 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
14832 fi
14833 rm -f core
14834 fi
14835 echo "$as_me:14835: result: $cf_cv_func_curses_version" >&5
14836 echo "${ECHO_T}$cf_cv_func_curses_version" >&6
14837 test "$cf_cv_func_curses_version" = yes &&
14838 cat >>confdefs.h <<\EOF
14839 #define HAVE_CURSES_VERSION 1
14840 EOF
14841
14842 echo "$as_me:14842: checking for alternate character set array" >&5
14843 echo $ECHO_N "checking for alternate character set array... $ECHO_C" >&6
14844 if test "${cf_cv_curses_acs_map+set}" = set; then
14845   echo $ECHO_N "(cached) $ECHO_C" >&6
14846 else
14847
14848 cf_cv_curses_acs_map=unknown
14849 for name in acs_map _acs_map __acs_map ${NCURSES_WRAP_PREFIX}acs_map
14850 do
14851 cat >conftest.$ac_ext <<_ACEOF
14852 #line 14852 "configure"
14853 #include "confdefs.h"
14854
14855 #include <${cf_cv_ncurses_header:-curses.h}>
14856
14857 int
14858 main ()
14859 {
14860
14861 $name['k'] = ACS_PLUS
14862
14863   ;
14864   return 0;
14865 }
14866 _ACEOF
14867 rm -f conftest.$ac_objext conftest$ac_exeext
14868 if { (eval echo "$as_me:14868: \"$ac_link\"") >&5
14869   (eval $ac_link) 2>&5
14870   ac_status=$?
14871   echo "$as_me:14871: \$? = $ac_status" >&5
14872   (exit $ac_status); } &&
14873          { ac_try='test -s conftest$ac_exeext'
14874   { (eval echo "$as_me:14874: \"$ac_try\"") >&5
14875   (eval $ac_try) 2>&5
14876   ac_status=$?
14877   echo "$as_me:14877: \$? = $ac_status" >&5
14878   (exit $ac_status); }; }; then
14879   cf_cv_curses_acs_map=$name; break
14880 else
14881   echo "$as_me: failed program was:" >&5
14882 cat conftest.$ac_ext >&5
14883 fi
14884 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14885 done
14886
14887 fi
14888 echo "$as_me:14888: result: $cf_cv_curses_acs_map" >&5
14889 echo "${ECHO_T}$cf_cv_curses_acs_map" >&6
14890
14891 test "$cf_cv_curses_acs_map" != unknown &&
14892 cat >>confdefs.h <<EOF
14893 #define CURSES_ACS_ARRAY $cf_cv_curses_acs_map
14894 EOF
14895
14896 if test "$cf_enable_widec" = yes; then
14897
14898 echo "$as_me:14898: checking for wide alternate character set array" >&5
14899 echo $ECHO_N "checking for wide alternate character set array... $ECHO_C" >&6
14900 if test "${cf_cv_curses_wacs_map+set}" = set; then
14901   echo $ECHO_N "(cached) $ECHO_C" >&6
14902 else
14903
14904         cf_cv_curses_wacs_map=unknown
14905         for name in wacs_map _wacs_map __wacs_map _nc_wacs _wacs_char
14906         do
14907         cat >conftest.$ac_ext <<_ACEOF
14908 #line 14908 "configure"
14909 #include "confdefs.h"
14910
14911 #ifndef _XOPEN_SOURCE_EXTENDED
14912 #define _XOPEN_SOURCE_EXTENDED
14913 #endif
14914 #include <${cf_cv_ncurses_header:-curses.h}>
14915 int
14916 main ()
14917 {
14918 void *foo = &($name['k'])
14919   ;
14920   return 0;
14921 }
14922 _ACEOF
14923 rm -f conftest.$ac_objext conftest$ac_exeext
14924 if { (eval echo "$as_me:14924: \"$ac_link\"") >&5
14925   (eval $ac_link) 2>&5
14926   ac_status=$?
14927   echo "$as_me:14927: \$? = $ac_status" >&5
14928   (exit $ac_status); } &&
14929          { ac_try='test -s conftest$ac_exeext'
14930   { (eval echo "$as_me:14930: \"$ac_try\"") >&5
14931   (eval $ac_try) 2>&5
14932   ac_status=$?
14933   echo "$as_me:14933: \$? = $ac_status" >&5
14934   (exit $ac_status); }; }; then
14935   cf_cv_curses_wacs_map=$name
14936          break
14937 else
14938   echo "$as_me: failed program was:" >&5
14939 cat conftest.$ac_ext >&5
14940 fi
14941 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14942         done
14943 fi
14944 echo "$as_me:14944: result: $cf_cv_curses_wacs_map" >&5
14945 echo "${ECHO_T}$cf_cv_curses_wacs_map" >&6
14946
14947 test "$cf_cv_curses_wacs_map" != unknown &&
14948 cat >>confdefs.h <<EOF
14949 #define CURSES_WACS_ARRAY $cf_cv_curses_wacs_map
14950 EOF
14951
14952 echo "$as_me:14952: checking for wide alternate character constants" >&5
14953 echo $ECHO_N "checking for wide alternate character constants... $ECHO_C" >&6
14954 if test "${cf_cv_curses_wacs_symbols+set}" = set; then
14955   echo $ECHO_N "(cached) $ECHO_C" >&6
14956 else
14957
14958 cf_cv_curses_wacs_symbols=no
14959 if test "$cf_cv_curses_wacs_map" != unknown
14960 then
14961         cat >conftest.$ac_ext <<_ACEOF
14962 #line 14962 "configure"
14963 #include "confdefs.h"
14964
14965 #ifndef _XOPEN_SOURCE_EXTENDED
14966 #define _XOPEN_SOURCE_EXTENDED
14967 #endif
14968 #include <${cf_cv_ncurses_header:-curses.h}>
14969 int
14970 main ()
14971 {
14972 cchar_t *foo = WACS_PLUS;
14973          $cf_cv_curses_wacs_map['k'] = *WACS_PLUS
14974   ;
14975   return 0;
14976 }
14977 _ACEOF
14978 rm -f conftest.$ac_objext conftest$ac_exeext
14979 if { (eval echo "$as_me:14979: \"$ac_link\"") >&5
14980   (eval $ac_link) 2>&5
14981   ac_status=$?
14982   echo "$as_me:14982: \$? = $ac_status" >&5
14983   (exit $ac_status); } &&
14984          { ac_try='test -s conftest$ac_exeext'
14985   { (eval echo "$as_me:14985: \"$ac_try\"") >&5
14986   (eval $ac_try) 2>&5
14987   ac_status=$?
14988   echo "$as_me:14988: \$? = $ac_status" >&5
14989   (exit $ac_status); }; }; then
14990   cf_cv_curses_wacs_symbols=yes
14991 else
14992   echo "$as_me: failed program was:" >&5
14993 cat conftest.$ac_ext >&5
14994 fi
14995 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14996 else
14997         cat >conftest.$ac_ext <<_ACEOF
14998 #line 14998 "configure"
14999 #include "confdefs.h"
15000
15001 #ifndef _XOPEN_SOURCE_EXTENDED
15002 #define _XOPEN_SOURCE_EXTENDED
15003 #endif
15004 #include <${cf_cv_ncurses_header:-curses.h}>
15005 int
15006 main ()
15007 {
15008 cchar_t *foo = WACS_PLUS
15009   ;
15010   return 0;
15011 }
15012 _ACEOF
15013 rm -f conftest.$ac_objext conftest$ac_exeext
15014 if { (eval echo "$as_me:15014: \"$ac_link\"") >&5
15015   (eval $ac_link) 2>&5
15016   ac_status=$?
15017   echo "$as_me:15017: \$? = $ac_status" >&5
15018   (exit $ac_status); } &&
15019          { ac_try='test -s conftest$ac_exeext'
15020   { (eval echo "$as_me:15020: \"$ac_try\"") >&5
15021   (eval $ac_try) 2>&5
15022   ac_status=$?
15023   echo "$as_me:15023: \$? = $ac_status" >&5
15024   (exit $ac_status); }; }; then
15025   cf_cv_curses_wacs_symbols=yes
15026 else
15027   echo "$as_me: failed program was:" >&5
15028 cat conftest.$ac_ext >&5
15029 fi
15030 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15031 fi
15032
15033 fi
15034 echo "$as_me:15034: result: $cf_cv_curses_wacs_symbols" >&5
15035 echo "${ECHO_T}$cf_cv_curses_wacs_symbols" >&6
15036
15037 test "$cf_cv_curses_wacs_symbols" != no &&
15038 cat >>confdefs.h <<\EOF
15039 #define CURSES_WACS_SYMBOLS 1
15040 EOF
15041
15042 fi
15043
15044 echo "$as_me:15044: checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}" >&5
15045 echo $ECHO_N "checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
15046 cat >conftest.$ac_ext <<_ACEOF
15047 #line 15047 "configure"
15048 #include "confdefs.h"
15049
15050 #ifndef _XOPEN_SOURCE_EXTENDED
15051 #define _XOPEN_SOURCE_EXTENDED
15052 #endif
15053 #include <${cf_cv_ncurses_header:-curses.h}>
15054 int
15055 main ()
15056 {
15057
15058 attr_t foo
15059
15060   ;
15061   return 0;
15062 }
15063 _ACEOF
15064 rm -f conftest.$ac_objext
15065 if { (eval echo "$as_me:15065: \"$ac_compile\"") >&5
15066   (eval $ac_compile) 2>&5
15067   ac_status=$?
15068   echo "$as_me:15068: \$? = $ac_status" >&5
15069   (exit $ac_status); } &&
15070          { ac_try='test -s conftest.$ac_objext'
15071   { (eval echo "$as_me:15071: \"$ac_try\"") >&5
15072   (eval $ac_try) 2>&5
15073   ac_status=$?
15074   echo "$as_me:15074: \$? = $ac_status" >&5
15075   (exit $ac_status); }; }; then
15076   cf_result=yes
15077 else
15078   echo "$as_me: failed program was:" >&5
15079 cat conftest.$ac_ext >&5
15080 cf_result=no
15081 fi
15082 rm -f conftest.$ac_objext conftest.$ac_ext
15083 echo "$as_me:15083: result: $cf_result" >&5
15084 echo "${ECHO_T}$cf_result" >&6
15085 if test $cf_result = yes ; then
15086
15087 cf_result=`echo "have_type_attr_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15088
15089 cat >>confdefs.h <<EOF
15090 #define $cf_result 1
15091 EOF
15092
15093 else
15094
15095 cat >>confdefs.h <<EOF
15096 #define attr_t long
15097 EOF
15098
15099 fi
15100
15101 if test "$cf_enable_widec" = yes; then
15102
15103 # This is needed on Tru64 5.0 to declare mbstate_t
15104 echo "$as_me:15104: checking if we must include wchar.h to declare mbstate_t" >&5
15105 echo $ECHO_N "checking if we must include wchar.h to declare mbstate_t... $ECHO_C" >&6
15106 if test "${cf_cv_mbstate_t+set}" = set; then
15107   echo $ECHO_N "(cached) $ECHO_C" >&6
15108 else
15109
15110 cat >conftest.$ac_ext <<_ACEOF
15111 #line 15111 "configure"
15112 #include "confdefs.h"
15113
15114 #include <stdlib.h>
15115 #include <stdarg.h>
15116 #include <stdio.h>
15117 #ifdef HAVE_LIBUTF8_H
15118 #include <libutf8.h>
15119 #endif
15120 int
15121 main ()
15122 {
15123 mbstate_t state
15124   ;
15125   return 0;
15126 }
15127 _ACEOF
15128 rm -f conftest.$ac_objext
15129 if { (eval echo "$as_me:15129: \"$ac_compile\"") >&5
15130   (eval $ac_compile) 2>&5
15131   ac_status=$?
15132   echo "$as_me:15132: \$? = $ac_status" >&5
15133   (exit $ac_status); } &&
15134          { ac_try='test -s conftest.$ac_objext'
15135   { (eval echo "$as_me:15135: \"$ac_try\"") >&5
15136   (eval $ac_try) 2>&5
15137   ac_status=$?
15138   echo "$as_me:15138: \$? = $ac_status" >&5
15139   (exit $ac_status); }; }; then
15140   cf_cv_mbstate_t=no
15141 else
15142   echo "$as_me: failed program was:" >&5
15143 cat conftest.$ac_ext >&5
15144 cat >conftest.$ac_ext <<_ACEOF
15145 #line 15145 "configure"
15146 #include "confdefs.h"
15147
15148 #include <stdlib.h>
15149 #include <stdarg.h>
15150 #include <stdio.h>
15151 #include <wchar.h>
15152 #ifdef HAVE_LIBUTF8_H
15153 #include <libutf8.h>
15154 #endif
15155 int
15156 main ()
15157 {
15158 mbstate_t value
15159   ;
15160   return 0;
15161 }
15162 _ACEOF
15163 rm -f conftest.$ac_objext
15164 if { (eval echo "$as_me:15164: \"$ac_compile\"") >&5
15165   (eval $ac_compile) 2>&5
15166   ac_status=$?
15167   echo "$as_me:15167: \$? = $ac_status" >&5
15168   (exit $ac_status); } &&
15169          { ac_try='test -s conftest.$ac_objext'
15170   { (eval echo "$as_me:15170: \"$ac_try\"") >&5
15171   (eval $ac_try) 2>&5
15172   ac_status=$?
15173   echo "$as_me:15173: \$? = $ac_status" >&5
15174   (exit $ac_status); }; }; then
15175   cf_cv_mbstate_t=yes
15176 else
15177   echo "$as_me: failed program was:" >&5
15178 cat conftest.$ac_ext >&5
15179 cf_cv_mbstate_t=unknown
15180 fi
15181 rm -f conftest.$ac_objext conftest.$ac_ext
15182 fi
15183 rm -f conftest.$ac_objext conftest.$ac_ext
15184 fi
15185 echo "$as_me:15185: result: $cf_cv_mbstate_t" >&5
15186 echo "${ECHO_T}$cf_cv_mbstate_t" >&6
15187
15188 if test "$cf_cv_mbstate_t" = yes ; then
15189
15190 cat >>confdefs.h <<\EOF
15191 #define NEED_WCHAR_H 1
15192 EOF
15193
15194         NEED_WCHAR_H=1
15195 fi
15196
15197 # if we do not find mbstate_t in either place, use substitution to provide a fallback.
15198 if test "$cf_cv_mbstate_t" = unknown ; then
15199         NCURSES_MBSTATE_T=1
15200 fi
15201
15202 # if we find mbstate_t in either place, use substitution to provide a fallback.
15203 if test "$cf_cv_mbstate_t" != unknown ; then
15204         NCURSES_OK_MBSTATE_T=1
15205 fi
15206
15207 # This is needed on Tru64 5.0 to declare wchar_t
15208 echo "$as_me:15208: checking if we must include wchar.h to declare wchar_t" >&5
15209 echo $ECHO_N "checking if we must include wchar.h to declare wchar_t... $ECHO_C" >&6
15210 if test "${cf_cv_wchar_t+set}" = set; then
15211   echo $ECHO_N "(cached) $ECHO_C" >&6
15212 else
15213
15214 cat >conftest.$ac_ext <<_ACEOF
15215 #line 15215 "configure"
15216 #include "confdefs.h"
15217
15218 #include <stdlib.h>
15219 #include <stdarg.h>
15220 #include <stdio.h>
15221 #ifdef HAVE_LIBUTF8_H
15222 #include <libutf8.h>
15223 #endif
15224 int
15225 main ()
15226 {
15227 wchar_t state
15228   ;
15229   return 0;
15230 }
15231 _ACEOF
15232 rm -f conftest.$ac_objext
15233 if { (eval echo "$as_me:15233: \"$ac_compile\"") >&5
15234   (eval $ac_compile) 2>&5
15235   ac_status=$?
15236   echo "$as_me:15236: \$? = $ac_status" >&5
15237   (exit $ac_status); } &&
15238          { ac_try='test -s conftest.$ac_objext'
15239   { (eval echo "$as_me:15239: \"$ac_try\"") >&5
15240   (eval $ac_try) 2>&5
15241   ac_status=$?
15242   echo "$as_me:15242: \$? = $ac_status" >&5
15243   (exit $ac_status); }; }; then
15244   cf_cv_wchar_t=no
15245 else
15246   echo "$as_me: failed program was:" >&5
15247 cat conftest.$ac_ext >&5
15248 cat >conftest.$ac_ext <<_ACEOF
15249 #line 15249 "configure"
15250 #include "confdefs.h"
15251
15252 #include <stdlib.h>
15253 #include <stdarg.h>
15254 #include <stdio.h>
15255 #include <wchar.h>
15256 #ifdef HAVE_LIBUTF8_H
15257 #include <libutf8.h>
15258 #endif
15259 int
15260 main ()
15261 {
15262 wchar_t value
15263   ;
15264   return 0;
15265 }
15266 _ACEOF
15267 rm -f conftest.$ac_objext
15268 if { (eval echo "$as_me:15268: \"$ac_compile\"") >&5
15269   (eval $ac_compile) 2>&5
15270   ac_status=$?
15271   echo "$as_me:15271: \$? = $ac_status" >&5
15272   (exit $ac_status); } &&
15273          { ac_try='test -s conftest.$ac_objext'
15274   { (eval echo "$as_me:15274: \"$ac_try\"") >&5
15275   (eval $ac_try) 2>&5
15276   ac_status=$?
15277   echo "$as_me:15277: \$? = $ac_status" >&5
15278   (exit $ac_status); }; }; then
15279   cf_cv_wchar_t=yes
15280 else
15281   echo "$as_me: failed program was:" >&5
15282 cat conftest.$ac_ext >&5
15283 cf_cv_wchar_t=unknown
15284 fi
15285 rm -f conftest.$ac_objext conftest.$ac_ext
15286 fi
15287 rm -f conftest.$ac_objext conftest.$ac_ext
15288 fi
15289 echo "$as_me:15289: result: $cf_cv_wchar_t" >&5
15290 echo "${ECHO_T}$cf_cv_wchar_t" >&6
15291
15292 if test "$cf_cv_wchar_t" = yes ; then
15293
15294 cat >>confdefs.h <<\EOF
15295 #define NEED_WCHAR_H 1
15296 EOF
15297
15298         NEED_WCHAR_H=1
15299 fi
15300
15301 # if we do not find wchar_t in either place, use substitution to provide a fallback.
15302 if test "$cf_cv_wchar_t" = unknown ; then
15303         NCURSES_WCHAR_T=1
15304 fi
15305
15306 # if we find wchar_t in either place, use substitution to provide a fallback.
15307 if test "$cf_cv_wchar_t" != unknown ; then
15308         NCURSES_OK_WCHAR_T=1
15309 fi
15310
15311 # This is needed on Tru64 5.0 to declare wint_t
15312 echo "$as_me:15312: checking if we must include wchar.h to declare wint_t" >&5
15313 echo $ECHO_N "checking if we must include wchar.h to declare wint_t... $ECHO_C" >&6
15314 if test "${cf_cv_wint_t+set}" = set; then
15315   echo $ECHO_N "(cached) $ECHO_C" >&6
15316 else
15317
15318 cat >conftest.$ac_ext <<_ACEOF
15319 #line 15319 "configure"
15320 #include "confdefs.h"
15321
15322 #include <stdlib.h>
15323 #include <stdarg.h>
15324 #include <stdio.h>
15325 #ifdef HAVE_LIBUTF8_H
15326 #include <libutf8.h>
15327 #endif
15328 int
15329 main ()
15330 {
15331 wint_t state
15332   ;
15333   return 0;
15334 }
15335 _ACEOF
15336 rm -f conftest.$ac_objext
15337 if { (eval echo "$as_me:15337: \"$ac_compile\"") >&5
15338   (eval $ac_compile) 2>&5
15339   ac_status=$?
15340   echo "$as_me:15340: \$? = $ac_status" >&5
15341   (exit $ac_status); } &&
15342          { ac_try='test -s conftest.$ac_objext'
15343   { (eval echo "$as_me:15343: \"$ac_try\"") >&5
15344   (eval $ac_try) 2>&5
15345   ac_status=$?
15346   echo "$as_me:15346: \$? = $ac_status" >&5
15347   (exit $ac_status); }; }; then
15348   cf_cv_wint_t=no
15349 else
15350   echo "$as_me: failed program was:" >&5
15351 cat conftest.$ac_ext >&5
15352 cat >conftest.$ac_ext <<_ACEOF
15353 #line 15353 "configure"
15354 #include "confdefs.h"
15355
15356 #include <stdlib.h>
15357 #include <stdarg.h>
15358 #include <stdio.h>
15359 #include <wchar.h>
15360 #ifdef HAVE_LIBUTF8_H
15361 #include <libutf8.h>
15362 #endif
15363 int
15364 main ()
15365 {
15366 wint_t value
15367   ;
15368   return 0;
15369 }
15370 _ACEOF
15371 rm -f conftest.$ac_objext
15372 if { (eval echo "$as_me:15372: \"$ac_compile\"") >&5
15373   (eval $ac_compile) 2>&5
15374   ac_status=$?
15375   echo "$as_me:15375: \$? = $ac_status" >&5
15376   (exit $ac_status); } &&
15377          { ac_try='test -s conftest.$ac_objext'
15378   { (eval echo "$as_me:15378: \"$ac_try\"") >&5
15379   (eval $ac_try) 2>&5
15380   ac_status=$?
15381   echo "$as_me:15381: \$? = $ac_status" >&5
15382   (exit $ac_status); }; }; then
15383   cf_cv_wint_t=yes
15384 else
15385   echo "$as_me: failed program was:" >&5
15386 cat conftest.$ac_ext >&5
15387 cf_cv_wint_t=unknown
15388 fi
15389 rm -f conftest.$ac_objext conftest.$ac_ext
15390 fi
15391 rm -f conftest.$ac_objext conftest.$ac_ext
15392 fi
15393 echo "$as_me:15393: result: $cf_cv_wint_t" >&5
15394 echo "${ECHO_T}$cf_cv_wint_t" >&6
15395
15396 if test "$cf_cv_wint_t" = yes ; then
15397
15398 cat >>confdefs.h <<\EOF
15399 #define NEED_WCHAR_H 1
15400 EOF
15401
15402         NEED_WCHAR_H=1
15403 fi
15404
15405 # if we do not find wint_t in either place, use substitution to provide a fallback.
15406 if test "$cf_cv_wint_t" = unknown ; then
15407         NCURSES_WINT_T=1
15408 fi
15409
15410 # if we find wint_t in either place, use substitution to provide a fallback.
15411 if test "$cf_cv_wint_t" != unknown ; then
15412         NCURSES_OK_WINT_T=1
15413 fi
15414
15415         if test "$NCURSES_OK_MBSTATE_T" = 0 ; then
15416
15417 echo "$as_me:15417: checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}" >&5
15418 echo $ECHO_N "checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
15419 cat >conftest.$ac_ext <<_ACEOF
15420 #line 15420 "configure"
15421 #include "confdefs.h"
15422
15423 #ifndef _XOPEN_SOURCE_EXTENDED
15424 #define _XOPEN_SOURCE_EXTENDED
15425 #endif
15426 #include <${cf_cv_ncurses_header:-curses.h}>
15427 int
15428 main ()
15429 {
15430
15431 mbstate_t foo
15432
15433   ;
15434   return 0;
15435 }
15436 _ACEOF
15437 rm -f conftest.$ac_objext
15438 if { (eval echo "$as_me:15438: \"$ac_compile\"") >&5
15439   (eval $ac_compile) 2>&5
15440   ac_status=$?
15441   echo "$as_me:15441: \$? = $ac_status" >&5
15442   (exit $ac_status); } &&
15443          { ac_try='test -s conftest.$ac_objext'
15444   { (eval echo "$as_me:15444: \"$ac_try\"") >&5
15445   (eval $ac_try) 2>&5
15446   ac_status=$?
15447   echo "$as_me:15447: \$? = $ac_status" >&5
15448   (exit $ac_status); }; }; then
15449   cf_result=yes
15450 else
15451   echo "$as_me: failed program was:" >&5
15452 cat conftest.$ac_ext >&5
15453 cf_result=no
15454 fi
15455 rm -f conftest.$ac_objext conftest.$ac_ext
15456 echo "$as_me:15456: result: $cf_result" >&5
15457 echo "${ECHO_T}$cf_result" >&6
15458 if test $cf_result = yes ; then
15459
15460 cf_result=`echo "have_type_mbstate_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15461
15462 cat >>confdefs.h <<EOF
15463 #define $cf_result 1
15464 EOF
15465
15466 else
15467
15468 cat >>confdefs.h <<EOF
15469 #define mbstate_t long
15470 EOF
15471
15472 fi
15473
15474         fi
15475
15476         if test "$NCURSES_OK_WCHAR_T" = 0 ; then
15477
15478 echo "$as_me:15478: checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}" >&5
15479 echo $ECHO_N "checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
15480 cat >conftest.$ac_ext <<_ACEOF
15481 #line 15481 "configure"
15482 #include "confdefs.h"
15483
15484 #ifndef _XOPEN_SOURCE_EXTENDED
15485 #define _XOPEN_SOURCE_EXTENDED
15486 #endif
15487 #include <${cf_cv_ncurses_header:-curses.h}>
15488 int
15489 main ()
15490 {
15491
15492 wchar_t foo
15493
15494   ;
15495   return 0;
15496 }
15497 _ACEOF
15498 rm -f conftest.$ac_objext
15499 if { (eval echo "$as_me:15499: \"$ac_compile\"") >&5
15500   (eval $ac_compile) 2>&5
15501   ac_status=$?
15502   echo "$as_me:15502: \$? = $ac_status" >&5
15503   (exit $ac_status); } &&
15504          { ac_try='test -s conftest.$ac_objext'
15505   { (eval echo "$as_me:15505: \"$ac_try\"") >&5
15506   (eval $ac_try) 2>&5
15507   ac_status=$?
15508   echo "$as_me:15508: \$? = $ac_status" >&5
15509   (exit $ac_status); }; }; then
15510   cf_result=yes
15511 else
15512   echo "$as_me: failed program was:" >&5
15513 cat conftest.$ac_ext >&5
15514 cf_result=no
15515 fi
15516 rm -f conftest.$ac_objext conftest.$ac_ext
15517 echo "$as_me:15517: result: $cf_result" >&5
15518 echo "${ECHO_T}$cf_result" >&6
15519 if test $cf_result = yes ; then
15520
15521 cf_result=`echo "have_type_wchar_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15522
15523 cat >>confdefs.h <<EOF
15524 #define $cf_result 1
15525 EOF
15526
15527 else
15528
15529 cat >>confdefs.h <<EOF
15530 #define wchar_t long
15531 EOF
15532
15533 fi
15534
15535         fi
15536
15537         if test "$NCURSES_OK_WINT_T" = 0 ; then
15538
15539 echo "$as_me:15539: checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}" >&5
15540 echo $ECHO_N "checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
15541 cat >conftest.$ac_ext <<_ACEOF
15542 #line 15542 "configure"
15543 #include "confdefs.h"
15544
15545 #ifndef _XOPEN_SOURCE_EXTENDED
15546 #define _XOPEN_SOURCE_EXTENDED
15547 #endif
15548 #include <${cf_cv_ncurses_header:-curses.h}>
15549 int
15550 main ()
15551 {
15552
15553 wint_t foo
15554
15555   ;
15556   return 0;
15557 }
15558 _ACEOF
15559 rm -f conftest.$ac_objext
15560 if { (eval echo "$as_me:15560: \"$ac_compile\"") >&5
15561   (eval $ac_compile) 2>&5
15562   ac_status=$?
15563   echo "$as_me:15563: \$? = $ac_status" >&5
15564   (exit $ac_status); } &&
15565          { ac_try='test -s conftest.$ac_objext'
15566   { (eval echo "$as_me:15566: \"$ac_try\"") >&5
15567   (eval $ac_try) 2>&5
15568   ac_status=$?
15569   echo "$as_me:15569: \$? = $ac_status" >&5
15570   (exit $ac_status); }; }; then
15571   cf_result=yes
15572 else
15573   echo "$as_me: failed program was:" >&5
15574 cat conftest.$ac_ext >&5
15575 cf_result=no
15576 fi
15577 rm -f conftest.$ac_objext conftest.$ac_ext
15578 echo "$as_me:15578: result: $cf_result" >&5
15579 echo "${ECHO_T}$cf_result" >&6
15580 if test $cf_result = yes ; then
15581
15582 cf_result=`echo "have_type_wint_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15583
15584 cat >>confdefs.h <<EOF
15585 #define $cf_result 1
15586 EOF
15587
15588 else
15589
15590 cat >>confdefs.h <<EOF
15591 #define wint_t long
15592 EOF
15593
15594 fi
15595
15596         fi
15597 fi
15598
15599 echo "$as_me:15599: checking for data boolnames declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
15600 echo $ECHO_N "checking for data boolnames declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
15601
15602 cat >conftest.$ac_ext <<_ACEOF
15603 #line 15603 "configure"
15604 #include "confdefs.h"
15605
15606 #ifdef HAVE_XCURSES
15607 #include <xcurses.h>
15608 char * XCursesProgramName = "test";
15609 #else
15610 #include <${cf_cv_ncurses_header:-curses.h}>
15611 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
15612 #include <ncursesw/term.h>
15613 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
15614 #include <ncurses/term.h>
15615 #elif defined(HAVE_TERM_H)
15616 #include <term.h>
15617 #endif
15618 #endif
15619
15620 int
15621 main ()
15622 {
15623
15624 void *foo = &(boolnames)
15625
15626   ;
15627   return 0;
15628 }
15629 _ACEOF
15630 rm -f conftest.$ac_objext
15631 if { (eval echo "$as_me:15631: \"$ac_compile\"") >&5
15632   (eval $ac_compile) 2>&5
15633   ac_status=$?
15634   echo "$as_me:15634: \$? = $ac_status" >&5
15635   (exit $ac_status); } &&
15636          { ac_try='test -s conftest.$ac_objext'
15637   { (eval echo "$as_me:15637: \"$ac_try\"") >&5
15638   (eval $ac_try) 2>&5
15639   ac_status=$?
15640   echo "$as_me:15640: \$? = $ac_status" >&5
15641   (exit $ac_status); }; }; then
15642   cf_result=yes
15643 else
15644   echo "$as_me: failed program was:" >&5
15645 cat conftest.$ac_ext >&5
15646 cf_result=no
15647 fi
15648 rm -f conftest.$ac_objext conftest.$ac_ext
15649 echo "$as_me:15649: result: $cf_result" >&5
15650 echo "${ECHO_T}$cf_result" >&6
15651
15652 if test $cf_result = yes ; then
15653
15654 cf_result=`echo "have_curses_data_boolnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15655
15656         cat >>confdefs.h <<EOF
15657 #define $cf_result 1
15658 EOF
15659
15660 else
15661         echo "$as_me:15661: checking for data boolnames in library" >&5
15662 echo $ECHO_N "checking for data boolnames in library... $ECHO_C" >&6
15663         # BSD linkers insist on making weak linkage, but resolve at runtime.
15664         if test "$cross_compiling" = yes; then
15665
15666         # cross-compiling
15667         cat >conftest.$ac_ext <<_ACEOF
15668 #line 15668 "configure"
15669 #include "confdefs.h"
15670
15671 #ifdef HAVE_XCURSES
15672 #include <xcurses.h>
15673 char * XCursesProgramName = "test";
15674 #else
15675 #include <${cf_cv_ncurses_header:-curses.h}>
15676 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
15677 #include <ncursesw/term.h>
15678 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
15679 #include <ncurses/term.h>
15680 #elif defined(HAVE_TERM_H)
15681 #include <term.h>
15682 #endif
15683 #endif
15684
15685 extern char boolnames;
15686 int
15687 main ()
15688 {
15689
15690         do {
15691                 void *foo = &(boolnames);
15692                 fprintf(stderr, "testing linkage of boolnames:%p\n", foo);
15693                 ${cf_cv_main_return:-return}(foo == 0);
15694         } while (0)
15695
15696   ;
15697   return 0;
15698 }
15699 _ACEOF
15700 rm -f conftest.$ac_objext conftest$ac_exeext
15701 if { (eval echo "$as_me:15701: \"$ac_link\"") >&5
15702   (eval $ac_link) 2>&5
15703   ac_status=$?
15704   echo "$as_me:15704: \$? = $ac_status" >&5
15705   (exit $ac_status); } &&
15706          { ac_try='test -s conftest$ac_exeext'
15707   { (eval echo "$as_me:15707: \"$ac_try\"") >&5
15708   (eval $ac_try) 2>&5
15709   ac_status=$?
15710   echo "$as_me:15710: \$? = $ac_status" >&5
15711   (exit $ac_status); }; }; then
15712   cf_result=yes
15713 else
15714   echo "$as_me: failed program was:" >&5
15715 cat conftest.$ac_ext >&5
15716 cf_result=no
15717 fi
15718 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15719
15720 else
15721   cat >conftest.$ac_ext <<_ACEOF
15722 #line 15722 "configure"
15723 #include "confdefs.h"
15724
15725 #ifdef HAVE_XCURSES
15726 #include <xcurses.h>
15727 char * XCursesProgramName = "test";
15728 #else
15729 #include <${cf_cv_ncurses_header:-curses.h}>
15730 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
15731 #include <ncursesw/term.h>
15732 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
15733 #include <ncurses/term.h>
15734 #elif defined(HAVE_TERM_H)
15735 #include <term.h>
15736 #endif
15737 #endif
15738
15739 extern char boolnames;
15740 int main(void)
15741 {
15742         void *foo = &(boolnames);
15743         fprintf(stderr, "testing linkage of boolnames:%p\n", foo);
15744         ${cf_cv_main_return:-return}(foo == 0);
15745 }
15746 _ACEOF
15747 rm -f conftest$ac_exeext
15748 if { (eval echo "$as_me:15748: \"$ac_link\"") >&5
15749   (eval $ac_link) 2>&5
15750   ac_status=$?
15751   echo "$as_me:15751: \$? = $ac_status" >&5
15752   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
15753   { (eval echo "$as_me:15753: \"$ac_try\"") >&5
15754   (eval $ac_try) 2>&5
15755   ac_status=$?
15756   echo "$as_me:15756: \$? = $ac_status" >&5
15757   (exit $ac_status); }; }; then
15758   cf_result=yes
15759 else
15760   echo "$as_me: program exited with status $ac_status" >&5
15761 echo "$as_me: failed program was:" >&5
15762 cat conftest.$ac_ext >&5
15763 cf_result=no
15764 fi
15765 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
15766 fi
15767         echo "$as_me:15767: result: $cf_result" >&5
15768 echo "${ECHO_T}$cf_result" >&6
15769         if test $cf_result = yes ; then
15770
15771 cf_result=`echo "decl_curses_data_boolnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15772
15773                 cat >>confdefs.h <<EOF
15774 #define $cf_result 1
15775 EOF
15776
15777         fi
15778 fi
15779
15780 echo "$as_me:15780: checking for data boolfnames declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
15781 echo $ECHO_N "checking for data boolfnames declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
15782
15783 cat >conftest.$ac_ext <<_ACEOF
15784 #line 15784 "configure"
15785 #include "confdefs.h"
15786
15787 #ifdef HAVE_XCURSES
15788 #include <xcurses.h>
15789 char * XCursesProgramName = "test";
15790 #else
15791 #include <${cf_cv_ncurses_header:-curses.h}>
15792 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
15793 #include <ncursesw/term.h>
15794 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
15795 #include <ncurses/term.h>
15796 #elif defined(HAVE_TERM_H)
15797 #include <term.h>
15798 #endif
15799 #endif
15800
15801 int
15802 main ()
15803 {
15804
15805 void *foo = &(boolfnames)
15806
15807   ;
15808   return 0;
15809 }
15810 _ACEOF
15811 rm -f conftest.$ac_objext
15812 if { (eval echo "$as_me:15812: \"$ac_compile\"") >&5
15813   (eval $ac_compile) 2>&5
15814   ac_status=$?
15815   echo "$as_me:15815: \$? = $ac_status" >&5
15816   (exit $ac_status); } &&
15817          { ac_try='test -s conftest.$ac_objext'
15818   { (eval echo "$as_me:15818: \"$ac_try\"") >&5
15819   (eval $ac_try) 2>&5
15820   ac_status=$?
15821   echo "$as_me:15821: \$? = $ac_status" >&5
15822   (exit $ac_status); }; }; then
15823   cf_result=yes
15824 else
15825   echo "$as_me: failed program was:" >&5
15826 cat conftest.$ac_ext >&5
15827 cf_result=no
15828 fi
15829 rm -f conftest.$ac_objext conftest.$ac_ext
15830 echo "$as_me:15830: result: $cf_result" >&5
15831 echo "${ECHO_T}$cf_result" >&6
15832
15833 if test $cf_result = yes ; then
15834
15835 cf_result=`echo "have_curses_data_boolfnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15836
15837         cat >>confdefs.h <<EOF
15838 #define $cf_result 1
15839 EOF
15840
15841 else
15842         echo "$as_me:15842: checking for data boolfnames in library" >&5
15843 echo $ECHO_N "checking for data boolfnames in library... $ECHO_C" >&6
15844         # BSD linkers insist on making weak linkage, but resolve at runtime.
15845         if test "$cross_compiling" = yes; then
15846
15847         # cross-compiling
15848         cat >conftest.$ac_ext <<_ACEOF
15849 #line 15849 "configure"
15850 #include "confdefs.h"
15851
15852 #ifdef HAVE_XCURSES
15853 #include <xcurses.h>
15854 char * XCursesProgramName = "test";
15855 #else
15856 #include <${cf_cv_ncurses_header:-curses.h}>
15857 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
15858 #include <ncursesw/term.h>
15859 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
15860 #include <ncurses/term.h>
15861 #elif defined(HAVE_TERM_H)
15862 #include <term.h>
15863 #endif
15864 #endif
15865
15866 extern char boolfnames;
15867 int
15868 main ()
15869 {
15870
15871         do {
15872                 void *foo = &(boolfnames);
15873                 fprintf(stderr, "testing linkage of boolfnames:%p\n", foo);
15874                 ${cf_cv_main_return:-return}(foo == 0);
15875         } while (0)
15876
15877   ;
15878   return 0;
15879 }
15880 _ACEOF
15881 rm -f conftest.$ac_objext conftest$ac_exeext
15882 if { (eval echo "$as_me:15882: \"$ac_link\"") >&5
15883   (eval $ac_link) 2>&5
15884   ac_status=$?
15885   echo "$as_me:15885: \$? = $ac_status" >&5
15886   (exit $ac_status); } &&
15887          { ac_try='test -s conftest$ac_exeext'
15888   { (eval echo "$as_me:15888: \"$ac_try\"") >&5
15889   (eval $ac_try) 2>&5
15890   ac_status=$?
15891   echo "$as_me:15891: \$? = $ac_status" >&5
15892   (exit $ac_status); }; }; then
15893   cf_result=yes
15894 else
15895   echo "$as_me: failed program was:" >&5
15896 cat conftest.$ac_ext >&5
15897 cf_result=no
15898 fi
15899 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15900
15901 else
15902   cat >conftest.$ac_ext <<_ACEOF
15903 #line 15903 "configure"
15904 #include "confdefs.h"
15905
15906 #ifdef HAVE_XCURSES
15907 #include <xcurses.h>
15908 char * XCursesProgramName = "test";
15909 #else
15910 #include <${cf_cv_ncurses_header:-curses.h}>
15911 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
15912 #include <ncursesw/term.h>
15913 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
15914 #include <ncurses/term.h>
15915 #elif defined(HAVE_TERM_H)
15916 #include <term.h>
15917 #endif
15918 #endif
15919
15920 extern char boolfnames;
15921 int main(void)
15922 {
15923         void *foo = &(boolfnames);
15924         fprintf(stderr, "testing linkage of boolfnames:%p\n", foo);
15925         ${cf_cv_main_return:-return}(foo == 0);
15926 }
15927 _ACEOF
15928 rm -f conftest$ac_exeext
15929 if { (eval echo "$as_me:15929: \"$ac_link\"") >&5
15930   (eval $ac_link) 2>&5
15931   ac_status=$?
15932   echo "$as_me:15932: \$? = $ac_status" >&5
15933   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
15934   { (eval echo "$as_me:15934: \"$ac_try\"") >&5
15935   (eval $ac_try) 2>&5
15936   ac_status=$?
15937   echo "$as_me:15937: \$? = $ac_status" >&5
15938   (exit $ac_status); }; }; then
15939   cf_result=yes
15940 else
15941   echo "$as_me: program exited with status $ac_status" >&5
15942 echo "$as_me: failed program was:" >&5
15943 cat conftest.$ac_ext >&5
15944 cf_result=no
15945 fi
15946 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
15947 fi
15948         echo "$as_me:15948: result: $cf_result" >&5
15949 echo "${ECHO_T}$cf_result" >&6
15950         if test $cf_result = yes ; then
15951
15952 cf_result=`echo "decl_curses_data_boolfnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15953
15954                 cat >>confdefs.h <<EOF
15955 #define $cf_result 1
15956 EOF
15957
15958         fi
15959 fi
15960
15961 if ( test "$GCC" = yes || test "$GXX" = yes )
15962 then
15963 echo "$as_me:15963: checking if you want to turn on gcc warnings" >&5
15964 echo $ECHO_N "checking if you want to turn on gcc warnings... $ECHO_C" >&6
15965
15966 # Check whether --enable-warnings or --disable-warnings was given.
15967 if test "${enable_warnings+set}" = set; then
15968   enableval="$enable_warnings"
15969   test "$enableval" != yes && enableval=no
15970   if test "$enableval" != "no" ; then
15971     with_warnings=yes
15972   else
15973     with_warnings=no
15974   fi
15975 else
15976   enableval=no
15977   with_warnings=no
15978
15979 fi;
15980 echo "$as_me:15980: result: $with_warnings" >&5
15981 echo "${ECHO_T}$with_warnings" >&6
15982 if test "$with_warnings" = "yes"
15983 then
15984
15985 if test "$GCC" = yes
15986 then
15987 cat > conftest.i <<EOF
15988 #ifndef GCC_PRINTF
15989 #define GCC_PRINTF 0
15990 #endif
15991 #ifndef GCC_SCANF
15992 #define GCC_SCANF 0
15993 #endif
15994 #ifndef GCC_NORETURN
15995 #define GCC_NORETURN /* nothing */
15996 #endif
15997 #ifndef GCC_UNUSED
15998 #define GCC_UNUSED /* nothing */
15999 #endif
16000 EOF
16001 if test "$GCC" = yes
16002 then
16003         { echo "$as_me:16003: checking for $CC __attribute__ directives..." >&5
16004 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
16005 cat > conftest.$ac_ext <<EOF
16006 #line 16006 "${as_me:-configure}"
16007 #include "confdefs.h"
16008 #include "conftest.h"
16009 #include "conftest.i"
16010 #if     GCC_PRINTF
16011 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
16012 #else
16013 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
16014 #endif
16015 #if     GCC_SCANF
16016 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
16017 #else
16018 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
16019 #endif
16020 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
16021 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
16022 extern void foo(void) GCC_NORETURN;
16023 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
16024 EOF
16025         cf_printf_attribute=no
16026         cf_scanf_attribute=no
16027         for cf_attribute in scanf printf unused noreturn
16028         do
16029
16030 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16031
16032                 cf_directive="__attribute__(($cf_attribute))"
16033                 echo "checking for $CC $cf_directive" 1>&5
16034
16035                 case $cf_attribute in
16036                 (printf)
16037                         cf_printf_attribute=yes
16038                         cat >conftest.h <<EOF
16039 #define GCC_$cf_ATTRIBUTE 1
16040 EOF
16041                         ;;
16042                 (scanf)
16043                         cf_scanf_attribute=yes
16044                         cat >conftest.h <<EOF
16045 #define GCC_$cf_ATTRIBUTE 1
16046 EOF
16047                         ;;
16048                 (*)
16049                         cat >conftest.h <<EOF
16050 #define GCC_$cf_ATTRIBUTE $cf_directive
16051 EOF
16052                         ;;
16053                 esac
16054
16055                 if { (eval echo "$as_me:16055: \"$ac_compile\"") >&5
16056   (eval $ac_compile) 2>&5
16057   ac_status=$?
16058   echo "$as_me:16058: \$? = $ac_status" >&5
16059   (exit $ac_status); }; then
16060                         test -n "$verbose" && echo "$as_me:16060: result: ... $cf_attribute" >&5
16061 echo "${ECHO_T}... $cf_attribute" >&6
16062                         cat conftest.h >>confdefs.h
16063                         case $cf_attribute in
16064                         (noreturn)
16065
16066 cat >>confdefs.h <<EOF
16067 #define GCC_NORETURN $cf_directive
16068 EOF
16069
16070                                 ;;
16071                         (printf)
16072                                 cf_value='/* nothing */'
16073                                 if test "$cf_printf_attribute" != no ; then
16074                                         cf_value='__attribute__((format(printf,fmt,var)))'
16075
16076 cat >>confdefs.h <<\EOF
16077 #define GCC_PRINTF 1
16078 EOF
16079
16080                                 fi
16081
16082 cat >>confdefs.h <<EOF
16083 #define GCC_PRINTFLIKE(fmt,var) $cf_value
16084 EOF
16085
16086                                 ;;
16087                         (scanf)
16088                                 cf_value='/* nothing */'
16089                                 if test "$cf_scanf_attribute" != no ; then
16090                                         cf_value='__attribute__((format(scanf,fmt,var)))'
16091
16092 cat >>confdefs.h <<\EOF
16093 #define GCC_SCANF 1
16094 EOF
16095
16096                                 fi
16097
16098 cat >>confdefs.h <<EOF
16099 #define GCC_SCANFLIKE(fmt,var) $cf_value
16100 EOF
16101
16102                                 ;;
16103                         (unused)
16104
16105 cat >>confdefs.h <<EOF
16106 #define GCC_UNUSED $cf_directive
16107 EOF
16108
16109                                 ;;
16110                         esac
16111                 fi
16112         done
16113 else
16114         fgrep define conftest.i >>confdefs.h
16115 fi
16116 rm -rf conftest*
16117 fi
16118
16119 INTEL_COMPILER=no
16120
16121 if test "$GCC" = yes ; then
16122         case $host_os in
16123         (linux*|gnu*)
16124                 echo "$as_me:16124: checking if this is really Intel C compiler" >&5
16125 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
16126                 cf_save_CFLAGS="$CFLAGS"
16127                 CFLAGS="$CFLAGS -no-gcc"
16128                 cat >conftest.$ac_ext <<_ACEOF
16129 #line 16129 "configure"
16130 #include "confdefs.h"
16131
16132 int
16133 main ()
16134 {
16135
16136 #ifdef __INTEL_COMPILER
16137 #else
16138 make an error
16139 #endif
16140
16141   ;
16142   return 0;
16143 }
16144 _ACEOF
16145 rm -f conftest.$ac_objext
16146 if { (eval echo "$as_me:16146: \"$ac_compile\"") >&5
16147   (eval $ac_compile) 2>&5
16148   ac_status=$?
16149   echo "$as_me:16149: \$? = $ac_status" >&5
16150   (exit $ac_status); } &&
16151          { ac_try='test -s conftest.$ac_objext'
16152   { (eval echo "$as_me:16152: \"$ac_try\"") >&5
16153   (eval $ac_try) 2>&5
16154   ac_status=$?
16155   echo "$as_me:16155: \$? = $ac_status" >&5
16156   (exit $ac_status); }; }; then
16157   INTEL_COMPILER=yes
16158 cf_save_CFLAGS="$cf_save_CFLAGS -we147"
16159
16160 else
16161   echo "$as_me: failed program was:" >&5
16162 cat conftest.$ac_ext >&5
16163 fi
16164 rm -f conftest.$ac_objext conftest.$ac_ext
16165                 CFLAGS="$cf_save_CFLAGS"
16166                 echo "$as_me:16166: result: $INTEL_COMPILER" >&5
16167 echo "${ECHO_T}$INTEL_COMPILER" >&6
16168                 ;;
16169         esac
16170 fi
16171
16172 CLANG_COMPILER=no
16173
16174 if test "$GCC" = yes ; then
16175         echo "$as_me:16175: checking if this is really Clang C compiler" >&5
16176 echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6
16177         cf_save_CFLAGS="$CFLAGS"
16178         CFLAGS="$CFLAGS -Qunused-arguments"
16179         cat >conftest.$ac_ext <<_ACEOF
16180 #line 16180 "configure"
16181 #include "confdefs.h"
16182
16183 int
16184 main ()
16185 {
16186
16187 #ifdef __clang__
16188 #else
16189 make an error
16190 #endif
16191
16192   ;
16193   return 0;
16194 }
16195 _ACEOF
16196 rm -f conftest.$ac_objext
16197 if { (eval echo "$as_me:16197: \"$ac_compile\"") >&5
16198   (eval $ac_compile) 2>&5
16199   ac_status=$?
16200   echo "$as_me:16200: \$? = $ac_status" >&5
16201   (exit $ac_status); } &&
16202          { ac_try='test -s conftest.$ac_objext'
16203   { (eval echo "$as_me:16203: \"$ac_try\"") >&5
16204   (eval $ac_try) 2>&5
16205   ac_status=$?
16206   echo "$as_me:16206: \$? = $ac_status" >&5
16207   (exit $ac_status); }; }; then
16208   CLANG_COMPILER=yes
16209 cf_save_CFLAGS="$cf_save_CFLAGS -Qunused-arguments"
16210
16211 else
16212   echo "$as_me: failed program was:" >&5
16213 cat conftest.$ac_ext >&5
16214 fi
16215 rm -f conftest.$ac_objext conftest.$ac_ext
16216         CFLAGS="$cf_save_CFLAGS"
16217         echo "$as_me:16217: result: $CLANG_COMPILER" >&5
16218 echo "${ECHO_T}$CLANG_COMPILER" >&6
16219 fi
16220
16221 cat > conftest.$ac_ext <<EOF
16222 #line 16222 "${as_me:-configure}"
16223 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
16224 EOF
16225
16226 if test "$INTEL_COMPILER" = yes
16227 then
16228 # The "-wdXXX" options suppress warnings:
16229 # remark #1419: external declaration in primary source file
16230 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
16231 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
16232 # remark #193: zero used for undefined preprocessing identifier
16233 # remark #593: variable "curs_sb_left_arrow" was set but never used
16234 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
16235 # remark #869: parameter "tw" was never referenced
16236 # remark #981: operands are evaluated in unspecified order
16237 # warning #279: controlling expression is constant
16238
16239         { echo "$as_me:16239: checking for $CC warning options..." >&5
16240 echo "$as_me: checking for $CC warning options..." >&6;}
16241         cf_save_CFLAGS="$CFLAGS"
16242         EXTRA_CFLAGS="-Wall"
16243         for cf_opt in \
16244                 wd1419 \
16245                 wd1683 \
16246                 wd1684 \
16247                 wd193 \
16248                 wd593 \
16249                 wd279 \
16250                 wd810 \
16251                 wd869 \
16252                 wd981
16253         do
16254                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
16255                 if { (eval echo "$as_me:16255: \"$ac_compile\"") >&5
16256   (eval $ac_compile) 2>&5
16257   ac_status=$?
16258   echo "$as_me:16258: \$? = $ac_status" >&5
16259   (exit $ac_status); }; then
16260                         test -n "$verbose" && echo "$as_me:16260: result: ... -$cf_opt" >&5
16261 echo "${ECHO_T}... -$cf_opt" >&6
16262                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
16263                 fi
16264         done
16265         CFLAGS="$cf_save_CFLAGS"
16266
16267 elif test "$GCC" = yes
16268 then
16269         { echo "$as_me:16269: checking for $CC warning options..." >&5
16270 echo "$as_me: checking for $CC warning options..." >&6;}
16271         cf_save_CFLAGS="$CFLAGS"
16272         EXTRA_CFLAGS=
16273         cf_warn_CONST=""
16274         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
16275         cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
16276         test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
16277         for cf_opt in W Wall \
16278                 Wbad-function-cast \
16279                 Wcast-align \
16280                 Wcast-qual \
16281                 Wdeclaration-after-statement \
16282                 Wextra \
16283                 Winline \
16284                 Wmissing-declarations \
16285                 Wmissing-prototypes \
16286                 Wnested-externs \
16287                 Wpointer-arith \
16288                 Wshadow \
16289                 Wstrict-prototypes \
16290                 Wundef $cf_gcc_warnings $cf_warn_CONST
16291         do
16292                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
16293                 if { (eval echo "$as_me:16293: \"$ac_compile\"") >&5
16294   (eval $ac_compile) 2>&5
16295   ac_status=$?
16296   echo "$as_me:16296: \$? = $ac_status" >&5
16297   (exit $ac_status); }; then
16298                         test -n "$verbose" && echo "$as_me:16298: result: ... -$cf_opt" >&5
16299 echo "${ECHO_T}... -$cf_opt" >&6
16300                         case $cf_opt in
16301                         (Wcast-qual)
16302                                 CPPFLAGS="$CPPFLAGS -DXTSTRINGDEFINES"
16303                                 ;;
16304                         (Winline)
16305                                 case $GCC_VERSION in
16306                                 ([34].*)
16307                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
16308
16309 echo "${as_me:-configure}:16309: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
16310
16311                                         continue;;
16312                                 esac
16313                                 ;;
16314                         (Wpointer-arith)
16315                                 case $GCC_VERSION in
16316                                 ([12].*)
16317                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
16318
16319 echo "${as_me:-configure}:16319: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
16320
16321                                         continue;;
16322                                 esac
16323                                 ;;
16324                         esac
16325                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
16326                 fi
16327         done
16328         CFLAGS="$cf_save_CFLAGS"
16329 fi
16330 rm -rf conftest*
16331
16332 fi
16333 fi
16334
16335 echo "$as_me:16335: checking if you want to use dmalloc for testing" >&5
16336 echo $ECHO_N "checking if you want to use dmalloc for testing... $ECHO_C" >&6
16337
16338 # Check whether --with-dmalloc or --without-dmalloc was given.
16339 if test "${with_dmalloc+set}" = set; then
16340   withval="$with_dmalloc"
16341
16342 cat >>confdefs.h <<EOF
16343 #define USE_DMALLOC 1
16344 EOF
16345
16346         : ${with_cflags:=-g}
16347         : ${with_no_leaks:=yes}
16348          with_dmalloc=yes
16349 else
16350   with_dmalloc=
16351 fi;
16352 echo "$as_me:16352: result: ${with_dmalloc:-no}" >&5
16353 echo "${ECHO_T}${with_dmalloc:-no}" >&6
16354
16355 case .$with_cflags in
16356 (.*-g*)
16357         case .$CFLAGS in
16358         (.*-g*)
16359                 ;;
16360         (*)
16361
16362 cf_fix_cppflags=no
16363 cf_new_cflags=
16364 cf_new_cppflags=
16365 cf_new_extra_cppflags=
16366
16367 for cf_add_cflags in -g
16368 do
16369 case $cf_fix_cppflags in
16370 (no)
16371         case $cf_add_cflags in
16372         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
16373                 case $cf_add_cflags in
16374                 (-D*)
16375                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
16376
16377                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16378                                 && test -z "${cf_tst_cflags}" \
16379                                 && cf_fix_cppflags=yes
16380
16381                         if test $cf_fix_cppflags = yes ; then
16382                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
16383                                 continue
16384                         elif test "${cf_tst_cflags}" = "\"'" ; then
16385                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
16386                                 continue
16387                         fi
16388                         ;;
16389                 esac
16390                 case "$CPPFLAGS" in
16391                 (*$cf_add_cflags)
16392                         ;;
16393                 (*)
16394                         case $cf_add_cflags in
16395                         (-D*)
16396                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
16397
16398 CPPFLAGS=`echo "$CPPFLAGS" | \
16399         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
16400                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
16401
16402                                 ;;
16403                         esac
16404                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
16405                         ;;
16406                 esac
16407                 ;;
16408         (*)
16409                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
16410                 ;;
16411         esac
16412         ;;
16413 (yes)
16414         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
16415
16416         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
16417
16418         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16419                 && test -z "${cf_tst_cflags}" \
16420                 && cf_fix_cppflags=no
16421         ;;
16422 esac
16423 done
16424
16425 if test -n "$cf_new_cflags" ; then
16426
16427         CFLAGS="$CFLAGS $cf_new_cflags"
16428 fi
16429
16430 if test -n "$cf_new_cppflags" ; then
16431
16432         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
16433 fi
16434
16435 if test -n "$cf_new_extra_cppflags" ; then
16436
16437         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
16438 fi
16439
16440                 ;;
16441         esac
16442         ;;
16443 esac
16444
16445 if test "$with_dmalloc" = yes ; then
16446         echo "$as_me:16446: checking for dmalloc.h" >&5
16447 echo $ECHO_N "checking for dmalloc.h... $ECHO_C" >&6
16448 if test "${ac_cv_header_dmalloc_h+set}" = set; then
16449   echo $ECHO_N "(cached) $ECHO_C" >&6
16450 else
16451   cat >conftest.$ac_ext <<_ACEOF
16452 #line 16452 "configure"
16453 #include "confdefs.h"
16454 #include <dmalloc.h>
16455 _ACEOF
16456 if { (eval echo "$as_me:16456: \"$ac_cpp conftest.$ac_ext\"") >&5
16457   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
16458   ac_status=$?
16459   egrep -v '^ *\+' conftest.er1 >conftest.err
16460   rm -f conftest.er1
16461   cat conftest.err >&5
16462   echo "$as_me:16462: \$? = $ac_status" >&5
16463   (exit $ac_status); } >/dev/null; then
16464   if test -s conftest.err; then
16465     ac_cpp_err=$ac_c_preproc_warn_flag
16466   else
16467     ac_cpp_err=
16468   fi
16469 else
16470   ac_cpp_err=yes
16471 fi
16472 if test -z "$ac_cpp_err"; then
16473   ac_cv_header_dmalloc_h=yes
16474 else
16475   echo "$as_me: failed program was:" >&5
16476   cat conftest.$ac_ext >&5
16477   ac_cv_header_dmalloc_h=no
16478 fi
16479 rm -f conftest.err conftest.$ac_ext
16480 fi
16481 echo "$as_me:16481: result: $ac_cv_header_dmalloc_h" >&5
16482 echo "${ECHO_T}$ac_cv_header_dmalloc_h" >&6
16483 if test $ac_cv_header_dmalloc_h = yes; then
16484
16485 echo "$as_me:16485: checking for dmalloc_debug in -ldmalloc" >&5
16486 echo $ECHO_N "checking for dmalloc_debug in -ldmalloc... $ECHO_C" >&6
16487 if test "${ac_cv_lib_dmalloc_dmalloc_debug+set}" = set; then
16488   echo $ECHO_N "(cached) $ECHO_C" >&6
16489 else
16490   ac_check_lib_save_LIBS=$LIBS
16491 LIBS="-ldmalloc  $LIBS"
16492 cat >conftest.$ac_ext <<_ACEOF
16493 #line 16493 "configure"
16494 #include "confdefs.h"
16495
16496 /* Override any gcc2 internal prototype to avoid an error.  */
16497 #ifdef __cplusplus
16498 extern "C"
16499 #endif
16500 /* We use char because int might match the return type of a gcc2
16501    builtin and then its argument prototype would still apply.  */
16502 char dmalloc_debug ();
16503 int
16504 main ()
16505 {
16506 dmalloc_debug ();
16507   ;
16508   return 0;
16509 }
16510 _ACEOF
16511 rm -f conftest.$ac_objext conftest$ac_exeext
16512 if { (eval echo "$as_me:16512: \"$ac_link\"") >&5
16513   (eval $ac_link) 2>&5
16514   ac_status=$?
16515   echo "$as_me:16515: \$? = $ac_status" >&5
16516   (exit $ac_status); } &&
16517          { ac_try='test -s conftest$ac_exeext'
16518   { (eval echo "$as_me:16518: \"$ac_try\"") >&5
16519   (eval $ac_try) 2>&5
16520   ac_status=$?
16521   echo "$as_me:16521: \$? = $ac_status" >&5
16522   (exit $ac_status); }; }; then
16523   ac_cv_lib_dmalloc_dmalloc_debug=yes
16524 else
16525   echo "$as_me: failed program was:" >&5
16526 cat conftest.$ac_ext >&5
16527 ac_cv_lib_dmalloc_dmalloc_debug=no
16528 fi
16529 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16530 LIBS=$ac_check_lib_save_LIBS
16531 fi
16532 echo "$as_me:16532: result: $ac_cv_lib_dmalloc_dmalloc_debug" >&5
16533 echo "${ECHO_T}$ac_cv_lib_dmalloc_dmalloc_debug" >&6
16534 if test $ac_cv_lib_dmalloc_dmalloc_debug = yes; then
16535   cat >>confdefs.h <<EOF
16536 #define HAVE_LIBDMALLOC 1
16537 EOF
16538
16539   LIBS="-ldmalloc $LIBS"
16540
16541 fi
16542
16543 fi
16544
16545 fi
16546
16547 echo "$as_me:16547: checking if you want to use dbmalloc for testing" >&5
16548 echo $ECHO_N "checking if you want to use dbmalloc for testing... $ECHO_C" >&6
16549
16550 # Check whether --with-dbmalloc or --without-dbmalloc was given.
16551 if test "${with_dbmalloc+set}" = set; then
16552   withval="$with_dbmalloc"
16553
16554 cat >>confdefs.h <<EOF
16555 #define USE_DBMALLOC 1
16556 EOF
16557
16558         : ${with_cflags:=-g}
16559         : ${with_no_leaks:=yes}
16560          with_dbmalloc=yes
16561 else
16562   with_dbmalloc=
16563 fi;
16564 echo "$as_me:16564: result: ${with_dbmalloc:-no}" >&5
16565 echo "${ECHO_T}${with_dbmalloc:-no}" >&6
16566
16567 case .$with_cflags in
16568 (.*-g*)
16569         case .$CFLAGS in
16570         (.*-g*)
16571                 ;;
16572         (*)
16573
16574 cf_fix_cppflags=no
16575 cf_new_cflags=
16576 cf_new_cppflags=
16577 cf_new_extra_cppflags=
16578
16579 for cf_add_cflags in -g
16580 do
16581 case $cf_fix_cppflags in
16582 (no)
16583         case $cf_add_cflags in
16584         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
16585                 case $cf_add_cflags in
16586                 (-D*)
16587                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
16588
16589                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16590                                 && test -z "${cf_tst_cflags}" \
16591                                 && cf_fix_cppflags=yes
16592
16593                         if test $cf_fix_cppflags = yes ; then
16594                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
16595                                 continue
16596                         elif test "${cf_tst_cflags}" = "\"'" ; then
16597                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
16598                                 continue
16599                         fi
16600                         ;;
16601                 esac
16602                 case "$CPPFLAGS" in
16603                 (*$cf_add_cflags)
16604                         ;;
16605                 (*)
16606                         case $cf_add_cflags in
16607                         (-D*)
16608                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
16609
16610 CPPFLAGS=`echo "$CPPFLAGS" | \
16611         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
16612                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
16613
16614                                 ;;
16615                         esac
16616                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
16617                         ;;
16618                 esac
16619                 ;;
16620         (*)
16621                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
16622                 ;;
16623         esac
16624         ;;
16625 (yes)
16626         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
16627
16628         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
16629
16630         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16631                 && test -z "${cf_tst_cflags}" \
16632                 && cf_fix_cppflags=no
16633         ;;
16634 esac
16635 done
16636
16637 if test -n "$cf_new_cflags" ; then
16638
16639         CFLAGS="$CFLAGS $cf_new_cflags"
16640 fi
16641
16642 if test -n "$cf_new_cppflags" ; then
16643
16644         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
16645 fi
16646
16647 if test -n "$cf_new_extra_cppflags" ; then
16648
16649         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
16650 fi
16651
16652                 ;;
16653         esac
16654         ;;
16655 esac
16656
16657 if test "$with_dbmalloc" = yes ; then
16658         echo "$as_me:16658: checking for dbmalloc.h" >&5
16659 echo $ECHO_N "checking for dbmalloc.h... $ECHO_C" >&6
16660 if test "${ac_cv_header_dbmalloc_h+set}" = set; then
16661   echo $ECHO_N "(cached) $ECHO_C" >&6
16662 else
16663   cat >conftest.$ac_ext <<_ACEOF
16664 #line 16664 "configure"
16665 #include "confdefs.h"
16666 #include <dbmalloc.h>
16667 _ACEOF
16668 if { (eval echo "$as_me:16668: \"$ac_cpp conftest.$ac_ext\"") >&5
16669   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
16670   ac_status=$?
16671   egrep -v '^ *\+' conftest.er1 >conftest.err
16672   rm -f conftest.er1
16673   cat conftest.err >&5
16674   echo "$as_me:16674: \$? = $ac_status" >&5
16675   (exit $ac_status); } >/dev/null; then
16676   if test -s conftest.err; then
16677     ac_cpp_err=$ac_c_preproc_warn_flag
16678   else
16679     ac_cpp_err=
16680   fi
16681 else
16682   ac_cpp_err=yes
16683 fi
16684 if test -z "$ac_cpp_err"; then
16685   ac_cv_header_dbmalloc_h=yes
16686 else
16687   echo "$as_me: failed program was:" >&5
16688   cat conftest.$ac_ext >&5
16689   ac_cv_header_dbmalloc_h=no
16690 fi
16691 rm -f conftest.err conftest.$ac_ext
16692 fi
16693 echo "$as_me:16693: result: $ac_cv_header_dbmalloc_h" >&5
16694 echo "${ECHO_T}$ac_cv_header_dbmalloc_h" >&6
16695 if test $ac_cv_header_dbmalloc_h = yes; then
16696
16697 echo "$as_me:16697: checking for debug_malloc in -ldbmalloc" >&5
16698 echo $ECHO_N "checking for debug_malloc in -ldbmalloc... $ECHO_C" >&6
16699 if test "${ac_cv_lib_dbmalloc_debug_malloc+set}" = set; then
16700   echo $ECHO_N "(cached) $ECHO_C" >&6
16701 else
16702   ac_check_lib_save_LIBS=$LIBS
16703 LIBS="-ldbmalloc  $LIBS"
16704 cat >conftest.$ac_ext <<_ACEOF
16705 #line 16705 "configure"
16706 #include "confdefs.h"
16707
16708 /* Override any gcc2 internal prototype to avoid an error.  */
16709 #ifdef __cplusplus
16710 extern "C"
16711 #endif
16712 /* We use char because int might match the return type of a gcc2
16713    builtin and then its argument prototype would still apply.  */
16714 char debug_malloc ();
16715 int
16716 main ()
16717 {
16718 debug_malloc ();
16719   ;
16720   return 0;
16721 }
16722 _ACEOF
16723 rm -f conftest.$ac_objext conftest$ac_exeext
16724 if { (eval echo "$as_me:16724: \"$ac_link\"") >&5
16725   (eval $ac_link) 2>&5
16726   ac_status=$?
16727   echo "$as_me:16727: \$? = $ac_status" >&5
16728   (exit $ac_status); } &&
16729          { ac_try='test -s conftest$ac_exeext'
16730   { (eval echo "$as_me:16730: \"$ac_try\"") >&5
16731   (eval $ac_try) 2>&5
16732   ac_status=$?
16733   echo "$as_me:16733: \$? = $ac_status" >&5
16734   (exit $ac_status); }; }; then
16735   ac_cv_lib_dbmalloc_debug_malloc=yes
16736 else
16737   echo "$as_me: failed program was:" >&5
16738 cat conftest.$ac_ext >&5
16739 ac_cv_lib_dbmalloc_debug_malloc=no
16740 fi
16741 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16742 LIBS=$ac_check_lib_save_LIBS
16743 fi
16744 echo "$as_me:16744: result: $ac_cv_lib_dbmalloc_debug_malloc" >&5
16745 echo "${ECHO_T}$ac_cv_lib_dbmalloc_debug_malloc" >&6
16746 if test $ac_cv_lib_dbmalloc_debug_malloc = yes; then
16747   cat >>confdefs.h <<EOF
16748 #define HAVE_LIBDBMALLOC 1
16749 EOF
16750
16751   LIBS="-ldbmalloc $LIBS"
16752
16753 fi
16754
16755 fi
16756
16757 fi
16758
16759 echo "$as_me:16759: checking if you want to use valgrind for testing" >&5
16760 echo $ECHO_N "checking if you want to use valgrind for testing... $ECHO_C" >&6
16761
16762 # Check whether --with-valgrind or --without-valgrind was given.
16763 if test "${with_valgrind+set}" = set; then
16764   withval="$with_valgrind"
16765
16766 cat >>confdefs.h <<EOF
16767 #define USE_VALGRIND 1
16768 EOF
16769
16770         : ${with_cflags:=-g}
16771         : ${with_no_leaks:=yes}
16772          with_valgrind=yes
16773 else
16774   with_valgrind=
16775 fi;
16776 echo "$as_me:16776: result: ${with_valgrind:-no}" >&5
16777 echo "${ECHO_T}${with_valgrind:-no}" >&6
16778
16779 case .$with_cflags in
16780 (.*-g*)
16781         case .$CFLAGS in
16782         (.*-g*)
16783                 ;;
16784         (*)
16785
16786 cf_fix_cppflags=no
16787 cf_new_cflags=
16788 cf_new_cppflags=
16789 cf_new_extra_cppflags=
16790
16791 for cf_add_cflags in -g
16792 do
16793 case $cf_fix_cppflags in
16794 (no)
16795         case $cf_add_cflags in
16796         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
16797                 case $cf_add_cflags in
16798                 (-D*)
16799                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
16800
16801                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16802                                 && test -z "${cf_tst_cflags}" \
16803                                 && cf_fix_cppflags=yes
16804
16805                         if test $cf_fix_cppflags = yes ; then
16806                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
16807                                 continue
16808                         elif test "${cf_tst_cflags}" = "\"'" ; then
16809                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
16810                                 continue
16811                         fi
16812                         ;;
16813                 esac
16814                 case "$CPPFLAGS" in
16815                 (*$cf_add_cflags)
16816                         ;;
16817                 (*)
16818                         case $cf_add_cflags in
16819                         (-D*)
16820                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
16821
16822 CPPFLAGS=`echo "$CPPFLAGS" | \
16823         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
16824                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
16825
16826                                 ;;
16827                         esac
16828                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
16829                         ;;
16830                 esac
16831                 ;;
16832         (*)
16833                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
16834                 ;;
16835         esac
16836         ;;
16837 (yes)
16838         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
16839
16840         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
16841
16842         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16843                 && test -z "${cf_tst_cflags}" \
16844                 && cf_fix_cppflags=no
16845         ;;
16846 esac
16847 done
16848
16849 if test -n "$cf_new_cflags" ; then
16850
16851         CFLAGS="$CFLAGS $cf_new_cflags"
16852 fi
16853
16854 if test -n "$cf_new_cppflags" ; then
16855
16856         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
16857 fi
16858
16859 if test -n "$cf_new_extra_cppflags" ; then
16860
16861         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
16862 fi
16863
16864                 ;;
16865         esac
16866         ;;
16867 esac
16868
16869 echo "$as_me:16869: checking if you want to perform memory-leak testing" >&5
16870 echo $ECHO_N "checking if you want to perform memory-leak testing... $ECHO_C" >&6
16871
16872 # Check whether --enable-leaks or --disable-leaks was given.
16873 if test "${enable_leaks+set}" = set; then
16874   enableval="$enable_leaks"
16875   if test "x$enableval" = xno; then with_no_leaks=yes; else with_no_leaks=no; fi
16876 else
16877   : ${with_no_leaks:=no}
16878 fi;
16879 echo "$as_me:16879: result: $with_no_leaks" >&5
16880 echo "${ECHO_T}$with_no_leaks" >&6
16881
16882 if test "$with_no_leaks" = yes ; then
16883
16884 cat >>confdefs.h <<\EOF
16885 #define NO_LEAKS 1
16886 EOF
16887
16888 cat >>confdefs.h <<\EOF
16889 #define YY_NO_LEAKS 1
16890 EOF
16891
16892 fi
16893
16894 LD_RPATH_OPT=
16895 echo "$as_me:16895: checking for an rpath option" >&5
16896 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
16897 case $cf_cv_system_name in
16898 (irix*)
16899         if test "$GCC" = yes; then
16900                 LD_RPATH_OPT="-Wl,-rpath,"
16901         else
16902                 LD_RPATH_OPT="-rpath "
16903         fi
16904         ;;
16905 (linux*|gnu*|k*bsd*-gnu)
16906         LD_RPATH_OPT="-Wl,-rpath,"
16907         ;;
16908 (openbsd[2-9].*|mirbsd*)
16909         LD_RPATH_OPT="-Wl,-rpath,"
16910         ;;
16911 (dragonfly*|freebsd*)
16912         LD_RPATH_OPT="-rpath "
16913         ;;
16914 (netbsd*)
16915         LD_RPATH_OPT="-Wl,-rpath,"
16916         ;;
16917 (osf*|mls+*)
16918         LD_RPATH_OPT="-rpath "
16919         ;;
16920 (solaris2*)
16921         LD_RPATH_OPT="-R"
16922         ;;
16923 (*)
16924         ;;
16925 esac
16926 echo "$as_me:16926: result: $LD_RPATH_OPT" >&5
16927 echo "${ECHO_T}$LD_RPATH_OPT" >&6
16928
16929 case "x$LD_RPATH_OPT" in
16930 (x-R*)
16931         echo "$as_me:16931: checking if we need a space after rpath option" >&5
16932 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
16933         cf_save_LIBS="$LIBS"
16934
16935 cf_add_libs="${LD_RPATH_OPT}$libdir"
16936 # Filter out duplicates - this happens with badly-designed ".pc" files...
16937 for cf_add_1lib in $LIBS
16938 do
16939         for cf_add_2lib in $cf_add_libs
16940         do
16941                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
16942                 then
16943                         cf_add_1lib=
16944                         break
16945                 fi
16946         done
16947         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
16948 done
16949 LIBS="$cf_add_libs"
16950
16951         cat >conftest.$ac_ext <<_ACEOF
16952 #line 16952 "configure"
16953 #include "confdefs.h"
16954
16955 int
16956 main ()
16957 {
16958
16959   ;
16960   return 0;
16961 }
16962 _ACEOF
16963 rm -f conftest.$ac_objext conftest$ac_exeext
16964 if { (eval echo "$as_me:16964: \"$ac_link\"") >&5
16965   (eval $ac_link) 2>&5
16966   ac_status=$?
16967   echo "$as_me:16967: \$? = $ac_status" >&5
16968   (exit $ac_status); } &&
16969          { ac_try='test -s conftest$ac_exeext'
16970   { (eval echo "$as_me:16970: \"$ac_try\"") >&5
16971   (eval $ac_try) 2>&5
16972   ac_status=$?
16973   echo "$as_me:16973: \$? = $ac_status" >&5
16974   (exit $ac_status); }; }; then
16975   cf_rpath_space=no
16976 else
16977   echo "$as_me: failed program was:" >&5
16978 cat conftest.$ac_ext >&5
16979 cf_rpath_space=yes
16980 fi
16981 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16982         LIBS="$cf_save_LIBS"
16983         echo "$as_me:16983: result: $cf_rpath_space" >&5
16984 echo "${ECHO_T}$cf_rpath_space" >&6
16985         test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
16986         ;;
16987 esac
16988
16989 echo "$as_me:16989: checking if rpath-hack should be disabled" >&5
16990 echo $ECHO_N "checking if rpath-hack should be disabled... $ECHO_C" >&6
16991
16992 # Check whether --enable-rpath-hack or --disable-rpath-hack was given.
16993 if test "${enable_rpath_hack+set}" = set; then
16994   enableval="$enable_rpath_hack"
16995   test "$enableval" != no && enableval=yes
16996   if test "$enableval" != "yes" ; then
16997     cf_disable_rpath_hack=yes
16998   else
16999     cf_disable_rpath_hack=no
17000   fi
17001 else
17002   enableval=yes
17003   cf_disable_rpath_hack=no
17004
17005 fi;
17006 echo "$as_me:17006: result: $cf_disable_rpath_hack" >&5
17007 echo "${ECHO_T}$cf_disable_rpath_hack" >&6
17008 if test "$cf_disable_rpath_hack" = no ; then
17009
17010 echo "$as_me:17010: checking for updated LDFLAGS" >&5
17011 echo $ECHO_N "checking for updated LDFLAGS... $ECHO_C" >&6
17012 if test -n "$LD_RPATH_OPT" ; then
17013         echo "$as_me:17013: result: maybe" >&5
17014 echo "${ECHO_T}maybe" >&6
17015
17016         for ac_prog in ldd
17017 do
17018   # Extract the first word of "$ac_prog", so it can be a program name with args.
17019 set dummy $ac_prog; ac_word=$2
17020 echo "$as_me:17020: checking for $ac_word" >&5
17021 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
17022 if test "${ac_cv_prog_cf_ldd_prog+set}" = set; then
17023   echo $ECHO_N "(cached) $ECHO_C" >&6
17024 else
17025   if test -n "$cf_ldd_prog"; then
17026   ac_cv_prog_cf_ldd_prog="$cf_ldd_prog" # Let the user override the test.
17027 else
17028   ac_save_IFS=$IFS; IFS=$ac_path_separator
17029 ac_dummy="$PATH"
17030 for ac_dir in $ac_dummy; do
17031   IFS=$ac_save_IFS
17032   test -z "$ac_dir" && ac_dir=.
17033   $as_executable_p "$ac_dir/$ac_word" || continue
17034 ac_cv_prog_cf_ldd_prog="$ac_prog"
17035 echo "$as_me:17035: found $ac_dir/$ac_word" >&5
17036 break
17037 done
17038
17039 fi
17040 fi
17041 cf_ldd_prog=$ac_cv_prog_cf_ldd_prog
17042 if test -n "$cf_ldd_prog"; then
17043   echo "$as_me:17043: result: $cf_ldd_prog" >&5
17044 echo "${ECHO_T}$cf_ldd_prog" >&6
17045 else
17046   echo "$as_me:17046: result: no" >&5
17047 echo "${ECHO_T}no" >&6
17048 fi
17049
17050   test -n "$cf_ldd_prog" && break
17051 done
17052 test -n "$cf_ldd_prog" || cf_ldd_prog="no"
17053
17054         cf_rpath_list="/usr/lib /lib"
17055         if test "$cf_ldd_prog" != no
17056         then
17057                 cf_rpath_oops=
17058
17059 cat >conftest.$ac_ext <<_ACEOF
17060 #line 17060 "configure"
17061 #include "confdefs.h"
17062 #include <stdio.h>
17063 int
17064 main ()
17065 {
17066 printf("Hello");
17067   ;
17068   return 0;
17069 }
17070 _ACEOF
17071 rm -f conftest.$ac_objext conftest$ac_exeext
17072 if { (eval echo "$as_me:17072: \"$ac_link\"") >&5
17073   (eval $ac_link) 2>&5
17074   ac_status=$?
17075   echo "$as_me:17075: \$? = $ac_status" >&5
17076   (exit $ac_status); } &&
17077          { ac_try='test -s conftest$ac_exeext'
17078   { (eval echo "$as_me:17078: \"$ac_try\"") >&5
17079   (eval $ac_try) 2>&5
17080   ac_status=$?
17081   echo "$as_me:17081: \$? = $ac_status" >&5
17082   (exit $ac_status); }; }; then
17083   cf_rpath_oops=`$cf_ldd_prog conftest$ac_exeext | fgrep ' not found' | sed -e 's% =>.*$%%' |sort | uniq`
17084                  cf_rpath_list=`$cf_ldd_prog conftest$ac_exeext | fgrep / | sed -e 's%^.*[      ]/%/%' -e 's%/[^/][^/]*$%%' |sort | uniq`
17085 else
17086   echo "$as_me: failed program was:" >&5
17087 cat conftest.$ac_ext >&5
17088 fi
17089 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17090
17091                 # If we passed the link-test, but get a "not found" on a given library,
17092                 # this could be due to inept reconfiguration of gcc to make it only
17093                 # partly honor /usr/local/lib (or whatever).  Sometimes this behavior
17094                 # is intentional, e.g., installing gcc in /usr/bin and suppressing the
17095                 # /usr/local libraries.
17096                 if test -n "$cf_rpath_oops"
17097                 then
17098                         for cf_rpath_src in $cf_rpath_oops
17099                         do
17100                                 for cf_rpath_dir in \
17101                                         /usr/local \
17102                                         /usr/pkg \
17103                                         /opt/sfw
17104                                 do
17105                                         if test -f $cf_rpath_dir/lib/$cf_rpath_src
17106                                         then
17107                                                 test -n "$verbose" && echo "    ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src" 1>&6
17108
17109 echo "${as_me:-configure}:17109: testing ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src ..." 1>&5
17110
17111                                                 LDFLAGS="$LDFLAGS -L$cf_rpath_dir/lib"
17112                                                 break
17113                                         fi
17114                                 done
17115                         done
17116                 fi
17117         fi
17118
17119         test -n "$verbose" && echo "    ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
17120
17121 echo "${as_me:-configure}:17121: testing ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
17122
17123 test -n "$verbose" && echo "    ...checking LDFLAGS $LDFLAGS" 1>&6
17124
17125 echo "${as_me:-configure}:17125: testing ...checking LDFLAGS $LDFLAGS ..." 1>&5
17126
17127 cf_rpath_dst=
17128 for cf_rpath_src in $LDFLAGS
17129 do
17130         case $cf_rpath_src in
17131         (-L*)
17132
17133                 # check if this refers to a directory which we will ignore
17134                 cf_rpath_skip=no
17135                 if test -n "$cf_rpath_list"
17136                 then
17137                         for cf_rpath_item in $cf_rpath_list
17138                         do
17139                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
17140                                 then
17141                                         cf_rpath_skip=yes
17142                                         break
17143                                 fi
17144                         done
17145                 fi
17146
17147                 if test "$cf_rpath_skip" = no
17148                 then
17149                         # transform the option
17150                         if test "$LD_RPATH_OPT" = "-R " ; then
17151                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
17152                         else
17153                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
17154                         fi
17155
17156                         # if we have not already added this, add it now
17157                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
17158                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
17159                         then
17160                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
17161
17162 echo "${as_me:-configure}:17162: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
17163
17164                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
17165                         fi
17166                 fi
17167                 ;;
17168         esac
17169         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
17170 done
17171 LDFLAGS=$cf_rpath_dst
17172
17173 test -n "$verbose" && echo "    ...checked LDFLAGS $LDFLAGS" 1>&6
17174
17175 echo "${as_me:-configure}:17175: testing ...checked LDFLAGS $LDFLAGS ..." 1>&5
17176
17177 test -n "$verbose" && echo "    ...checking LIBS $LIBS" 1>&6
17178
17179 echo "${as_me:-configure}:17179: testing ...checking LIBS $LIBS ..." 1>&5
17180
17181 cf_rpath_dst=
17182 for cf_rpath_src in $LIBS
17183 do
17184         case $cf_rpath_src in
17185         (-L*)
17186
17187                 # check if this refers to a directory which we will ignore
17188                 cf_rpath_skip=no
17189                 if test -n "$cf_rpath_list"
17190                 then
17191                         for cf_rpath_item in $cf_rpath_list
17192                         do
17193                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
17194                                 then
17195                                         cf_rpath_skip=yes
17196                                         break
17197                                 fi
17198                         done
17199                 fi
17200
17201                 if test "$cf_rpath_skip" = no
17202                 then
17203                         # transform the option
17204                         if test "$LD_RPATH_OPT" = "-R " ; then
17205                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
17206                         else
17207                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
17208                         fi
17209
17210                         # if we have not already added this, add it now
17211                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
17212                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
17213                         then
17214                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
17215
17216 echo "${as_me:-configure}:17216: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
17217
17218                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
17219                         fi
17220                 fi
17221                 ;;
17222         esac
17223         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
17224 done
17225 LIBS=$cf_rpath_dst
17226
17227 test -n "$verbose" && echo "    ...checked LIBS $LIBS" 1>&6
17228
17229 echo "${as_me:-configure}:17229: testing ...checked LIBS $LIBS ..." 1>&5
17230
17231         test -n "$verbose" && echo "    ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
17232
17233 echo "${as_me:-configure}:17233: testing ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
17234
17235 else
17236         echo "$as_me:17236: result: no" >&5
17237 echo "${ECHO_T}no" >&6
17238 fi
17239
17240 fi
17241
17242 TEST_ARGS="$LIBS"
17243 LIBS=
17244
17245 ac_config_files="$ac_config_files Makefile"
17246 ac_config_commands="$ac_config_commands default"
17247 cat >confcache <<\_ACEOF
17248 # This file is a shell script that caches the results of configure
17249 # tests run on this system so they can be shared between configure
17250 # scripts and configure runs, see configure's option --config-cache.
17251 # It is not useful on other systems.  If it contains results you don't
17252 # want to keep, you may remove or edit it.
17253 #
17254 # config.status only pays attention to the cache file if you give it
17255 # the --recheck option to rerun configure.
17256 #
17257 # `ac_cv_env_foo' variables (set or unset) will be overriden when
17258 # loading this file, other *unset* `ac_cv_foo' will be assigned the
17259 # following values.
17260
17261 _ACEOF
17262
17263 # The following way of writing the cache mishandles newlines in values,
17264 # but we know of no workaround that is simple, portable, and efficient.
17265 # So, don't put newlines in cache variables' values.
17266 # Ultrix sh set writes to stderr and can't be redirected directly,
17267 # and sets the high bit in the cache file unless we assign to the vars.
17268 {
17269   (set) 2>&1 |
17270     case `(ac_space=' '; set | grep ac_space) 2>&1` in
17271     *ac_space=\ *)
17272       # `set' does not quote correctly, so add quotes (double-quote
17273       # substitution turns \\\\ into \\, and sed turns \\ into \).
17274       sed -n \
17275         "s/'/'\\\\''/g;
17276           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
17277       ;;
17278     *)
17279       # `set' quotes correctly as required by POSIX, so do not add quotes.
17280       sed -n \
17281         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
17282       ;;
17283     esac;
17284 } |
17285   sed '
17286      t clear
17287      : clear
17288      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
17289      t end
17290      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
17291      : end' >>confcache
17292 if cmp -s $cache_file confcache; then :; else
17293   if test -w $cache_file; then
17294     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
17295     cat confcache >$cache_file
17296   else
17297     echo "not updating unwritable cache $cache_file"
17298   fi
17299 fi
17300 rm -f confcache
17301
17302 test "x$prefix" = xNONE && prefix=$ac_default_prefix
17303 # Let make expand exec_prefix.
17304 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
17305
17306 # VPATH may cause trouble with some makes, so we remove $(srcdir),
17307 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
17308 # trailing colons and then remove the whole line if VPATH becomes empty
17309 # (actually we leave an empty line to preserve line numbers).
17310 if test "x$srcdir" = x.; then
17311   ac_vpsub='/^[         ]*VPATH[        ]*=/{
17312 s/:*\$(srcdir):*/:/;
17313 s/:*\${srcdir}:*/:/;
17314 s/:*@srcdir@:*/:/;
17315 s/^\([^=]*=[    ]*\):*/\1/;
17316 s/:*$//;
17317 s/^[^=]*=[      ]*$//;
17318 }'
17319 fi
17320
17321 DEFS=-DHAVE_CONFIG_H
17322
17323 : ${CONFIG_STATUS=./config.status}
17324 ac_clean_files_save=$ac_clean_files
17325 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
17326 { echo "$as_me:17326: creating $CONFIG_STATUS" >&5
17327 echo "$as_me: creating $CONFIG_STATUS" >&6;}
17328 cat >$CONFIG_STATUS <<_ACEOF
17329 #! $SHELL
17330 # Generated automatically by configure.
17331 # Run this file to recreate the current configuration.
17332 # Compiler output produced by configure, useful for debugging
17333 # configure, is in config.log if it exists.
17334
17335 debug=false
17336 SHELL=\${CONFIG_SHELL-$SHELL}
17337 ac_cs_invocation="\$0 \$@"
17338
17339 _ACEOF
17340
17341 cat >>$CONFIG_STATUS <<\_ACEOF
17342 # Be Bourne compatible
17343 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
17344   emulate sh
17345   NULLCMD=:
17346 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
17347   set -o posix
17348 fi
17349
17350 # Name of the executable.
17351 as_me=`echo "$0" |sed 's,.*[\\/],,'`
17352
17353 if expr a : '\(a\)' >/dev/null 2>&1; then
17354   as_expr=expr
17355 else
17356   as_expr=false
17357 fi
17358
17359 rm -f conf$$ conf$$.exe conf$$.file
17360 echo >conf$$.file
17361 if ln -s conf$$.file conf$$ 2>/dev/null; then
17362   # We could just check for DJGPP; but this test a) works b) is more generic
17363   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
17364   if test -f conf$$.exe; then
17365     # Don't use ln at all; we don't have any links
17366     as_ln_s='cp -p'
17367   else
17368     as_ln_s='ln -s'
17369   fi
17370 elif ln conf$$.file conf$$ 2>/dev/null; then
17371   as_ln_s=ln
17372 else
17373   as_ln_s='cp -p'
17374 fi
17375 rm -f conf$$ conf$$.exe conf$$.file
17376
17377 as_executable_p="test -f"
17378
17379 # Support unset when possible.
17380 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
17381   as_unset=unset
17382 else
17383   as_unset=false
17384 fi
17385
17386 # NLS nuisances.
17387 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
17388 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
17389 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
17390 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
17391 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
17392 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
17393 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
17394 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
17395
17396 # IFS
17397 # We need space, tab and new line, in precisely that order.
17398 as_nl='
17399 '
17400 IFS="   $as_nl"
17401
17402 # CDPATH.
17403 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
17404
17405 exec 6>&1
17406
17407 _ACEOF
17408
17409 # Files that config.status was made for.
17410 if test -n "$ac_config_files"; then
17411   echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
17412 fi
17413
17414 if test -n "$ac_config_headers"; then
17415   echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
17416 fi
17417
17418 if test -n "$ac_config_links"; then
17419   echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
17420 fi
17421
17422 if test -n "$ac_config_commands"; then
17423   echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
17424 fi
17425
17426 cat >>$CONFIG_STATUS <<\EOF
17427
17428 ac_cs_usage="\
17429 \`$as_me' instantiates files from templates according to the
17430 current configuration.
17431
17432 Usage: $0 [OPTIONS] [FILE]...
17433
17434   -h, --help       print this help, then exit
17435   -V, --version    print version number, then exit
17436   -d, --debug      don't remove temporary files
17437       --recheck    update $as_me by reconfiguring in the same conditions
17438   --file=FILE[:TEMPLATE]
17439                    instantiate the configuration file FILE
17440   --header=FILE[:TEMPLATE]
17441                    instantiate the configuration header FILE
17442
17443 Configuration files:
17444 $config_files
17445
17446 Configuration headers:
17447 $config_headers
17448
17449 Configuration commands:
17450 $config_commands
17451
17452 Report bugs to <dickey@invisible-island.net>."
17453 EOF
17454
17455 cat >>$CONFIG_STATUS <<EOF
17456 ac_cs_version="\\
17457 config.status
17458 configured by $0, generated by GNU Autoconf 2.52.20141204,
17459   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
17460
17461 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
17462 Free Software Foundation, Inc.
17463 This config.status script is free software; the Free Software Foundation
17464 gives unlimited permission to copy, distribute and modify it."
17465 srcdir=$srcdir
17466 INSTALL="$INSTALL"
17467 EOF
17468
17469 cat >>$CONFIG_STATUS <<\EOF
17470 # If no file are specified by the user, then we need to provide default
17471 # value.  By we need to know if files were specified by the user.
17472 ac_need_defaults=:
17473 while test $# != 0
17474 do
17475   case $1 in
17476   --*=*)
17477     ac_option=`expr "x$1" : 'x\([^=]*\)='`
17478     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
17479     shift
17480     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
17481     shift
17482     ;;
17483   -*);;
17484   *) # This is not an option, so the user has probably given explicit
17485      # arguments.
17486      ac_need_defaults=false;;
17487   esac
17488
17489   case $1 in
17490   # Handling of the options.
17491 EOF
17492 cat >>$CONFIG_STATUS <<EOF
17493   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
17494     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
17495     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
17496 EOF
17497 cat >>$CONFIG_STATUS <<\EOF
17498   --version | --vers* | -V )
17499     echo "$ac_cs_version"; exit 0 ;;
17500   --he | --h)
17501     # Conflict between --help and --header
17502     { { echo "$as_me:17502: error: ambiguous option: $1
17503 Try \`$0 --help' for more information." >&5
17504 echo "$as_me: error: ambiguous option: $1
17505 Try \`$0 --help' for more information." >&2;}
17506    { (exit 1); exit 1; }; };;
17507   --help | --hel | -h )
17508     echo "$ac_cs_usage"; exit 0 ;;
17509   --debug | --d* | -d )
17510     debug=: ;;
17511   --file | --fil | --fi | --f )
17512     shift
17513     CONFIG_FILES="$CONFIG_FILES $1"
17514     ac_need_defaults=false;;
17515   --header | --heade | --head | --hea )
17516     shift
17517     CONFIG_HEADERS="$CONFIG_HEADERS $1"
17518     ac_need_defaults=false;;
17519
17520   # This is an error.
17521   -*) { { echo "$as_me:17521: error: unrecognized option: $1
17522 Try \`$0 --help' for more information." >&5
17523 echo "$as_me: error: unrecognized option: $1
17524 Try \`$0 --help' for more information." >&2;}
17525    { (exit 1); exit 1; }; } ;;
17526
17527   *) ac_config_targets="$ac_config_targets $1" ;;
17528
17529   esac
17530   shift
17531 done
17532
17533 exec 5>>config.log
17534 cat >&5 << _ACEOF
17535
17536 ## ----------------------- ##
17537 ## Running config.status.  ##
17538 ## ----------------------- ##
17539
17540 This file was extended by $as_me 2.52.20141204, executed with
17541   CONFIG_FILES    = $CONFIG_FILES
17542   CONFIG_HEADERS  = $CONFIG_HEADERS
17543   CONFIG_LINKS    = $CONFIG_LINKS
17544   CONFIG_COMMANDS = $CONFIG_COMMANDS
17545   > $ac_cs_invocation
17546 on `(hostname || uname -n) 2>/dev/null | sed 1q`
17547
17548 _ACEOF
17549 EOF
17550
17551 cat >>$CONFIG_STATUS <<EOF
17552 #
17553 # INIT-COMMANDS section.
17554 #
17555
17556 AWK="$AWK"
17557 ECHO_CC="$ECHO_CC"
17558 ECHO_LD="$ECHO_LD"
17559 SHOW_CC="$SHOW_LD"
17560
17561 EOF
17562
17563 cat >>$CONFIG_STATUS <<\EOF
17564 for ac_config_target in $ac_config_targets
17565 do
17566   case "$ac_config_target" in
17567   # Handling of arguments.
17568   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
17569   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
17570   "ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS ncurses_cfg.h:ncurses_tst.hin" ;;
17571   *) { { echo "$as_me:17571: error: invalid argument: $ac_config_target" >&5
17572 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
17573    { (exit 1); exit 1; }; };;
17574   esac
17575 done
17576
17577 # If the user did not use the arguments to specify the items to instantiate,
17578 # then the envvar interface is used.  Set only those that are not.
17579 # We use the long form for the default assignment because of an extremely
17580 # bizarre bug on SunOS 4.1.3.
17581 if $ac_need_defaults; then
17582   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
17583   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
17584   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
17585 fi
17586
17587 # Create a temporary directory, and hook for its removal unless debugging.
17588 $debug ||
17589 {
17590   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
17591   trap '{ (exit 1); exit 1; }' 1 2 13 15
17592 }
17593
17594 # Create a (secure) tmp directory for tmp files.
17595 : ${TMPDIR=/tmp}
17596 {
17597   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
17598   test -n "$tmp" && test -d "$tmp"
17599 }  ||
17600 {
17601   tmp=$TMPDIR/cs$$-$RANDOM
17602   (umask 077 && mkdir $tmp)
17603 } ||
17604 {
17605    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
17606    { (exit 1); exit 1; }
17607 }
17608
17609 EOF
17610
17611 cat >>$CONFIG_STATUS <<EOF
17612
17613 #
17614 # CONFIG_FILES section.
17615 #
17616
17617 # No need to generate the scripts if there are no CONFIG_FILES.
17618 # This happens for instance when ./config.status config.h
17619 if test -n "\$CONFIG_FILES"; then
17620   # Protect against being on the right side of a sed subst in config.status.
17621   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
17622    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
17623 s,@SHELL@,$SHELL,;t t
17624 s,@exec_prefix@,$exec_prefix,;t t
17625 s,@prefix@,$prefix,;t t
17626 s,@program_transform_name@,$program_transform_name,;t t
17627 s,@bindir@,$bindir,;t t
17628 s,@sbindir@,$sbindir,;t t
17629 s,@libexecdir@,$libexecdir,;t t
17630 s,@datarootdir@,$datarootdir,;t t
17631 s,@datadir@,$datadir,;t t
17632 s,@sysconfdir@,$sysconfdir,;t t
17633 s,@sharedstatedir@,$sharedstatedir,;t t
17634 s,@localstatedir@,$localstatedir,;t t
17635 s,@libdir@,$libdir,;t t
17636 s,@includedir@,$includedir,;t t
17637 s,@oldincludedir@,$oldincludedir,;t t
17638 s,@infodir@,$infodir,;t t
17639 s,@mandir@,$mandir,;t t
17640 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
17641 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
17642 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
17643 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
17644 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
17645 s,@build_alias@,$build_alias,;t t
17646 s,@host_alias@,$host_alias,;t t
17647 s,@target_alias@,$target_alias,;t t
17648 s,@ECHO_C@,$ECHO_C,;t t
17649 s,@ECHO_N@,$ECHO_N,;t t
17650 s,@ECHO_T@,$ECHO_T,;t t
17651 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
17652 s,@DEFS@,$DEFS,;t t
17653 s,@LIBS@,$LIBS,;t t
17654 s,@build@,$build,;t t
17655 s,@build_cpu@,$build_cpu,;t t
17656 s,@build_vendor@,$build_vendor,;t t
17657 s,@build_os@,$build_os,;t t
17658 s,@host@,$host,;t t
17659 s,@host_cpu@,$host_cpu,;t t
17660 s,@host_vendor@,$host_vendor,;t t
17661 s,@host_os@,$host_os,;t t
17662 s,@SET_MAKE@,$SET_MAKE,;t t
17663 s,@CC@,$CC,;t t
17664 s,@CFLAGS@,$CFLAGS,;t t
17665 s,@LDFLAGS@,$LDFLAGS,;t t
17666 s,@CPPFLAGS@,$CPPFLAGS,;t t
17667 s,@ac_ct_CC@,$ac_ct_CC,;t t
17668 s,@EXEEXT@,$EXEEXT,;t t
17669 s,@OBJEXT@,$OBJEXT,;t t
17670 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
17671 s,@CPP@,$CPP,;t t
17672 s,@AWK@,$AWK,;t t
17673 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
17674 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
17675 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
17676 s,@LINT@,$LINT,;t t
17677 s,@LINT_OPTS@,$LINT_OPTS,;t t
17678 s,@CTAGS@,$CTAGS,;t t
17679 s,@ETAGS@,$ETAGS,;t t
17680 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
17681 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
17682 s,@MATH_LIB@,$MATH_LIB,;t t
17683 s,@top_builddir@,$top_builddir,;t t
17684 s,@CC_G_OPT@,$CC_G_OPT,;t t
17685 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
17686 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
17687 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
17688 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
17689 s,@LD@,$LD,;t t
17690 s,@LDFLAGS_SHARED@,$LDFLAGS_SHARED,;t t
17691 s,@LDFLAGS_STATIC@,$LDFLAGS_STATIC,;t t
17692 s,@LD_MODEL@,$LD_MODEL,;t t
17693 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
17694 s,@LIBTOOL@,$LIBTOOL,;t t
17695 s,@LIBTOOL_OPTS@,$LIBTOOL_OPTS,;t t
17696 s,@LIB_CLEAN@,$LIB_CLEAN,;t t
17697 s,@LIB_COMPILE@,$LIB_COMPILE,;t t
17698 s,@LIB_LINK@,$LIB_LINK,;t t
17699 s,@LINK_TESTS@,$LINK_TESTS,;t t
17700 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
17701 s,@PACKAGE@,$PACKAGE,;t t
17702 s,@PTHREAD@,$PTHREAD,;t t
17703 s,@TEST_ARGS@,$TEST_ARGS,;t t
17704 s,@TEST_DEPS@,$TEST_DEPS,;t t
17705 s,@TEST_LIBS@,$TEST_LIBS,;t t
17706 s,@TINFO_LDFLAGS@,$TINFO_LDFLAGS,;t t
17707 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
17708 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
17709 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
17710 s,@includesubdir@,$includesubdir,;t t
17711 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
17712 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
17713 s,@ECHO_LT@,$ECHO_LT,;t t
17714 s,@ECHO_LD@,$ECHO_LD,;t t
17715 s,@RULE_CC@,$RULE_CC,;t t
17716 s,@SHOW_CC@,$SHOW_CC,;t t
17717 s,@ECHO_CC@,$ECHO_CC,;t t
17718 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
17719 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
17720 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
17721 s,@X_CFLAGS@,$X_CFLAGS,;t t
17722 s,@X_PRE_LIBS@,$X_PRE_LIBS,;t t
17723 s,@X_LIBS@,$X_LIBS,;t t
17724 s,@X_EXTRA_LIBS@,$X_EXTRA_LIBS,;t t
17725 s,@XCURSES_CONFIG@,$XCURSES_CONFIG,;t t
17726 s,@ac_ct_XCURSES_CONFIG@,$ac_ct_XCURSES_CONFIG,;t t
17727 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
17728 s,@cf_ldd_prog@,$cf_ldd_prog,;t t
17729 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
17730 CEOF
17731
17732 EOF
17733
17734   cat >>$CONFIG_STATUS <<\EOF
17735   # Split the substitutions into bite-sized pieces for seds with
17736   # small command number limits, like on Digital OSF/1 and HP-UX.
17737   ac_max_sed_lines=48
17738   ac_sed_frag=1 # Number of current file.
17739   ac_beg=1 # First line for current file.
17740   ac_end=$ac_max_sed_lines # Line after last line for current file.
17741   ac_more_lines=:
17742   ac_sed_cmds=
17743   while $ac_more_lines; do
17744     if test $ac_beg -gt 1; then
17745       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
17746     else
17747       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
17748     fi
17749     if test ! -s $tmp/subs.frag; then
17750       ac_more_lines=false
17751     else
17752       # The purpose of the label and of the branching condition is to
17753       # speed up the sed processing (if there are no `@' at all, there
17754       # is no need to browse any of the substitutions).
17755       # These are the two extra sed commands mentioned above.
17756       (echo ':t
17757   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
17758       if test -z "$ac_sed_cmds"; then
17759         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
17760       else
17761         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
17762       fi
17763       ac_sed_frag=`expr $ac_sed_frag + 1`
17764       ac_beg=$ac_end
17765       ac_end=`expr $ac_end + $ac_max_sed_lines`
17766     fi
17767   done
17768   if test -z "$ac_sed_cmds"; then
17769     ac_sed_cmds=cat
17770   fi
17771 fi # test -n "$CONFIG_FILES"
17772
17773 EOF
17774 cat >>$CONFIG_STATUS <<\EOF
17775 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
17776   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
17777   case $ac_file in
17778   - | *:- | *:-:* ) # input from stdin
17779         cat >$tmp/stdin
17780         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
17781         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
17782   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
17783         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
17784   * )   ac_file_in=$ac_file.in ;;
17785   esac
17786
17787   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
17788   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
17789          X"$ac_file" : 'X\(//\)[^/]' \| \
17790          X"$ac_file" : 'X\(//\)$' \| \
17791          X"$ac_file" : 'X\(/\)' \| \
17792          .     : '\(.\)' 2>/dev/null ||
17793 echo X"$ac_file" |
17794     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
17795           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
17796           /^X\(\/\/\)$/{ s//\1/; q; }
17797           /^X\(\/\).*/{ s//\1/; q; }
17798           s/.*/./; q'`
17799   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
17800     { case "$ac_dir" in
17801   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
17802   *)                      as_incr_dir=.;;
17803 esac
17804 as_dummy="$ac_dir"
17805 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
17806   case $as_mkdir_dir in
17807     # Skip DOS drivespec
17808     ?:) as_incr_dir=$as_mkdir_dir ;;
17809     *)
17810       as_incr_dir=$as_incr_dir/$as_mkdir_dir
17811       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
17812     ;;
17813   esac
17814 done; }
17815
17816     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
17817     # A "../" for each directory in $ac_dir_suffix.
17818     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
17819   else
17820     ac_dir_suffix= ac_dots=
17821   fi
17822
17823   case $srcdir in
17824   .)  ac_srcdir=.
17825       if test -z "$ac_dots"; then
17826          ac_top_srcdir=.
17827       else
17828          ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'`
17829       fi ;;
17830   [\\/]* | ?:[\\/]* )
17831       ac_srcdir=$srcdir$ac_dir_suffix;
17832       ac_top_srcdir=$srcdir ;;
17833   *) # Relative path.
17834     ac_srcdir=$ac_dots$srcdir$ac_dir_suffix
17835     ac_top_srcdir=$ac_dots$srcdir ;;
17836   esac
17837
17838   case $INSTALL in
17839   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
17840   *) ac_INSTALL=$ac_dots$INSTALL ;;
17841   esac
17842
17843   if test x"$ac_file" != x-; then
17844     { echo "$as_me:17844: creating $ac_file" >&5
17845 echo "$as_me: creating $ac_file" >&6;}
17846     rm -f "$ac_file"
17847   fi
17848   # Let's still pretend it is `configure' which instantiates (i.e., don't
17849   # use $as_me), people would be surprised to read:
17850   #    /* config.h.  Generated automatically by config.status.  */
17851   configure_input="Generated automatically from `echo $ac_file_in |
17852                                                  sed 's,.*/,,'` by configure."
17853
17854   # First look for the input files in the build tree, otherwise in the
17855   # src tree.
17856   ac_file_inputs=`IFS=:
17857     for f in $ac_file_in; do
17858       case $f in
17859       -) echo $tmp/stdin ;;
17860       [\\/$]*)
17861          # Absolute (can't be DOS-style, as IFS=:)
17862          test -f "$f" || { { echo "$as_me:17862: error: cannot find input file: $f" >&5
17863 echo "$as_me: error: cannot find input file: $f" >&2;}
17864    { (exit 1); exit 1; }; }
17865          echo $f;;
17866       *) # Relative
17867          if test -f "$f"; then
17868            # Build tree
17869            echo $f
17870          elif test -f "$srcdir/$f"; then
17871            # Source tree
17872            echo $srcdir/$f
17873          else
17874            # /dev/null tree
17875            { { echo "$as_me:17875: error: cannot find input file: $f" >&5
17876 echo "$as_me: error: cannot find input file: $f" >&2;}
17877    { (exit 1); exit 1; }; }
17878          fi;;
17879       esac
17880     done` || { (exit 1); exit 1; }
17881 EOF
17882 cat >>$CONFIG_STATUS <<\EOF
17883   ac_warn_datarootdir=no
17884   if test x"$ac_file" != x-; then
17885     for ac_item in $ac_file_inputs
17886     do
17887       ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' $ac_item`
17888       if test -n "$ac_seen"; then
17889         ac_used=`grep '@datarootdir@' $ac_item`
17890         if test -z "$ac_used"; then
17891           { echo "$as_me:17891: WARNING: datarootdir was used implicitly but not set:
17892 $ac_seen" >&5
17893 echo "$as_me: WARNING: datarootdir was used implicitly but not set:
17894 $ac_seen" >&2;}
17895           ac_warn_datarootdir=yes
17896         fi
17897       fi
17898       ac_seen=`grep '${datarootdir}' $ac_item`
17899       if test -n "$ac_seen"; then
17900         { echo "$as_me:17900: WARNING: datarootdir was used explicitly but not set:
17901 $ac_seen" >&5
17902 echo "$as_me: WARNING: datarootdir was used explicitly but not set:
17903 $ac_seen" >&2;}
17904         ac_warn_datarootdir=yes
17905       fi
17906     done
17907   fi
17908
17909 if test "x$ac_warn_datarootdir" = xyes; then
17910   ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
17911 fi
17912
17913 EOF
17914 cat >>$CONFIG_STATUS <<EOF
17915   sed "$ac_vpsub
17916 $extrasub
17917 EOF
17918 cat >>$CONFIG_STATUS <<\EOF
17919 :t
17920 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
17921 s,@configure_input@,$configure_input,;t t
17922 s,@srcdir@,$ac_srcdir,;t t
17923 s,@top_srcdir@,$ac_top_srcdir,;t t
17924 s,@INSTALL@,$ac_INSTALL,;t t
17925 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
17926   rm -f $tmp/stdin
17927   if test x"$ac_file" != x-; then
17928     cp $tmp/out $ac_file
17929
17930     for ac_name in prefix exec_prefix datarootdir
17931     do
17932         ac_seen=`fgrep -n '${'$ac_name'[:=].*}' $ac_file`
17933         if test -n "$ac_seen"; then
17934             ac_init=`egrep '[   ]*'$ac_name'[   ]*=' $ac_file`
17935             if test -z "$ac_init"; then
17936               ac_seen=`echo "$ac_seen" |sed -e 's,^,'$ac_file':,'`
17937               { echo "$as_me:17937: WARNING: Variable $ac_name is used but was not set:
17938 $ac_seen" >&5
17939 echo "$as_me: WARNING: Variable $ac_name is used but was not set:
17940 $ac_seen" >&2;}
17941             fi
17942         fi
17943     done
17944     egrep -n '@[a-z_][a-z_0-9]+@' $ac_file >$tmp/out
17945     egrep -n '@[A-Z_][A-Z_0-9]+@' $ac_file >>$tmp/out
17946     if test -s $tmp/out; then
17947       ac_seen=`sed -e 's,^,'$ac_file':,' < $tmp/out`
17948       { echo "$as_me:17948: WARNING: Some variables may not be substituted:
17949 $ac_seen" >&5
17950 echo "$as_me: WARNING: Some variables may not be substituted:
17951 $ac_seen" >&2;}
17952     fi
17953   else
17954     cat $tmp/out
17955   fi
17956   rm -f $tmp/out
17957
17958 done
17959 EOF
17960 cat >>$CONFIG_STATUS <<\EOF
17961
17962 #
17963 # CONFIG_HEADER section.
17964 #
17965
17966 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
17967 # NAME is the cpp macro being defined and VALUE is the value it is being given.
17968 #
17969 # ac_d sets the value in "#define NAME VALUE" lines.
17970 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
17971 ac_dB='[        ].*$,\1#\2'
17972 ac_dC=' '
17973 ac_dD=',;t'
17974 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
17975 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
17976 ac_iB='\([      ]\),\1#\2define\3'
17977 ac_iC=' '
17978 ac_iD='\4,;t'
17979 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
17980 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
17981 ac_uB='$,\1#\2define\3'
17982 ac_uC=' '
17983 ac_uD=',;t'
17984
17985 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
17986   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
17987   case $ac_file in
17988   - | *:- | *:-:* ) # input from stdin
17989         cat >$tmp/stdin
17990         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
17991         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
17992   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
17993         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
17994   * )   ac_file_in=$ac_file.in ;;
17995   esac
17996
17997   test x"$ac_file" != x- && { echo "$as_me:17997: creating $ac_file" >&5
17998 echo "$as_me: creating $ac_file" >&6;}
17999
18000   # First look for the input files in the build tree, otherwise in the
18001   # src tree.
18002   ac_file_inputs=`IFS=:
18003     for f in $ac_file_in; do
18004       case $f in
18005       -) echo $tmp/stdin ;;
18006       [\\/$]*)
18007          # Absolute (can't be DOS-style, as IFS=:)
18008          test -f "$f" || { { echo "$as_me:18008: error: cannot find input file: $f" >&5
18009 echo "$as_me: error: cannot find input file: $f" >&2;}
18010    { (exit 1); exit 1; }; }
18011          echo $f;;
18012       *) # Relative
18013          if test -f "$f"; then
18014            # Build tree
18015            echo $f
18016          elif test -f "$srcdir/$f"; then
18017            # Source tree
18018            echo $srcdir/$f
18019          else
18020            # /dev/null tree
18021            { { echo "$as_me:18021: error: cannot find input file: $f" >&5
18022 echo "$as_me: error: cannot find input file: $f" >&2;}
18023    { (exit 1); exit 1; }; }
18024          fi;;
18025       esac
18026     done` || { (exit 1); exit 1; }
18027   # Remove the trailing spaces.
18028   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
18029
18030 EOF
18031
18032 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
18033 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
18034 # be either 'cat' or 'sort'.
18035 cat confdefs.h | uniq >conftest.vals
18036
18037 # Break up conftest.vals because some shells have a limit on
18038 # the size of here documents, and old seds have small limits too.
18039
18040 rm -f conftest.tail
18041 echo '  rm -f conftest.frag' >> $CONFIG_STATUS
18042 while grep . conftest.vals >/dev/null
18043 do
18044   # Write chunks of a limited-size here document to conftest.frag.
18045   echo '  cat >> conftest.frag <<CEOF' >> $CONFIG_STATUS
18046   sed ${ac_max_here_lines}q conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> $CONFIG_STATUS
18047   echo 'CEOF' >> $CONFIG_STATUS
18048   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
18049   rm -f conftest.vals
18050   mv conftest.tail conftest.vals
18051 done
18052 rm -f conftest.vals
18053
18054 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
18055 # marker @DEFS@.
18056 echo '  cat >> conftest.edit <<CEOF
18057 /@DEFS@/r conftest.frag
18058 /@DEFS@/d
18059 CEOF
18060 sed -f conftest.edit $tmp/in > $tmp/out
18061 rm -f $tmp/in
18062 mv $tmp/out $tmp/in
18063 rm -f conftest.edit conftest.frag
18064 ' >> $CONFIG_STATUS
18065
18066 cat >>$CONFIG_STATUS <<\EOF
18067   # Let's still pretend it is `configure' which instantiates (i.e., don't
18068   # use $as_me), people would be surprised to read:
18069   #    /* config.h.  Generated automatically by config.status.  */
18070   if test x"$ac_file" = x-; then
18071     echo "/* Generated automatically by configure.  */" >$tmp/config.h
18072   else
18073     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
18074   fi
18075   cat $tmp/in >>$tmp/config.h
18076   rm -f $tmp/in
18077   if test x"$ac_file" != x-; then
18078     if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
18079       { echo "$as_me:18079: $ac_file is unchanged" >&5
18080 echo "$as_me: $ac_file is unchanged" >&6;}
18081     else
18082       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
18083          X"$ac_file" : 'X\(//\)[^/]' \| \
18084          X"$ac_file" : 'X\(//\)$' \| \
18085          X"$ac_file" : 'X\(/\)' \| \
18086          .     : '\(.\)' 2>/dev/null ||
18087 echo X"$ac_file" |
18088     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
18089           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
18090           /^X\(\/\/\)$/{ s//\1/; q; }
18091           /^X\(\/\).*/{ s//\1/; q; }
18092           s/.*/./; q'`
18093       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
18094         { case "$ac_dir" in
18095   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
18096   *)                      as_incr_dir=.;;
18097 esac
18098 as_dummy="$ac_dir"
18099 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
18100   case $as_mkdir_dir in
18101     # Skip DOS drivespec
18102     ?:) as_incr_dir=$as_mkdir_dir ;;
18103     *)
18104       as_incr_dir=$as_incr_dir/$as_mkdir_dir
18105       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
18106     ;;
18107   esac
18108 done; }
18109
18110       fi
18111       rm -f $ac_file
18112       mv $tmp/config.h $ac_file
18113     fi
18114   else
18115     cat $tmp/config.h
18116     rm -f $tmp/config.h
18117   fi
18118 done
18119 EOF
18120 cat >>$CONFIG_STATUS <<\EOF
18121 #
18122 # CONFIG_COMMANDS section.
18123 #
18124 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
18125   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
18126   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
18127
18128   case $ac_dest in
18129     default )
18130
18131 for cf_dir in .
18132 do
18133         if test ! -d $srcdir/$cf_dir; then
18134                 continue
18135         elif test -f $srcdir/$cf_dir/programs; then
18136                 $AWK -f $srcdir/mk-test.awk INSTALL=yes ECHO_LINK="$ECHO_LD" $srcdir/$cf_dir/programs >>$cf_dir/Makefile
18137         fi
18138 done
18139
18140         cat >>Makefile <<TEST_EOF
18141
18142 # These rules are generated so we do not rely on suffix rules, which do not
18143 # work consistently for different make-programs (the '\$(MODEL)/' confuses
18144 # some, and the '\$x' confuses others).
18145 TEST_EOF
18146
18147 LIST=`sed -e 's/[       ].*//' -e '/^[#@]/d' $srcdir/modules`
18148 for N in $LIST
18149 do
18150         cat >>Makefile <<TEST_EOF
18151
18152 \$(MODEL)/$N.o : \$(srcdir)/$N.c \\
18153         \$(srcdir)/test.priv.h \\
18154         ncurses_cfg.h
18155         $SHOW_CC
18156         $ECHO_CC\$(CC) -c \$(CFLAGS_DEFAULT) \$(srcdir)/$N.c
18157 TEST_EOF
18158 done
18159
18160 if test -f ../config.guess && test -f ../config.sub
18161 then
18162         cat >>Makefile <<TEST_EOF
18163
18164 # if we used CF_INHERIT for getting these files, we can remove them
18165 distclean::
18166         rm -f config.guess config.sub
18167 TEST_EOF
18168 fi
18169  ;;
18170   esac
18171 done
18172 EOF
18173
18174 cat >>$CONFIG_STATUS <<\EOF
18175
18176 { (exit 0); exit 0; }
18177 EOF
18178 chmod +x $CONFIG_STATUS
18179 ac_clean_files=$ac_clean_files_save
18180
18181 # configure is writing to config.log, and then calls config.status.
18182 # config.status does its own redirection, appending to config.log.
18183 # Unfortunately, on DOS this fails, as config.log is still kept open
18184 # by configure, so config.status won't be able to write to it; its
18185 # output is simply discarded.  So we exec the FD to /dev/null,
18186 # effectively closing config.log, so it can be properly (re)opened and
18187 # appended to by config.status.  When coming back to configure, we
18188 # need to make the FD available again.
18189 if test "$no_create" != yes; then
18190   ac_cs_success=:
18191   exec 5>/dev/null
18192   $SHELL $CONFIG_STATUS || ac_cs_success=false
18193   exec 5>>config.log
18194   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
18195   # would make configure fail if this is the last instruction.
18196   $ac_cs_success || { (exit 1); exit 1; }
18197 fi
18198