]> ncurses.scripts.mit.edu Git - ncurses.git/blob - test/configure
98acd5d2a648f5e509fd68c4b85d37d3d0060319
[ncurses.git] / test / configure
1 #! /bin/sh
2 # Guess values for system-dependent variables and create Makefiles.
3 # Generated by Autoconf 2.52.20150926.
4 #
5 # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
6 # Free Software Foundation, Inc.
7 # This configure script is free software; the Free Software Foundation
8 # gives unlimited permission to copy, distribute and modify it.
9
10 # Avoid depending upon Character Ranges.
11 as_cr_letters='abcdefghijklmnopqrstuvwxyz'
12 as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
13 as_cr_Letters=$as_cr_letters$as_cr_LETTERS
14 as_cr_digits='0123456789'
15 as_cr_alnum=$as_cr_Letters$as_cr_digits
16
17 # Sed expression to map a string onto a valid variable name.
18 as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
19
20 # Sed expression to map a string onto a valid CPP name.
21 as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
22
23 # Be Bourne compatible
24 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
25   emulate sh
26   NULLCMD=:
27 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
28   set -o posix
29 fi
30
31 # Name of the executable.
32 as_me=`echo "$0" |sed 's,.*[\\/],,'`
33
34 if expr a : '\(a\)' >/dev/null 2>&1; then
35   as_expr=expr
36 else
37   as_expr=false
38 fi
39
40 rm -f conf$$ conf$$.exe conf$$.file
41 echo >conf$$.file
42 if ln -s conf$$.file conf$$ 2>/dev/null; then
43   # We could just check for DJGPP; but this test a) works b) is more generic
44   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
45   if test -f conf$$.exe; then
46     # Don't use ln at all; we don't have any links
47     as_ln_s='cp -p'
48   else
49     as_ln_s='ln -s'
50   fi
51 elif ln conf$$.file conf$$ 2>/dev/null; then
52   as_ln_s=ln
53 else
54   as_ln_s='cp -p'
55 fi
56 rm -f conf$$ conf$$.exe conf$$.file
57
58 as_executable_p="test -f"
59
60 # Support unset when possible.
61 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
62   as_unset=unset
63 else
64   as_unset=false
65 fi
66
67 # NLS nuisances.
68 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
69 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
70 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
71 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
72 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
73 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
74 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
75 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
76
77 # IFS
78 # We need space, tab and new line, in precisely that order.
79 as_nl='
80 '
81 IFS="   $as_nl"
82
83 # CDPATH.
84 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
85
86 # Name of the host.
87 # hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
88 # so uname gets run too.
89 ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
90
91 exec 6>&1
92
93 #
94 # Initializations.
95 #
96 ac_default_prefix=/usr/local
97 cross_compiling=no
98 subdirs=
99 MFLAGS= MAKEFLAGS=
100 SHELL=${CONFIG_SHELL-/bin/sh}
101
102 # Maximum number of lines to put in a shell here document.
103 # This variable seems obsolete.  It should probably be removed, and
104 # only ac_max_sed_lines should be used.
105 : ${ac_max_here_lines=38}
106
107 ac_unique_file="ncurses.c"
108
109 # Initialize some variables set by options.
110 ac_init_help=
111 ac_init_version=false
112 # The variables have the same names as the options, with
113 # dashes changed to underlines.
114 cache_file=/dev/null
115 exec_prefix=NONE
116 no_create=
117 no_recursion=
118 prefix=NONE
119 program_prefix=NONE
120 program_suffix=NONE
121 program_transform_name=s,x,x,
122 silent=
123 site=
124 srcdir=
125 verbose=
126 x_includes=NONE
127 x_libraries=NONE
128
129 # Installation directory options.
130 # These are left unexpanded so users can "make install exec_prefix=/foo"
131 # and all the variables that are supposed to be based on exec_prefix
132 # by default will actually change.
133 # Use braces instead of parens because sh, perl, etc. also accept them.
134 bindir='${exec_prefix}/bin'
135 sbindir='${exec_prefix}/sbin'
136 libexecdir='${exec_prefix}/libexec'
137 datarootdir='${prefix}/share'
138 datadir='${datarootdir}'
139 sysconfdir='${prefix}/etc'
140 sharedstatedir='${prefix}/com'
141 localstatedir='${prefix}/var'
142 libdir='${exec_prefix}/lib'
143 includedir='${prefix}/include'
144 oldincludedir='/usr/include'
145 infodir='${datarootdir}/info'
146 mandir='${datarootdir}/man'
147
148 # Identity of this package.
149 PACKAGE_NAME=
150 PACKAGE_TARNAME=
151 PACKAGE_VERSION=
152 PACKAGE_STRING=
153 PACKAGE_BUGREPORT=
154
155 ac_prev=
156 for ac_option
157 do
158   # If the previous option needs an argument, assign it.
159   if test -n "$ac_prev"; then
160     eval "$ac_prev=\$ac_option"
161     ac_prev=
162     continue
163   fi
164
165   ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
166
167   # Accept the important Cygnus configure options, so we can diagnose typos.
168
169   case $ac_option in
170
171   -bindir | --bindir | --bindi | --bind | --bin | --bi)
172     ac_prev=bindir ;;
173   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
174     bindir=$ac_optarg ;;
175
176   -build | --build | --buil | --bui | --bu)
177     ac_prev=build_alias ;;
178   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
179     build_alias=$ac_optarg ;;
180
181   -cache-file | --cache-file | --cache-fil | --cache-fi \
182   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
183     ac_prev=cache_file ;;
184   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
185   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
186     cache_file=$ac_optarg ;;
187
188   --config-cache | -C)
189     cache_file=config.cache ;;
190
191   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
192     ac_prev=datadir ;;
193   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
194   | --da=*)
195     datadir=$ac_optarg ;;
196
197   -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
198   | --dataroo | --dataro | --datar)
199     ac_prev=datarootdir ;;
200   -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
201   | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
202     datarootdir=$ac_optarg ;;
203
204   -disable-* | --disable-*)
205     ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
206     # Reject names that are not valid shell variable names.
207     expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
208       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
209    { (exit 1); exit 1; }; }
210     ac_feature=`echo $ac_feature | sed 's/-/_/g'`
211     eval "enable_$ac_feature=no" ;;
212
213   -enable-* | --enable-*)
214     ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
215     # Reject names that are not valid shell variable names.
216     expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
217       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
218    { (exit 1); exit 1; }; }
219     ac_feature=`echo $ac_feature | sed 's/-/_/g'`
220     case $ac_option in
221       *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
222       *) ac_optarg=yes ;;
223     esac
224     eval "enable_$ac_feature='$ac_optarg'" ;;
225
226   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
227   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
228   | --exec | --exe | --ex)
229     ac_prev=exec_prefix ;;
230   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
231   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
232   | --exec=* | --exe=* | --ex=*)
233     exec_prefix=$ac_optarg ;;
234
235   -gas | --gas | --ga | --g)
236     # Obsolete; use --with-gas.
237     with_gas=yes ;;
238
239   -help | --help | --hel | --he | -h)
240     ac_init_help=long ;;
241   -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
242     ac_init_help=recursive ;;
243   -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
244     ac_init_help=short ;;
245
246   -host | --host | --hos | --ho)
247     ac_prev=host_alias ;;
248   -host=* | --host=* | --hos=* | --ho=*)
249     host_alias=$ac_optarg ;;
250
251   -includedir | --includedir | --includedi | --included | --include \
252   | --includ | --inclu | --incl | --inc)
253     ac_prev=includedir ;;
254   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
255   | --includ=* | --inclu=* | --incl=* | --inc=*)
256     includedir=$ac_optarg ;;
257
258   -infodir | --infodir | --infodi | --infod | --info | --inf)
259     ac_prev=infodir ;;
260   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
261     infodir=$ac_optarg ;;
262
263   -libdir | --libdir | --libdi | --libd)
264     ac_prev=libdir ;;
265   -libdir=* | --libdir=* | --libdi=* | --libd=*)
266     libdir=$ac_optarg ;;
267
268   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
269   | --libexe | --libex | --libe)
270     ac_prev=libexecdir ;;
271   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
272   | --libexe=* | --libex=* | --libe=*)
273     libexecdir=$ac_optarg ;;
274
275   -localstatedir | --localstatedir | --localstatedi | --localstated \
276   | --localstate | --localstat | --localsta | --localst \
277   | --locals | --local | --loca | --loc | --lo)
278     ac_prev=localstatedir ;;
279   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
280   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
281   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
282     localstatedir=$ac_optarg ;;
283
284   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
285     ac_prev=mandir ;;
286   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
287     mandir=$ac_optarg ;;
288
289   -nfp | --nfp | --nf)
290     # Obsolete; use --without-fp.
291     with_fp=no ;;
292
293   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
294   | --no-cr | --no-c)
295     no_create=yes ;;
296
297   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
298   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
299     no_recursion=yes ;;
300
301   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
302   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
303   | --oldin | --oldi | --old | --ol | --o)
304     ac_prev=oldincludedir ;;
305   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
306   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
307   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
308     oldincludedir=$ac_optarg ;;
309
310   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
311     ac_prev=prefix ;;
312   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
313     prefix=$ac_optarg ;;
314
315   -program-prefix | --program-prefix | --program-prefi | --program-pref \
316   | --program-pre | --program-pr | --program-p)
317     ac_prev=program_prefix ;;
318   -program-prefix=* | --program-prefix=* | --program-prefi=* \
319   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
320     program_prefix=$ac_optarg ;;
321
322   -program-suffix | --program-suffix | --program-suffi | --program-suff \
323   | --program-suf | --program-su | --program-s)
324     ac_prev=program_suffix ;;
325   -program-suffix=* | --program-suffix=* | --program-suffi=* \
326   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
327     program_suffix=$ac_optarg ;;
328
329   -program-transform-name | --program-transform-name \
330   | --program-transform-nam | --program-transform-na \
331   | --program-transform-n | --program-transform- \
332   | --program-transform | --program-transfor \
333   | --program-transfo | --program-transf \
334   | --program-trans | --program-tran \
335   | --progr-tra | --program-tr | --program-t)
336     ac_prev=program_transform_name ;;
337   -program-transform-name=* | --program-transform-name=* \
338   | --program-transform-nam=* | --program-transform-na=* \
339   | --program-transform-n=* | --program-transform-=* \
340   | --program-transform=* | --program-transfor=* \
341   | --program-transfo=* | --program-transf=* \
342   | --program-trans=* | --program-tran=* \
343   | --progr-tra=* | --program-tr=* | --program-t=*)
344     program_transform_name=$ac_optarg ;;
345
346   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
347   | -silent | --silent | --silen | --sile | --sil)
348     silent=yes ;;
349
350   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
351     ac_prev=sbindir ;;
352   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
353   | --sbi=* | --sb=*)
354     sbindir=$ac_optarg ;;
355
356   -sharedstatedir | --sharedstatedir | --sharedstatedi \
357   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
358   | --sharedst | --shareds | --shared | --share | --shar \
359   | --sha | --sh)
360     ac_prev=sharedstatedir ;;
361   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
362   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
363   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
364   | --sha=* | --sh=*)
365     sharedstatedir=$ac_optarg ;;
366
367   -site | --site | --sit)
368     ac_prev=site ;;
369   -site=* | --site=* | --sit=*)
370     site=$ac_optarg ;;
371
372   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
373     ac_prev=srcdir ;;
374   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
375     srcdir=$ac_optarg ;;
376
377   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
378   | --syscon | --sysco | --sysc | --sys | --sy)
379     ac_prev=sysconfdir ;;
380   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
381   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
382     sysconfdir=$ac_optarg ;;
383
384   -target | --target | --targe | --targ | --tar | --ta | --t)
385     ac_prev=target_alias ;;
386   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
387     target_alias=$ac_optarg ;;
388
389   -v | -verbose | --verbose | --verbos | --verbo | --verb)
390     verbose=yes ;;
391
392   -version | --version | --versio | --versi | --vers | -V)
393     ac_init_version=: ;;
394
395   -with-* | --with-*)
396     ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
397     # Reject names that are not valid shell variable names.
398     expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
399       { echo "$as_me: error: invalid package name: $ac_package" >&2
400    { (exit 1); exit 1; }; }
401     ac_package=`echo $ac_package| sed 's/-/_/g'`
402     case $ac_option in
403       *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
404       *) ac_optarg=yes ;;
405     esac
406     eval "with_$ac_package='$ac_optarg'" ;;
407
408   -without-* | --without-*)
409     ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
410     # Reject names that are not valid shell variable names.
411     expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
412       { echo "$as_me: error: invalid package name: $ac_package" >&2
413    { (exit 1); exit 1; }; }
414     ac_package=`echo $ac_package | sed 's/-/_/g'`
415     eval "with_$ac_package=no" ;;
416
417   --x)
418     # Obsolete; use --with-x.
419     with_x=yes ;;
420
421   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
422   | --x-incl | --x-inc | --x-in | --x-i)
423     ac_prev=x_includes ;;
424   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
425   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
426     x_includes=$ac_optarg ;;
427
428   -x-libraries | --x-libraries | --x-librarie | --x-librari \
429   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
430     ac_prev=x_libraries ;;
431   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
432   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
433     x_libraries=$ac_optarg ;;
434
435   -*) { echo "$as_me: error: unrecognized option: $ac_option
436 Try \`$0 --help' for more information." >&2
437    { (exit 1); exit 1; }; }
438     ;;
439
440   *=*)
441     ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
442     # Reject names that are not valid shell variable names.
443     expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
444       { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
445    { (exit 1); exit 1; }; }
446     ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
447     eval "$ac_envvar='$ac_optarg'"
448     export $ac_envvar ;;
449
450   *)
451     # FIXME: should be removed in autoconf 3.0.
452     echo "$as_me: WARNING: you should use --build, --host, --target" >&2
453     expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
454       echo "$as_me: WARNING: invalid host type: $ac_option" >&2
455     : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
456     ;;
457
458   esac
459 done
460
461 if test -n "$ac_prev"; then
462   ac_option=--`echo $ac_prev | sed 's/_/-/g'`
463   { echo "$as_me: error: missing argument to $ac_option" >&2
464    { (exit 1); exit 1; }; }
465 fi
466
467 # Be sure to have absolute paths.
468 for ac_var in exec_prefix prefix
469 do
470   eval ac_val=$`echo $ac_var`
471   case $ac_val in
472     [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
473     *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
474    { (exit 1); exit 1; }; };;
475   esac
476 done
477
478 # Be sure to have absolute paths.
479 for ac_var in bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir \
480               localstatedir libdir includedir oldincludedir infodir mandir
481 do
482   eval ac_val=$`echo $ac_var`
483   case $ac_val in
484     [\\/$]* | ?:[\\/]* ) ;;
485     *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
486    { (exit 1); exit 1; }; };;
487   esac
488 done
489
490 # There might be people who depend on the old broken behavior: `$host'
491 # used to hold the argument of --host etc.
492 build=$build_alias
493 host=$host_alias
494 target=$target_alias
495
496 # FIXME: should be removed in autoconf 3.0.
497 if test "x$host_alias" != x; then
498   if test "x$build_alias" = x; then
499     cross_compiling=maybe
500     echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
501     If a cross compiler is detected then cross compile mode will be used." >&2
502   elif test "x$build_alias" != "x$host_alias"; then
503     cross_compiling=yes
504   fi
505 fi
506
507 ac_tool_prefix=
508 test -n "$host_alias" && ac_tool_prefix=$host_alias-
509
510 test "$silent" = yes && exec 6>/dev/null
511
512 # Find the source files, if location was not specified.
513 if test -z "$srcdir"; then
514   ac_srcdir_defaulted=yes
515   # Try the directory containing this script, then its parent.
516   ac_prog=$0
517   ac_confdir=`echo "$ac_prog" | sed 's%[\\/][^\\/][^\\/]*$%%'`
518   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
519   srcdir=$ac_confdir
520   if test ! -r $srcdir/$ac_unique_file; then
521     srcdir=..
522   fi
523 else
524   ac_srcdir_defaulted=no
525 fi
526 if test ! -r $srcdir/$ac_unique_file; then
527   if test "$ac_srcdir_defaulted" = yes; then
528     { echo "$as_me: error: cannot find sources in $ac_confdir or .." >&2
529    { (exit 1); exit 1; }; }
530   else
531     { echo "$as_me: error: cannot find sources in $srcdir" >&2
532    { (exit 1); exit 1; }; }
533   fi
534 fi
535 srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
536 ac_env_build_alias_set=${build_alias+set}
537 ac_env_build_alias_value=$build_alias
538 ac_cv_env_build_alias_set=${build_alias+set}
539 ac_cv_env_build_alias_value=$build_alias
540 ac_env_host_alias_set=${host_alias+set}
541 ac_env_host_alias_value=$host_alias
542 ac_cv_env_host_alias_set=${host_alias+set}
543 ac_cv_env_host_alias_value=$host_alias
544 ac_env_target_alias_set=${target_alias+set}
545 ac_env_target_alias_value=$target_alias
546 ac_cv_env_target_alias_set=${target_alias+set}
547 ac_cv_env_target_alias_value=$target_alias
548 ac_env_CC_set=${CC+set}
549 ac_env_CC_value=$CC
550 ac_cv_env_CC_set=${CC+set}
551 ac_cv_env_CC_value=$CC
552 ac_env_CFLAGS_set=${CFLAGS+set}
553 ac_env_CFLAGS_value=$CFLAGS
554 ac_cv_env_CFLAGS_set=${CFLAGS+set}
555 ac_cv_env_CFLAGS_value=$CFLAGS
556 ac_env_LDFLAGS_set=${LDFLAGS+set}
557 ac_env_LDFLAGS_value=$LDFLAGS
558 ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
559 ac_cv_env_LDFLAGS_value=$LDFLAGS
560 ac_env_CPPFLAGS_set=${CPPFLAGS+set}
561 ac_env_CPPFLAGS_value=$CPPFLAGS
562 ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
563 ac_cv_env_CPPFLAGS_value=$CPPFLAGS
564 ac_env_CPP_set=${CPP+set}
565 ac_env_CPP_value=$CPP
566 ac_cv_env_CPP_set=${CPP+set}
567 ac_cv_env_CPP_value=$CPP
568
569 #
570 # Report the --help message.
571 #
572 if test "$ac_init_help" = "long"; then
573   # Omit some internal or obsolete options to make the list less imposing.
574   # This message is too long to be a string in the A/UX 3.1 sh.
575   cat <<EOF
576 \`configure' configures this package to adapt to many kinds of systems.
577
578 Usage: $0 [OPTION]... [VAR=VALUE]...
579
580 To assign environment variables (e.g., CC, CFLAGS...), specify them as
581 VAR=VALUE.  See below for descriptions of some of the useful variables.
582
583 Defaults for the options are specified in brackets.
584
585 Configuration:
586   -h, --help              display this help and exit
587       --help=short        display options specific to this package
588       --help=recursive    display the short help of all the included packages
589   -V, --version           display version information and exit
590   -q, --quiet, --silent   do not print \`checking...' messages
591       --cache-file=FILE   cache test results in FILE [disabled]
592   -C, --config-cache      alias for \`--cache-file=config.cache'
593   -n, --no-create         do not create output files
594       --srcdir=DIR        find the sources in DIR [configure dir or \`..']
595
596 EOF
597
598   cat <<EOF
599 Installation directories:
600   --prefix=PREFIX         install architecture-independent files in PREFIX
601                           [$ac_default_prefix]
602   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
603                           [PREFIX]
604
605 By default, \`make install' will install all the files in
606 \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
607 an installation prefix other than \`$ac_default_prefix' using \`--prefix',
608 for instance \`--prefix=\$HOME'.
609
610 For better control, use the options below.
611
612 Fine tuning of the installation directories:
613   --bindir=DIR            user executables [EPREFIX/bin]
614   --sbindir=DIR           system admin executables [EPREFIX/sbin]
615   --libexecdir=DIR        program executables [EPREFIX/libexec]
616   --datarootdir=DIR       read-only architecture-independent data [PREFIX/share]
617   --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
618   --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
619   --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
620   --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
621   --libdir=DIR            object code libraries [EPREFIX/lib]
622   --includedir=DIR        C header files [PREFIX/include]
623   --oldincludedir=DIR     C header files for non-gcc [/usr/include]
624   --infodir=DIR           info documentation [DATAROOTDIR/info]
625   --mandir=DIR            man documentation [DATAROOTDIR/man]
626 EOF
627
628   cat <<\EOF
629
630 Program names:
631   --program-prefix=PREFIX            prepend PREFIX to installed program names
632   --program-suffix=SUFFIX            append SUFFIX to installed program names
633   --program-transform-name=PROGRAM   run sed PROGRAM on installed program names
634
635 X features:
636   --x-includes=DIR    X include files are in DIR
637   --x-libraries=DIR   X library files are in DIR
638
639 System types:
640   --build=BUILD           configure for building on BUILD [guessed]
641   --host=HOST       build programs to run on HOST [BUILD]
642 EOF
643 fi
644
645 if test -n "$ac_init_help"; then
646
647   cat <<\EOF
648
649 Optional Packages:
650   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
651   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
652
653 Optional Features:
654   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
655   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
656
657 General Options:
658   --with-pkg-config{=path} enable/disable use of pkg-config
659   --disable-echo          do not display "compiling" commands
660 Curses Version-dependent Options:
661   --with-ncurses-wrap-prefix naming-prefix for ncurses wrapped-variables
662   --disable-widec         disable checks for wide-character functions
663   --with-curses-dir=DIR   directory in which (n)curses is installed
664   --with-screen=XXX       use specified curses-libraries
665   --with-ncursesw         use wide ncurses-libraries
666   --with-ncurses          use ncurses-libraries
667   --with-pdcurses         compile/link with pdcurses X11 library
668   --with-curses-colr      compile/link with HPUX 10.x color-curses
669   --with-curses-5lib      compile/link with SunOS 5lib curses
670   --with-Xaw3d            link with Xaw 3d library
671   --with-Xaw3dxft         link with Xaw 3d xft library
672   --with-neXtaw           link with neXT Athena library
673   --with-XawPlus          link with Athena-Plus library
674   --with-x                use the X Window System
675 Testing/development Options:
676   --enable-warnings       test: turn on gcc compiler warnings
677   --with-dmalloc          test: use Gray Watson's dmalloc library
678   --with-dbmalloc         test: use Conor Cahill's dbmalloc library
679   --with-valgrind         test: use valgrind
680   --disable-leaks         test: free permanent memory, analyze leaks
681   --disable-rpath-hack    don't add rpath options for additional libraries
682
683 Some influential environment variables:
684   CC          C compiler command
685   CFLAGS      C compiler flags
686   LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
687               nonstandard directory <lib dir>
688   CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
689               headers in a nonstandard directory <include dir>
690   CPP         C preprocessor
691
692 Use these variables to override the choices made by `configure' or to help
693 it to find libraries and programs with nonstandard names/locations.
694
695 EOF
696 fi
697
698 if test "$ac_init_help" = "recursive"; then
699   # If there are subdirs, report their specific --help.
700   ac_popdir=`pwd`
701   for ac_subdir in : $ac_subdirs_all; do test "x$ac_subdir" = x: && continue
702     cd $ac_subdir
703     # A "../" for each directory in /$ac_subdir.
704     ac_dots=`echo $ac_subdir |
705              sed 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g'`
706
707     case $srcdir in
708     .) # No --srcdir option.  We are building in place.
709       ac_sub_srcdir=$srcdir ;;
710     [\\/]* | ?:[\\/]* ) # Absolute path.
711       ac_sub_srcdir=$srcdir/$ac_subdir ;;
712     *) # Relative path.
713       ac_sub_srcdir=$ac_dots$srcdir/$ac_subdir ;;
714     esac
715
716     # Check for guested configure; otherwise get Cygnus style configure.
717     if test -f $ac_sub_srcdir/configure.gnu; then
718       echo
719       $SHELL $ac_sub_srcdir/configure.gnu  --help=recursive
720     elif test -f $ac_sub_srcdir/configure; then
721       echo
722       $SHELL $ac_sub_srcdir/configure  --help=recursive
723     elif test -f $ac_sub_srcdir/configure.ac ||
724            test -f $ac_sub_srcdir/configure.in; then
725       echo
726       $ac_configure --help
727     else
728       echo "$as_me: WARNING: no configuration information is in $ac_subdir" >&2
729     fi
730     cd $ac_popdir
731   done
732 fi
733
734 test -n "$ac_init_help" && exit 0
735 if $ac_init_version; then
736   cat <<\EOF
737
738 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
739 Free Software Foundation, Inc.
740 This configure script is free software; the Free Software Foundation
741 gives unlimited permission to copy, distribute and modify it.
742 EOF
743   exit 0
744 fi
745 exec 5>config.log
746 cat >&5 <<EOF
747 This file contains any messages produced by compilers while
748 running configure, to aid debugging if configure makes a mistake.
749
750 It was created by $as_me, which was
751 generated by GNU Autoconf 2.52.20150926.  Invocation command line was
752
753   $ $0 $@
754
755 EOF
756 {
757 cat <<_ASUNAME
758 ## ---------- ##
759 ## Platform.  ##
760 ## ---------- ##
761
762 hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
763 uname -m = `(uname -m) 2>/dev/null || echo unknown`
764 uname -r = `(uname -r) 2>/dev/null || echo unknown`
765 uname -s = `(uname -s) 2>/dev/null || echo unknown`
766 uname -v = `(uname -v) 2>/dev/null || echo unknown`
767
768 /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
769 /bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
770
771 /bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
772 /usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
773 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
774 hostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
775 /bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
776 /usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
777 /bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
778
779 PATH = $PATH
780
781 _ASUNAME
782 } >&5
783
784 cat >&5 <<EOF
785 ## ------------ ##
786 ## Core tests.  ##
787 ## ------------ ##
788
789 EOF
790
791 # Keep a trace of the command line.
792 # Strip out --no-create and --no-recursion so they do not pile up.
793 # Also quote any args containing shell meta-characters.
794 ac_configure_args=
795 ac_sep=
796 for ac_arg
797 do
798   case $ac_arg in
799   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
800   | --no-cr | --no-c) ;;
801   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
802   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
803   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
804     ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"`
805     ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
806     ac_sep=" " ;;
807   *) ac_configure_args="$ac_configure_args$ac_sep$ac_arg"
808      ac_sep=" " ;;
809   esac
810   # Get rid of the leading space.
811 done
812
813 # When interrupted or exit'd, cleanup temporary files, and complete
814 # config.log.  We remove comments because anyway the quotes in there
815 # would cause problems or look ugly.
816 trap 'exit_status=$?
817   # Save into config.log some information that might help in debugging.
818   echo >&5
819   echo "## ----------------- ##" >&5
820   echo "## Cache variables.  ##" >&5
821   echo "## ----------------- ##" >&5
822   echo >&5
823   # The following way of writing the cache mishandles newlines in values,
824 {
825   (set) 2>&1 |
826     case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
827     *ac_space=\ *)
828       sed -n \
829         "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
830           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
831       ;;
832     *)
833       sed -n \
834         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
835       ;;
836     esac;
837 } >&5
838   sed "/^$/d" confdefs.h >conftest.log
839   if test -s conftest.log; then
840     echo >&5
841     echo "## ------------ ##" >&5
842     echo "## confdefs.h.  ##" >&5
843     echo "## ------------ ##" >&5
844     echo >&5
845     cat conftest.log >&5
846   fi
847   (echo; echo) >&5
848   test "$ac_signal" != 0 &&
849     echo "$as_me: caught signal $ac_signal" >&5
850   echo "$as_me: exit $exit_status" >&5
851   rm -rf conftest* confdefs* core core.* *.core conf$$* $ac_clean_files &&
852     exit $exit_status
853      ' 0
854 for ac_signal in 1 2 13 15; do
855   trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
856 done
857 ac_signal=0
858
859 # confdefs.h avoids OS command line length limits that DEFS can exceed.
860 rm -rf conftest* confdefs.h
861 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
862 echo >confdefs.h
863
864 # Let the site file select an alternate cache file if it wants to.
865 # Prefer explicitly selected file to automatically selected ones.
866 if test -z "$CONFIG_SITE"; then
867   if test "x$prefix" != xNONE; then
868     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
869   else
870     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
871   fi
872 fi
873 for ac_site_file in $CONFIG_SITE; do
874   if test -r "$ac_site_file"; then
875     { echo "$as_me:875: loading site script $ac_site_file" >&5
876 echo "$as_me: loading site script $ac_site_file" >&6;}
877     cat "$ac_site_file" >&5
878     . "$ac_site_file"
879   fi
880 done
881
882 if test -r "$cache_file"; then
883   # Some versions of bash will fail to source /dev/null (special
884   # files actually), so we avoid doing that.
885   if test -f "$cache_file"; then
886     { echo "$as_me:886: loading cache $cache_file" >&5
887 echo "$as_me: loading cache $cache_file" >&6;}
888     case $cache_file in
889       [\\/]* | ?:[\\/]* ) . $cache_file;;
890       *)                      . ./$cache_file;;
891     esac
892   fi
893 else
894   { echo "$as_me:894: creating cache $cache_file" >&5
895 echo "$as_me: creating cache $cache_file" >&6;}
896   >$cache_file
897 fi
898
899 # Check that the precious variables saved in the cache have kept the same
900 # value.
901 ac_cache_corrupted=false
902 for ac_var in `(set) 2>&1 |
903                sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
904   eval ac_old_set=\$ac_cv_env_${ac_var}_set
905   eval ac_new_set=\$ac_env_${ac_var}_set
906   eval ac_old_val="\$ac_cv_env_${ac_var}_value"
907   eval ac_new_val="\$ac_env_${ac_var}_value"
908   case $ac_old_set,$ac_new_set in
909     set,)
910       { echo "$as_me:910: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
911 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
912       ac_cache_corrupted=: ;;
913     ,set)
914       { echo "$as_me:914: error: \`$ac_var' was not set in the previous run" >&5
915 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
916       ac_cache_corrupted=: ;;
917     ,);;
918     *)
919       if test "x$ac_old_val" != "x$ac_new_val"; then
920         { echo "$as_me:920: error: \`$ac_var' has changed since the previous run:" >&5
921 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
922         { echo "$as_me:922:   former value:  $ac_old_val" >&5
923 echo "$as_me:   former value:  $ac_old_val" >&2;}
924         { echo "$as_me:924:   current value: $ac_new_val" >&5
925 echo "$as_me:   current value: $ac_new_val" >&2;}
926         ac_cache_corrupted=:
927       fi;;
928   esac
929   # Pass precious variables to config.status.  It doesn't matter if
930   # we pass some twice (in addition to the command line arguments).
931   if test "$ac_new_set" = set; then
932     case $ac_new_val in
933     *" "*|*"    "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
934       ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"`
935       ac_configure_args="$ac_configure_args '$ac_arg'"
936       ;;
937     *) ac_configure_args="$ac_configure_args $ac_var=$ac_new_val"
938        ;;
939     esac
940   fi
941 done
942 if $ac_cache_corrupted; then
943   { echo "$as_me:943: error: changes in the environment can compromise the build" >&5
944 echo "$as_me: error: changes in the environment can compromise the build" >&2;}
945   { { echo "$as_me:945: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
946 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
947    { (exit 1); exit 1; }; }
948 fi
949
950 ac_ext=c
951 ac_cpp='$CPP $CPPFLAGS'
952 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
953 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
954 ac_compiler_gnu=$ac_cv_c_compiler_gnu
955 ac_main_return=return
956
957 case `echo "testing\c" 2>/dev/null; echo 1,2,3`,`echo -n testing 2>/dev/null; echo 1,2,3` in
958   *c*,-n*) ECHO_N= ECHO_C=      # newlines do not sed ;-) only broken shells would use this case anyway
959                    ECHO_T='     ' ;;
960   *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
961   *)      ECHO_N= ECHO_C='\c' ECHO_T= ;;
962 esac
963 echo "#! $SHELL" >conftest.sh
964 echo  "exit 0"   >>conftest.sh
965 chmod +x conftest.sh
966 if { (echo "$as_me:966: PATH=\".;.\"; conftest.sh") >&5
967   (PATH=".;."; conftest.sh) 2>&5
968   ac_status=$?
969   echo "$as_me:969: \$? = $ac_status" >&5
970   (exit $ac_status); }; then
971   ac_path_separator=';'
972 else
973   ac_path_separator=:
974 fi
975 PATH_SEPARATOR="$ac_path_separator"
976 rm -f conftest.sh
977
978 ac_config_headers="$ac_config_headers ncurses_cfg.h:ncurses_tst.hin"
979
980 test -f config.guess || ( test -f ../config.guess && cp ../config.guess ./ )
981
982 test -f config.sub || ( test -f ../config.sub && cp ../config.sub ./ )
983
984 ac_aux_dir=
985 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
986   if test -f $ac_dir/install-sh; then
987     ac_aux_dir=$ac_dir
988     ac_install_sh="$ac_aux_dir/install-sh -c"
989     break
990   elif test -f $ac_dir/install.sh; then
991     ac_aux_dir=$ac_dir
992     ac_install_sh="$ac_aux_dir/install.sh -c"
993     break
994   elif test -f $ac_dir/shtool; then
995     ac_aux_dir=$ac_dir
996     ac_install_sh="$ac_aux_dir/shtool install -c"
997     break
998   fi
999 done
1000 if test -z "$ac_aux_dir"; then
1001   { { echo "$as_me:1001: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
1002 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
1003    { (exit 1); exit 1; }; }
1004 fi
1005 ac_config_guess="$SHELL $ac_aux_dir/config.guess"
1006 ac_config_sub="$SHELL $ac_aux_dir/config.sub"
1007 ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
1008
1009 # Make sure we can run config.sub.
1010 $ac_config_sub sun4 >/dev/null 2>&1 ||
1011   { { echo "$as_me:1011: error: cannot run $ac_config_sub" >&5
1012 echo "$as_me: error: cannot run $ac_config_sub" >&2;}
1013    { (exit 1); exit 1; }; }
1014
1015 echo "$as_me:1015: checking build system type" >&5
1016 echo $ECHO_N "checking build system type... $ECHO_C" >&6
1017 if test "${ac_cv_build+set}" = set; then
1018   echo $ECHO_N "(cached) $ECHO_C" >&6
1019 else
1020   ac_cv_build_alias=$build_alias
1021 test -z "$ac_cv_build_alias" &&
1022   ac_cv_build_alias=`$ac_config_guess`
1023 test -z "$ac_cv_build_alias" &&
1024   { { echo "$as_me:1024: error: cannot guess build type; you must specify one" >&5
1025 echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
1026    { (exit 1); exit 1; }; }
1027 ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
1028   { { echo "$as_me:1028: error: $ac_config_sub $ac_cv_build_alias failed." >&5
1029 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed." >&2;}
1030    { (exit 1); exit 1; }; }
1031
1032 fi
1033 echo "$as_me:1033: result: $ac_cv_build" >&5
1034 echo "${ECHO_T}$ac_cv_build" >&6
1035 build=$ac_cv_build
1036 build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1037 build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1038 build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1039
1040 if test -f $srcdir/config.guess || test -f $ac_aux_dir/config.guess ; then
1041         echo "$as_me:1041: checking host system type" >&5
1042 echo $ECHO_N "checking host system type... $ECHO_C" >&6
1043 if test "${ac_cv_host+set}" = set; then
1044   echo $ECHO_N "(cached) $ECHO_C" >&6
1045 else
1046   ac_cv_host_alias=$host_alias
1047 test -z "$ac_cv_host_alias" &&
1048   ac_cv_host_alias=$ac_cv_build_alias
1049 ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
1050   { { echo "$as_me:1050: error: $ac_config_sub $ac_cv_host_alias failed" >&5
1051 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
1052    { (exit 1); exit 1; }; }
1053
1054 fi
1055 echo "$as_me:1055: result: $ac_cv_host" >&5
1056 echo "${ECHO_T}$ac_cv_host" >&6
1057 host=$ac_cv_host
1058 host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1059 host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1060 host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1061
1062         system_name="$host_os"
1063 else
1064         system_name="`(uname -s -r) 2>/dev/null`"
1065         if test -z "$system_name" ; then
1066                 system_name="`(hostname) 2>/dev/null`"
1067         fi
1068 fi
1069 test -n "$system_name" &&
1070 cat >>confdefs.h <<EOF
1071 #define SYSTEM_NAME "$system_name"
1072 EOF
1073
1074 if test "${cf_cv_system_name+set}" = set; then
1075   echo $ECHO_N "(cached) $ECHO_C" >&6
1076 else
1077   cf_cv_system_name="$system_name"
1078 fi
1079
1080 test -z "$system_name" && system_name="$cf_cv_system_name"
1081 test -n "$cf_cv_system_name" && echo "$as_me:1081: result: Configuring for $cf_cv_system_name" >&5
1082 echo "${ECHO_T}Configuring for $cf_cv_system_name" >&6
1083
1084 if test ".$system_name" != ".$cf_cv_system_name" ; then
1085         echo "$as_me:1085: result: Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&5
1086 echo "${ECHO_T}Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&6
1087         { { echo "$as_me:1087: error: \"Please remove config.cache and try again.\"" >&5
1088 echo "$as_me: error: \"Please remove config.cache and try again.\"" >&2;}
1089    { (exit 1); exit 1; }; }
1090 fi
1091
1092 test "$program_prefix" != NONE &&
1093   program_transform_name="s,^,$program_prefix,;$program_transform_name"
1094 # Use a double $ so make ignores it.
1095 test "$program_suffix" != NONE &&
1096   program_transform_name="s,\$,$program_suffix,;$program_transform_name"
1097 # Double any \ or $.  echo might interpret backslashes.
1098 # By default was `s,x,x', remove it if useless.
1099 cat <<\_ACEOF >conftest.sed
1100 s/[\\$]/&&/g;s/;s,x,x,$//
1101 _ACEOF
1102 program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
1103 rm conftest.sed
1104
1105 echo "$as_me:1105: checking whether ${MAKE-make} sets \${MAKE}" >&5
1106 echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6
1107 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
1108 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
1109   echo $ECHO_N "(cached) $ECHO_C" >&6
1110 else
1111   cat >conftest.make <<\EOF
1112 all:
1113         @echo 'ac_maketemp="${MAKE}"'
1114 EOF
1115 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
1116 eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
1117 if test -n "$ac_maketemp"; then
1118   eval ac_cv_prog_make_${ac_make}_set=yes
1119 else
1120   eval ac_cv_prog_make_${ac_make}_set=no
1121 fi
1122 rm -f conftest.make
1123 fi
1124 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
1125   echo "$as_me:1125: result: yes" >&5
1126 echo "${ECHO_T}yes" >&6
1127   SET_MAKE=
1128 else
1129   echo "$as_me:1129: result: no" >&5
1130 echo "${ECHO_T}no" >&6
1131   SET_MAKE="MAKE=${MAKE-make}"
1132 fi
1133
1134 ac_ext=c
1135 ac_cpp='$CPP $CPPFLAGS'
1136 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1137 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1138 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1139 ac_main_return=return
1140 if test -n "$ac_tool_prefix"; then
1141   # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
1142 set dummy ${ac_tool_prefix}gcc; ac_word=$2
1143 echo "$as_me:1143: checking for $ac_word" >&5
1144 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1145 if test "${ac_cv_prog_CC+set}" = set; then
1146   echo $ECHO_N "(cached) $ECHO_C" >&6
1147 else
1148   if test -n "$CC"; then
1149   ac_cv_prog_CC="$CC" # Let the user override the test.
1150 else
1151   ac_save_IFS=$IFS; IFS=$ac_path_separator
1152 ac_dummy="$PATH"
1153 for ac_dir in $ac_dummy; do
1154   IFS=$ac_save_IFS
1155   test -z "$ac_dir" && ac_dir=.
1156   $as_executable_p "$ac_dir/$ac_word" || continue
1157 ac_cv_prog_CC="${ac_tool_prefix}gcc"
1158 echo "$as_me:1158: found $ac_dir/$ac_word" >&5
1159 break
1160 done
1161
1162 fi
1163 fi
1164 CC=$ac_cv_prog_CC
1165 if test -n "$CC"; then
1166   echo "$as_me:1166: result: $CC" >&5
1167 echo "${ECHO_T}$CC" >&6
1168 else
1169   echo "$as_me:1169: result: no" >&5
1170 echo "${ECHO_T}no" >&6
1171 fi
1172
1173 fi
1174 if test -z "$ac_cv_prog_CC"; then
1175   ac_ct_CC=$CC
1176   # Extract the first word of "gcc", so it can be a program name with args.
1177 set dummy gcc; ac_word=$2
1178 echo "$as_me:1178: checking for $ac_word" >&5
1179 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1180 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1181   echo $ECHO_N "(cached) $ECHO_C" >&6
1182 else
1183   if test -n "$ac_ct_CC"; then
1184   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1185 else
1186   ac_save_IFS=$IFS; IFS=$ac_path_separator
1187 ac_dummy="$PATH"
1188 for ac_dir in $ac_dummy; do
1189   IFS=$ac_save_IFS
1190   test -z "$ac_dir" && ac_dir=.
1191   $as_executable_p "$ac_dir/$ac_word" || continue
1192 ac_cv_prog_ac_ct_CC="gcc"
1193 echo "$as_me:1193: found $ac_dir/$ac_word" >&5
1194 break
1195 done
1196
1197 fi
1198 fi
1199 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1200 if test -n "$ac_ct_CC"; then
1201   echo "$as_me:1201: result: $ac_ct_CC" >&5
1202 echo "${ECHO_T}$ac_ct_CC" >&6
1203 else
1204   echo "$as_me:1204: result: no" >&5
1205 echo "${ECHO_T}no" >&6
1206 fi
1207
1208   CC=$ac_ct_CC
1209 else
1210   CC="$ac_cv_prog_CC"
1211 fi
1212
1213 if test -z "$CC"; then
1214   if test -n "$ac_tool_prefix"; then
1215   # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
1216 set dummy ${ac_tool_prefix}cc; ac_word=$2
1217 echo "$as_me:1217: checking for $ac_word" >&5
1218 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1219 if test "${ac_cv_prog_CC+set}" = set; then
1220   echo $ECHO_N "(cached) $ECHO_C" >&6
1221 else
1222   if test -n "$CC"; then
1223   ac_cv_prog_CC="$CC" # Let the user override the test.
1224 else
1225   ac_save_IFS=$IFS; IFS=$ac_path_separator
1226 ac_dummy="$PATH"
1227 for ac_dir in $ac_dummy; do
1228   IFS=$ac_save_IFS
1229   test -z "$ac_dir" && ac_dir=.
1230   $as_executable_p "$ac_dir/$ac_word" || continue
1231 ac_cv_prog_CC="${ac_tool_prefix}cc"
1232 echo "$as_me:1232: found $ac_dir/$ac_word" >&5
1233 break
1234 done
1235
1236 fi
1237 fi
1238 CC=$ac_cv_prog_CC
1239 if test -n "$CC"; then
1240   echo "$as_me:1240: result: $CC" >&5
1241 echo "${ECHO_T}$CC" >&6
1242 else
1243   echo "$as_me:1243: result: no" >&5
1244 echo "${ECHO_T}no" >&6
1245 fi
1246
1247 fi
1248 if test -z "$ac_cv_prog_CC"; then
1249   ac_ct_CC=$CC
1250   # Extract the first word of "cc", so it can be a program name with args.
1251 set dummy cc; ac_word=$2
1252 echo "$as_me:1252: checking for $ac_word" >&5
1253 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1254 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1255   echo $ECHO_N "(cached) $ECHO_C" >&6
1256 else
1257   if test -n "$ac_ct_CC"; then
1258   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1259 else
1260   ac_save_IFS=$IFS; IFS=$ac_path_separator
1261 ac_dummy="$PATH"
1262 for ac_dir in $ac_dummy; do
1263   IFS=$ac_save_IFS
1264   test -z "$ac_dir" && ac_dir=.
1265   $as_executable_p "$ac_dir/$ac_word" || continue
1266 ac_cv_prog_ac_ct_CC="cc"
1267 echo "$as_me:1267: found $ac_dir/$ac_word" >&5
1268 break
1269 done
1270
1271 fi
1272 fi
1273 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1274 if test -n "$ac_ct_CC"; then
1275   echo "$as_me:1275: result: $ac_ct_CC" >&5
1276 echo "${ECHO_T}$ac_ct_CC" >&6
1277 else
1278   echo "$as_me:1278: result: no" >&5
1279 echo "${ECHO_T}no" >&6
1280 fi
1281
1282   CC=$ac_ct_CC
1283 else
1284   CC="$ac_cv_prog_CC"
1285 fi
1286
1287 fi
1288 if test -z "$CC"; then
1289   # Extract the first word of "cc", so it can be a program name with args.
1290 set dummy cc; ac_word=$2
1291 echo "$as_me:1291: checking for $ac_word" >&5
1292 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1293 if test "${ac_cv_prog_CC+set}" = set; then
1294   echo $ECHO_N "(cached) $ECHO_C" >&6
1295 else
1296   if test -n "$CC"; then
1297   ac_cv_prog_CC="$CC" # Let the user override the test.
1298 else
1299   ac_prog_rejected=no
1300   ac_save_IFS=$IFS; IFS=$ac_path_separator
1301 ac_dummy="$PATH"
1302 for ac_dir in $ac_dummy; do
1303   IFS=$ac_save_IFS
1304   test -z "$ac_dir" && ac_dir=.
1305   $as_executable_p "$ac_dir/$ac_word" || continue
1306 if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1307   ac_prog_rejected=yes
1308   continue
1309 fi
1310 ac_cv_prog_CC="cc"
1311 echo "$as_me:1311: found $ac_dir/$ac_word" >&5
1312 break
1313 done
1314
1315 if test $ac_prog_rejected = yes; then
1316   # We found a bogon in the path, so make sure we never use it.
1317   set dummy $ac_cv_prog_CC
1318   shift
1319   if test $# != 0; then
1320     # We chose a different compiler from the bogus one.
1321     # However, it has the same basename, so the bogon will be chosen
1322     # first if we set CC to just the basename; use the full file name.
1323     shift
1324     set dummy "$ac_dir/$ac_word" ${1+"$@"}
1325     shift
1326     ac_cv_prog_CC="$@"
1327   fi
1328 fi
1329 fi
1330 fi
1331 CC=$ac_cv_prog_CC
1332 if test -n "$CC"; then
1333   echo "$as_me:1333: result: $CC" >&5
1334 echo "${ECHO_T}$CC" >&6
1335 else
1336   echo "$as_me:1336: result: no" >&5
1337 echo "${ECHO_T}no" >&6
1338 fi
1339
1340 fi
1341 if test -z "$CC"; then
1342   if test -n "$ac_tool_prefix"; then
1343   for ac_prog in cl
1344   do
1345     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
1346 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
1347 echo "$as_me:1347: checking for $ac_word" >&5
1348 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1349 if test "${ac_cv_prog_CC+set}" = set; then
1350   echo $ECHO_N "(cached) $ECHO_C" >&6
1351 else
1352   if test -n "$CC"; then
1353   ac_cv_prog_CC="$CC" # Let the user override the test.
1354 else
1355   ac_save_IFS=$IFS; IFS=$ac_path_separator
1356 ac_dummy="$PATH"
1357 for ac_dir in $ac_dummy; do
1358   IFS=$ac_save_IFS
1359   test -z "$ac_dir" && ac_dir=.
1360   $as_executable_p "$ac_dir/$ac_word" || continue
1361 ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
1362 echo "$as_me:1362: found $ac_dir/$ac_word" >&5
1363 break
1364 done
1365
1366 fi
1367 fi
1368 CC=$ac_cv_prog_CC
1369 if test -n "$CC"; then
1370   echo "$as_me:1370: result: $CC" >&5
1371 echo "${ECHO_T}$CC" >&6
1372 else
1373   echo "$as_me:1373: result: no" >&5
1374 echo "${ECHO_T}no" >&6
1375 fi
1376
1377     test -n "$CC" && break
1378   done
1379 fi
1380 if test -z "$CC"; then
1381   ac_ct_CC=$CC
1382   for ac_prog in cl
1383 do
1384   # Extract the first word of "$ac_prog", so it can be a program name with args.
1385 set dummy $ac_prog; ac_word=$2
1386 echo "$as_me:1386: checking for $ac_word" >&5
1387 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1388 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1389   echo $ECHO_N "(cached) $ECHO_C" >&6
1390 else
1391   if test -n "$ac_ct_CC"; then
1392   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1393 else
1394   ac_save_IFS=$IFS; IFS=$ac_path_separator
1395 ac_dummy="$PATH"
1396 for ac_dir in $ac_dummy; do
1397   IFS=$ac_save_IFS
1398   test -z "$ac_dir" && ac_dir=.
1399   $as_executable_p "$ac_dir/$ac_word" || continue
1400 ac_cv_prog_ac_ct_CC="$ac_prog"
1401 echo "$as_me:1401: found $ac_dir/$ac_word" >&5
1402 break
1403 done
1404
1405 fi
1406 fi
1407 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1408 if test -n "$ac_ct_CC"; then
1409   echo "$as_me:1409: result: $ac_ct_CC" >&5
1410 echo "${ECHO_T}$ac_ct_CC" >&6
1411 else
1412   echo "$as_me:1412: result: no" >&5
1413 echo "${ECHO_T}no" >&6
1414 fi
1415
1416   test -n "$ac_ct_CC" && break
1417 done
1418
1419   CC=$ac_ct_CC
1420 fi
1421
1422 fi
1423
1424 test -z "$CC" && { { echo "$as_me:1424: error: no acceptable cc found in \$PATH" >&5
1425 echo "$as_me: error: no acceptable cc found in \$PATH" >&2;}
1426    { (exit 1); exit 1; }; }
1427
1428 # Provide some information about the compiler.
1429 echo "$as_me:1429:" \
1430      "checking for C compiler version" >&5
1431 ac_compiler=`set X $ac_compile; echo $2`
1432 { (eval echo "$as_me:1432: \"$ac_compiler --version </dev/null >&5\"") >&5
1433   (eval $ac_compiler --version </dev/null >&5) 2>&5
1434   ac_status=$?
1435   echo "$as_me:1435: \$? = $ac_status" >&5
1436   (exit $ac_status); }
1437 { (eval echo "$as_me:1437: \"$ac_compiler -v </dev/null >&5\"") >&5
1438   (eval $ac_compiler -v </dev/null >&5) 2>&5
1439   ac_status=$?
1440   echo "$as_me:1440: \$? = $ac_status" >&5
1441   (exit $ac_status); }
1442 { (eval echo "$as_me:1442: \"$ac_compiler -V </dev/null >&5\"") >&5
1443   (eval $ac_compiler -V </dev/null >&5) 2>&5
1444   ac_status=$?
1445   echo "$as_me:1445: \$? = $ac_status" >&5
1446   (exit $ac_status); }
1447
1448 cat >conftest.$ac_ext <<_ACEOF
1449 #line 1449 "configure"
1450 #include "confdefs.h"
1451
1452 int
1453 main ()
1454 {
1455
1456   ;
1457   return 0;
1458 }
1459 _ACEOF
1460 ac_clean_files_save=$ac_clean_files
1461 ac_clean_files="$ac_clean_files a.out a.exe"
1462 # Try to create an executable without -o first, disregard a.out.
1463 # It will help us diagnose broken compilers, and finding out an intuition
1464 # of exeext.
1465 echo "$as_me:1465: checking for C compiler default output" >&5
1466 echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
1467 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
1468 if { (eval echo "$as_me:1468: \"$ac_link_default\"") >&5
1469   (eval $ac_link_default) 2>&5
1470   ac_status=$?
1471   echo "$as_me:1471: \$? = $ac_status" >&5
1472   (exit $ac_status); }; then
1473   # Find the output, starting from the most likely.  This scheme is
1474 # not robust to junk in `.', hence go to wildcards (a.*) only as a last
1475 # resort.
1476 for ac_file in `ls a.exe conftest.exe 2>/dev/null;
1477                 ls a.out conftest 2>/dev/null;
1478                 ls a.* conftest.* 2>/dev/null`; do
1479   case $ac_file in
1480     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1481     a.out ) # We found the default executable, but exeext='' is most
1482             # certainly right.
1483             break;;
1484     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1485           # FIXME: I believe we export ac_cv_exeext for Libtool --akim.
1486           export ac_cv_exeext
1487           break;;
1488     * ) break;;
1489   esac
1490 done
1491 else
1492   echo "$as_me: failed program was:" >&5
1493 cat conftest.$ac_ext >&5
1494 { { echo "$as_me:1494: error: C compiler cannot create executables" >&5
1495 echo "$as_me: error: C compiler cannot create executables" >&2;}
1496    { (exit 77); exit 77; }; }
1497 fi
1498
1499 ac_exeext=$ac_cv_exeext
1500 echo "$as_me:1500: result: $ac_file" >&5
1501 echo "${ECHO_T}$ac_file" >&6
1502
1503 # Check the compiler produces executables we can run.  If not, either
1504 # the compiler is broken, or we cross compile.
1505 echo "$as_me:1505: checking whether the C compiler works" >&5
1506 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
1507 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0
1508 # If not cross compiling, check that we can run a simple program.
1509 if test "$cross_compiling" != yes; then
1510   if { ac_try='./$ac_file'
1511   { (eval echo "$as_me:1511: \"$ac_try\"") >&5
1512   (eval $ac_try) 2>&5
1513   ac_status=$?
1514   echo "$as_me:1514: \$? = $ac_status" >&5
1515   (exit $ac_status); }; }; then
1516     cross_compiling=no
1517   else
1518     if test "$cross_compiling" = maybe; then
1519         cross_compiling=yes
1520     else
1521         { { echo "$as_me:1521: error: cannot run C compiled programs.
1522 If you meant to cross compile, use \`--host'." >&5
1523 echo "$as_me: error: cannot run C compiled programs.
1524 If you meant to cross compile, use \`--host'." >&2;}
1525    { (exit 1); exit 1; }; }
1526     fi
1527   fi
1528 fi
1529 echo "$as_me:1529: result: yes" >&5
1530 echo "${ECHO_T}yes" >&6
1531
1532 rm -f a.out a.exe conftest$ac_cv_exeext
1533 ac_clean_files=$ac_clean_files_save
1534 # Check the compiler produces executables we can run.  If not, either
1535 # the compiler is broken, or we cross compile.
1536 echo "$as_me:1536: checking whether we are cross compiling" >&5
1537 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
1538 echo "$as_me:1538: result: $cross_compiling" >&5
1539 echo "${ECHO_T}$cross_compiling" >&6
1540
1541 echo "$as_me:1541: checking for executable suffix" >&5
1542 echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6
1543 if { (eval echo "$as_me:1543: \"$ac_link\"") >&5
1544   (eval $ac_link) 2>&5
1545   ac_status=$?
1546   echo "$as_me:1546: \$? = $ac_status" >&5
1547   (exit $ac_status); }; then
1548   # If both `conftest.exe' and `conftest' are `present' (well, observable)
1549 # catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
1550 # work properly (i.e., refer to `conftest.exe'), while it won't with
1551 # `rm'.
1552 for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do
1553   case $ac_file in
1554     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1555     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1556           export ac_cv_exeext
1557           break;;
1558     * ) break;;
1559   esac
1560 done
1561 else
1562   { { echo "$as_me:1562: error: cannot compute EXEEXT: cannot compile and link" >&5
1563 echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;}
1564    { (exit 1); exit 1; }; }
1565 fi
1566
1567 rm -f conftest$ac_cv_exeext
1568 echo "$as_me:1568: result: $ac_cv_exeext" >&5
1569 echo "${ECHO_T}$ac_cv_exeext" >&6
1570
1571 rm -f conftest.$ac_ext
1572 EXEEXT=$ac_cv_exeext
1573 ac_exeext=$EXEEXT
1574 echo "$as_me:1574: checking for object suffix" >&5
1575 echo $ECHO_N "checking for object suffix... $ECHO_C" >&6
1576 if test "${ac_cv_objext+set}" = set; then
1577   echo $ECHO_N "(cached) $ECHO_C" >&6
1578 else
1579   cat >conftest.$ac_ext <<_ACEOF
1580 #line 1580 "configure"
1581 #include "confdefs.h"
1582
1583 int
1584 main ()
1585 {
1586
1587   ;
1588   return 0;
1589 }
1590 _ACEOF
1591 rm -f conftest.o conftest.obj
1592 if { (eval echo "$as_me:1592: \"$ac_compile\"") >&5
1593   (eval $ac_compile) 2>&5
1594   ac_status=$?
1595   echo "$as_me:1595: \$? = $ac_status" >&5
1596   (exit $ac_status); }; then
1597   for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
1598   case $ac_file in
1599     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.map | *.inf ) ;;
1600     *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
1601        break;;
1602   esac
1603 done
1604 else
1605   echo "$as_me: failed program was:" >&5
1606 cat conftest.$ac_ext >&5
1607 { { echo "$as_me:1607: error: cannot compute OBJEXT: cannot compile" >&5
1608 echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;}
1609    { (exit 1); exit 1; }; }
1610 fi
1611
1612 rm -f conftest.$ac_cv_objext conftest.$ac_ext
1613 fi
1614 echo "$as_me:1614: result: $ac_cv_objext" >&5
1615 echo "${ECHO_T}$ac_cv_objext" >&6
1616 OBJEXT=$ac_cv_objext
1617 ac_objext=$OBJEXT
1618 echo "$as_me:1618: checking whether we are using the GNU C compiler" >&5
1619 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
1620 if test "${ac_cv_c_compiler_gnu+set}" = set; then
1621   echo $ECHO_N "(cached) $ECHO_C" >&6
1622 else
1623   cat >conftest.$ac_ext <<_ACEOF
1624 #line 1624 "configure"
1625 #include "confdefs.h"
1626
1627 int
1628 main ()
1629 {
1630 #ifndef __GNUC__
1631        choke me
1632 #endif
1633
1634   ;
1635   return 0;
1636 }
1637 _ACEOF
1638 rm -f conftest.$ac_objext
1639 if { (eval echo "$as_me:1639: \"$ac_compile\"") >&5
1640   (eval $ac_compile) 2>&5
1641   ac_status=$?
1642   echo "$as_me:1642: \$? = $ac_status" >&5
1643   (exit $ac_status); } &&
1644          { ac_try='test -s conftest.$ac_objext'
1645   { (eval echo "$as_me:1645: \"$ac_try\"") >&5
1646   (eval $ac_try) 2>&5
1647   ac_status=$?
1648   echo "$as_me:1648: \$? = $ac_status" >&5
1649   (exit $ac_status); }; }; then
1650   ac_compiler_gnu=yes
1651 else
1652   echo "$as_me: failed program was:" >&5
1653 cat conftest.$ac_ext >&5
1654 ac_compiler_gnu=no
1655 fi
1656 rm -f conftest.$ac_objext conftest.$ac_ext
1657 ac_cv_c_compiler_gnu=$ac_compiler_gnu
1658
1659 fi
1660 echo "$as_me:1660: result: $ac_cv_c_compiler_gnu" >&5
1661 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
1662 GCC=`test $ac_compiler_gnu = yes && echo yes`
1663 ac_test_CFLAGS=${CFLAGS+set}
1664 ac_save_CFLAGS=$CFLAGS
1665 CFLAGS="-g"
1666 echo "$as_me:1666: checking whether $CC accepts -g" >&5
1667 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
1668 if test "${ac_cv_prog_cc_g+set}" = set; then
1669   echo $ECHO_N "(cached) $ECHO_C" >&6
1670 else
1671   cat >conftest.$ac_ext <<_ACEOF
1672 #line 1672 "configure"
1673 #include "confdefs.h"
1674
1675 int
1676 main ()
1677 {
1678
1679   ;
1680   return 0;
1681 }
1682 _ACEOF
1683 rm -f conftest.$ac_objext
1684 if { (eval echo "$as_me:1684: \"$ac_compile\"") >&5
1685   (eval $ac_compile) 2>&5
1686   ac_status=$?
1687   echo "$as_me:1687: \$? = $ac_status" >&5
1688   (exit $ac_status); } &&
1689          { ac_try='test -s conftest.$ac_objext'
1690   { (eval echo "$as_me:1690: \"$ac_try\"") >&5
1691   (eval $ac_try) 2>&5
1692   ac_status=$?
1693   echo "$as_me:1693: \$? = $ac_status" >&5
1694   (exit $ac_status); }; }; then
1695   ac_cv_prog_cc_g=yes
1696 else
1697   echo "$as_me: failed program was:" >&5
1698 cat conftest.$ac_ext >&5
1699 ac_cv_prog_cc_g=no
1700 fi
1701 rm -f conftest.$ac_objext conftest.$ac_ext
1702 fi
1703 echo "$as_me:1703: result: $ac_cv_prog_cc_g" >&5
1704 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
1705 if test "$ac_test_CFLAGS" = set; then
1706   CFLAGS=$ac_save_CFLAGS
1707 elif test $ac_cv_prog_cc_g = yes; then
1708   if test "$GCC" = yes; then
1709     CFLAGS="-g -O2"
1710   else
1711     CFLAGS="-g"
1712   fi
1713 else
1714   if test "$GCC" = yes; then
1715     CFLAGS="-O2"
1716   else
1717     CFLAGS=
1718   fi
1719 fi
1720 # Some people use a C++ compiler to compile C.  Since we use `exit',
1721 # in C++ we need to declare it.  In case someone uses the same compiler
1722 # for both compiling C and C++ we need to have the C++ compiler decide
1723 # the declaration of exit, since it's the most demanding environment.
1724 cat >conftest.$ac_ext <<_ACEOF
1725 #ifndef __cplusplus
1726   choke me
1727 #endif
1728 _ACEOF
1729 rm -f conftest.$ac_objext
1730 if { (eval echo "$as_me:1730: \"$ac_compile\"") >&5
1731   (eval $ac_compile) 2>&5
1732   ac_status=$?
1733   echo "$as_me:1733: \$? = $ac_status" >&5
1734   (exit $ac_status); } &&
1735          { ac_try='test -s conftest.$ac_objext'
1736   { (eval echo "$as_me:1736: \"$ac_try\"") >&5
1737   (eval $ac_try) 2>&5
1738   ac_status=$?
1739   echo "$as_me:1739: \$? = $ac_status" >&5
1740   (exit $ac_status); }; }; then
1741   for ac_declaration in \
1742    ''\
1743    '#include <stdlib.h>' \
1744    'extern "C" void std::exit (int) throw (); using std::exit;' \
1745    'extern "C" void std::exit (int); using std::exit;' \
1746    'extern "C" void exit (int) throw ();' \
1747    'extern "C" void exit (int);' \
1748    'void exit (int);'
1749 do
1750   cat >conftest.$ac_ext <<_ACEOF
1751 #line 1751 "configure"
1752 #include "confdefs.h"
1753 #include <stdlib.h>
1754 $ac_declaration
1755 int
1756 main ()
1757 {
1758 exit (42);
1759   ;
1760   return 0;
1761 }
1762 _ACEOF
1763 rm -f conftest.$ac_objext
1764 if { (eval echo "$as_me:1764: \"$ac_compile\"") >&5
1765   (eval $ac_compile) 2>&5
1766   ac_status=$?
1767   echo "$as_me:1767: \$? = $ac_status" >&5
1768   (exit $ac_status); } &&
1769          { ac_try='test -s conftest.$ac_objext'
1770   { (eval echo "$as_me:1770: \"$ac_try\"") >&5
1771   (eval $ac_try) 2>&5
1772   ac_status=$?
1773   echo "$as_me:1773: \$? = $ac_status" >&5
1774   (exit $ac_status); }; }; then
1775   :
1776 else
1777   echo "$as_me: failed program was:" >&5
1778 cat conftest.$ac_ext >&5
1779 continue
1780 fi
1781 rm -f conftest.$ac_objext conftest.$ac_ext
1782   cat >conftest.$ac_ext <<_ACEOF
1783 #line 1783 "configure"
1784 #include "confdefs.h"
1785 $ac_declaration
1786 int
1787 main ()
1788 {
1789 exit (42);
1790   ;
1791   return 0;
1792 }
1793 _ACEOF
1794 rm -f conftest.$ac_objext
1795 if { (eval echo "$as_me:1795: \"$ac_compile\"") >&5
1796   (eval $ac_compile) 2>&5
1797   ac_status=$?
1798   echo "$as_me:1798: \$? = $ac_status" >&5
1799   (exit $ac_status); } &&
1800          { ac_try='test -s conftest.$ac_objext'
1801   { (eval echo "$as_me:1801: \"$ac_try\"") >&5
1802   (eval $ac_try) 2>&5
1803   ac_status=$?
1804   echo "$as_me:1804: \$? = $ac_status" >&5
1805   (exit $ac_status); }; }; then
1806   break
1807 else
1808   echo "$as_me: failed program was:" >&5
1809 cat conftest.$ac_ext >&5
1810 fi
1811 rm -f conftest.$ac_objext conftest.$ac_ext
1812 done
1813 rm -rf conftest*
1814 if test -n "$ac_declaration"; then
1815   echo '#ifdef __cplusplus' >>confdefs.h
1816   echo $ac_declaration      >>confdefs.h
1817   echo '#endif'             >>confdefs.h
1818 fi
1819
1820 else
1821   echo "$as_me: failed program was:" >&5
1822 cat conftest.$ac_ext >&5
1823 fi
1824 rm -f conftest.$ac_objext conftest.$ac_ext
1825 ac_ext=c
1826 ac_cpp='$CPP $CPPFLAGS'
1827 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1828 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1829 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1830 ac_main_return=return
1831
1832 GCC_VERSION=none
1833 if test "$GCC" = yes ; then
1834         echo "$as_me:1834: checking version of $CC" >&5
1835 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
1836         GCC_VERSION="`${CC} --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(GCC[^)]*) //' -e 's/^.*(Debian[^)]*) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`"
1837         test -z "$GCC_VERSION" && GCC_VERSION=unknown
1838         echo "$as_me:1838: result: $GCC_VERSION" >&5
1839 echo "${ECHO_T}$GCC_VERSION" >&6
1840 fi
1841
1842 echo "$as_me:1842: checking for $CC option to accept ANSI C" >&5
1843 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
1844 if test "${ac_cv_prog_cc_stdc+set}" = set; then
1845   echo $ECHO_N "(cached) $ECHO_C" >&6
1846 else
1847   ac_cv_prog_cc_stdc=no
1848 ac_save_CC=$CC
1849 cat >conftest.$ac_ext <<_ACEOF
1850 #line 1850 "configure"
1851 #include "confdefs.h"
1852 #include <stdarg.h>
1853 #include <stdio.h>
1854 #include <sys/types.h>
1855 #include <sys/stat.h>
1856 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
1857 struct buf { int x; };
1858 FILE * (*rcsopen) (struct buf *, struct stat *, int);
1859 static char *e (p, i)
1860      char **p;
1861      int i;
1862 {
1863   return p[i];
1864 }
1865 static char *f (char * (*g) (char **, int), char **p, ...)
1866 {
1867   char *s;
1868   va_list v;
1869   va_start (v,p);
1870   s = g (p, va_arg (v,int));
1871   va_end (v);
1872   return s;
1873 }
1874 int test (int i, double x);
1875 struct s1 {int (*f) (int a);};
1876 struct s2 {int (*f) (double a);};
1877 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
1878 int argc;
1879 char **argv;
1880 int
1881 main ()
1882 {
1883 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
1884   ;
1885   return 0;
1886 }
1887 _ACEOF
1888 # Don't try gcc -ansi; that turns off useful extensions and
1889 # breaks some systems' header files.
1890 # AIX                   -qlanglvl=ansi
1891 # Ultrix and OSF/1      -std1
1892 # HP-UX 10.20 and later -Ae
1893 # HP-UX older versions  -Aa -D_HPUX_SOURCE
1894 # SVR4                  -Xc -D__EXTENSIONS__
1895 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
1896 do
1897   CC="$ac_save_CC $ac_arg"
1898   rm -f conftest.$ac_objext
1899 if { (eval echo "$as_me:1899: \"$ac_compile\"") >&5
1900   (eval $ac_compile) 2>&5
1901   ac_status=$?
1902   echo "$as_me:1902: \$? = $ac_status" >&5
1903   (exit $ac_status); } &&
1904          { ac_try='test -s conftest.$ac_objext'
1905   { (eval echo "$as_me:1905: \"$ac_try\"") >&5
1906   (eval $ac_try) 2>&5
1907   ac_status=$?
1908   echo "$as_me:1908: \$? = $ac_status" >&5
1909   (exit $ac_status); }; }; then
1910   ac_cv_prog_cc_stdc=$ac_arg
1911 break
1912 else
1913   echo "$as_me: failed program was:" >&5
1914 cat conftest.$ac_ext >&5
1915 fi
1916 rm -f conftest.$ac_objext
1917 done
1918 rm -f conftest.$ac_ext conftest.$ac_objext
1919 CC=$ac_save_CC
1920
1921 fi
1922
1923 case "x$ac_cv_prog_cc_stdc" in
1924   x|xno)
1925     echo "$as_me:1925: result: none needed" >&5
1926 echo "${ECHO_T}none needed" >&6 ;;
1927   *)
1928     echo "$as_me:1928: result: $ac_cv_prog_cc_stdc" >&5
1929 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
1930     CC="$CC $ac_cv_prog_cc_stdc" ;;
1931 esac
1932
1933 # This should have been defined by AC_PROG_CC
1934 : ${CC:=cc}
1935
1936 echo "$as_me:1936: checking \$CC variable" >&5
1937 echo $ECHO_N "checking \$CC variable... $ECHO_C" >&6
1938 case "$CC" in
1939 (*[\ \  ]-[IUD]*)
1940         echo "$as_me:1940: result: broken" >&5
1941 echo "${ECHO_T}broken" >&6
1942         { echo "$as_me:1942: WARNING: your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options" >&5
1943 echo "$as_me: WARNING: your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options" >&2;}
1944         # humor him...
1945         cf_flags=`echo "$CC" | sed -e 's/^[^    ]*[     ]//'`
1946         CC=`echo "$CC" | sed -e 's/[    ].*//'`
1947
1948 cf_fix_cppflags=no
1949 cf_new_cflags=
1950 cf_new_cppflags=
1951 cf_new_extra_cppflags=
1952
1953 for cf_add_cflags in $cf_flags
1954 do
1955 case $cf_fix_cppflags in
1956 (no)
1957         case $cf_add_cflags in
1958         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
1959                 case $cf_add_cflags in
1960                 (-D*)
1961                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
1962
1963                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
1964                                 && test -z "${cf_tst_cflags}" \
1965                                 && cf_fix_cppflags=yes
1966
1967                         if test $cf_fix_cppflags = yes ; then
1968                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
1969                                 continue
1970                         elif test "${cf_tst_cflags}" = "\"'" ; then
1971                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
1972                                 continue
1973                         fi
1974                         ;;
1975                 esac
1976                 case "$CPPFLAGS" in
1977                 (*$cf_add_cflags)
1978                         ;;
1979                 (*)
1980                         case $cf_add_cflags in
1981                         (-D*)
1982                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
1983
1984 CPPFLAGS=`echo "$CPPFLAGS" | \
1985         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
1986                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
1987
1988                                 ;;
1989                         esac
1990                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
1991                         ;;
1992                 esac
1993                 ;;
1994         (*)
1995                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
1996                 ;;
1997         esac
1998         ;;
1999 (yes)
2000         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
2001
2002         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
2003
2004         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2005                 && test -z "${cf_tst_cflags}" \
2006                 && cf_fix_cppflags=no
2007         ;;
2008 esac
2009 done
2010
2011 if test -n "$cf_new_cflags" ; then
2012
2013         CFLAGS="$CFLAGS $cf_new_cflags"
2014 fi
2015
2016 if test -n "$cf_new_cppflags" ; then
2017
2018         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
2019 fi
2020
2021 if test -n "$cf_new_extra_cppflags" ; then
2022
2023         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
2024 fi
2025
2026         ;;
2027 (*)
2028         echo "$as_me:2028: result: ok" >&5
2029 echo "${ECHO_T}ok" >&6
2030         ;;
2031 esac
2032
2033 ac_ext=c
2034 ac_cpp='$CPP $CPPFLAGS'
2035 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2036 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2037 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2038 ac_main_return=return
2039 echo "$as_me:2039: checking how to run the C preprocessor" >&5
2040 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
2041 # On Suns, sometimes $CPP names a directory.
2042 if test -n "$CPP" && test -d "$CPP"; then
2043   CPP=
2044 fi
2045 if test -z "$CPP"; then
2046   if test "${ac_cv_prog_CPP+set}" = set; then
2047   echo $ECHO_N "(cached) $ECHO_C" >&6
2048 else
2049       # Double quotes because CPP needs to be expanded
2050     for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
2051     do
2052       ac_preproc_ok=false
2053 for ac_c_preproc_warn_flag in '' yes
2054 do
2055   # Use a header file that comes with gcc, so configuring glibc
2056   # with a fresh cross-compiler works.
2057   # On the NeXT, cc -E runs the code through the compiler's parser,
2058   # not just through cpp. "Syntax error" is here to catch this case.
2059   cat >conftest.$ac_ext <<_ACEOF
2060 #line 2060 "configure"
2061 #include "confdefs.h"
2062 #include <assert.h>
2063                      Syntax error
2064 _ACEOF
2065 if { (eval echo "$as_me:2065: \"$ac_cpp conftest.$ac_ext\"") >&5
2066   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2067   ac_status=$?
2068   egrep -v '^ *\+' conftest.er1 >conftest.err
2069   rm -f conftest.er1
2070   cat conftest.err >&5
2071   echo "$as_me:2071: \$? = $ac_status" >&5
2072   (exit $ac_status); } >/dev/null; then
2073   if test -s conftest.err; then
2074     ac_cpp_err=$ac_c_preproc_warn_flag
2075   else
2076     ac_cpp_err=
2077   fi
2078 else
2079   ac_cpp_err=yes
2080 fi
2081 if test -z "$ac_cpp_err"; then
2082   :
2083 else
2084   echo "$as_me: failed program was:" >&5
2085   cat conftest.$ac_ext >&5
2086   # Broken: fails on valid input.
2087 continue
2088 fi
2089 rm -f conftest.err conftest.$ac_ext
2090
2091   # OK, works on sane cases.  Now check whether non-existent headers
2092   # can be detected and how.
2093   cat >conftest.$ac_ext <<_ACEOF
2094 #line 2094 "configure"
2095 #include "confdefs.h"
2096 #include <ac_nonexistent.h>
2097 _ACEOF
2098 if { (eval echo "$as_me:2098: \"$ac_cpp conftest.$ac_ext\"") >&5
2099   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2100   ac_status=$?
2101   egrep -v '^ *\+' conftest.er1 >conftest.err
2102   rm -f conftest.er1
2103   cat conftest.err >&5
2104   echo "$as_me:2104: \$? = $ac_status" >&5
2105   (exit $ac_status); } >/dev/null; then
2106   if test -s conftest.err; then
2107     ac_cpp_err=$ac_c_preproc_warn_flag
2108   else
2109     ac_cpp_err=
2110   fi
2111 else
2112   ac_cpp_err=yes
2113 fi
2114 if test -z "$ac_cpp_err"; then
2115   # Broken: success on invalid input.
2116 continue
2117 else
2118   echo "$as_me: failed program was:" >&5
2119   cat conftest.$ac_ext >&5
2120   # Passes both tests.
2121 ac_preproc_ok=:
2122 break
2123 fi
2124 rm -f conftest.err conftest.$ac_ext
2125
2126 done
2127 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2128 rm -f conftest.err conftest.$ac_ext
2129 if $ac_preproc_ok; then
2130   break
2131 fi
2132
2133     done
2134     ac_cv_prog_CPP=$CPP
2135
2136 fi
2137   CPP=$ac_cv_prog_CPP
2138 else
2139   ac_cv_prog_CPP=$CPP
2140 fi
2141 echo "$as_me:2141: result: $CPP" >&5
2142 echo "${ECHO_T}$CPP" >&6
2143 ac_preproc_ok=false
2144 for ac_c_preproc_warn_flag in '' yes
2145 do
2146   # Use a header file that comes with gcc, so configuring glibc
2147   # with a fresh cross-compiler works.
2148   # On the NeXT, cc -E runs the code through the compiler's parser,
2149   # not just through cpp. "Syntax error" is here to catch this case.
2150   cat >conftest.$ac_ext <<_ACEOF
2151 #line 2151 "configure"
2152 #include "confdefs.h"
2153 #include <assert.h>
2154                      Syntax error
2155 _ACEOF
2156 if { (eval echo "$as_me:2156: \"$ac_cpp conftest.$ac_ext\"") >&5
2157   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2158   ac_status=$?
2159   egrep -v '^ *\+' conftest.er1 >conftest.err
2160   rm -f conftest.er1
2161   cat conftest.err >&5
2162   echo "$as_me:2162: \$? = $ac_status" >&5
2163   (exit $ac_status); } >/dev/null; then
2164   if test -s conftest.err; then
2165     ac_cpp_err=$ac_c_preproc_warn_flag
2166   else
2167     ac_cpp_err=
2168   fi
2169 else
2170   ac_cpp_err=yes
2171 fi
2172 if test -z "$ac_cpp_err"; then
2173   :
2174 else
2175   echo "$as_me: failed program was:" >&5
2176   cat conftest.$ac_ext >&5
2177   # Broken: fails on valid input.
2178 continue
2179 fi
2180 rm -f conftest.err conftest.$ac_ext
2181
2182   # OK, works on sane cases.  Now check whether non-existent headers
2183   # can be detected and how.
2184   cat >conftest.$ac_ext <<_ACEOF
2185 #line 2185 "configure"
2186 #include "confdefs.h"
2187 #include <ac_nonexistent.h>
2188 _ACEOF
2189 if { (eval echo "$as_me:2189: \"$ac_cpp conftest.$ac_ext\"") >&5
2190   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2191   ac_status=$?
2192   egrep -v '^ *\+' conftest.er1 >conftest.err
2193   rm -f conftest.er1
2194   cat conftest.err >&5
2195   echo "$as_me:2195: \$? = $ac_status" >&5
2196   (exit $ac_status); } >/dev/null; then
2197   if test -s conftest.err; then
2198     ac_cpp_err=$ac_c_preproc_warn_flag
2199   else
2200     ac_cpp_err=
2201   fi
2202 else
2203   ac_cpp_err=yes
2204 fi
2205 if test -z "$ac_cpp_err"; then
2206   # Broken: success on invalid input.
2207 continue
2208 else
2209   echo "$as_me: failed program was:" >&5
2210   cat conftest.$ac_ext >&5
2211   # Passes both tests.
2212 ac_preproc_ok=:
2213 break
2214 fi
2215 rm -f conftest.err conftest.$ac_ext
2216
2217 done
2218 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2219 rm -f conftest.err conftest.$ac_ext
2220 if $ac_preproc_ok; then
2221   :
2222 else
2223   { { echo "$as_me:2223: error: C preprocessor \"$CPP\" fails sanity check" >&5
2224 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;}
2225    { (exit 1); exit 1; }; }
2226 fi
2227
2228 ac_ext=c
2229 ac_cpp='$CPP $CPPFLAGS'
2230 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2231 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2232 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2233 ac_main_return=return
2234
2235 for ac_prog in mawk gawk nawk awk
2236 do
2237   # Extract the first word of "$ac_prog", so it can be a program name with args.
2238 set dummy $ac_prog; ac_word=$2
2239 echo "$as_me:2239: checking for $ac_word" >&5
2240 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2241 if test "${ac_cv_prog_AWK+set}" = set; then
2242   echo $ECHO_N "(cached) $ECHO_C" >&6
2243 else
2244   if test -n "$AWK"; then
2245   ac_cv_prog_AWK="$AWK" # Let the user override the test.
2246 else
2247   ac_save_IFS=$IFS; IFS=$ac_path_separator
2248 ac_dummy="$PATH"
2249 for ac_dir in $ac_dummy; do
2250   IFS=$ac_save_IFS
2251   test -z "$ac_dir" && ac_dir=.
2252   $as_executable_p "$ac_dir/$ac_word" || continue
2253 ac_cv_prog_AWK="$ac_prog"
2254 echo "$as_me:2254: found $ac_dir/$ac_word" >&5
2255 break
2256 done
2257
2258 fi
2259 fi
2260 AWK=$ac_cv_prog_AWK
2261 if test -n "$AWK"; then
2262   echo "$as_me:2262: result: $AWK" >&5
2263 echo "${ECHO_T}$AWK" >&6
2264 else
2265   echo "$as_me:2265: result: no" >&5
2266 echo "${ECHO_T}no" >&6
2267 fi
2268
2269   test -n "$AWK" && break
2270 done
2271
2272 # Find a good install program.  We prefer a C program (faster),
2273 # so one script is as good as another.  But avoid the broken or
2274 # incompatible versions:
2275 # SysV /etc/install, /usr/sbin/install
2276 # SunOS /usr/etc/install
2277 # IRIX /sbin/install
2278 # AIX /bin/install
2279 # AmigaOS /C/install, which installs bootblocks on floppy discs
2280 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2281 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2282 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2283 # ./install, which can be erroneously created by make from ./install.sh.
2284 echo "$as_me:2284: checking for a BSD compatible install" >&5
2285 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
2286 if test -z "$INSTALL"; then
2287 if test "${ac_cv_path_install+set}" = set; then
2288   echo $ECHO_N "(cached) $ECHO_C" >&6
2289 else
2290     ac_save_IFS=$IFS; IFS=$ac_path_separator
2291   for ac_dir in $PATH; do
2292     IFS=$ac_save_IFS
2293     # Account for people who put trailing slashes in PATH elements.
2294     case $ac_dir/ in
2295     / | ./ | .// | /cC/* \
2296     | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
2297     | /usr/ucb/* ) ;;
2298     *)
2299       # OSF1 and SCO ODT 3.0 have their own names for install.
2300       # Don't use installbsd from OSF since it installs stuff as root
2301       # by default.
2302       for ac_prog in ginstall scoinst install; do
2303         if $as_executable_p "$ac_dir/$ac_prog"; then
2304           if test $ac_prog = install &&
2305             grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2306             # AIX install.  It has an incompatible calling convention.
2307             :
2308           elif test $ac_prog = install &&
2309             grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2310             # program-specific install script used by HP pwplus--don't use.
2311             :
2312           else
2313             ac_cv_path_install="$ac_dir/$ac_prog -c"
2314             break 2
2315           fi
2316         fi
2317       done
2318       ;;
2319     esac
2320   done
2321
2322 fi
2323   if test "${ac_cv_path_install+set}" = set; then
2324     INSTALL=$ac_cv_path_install
2325   else
2326     # As a last resort, use the slow shell script.  We don't cache a
2327     # path for INSTALL within a source directory, because that will
2328     # break other packages using the cache if that directory is
2329     # removed, or if the path is relative.
2330     INSTALL=$ac_install_sh
2331   fi
2332 fi
2333 echo "$as_me:2333: result: $INSTALL" >&5
2334 echo "${ECHO_T}$INSTALL" >&6
2335
2336 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2337 # It thinks the first close brace ends the variable substitution.
2338 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2339
2340 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2341
2342 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2343
2344 case $INSTALL in
2345 (/*)
2346         ;;
2347 (*)
2348         cf_dir=`echo $INSTALL | sed -e 's%/[^/]*$%%'`
2349         test -z "$cf_dir" && cf_dir=.
2350         INSTALL=`cd $cf_dir && pwd`/`echo $INSTALL | sed -e 's%^.*/%%'`
2351         ;;
2352 esac
2353
2354 for ac_prog in tdlint lint alint splint lclint
2355 do
2356   # Extract the first word of "$ac_prog", so it can be a program name with args.
2357 set dummy $ac_prog; ac_word=$2
2358 echo "$as_me:2358: checking for $ac_word" >&5
2359 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2360 if test "${ac_cv_prog_LINT+set}" = set; then
2361   echo $ECHO_N "(cached) $ECHO_C" >&6
2362 else
2363   if test -n "$LINT"; then
2364   ac_cv_prog_LINT="$LINT" # Let the user override the test.
2365 else
2366   ac_save_IFS=$IFS; IFS=$ac_path_separator
2367 ac_dummy="$PATH"
2368 for ac_dir in $ac_dummy; do
2369   IFS=$ac_save_IFS
2370   test -z "$ac_dir" && ac_dir=.
2371   $as_executable_p "$ac_dir/$ac_word" || continue
2372 ac_cv_prog_LINT="$ac_prog"
2373 echo "$as_me:2373: found $ac_dir/$ac_word" >&5
2374 break
2375 done
2376
2377 fi
2378 fi
2379 LINT=$ac_cv_prog_LINT
2380 if test -n "$LINT"; then
2381   echo "$as_me:2381: result: $LINT" >&5
2382 echo "${ECHO_T}$LINT" >&6
2383 else
2384   echo "$as_me:2384: result: no" >&5
2385 echo "${ECHO_T}no" >&6
2386 fi
2387
2388   test -n "$LINT" && break
2389 done
2390
2391 echo "$as_me:2391: checking if filesystem supports mixed-case filenames" >&5
2392 echo $ECHO_N "checking if filesystem supports mixed-case filenames... $ECHO_C" >&6
2393 if test "${cf_cv_mixedcase+set}" = set; then
2394   echo $ECHO_N "(cached) $ECHO_C" >&6
2395 else
2396
2397 if test "$cross_compiling" = yes ; then
2398         case $target_alias in
2399         (*-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw*|*-uwin*)
2400                 cf_cv_mixedcase=no
2401                 ;;
2402         (*)
2403                 cf_cv_mixedcase=yes
2404                 ;;
2405         esac
2406 else
2407         rm -f conftest CONFTEST
2408         echo test >conftest
2409         if test -f CONFTEST ; then
2410                 cf_cv_mixedcase=no
2411         else
2412                 cf_cv_mixedcase=yes
2413         fi
2414         rm -f conftest CONFTEST
2415 fi
2416
2417 fi
2418 echo "$as_me:2418: result: $cf_cv_mixedcase" >&5
2419 echo "${ECHO_T}$cf_cv_mixedcase" >&6
2420 test "$cf_cv_mixedcase" = yes &&
2421 cat >>confdefs.h <<\EOF
2422 #define MIXEDCASE_FILENAMES 1
2423 EOF
2424
2425 for ac_prog in exctags ctags
2426 do
2427   # Extract the first word of "$ac_prog", so it can be a program name with args.
2428 set dummy $ac_prog; ac_word=$2
2429 echo "$as_me:2429: checking for $ac_word" >&5
2430 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2431 if test "${ac_cv_prog_CTAGS+set}" = set; then
2432   echo $ECHO_N "(cached) $ECHO_C" >&6
2433 else
2434   if test -n "$CTAGS"; then
2435   ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test.
2436 else
2437   ac_save_IFS=$IFS; IFS=$ac_path_separator
2438 ac_dummy="$PATH"
2439 for ac_dir in $ac_dummy; do
2440   IFS=$ac_save_IFS
2441   test -z "$ac_dir" && ac_dir=.
2442   $as_executable_p "$ac_dir/$ac_word" || continue
2443 ac_cv_prog_CTAGS="$ac_prog"
2444 echo "$as_me:2444: found $ac_dir/$ac_word" >&5
2445 break
2446 done
2447
2448 fi
2449 fi
2450 CTAGS=$ac_cv_prog_CTAGS
2451 if test -n "$CTAGS"; then
2452   echo "$as_me:2452: result: $CTAGS" >&5
2453 echo "${ECHO_T}$CTAGS" >&6
2454 else
2455   echo "$as_me:2455: result: no" >&5
2456 echo "${ECHO_T}no" >&6
2457 fi
2458
2459   test -n "$CTAGS" && break
2460 done
2461
2462 for ac_prog in exetags etags
2463 do
2464   # Extract the first word of "$ac_prog", so it can be a program name with args.
2465 set dummy $ac_prog; ac_word=$2
2466 echo "$as_me:2466: checking for $ac_word" >&5
2467 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2468 if test "${ac_cv_prog_ETAGS+set}" = set; then
2469   echo $ECHO_N "(cached) $ECHO_C" >&6
2470 else
2471   if test -n "$ETAGS"; then
2472   ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test.
2473 else
2474   ac_save_IFS=$IFS; IFS=$ac_path_separator
2475 ac_dummy="$PATH"
2476 for ac_dir in $ac_dummy; do
2477   IFS=$ac_save_IFS
2478   test -z "$ac_dir" && ac_dir=.
2479   $as_executable_p "$ac_dir/$ac_word" || continue
2480 ac_cv_prog_ETAGS="$ac_prog"
2481 echo "$as_me:2481: found $ac_dir/$ac_word" >&5
2482 break
2483 done
2484
2485 fi
2486 fi
2487 ETAGS=$ac_cv_prog_ETAGS
2488 if test -n "$ETAGS"; then
2489   echo "$as_me:2489: result: $ETAGS" >&5
2490 echo "${ECHO_T}$ETAGS" >&6
2491 else
2492   echo "$as_me:2492: result: no" >&5
2493 echo "${ECHO_T}no" >&6
2494 fi
2495
2496   test -n "$ETAGS" && break
2497 done
2498
2499 # Extract the first word of "${CTAGS:-ctags}", so it can be a program name with args.
2500 set dummy ${CTAGS:-ctags}; ac_word=$2
2501 echo "$as_me:2501: checking for $ac_word" >&5
2502 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2503 if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" = set; then
2504   echo $ECHO_N "(cached) $ECHO_C" >&6
2505 else
2506   if test -n "$MAKE_LOWER_TAGS"; then
2507   ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test.
2508 else
2509   ac_save_IFS=$IFS; IFS=$ac_path_separator
2510 ac_dummy="$PATH"
2511 for ac_dir in $ac_dummy; do
2512   IFS=$ac_save_IFS
2513   test -z "$ac_dir" && ac_dir=.
2514   $as_executable_p "$ac_dir/$ac_word" || continue
2515 ac_cv_prog_MAKE_LOWER_TAGS="yes"
2516 echo "$as_me:2516: found $ac_dir/$ac_word" >&5
2517 break
2518 done
2519
2520   test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no"
2521 fi
2522 fi
2523 MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS
2524 if test -n "$MAKE_LOWER_TAGS"; then
2525   echo "$as_me:2525: result: $MAKE_LOWER_TAGS" >&5
2526 echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6
2527 else
2528   echo "$as_me:2528: result: no" >&5
2529 echo "${ECHO_T}no" >&6
2530 fi
2531
2532 if test "$cf_cv_mixedcase" = yes ; then
2533         # Extract the first word of "${ETAGS:-etags}", so it can be a program name with args.
2534 set dummy ${ETAGS:-etags}; ac_word=$2
2535 echo "$as_me:2535: checking for $ac_word" >&5
2536 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2537 if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" = set; then
2538   echo $ECHO_N "(cached) $ECHO_C" >&6
2539 else
2540   if test -n "$MAKE_UPPER_TAGS"; then
2541   ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test.
2542 else
2543   ac_save_IFS=$IFS; IFS=$ac_path_separator
2544 ac_dummy="$PATH"
2545 for ac_dir in $ac_dummy; do
2546   IFS=$ac_save_IFS
2547   test -z "$ac_dir" && ac_dir=.
2548   $as_executable_p "$ac_dir/$ac_word" || continue
2549 ac_cv_prog_MAKE_UPPER_TAGS="yes"
2550 echo "$as_me:2550: found $ac_dir/$ac_word" >&5
2551 break
2552 done
2553
2554   test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no"
2555 fi
2556 fi
2557 MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS
2558 if test -n "$MAKE_UPPER_TAGS"; then
2559   echo "$as_me:2559: result: $MAKE_UPPER_TAGS" >&5
2560 echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6
2561 else
2562   echo "$as_me:2562: result: no" >&5
2563 echo "${ECHO_T}no" >&6
2564 fi
2565
2566 else
2567         MAKE_UPPER_TAGS=no
2568 fi
2569
2570 if test "$MAKE_UPPER_TAGS" = yes ; then
2571         MAKE_UPPER_TAGS=
2572 else
2573         MAKE_UPPER_TAGS="#"
2574 fi
2575
2576 if test "$MAKE_LOWER_TAGS" = yes ; then
2577         MAKE_LOWER_TAGS=
2578 else
2579         MAKE_LOWER_TAGS="#"
2580 fi
2581
2582 echo "$as_me:2582: checking if -lm needed for math functions" >&5
2583 echo $ECHO_N "checking if -lm needed for math functions... $ECHO_C" >&6
2584 if test "${cf_cv_need_libm+set}" = set; then
2585   echo $ECHO_N "(cached) $ECHO_C" >&6
2586 else
2587
2588         cat >conftest.$ac_ext <<_ACEOF
2589 #line 2589 "configure"
2590 #include "confdefs.h"
2591
2592         #include <stdio.h>
2593         #include <math.h>
2594
2595 int
2596 main ()
2597 {
2598 double x = rand(); printf("result = %g\n", pow(sin(x),x))
2599   ;
2600   return 0;
2601 }
2602 _ACEOF
2603 rm -f conftest.$ac_objext conftest$ac_exeext
2604 if { (eval echo "$as_me:2604: \"$ac_link\"") >&5
2605   (eval $ac_link) 2>&5
2606   ac_status=$?
2607   echo "$as_me:2607: \$? = $ac_status" >&5
2608   (exit $ac_status); } &&
2609          { ac_try='test -s conftest$ac_exeext'
2610   { (eval echo "$as_me:2610: \"$ac_try\"") >&5
2611   (eval $ac_try) 2>&5
2612   ac_status=$?
2613   echo "$as_me:2613: \$? = $ac_status" >&5
2614   (exit $ac_status); }; }; then
2615   cf_cv_need_libm=no
2616 else
2617   echo "$as_me: failed program was:" >&5
2618 cat conftest.$ac_ext >&5
2619 cf_cv_need_libm=yes
2620 fi
2621 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
2622 fi
2623 echo "$as_me:2623: result: $cf_cv_need_libm" >&5
2624 echo "${ECHO_T}$cf_cv_need_libm" >&6
2625 if test "$cf_cv_need_libm" = yes
2626 then
2627 MATH_LIB=-lm
2628 fi
2629
2630 top_builddir=`pwd`
2631
2632 CC_G_OPT="-g"
2633 CC_SHARED_OPTS=unknown
2634 CPPFLAGS="$CPPFLAGS"
2635 DFT_DEP_SUFFIX=""
2636 DFT_OBJ_SUBDIR=`pwd|sed -e's:.*/::'`
2637 DFT_UPR_MODEL="NORMAL"
2638 LD="ld"
2639 LDFLAGS_SHARED=""
2640 LDFLAGS_STATIC=""
2641 LD_MODEL=""
2642 LD_SHARED_OPTS=""
2643 LIBTOOL=""
2644 LIBTOOL_OPTS=""
2645 LIB_CLEAN=""
2646 LIB_COMPILE=""
2647 LIB_LINK='${CC}'
2648 LINK_TESTS=""
2649 LOCAL_LDFLAGS=""
2650 PACKAGE="ncurses-examples"
2651 PTHREAD="-lm"
2652 TEST_ARGS=""
2653 TEST_DEPS=""
2654 TEST_LIBS=""
2655 TINFO_LDFLAGS=''
2656 TINFO_LIBS='$(LIBS_CURSES)'
2657 cf_cv_abi_version=""
2658 cf_cv_rel_version=""
2659 includesubdir=""
2660
2661 cf_cv_screen=curses
2662 cf_cv_libtype=
2663
2664 if test "$GCC" = yes
2665 then
2666 cat > conftest.i <<EOF
2667 #ifndef GCC_PRINTF
2668 #define GCC_PRINTF 0
2669 #endif
2670 #ifndef GCC_SCANF
2671 #define GCC_SCANF 0
2672 #endif
2673 #ifndef GCC_NORETURN
2674 #define GCC_NORETURN /* nothing */
2675 #endif
2676 #ifndef GCC_UNUSED
2677 #define GCC_UNUSED /* nothing */
2678 #endif
2679 EOF
2680 if test "$GCC" = yes
2681 then
2682         { echo "$as_me:2682: checking for $CC __attribute__ directives..." >&5
2683 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
2684 cat > conftest.$ac_ext <<EOF
2685 #line 2685 "${as_me:-configure}"
2686 #include "confdefs.h"
2687 #include "conftest.h"
2688 #include "conftest.i"
2689 #if     GCC_PRINTF
2690 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
2691 #else
2692 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
2693 #endif
2694 #if     GCC_SCANF
2695 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
2696 #else
2697 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
2698 #endif
2699 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
2700 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
2701 extern void foo(void) GCC_NORETURN;
2702 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
2703 EOF
2704         cf_printf_attribute=no
2705         cf_scanf_attribute=no
2706         for cf_attribute in scanf printf unused noreturn
2707         do
2708
2709 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
2710
2711                 cf_directive="__attribute__(($cf_attribute))"
2712                 echo "checking for $CC $cf_directive" 1>&5
2713
2714                 case $cf_attribute in
2715                 (printf)
2716                         cf_printf_attribute=yes
2717                         cat >conftest.h <<EOF
2718 #define GCC_$cf_ATTRIBUTE 1
2719 EOF
2720                         ;;
2721                 (scanf)
2722                         cf_scanf_attribute=yes
2723                         cat >conftest.h <<EOF
2724 #define GCC_$cf_ATTRIBUTE 1
2725 EOF
2726                         ;;
2727                 (*)
2728                         cat >conftest.h <<EOF
2729 #define GCC_$cf_ATTRIBUTE $cf_directive
2730 EOF
2731                         ;;
2732                 esac
2733
2734                 if { (eval echo "$as_me:2734: \"$ac_compile\"") >&5
2735   (eval $ac_compile) 2>&5
2736   ac_status=$?
2737   echo "$as_me:2737: \$? = $ac_status" >&5
2738   (exit $ac_status); }; then
2739                         test -n "$verbose" && echo "$as_me:2739: result: ... $cf_attribute" >&5
2740 echo "${ECHO_T}... $cf_attribute" >&6
2741                         cat conftest.h >>confdefs.h
2742                         case $cf_attribute in
2743                         (noreturn)
2744
2745 cat >>confdefs.h <<EOF
2746 #define GCC_NORETURN $cf_directive
2747 EOF
2748
2749                                 ;;
2750                         (printf)
2751                                 cf_value='/* nothing */'
2752                                 if test "$cf_printf_attribute" != no ; then
2753                                         cf_value='__attribute__((format(printf,fmt,var)))'
2754
2755 cat >>confdefs.h <<\EOF
2756 #define GCC_PRINTF 1
2757 EOF
2758
2759                                 fi
2760
2761 cat >>confdefs.h <<EOF
2762 #define GCC_PRINTFLIKE(fmt,var) $cf_value
2763 EOF
2764
2765                                 ;;
2766                         (scanf)
2767                                 cf_value='/* nothing */'
2768                                 if test "$cf_scanf_attribute" != no ; then
2769                                         cf_value='__attribute__((format(scanf,fmt,var)))'
2770
2771 cat >>confdefs.h <<\EOF
2772 #define GCC_SCANF 1
2773 EOF
2774
2775                                 fi
2776
2777 cat >>confdefs.h <<EOF
2778 #define GCC_SCANFLIKE(fmt,var) $cf_value
2779 EOF
2780
2781                                 ;;
2782                         (unused)
2783
2784 cat >>confdefs.h <<EOF
2785 #define GCC_UNUSED $cf_directive
2786 EOF
2787
2788                                 ;;
2789                         esac
2790                 fi
2791         done
2792 else
2793         fgrep define conftest.i >>confdefs.h
2794 fi
2795 rm -rf conftest*
2796 fi
2797
2798 cf_XOPEN_SOURCE=500
2799 cf_POSIX_C_SOURCE=199506L
2800 cf_xopen_source=
2801
2802 case $host_os in
2803 (aix[4-7]*)
2804         cf_xopen_source="-D_ALL_SOURCE"
2805         ;;
2806 (cygwin|msys)
2807         cf_XOPEN_SOURCE=600
2808         ;;
2809 (darwin[0-8].*)
2810         cf_xopen_source="-D_APPLE_C_SOURCE"
2811         ;;
2812 (darwin*)
2813         cf_xopen_source="-D_DARWIN_C_SOURCE"
2814         cf_XOPEN_SOURCE=
2815         ;;
2816 (freebsd*|dragonfly*)
2817         # 5.x headers associate
2818         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
2819         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
2820         cf_POSIX_C_SOURCE=200112L
2821         cf_XOPEN_SOURCE=600
2822         cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
2823         ;;
2824 (hpux11*)
2825         cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
2826         ;;
2827 (hpux*)
2828         cf_xopen_source="-D_HPUX_SOURCE"
2829         ;;
2830 (irix[56].*)
2831         cf_xopen_source="-D_SGI_SOURCE"
2832         cf_XOPEN_SOURCE=
2833         ;;
2834 (linux*|gnu*|mint*|k*bsd*-gnu)
2835
2836 echo "$as_me:2836: checking if we must define _GNU_SOURCE" >&5
2837 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
2838 if test "${cf_cv_gnu_source+set}" = set; then
2839   echo $ECHO_N "(cached) $ECHO_C" >&6
2840 else
2841
2842 cat >conftest.$ac_ext <<_ACEOF
2843 #line 2843 "configure"
2844 #include "confdefs.h"
2845 #include <sys/types.h>
2846 int
2847 main ()
2848 {
2849
2850 #ifndef _XOPEN_SOURCE
2851 make an error
2852 #endif
2853   ;
2854   return 0;
2855 }
2856 _ACEOF
2857 rm -f conftest.$ac_objext
2858 if { (eval echo "$as_me:2858: \"$ac_compile\"") >&5
2859   (eval $ac_compile) 2>&5
2860   ac_status=$?
2861   echo "$as_me:2861: \$? = $ac_status" >&5
2862   (exit $ac_status); } &&
2863          { ac_try='test -s conftest.$ac_objext'
2864   { (eval echo "$as_me:2864: \"$ac_try\"") >&5
2865   (eval $ac_try) 2>&5
2866   ac_status=$?
2867   echo "$as_me:2867: \$? = $ac_status" >&5
2868   (exit $ac_status); }; }; then
2869   cf_cv_gnu_source=no
2870 else
2871   echo "$as_me: failed program was:" >&5
2872 cat conftest.$ac_ext >&5
2873 cf_save="$CPPFLAGS"
2874          CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
2875          cat >conftest.$ac_ext <<_ACEOF
2876 #line 2876 "configure"
2877 #include "confdefs.h"
2878 #include <sys/types.h>
2879 int
2880 main ()
2881 {
2882
2883 #ifdef _XOPEN_SOURCE
2884 make an error
2885 #endif
2886   ;
2887   return 0;
2888 }
2889 _ACEOF
2890 rm -f conftest.$ac_objext
2891 if { (eval echo "$as_me:2891: \"$ac_compile\"") >&5
2892   (eval $ac_compile) 2>&5
2893   ac_status=$?
2894   echo "$as_me:2894: \$? = $ac_status" >&5
2895   (exit $ac_status); } &&
2896          { ac_try='test -s conftest.$ac_objext'
2897   { (eval echo "$as_me:2897: \"$ac_try\"") >&5
2898   (eval $ac_try) 2>&5
2899   ac_status=$?
2900   echo "$as_me:2900: \$? = $ac_status" >&5
2901   (exit $ac_status); }; }; then
2902   cf_cv_gnu_source=no
2903 else
2904   echo "$as_me: failed program was:" >&5
2905 cat conftest.$ac_ext >&5
2906 cf_cv_gnu_source=yes
2907 fi
2908 rm -f conftest.$ac_objext conftest.$ac_ext
2909         CPPFLAGS="$cf_save"
2910
2911 fi
2912 rm -f conftest.$ac_objext conftest.$ac_ext
2913
2914 fi
2915 echo "$as_me:2915: result: $cf_cv_gnu_source" >&5
2916 echo "${ECHO_T}$cf_cv_gnu_source" >&6
2917 test "$cf_cv_gnu_source" = yes && CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
2918
2919         ;;
2920 (minix*)
2921         cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this...
2922         ;;
2923 (mirbsd*)
2924         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
2925         cf_XOPEN_SOURCE=
2926
2927 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
2928
2929 cf_save_CFLAGS="$CFLAGS"
2930 cf_save_CPPFLAGS="$CPPFLAGS"
2931
2932 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
2933         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
2934                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
2935
2936 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
2937         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
2938                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
2939
2940 echo "$as_me:2940: checking if we should define _POSIX_C_SOURCE" >&5
2941 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
2942 if test "${cf_cv_posix_c_source+set}" = set; then
2943   echo $ECHO_N "(cached) $ECHO_C" >&6
2944 else
2945
2946 echo "${as_me:-configure}:2946: testing if the symbol is already defined go no further ..." 1>&5
2947
2948         cat >conftest.$ac_ext <<_ACEOF
2949 #line 2949 "configure"
2950 #include "confdefs.h"
2951 #include <sys/types.h>
2952 int
2953 main ()
2954 {
2955
2956 #ifndef _POSIX_C_SOURCE
2957 make an error
2958 #endif
2959   ;
2960   return 0;
2961 }
2962 _ACEOF
2963 rm -f conftest.$ac_objext
2964 if { (eval echo "$as_me:2964: \"$ac_compile\"") >&5
2965   (eval $ac_compile) 2>&5
2966   ac_status=$?
2967   echo "$as_me:2967: \$? = $ac_status" >&5
2968   (exit $ac_status); } &&
2969          { ac_try='test -s conftest.$ac_objext'
2970   { (eval echo "$as_me:2970: \"$ac_try\"") >&5
2971   (eval $ac_try) 2>&5
2972   ac_status=$?
2973   echo "$as_me:2973: \$? = $ac_status" >&5
2974   (exit $ac_status); }; }; then
2975   cf_cv_posix_c_source=no
2976 else
2977   echo "$as_me: failed program was:" >&5
2978 cat conftest.$ac_ext >&5
2979 cf_want_posix_source=no
2980          case .$cf_POSIX_C_SOURCE in
2981          (.[12]??*)
2982                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
2983                 ;;
2984          (.2)
2985                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
2986                 cf_want_posix_source=yes
2987                 ;;
2988          (.*)
2989                 cf_want_posix_source=yes
2990                 ;;
2991          esac
2992          if test "$cf_want_posix_source" = yes ; then
2993                 cat >conftest.$ac_ext <<_ACEOF
2994 #line 2994 "configure"
2995 #include "confdefs.h"
2996 #include <sys/types.h>
2997 int
2998 main ()
2999 {
3000
3001 #ifdef _POSIX_SOURCE
3002 make an error
3003 #endif
3004   ;
3005   return 0;
3006 }
3007 _ACEOF
3008 rm -f conftest.$ac_objext
3009 if { (eval echo "$as_me:3009: \"$ac_compile\"") >&5
3010   (eval $ac_compile) 2>&5
3011   ac_status=$?
3012   echo "$as_me:3012: \$? = $ac_status" >&5
3013   (exit $ac_status); } &&
3014          { ac_try='test -s conftest.$ac_objext'
3015   { (eval echo "$as_me:3015: \"$ac_try\"") >&5
3016   (eval $ac_try) 2>&5
3017   ac_status=$?
3018   echo "$as_me:3018: \$? = $ac_status" >&5
3019   (exit $ac_status); }; }; then
3020   :
3021 else
3022   echo "$as_me: failed program was:" >&5
3023 cat conftest.$ac_ext >&5
3024 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
3025 fi
3026 rm -f conftest.$ac_objext conftest.$ac_ext
3027          fi
3028
3029 echo "${as_me:-configure}:3029: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
3030
3031          CFLAGS="$cf_trim_CFLAGS"
3032          CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
3033
3034 echo "${as_me:-configure}:3034: testing if the second compile does not leave our definition intact error ..." 1>&5
3035
3036          cat >conftest.$ac_ext <<_ACEOF
3037 #line 3037 "configure"
3038 #include "confdefs.h"
3039 #include <sys/types.h>
3040 int
3041 main ()
3042 {
3043
3044 #ifndef _POSIX_C_SOURCE
3045 make an error
3046 #endif
3047   ;
3048   return 0;
3049 }
3050 _ACEOF
3051 rm -f conftest.$ac_objext
3052 if { (eval echo "$as_me:3052: \"$ac_compile\"") >&5
3053   (eval $ac_compile) 2>&5
3054   ac_status=$?
3055   echo "$as_me:3055: \$? = $ac_status" >&5
3056   (exit $ac_status); } &&
3057          { ac_try='test -s conftest.$ac_objext'
3058   { (eval echo "$as_me:3058: \"$ac_try\"") >&5
3059   (eval $ac_try) 2>&5
3060   ac_status=$?
3061   echo "$as_me:3061: \$? = $ac_status" >&5
3062   (exit $ac_status); }; }; then
3063   :
3064 else
3065   echo "$as_me: failed program was:" >&5
3066 cat conftest.$ac_ext >&5
3067 cf_cv_posix_c_source=no
3068 fi
3069 rm -f conftest.$ac_objext conftest.$ac_ext
3070          CFLAGS="$cf_save_CFLAGS"
3071          CPPFLAGS="$cf_save_CPPFLAGS"
3072
3073 fi
3074 rm -f conftest.$ac_objext conftest.$ac_ext
3075
3076 fi
3077 echo "$as_me:3077: result: $cf_cv_posix_c_source" >&5
3078 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
3079
3080 if test "$cf_cv_posix_c_source" != no ; then
3081         CFLAGS="$cf_trim_CFLAGS"
3082         CPPFLAGS="$cf_trim_CPPFLAGS"
3083
3084 cf_fix_cppflags=no
3085 cf_new_cflags=
3086 cf_new_cppflags=
3087 cf_new_extra_cppflags=
3088
3089 for cf_add_cflags in $cf_cv_posix_c_source
3090 do
3091 case $cf_fix_cppflags in
3092 (no)
3093         case $cf_add_cflags in
3094         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
3095                 case $cf_add_cflags in
3096                 (-D*)
3097                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3098
3099                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3100                                 && test -z "${cf_tst_cflags}" \
3101                                 && cf_fix_cppflags=yes
3102
3103                         if test $cf_fix_cppflags = yes ; then
3104                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3105                                 continue
3106                         elif test "${cf_tst_cflags}" = "\"'" ; then
3107                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3108                                 continue
3109                         fi
3110                         ;;
3111                 esac
3112                 case "$CPPFLAGS" in
3113                 (*$cf_add_cflags)
3114                         ;;
3115                 (*)
3116                         case $cf_add_cflags in
3117                         (-D*)
3118                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3119
3120 CPPFLAGS=`echo "$CPPFLAGS" | \
3121         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3122                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3123
3124                                 ;;
3125                         esac
3126                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3127                         ;;
3128                 esac
3129                 ;;
3130         (*)
3131                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
3132                 ;;
3133         esac
3134         ;;
3135 (yes)
3136         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3137
3138         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3139
3140         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3141                 && test -z "${cf_tst_cflags}" \
3142                 && cf_fix_cppflags=no
3143         ;;
3144 esac
3145 done
3146
3147 if test -n "$cf_new_cflags" ; then
3148
3149         CFLAGS="$CFLAGS $cf_new_cflags"
3150 fi
3151
3152 if test -n "$cf_new_cppflags" ; then
3153
3154         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
3155 fi
3156
3157 if test -n "$cf_new_extra_cppflags" ; then
3158
3159         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
3160 fi
3161
3162 fi
3163
3164         ;;
3165 (netbsd*)
3166         cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
3167         ;;
3168 (openbsd[4-9]*)
3169         # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
3170         cf_xopen_source="-D_BSD_SOURCE"
3171         cf_XOPEN_SOURCE=600
3172         ;;
3173 (openbsd*)
3174         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
3175         ;;
3176 (os2*)
3177         cf_XOPEN_SOURCE=
3178         ;;
3179 (osf[45]*)
3180         cf_xopen_source="-D_OSF_SOURCE"
3181         ;;
3182 (nto-qnx*)
3183         cf_xopen_source="-D_QNX_SOURCE"
3184         ;;
3185 (sco*)
3186         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
3187         ;;
3188 (solaris2.*)
3189         cf_xopen_source="-D__EXTENSIONS__"
3190         cf_cv_xopen_source=broken
3191         ;;
3192 (sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
3193         cf_XOPEN_SOURCE=
3194         cf_POSIX_C_SOURCE=
3195         ;;
3196 (*)
3197
3198 echo "$as_me:3198: checking if we should define _XOPEN_SOURCE" >&5
3199 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
3200 if test "${cf_cv_xopen_source+set}" = set; then
3201   echo $ECHO_N "(cached) $ECHO_C" >&6
3202 else
3203
3204         cat >conftest.$ac_ext <<_ACEOF
3205 #line 3205 "configure"
3206 #include "confdefs.h"
3207
3208 #include <stdlib.h>
3209 #include <string.h>
3210 #include <sys/types.h>
3211
3212 int
3213 main ()
3214 {
3215
3216 #ifndef _XOPEN_SOURCE
3217 make an error
3218 #endif
3219   ;
3220   return 0;
3221 }
3222 _ACEOF
3223 rm -f conftest.$ac_objext
3224 if { (eval echo "$as_me:3224: \"$ac_compile\"") >&5
3225   (eval $ac_compile) 2>&5
3226   ac_status=$?
3227   echo "$as_me:3227: \$? = $ac_status" >&5
3228   (exit $ac_status); } &&
3229          { ac_try='test -s conftest.$ac_objext'
3230   { (eval echo "$as_me:3230: \"$ac_try\"") >&5
3231   (eval $ac_try) 2>&5
3232   ac_status=$?
3233   echo "$as_me:3233: \$? = $ac_status" >&5
3234   (exit $ac_status); }; }; then
3235   cf_cv_xopen_source=no
3236 else
3237   echo "$as_me: failed program was:" >&5
3238 cat conftest.$ac_ext >&5
3239 cf_save="$CPPFLAGS"
3240          CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
3241          cat >conftest.$ac_ext <<_ACEOF
3242 #line 3242 "configure"
3243 #include "confdefs.h"
3244
3245 #include <stdlib.h>
3246 #include <string.h>
3247 #include <sys/types.h>
3248
3249 int
3250 main ()
3251 {
3252
3253 #ifdef _XOPEN_SOURCE
3254 make an error
3255 #endif
3256   ;
3257   return 0;
3258 }
3259 _ACEOF
3260 rm -f conftest.$ac_objext
3261 if { (eval echo "$as_me:3261: \"$ac_compile\"") >&5
3262   (eval $ac_compile) 2>&5
3263   ac_status=$?
3264   echo "$as_me:3264: \$? = $ac_status" >&5
3265   (exit $ac_status); } &&
3266          { ac_try='test -s conftest.$ac_objext'
3267   { (eval echo "$as_me:3267: \"$ac_try\"") >&5
3268   (eval $ac_try) 2>&5
3269   ac_status=$?
3270   echo "$as_me:3270: \$? = $ac_status" >&5
3271   (exit $ac_status); }; }; then
3272   cf_cv_xopen_source=no
3273 else
3274   echo "$as_me: failed program was:" >&5
3275 cat conftest.$ac_ext >&5
3276 cf_cv_xopen_source=$cf_XOPEN_SOURCE
3277 fi
3278 rm -f conftest.$ac_objext conftest.$ac_ext
3279         CPPFLAGS="$cf_save"
3280
3281 fi
3282 rm -f conftest.$ac_objext conftest.$ac_ext
3283
3284 fi
3285 echo "$as_me:3285: result: $cf_cv_xopen_source" >&5
3286 echo "${ECHO_T}$cf_cv_xopen_source" >&6
3287
3288 if test "$cf_cv_xopen_source" != no ; then
3289
3290 CFLAGS=`echo "$CFLAGS" | \
3291         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
3292                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
3293
3294 CPPFLAGS=`echo "$CPPFLAGS" | \
3295         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
3296                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
3297
3298         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
3299
3300 cf_fix_cppflags=no
3301 cf_new_cflags=
3302 cf_new_cppflags=
3303 cf_new_extra_cppflags=
3304
3305 for cf_add_cflags in $cf_temp_xopen_source
3306 do
3307 case $cf_fix_cppflags in
3308 (no)
3309         case $cf_add_cflags in
3310         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
3311                 case $cf_add_cflags in
3312                 (-D*)
3313                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3314
3315                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3316                                 && test -z "${cf_tst_cflags}" \
3317                                 && cf_fix_cppflags=yes
3318
3319                         if test $cf_fix_cppflags = yes ; then
3320                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3321                                 continue
3322                         elif test "${cf_tst_cflags}" = "\"'" ; then
3323                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3324                                 continue
3325                         fi
3326                         ;;
3327                 esac
3328                 case "$CPPFLAGS" in
3329                 (*$cf_add_cflags)
3330                         ;;
3331                 (*)
3332                         case $cf_add_cflags in
3333                         (-D*)
3334                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3335
3336 CPPFLAGS=`echo "$CPPFLAGS" | \
3337         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3338                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3339
3340                                 ;;
3341                         esac
3342                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3343                         ;;
3344                 esac
3345                 ;;
3346         (*)
3347                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
3348                 ;;
3349         esac
3350         ;;
3351 (yes)
3352         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3353
3354         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3355
3356         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3357                 && test -z "${cf_tst_cflags}" \
3358                 && cf_fix_cppflags=no
3359         ;;
3360 esac
3361 done
3362
3363 if test -n "$cf_new_cflags" ; then
3364
3365         CFLAGS="$CFLAGS $cf_new_cflags"
3366 fi
3367
3368 if test -n "$cf_new_cppflags" ; then
3369
3370         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
3371 fi
3372
3373 if test -n "$cf_new_extra_cppflags" ; then
3374
3375         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
3376 fi
3377
3378 fi
3379
3380 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
3381
3382 cf_save_CFLAGS="$CFLAGS"
3383 cf_save_CPPFLAGS="$CPPFLAGS"
3384
3385 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
3386         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
3387                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
3388
3389 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
3390         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
3391                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
3392
3393 echo "$as_me:3393: checking if we should define _POSIX_C_SOURCE" >&5
3394 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
3395 if test "${cf_cv_posix_c_source+set}" = set; then
3396   echo $ECHO_N "(cached) $ECHO_C" >&6
3397 else
3398
3399 echo "${as_me:-configure}:3399: testing if the symbol is already defined go no further ..." 1>&5
3400
3401         cat >conftest.$ac_ext <<_ACEOF
3402 #line 3402 "configure"
3403 #include "confdefs.h"
3404 #include <sys/types.h>
3405 int
3406 main ()
3407 {
3408
3409 #ifndef _POSIX_C_SOURCE
3410 make an error
3411 #endif
3412   ;
3413   return 0;
3414 }
3415 _ACEOF
3416 rm -f conftest.$ac_objext
3417 if { (eval echo "$as_me:3417: \"$ac_compile\"") >&5
3418   (eval $ac_compile) 2>&5
3419   ac_status=$?
3420   echo "$as_me:3420: \$? = $ac_status" >&5
3421   (exit $ac_status); } &&
3422          { ac_try='test -s conftest.$ac_objext'
3423   { (eval echo "$as_me:3423: \"$ac_try\"") >&5
3424   (eval $ac_try) 2>&5
3425   ac_status=$?
3426   echo "$as_me:3426: \$? = $ac_status" >&5
3427   (exit $ac_status); }; }; then
3428   cf_cv_posix_c_source=no
3429 else
3430   echo "$as_me: failed program was:" >&5
3431 cat conftest.$ac_ext >&5
3432 cf_want_posix_source=no
3433          case .$cf_POSIX_C_SOURCE in
3434          (.[12]??*)
3435                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
3436                 ;;
3437          (.2)
3438                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
3439                 cf_want_posix_source=yes
3440                 ;;
3441          (.*)
3442                 cf_want_posix_source=yes
3443                 ;;
3444          esac
3445          if test "$cf_want_posix_source" = yes ; then
3446                 cat >conftest.$ac_ext <<_ACEOF
3447 #line 3447 "configure"
3448 #include "confdefs.h"
3449 #include <sys/types.h>
3450 int
3451 main ()
3452 {
3453
3454 #ifdef _POSIX_SOURCE
3455 make an error
3456 #endif
3457   ;
3458   return 0;
3459 }
3460 _ACEOF
3461 rm -f conftest.$ac_objext
3462 if { (eval echo "$as_me:3462: \"$ac_compile\"") >&5
3463   (eval $ac_compile) 2>&5
3464   ac_status=$?
3465   echo "$as_me:3465: \$? = $ac_status" >&5
3466   (exit $ac_status); } &&
3467          { ac_try='test -s conftest.$ac_objext'
3468   { (eval echo "$as_me:3468: \"$ac_try\"") >&5
3469   (eval $ac_try) 2>&5
3470   ac_status=$?
3471   echo "$as_me:3471: \$? = $ac_status" >&5
3472   (exit $ac_status); }; }; then
3473   :
3474 else
3475   echo "$as_me: failed program was:" >&5
3476 cat conftest.$ac_ext >&5
3477 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
3478 fi
3479 rm -f conftest.$ac_objext conftest.$ac_ext
3480          fi
3481
3482 echo "${as_me:-configure}:3482: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
3483
3484          CFLAGS="$cf_trim_CFLAGS"
3485          CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
3486
3487 echo "${as_me:-configure}:3487: testing if the second compile does not leave our definition intact error ..." 1>&5
3488
3489          cat >conftest.$ac_ext <<_ACEOF
3490 #line 3490 "configure"
3491 #include "confdefs.h"
3492 #include <sys/types.h>
3493 int
3494 main ()
3495 {
3496
3497 #ifndef _POSIX_C_SOURCE
3498 make an error
3499 #endif
3500   ;
3501   return 0;
3502 }
3503 _ACEOF
3504 rm -f conftest.$ac_objext
3505 if { (eval echo "$as_me:3505: \"$ac_compile\"") >&5
3506   (eval $ac_compile) 2>&5
3507   ac_status=$?
3508   echo "$as_me:3508: \$? = $ac_status" >&5
3509   (exit $ac_status); } &&
3510          { ac_try='test -s conftest.$ac_objext'
3511   { (eval echo "$as_me:3511: \"$ac_try\"") >&5
3512   (eval $ac_try) 2>&5
3513   ac_status=$?
3514   echo "$as_me:3514: \$? = $ac_status" >&5
3515   (exit $ac_status); }; }; then
3516   :
3517 else
3518   echo "$as_me: failed program was:" >&5
3519 cat conftest.$ac_ext >&5
3520 cf_cv_posix_c_source=no
3521 fi
3522 rm -f conftest.$ac_objext conftest.$ac_ext
3523          CFLAGS="$cf_save_CFLAGS"
3524          CPPFLAGS="$cf_save_CPPFLAGS"
3525
3526 fi
3527 rm -f conftest.$ac_objext conftest.$ac_ext
3528
3529 fi
3530 echo "$as_me:3530: result: $cf_cv_posix_c_source" >&5
3531 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
3532
3533 if test "$cf_cv_posix_c_source" != no ; then
3534         CFLAGS="$cf_trim_CFLAGS"
3535         CPPFLAGS="$cf_trim_CPPFLAGS"
3536
3537 cf_fix_cppflags=no
3538 cf_new_cflags=
3539 cf_new_cppflags=
3540 cf_new_extra_cppflags=
3541
3542 for cf_add_cflags in $cf_cv_posix_c_source
3543 do
3544 case $cf_fix_cppflags in
3545 (no)
3546         case $cf_add_cflags in
3547         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
3548                 case $cf_add_cflags in
3549                 (-D*)
3550                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3551
3552                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3553                                 && test -z "${cf_tst_cflags}" \
3554                                 && cf_fix_cppflags=yes
3555
3556                         if test $cf_fix_cppflags = yes ; then
3557                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3558                                 continue
3559                         elif test "${cf_tst_cflags}" = "\"'" ; then
3560                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3561                                 continue
3562                         fi
3563                         ;;
3564                 esac
3565                 case "$CPPFLAGS" in
3566                 (*$cf_add_cflags)
3567                         ;;
3568                 (*)
3569                         case $cf_add_cflags in
3570                         (-D*)
3571                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3572
3573 CPPFLAGS=`echo "$CPPFLAGS" | \
3574         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3575                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3576
3577                                 ;;
3578                         esac
3579                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3580                         ;;
3581                 esac
3582                 ;;
3583         (*)
3584                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
3585                 ;;
3586         esac
3587         ;;
3588 (yes)
3589         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3590
3591         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3592
3593         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3594                 && test -z "${cf_tst_cflags}" \
3595                 && cf_fix_cppflags=no
3596         ;;
3597 esac
3598 done
3599
3600 if test -n "$cf_new_cflags" ; then
3601
3602         CFLAGS="$CFLAGS $cf_new_cflags"
3603 fi
3604
3605 if test -n "$cf_new_cppflags" ; then
3606
3607         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
3608 fi
3609
3610 if test -n "$cf_new_extra_cppflags" ; then
3611
3612         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
3613 fi
3614
3615 fi
3616
3617         ;;
3618 esac
3619
3620 if test -n "$cf_xopen_source" ; then
3621
3622 cf_fix_cppflags=no
3623 cf_new_cflags=
3624 cf_new_cppflags=
3625 cf_new_extra_cppflags=
3626
3627 for cf_add_cflags in $cf_xopen_source
3628 do
3629 case $cf_fix_cppflags in
3630 (no)
3631         case $cf_add_cflags in
3632         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
3633                 case $cf_add_cflags in
3634                 (-D*)
3635                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3636
3637                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3638                                 && test -z "${cf_tst_cflags}" \
3639                                 && cf_fix_cppflags=yes
3640
3641                         if test $cf_fix_cppflags = yes ; then
3642                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3643                                 continue
3644                         elif test "${cf_tst_cflags}" = "\"'" ; then
3645                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3646                                 continue
3647                         fi
3648                         ;;
3649                 esac
3650                 case "$CPPFLAGS" in
3651                 (*$cf_add_cflags)
3652                         ;;
3653                 (*)
3654                         case $cf_add_cflags in
3655                         (-D*)
3656                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3657
3658 CPPFLAGS=`echo "$CPPFLAGS" | \
3659         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3660                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3661
3662                                 ;;
3663                         esac
3664                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3665                         ;;
3666                 esac
3667                 ;;
3668         (*)
3669                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
3670                 ;;
3671         esac
3672         ;;
3673 (yes)
3674         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3675
3676         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3677
3678         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3679                 && test -z "${cf_tst_cflags}" \
3680                 && cf_fix_cppflags=no
3681         ;;
3682 esac
3683 done
3684
3685 if test -n "$cf_new_cflags" ; then
3686         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
3687
3688 echo "${as_me:-configure}:3688: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
3689
3690         CFLAGS="$CFLAGS $cf_new_cflags"
3691 fi
3692
3693 if test -n "$cf_new_cppflags" ; then
3694         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
3695
3696 echo "${as_me:-configure}:3696: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
3697
3698         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
3699 fi
3700
3701 if test -n "$cf_new_extra_cppflags" ; then
3702         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
3703
3704 echo "${as_me:-configure}:3704: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
3705
3706         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
3707 fi
3708
3709 fi
3710
3711 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
3712         echo "$as_me:3712: checking if _XOPEN_SOURCE really is set" >&5
3713 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
3714         cat >conftest.$ac_ext <<_ACEOF
3715 #line 3715 "configure"
3716 #include "confdefs.h"
3717 #include <stdlib.h>
3718 int
3719 main ()
3720 {
3721
3722 #ifndef _XOPEN_SOURCE
3723 make an error
3724 #endif
3725   ;
3726   return 0;
3727 }
3728 _ACEOF
3729 rm -f conftest.$ac_objext
3730 if { (eval echo "$as_me:3730: \"$ac_compile\"") >&5
3731   (eval $ac_compile) 2>&5
3732   ac_status=$?
3733   echo "$as_me:3733: \$? = $ac_status" >&5
3734   (exit $ac_status); } &&
3735          { ac_try='test -s conftest.$ac_objext'
3736   { (eval echo "$as_me:3736: \"$ac_try\"") >&5
3737   (eval $ac_try) 2>&5
3738   ac_status=$?
3739   echo "$as_me:3739: \$? = $ac_status" >&5
3740   (exit $ac_status); }; }; then
3741   cf_XOPEN_SOURCE_set=yes
3742 else
3743   echo "$as_me: failed program was:" >&5
3744 cat conftest.$ac_ext >&5
3745 cf_XOPEN_SOURCE_set=no
3746 fi
3747 rm -f conftest.$ac_objext conftest.$ac_ext
3748         echo "$as_me:3748: result: $cf_XOPEN_SOURCE_set" >&5
3749 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
3750         if test $cf_XOPEN_SOURCE_set = yes
3751         then
3752                 cat >conftest.$ac_ext <<_ACEOF
3753 #line 3753 "configure"
3754 #include "confdefs.h"
3755 #include <stdlib.h>
3756 int
3757 main ()
3758 {
3759
3760 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
3761 make an error
3762 #endif
3763   ;
3764   return 0;
3765 }
3766 _ACEOF
3767 rm -f conftest.$ac_objext
3768 if { (eval echo "$as_me:3768: \"$ac_compile\"") >&5
3769   (eval $ac_compile) 2>&5
3770   ac_status=$?
3771   echo "$as_me:3771: \$? = $ac_status" >&5
3772   (exit $ac_status); } &&
3773          { ac_try='test -s conftest.$ac_objext'
3774   { (eval echo "$as_me:3774: \"$ac_try\"") >&5
3775   (eval $ac_try) 2>&5
3776   ac_status=$?
3777   echo "$as_me:3777: \$? = $ac_status" >&5
3778   (exit $ac_status); }; }; then
3779   cf_XOPEN_SOURCE_set_ok=yes
3780 else
3781   echo "$as_me: failed program was:" >&5
3782 cat conftest.$ac_ext >&5
3783 cf_XOPEN_SOURCE_set_ok=no
3784 fi
3785 rm -f conftest.$ac_objext conftest.$ac_ext
3786                 if test $cf_XOPEN_SOURCE_set_ok = no
3787                 then
3788                         { echo "$as_me:3788: WARNING: _XOPEN_SOURCE is lower than requested" >&5
3789 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
3790                 fi
3791         else
3792
3793 echo "$as_me:3793: checking if we should define _XOPEN_SOURCE" >&5
3794 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
3795 if test "${cf_cv_xopen_source+set}" = set; then
3796   echo $ECHO_N "(cached) $ECHO_C" >&6
3797 else
3798
3799         cat >conftest.$ac_ext <<_ACEOF
3800 #line 3800 "configure"
3801 #include "confdefs.h"
3802
3803 #include <stdlib.h>
3804 #include <string.h>
3805 #include <sys/types.h>
3806
3807 int
3808 main ()
3809 {
3810
3811 #ifndef _XOPEN_SOURCE
3812 make an error
3813 #endif
3814   ;
3815   return 0;
3816 }
3817 _ACEOF
3818 rm -f conftest.$ac_objext
3819 if { (eval echo "$as_me:3819: \"$ac_compile\"") >&5
3820   (eval $ac_compile) 2>&5
3821   ac_status=$?
3822   echo "$as_me:3822: \$? = $ac_status" >&5
3823   (exit $ac_status); } &&
3824          { ac_try='test -s conftest.$ac_objext'
3825   { (eval echo "$as_me:3825: \"$ac_try\"") >&5
3826   (eval $ac_try) 2>&5
3827   ac_status=$?
3828   echo "$as_me:3828: \$? = $ac_status" >&5
3829   (exit $ac_status); }; }; then
3830   cf_cv_xopen_source=no
3831 else
3832   echo "$as_me: failed program was:" >&5
3833 cat conftest.$ac_ext >&5
3834 cf_save="$CPPFLAGS"
3835          CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
3836          cat >conftest.$ac_ext <<_ACEOF
3837 #line 3837 "configure"
3838 #include "confdefs.h"
3839
3840 #include <stdlib.h>
3841 #include <string.h>
3842 #include <sys/types.h>
3843
3844 int
3845 main ()
3846 {
3847
3848 #ifdef _XOPEN_SOURCE
3849 make an error
3850 #endif
3851   ;
3852   return 0;
3853 }
3854 _ACEOF
3855 rm -f conftest.$ac_objext
3856 if { (eval echo "$as_me:3856: \"$ac_compile\"") >&5
3857   (eval $ac_compile) 2>&5
3858   ac_status=$?
3859   echo "$as_me:3859: \$? = $ac_status" >&5
3860   (exit $ac_status); } &&
3861          { ac_try='test -s conftest.$ac_objext'
3862   { (eval echo "$as_me:3862: \"$ac_try\"") >&5
3863   (eval $ac_try) 2>&5
3864   ac_status=$?
3865   echo "$as_me:3865: \$? = $ac_status" >&5
3866   (exit $ac_status); }; }; then
3867   cf_cv_xopen_source=no
3868 else
3869   echo "$as_me: failed program was:" >&5
3870 cat conftest.$ac_ext >&5
3871 cf_cv_xopen_source=$cf_XOPEN_SOURCE
3872 fi
3873 rm -f conftest.$ac_objext conftest.$ac_ext
3874         CPPFLAGS="$cf_save"
3875
3876 fi
3877 rm -f conftest.$ac_objext conftest.$ac_ext
3878
3879 fi
3880 echo "$as_me:3880: result: $cf_cv_xopen_source" >&5
3881 echo "${ECHO_T}$cf_cv_xopen_source" >&6
3882
3883 if test "$cf_cv_xopen_source" != no ; then
3884
3885 CFLAGS=`echo "$CFLAGS" | \
3886         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
3887                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
3888
3889 CPPFLAGS=`echo "$CPPFLAGS" | \
3890         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
3891                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
3892
3893         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
3894
3895 cf_fix_cppflags=no
3896 cf_new_cflags=
3897 cf_new_cppflags=
3898 cf_new_extra_cppflags=
3899
3900 for cf_add_cflags in $cf_temp_xopen_source
3901 do
3902 case $cf_fix_cppflags in
3903 (no)
3904         case $cf_add_cflags in
3905         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
3906                 case $cf_add_cflags in
3907                 (-D*)
3908                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3909
3910                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3911                                 && test -z "${cf_tst_cflags}" \
3912                                 && cf_fix_cppflags=yes
3913
3914                         if test $cf_fix_cppflags = yes ; then
3915                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3916                                 continue
3917                         elif test "${cf_tst_cflags}" = "\"'" ; then
3918                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3919                                 continue
3920                         fi
3921                         ;;
3922                 esac
3923                 case "$CPPFLAGS" in
3924                 (*$cf_add_cflags)
3925                         ;;
3926                 (*)
3927                         case $cf_add_cflags in
3928                         (-D*)
3929                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3930
3931 CPPFLAGS=`echo "$CPPFLAGS" | \
3932         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3933                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3934
3935                                 ;;
3936                         esac
3937                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3938                         ;;
3939                 esac
3940                 ;;
3941         (*)
3942                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
3943                 ;;
3944         esac
3945         ;;
3946 (yes)
3947         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3948
3949         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3950
3951         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3952                 && test -z "${cf_tst_cflags}" \
3953                 && cf_fix_cppflags=no
3954         ;;
3955 esac
3956 done
3957
3958 if test -n "$cf_new_cflags" ; then
3959
3960         CFLAGS="$CFLAGS $cf_new_cflags"
3961 fi
3962
3963 if test -n "$cf_new_cppflags" ; then
3964
3965         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
3966 fi
3967
3968 if test -n "$cf_new_extra_cppflags" ; then
3969
3970         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
3971 fi
3972
3973 fi
3974
3975         fi
3976 fi
3977
3978 echo "$as_me:3978: checking for signal global datatype" >&5
3979 echo $ECHO_N "checking for signal global datatype... $ECHO_C" >&6
3980 if test "${cf_cv_sig_atomic_t+set}" = set; then
3981   echo $ECHO_N "(cached) $ECHO_C" >&6
3982 else
3983
3984         for cf_type in \
3985                 "volatile sig_atomic_t" \
3986                 "sig_atomic_t" \
3987                 "int"
3988         do
3989         cat >conftest.$ac_ext <<_ACEOF
3990 #line 3990 "configure"
3991 #include "confdefs.h"
3992
3993 #include <sys/types.h>
3994 #include <signal.h>
3995 #include <stdio.h>
3996
3997 extern $cf_type x;
3998 $cf_type x;
3999 static void handler(int sig)
4000 {
4001         x = 5;
4002 }
4003 int
4004 main ()
4005 {
4006 signal(SIGINT, handler);
4007                  x = 1
4008   ;
4009   return 0;
4010 }
4011 _ACEOF
4012 rm -f conftest.$ac_objext
4013 if { (eval echo "$as_me:4013: \"$ac_compile\"") >&5
4014   (eval $ac_compile) 2>&5
4015   ac_status=$?
4016   echo "$as_me:4016: \$? = $ac_status" >&5
4017   (exit $ac_status); } &&
4018          { ac_try='test -s conftest.$ac_objext'
4019   { (eval echo "$as_me:4019: \"$ac_try\"") >&5
4020   (eval $ac_try) 2>&5
4021   ac_status=$?
4022   echo "$as_me:4022: \$? = $ac_status" >&5
4023   (exit $ac_status); }; }; then
4024   cf_cv_sig_atomic_t=$cf_type
4025 else
4026   echo "$as_me: failed program was:" >&5
4027 cat conftest.$ac_ext >&5
4028 cf_cv_sig_atomic_t=no
4029 fi
4030 rm -f conftest.$ac_objext conftest.$ac_ext
4031                 test "$cf_cv_sig_atomic_t" != no && break
4032         done
4033
4034 fi
4035
4036 echo "$as_me:4036: result: $cf_cv_sig_atomic_t" >&5
4037 echo "${ECHO_T}$cf_cv_sig_atomic_t" >&6
4038 test "$cf_cv_sig_atomic_t" != no &&
4039 cat >>confdefs.h <<EOF
4040 #define SIG_ATOMIC_T $cf_cv_sig_atomic_t
4041 EOF
4042
4043 echo "$as_me:4043: checking if you want to use pkg-config" >&5
4044 echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6
4045
4046 # Check whether --with-pkg-config or --without-pkg-config was given.
4047 if test "${with_pkg_config+set}" = set; then
4048   withval="$with_pkg_config"
4049   cf_pkg_config=$withval
4050 else
4051   cf_pkg_config=yes
4052 fi;
4053 echo "$as_me:4053: result: $cf_pkg_config" >&5
4054 echo "${ECHO_T}$cf_pkg_config" >&6
4055
4056 case $cf_pkg_config in
4057 (no)
4058         PKG_CONFIG=none
4059         ;;
4060 (yes)
4061
4062 if test -n "$ac_tool_prefix"; then
4063   # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
4064 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
4065 echo "$as_me:4065: checking for $ac_word" >&5
4066 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4067 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
4068   echo $ECHO_N "(cached) $ECHO_C" >&6
4069 else
4070   case $PKG_CONFIG in
4071   [\\/]* | ?:[\\/]*)
4072   ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
4073   ;;
4074   *)
4075   ac_save_IFS=$IFS; IFS=$ac_path_separator
4076 ac_dummy="$PATH"
4077 for ac_dir in $ac_dummy; do
4078   IFS=$ac_save_IFS
4079   test -z "$ac_dir" && ac_dir=.
4080   if $as_executable_p "$ac_dir/$ac_word"; then
4081    ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
4082    echo "$as_me:4082: found $ac_dir/$ac_word" >&5
4083    break
4084 fi
4085 done
4086
4087   ;;
4088 esac
4089 fi
4090 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
4091
4092 if test -n "$PKG_CONFIG"; then
4093   echo "$as_me:4093: result: $PKG_CONFIG" >&5
4094 echo "${ECHO_T}$PKG_CONFIG" >&6
4095 else
4096   echo "$as_me:4096: result: no" >&5
4097 echo "${ECHO_T}no" >&6
4098 fi
4099
4100 fi
4101 if test -z "$ac_cv_path_PKG_CONFIG"; then
4102   ac_pt_PKG_CONFIG=$PKG_CONFIG
4103   # Extract the first word of "pkg-config", so it can be a program name with args.
4104 set dummy pkg-config; ac_word=$2
4105 echo "$as_me:4105: checking for $ac_word" >&5
4106 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4107 if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
4108   echo $ECHO_N "(cached) $ECHO_C" >&6
4109 else
4110   case $ac_pt_PKG_CONFIG in
4111   [\\/]* | ?:[\\/]*)
4112   ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
4113   ;;
4114   *)
4115   ac_save_IFS=$IFS; IFS=$ac_path_separator
4116 ac_dummy="$PATH"
4117 for ac_dir in $ac_dummy; do
4118   IFS=$ac_save_IFS
4119   test -z "$ac_dir" && ac_dir=.
4120   if $as_executable_p "$ac_dir/$ac_word"; then
4121    ac_cv_path_ac_pt_PKG_CONFIG="$ac_dir/$ac_word"
4122    echo "$as_me:4122: found $ac_dir/$ac_word" >&5
4123    break
4124 fi
4125 done
4126
4127   test -z "$ac_cv_path_ac_pt_PKG_CONFIG" && ac_cv_path_ac_pt_PKG_CONFIG="none"
4128   ;;
4129 esac
4130 fi
4131 ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
4132
4133 if test -n "$ac_pt_PKG_CONFIG"; then
4134   echo "$as_me:4134: result: $ac_pt_PKG_CONFIG" >&5
4135 echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
4136 else
4137   echo "$as_me:4137: result: no" >&5
4138 echo "${ECHO_T}no" >&6
4139 fi
4140
4141   PKG_CONFIG=$ac_pt_PKG_CONFIG
4142 else
4143   PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
4144 fi
4145
4146         ;;
4147 (*)
4148         PKG_CONFIG=$withval
4149         ;;
4150 esac
4151
4152 test -z "$PKG_CONFIG" && PKG_CONFIG=none
4153 if test "$PKG_CONFIG" != none ; then
4154
4155 if test "x$prefix" != xNONE; then
4156         cf_path_syntax="$prefix"
4157 else
4158         cf_path_syntax="$ac_default_prefix"
4159 fi
4160
4161 case ".$PKG_CONFIG" in
4162 (.\$\(*\)*|.\'*\'*)
4163         ;;
4164 (..|./*|.\\*)
4165         ;;
4166 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
4167         ;;
4168 (.\${*prefix}*|.\${*dir}*)
4169         eval PKG_CONFIG="$PKG_CONFIG"
4170         case ".$PKG_CONFIG" in
4171         (.NONE/*)
4172                 PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
4173                 ;;
4174         esac
4175         ;;
4176 (.no|.NONE/*)
4177         PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
4178         ;;
4179 (*)
4180         { { echo "$as_me:4180: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
4181 echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
4182    { (exit 1); exit 1; }; }
4183         ;;
4184 esac
4185
4186 elif test "x$cf_pkg_config" != xno ; then
4187         { echo "$as_me:4187: WARNING: pkg-config is not installed" >&5
4188 echo "$as_me: WARNING: pkg-config is not installed" >&2;}
4189 fi
4190
4191 echo "$as_me:4191: checking if you want to see long compiling messages" >&5
4192 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
4193
4194 # Check whether --enable-echo or --disable-echo was given.
4195 if test "${enable_echo+set}" = set; then
4196   enableval="$enable_echo"
4197   test "$enableval" != no && enableval=yes
4198         if test "$enableval" != "yes" ; then
4199
4200         ECHO_LT='--silent'
4201         ECHO_LD='@echo linking $@;'
4202         RULE_CC='@echo compiling $<'
4203         SHOW_CC='@echo compiling $@'
4204         ECHO_CC='@'
4205
4206         else
4207
4208         ECHO_LT=''
4209         ECHO_LD=''
4210         RULE_CC=''
4211         SHOW_CC=''
4212         ECHO_CC=''
4213
4214         fi
4215 else
4216   enableval=yes
4217
4218         ECHO_LT=''
4219         ECHO_LD=''
4220         RULE_CC=''
4221         SHOW_CC=''
4222         ECHO_CC=''
4223
4224 fi;
4225 echo "$as_me:4225: result: $enableval" >&5
4226 echo "${ECHO_T}$enableval" >&6
4227
4228 echo "$as_me:4228: checking for ncurses wrap-prefix" >&5
4229 echo $ECHO_N "checking for ncurses wrap-prefix... $ECHO_C" >&6
4230
4231 # Check whether --with-ncurses-wrap-prefix or --without-ncurses-wrap-prefix was given.
4232 if test "${with_ncurses_wrap_prefix+set}" = set; then
4233   withval="$with_ncurses_wrap_prefix"
4234   NCURSES_WRAP_PREFIX=$withval
4235 else
4236   NCURSES_WRAP_PREFIX=_nc_
4237 fi;
4238 echo "$as_me:4238: result: $NCURSES_WRAP_PREFIX" >&5
4239 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
4240
4241 echo "$as_me:4241: checking if you want to check for wide-character functions" >&5
4242 echo $ECHO_N "checking if you want to check for wide-character functions... $ECHO_C" >&6
4243
4244 # Check whether --enable-widec or --disable-widec was given.
4245 if test "${enable_widec+set}" = set; then
4246   enableval="$enable_widec"
4247   test "$enableval" != no && enableval=yes
4248         if test "$enableval" != "yes" ; then
4249     cf_enable_widec=no
4250         else
4251                 cf_enable_widec=yes
4252         fi
4253 else
4254   enableval=yes
4255         cf_enable_widec=yes
4256
4257 fi;
4258 echo "$as_me:4258: result: $cf_enable_widec" >&5
4259 echo "${ECHO_T}$cf_enable_widec" >&6
4260
4261 echo "$as_me:4261: checking for specific curses-directory" >&5
4262 echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
4263
4264 # Check whether --with-curses-dir or --without-curses-dir was given.
4265 if test "${with_curses_dir+set}" = set; then
4266   withval="$with_curses_dir"
4267   cf_cv_curses_dir=$withval
4268 else
4269   cf_cv_curses_dir=no
4270 fi;
4271 echo "$as_me:4271: result: $cf_cv_curses_dir" >&5
4272 echo "${ECHO_T}$cf_cv_curses_dir" >&6
4273
4274 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
4275 then
4276
4277 if test "x$prefix" != xNONE; then
4278         cf_path_syntax="$prefix"
4279 else
4280         cf_path_syntax="$ac_default_prefix"
4281 fi
4282
4283 case ".$withval" in
4284 (.\$\(*\)*|.\'*\'*)
4285         ;;
4286 (..|./*|.\\*)
4287         ;;
4288 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
4289         ;;
4290 (.\${*prefix}*|.\${*dir}*)
4291         eval withval="$withval"
4292         case ".$withval" in
4293         (.NONE/*)
4294                 withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
4295                 ;;
4296         esac
4297         ;;
4298 (.no|.NONE/*)
4299         withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
4300         ;;
4301 (*)
4302         { { echo "$as_me:4302: error: expected a pathname, not \"$withval\"" >&5
4303 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
4304    { (exit 1); exit 1; }; }
4305         ;;
4306 esac
4307
4308         if test -d "$cf_cv_curses_dir"
4309         then
4310
4311 if test -n "$cf_cv_curses_dir/include" ; then
4312   for cf_add_incdir in $cf_cv_curses_dir/include
4313   do
4314         while test $cf_add_incdir != /usr/include
4315         do
4316           if test -d $cf_add_incdir
4317           then
4318                 cf_have_incdir=no
4319                 if test -n "$CFLAGS$CPPFLAGS" ; then
4320                   # a loop is needed to ensure we can add subdirs of existing dirs
4321                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4322                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4323                           cf_have_incdir=yes; break
4324                         fi
4325                   done
4326                 fi
4327
4328                 if test "$cf_have_incdir" = no ; then
4329                   if test "$cf_add_incdir" = /usr/local/include ; then
4330                         if test "$GCC" = yes
4331                         then
4332                           cf_save_CPPFLAGS=$CPPFLAGS
4333                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4334                           cat >conftest.$ac_ext <<_ACEOF
4335 #line 4335 "configure"
4336 #include "confdefs.h"
4337 #include <stdio.h>
4338 int
4339 main ()
4340 {
4341 printf("Hello")
4342   ;
4343   return 0;
4344 }
4345 _ACEOF
4346 rm -f conftest.$ac_objext
4347 if { (eval echo "$as_me:4347: \"$ac_compile\"") >&5
4348   (eval $ac_compile) 2>&5
4349   ac_status=$?
4350   echo "$as_me:4350: \$? = $ac_status" >&5
4351   (exit $ac_status); } &&
4352          { ac_try='test -s conftest.$ac_objext'
4353   { (eval echo "$as_me:4353: \"$ac_try\"") >&5
4354   (eval $ac_try) 2>&5
4355   ac_status=$?
4356   echo "$as_me:4356: \$? = $ac_status" >&5
4357   (exit $ac_status); }; }; then
4358   :
4359 else
4360   echo "$as_me: failed program was:" >&5
4361 cat conftest.$ac_ext >&5
4362 cf_have_incdir=yes
4363 fi
4364 rm -f conftest.$ac_objext conftest.$ac_ext
4365                           CPPFLAGS=$cf_save_CPPFLAGS
4366                         fi
4367                   fi
4368                 fi
4369
4370                 if test "$cf_have_incdir" = no ; then
4371                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4372
4373 echo "${as_me:-configure}:4373: testing adding $cf_add_incdir to include-path ..." 1>&5
4374
4375                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4376
4377                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
4378                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4379                   cf_add_incdir="$cf_top_incdir"
4380                 else
4381                   break
4382                 fi
4383           else
4384                 break
4385           fi
4386         done
4387   done
4388 fi
4389
4390 if test -n "$cf_cv_curses_dir/lib" ; then
4391         for cf_add_libdir in $cf_cv_curses_dir/lib
4392         do
4393                 if test $cf_add_libdir = /usr/lib ; then
4394                         :
4395                 elif test -d $cf_add_libdir
4396                 then
4397                         cf_have_libdir=no
4398                         if test -n "$LDFLAGS$LIBS" ; then
4399                                 # a loop is needed to ensure we can add subdirs of existing dirs
4400                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
4401                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
4402                                                 cf_have_libdir=yes; break
4403                                         fi
4404                                 done
4405                         fi
4406                         if test "$cf_have_libdir" = no ; then
4407                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
4408
4409 echo "${as_me:-configure}:4409: testing adding $cf_add_libdir to library-path ..." 1>&5
4410
4411                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
4412                         fi
4413                 fi
4414         done
4415 fi
4416
4417         fi
4418 fi
4419
4420 cf_cv_screen=curses
4421
4422 echo "$as_me:4422: checking for specified curses library type" >&5
4423 echo $ECHO_N "checking for specified curses library type... $ECHO_C" >&6
4424
4425 # Check whether --with-screen or --without-screen was given.
4426 if test "${with_screen+set}" = set; then
4427   withval="$with_screen"
4428   cf_cv_screen=$withval
4429 else
4430
4431 # Check whether --with-ncursesw or --without-ncursesw was given.
4432 if test "${with_ncursesw+set}" = set; then
4433   withval="$with_ncursesw"
4434   cf_cv_screen=ncursesw
4435 else
4436
4437 # Check whether --with-ncurses or --without-ncurses was given.
4438 if test "${with_ncurses+set}" = set; then
4439   withval="$with_ncurses"
4440   cf_cv_screen=ncurses
4441 else
4442
4443 # Check whether --with-pdcurses or --without-pdcurses was given.
4444 if test "${with_pdcurses+set}" = set; then
4445   withval="$with_pdcurses"
4446   cf_cv_screen=pdcurses
4447 else
4448
4449 # Check whether --with-curses-colr or --without-curses-colr was given.
4450 if test "${with_curses_colr+set}" = set; then
4451   withval="$with_curses_colr"
4452   cf_cv_screen=curses_colr
4453 else
4454
4455 # Check whether --with-curses-5lib or --without-curses-5lib was given.
4456 if test "${with_curses_5lib+set}" = set; then
4457   withval="$with_curses_5lib"
4458   cf_cv_screen=curses_5lib
4459 fi;
4460 fi;
4461 fi;
4462 fi;
4463 fi;
4464 fi;
4465
4466 echo "$as_me:4466: result: $cf_cv_screen" >&5
4467 echo "${ECHO_T}$cf_cv_screen" >&6
4468
4469 case $cf_cv_screen in
4470 (curses|curses_*)
4471
4472 echo "$as_me:4472: checking for extra include directories" >&5
4473 echo $ECHO_N "checking for extra include directories... $ECHO_C" >&6
4474 if test "${cf_cv_curses_incdir+set}" = set; then
4475   echo $ECHO_N "(cached) $ECHO_C" >&6
4476 else
4477
4478 cf_cv_curses_incdir=no
4479 case $host_os in
4480 (hpux10.*)
4481         if test "x$cf_cv_screen" = "xcurses_colr"
4482         then
4483                 test -d /usr/include/curses_colr && \
4484                 cf_cv_curses_incdir="-I/usr/include/curses_colr"
4485         fi
4486         ;;
4487 (sunos3*|sunos4*)
4488         if test "x$cf_cv_screen" = "xcurses_5lib"
4489         then
4490                 test -d /usr/5lib && \
4491                 test -d /usr/5include && \
4492                 cf_cv_curses_incdir="-I/usr/5include"
4493         fi
4494         ;;
4495 esac
4496
4497 fi
4498 echo "$as_me:4498: result: $cf_cv_curses_incdir" >&5
4499 echo "${ECHO_T}$cf_cv_curses_incdir" >&6
4500 test "$cf_cv_curses_incdir" != no && CPPFLAGS="$CPPFLAGS $cf_cv_curses_incdir"
4501
4502 echo "$as_me:4502: checking if we have identified curses headers" >&5
4503 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
4504 if test "${cf_cv_ncurses_header+set}" = set; then
4505   echo $ECHO_N "(cached) $ECHO_C" >&6
4506 else
4507
4508 cf_cv_ncurses_header=none
4509 for cf_header in \
4510         ncurses.h  \
4511         curses.h  ncurses/ncurses.h ncurses/curses.h
4512 do
4513 cat >conftest.$ac_ext <<_ACEOF
4514 #line 4514 "configure"
4515 #include "confdefs.h"
4516 #include <${cf_header}>
4517 int
4518 main ()
4519 {
4520 initscr(); tgoto("?", 0,0)
4521   ;
4522   return 0;
4523 }
4524 _ACEOF
4525 rm -f conftest.$ac_objext
4526 if { (eval echo "$as_me:4526: \"$ac_compile\"") >&5
4527   (eval $ac_compile) 2>&5
4528   ac_status=$?
4529   echo "$as_me:4529: \$? = $ac_status" >&5
4530   (exit $ac_status); } &&
4531          { ac_try='test -s conftest.$ac_objext'
4532   { (eval echo "$as_me:4532: \"$ac_try\"") >&5
4533   (eval $ac_try) 2>&5
4534   ac_status=$?
4535   echo "$as_me:4535: \$? = $ac_status" >&5
4536   (exit $ac_status); }; }; then
4537   cf_cv_ncurses_header=$cf_header; break
4538 else
4539   echo "$as_me: failed program was:" >&5
4540 cat conftest.$ac_ext >&5
4541 fi
4542 rm -f conftest.$ac_objext conftest.$ac_ext
4543 done
4544
4545 fi
4546 echo "$as_me:4546: result: $cf_cv_ncurses_header" >&5
4547 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
4548
4549 if test "$cf_cv_ncurses_header" = none ; then
4550         { { echo "$as_me:4550: error: No curses header-files found" >&5
4551 echo "$as_me: error: No curses header-files found" >&2;}
4552    { (exit 1); exit 1; }; }
4553 fi
4554
4555 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
4556
4557 for ac_header in $cf_cv_ncurses_header
4558 do
4559 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
4560 echo "$as_me:4560: checking for $ac_header" >&5
4561 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
4562 if eval "test \"\${$as_ac_Header+set}\" = set"; then
4563   echo $ECHO_N "(cached) $ECHO_C" >&6
4564 else
4565   cat >conftest.$ac_ext <<_ACEOF
4566 #line 4566 "configure"
4567 #include "confdefs.h"
4568 #include <$ac_header>
4569 _ACEOF
4570 if { (eval echo "$as_me:4570: \"$ac_cpp conftest.$ac_ext\"") >&5
4571   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
4572   ac_status=$?
4573   egrep -v '^ *\+' conftest.er1 >conftest.err
4574   rm -f conftest.er1
4575   cat conftest.err >&5
4576   echo "$as_me:4576: \$? = $ac_status" >&5
4577   (exit $ac_status); } >/dev/null; then
4578   if test -s conftest.err; then
4579     ac_cpp_err=$ac_c_preproc_warn_flag
4580   else
4581     ac_cpp_err=
4582   fi
4583 else
4584   ac_cpp_err=yes
4585 fi
4586 if test -z "$ac_cpp_err"; then
4587   eval "$as_ac_Header=yes"
4588 else
4589   echo "$as_me: failed program was:" >&5
4590   cat conftest.$ac_ext >&5
4591   eval "$as_ac_Header=no"
4592 fi
4593 rm -f conftest.err conftest.$ac_ext
4594 fi
4595 echo "$as_me:4595: result: `eval echo '${'$as_ac_Header'}'`" >&5
4596 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
4597 if test `eval echo '${'$as_ac_Header'}'` = yes; then
4598   cat >>confdefs.h <<EOF
4599 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
4600 EOF
4601
4602 fi
4603 done
4604
4605 echo "$as_me:4605: checking for terminfo header" >&5
4606 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
4607 if test "${cf_cv_term_header+set}" = set; then
4608   echo $ECHO_N "(cached) $ECHO_C" >&6
4609 else
4610
4611 case ${cf_cv_ncurses_header} in
4612 (*/ncurses.h|*/ncursesw.h)
4613         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
4614         ;;
4615 (*)
4616         cf_term_header=term.h
4617         ;;
4618 esac
4619
4620 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
4621 do
4622 cat >conftest.$ac_ext <<_ACEOF
4623 #line 4623 "configure"
4624 #include "confdefs.h"
4625 #include <stdio.h>
4626 #include <${cf_cv_ncurses_header:-curses.h}>
4627 #include <$cf_test>
4628
4629 int
4630 main ()
4631 {
4632 int x = auto_left_margin
4633   ;
4634   return 0;
4635 }
4636 _ACEOF
4637 rm -f conftest.$ac_objext
4638 if { (eval echo "$as_me:4638: \"$ac_compile\"") >&5
4639   (eval $ac_compile) 2>&5
4640   ac_status=$?
4641   echo "$as_me:4641: \$? = $ac_status" >&5
4642   (exit $ac_status); } &&
4643          { ac_try='test -s conftest.$ac_objext'
4644   { (eval echo "$as_me:4644: \"$ac_try\"") >&5
4645   (eval $ac_try) 2>&5
4646   ac_status=$?
4647   echo "$as_me:4647: \$? = $ac_status" >&5
4648   (exit $ac_status); }; }; then
4649
4650         cf_cv_term_header="$cf_test"
4651 else
4652   echo "$as_me: failed program was:" >&5
4653 cat conftest.$ac_ext >&5
4654
4655         cf_cv_term_header=unknown
4656
4657 fi
4658 rm -f conftest.$ac_objext conftest.$ac_ext
4659         test "$cf_cv_term_header" != unknown && break
4660 done
4661
4662 fi
4663 echo "$as_me:4663: result: $cf_cv_term_header" >&5
4664 echo "${ECHO_T}$cf_cv_term_header" >&6
4665
4666 # Set definitions to allow ifdef'ing to accommodate subdirectories
4667
4668 case $cf_cv_term_header in
4669 (*term.h)
4670
4671 cat >>confdefs.h <<\EOF
4672 #define HAVE_TERM_H 1
4673 EOF
4674
4675         ;;
4676 esac
4677
4678 case $cf_cv_term_header in
4679 (ncurses/term.h)
4680
4681 cat >>confdefs.h <<\EOF
4682 #define HAVE_NCURSES_TERM_H 1
4683 EOF
4684
4685         ;;
4686 (ncursesw/term.h)
4687
4688 cat >>confdefs.h <<\EOF
4689 #define HAVE_NCURSESW_TERM_H 1
4690 EOF
4691
4692         ;;
4693 esac
4694
4695 echo "$as_me:4695: checking for ncurses version" >&5
4696 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
4697 if test "${cf_cv_ncurses_version+set}" = set; then
4698   echo $ECHO_N "(cached) $ECHO_C" >&6
4699 else
4700
4701         cf_cv_ncurses_version=no
4702         cf_tempfile=out$$
4703         rm -f $cf_tempfile
4704         if test "$cross_compiling" = yes; then
4705
4706         # This will not work if the preprocessor splits the line after the
4707         # Autoconf token.  The 'unproto' program does that.
4708         cat > conftest.$ac_ext <<EOF
4709 #include <${cf_cv_ncurses_header:-curses.h}>
4710 #undef Autoconf
4711 #ifdef NCURSES_VERSION
4712 Autoconf NCURSES_VERSION
4713 #else
4714 #ifdef __NCURSES_H
4715 Autoconf "old"
4716 #endif
4717 ;
4718 #endif
4719 EOF
4720         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
4721         { (eval echo "$as_me:4721: \"$cf_try\"") >&5
4722   (eval $cf_try) 2>&5
4723   ac_status=$?
4724   echo "$as_me:4724: \$? = $ac_status" >&5
4725   (exit $ac_status); }
4726         if test -f conftest.out ; then
4727                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
4728                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
4729                 rm -f conftest.out
4730         fi
4731
4732 else
4733   cat >conftest.$ac_ext <<_ACEOF
4734 #line 4734 "configure"
4735 #include "confdefs.h"
4736
4737 #include <${cf_cv_ncurses_header:-curses.h}>
4738 #include <stdio.h>
4739 int main()
4740 {
4741         FILE *fp = fopen("$cf_tempfile", "w");
4742 #ifdef NCURSES_VERSION
4743 # ifdef NCURSES_VERSION_PATCH
4744         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
4745 # else
4746         fprintf(fp, "%s\n", NCURSES_VERSION);
4747 # endif
4748 #else
4749 # ifdef __NCURSES_H
4750         fprintf(fp, "old\n");
4751 # else
4752         make an error
4753 # endif
4754 #endif
4755         ${cf_cv_main_return:-return}(0);
4756 }
4757 _ACEOF
4758 rm -f conftest$ac_exeext
4759 if { (eval echo "$as_me:4759: \"$ac_link\"") >&5
4760   (eval $ac_link) 2>&5
4761   ac_status=$?
4762   echo "$as_me:4762: \$? = $ac_status" >&5
4763   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
4764   { (eval echo "$as_me:4764: \"$ac_try\"") >&5
4765   (eval $ac_try) 2>&5
4766   ac_status=$?
4767   echo "$as_me:4767: \$? = $ac_status" >&5
4768   (exit $ac_status); }; }; then
4769
4770         cf_cv_ncurses_version=`cat $cf_tempfile`
4771 else
4772   echo "$as_me: program exited with status $ac_status" >&5
4773 echo "$as_me: failed program was:" >&5
4774 cat conftest.$ac_ext >&5
4775 fi
4776 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
4777 fi
4778         rm -f $cf_tempfile
4779
4780 fi
4781 echo "$as_me:4781: result: $cf_cv_ncurses_version" >&5
4782 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
4783 test "$cf_cv_ncurses_version" = no ||
4784 cat >>confdefs.h <<\EOF
4785 #define NCURSES 1
4786 EOF
4787
4788 echo "$as_me:4788: checking if we have identified curses libraries" >&5
4789 echo $ECHO_N "checking if we have identified curses libraries... $ECHO_C" >&6
4790 cat >conftest.$ac_ext <<_ACEOF
4791 #line 4791 "configure"
4792 #include "confdefs.h"
4793 #include <${cf_cv_ncurses_header:-curses.h}>
4794 int
4795 main ()
4796 {
4797 initscr(); tgoto("?", 0,0)
4798   ;
4799   return 0;
4800 }
4801 _ACEOF
4802 rm -f conftest.$ac_objext conftest$ac_exeext
4803 if { (eval echo "$as_me:4803: \"$ac_link\"") >&5
4804   (eval $ac_link) 2>&5
4805   ac_status=$?
4806   echo "$as_me:4806: \$? = $ac_status" >&5
4807   (exit $ac_status); } &&
4808          { ac_try='test -s conftest$ac_exeext'
4809   { (eval echo "$as_me:4809: \"$ac_try\"") >&5
4810   (eval $ac_try) 2>&5
4811   ac_status=$?
4812   echo "$as_me:4812: \$? = $ac_status" >&5
4813   (exit $ac_status); }; }; then
4814   cf_result=yes
4815 else
4816   echo "$as_me: failed program was:" >&5
4817 cat conftest.$ac_ext >&5
4818 cf_result=no
4819 fi
4820 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4821 echo "$as_me:4821: result: $cf_result" >&5
4822 echo "${ECHO_T}$cf_result" >&6
4823
4824 if test "$cf_result" = no ; then
4825 case $host_os in
4826 (freebsd*)
4827         echo "$as_me:4827: checking for tgoto in -lmytinfo" >&5
4828 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
4829 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
4830   echo $ECHO_N "(cached) $ECHO_C" >&6
4831 else
4832   ac_check_lib_save_LIBS=$LIBS
4833 LIBS="-lmytinfo  $LIBS"
4834 cat >conftest.$ac_ext <<_ACEOF
4835 #line 4835 "configure"
4836 #include "confdefs.h"
4837
4838 /* Override any gcc2 internal prototype to avoid an error.  */
4839 #ifdef __cplusplus
4840 extern "C"
4841 #endif
4842 /* We use char because int might match the return type of a gcc2
4843    builtin and then its argument prototype would still apply.  */
4844 char tgoto ();
4845 int
4846 main ()
4847 {
4848 tgoto ();
4849   ;
4850   return 0;
4851 }
4852 _ACEOF
4853 rm -f conftest.$ac_objext conftest$ac_exeext
4854 if { (eval echo "$as_me:4854: \"$ac_link\"") >&5
4855   (eval $ac_link) 2>&5
4856   ac_status=$?
4857   echo "$as_me:4857: \$? = $ac_status" >&5
4858   (exit $ac_status); } &&
4859          { ac_try='test -s conftest$ac_exeext'
4860   { (eval echo "$as_me:4860: \"$ac_try\"") >&5
4861   (eval $ac_try) 2>&5
4862   ac_status=$?
4863   echo "$as_me:4863: \$? = $ac_status" >&5
4864   (exit $ac_status); }; }; then
4865   ac_cv_lib_mytinfo_tgoto=yes
4866 else
4867   echo "$as_me: failed program was:" >&5
4868 cat conftest.$ac_ext >&5
4869 ac_cv_lib_mytinfo_tgoto=no
4870 fi
4871 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4872 LIBS=$ac_check_lib_save_LIBS
4873 fi
4874 echo "$as_me:4874: result: $ac_cv_lib_mytinfo_tgoto" >&5
4875 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
4876 if test $ac_cv_lib_mytinfo_tgoto = yes; then
4877
4878 cf_add_libs="-lmytinfo"
4879 # Filter out duplicates - this happens with badly-designed ".pc" files...
4880 for cf_add_1lib in $LIBS
4881 do
4882         for cf_add_2lib in $cf_add_libs
4883         do
4884                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
4885                 then
4886                         cf_add_1lib=
4887                         break
4888                 fi
4889         done
4890         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
4891 done
4892 LIBS="$cf_add_libs"
4893
4894 fi
4895
4896         ;;
4897 (hpux10.*)
4898         # Looking at HPUX 10.20, the Hcurses library is the oldest (1997), cur_colr
4899         # next (1998), and xcurses "newer" (2000).  There is no header file for
4900         # Hcurses; the subdirectory curses_colr has the headers (curses.h and
4901         # term.h) for cur_colr
4902         if test "x$cf_cv_screen" = "xcurses_colr"
4903         then
4904                 echo "$as_me:4904: checking for initscr in -lcur_colr" >&5
4905 echo $ECHO_N "checking for initscr in -lcur_colr... $ECHO_C" >&6
4906 if test "${ac_cv_lib_cur_colr_initscr+set}" = set; then
4907   echo $ECHO_N "(cached) $ECHO_C" >&6
4908 else
4909   ac_check_lib_save_LIBS=$LIBS
4910 LIBS="-lcur_colr  $LIBS"
4911 cat >conftest.$ac_ext <<_ACEOF
4912 #line 4912 "configure"
4913 #include "confdefs.h"
4914
4915 /* Override any gcc2 internal prototype to avoid an error.  */
4916 #ifdef __cplusplus
4917 extern "C"
4918 #endif
4919 /* We use char because int might match the return type of a gcc2
4920    builtin and then its argument prototype would still apply.  */
4921 char initscr ();
4922 int
4923 main ()
4924 {
4925 initscr ();
4926   ;
4927   return 0;
4928 }
4929 _ACEOF
4930 rm -f conftest.$ac_objext conftest$ac_exeext
4931 if { (eval echo "$as_me:4931: \"$ac_link\"") >&5
4932   (eval $ac_link) 2>&5
4933   ac_status=$?
4934   echo "$as_me:4934: \$? = $ac_status" >&5
4935   (exit $ac_status); } &&
4936          { ac_try='test -s conftest$ac_exeext'
4937   { (eval echo "$as_me:4937: \"$ac_try\"") >&5
4938   (eval $ac_try) 2>&5
4939   ac_status=$?
4940   echo "$as_me:4940: \$? = $ac_status" >&5
4941   (exit $ac_status); }; }; then
4942   ac_cv_lib_cur_colr_initscr=yes
4943 else
4944   echo "$as_me: failed program was:" >&5
4945 cat conftest.$ac_ext >&5
4946 ac_cv_lib_cur_colr_initscr=no
4947 fi
4948 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4949 LIBS=$ac_check_lib_save_LIBS
4950 fi
4951 echo "$as_me:4951: result: $ac_cv_lib_cur_colr_initscr" >&5
4952 echo "${ECHO_T}$ac_cv_lib_cur_colr_initscr" >&6
4953 if test $ac_cv_lib_cur_colr_initscr = yes; then
4954
4955 cf_add_libs="-lcur_colr"
4956 # Filter out duplicates - this happens with badly-designed ".pc" files...
4957 for cf_add_1lib in $LIBS
4958 do
4959         for cf_add_2lib in $cf_add_libs
4960         do
4961                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
4962                 then
4963                         cf_add_1lib=
4964                         break
4965                 fi
4966         done
4967         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
4968 done
4969 LIBS="$cf_add_libs"
4970
4971                         ac_cv_func_initscr=yes
4972
4973 else
4974
4975                 echo "$as_me:4975: checking for initscr in -lHcurses" >&5
4976 echo $ECHO_N "checking for initscr in -lHcurses... $ECHO_C" >&6
4977 if test "${ac_cv_lib_Hcurses_initscr+set}" = set; then
4978   echo $ECHO_N "(cached) $ECHO_C" >&6
4979 else
4980   ac_check_lib_save_LIBS=$LIBS
4981 LIBS="-lHcurses  $LIBS"
4982 cat >conftest.$ac_ext <<_ACEOF
4983 #line 4983 "configure"
4984 #include "confdefs.h"
4985
4986 /* Override any gcc2 internal prototype to avoid an error.  */
4987 #ifdef __cplusplus
4988 extern "C"
4989 #endif
4990 /* We use char because int might match the return type of a gcc2
4991    builtin and then its argument prototype would still apply.  */
4992 char initscr ();
4993 int
4994 main ()
4995 {
4996 initscr ();
4997   ;
4998   return 0;
4999 }
5000 _ACEOF
5001 rm -f conftest.$ac_objext conftest$ac_exeext
5002 if { (eval echo "$as_me:5002: \"$ac_link\"") >&5
5003   (eval $ac_link) 2>&5
5004   ac_status=$?
5005   echo "$as_me:5005: \$? = $ac_status" >&5
5006   (exit $ac_status); } &&
5007          { ac_try='test -s conftest$ac_exeext'
5008   { (eval echo "$as_me:5008: \"$ac_try\"") >&5
5009   (eval $ac_try) 2>&5
5010   ac_status=$?
5011   echo "$as_me:5011: \$? = $ac_status" >&5
5012   (exit $ac_status); }; }; then
5013   ac_cv_lib_Hcurses_initscr=yes
5014 else
5015   echo "$as_me: failed program was:" >&5
5016 cat conftest.$ac_ext >&5
5017 ac_cv_lib_Hcurses_initscr=no
5018 fi
5019 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5020 LIBS=$ac_check_lib_save_LIBS
5021 fi
5022 echo "$as_me:5022: result: $ac_cv_lib_Hcurses_initscr" >&5
5023 echo "${ECHO_T}$ac_cv_lib_Hcurses_initscr" >&6
5024 if test $ac_cv_lib_Hcurses_initscr = yes; then
5025
5026                         # HP's header uses __HP_CURSES, but user claims _HP_CURSES.
5027
5028 cf_add_libs="-lHcurses"
5029 # Filter out duplicates - this happens with badly-designed ".pc" files...
5030 for cf_add_1lib in $LIBS
5031 do
5032         for cf_add_2lib in $cf_add_libs
5033         do
5034                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5035                 then
5036                         cf_add_1lib=
5037                         break
5038                 fi
5039         done
5040         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5041 done
5042 LIBS="$cf_add_libs"
5043
5044                         CPPFLAGS="$CPPFLAGS -D__HP_CURSES -D_HP_CURSES"
5045                         ac_cv_func_initscr=yes
5046
5047 fi
5048
5049 fi
5050
5051         fi
5052         ;;
5053 (linux*)
5054         case `arch 2>/dev/null` in
5055         (x86_64)
5056                 if test -d /lib64
5057                 then
5058
5059 if test -n "/lib64" ; then
5060         for cf_add_libdir in /lib64
5061         do
5062                 if test $cf_add_libdir = /usr/lib ; then
5063                         :
5064                 elif test -d $cf_add_libdir
5065                 then
5066                         cf_have_libdir=no
5067                         if test -n "$LDFLAGS$LIBS" ; then
5068                                 # a loop is needed to ensure we can add subdirs of existing dirs
5069                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
5070                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5071                                                 cf_have_libdir=yes; break
5072                                         fi
5073                                 done
5074                         fi
5075                         if test "$cf_have_libdir" = no ; then
5076                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5077
5078 echo "${as_me:-configure}:5078: testing adding $cf_add_libdir to library-path ..." 1>&5
5079
5080                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5081                         fi
5082                 fi
5083         done
5084 fi
5085
5086                 else
5087
5088 if test -n "/lib" ; then
5089         for cf_add_libdir in /lib
5090         do
5091                 if test $cf_add_libdir = /usr/lib ; then
5092                         :
5093                 elif test -d $cf_add_libdir
5094                 then
5095                         cf_have_libdir=no
5096                         if test -n "$LDFLAGS$LIBS" ; then
5097                                 # a loop is needed to ensure we can add subdirs of existing dirs
5098                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
5099                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5100                                                 cf_have_libdir=yes; break
5101                                         fi
5102                                 done
5103                         fi
5104                         if test "$cf_have_libdir" = no ; then
5105                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5106
5107 echo "${as_me:-configure}:5107: testing adding $cf_add_libdir to library-path ..." 1>&5
5108
5109                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5110                         fi
5111                 fi
5112         done
5113 fi
5114
5115                 fi
5116                 ;;
5117         (*)
5118
5119 if test -n "/lib" ; then
5120         for cf_add_libdir in /lib
5121         do
5122                 if test $cf_add_libdir = /usr/lib ; then
5123                         :
5124                 elif test -d $cf_add_libdir
5125                 then
5126                         cf_have_libdir=no
5127                         if test -n "$LDFLAGS$LIBS" ; then
5128                                 # a loop is needed to ensure we can add subdirs of existing dirs
5129                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
5130                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5131                                                 cf_have_libdir=yes; break
5132                                         fi
5133                                 done
5134                         fi
5135                         if test "$cf_have_libdir" = no ; then
5136                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5137
5138 echo "${as_me:-configure}:5138: testing adding $cf_add_libdir to library-path ..." 1>&5
5139
5140                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5141                         fi
5142                 fi
5143         done
5144 fi
5145
5146                 ;;
5147         esac
5148         ;;
5149 (sunos3*|sunos4*)
5150         if test "x$cf_cv_screen" = "xcurses_5lib"
5151         then
5152                 if test -d /usr/5lib ; then
5153
5154 if test -n "/usr/5lib" ; then
5155         for cf_add_libdir in /usr/5lib
5156         do
5157                 if test $cf_add_libdir = /usr/lib ; then
5158                         :
5159                 elif test -d $cf_add_libdir
5160                 then
5161                         cf_have_libdir=no
5162                         if test -n "$LDFLAGS$LIBS" ; then
5163                                 # a loop is needed to ensure we can add subdirs of existing dirs
5164                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
5165                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5166                                                 cf_have_libdir=yes; break
5167                                         fi
5168                                 done
5169                         fi
5170                         if test "$cf_have_libdir" = no ; then
5171                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5172
5173 echo "${as_me:-configure}:5173: testing adding $cf_add_libdir to library-path ..." 1>&5
5174
5175                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5176                         fi
5177                 fi
5178         done
5179 fi
5180
5181 cf_add_libs="-lcurses -ltermcap"
5182 # Filter out duplicates - this happens with badly-designed ".pc" files...
5183 for cf_add_1lib in $LIBS
5184 do
5185         for cf_add_2lib in $cf_add_libs
5186         do
5187                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5188                 then
5189                         cf_add_1lib=
5190                         break
5191                 fi
5192         done
5193         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5194 done
5195 LIBS="$cf_add_libs"
5196
5197                 fi
5198         fi
5199         ac_cv_func_initscr=yes
5200         ;;
5201 esac
5202
5203 if test ".$ac_cv_func_initscr" != .yes ; then
5204         cf_save_LIBS="$LIBS"
5205
5206         if test ".${cf_cv_ncurses_version:-no}" != .no
5207         then
5208                 cf_check_list="ncurses curses cursesX"
5209         else
5210                 cf_check_list="cursesX curses ncurses"
5211         fi
5212
5213         # Check for library containing tgoto.  Do this before curses library
5214         # because it may be needed to link the test-case for initscr.
5215         if test "x$cf_term_lib" = x
5216         then
5217                 echo "$as_me:5217: checking for tgoto" >&5
5218 echo $ECHO_N "checking for tgoto... $ECHO_C" >&6
5219 if test "${ac_cv_func_tgoto+set}" = set; then
5220   echo $ECHO_N "(cached) $ECHO_C" >&6
5221 else
5222   cat >conftest.$ac_ext <<_ACEOF
5223 #line 5223 "configure"
5224 #include "confdefs.h"
5225 /* System header to define __stub macros and hopefully few prototypes,
5226     which can conflict with char tgoto (); below.  */
5227 #include <assert.h>
5228 /* Override any gcc2 internal prototype to avoid an error.  */
5229 #ifdef __cplusplus
5230 extern "C"
5231 #endif
5232 /* We use char because int might match the return type of a gcc2
5233    builtin and then its argument prototype would still apply.  */
5234 char tgoto ();
5235 char (*f) ();
5236
5237 int
5238 main ()
5239 {
5240 /* The GNU C library defines this for functions which it implements
5241     to always fail with ENOSYS.  Some functions are actually named
5242     something starting with __ and the normal name is an alias.  */
5243 #if defined (__stub_tgoto) || defined (__stub___tgoto)
5244 choke me
5245 #else
5246 f = tgoto; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
5247 #endif
5248
5249   ;
5250   return 0;
5251 }
5252 _ACEOF
5253 rm -f conftest.$ac_objext conftest$ac_exeext
5254 if { (eval echo "$as_me:5254: \"$ac_link\"") >&5
5255   (eval $ac_link) 2>&5
5256   ac_status=$?
5257   echo "$as_me:5257: \$? = $ac_status" >&5
5258   (exit $ac_status); } &&
5259          { ac_try='test -s conftest$ac_exeext'
5260   { (eval echo "$as_me:5260: \"$ac_try\"") >&5
5261   (eval $ac_try) 2>&5
5262   ac_status=$?
5263   echo "$as_me:5263: \$? = $ac_status" >&5
5264   (exit $ac_status); }; }; then
5265   ac_cv_func_tgoto=yes
5266 else
5267   echo "$as_me: failed program was:" >&5
5268 cat conftest.$ac_ext >&5
5269 ac_cv_func_tgoto=no
5270 fi
5271 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5272 fi
5273 echo "$as_me:5273: result: $ac_cv_func_tgoto" >&5
5274 echo "${ECHO_T}$ac_cv_func_tgoto" >&6
5275 if test $ac_cv_func_tgoto = yes; then
5276   cf_term_lib=predefined
5277 else
5278
5279                         for cf_term_lib in $cf_check_list otermcap termcap tinfo termlib unknown
5280                         do
5281                                 as_ac_Lib=`echo "ac_cv_lib_$cf_term_lib''_tgoto" | $as_tr_sh`
5282 echo "$as_me:5282: checking for tgoto in -l$cf_term_lib" >&5
5283 echo $ECHO_N "checking for tgoto in -l$cf_term_lib... $ECHO_C" >&6
5284 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
5285   echo $ECHO_N "(cached) $ECHO_C" >&6
5286 else
5287   ac_check_lib_save_LIBS=$LIBS
5288 LIBS="-l$cf_term_lib  $LIBS"
5289 cat >conftest.$ac_ext <<_ACEOF
5290 #line 5290 "configure"
5291 #include "confdefs.h"
5292
5293 /* Override any gcc2 internal prototype to avoid an error.  */
5294 #ifdef __cplusplus
5295 extern "C"
5296 #endif
5297 /* We use char because int might match the return type of a gcc2
5298    builtin and then its argument prototype would still apply.  */
5299 char tgoto ();
5300 int
5301 main ()
5302 {
5303 tgoto ();
5304   ;
5305   return 0;
5306 }
5307 _ACEOF
5308 rm -f conftest.$ac_objext conftest$ac_exeext
5309 if { (eval echo "$as_me:5309: \"$ac_link\"") >&5
5310   (eval $ac_link) 2>&5
5311   ac_status=$?
5312   echo "$as_me:5312: \$? = $ac_status" >&5
5313   (exit $ac_status); } &&
5314          { ac_try='test -s conftest$ac_exeext'
5315   { (eval echo "$as_me:5315: \"$ac_try\"") >&5
5316   (eval $ac_try) 2>&5
5317   ac_status=$?
5318   echo "$as_me:5318: \$? = $ac_status" >&5
5319   (exit $ac_status); }; }; then
5320   eval "$as_ac_Lib=yes"
5321 else
5322   echo "$as_me: failed program was:" >&5
5323 cat conftest.$ac_ext >&5
5324 eval "$as_ac_Lib=no"
5325 fi
5326 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5327 LIBS=$ac_check_lib_save_LIBS
5328 fi
5329 echo "$as_me:5329: result: `eval echo '${'$as_ac_Lib'}'`" >&5
5330 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
5331 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
5332   break
5333 fi
5334
5335                         done
5336
5337 fi
5338
5339         fi
5340
5341         # Check for library containing initscr
5342         test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS"
5343         if test "x$cf_curs_lib" = x
5344         then
5345                 for cf_curs_lib in $cf_check_list xcurses jcurses pdcurses unknown
5346                 do
5347                         as_ac_Lib=`echo "ac_cv_lib_$cf_curs_lib''_initscr" | $as_tr_sh`
5348 echo "$as_me:5348: checking for initscr in -l$cf_curs_lib" >&5
5349 echo $ECHO_N "checking for initscr in -l$cf_curs_lib... $ECHO_C" >&6
5350 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
5351   echo $ECHO_N "(cached) $ECHO_C" >&6
5352 else
5353   ac_check_lib_save_LIBS=$LIBS
5354 LIBS="-l$cf_curs_lib  $LIBS"
5355 cat >conftest.$ac_ext <<_ACEOF
5356 #line 5356 "configure"
5357 #include "confdefs.h"
5358
5359 /* Override any gcc2 internal prototype to avoid an error.  */
5360 #ifdef __cplusplus
5361 extern "C"
5362 #endif
5363 /* We use char because int might match the return type of a gcc2
5364    builtin and then its argument prototype would still apply.  */
5365 char initscr ();
5366 int
5367 main ()
5368 {
5369 initscr ();
5370   ;
5371   return 0;
5372 }
5373 _ACEOF
5374 rm -f conftest.$ac_objext conftest$ac_exeext
5375 if { (eval echo "$as_me:5375: \"$ac_link\"") >&5
5376   (eval $ac_link) 2>&5
5377   ac_status=$?
5378   echo "$as_me:5378: \$? = $ac_status" >&5
5379   (exit $ac_status); } &&
5380          { ac_try='test -s conftest$ac_exeext'
5381   { (eval echo "$as_me:5381: \"$ac_try\"") >&5
5382   (eval $ac_try) 2>&5
5383   ac_status=$?
5384   echo "$as_me:5384: \$? = $ac_status" >&5
5385   (exit $ac_status); }; }; then
5386   eval "$as_ac_Lib=yes"
5387 else
5388   echo "$as_me: failed program was:" >&5
5389 cat conftest.$ac_ext >&5
5390 eval "$as_ac_Lib=no"
5391 fi
5392 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5393 LIBS=$ac_check_lib_save_LIBS
5394 fi
5395 echo "$as_me:5395: result: `eval echo '${'$as_ac_Lib'}'`" >&5
5396 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
5397 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
5398   break
5399 fi
5400
5401                 done
5402         fi
5403         test $cf_curs_lib = unknown && { { echo "$as_me:5403: error: no curses library found" >&5
5404 echo "$as_me: error: no curses library found" >&2;}
5405    { (exit 1); exit 1; }; }
5406
5407         LIBS="-l$cf_curs_lib $cf_save_LIBS"
5408         if test "$cf_term_lib" = unknown ; then
5409                 echo "$as_me:5409: checking if we can link with $cf_curs_lib library" >&5
5410 echo $ECHO_N "checking if we can link with $cf_curs_lib library... $ECHO_C" >&6
5411                 cat >conftest.$ac_ext <<_ACEOF
5412 #line 5412 "configure"
5413 #include "confdefs.h"
5414 #include <${cf_cv_ncurses_header:-curses.h}>
5415 int
5416 main ()
5417 {
5418 initscr()
5419   ;
5420   return 0;
5421 }
5422 _ACEOF
5423 rm -f conftest.$ac_objext conftest$ac_exeext
5424 if { (eval echo "$as_me:5424: \"$ac_link\"") >&5
5425   (eval $ac_link) 2>&5
5426   ac_status=$?
5427   echo "$as_me:5427: \$? = $ac_status" >&5
5428   (exit $ac_status); } &&
5429          { ac_try='test -s conftest$ac_exeext'
5430   { (eval echo "$as_me:5430: \"$ac_try\"") >&5
5431   (eval $ac_try) 2>&5
5432   ac_status=$?
5433   echo "$as_me:5433: \$? = $ac_status" >&5
5434   (exit $ac_status); }; }; then
5435   cf_result=yes
5436 else
5437   echo "$as_me: failed program was:" >&5
5438 cat conftest.$ac_ext >&5
5439 cf_result=no
5440 fi
5441 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5442                 echo "$as_me:5442: result: $cf_result" >&5
5443 echo "${ECHO_T}$cf_result" >&6
5444                 test $cf_result = no && { { echo "$as_me:5444: error: Cannot link curses library" >&5
5445 echo "$as_me: error: Cannot link curses library" >&2;}
5446    { (exit 1); exit 1; }; }
5447         elif test "$cf_curs_lib" = "$cf_term_lib" ; then
5448                 :
5449         elif test "$cf_term_lib" != predefined ; then
5450                 echo "$as_me:5450: checking if we need both $cf_curs_lib and $cf_term_lib libraries" >&5
5451 echo $ECHO_N "checking if we need both $cf_curs_lib and $cf_term_lib libraries... $ECHO_C" >&6
5452                 cat >conftest.$ac_ext <<_ACEOF
5453 #line 5453 "configure"
5454 #include "confdefs.h"
5455 #include <${cf_cv_ncurses_header:-curses.h}>
5456 int
5457 main ()
5458 {
5459 initscr(); tgoto((char *)0, 0, 0);
5460   ;
5461   return 0;
5462 }
5463 _ACEOF
5464 rm -f conftest.$ac_objext conftest$ac_exeext
5465 if { (eval echo "$as_me:5465: \"$ac_link\"") >&5
5466   (eval $ac_link) 2>&5
5467   ac_status=$?
5468   echo "$as_me:5468: \$? = $ac_status" >&5
5469   (exit $ac_status); } &&
5470          { ac_try='test -s conftest$ac_exeext'
5471   { (eval echo "$as_me:5471: \"$ac_try\"") >&5
5472   (eval $ac_try) 2>&5
5473   ac_status=$?
5474   echo "$as_me:5474: \$? = $ac_status" >&5
5475   (exit $ac_status); }; }; then
5476   cf_result=no
5477 else
5478   echo "$as_me: failed program was:" >&5
5479 cat conftest.$ac_ext >&5
5480
5481                         LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
5482                         cat >conftest.$ac_ext <<_ACEOF
5483 #line 5483 "configure"
5484 #include "confdefs.h"
5485 #include <${cf_cv_ncurses_header:-curses.h}>
5486 int
5487 main ()
5488 {
5489 initscr()
5490   ;
5491   return 0;
5492 }
5493 _ACEOF
5494 rm -f conftest.$ac_objext conftest$ac_exeext
5495 if { (eval echo "$as_me:5495: \"$ac_link\"") >&5
5496   (eval $ac_link) 2>&5
5497   ac_status=$?
5498   echo "$as_me:5498: \$? = $ac_status" >&5
5499   (exit $ac_status); } &&
5500          { ac_try='test -s conftest$ac_exeext'
5501   { (eval echo "$as_me:5501: \"$ac_try\"") >&5
5502   (eval $ac_try) 2>&5
5503   ac_status=$?
5504   echo "$as_me:5504: \$? = $ac_status" >&5
5505   (exit $ac_status); }; }; then
5506   cf_result=yes
5507 else
5508   echo "$as_me: failed program was:" >&5
5509 cat conftest.$ac_ext >&5
5510 cf_result=error
5511 fi
5512 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5513
5514 fi
5515 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5516                 echo "$as_me:5516: result: $cf_result" >&5
5517 echo "${ECHO_T}$cf_result" >&6
5518         fi
5519 fi
5520 fi
5521
5522         ;;
5523 (ncursesw*)
5524
5525 echo "$as_me:5525: checking for multibyte character support" >&5
5526 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
5527 if test "${cf_cv_utf8_lib+set}" = set; then
5528   echo $ECHO_N "(cached) $ECHO_C" >&6
5529 else
5530
5531         cf_save_LIBS="$LIBS"
5532         cat >conftest.$ac_ext <<_ACEOF
5533 #line 5533 "configure"
5534 #include "confdefs.h"
5535
5536 #include <stdlib.h>
5537 int
5538 main ()
5539 {
5540 putwc(0,0);
5541   ;
5542   return 0;
5543 }
5544 _ACEOF
5545 rm -f conftest.$ac_objext conftest$ac_exeext
5546 if { (eval echo "$as_me:5546: \"$ac_link\"") >&5
5547   (eval $ac_link) 2>&5
5548   ac_status=$?
5549   echo "$as_me:5549: \$? = $ac_status" >&5
5550   (exit $ac_status); } &&
5551          { ac_try='test -s conftest$ac_exeext'
5552   { (eval echo "$as_me:5552: \"$ac_try\"") >&5
5553   (eval $ac_try) 2>&5
5554   ac_status=$?
5555   echo "$as_me:5555: \$? = $ac_status" >&5
5556   (exit $ac_status); }; }; then
5557   cf_cv_utf8_lib=yes
5558 else
5559   echo "$as_me: failed program was:" >&5
5560 cat conftest.$ac_ext >&5
5561
5562 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
5563 # will be set on completion of the AC_TRY_LINK below.
5564 cf_cv_header_path_utf8=
5565 cf_cv_library_path_utf8=
5566
5567 echo "${as_me:-configure}:5567: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
5568
5569 cf_save_LIBS="$LIBS"
5570
5571 cat >conftest.$ac_ext <<_ACEOF
5572 #line 5572 "configure"
5573 #include "confdefs.h"
5574
5575 #include <libutf8.h>
5576 int
5577 main ()
5578 {
5579 putwc(0,0);
5580   ;
5581   return 0;
5582 }
5583 _ACEOF
5584 rm -f conftest.$ac_objext conftest$ac_exeext
5585 if { (eval echo "$as_me:5585: \"$ac_link\"") >&5
5586   (eval $ac_link) 2>&5
5587   ac_status=$?
5588   echo "$as_me:5588: \$? = $ac_status" >&5
5589   (exit $ac_status); } &&
5590          { ac_try='test -s conftest$ac_exeext'
5591   { (eval echo "$as_me:5591: \"$ac_try\"") >&5
5592   (eval $ac_try) 2>&5
5593   ac_status=$?
5594   echo "$as_me:5594: \$? = $ac_status" >&5
5595   (exit $ac_status); }; }; then
5596
5597         cf_cv_find_linkage_utf8=yes
5598         cf_cv_header_path_utf8=/usr/include
5599         cf_cv_library_path_utf8=/usr/lib
5600
5601 else
5602   echo "$as_me: failed program was:" >&5
5603 cat conftest.$ac_ext >&5
5604
5605 LIBS="-lutf8  $cf_save_LIBS"
5606
5607 cat >conftest.$ac_ext <<_ACEOF
5608 #line 5608 "configure"
5609 #include "confdefs.h"
5610
5611 #include <libutf8.h>
5612 int
5613 main ()
5614 {
5615 putwc(0,0);
5616   ;
5617   return 0;
5618 }
5619 _ACEOF
5620 rm -f conftest.$ac_objext conftest$ac_exeext
5621 if { (eval echo "$as_me:5621: \"$ac_link\"") >&5
5622   (eval $ac_link) 2>&5
5623   ac_status=$?
5624   echo "$as_me:5624: \$? = $ac_status" >&5
5625   (exit $ac_status); } &&
5626          { ac_try='test -s conftest$ac_exeext'
5627   { (eval echo "$as_me:5627: \"$ac_try\"") >&5
5628   (eval $ac_try) 2>&5
5629   ac_status=$?
5630   echo "$as_me:5630: \$? = $ac_status" >&5
5631   (exit $ac_status); }; }; then
5632
5633         cf_cv_find_linkage_utf8=yes
5634         cf_cv_header_path_utf8=/usr/include
5635         cf_cv_library_path_utf8=/usr/lib
5636         cf_cv_library_file_utf8="-lutf8"
5637
5638 else
5639   echo "$as_me: failed program was:" >&5
5640 cat conftest.$ac_ext >&5
5641
5642         cf_cv_find_linkage_utf8=no
5643         LIBS="$cf_save_LIBS"
5644
5645         test -n "$verbose" && echo "    find linkage for utf8 library" 1>&6
5646
5647 echo "${as_me:-configure}:5647: testing find linkage for utf8 library ..." 1>&5
5648
5649 echo "${as_me:-configure}:5649: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
5650
5651         cf_save_CPPFLAGS="$CPPFLAGS"
5652         cf_test_CPPFLAGS="$CPPFLAGS"
5653
5654 cf_search=
5655
5656 # collect the current set of include-directories from compiler flags
5657 cf_header_path_list=""
5658 if test -n "${CFLAGS}${CPPFLAGS}" ; then
5659         for cf_header_path in $CPPFLAGS $CFLAGS
5660         do
5661                 case $cf_header_path in
5662                 (-I*)
5663                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
5664
5665 test "x$cf_header_path" != "xNONE" && \
5666 test -d "$cf_header_path" && \
5667  {
5668         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
5669         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
5670         test -d $cf_header_path/include/utf8 &&       cf_search="$cf_search $cf_header_path/include/utf8"
5671         test -d $cf_header_path/include/utf8/include &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
5672         test -d $cf_header_path/utf8/include &&       cf_search="$cf_search $cf_header_path/utf8/include"
5673         test -d $cf_header_path/utf8/include/utf8 &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
5674 }
5675
5676                         cf_header_path_list="$cf_header_path_list $cf_search"
5677                         ;;
5678                 esac
5679         done
5680 fi
5681
5682 # add the variations for the package we are looking for
5683
5684 cf_search=
5685
5686 test "x$prefix" != "xNONE" && \
5687 test -d "$prefix" && \
5688  {
5689         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
5690         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
5691         test -d $prefix/include/utf8 &&       cf_search="$cf_search $prefix/include/utf8"
5692         test -d $prefix/include/utf8/include &&    cf_search="$cf_search $prefix/include/utf8/include"
5693         test -d $prefix/utf8/include &&       cf_search="$cf_search $prefix/utf8/include"
5694         test -d $prefix/utf8/include/utf8 &&    cf_search="$cf_search $prefix/utf8/include/utf8"
5695 }
5696
5697 for cf_subdir_prefix in \
5698         /usr \
5699         /usr/local \
5700         /usr/pkg \
5701         /opt \
5702         /opt/local \
5703         $HOME
5704 do
5705
5706 test "x$cf_subdir_prefix" != "x$prefix" && \
5707 test -d "$cf_subdir_prefix" && \
5708 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
5709         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
5710         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
5711         test -d $cf_subdir_prefix/include/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/include/utf8"
5712         test -d $cf_subdir_prefix/include/utf8/include &&    cf_search="$cf_search $cf_subdir_prefix/include/utf8/include"
5713         test -d $cf_subdir_prefix/utf8/include &&       cf_search="$cf_search $cf_subdir_prefix/utf8/include"
5714         test -d $cf_subdir_prefix/utf8/include/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/include/utf8"
5715 }
5716
5717 done
5718
5719 test "$includedir" != NONE && \
5720 test "$includedir" != "/usr/include" && \
5721 test -d "$includedir" && {
5722         test -d $includedir &&    cf_search="$cf_search $includedir"
5723         test -d $includedir/utf8 && cf_search="$cf_search $includedir/utf8"
5724 }
5725
5726 test "$oldincludedir" != NONE && \
5727 test "$oldincludedir" != "/usr/include" && \
5728 test -d "$oldincludedir" && {
5729         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
5730         test -d $oldincludedir/utf8 && cf_search="$cf_search $oldincludedir/utf8"
5731 }
5732
5733 cf_search="$cf_search $cf_header_path_list"
5734
5735         for cf_cv_header_path_utf8 in $cf_search
5736         do
5737                 if test -d $cf_cv_header_path_utf8 ; then
5738                         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
5739
5740 echo "${as_me:-configure}:5740: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
5741
5742                         CPPFLAGS="$cf_save_CPPFLAGS -I$cf_cv_header_path_utf8"
5743                         cat >conftest.$ac_ext <<_ACEOF
5744 #line 5744 "configure"
5745 #include "confdefs.h"
5746
5747 #include <libutf8.h>
5748 int
5749 main ()
5750 {
5751 putwc(0,0);
5752   ;
5753   return 0;
5754 }
5755 _ACEOF
5756 rm -f conftest.$ac_objext
5757 if { (eval echo "$as_me:5757: \"$ac_compile\"") >&5
5758   (eval $ac_compile) 2>&5
5759   ac_status=$?
5760   echo "$as_me:5760: \$? = $ac_status" >&5
5761   (exit $ac_status); } &&
5762          { ac_try='test -s conftest.$ac_objext'
5763   { (eval echo "$as_me:5763: \"$ac_try\"") >&5
5764   (eval $ac_try) 2>&5
5765   ac_status=$?
5766   echo "$as_me:5766: \$? = $ac_status" >&5
5767   (exit $ac_status); }; }; then
5768
5769                                 test -n "$verbose" && echo "    ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
5770
5771 echo "${as_me:-configure}:5771: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
5772
5773                                 cf_cv_find_linkage_utf8=maybe
5774                                 cf_test_CPPFLAGS="$CPPFLAGS"
5775                                 break
5776 else
5777   echo "$as_me: failed program was:" >&5
5778 cat conftest.$ac_ext >&5
5779
5780                                 CPPFLAGS="$cf_save_CPPFLAGS"
5781
5782 fi
5783 rm -f conftest.$ac_objext conftest.$ac_ext
5784                 fi
5785         done
5786
5787         if test "$cf_cv_find_linkage_utf8" = maybe ; then
5788
5789 echo "${as_me:-configure}:5789: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
5790
5791                 cf_save_LIBS="$LIBS"
5792                 cf_save_LDFLAGS="$LDFLAGS"
5793
5794                 if test "$cf_cv_find_linkage_utf8" != yes ; then
5795
5796 cf_search=
5797 cf_library_path_list=""
5798 if test -n "${LDFLAGS}${LIBS}" ; then
5799         for cf_library_path in $LDFLAGS $LIBS
5800         do
5801                 case $cf_library_path in
5802                 (-L*)
5803                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
5804
5805 test "x$cf_library_path" != "xNONE" && \
5806 test -d "$cf_library_path" && \
5807  {
5808         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
5809         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
5810         test -d $cf_library_path/lib/utf8 &&       cf_search="$cf_search $cf_library_path/lib/utf8"
5811         test -d $cf_library_path/lib/utf8/lib &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
5812         test -d $cf_library_path/utf8/lib &&       cf_search="$cf_search $cf_library_path/utf8/lib"
5813         test -d $cf_library_path/utf8/lib/utf8 &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
5814 }
5815
5816                         cf_library_path_list="$cf_library_path_list $cf_search"
5817                         ;;
5818                 esac
5819         done
5820 fi
5821
5822 cf_search=
5823
5824 test "x$prefix" != "xNONE" && \
5825 test -d "$prefix" && \
5826  {
5827         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
5828         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
5829         test -d $prefix/lib/utf8 &&       cf_search="$cf_search $prefix/lib/utf8"
5830         test -d $prefix/lib/utf8/lib &&    cf_search="$cf_search $prefix/lib/utf8/lib"
5831         test -d $prefix/utf8/lib &&       cf_search="$cf_search $prefix/utf8/lib"
5832         test -d $prefix/utf8/lib/utf8 &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
5833 }
5834
5835 for cf_subdir_prefix in \
5836         /usr \
5837         /usr/local \
5838         /usr/pkg \
5839         /opt \
5840         /opt/local \
5841         $HOME
5842 do
5843
5844 test "x$cf_subdir_prefix" != "x$prefix" && \
5845 test -d "$cf_subdir_prefix" && \
5846 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
5847         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
5848         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
5849         test -d $cf_subdir_prefix/lib/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/lib/utf8"
5850         test -d $cf_subdir_prefix/lib/utf8/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/utf8/lib"
5851         test -d $cf_subdir_prefix/utf8/lib &&       cf_search="$cf_search $cf_subdir_prefix/utf8/lib"
5852         test -d $cf_subdir_prefix/utf8/lib/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/lib/utf8"
5853 }
5854
5855 done
5856
5857 cf_search="$cf_library_path_list $cf_search"
5858
5859                         for cf_cv_library_path_utf8 in $cf_search
5860                         do
5861                                 if test -d $cf_cv_library_path_utf8 ; then
5862                                         test -n "$verbose" && echo "    ... testing $cf_cv_library_path_utf8" 1>&6
5863
5864 echo "${as_me:-configure}:5864: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
5865
5866                                         CPPFLAGS="$cf_test_CPPFLAGS"
5867                                         LIBS="-lutf8  $cf_save_LIBS"
5868                                         LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
5869                                         cat >conftest.$ac_ext <<_ACEOF
5870 #line 5870 "configure"
5871 #include "confdefs.h"
5872
5873 #include <libutf8.h>
5874 int
5875 main ()
5876 {
5877 putwc(0,0);
5878   ;
5879   return 0;
5880 }
5881 _ACEOF
5882 rm -f conftest.$ac_objext conftest$ac_exeext
5883 if { (eval echo "$as_me:5883: \"$ac_link\"") >&5
5884   (eval $ac_link) 2>&5
5885   ac_status=$?
5886   echo "$as_me:5886: \$? = $ac_status" >&5
5887   (exit $ac_status); } &&
5888          { ac_try='test -s conftest$ac_exeext'
5889   { (eval echo "$as_me:5889: \"$ac_try\"") >&5
5890   (eval $ac_try) 2>&5
5891   ac_status=$?
5892   echo "$as_me:5892: \$? = $ac_status" >&5
5893   (exit $ac_status); }; }; then
5894
5895                                         test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
5896
5897 echo "${as_me:-configure}:5897: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
5898
5899                                         cf_cv_find_linkage_utf8=yes
5900                                         cf_cv_library_file_utf8="-lutf8"
5901                                         break
5902 else
5903   echo "$as_me: failed program was:" >&5
5904 cat conftest.$ac_ext >&5
5905
5906                                         CPPFLAGS="$cf_save_CPPFLAGS"
5907                                         LIBS="$cf_save_LIBS"
5908                                         LDFLAGS="$cf_save_LDFLAGS"
5909
5910 fi
5911 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5912                                 fi
5913                         done
5914                         CPPFLAGS="$cf_save_CPPFLAGS"
5915                         LDFLAGS="$cf_save_LDFLAGS"
5916                 fi
5917
5918         else
5919                 cf_cv_find_linkage_utf8=no
5920         fi
5921
5922 fi
5923 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5924
5925 fi
5926 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5927
5928 LIBS="$cf_save_LIBS"
5929
5930 if test "$cf_cv_find_linkage_utf8" = yes ; then
5931 cf_cv_utf8_lib=add-on
5932 else
5933 cf_cv_utf8_lib=no
5934 fi
5935
5936 fi
5937 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5938 fi
5939 echo "$as_me:5939: result: $cf_cv_utf8_lib" >&5
5940 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
5941
5942 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
5943 # ncurses/ncursesw:
5944 if test "$cf_cv_utf8_lib" = "add-on" ; then
5945
5946 cat >>confdefs.h <<\EOF
5947 #define HAVE_LIBUTF8_H 1
5948 EOF
5949
5950 if test -n "$cf_cv_header_path_utf8" ; then
5951   for cf_add_incdir in $cf_cv_header_path_utf8
5952   do
5953         while test $cf_add_incdir != /usr/include
5954         do
5955           if test -d $cf_add_incdir
5956           then
5957                 cf_have_incdir=no
5958                 if test -n "$CFLAGS$CPPFLAGS" ; then
5959                   # a loop is needed to ensure we can add subdirs of existing dirs
5960                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5961                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5962                           cf_have_incdir=yes; break
5963                         fi
5964                   done
5965                 fi
5966
5967                 if test "$cf_have_incdir" = no ; then
5968                   if test "$cf_add_incdir" = /usr/local/include ; then
5969                         if test "$GCC" = yes
5970                         then
5971                           cf_save_CPPFLAGS=$CPPFLAGS
5972                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5973                           cat >conftest.$ac_ext <<_ACEOF
5974 #line 5974 "configure"
5975 #include "confdefs.h"
5976 #include <stdio.h>
5977 int
5978 main ()
5979 {
5980 printf("Hello")
5981   ;
5982   return 0;
5983 }
5984 _ACEOF
5985 rm -f conftest.$ac_objext
5986 if { (eval echo "$as_me:5986: \"$ac_compile\"") >&5
5987   (eval $ac_compile) 2>&5
5988   ac_status=$?
5989   echo "$as_me:5989: \$? = $ac_status" >&5
5990   (exit $ac_status); } &&
5991          { ac_try='test -s conftest.$ac_objext'
5992   { (eval echo "$as_me:5992: \"$ac_try\"") >&5
5993   (eval $ac_try) 2>&5
5994   ac_status=$?
5995   echo "$as_me:5995: \$? = $ac_status" >&5
5996   (exit $ac_status); }; }; then
5997   :
5998 else
5999   echo "$as_me: failed program was:" >&5
6000 cat conftest.$ac_ext >&5
6001 cf_have_incdir=yes
6002 fi
6003 rm -f conftest.$ac_objext conftest.$ac_ext
6004                           CPPFLAGS=$cf_save_CPPFLAGS
6005                         fi
6006                   fi
6007                 fi
6008
6009                 if test "$cf_have_incdir" = no ; then
6010                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6011
6012 echo "${as_me:-configure}:6012: testing adding $cf_add_incdir to include-path ..." 1>&5
6013
6014                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6015
6016                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6017                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6018                   cf_add_incdir="$cf_top_incdir"
6019                 else
6020                   break
6021                 fi
6022           else
6023                 break
6024           fi
6025         done
6026   done
6027 fi
6028
6029 if test -n "$cf_cv_library_path_utf8" ; then
6030         for cf_add_libdir in $cf_cv_library_path_utf8
6031         do
6032                 if test $cf_add_libdir = /usr/lib ; then
6033                         :
6034                 elif test -d $cf_add_libdir
6035                 then
6036                         cf_have_libdir=no
6037                         if test -n "$LDFLAGS$LIBS" ; then
6038                                 # a loop is needed to ensure we can add subdirs of existing dirs
6039                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6040                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6041                                                 cf_have_libdir=yes; break
6042                                         fi
6043                                 done
6044                         fi
6045                         if test "$cf_have_libdir" = no ; then
6046                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6047
6048 echo "${as_me:-configure}:6048: testing adding $cf_add_libdir to library-path ..." 1>&5
6049
6050                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6051                         fi
6052                 fi
6053         done
6054 fi
6055
6056 cf_add_libs="$cf_cv_library_file_utf8"
6057 # Filter out duplicates - this happens with badly-designed ".pc" files...
6058 for cf_add_1lib in $LIBS
6059 do
6060         for cf_add_2lib in $cf_add_libs
6061         do
6062                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6063                 then
6064                         cf_add_1lib=
6065                         break
6066                 fi
6067         done
6068         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6069 done
6070 LIBS="$cf_add_libs"
6071
6072 fi
6073
6074 cf_ncuconfig_root=$cf_cv_screen
6075 cf_have_ncuconfig=no
6076
6077 if test "x${PKG_CONFIG:=none}" != xnone; then
6078         echo "$as_me:6078: checking pkg-config for $cf_ncuconfig_root" >&5
6079 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
6080         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
6081                 echo "$as_me:6081: result: yes" >&5
6082 echo "${ECHO_T}yes" >&6
6083
6084                 echo "$as_me:6084: checking if the $cf_ncuconfig_root package files work" >&5
6085 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
6086                 cf_have_ncuconfig=unknown
6087
6088                 cf_save_CPPFLAGS="$CPPFLAGS"
6089                 cf_save_LIBS="$LIBS"
6090
6091                 CPPFLAGS="$CPPFLAGS `$PKG_CONFIG --cflags $cf_ncuconfig_root`"
6092
6093 cf_add_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
6094 # Filter out duplicates - this happens with badly-designed ".pc" files...
6095 for cf_add_1lib in $LIBS
6096 do
6097         for cf_add_2lib in $cf_add_libs
6098         do
6099                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6100                 then
6101                         cf_add_1lib=
6102                         break
6103                 fi
6104         done
6105         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6106 done
6107 LIBS="$cf_add_libs"
6108
6109                 cat >conftest.$ac_ext <<_ACEOF
6110 #line 6110 "configure"
6111 #include "confdefs.h"
6112 #include <${cf_cv_ncurses_header:-curses.h}>
6113 int
6114 main ()
6115 {
6116 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
6117   ;
6118   return 0;
6119 }
6120 _ACEOF
6121 rm -f conftest.$ac_objext conftest$ac_exeext
6122 if { (eval echo "$as_me:6122: \"$ac_link\"") >&5
6123   (eval $ac_link) 2>&5
6124   ac_status=$?
6125   echo "$as_me:6125: \$? = $ac_status" >&5
6126   (exit $ac_status); } &&
6127          { ac_try='test -s conftest$ac_exeext'
6128   { (eval echo "$as_me:6128: \"$ac_try\"") >&5
6129   (eval $ac_try) 2>&5
6130   ac_status=$?
6131   echo "$as_me:6131: \$? = $ac_status" >&5
6132   (exit $ac_status); }; }; then
6133   if test "$cross_compiling" = yes; then
6134   cf_have_ncuconfig=maybe
6135 else
6136   cat >conftest.$ac_ext <<_ACEOF
6137 #line 6137 "configure"
6138 #include "confdefs.h"
6139 #include <${cf_cv_ncurses_header:-curses.h}>
6140                                 int main(void)
6141                                 { char *xx = curses_version(); return (xx == 0); }
6142 _ACEOF
6143 rm -f conftest$ac_exeext
6144 if { (eval echo "$as_me:6144: \"$ac_link\"") >&5
6145   (eval $ac_link) 2>&5
6146   ac_status=$?
6147   echo "$as_me:6147: \$? = $ac_status" >&5
6148   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
6149   { (eval echo "$as_me:6149: \"$ac_try\"") >&5
6150   (eval $ac_try) 2>&5
6151   ac_status=$?
6152   echo "$as_me:6152: \$? = $ac_status" >&5
6153   (exit $ac_status); }; }; then
6154   cf_have_ncuconfig=yes
6155 else
6156   echo "$as_me: program exited with status $ac_status" >&5
6157 echo "$as_me: failed program was:" >&5
6158 cat conftest.$ac_ext >&5
6159 cf_have_ncuconfig=no
6160 fi
6161 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
6162 fi
6163 else
6164   echo "$as_me: failed program was:" >&5
6165 cat conftest.$ac_ext >&5
6166 cf_have_ncuconfig=no
6167 fi
6168 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6169                 echo "$as_me:6169: result: $cf_have_ncuconfig" >&5
6170 echo "${ECHO_T}$cf_have_ncuconfig" >&6
6171                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
6172                 if test "$cf_have_ncuconfig" != "yes"
6173                 then
6174                         CPPFLAGS="$cf_save_CPPFLAGS"
6175                         LIBS="$cf_save_LIBS"
6176                         NCURSES_CONFIG_PKG=none
6177                 else
6178
6179 cat >>confdefs.h <<\EOF
6180 #define NCURSES 1
6181 EOF
6182
6183                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
6184                 fi
6185
6186         else
6187                 echo "$as_me:6187: result: no" >&5
6188 echo "${ECHO_T}no" >&6
6189                 NCURSES_CONFIG_PKG=none
6190         fi
6191 else
6192         NCURSES_CONFIG_PKG=none
6193 fi
6194
6195 if test "x$cf_have_ncuconfig" = "xno"; then
6196         echo "Looking for ${cf_ncuconfig_root}-config"
6197
6198 if test -n "$ac_tool_prefix"; then
6199   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
6200   do
6201     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
6202 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
6203 echo "$as_me:6203: checking for $ac_word" >&5
6204 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
6205 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
6206   echo $ECHO_N "(cached) $ECHO_C" >&6
6207 else
6208   if test -n "$NCURSES_CONFIG"; then
6209   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
6210 else
6211   ac_save_IFS=$IFS; IFS=$ac_path_separator
6212 ac_dummy="$PATH"
6213 for ac_dir in $ac_dummy; do
6214   IFS=$ac_save_IFS
6215   test -z "$ac_dir" && ac_dir=.
6216   $as_executable_p "$ac_dir/$ac_word" || continue
6217 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
6218 echo "$as_me:6218: found $ac_dir/$ac_word" >&5
6219 break
6220 done
6221
6222 fi
6223 fi
6224 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
6225 if test -n "$NCURSES_CONFIG"; then
6226   echo "$as_me:6226: result: $NCURSES_CONFIG" >&5
6227 echo "${ECHO_T}$NCURSES_CONFIG" >&6
6228 else
6229   echo "$as_me:6229: result: no" >&5
6230 echo "${ECHO_T}no" >&6
6231 fi
6232
6233     test -n "$NCURSES_CONFIG" && break
6234   done
6235 fi
6236 if test -z "$NCURSES_CONFIG"; then
6237   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
6238   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
6239 do
6240   # Extract the first word of "$ac_prog", so it can be a program name with args.
6241 set dummy $ac_prog; ac_word=$2
6242 echo "$as_me:6242: checking for $ac_word" >&5
6243 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
6244 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
6245   echo $ECHO_N "(cached) $ECHO_C" >&6
6246 else
6247   if test -n "$ac_ct_NCURSES_CONFIG"; then
6248   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
6249 else
6250   ac_save_IFS=$IFS; IFS=$ac_path_separator
6251 ac_dummy="$PATH"
6252 for ac_dir in $ac_dummy; do
6253   IFS=$ac_save_IFS
6254   test -z "$ac_dir" && ac_dir=.
6255   $as_executable_p "$ac_dir/$ac_word" || continue
6256 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
6257 echo "$as_me:6257: found $ac_dir/$ac_word" >&5
6258 break
6259 done
6260
6261 fi
6262 fi
6263 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
6264 if test -n "$ac_ct_NCURSES_CONFIG"; then
6265   echo "$as_me:6265: result: $ac_ct_NCURSES_CONFIG" >&5
6266 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
6267 else
6268   echo "$as_me:6268: result: no" >&5
6269 echo "${ECHO_T}no" >&6
6270 fi
6271
6272   test -n "$ac_ct_NCURSES_CONFIG" && break
6273 done
6274 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
6275
6276   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
6277 fi
6278
6279         if test "$NCURSES_CONFIG" != none ; then
6280
6281                 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
6282
6283 cf_add_libs="`$NCURSES_CONFIG --libs`"
6284 # Filter out duplicates - this happens with badly-designed ".pc" files...
6285 for cf_add_1lib in $LIBS
6286 do
6287         for cf_add_2lib in $cf_add_libs
6288         do
6289                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6290                 then
6291                         cf_add_1lib=
6292                         break
6293                 fi
6294         done
6295         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6296 done
6297 LIBS="$cf_add_libs"
6298
6299                 # even with config script, some packages use no-override for curses.h
6300
6301 echo "$as_me:6301: checking if we have identified curses headers" >&5
6302 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
6303 if test "${cf_cv_ncurses_header+set}" = set; then
6304   echo $ECHO_N "(cached) $ECHO_C" >&6
6305 else
6306
6307 cf_cv_ncurses_header=none
6308 for cf_header in \
6309         ncurses.h $cf_cv_screen/ncurses.h \
6310         curses.h $cf_cv_screen/curses.h
6311 do
6312 cat >conftest.$ac_ext <<_ACEOF
6313 #line 6313 "configure"
6314 #include "confdefs.h"
6315 #include <${cf_header}>
6316 int
6317 main ()
6318 {
6319 initscr(); tgoto("?", 0,0)
6320   ;
6321   return 0;
6322 }
6323 _ACEOF
6324 rm -f conftest.$ac_objext
6325 if { (eval echo "$as_me:6325: \"$ac_compile\"") >&5
6326   (eval $ac_compile) 2>&5
6327   ac_status=$?
6328   echo "$as_me:6328: \$? = $ac_status" >&5
6329   (exit $ac_status); } &&
6330          { ac_try='test -s conftest.$ac_objext'
6331   { (eval echo "$as_me:6331: \"$ac_try\"") >&5
6332   (eval $ac_try) 2>&5
6333   ac_status=$?
6334   echo "$as_me:6334: \$? = $ac_status" >&5
6335   (exit $ac_status); }; }; then
6336   cf_cv_ncurses_header=$cf_header; break
6337 else
6338   echo "$as_me: failed program was:" >&5
6339 cat conftest.$ac_ext >&5
6340 fi
6341 rm -f conftest.$ac_objext conftest.$ac_ext
6342 done
6343
6344 fi
6345 echo "$as_me:6345: result: $cf_cv_ncurses_header" >&5
6346 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
6347
6348 if test "$cf_cv_ncurses_header" = none ; then
6349         { { echo "$as_me:6349: error: No curses header-files found" >&5
6350 echo "$as_me: error: No curses header-files found" >&2;}
6351    { (exit 1); exit 1; }; }
6352 fi
6353
6354 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
6355
6356 for ac_header in $cf_cv_ncurses_header
6357 do
6358 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
6359 echo "$as_me:6359: checking for $ac_header" >&5
6360 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
6361 if eval "test \"\${$as_ac_Header+set}\" = set"; then
6362   echo $ECHO_N "(cached) $ECHO_C" >&6
6363 else
6364   cat >conftest.$ac_ext <<_ACEOF
6365 #line 6365 "configure"
6366 #include "confdefs.h"
6367 #include <$ac_header>
6368 _ACEOF
6369 if { (eval echo "$as_me:6369: \"$ac_cpp conftest.$ac_ext\"") >&5
6370   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
6371   ac_status=$?
6372   egrep -v '^ *\+' conftest.er1 >conftest.err
6373   rm -f conftest.er1
6374   cat conftest.err >&5
6375   echo "$as_me:6375: \$? = $ac_status" >&5
6376   (exit $ac_status); } >/dev/null; then
6377   if test -s conftest.err; then
6378     ac_cpp_err=$ac_c_preproc_warn_flag
6379   else
6380     ac_cpp_err=
6381   fi
6382 else
6383   ac_cpp_err=yes
6384 fi
6385 if test -z "$ac_cpp_err"; then
6386   eval "$as_ac_Header=yes"
6387 else
6388   echo "$as_me: failed program was:" >&5
6389   cat conftest.$ac_ext >&5
6390   eval "$as_ac_Header=no"
6391 fi
6392 rm -f conftest.err conftest.$ac_ext
6393 fi
6394 echo "$as_me:6394: result: `eval echo '${'$as_ac_Header'}'`" >&5
6395 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
6396 if test `eval echo '${'$as_ac_Header'}'` = yes; then
6397   cat >>confdefs.h <<EOF
6398 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
6399 EOF
6400
6401 fi
6402 done
6403
6404 cat >>confdefs.h <<\EOF
6405 #define NCURSES 1
6406 EOF
6407
6408 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
6409
6410                 cat >>confdefs.h <<EOF
6411 #define $cf_nculib_ROOT 1
6412 EOF
6413
6414                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
6415
6416         else
6417
6418 cf_ncuhdr_root=$cf_cv_screen
6419
6420 test -n "$cf_cv_curses_dir" && \
6421 test "$cf_cv_curses_dir" != "no" && { \
6422
6423 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
6424   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
6425   do
6426         while test $cf_add_incdir != /usr/include
6427         do
6428           if test -d $cf_add_incdir
6429           then
6430                 cf_have_incdir=no
6431                 if test -n "$CFLAGS$CPPFLAGS" ; then
6432                   # a loop is needed to ensure we can add subdirs of existing dirs
6433                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6434                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6435                           cf_have_incdir=yes; break
6436                         fi
6437                   done
6438                 fi
6439
6440                 if test "$cf_have_incdir" = no ; then
6441                   if test "$cf_add_incdir" = /usr/local/include ; then
6442                         if test "$GCC" = yes
6443                         then
6444                           cf_save_CPPFLAGS=$CPPFLAGS
6445                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6446                           cat >conftest.$ac_ext <<_ACEOF
6447 #line 6447 "configure"
6448 #include "confdefs.h"
6449 #include <stdio.h>
6450 int
6451 main ()
6452 {
6453 printf("Hello")
6454   ;
6455   return 0;
6456 }
6457 _ACEOF
6458 rm -f conftest.$ac_objext
6459 if { (eval echo "$as_me:6459: \"$ac_compile\"") >&5
6460   (eval $ac_compile) 2>&5
6461   ac_status=$?
6462   echo "$as_me:6462: \$? = $ac_status" >&5
6463   (exit $ac_status); } &&
6464          { ac_try='test -s conftest.$ac_objext'
6465   { (eval echo "$as_me:6465: \"$ac_try\"") >&5
6466   (eval $ac_try) 2>&5
6467   ac_status=$?
6468   echo "$as_me:6468: \$? = $ac_status" >&5
6469   (exit $ac_status); }; }; then
6470   :
6471 else
6472   echo "$as_me: failed program was:" >&5
6473 cat conftest.$ac_ext >&5
6474 cf_have_incdir=yes
6475 fi
6476 rm -f conftest.$ac_objext conftest.$ac_ext
6477                           CPPFLAGS=$cf_save_CPPFLAGS
6478                         fi
6479                   fi
6480                 fi
6481
6482                 if test "$cf_have_incdir" = no ; then
6483                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6484
6485 echo "${as_me:-configure}:6485: testing adding $cf_add_incdir to include-path ..." 1>&5
6486
6487                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6488
6489                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6490                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6491                   cf_add_incdir="$cf_top_incdir"
6492                 else
6493                   break
6494                 fi
6495           else
6496                 break
6497           fi
6498         done
6499   done
6500 fi
6501
6502 }
6503
6504 echo "$as_me:6504: checking for $cf_ncuhdr_root header in include-path" >&5
6505 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
6506 if test "${cf_cv_ncurses_h+set}" = set; then
6507   echo $ECHO_N "(cached) $ECHO_C" >&6
6508 else
6509
6510         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
6511         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
6512         for cf_header in $cf_header_list
6513         do
6514
6515         cat >conftest.$ac_ext <<_ACEOF
6516 #line 6516 "configure"
6517 #include "confdefs.h"
6518
6519 #include <$cf_header>
6520 int
6521 main ()
6522 {
6523
6524 #ifdef NCURSES_VERSION
6525
6526 printf("%s\n", NCURSES_VERSION);
6527 #else
6528 #ifdef __NCURSES_H
6529 printf("old\n");
6530 #else
6531         make an error
6532 #endif
6533 #endif
6534
6535   ;
6536   return 0;
6537 }
6538 _ACEOF
6539 rm -f conftest.$ac_objext
6540 if { (eval echo "$as_me:6540: \"$ac_compile\"") >&5
6541   (eval $ac_compile) 2>&5
6542   ac_status=$?
6543   echo "$as_me:6543: \$? = $ac_status" >&5
6544   (exit $ac_status); } &&
6545          { ac_try='test -s conftest.$ac_objext'
6546   { (eval echo "$as_me:6546: \"$ac_try\"") >&5
6547   (eval $ac_try) 2>&5
6548   ac_status=$?
6549   echo "$as_me:6549: \$? = $ac_status" >&5
6550   (exit $ac_status); }; }; then
6551   cf_cv_ncurses_h=$cf_header
6552
6553 else
6554   echo "$as_me: failed program was:" >&5
6555 cat conftest.$ac_ext >&5
6556 cf_cv_ncurses_h=no
6557 fi
6558 rm -f conftest.$ac_objext conftest.$ac_ext
6559
6560                 test "$cf_cv_ncurses_h" != no && break
6561         done
6562
6563 fi
6564 echo "$as_me:6564: result: $cf_cv_ncurses_h" >&5
6565 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
6566
6567 if test "$cf_cv_ncurses_h" != no ; then
6568         cf_cv_ncurses_header=$cf_cv_ncurses_h
6569 else
6570
6571 echo "$as_me:6571: checking for $cf_ncuhdr_root include-path" >&5
6572 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
6573 if test "${cf_cv_ncurses_h2+set}" = set; then
6574   echo $ECHO_N "(cached) $ECHO_C" >&6
6575 else
6576
6577         test -n "$verbose" && echo
6578
6579 cf_search=
6580
6581 # collect the current set of include-directories from compiler flags
6582 cf_header_path_list=""
6583 if test -n "${CFLAGS}${CPPFLAGS}" ; then
6584         for cf_header_path in $CPPFLAGS $CFLAGS
6585         do
6586                 case $cf_header_path in
6587                 (-I*)
6588                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
6589
6590 test "x$cf_header_path" != "xNONE" && \
6591 test -d "$cf_header_path" && \
6592  {
6593         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
6594         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
6595         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
6596         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
6597         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
6598         test -d $cf_header_path/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
6599 }
6600
6601                         cf_header_path_list="$cf_header_path_list $cf_search"
6602                         ;;
6603                 esac
6604         done
6605 fi
6606
6607 # add the variations for the package we are looking for
6608
6609 cf_search=
6610
6611 test "x$prefix" != "xNONE" && \
6612 test -d "$prefix" && \
6613  {
6614         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
6615         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
6616         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
6617         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
6618         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
6619         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
6620 }
6621
6622 for cf_subdir_prefix in \
6623         /usr \
6624         /usr/local \
6625         /usr/pkg \
6626         /opt \
6627         /opt/local \
6628         $HOME
6629 do
6630
6631 test "x$cf_subdir_prefix" != "x$prefix" && \
6632 test -d "$cf_subdir_prefix" && \
6633 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
6634         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
6635         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
6636         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
6637         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
6638         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
6639         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
6640 }
6641
6642 done
6643
6644 test "$includedir" != NONE && \
6645 test "$includedir" != "/usr/include" && \
6646 test -d "$includedir" && {
6647         test -d $includedir &&    cf_search="$cf_search $includedir"
6648         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
6649 }
6650
6651 test "$oldincludedir" != NONE && \
6652 test "$oldincludedir" != "/usr/include" && \
6653 test -d "$oldincludedir" && {
6654         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
6655         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
6656 }
6657
6658 cf_search="$cf_search $cf_header_path_list"
6659
6660         test -n "$verbose" && echo search path $cf_search
6661         cf_save2_CPPFLAGS="$CPPFLAGS"
6662         for cf_incdir in $cf_search
6663         do
6664
6665 if test -n "$cf_incdir" ; then
6666   for cf_add_incdir in $cf_incdir
6667   do
6668         while test $cf_add_incdir != /usr/include
6669         do
6670           if test -d $cf_add_incdir
6671           then
6672                 cf_have_incdir=no
6673                 if test -n "$CFLAGS$CPPFLAGS" ; then
6674                   # a loop is needed to ensure we can add subdirs of existing dirs
6675                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6676                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6677                           cf_have_incdir=yes; break
6678                         fi
6679                   done
6680                 fi
6681
6682                 if test "$cf_have_incdir" = no ; then
6683                   if test "$cf_add_incdir" = /usr/local/include ; then
6684                         if test "$GCC" = yes
6685                         then
6686                           cf_save_CPPFLAGS=$CPPFLAGS
6687                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6688                           cat >conftest.$ac_ext <<_ACEOF
6689 #line 6689 "configure"
6690 #include "confdefs.h"
6691 #include <stdio.h>
6692 int
6693 main ()
6694 {
6695 printf("Hello")
6696   ;
6697   return 0;
6698 }
6699 _ACEOF
6700 rm -f conftest.$ac_objext
6701 if { (eval echo "$as_me:6701: \"$ac_compile\"") >&5
6702   (eval $ac_compile) 2>&5
6703   ac_status=$?
6704   echo "$as_me:6704: \$? = $ac_status" >&5
6705   (exit $ac_status); } &&
6706          { ac_try='test -s conftest.$ac_objext'
6707   { (eval echo "$as_me:6707: \"$ac_try\"") >&5
6708   (eval $ac_try) 2>&5
6709   ac_status=$?
6710   echo "$as_me:6710: \$? = $ac_status" >&5
6711   (exit $ac_status); }; }; then
6712   :
6713 else
6714   echo "$as_me: failed program was:" >&5
6715 cat conftest.$ac_ext >&5
6716 cf_have_incdir=yes
6717 fi
6718 rm -f conftest.$ac_objext conftest.$ac_ext
6719                           CPPFLAGS=$cf_save_CPPFLAGS
6720                         fi
6721                   fi
6722                 fi
6723
6724                 if test "$cf_have_incdir" = no ; then
6725                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6726
6727 echo "${as_me:-configure}:6727: testing adding $cf_add_incdir to include-path ..." 1>&5
6728
6729                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6730
6731                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6732                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6733                   cf_add_incdir="$cf_top_incdir"
6734                 else
6735                   break
6736                 fi
6737           else
6738                 break
6739           fi
6740         done
6741   done
6742 fi
6743
6744                 for cf_header in \
6745                         ncurses.h \
6746                         curses.h
6747                 do
6748
6749         cat >conftest.$ac_ext <<_ACEOF
6750 #line 6750 "configure"
6751 #include "confdefs.h"
6752
6753 #include <$cf_header>
6754 int
6755 main ()
6756 {
6757
6758 #ifdef NCURSES_VERSION
6759
6760 printf("%s\n", NCURSES_VERSION);
6761 #else
6762 #ifdef __NCURSES_H
6763 printf("old\n");
6764 #else
6765         make an error
6766 #endif
6767 #endif
6768
6769   ;
6770   return 0;
6771 }
6772 _ACEOF
6773 rm -f conftest.$ac_objext
6774 if { (eval echo "$as_me:6774: \"$ac_compile\"") >&5
6775   (eval $ac_compile) 2>&5
6776   ac_status=$?
6777   echo "$as_me:6777: \$? = $ac_status" >&5
6778   (exit $ac_status); } &&
6779          { ac_try='test -s conftest.$ac_objext'
6780   { (eval echo "$as_me:6780: \"$ac_try\"") >&5
6781   (eval $ac_try) 2>&5
6782   ac_status=$?
6783   echo "$as_me:6783: \$? = $ac_status" >&5
6784   (exit $ac_status); }; }; then
6785   cf_cv_ncurses_h2=$cf_header
6786
6787 else
6788   echo "$as_me: failed program was:" >&5
6789 cat conftest.$ac_ext >&5
6790 cf_cv_ncurses_h2=no
6791 fi
6792 rm -f conftest.$ac_objext conftest.$ac_ext
6793
6794                         if test "$cf_cv_ncurses_h2" != no ; then
6795                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
6796                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
6797                                 break
6798                         fi
6799                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
6800                 done
6801                 CPPFLAGS="$cf_save2_CPPFLAGS"
6802                 test "$cf_cv_ncurses_h2" != no && break
6803         done
6804         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:6804: error: not found" >&5
6805 echo "$as_me: error: not found" >&2;}
6806    { (exit 1); exit 1; }; }
6807
6808 fi
6809 echo "$as_me:6809: result: $cf_cv_ncurses_h2" >&5
6810 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
6811
6812         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
6813         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
6814         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
6815                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
6816         fi
6817
6818 if test -n "$cf_1st_incdir" ; then
6819   for cf_add_incdir in $cf_1st_incdir
6820   do
6821         while test $cf_add_incdir != /usr/include
6822         do
6823           if test -d $cf_add_incdir
6824           then
6825                 cf_have_incdir=no
6826                 if test -n "$CFLAGS$CPPFLAGS" ; then
6827                   # a loop is needed to ensure we can add subdirs of existing dirs
6828                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6829                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6830                           cf_have_incdir=yes; break
6831                         fi
6832                   done
6833                 fi
6834
6835                 if test "$cf_have_incdir" = no ; then
6836                   if test "$cf_add_incdir" = /usr/local/include ; then
6837                         if test "$GCC" = yes
6838                         then
6839                           cf_save_CPPFLAGS=$CPPFLAGS
6840                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6841                           cat >conftest.$ac_ext <<_ACEOF
6842 #line 6842 "configure"
6843 #include "confdefs.h"
6844 #include <stdio.h>
6845 int
6846 main ()
6847 {
6848 printf("Hello")
6849   ;
6850   return 0;
6851 }
6852 _ACEOF
6853 rm -f conftest.$ac_objext
6854 if { (eval echo "$as_me:6854: \"$ac_compile\"") >&5
6855   (eval $ac_compile) 2>&5
6856   ac_status=$?
6857   echo "$as_me:6857: \$? = $ac_status" >&5
6858   (exit $ac_status); } &&
6859          { ac_try='test -s conftest.$ac_objext'
6860   { (eval echo "$as_me:6860: \"$ac_try\"") >&5
6861   (eval $ac_try) 2>&5
6862   ac_status=$?
6863   echo "$as_me:6863: \$? = $ac_status" >&5
6864   (exit $ac_status); }; }; then
6865   :
6866 else
6867   echo "$as_me: failed program was:" >&5
6868 cat conftest.$ac_ext >&5
6869 cf_have_incdir=yes
6870 fi
6871 rm -f conftest.$ac_objext conftest.$ac_ext
6872                           CPPFLAGS=$cf_save_CPPFLAGS
6873                         fi
6874                   fi
6875                 fi
6876
6877                 if test "$cf_have_incdir" = no ; then
6878                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6879
6880 echo "${as_me:-configure}:6880: testing adding $cf_add_incdir to include-path ..." 1>&5
6881
6882                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6883
6884                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6885                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6886                   cf_add_incdir="$cf_top_incdir"
6887                 else
6888                   break
6889                 fi
6890           else
6891                 break
6892           fi
6893         done
6894   done
6895 fi
6896
6897 fi
6898
6899 # Set definitions to allow ifdef'ing for ncurses.h
6900
6901 case $cf_cv_ncurses_header in
6902 (*ncurses.h)
6903
6904 cat >>confdefs.h <<\EOF
6905 #define HAVE_NCURSES_H 1
6906 EOF
6907
6908         ;;
6909 esac
6910
6911 case $cf_cv_ncurses_header in
6912 (ncurses/curses.h|ncurses/ncurses.h)
6913
6914 cat >>confdefs.h <<\EOF
6915 #define HAVE_NCURSES_NCURSES_H 1
6916 EOF
6917
6918         ;;
6919 (ncursesw/curses.h|ncursesw/ncurses.h)
6920
6921 cat >>confdefs.h <<\EOF
6922 #define HAVE_NCURSESW_NCURSES_H 1
6923 EOF
6924
6925         ;;
6926 esac
6927
6928 echo "$as_me:6928: checking for terminfo header" >&5
6929 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
6930 if test "${cf_cv_term_header+set}" = set; then
6931   echo $ECHO_N "(cached) $ECHO_C" >&6
6932 else
6933
6934 case ${cf_cv_ncurses_header} in
6935 (*/ncurses.h|*/ncursesw.h)
6936         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
6937         ;;
6938 (*)
6939         cf_term_header=term.h
6940         ;;
6941 esac
6942
6943 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
6944 do
6945 cat >conftest.$ac_ext <<_ACEOF
6946 #line 6946 "configure"
6947 #include "confdefs.h"
6948 #include <stdio.h>
6949 #include <${cf_cv_ncurses_header:-curses.h}>
6950 #include <$cf_test>
6951
6952 int
6953 main ()
6954 {
6955 int x = auto_left_margin
6956   ;
6957   return 0;
6958 }
6959 _ACEOF
6960 rm -f conftest.$ac_objext
6961 if { (eval echo "$as_me:6961: \"$ac_compile\"") >&5
6962   (eval $ac_compile) 2>&5
6963   ac_status=$?
6964   echo "$as_me:6964: \$? = $ac_status" >&5
6965   (exit $ac_status); } &&
6966          { ac_try='test -s conftest.$ac_objext'
6967   { (eval echo "$as_me:6967: \"$ac_try\"") >&5
6968   (eval $ac_try) 2>&5
6969   ac_status=$?
6970   echo "$as_me:6970: \$? = $ac_status" >&5
6971   (exit $ac_status); }; }; then
6972
6973         cf_cv_term_header="$cf_test"
6974 else
6975   echo "$as_me: failed program was:" >&5
6976 cat conftest.$ac_ext >&5
6977
6978         cf_cv_term_header=unknown
6979
6980 fi
6981 rm -f conftest.$ac_objext conftest.$ac_ext
6982         test "$cf_cv_term_header" != unknown && break
6983 done
6984
6985 fi
6986 echo "$as_me:6986: result: $cf_cv_term_header" >&5
6987 echo "${ECHO_T}$cf_cv_term_header" >&6
6988
6989 # Set definitions to allow ifdef'ing to accommodate subdirectories
6990
6991 case $cf_cv_term_header in
6992 (*term.h)
6993
6994 cat >>confdefs.h <<\EOF
6995 #define HAVE_TERM_H 1
6996 EOF
6997
6998         ;;
6999 esac
7000
7001 case $cf_cv_term_header in
7002 (ncurses/term.h)
7003
7004 cat >>confdefs.h <<\EOF
7005 #define HAVE_NCURSES_TERM_H 1
7006 EOF
7007
7008         ;;
7009 (ncursesw/term.h)
7010
7011 cat >>confdefs.h <<\EOF
7012 #define HAVE_NCURSESW_TERM_H 1
7013 EOF
7014
7015         ;;
7016 esac
7017
7018 # some applications need this, but should check for NCURSES_VERSION
7019
7020 cat >>confdefs.h <<\EOF
7021 #define NCURSES 1
7022 EOF
7023
7024 echo "$as_me:7024: checking for ncurses version" >&5
7025 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
7026 if test "${cf_cv_ncurses_version+set}" = set; then
7027   echo $ECHO_N "(cached) $ECHO_C" >&6
7028 else
7029
7030         cf_cv_ncurses_version=no
7031         cf_tempfile=out$$
7032         rm -f $cf_tempfile
7033         if test "$cross_compiling" = yes; then
7034
7035         # This will not work if the preprocessor splits the line after the
7036         # Autoconf token.  The 'unproto' program does that.
7037         cat > conftest.$ac_ext <<EOF
7038 #include <${cf_cv_ncurses_header:-curses.h}>
7039 #undef Autoconf
7040 #ifdef NCURSES_VERSION
7041 Autoconf NCURSES_VERSION
7042 #else
7043 #ifdef __NCURSES_H
7044 Autoconf "old"
7045 #endif
7046 ;
7047 #endif
7048 EOF
7049         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
7050         { (eval echo "$as_me:7050: \"$cf_try\"") >&5
7051   (eval $cf_try) 2>&5
7052   ac_status=$?
7053   echo "$as_me:7053: \$? = $ac_status" >&5
7054   (exit $ac_status); }
7055         if test -f conftest.out ; then
7056                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
7057                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
7058                 rm -f conftest.out
7059         fi
7060
7061 else
7062   cat >conftest.$ac_ext <<_ACEOF
7063 #line 7063 "configure"
7064 #include "confdefs.h"
7065
7066 #include <${cf_cv_ncurses_header:-curses.h}>
7067 #include <stdio.h>
7068 int main()
7069 {
7070         FILE *fp = fopen("$cf_tempfile", "w");
7071 #ifdef NCURSES_VERSION
7072 # ifdef NCURSES_VERSION_PATCH
7073         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
7074 # else
7075         fprintf(fp, "%s\n", NCURSES_VERSION);
7076 # endif
7077 #else
7078 # ifdef __NCURSES_H
7079         fprintf(fp, "old\n");
7080 # else
7081         make an error
7082 # endif
7083 #endif
7084         ${cf_cv_main_return:-return}(0);
7085 }
7086 _ACEOF
7087 rm -f conftest$ac_exeext
7088 if { (eval echo "$as_me:7088: \"$ac_link\"") >&5
7089   (eval $ac_link) 2>&5
7090   ac_status=$?
7091   echo "$as_me:7091: \$? = $ac_status" >&5
7092   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
7093   { (eval echo "$as_me:7093: \"$ac_try\"") >&5
7094   (eval $ac_try) 2>&5
7095   ac_status=$?
7096   echo "$as_me:7096: \$? = $ac_status" >&5
7097   (exit $ac_status); }; }; then
7098
7099         cf_cv_ncurses_version=`cat $cf_tempfile`
7100 else
7101   echo "$as_me: program exited with status $ac_status" >&5
7102 echo "$as_me: failed program was:" >&5
7103 cat conftest.$ac_ext >&5
7104 fi
7105 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
7106 fi
7107         rm -f $cf_tempfile
7108
7109 fi
7110 echo "$as_me:7110: result: $cf_cv_ncurses_version" >&5
7111 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
7112 test "$cf_cv_ncurses_version" = no ||
7113 cat >>confdefs.h <<\EOF
7114 #define NCURSES 1
7115 EOF
7116
7117 cf_nculib_root=$cf_cv_screen
7118         # This works, except for the special case where we find gpm, but
7119         # ncurses is in a nonstandard location via $LIBS, and we really want
7120         # to link gpm.
7121 cf_ncurses_LIBS=""
7122 cf_ncurses_SAVE="$LIBS"
7123 echo "$as_me:7123: checking for Gpm_Open in -lgpm" >&5
7124 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
7125 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
7126   echo $ECHO_N "(cached) $ECHO_C" >&6
7127 else
7128   ac_check_lib_save_LIBS=$LIBS
7129 LIBS="-lgpm  $LIBS"
7130 cat >conftest.$ac_ext <<_ACEOF
7131 #line 7131 "configure"
7132 #include "confdefs.h"
7133
7134 /* Override any gcc2 internal prototype to avoid an error.  */
7135 #ifdef __cplusplus
7136 extern "C"
7137 #endif
7138 /* We use char because int might match the return type of a gcc2
7139    builtin and then its argument prototype would still apply.  */
7140 char Gpm_Open ();
7141 int
7142 main ()
7143 {
7144 Gpm_Open ();
7145   ;
7146   return 0;
7147 }
7148 _ACEOF
7149 rm -f conftest.$ac_objext conftest$ac_exeext
7150 if { (eval echo "$as_me:7150: \"$ac_link\"") >&5
7151   (eval $ac_link) 2>&5
7152   ac_status=$?
7153   echo "$as_me:7153: \$? = $ac_status" >&5
7154   (exit $ac_status); } &&
7155          { ac_try='test -s conftest$ac_exeext'
7156   { (eval echo "$as_me:7156: \"$ac_try\"") >&5
7157   (eval $ac_try) 2>&5
7158   ac_status=$?
7159   echo "$as_me:7159: \$? = $ac_status" >&5
7160   (exit $ac_status); }; }; then
7161   ac_cv_lib_gpm_Gpm_Open=yes
7162 else
7163   echo "$as_me: failed program was:" >&5
7164 cat conftest.$ac_ext >&5
7165 ac_cv_lib_gpm_Gpm_Open=no
7166 fi
7167 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7168 LIBS=$ac_check_lib_save_LIBS
7169 fi
7170 echo "$as_me:7170: result: $ac_cv_lib_gpm_Gpm_Open" >&5
7171 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
7172 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
7173   echo "$as_me:7173: checking for initscr in -lgpm" >&5
7174 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
7175 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
7176   echo $ECHO_N "(cached) $ECHO_C" >&6
7177 else
7178   ac_check_lib_save_LIBS=$LIBS
7179 LIBS="-lgpm  $LIBS"
7180 cat >conftest.$ac_ext <<_ACEOF
7181 #line 7181 "configure"
7182 #include "confdefs.h"
7183
7184 /* Override any gcc2 internal prototype to avoid an error.  */
7185 #ifdef __cplusplus
7186 extern "C"
7187 #endif
7188 /* We use char because int might match the return type of a gcc2
7189    builtin and then its argument prototype would still apply.  */
7190 char initscr ();
7191 int
7192 main ()
7193 {
7194 initscr ();
7195   ;
7196   return 0;
7197 }
7198 _ACEOF
7199 rm -f conftest.$ac_objext conftest$ac_exeext
7200 if { (eval echo "$as_me:7200: \"$ac_link\"") >&5
7201   (eval $ac_link) 2>&5
7202   ac_status=$?
7203   echo "$as_me:7203: \$? = $ac_status" >&5
7204   (exit $ac_status); } &&
7205          { ac_try='test -s conftest$ac_exeext'
7206   { (eval echo "$as_me:7206: \"$ac_try\"") >&5
7207   (eval $ac_try) 2>&5
7208   ac_status=$?
7209   echo "$as_me:7209: \$? = $ac_status" >&5
7210   (exit $ac_status); }; }; then
7211   ac_cv_lib_gpm_initscr=yes
7212 else
7213   echo "$as_me: failed program was:" >&5
7214 cat conftest.$ac_ext >&5
7215 ac_cv_lib_gpm_initscr=no
7216 fi
7217 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7218 LIBS=$ac_check_lib_save_LIBS
7219 fi
7220 echo "$as_me:7220: result: $ac_cv_lib_gpm_initscr" >&5
7221 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
7222 if test $ac_cv_lib_gpm_initscr = yes; then
7223   LIBS="$cf_ncurses_SAVE"
7224 else
7225   cf_ncurses_LIBS="-lgpm"
7226 fi
7227
7228 fi
7229
7230 case $host_os in
7231 (freebsd*)
7232         # This is only necessary if you are linking against an obsolete
7233         # version of ncurses (but it should do no harm, since it's static).
7234         if test "$cf_nculib_root" = ncurses ; then
7235                 echo "$as_me:7235: checking for tgoto in -lmytinfo" >&5
7236 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
7237 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
7238   echo $ECHO_N "(cached) $ECHO_C" >&6
7239 else
7240   ac_check_lib_save_LIBS=$LIBS
7241 LIBS="-lmytinfo  $LIBS"
7242 cat >conftest.$ac_ext <<_ACEOF
7243 #line 7243 "configure"
7244 #include "confdefs.h"
7245
7246 /* Override any gcc2 internal prototype to avoid an error.  */
7247 #ifdef __cplusplus
7248 extern "C"
7249 #endif
7250 /* We use char because int might match the return type of a gcc2
7251    builtin and then its argument prototype would still apply.  */
7252 char tgoto ();
7253 int
7254 main ()
7255 {
7256 tgoto ();
7257   ;
7258   return 0;
7259 }
7260 _ACEOF
7261 rm -f conftest.$ac_objext conftest$ac_exeext
7262 if { (eval echo "$as_me:7262: \"$ac_link\"") >&5
7263   (eval $ac_link) 2>&5
7264   ac_status=$?
7265   echo "$as_me:7265: \$? = $ac_status" >&5
7266   (exit $ac_status); } &&
7267          { ac_try='test -s conftest$ac_exeext'
7268   { (eval echo "$as_me:7268: \"$ac_try\"") >&5
7269   (eval $ac_try) 2>&5
7270   ac_status=$?
7271   echo "$as_me:7271: \$? = $ac_status" >&5
7272   (exit $ac_status); }; }; then
7273   ac_cv_lib_mytinfo_tgoto=yes
7274 else
7275   echo "$as_me: failed program was:" >&5
7276 cat conftest.$ac_ext >&5
7277 ac_cv_lib_mytinfo_tgoto=no
7278 fi
7279 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7280 LIBS=$ac_check_lib_save_LIBS
7281 fi
7282 echo "$as_me:7282: result: $ac_cv_lib_mytinfo_tgoto" >&5
7283 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
7284 if test $ac_cv_lib_mytinfo_tgoto = yes; then
7285   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
7286 fi
7287
7288         fi
7289         ;;
7290 esac
7291
7292 cf_add_libs="$cf_ncurses_LIBS"
7293 # Filter out duplicates - this happens with badly-designed ".pc" files...
7294 for cf_add_1lib in $LIBS
7295 do
7296         for cf_add_2lib in $cf_add_libs
7297         do
7298                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7299                 then
7300                         cf_add_1lib=
7301                         break
7302                 fi
7303         done
7304         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7305 done
7306 LIBS="$cf_add_libs"
7307
7308 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
7309 then
7310
7311 cf_add_libs="-l$cf_nculib_root"
7312 # Filter out duplicates - this happens with badly-designed ".pc" files...
7313 for cf_add_1lib in $LIBS
7314 do
7315         for cf_add_2lib in $cf_add_libs
7316         do
7317                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7318                 then
7319                         cf_add_1lib=
7320                         break
7321                 fi
7322         done
7323         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7324 done
7325 LIBS="$cf_add_libs"
7326
7327 else
7328
7329         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
7330         cf_libdir=""
7331         echo "$as_me:7331: checking for initscr" >&5
7332 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
7333 if test "${ac_cv_func_initscr+set}" = set; then
7334   echo $ECHO_N "(cached) $ECHO_C" >&6
7335 else
7336   cat >conftest.$ac_ext <<_ACEOF
7337 #line 7337 "configure"
7338 #include "confdefs.h"
7339 /* System header to define __stub macros and hopefully few prototypes,
7340     which can conflict with char initscr (); below.  */
7341 #include <assert.h>
7342 /* Override any gcc2 internal prototype to avoid an error.  */
7343 #ifdef __cplusplus
7344 extern "C"
7345 #endif
7346 /* We use char because int might match the return type of a gcc2
7347    builtin and then its argument prototype would still apply.  */
7348 char initscr ();
7349 char (*f) ();
7350
7351 int
7352 main ()
7353 {
7354 /* The GNU C library defines this for functions which it implements
7355     to always fail with ENOSYS.  Some functions are actually named
7356     something starting with __ and the normal name is an alias.  */
7357 #if defined (__stub_initscr) || defined (__stub___initscr)
7358 choke me
7359 #else
7360 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
7361 #endif
7362
7363   ;
7364   return 0;
7365 }
7366 _ACEOF
7367 rm -f conftest.$ac_objext conftest$ac_exeext
7368 if { (eval echo "$as_me:7368: \"$ac_link\"") >&5
7369   (eval $ac_link) 2>&5
7370   ac_status=$?
7371   echo "$as_me:7371: \$? = $ac_status" >&5
7372   (exit $ac_status); } &&
7373          { ac_try='test -s conftest$ac_exeext'
7374   { (eval echo "$as_me:7374: \"$ac_try\"") >&5
7375   (eval $ac_try) 2>&5
7376   ac_status=$?
7377   echo "$as_me:7377: \$? = $ac_status" >&5
7378   (exit $ac_status); }; }; then
7379   ac_cv_func_initscr=yes
7380 else
7381   echo "$as_me: failed program was:" >&5
7382 cat conftest.$ac_ext >&5
7383 ac_cv_func_initscr=no
7384 fi
7385 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7386 fi
7387 echo "$as_me:7387: result: $ac_cv_func_initscr" >&5
7388 echo "${ECHO_T}$ac_cv_func_initscr" >&6
7389 if test $ac_cv_func_initscr = yes; then
7390   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
7391 else
7392
7393                 cf_save_LIBS="$LIBS"
7394                 echo "$as_me:7394: checking for initscr in -l$cf_nculib_root" >&5
7395 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
7396                 LIBS="-l$cf_nculib_root $LIBS"
7397                 cat >conftest.$ac_ext <<_ACEOF
7398 #line 7398 "configure"
7399 #include "confdefs.h"
7400 #include <${cf_cv_ncurses_header:-curses.h}>
7401 int
7402 main ()
7403 {
7404 initscr()
7405   ;
7406   return 0;
7407 }
7408 _ACEOF
7409 rm -f conftest.$ac_objext conftest$ac_exeext
7410 if { (eval echo "$as_me:7410: \"$ac_link\"") >&5
7411   (eval $ac_link) 2>&5
7412   ac_status=$?
7413   echo "$as_me:7413: \$? = $ac_status" >&5
7414   (exit $ac_status); } &&
7415          { ac_try='test -s conftest$ac_exeext'
7416   { (eval echo "$as_me:7416: \"$ac_try\"") >&5
7417   (eval $ac_try) 2>&5
7418   ac_status=$?
7419   echo "$as_me:7419: \$? = $ac_status" >&5
7420   (exit $ac_status); }; }; then
7421   echo "$as_me:7421: result: yes" >&5
7422 echo "${ECHO_T}yes" >&6
7423                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
7424
7425 else
7426   echo "$as_me: failed program was:" >&5
7427 cat conftest.$ac_ext >&5
7428 echo "$as_me:7428: result: no" >&5
7429 echo "${ECHO_T}no" >&6
7430
7431 cf_search=
7432 cf_library_path_list=""
7433 if test -n "${LDFLAGS}${LIBS}" ; then
7434         for cf_library_path in $LDFLAGS $LIBS
7435         do
7436                 case $cf_library_path in
7437                 (-L*)
7438                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
7439
7440 test "x$cf_library_path" != "xNONE" && \
7441 test -d "$cf_library_path" && \
7442  {
7443         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
7444         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
7445         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
7446         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
7447         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
7448         test -d $cf_library_path/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib/$cf_nculib_root"
7449 }
7450
7451                         cf_library_path_list="$cf_library_path_list $cf_search"
7452                         ;;
7453                 esac
7454         done
7455 fi
7456
7457 cf_search=
7458
7459 test "x$prefix" != "xNONE" && \
7460 test -d "$prefix" && \
7461  {
7462         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
7463         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
7464         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
7465         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
7466         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
7467         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
7468 }
7469
7470 for cf_subdir_prefix in \
7471         /usr \
7472         /usr/local \
7473         /usr/pkg \
7474         /opt \
7475         /opt/local \
7476         $HOME
7477 do
7478
7479 test "x$cf_subdir_prefix" != "x$prefix" && \
7480 test -d "$cf_subdir_prefix" && \
7481 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
7482         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
7483         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
7484         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
7485         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
7486         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
7487         test -d $cf_subdir_prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib/$cf_nculib_root"
7488 }
7489
7490 done
7491
7492 cf_search="$cf_library_path_list $cf_search"
7493
7494                         for cf_libdir in $cf_search
7495                         do
7496                                 echo "$as_me:7496: checking for -l$cf_nculib_root in $cf_libdir" >&5
7497 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
7498                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
7499                                 cat >conftest.$ac_ext <<_ACEOF
7500 #line 7500 "configure"
7501 #include "confdefs.h"
7502 #include <${cf_cv_ncurses_header:-curses.h}>
7503 int
7504 main ()
7505 {
7506 initscr()
7507   ;
7508   return 0;
7509 }
7510 _ACEOF
7511 rm -f conftest.$ac_objext conftest$ac_exeext
7512 if { (eval echo "$as_me:7512: \"$ac_link\"") >&5
7513   (eval $ac_link) 2>&5
7514   ac_status=$?
7515   echo "$as_me:7515: \$? = $ac_status" >&5
7516   (exit $ac_status); } &&
7517          { ac_try='test -s conftest$ac_exeext'
7518   { (eval echo "$as_me:7518: \"$ac_try\"") >&5
7519   (eval $ac_try) 2>&5
7520   ac_status=$?
7521   echo "$as_me:7521: \$? = $ac_status" >&5
7522   (exit $ac_status); }; }; then
7523   echo "$as_me:7523: result: yes" >&5
7524 echo "${ECHO_T}yes" >&6
7525                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
7526                                          break
7527 else
7528   echo "$as_me: failed program was:" >&5
7529 cat conftest.$ac_ext >&5
7530 echo "$as_me:7530: result: no" >&5
7531 echo "${ECHO_T}no" >&6
7532                                          LIBS="$cf_save_LIBS"
7533 fi
7534 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7535                         done
7536
7537 fi
7538 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7539
7540 fi
7541
7542 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
7543
7544 if test $cf_found_library = no ; then
7545         { { echo "$as_me:7545: error: Cannot link $cf_nculib_root library" >&5
7546 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
7547    { (exit 1); exit 1; }; }
7548 fi
7549
7550 fi
7551
7552 if test -n "$cf_ncurses_LIBS" ; then
7553         echo "$as_me:7553: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
7554 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
7555         cf_ncurses_SAVE="$LIBS"
7556         for p in $cf_ncurses_LIBS ; do
7557                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
7558                 if test "$q" != "$LIBS" ; then
7559                         LIBS="$q"
7560                 fi
7561         done
7562         cat >conftest.$ac_ext <<_ACEOF
7563 #line 7563 "configure"
7564 #include "confdefs.h"
7565 #include <${cf_cv_ncurses_header:-curses.h}>
7566 int
7567 main ()
7568 {
7569 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
7570   ;
7571   return 0;
7572 }
7573 _ACEOF
7574 rm -f conftest.$ac_objext conftest$ac_exeext
7575 if { (eval echo "$as_me:7575: \"$ac_link\"") >&5
7576   (eval $ac_link) 2>&5
7577   ac_status=$?
7578   echo "$as_me:7578: \$? = $ac_status" >&5
7579   (exit $ac_status); } &&
7580          { ac_try='test -s conftest$ac_exeext'
7581   { (eval echo "$as_me:7581: \"$ac_try\"") >&5
7582   (eval $ac_try) 2>&5
7583   ac_status=$?
7584   echo "$as_me:7584: \$? = $ac_status" >&5
7585   (exit $ac_status); }; }; then
7586   echo "$as_me:7586: result: yes" >&5
7587 echo "${ECHO_T}yes" >&6
7588 else
7589   echo "$as_me: failed program was:" >&5
7590 cat conftest.$ac_ext >&5
7591 echo "$as_me:7591: result: no" >&5
7592 echo "${ECHO_T}no" >&6
7593                  LIBS="$cf_ncurses_SAVE"
7594 fi
7595 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7596 fi
7597
7598 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
7599
7600 cat >>confdefs.h <<EOF
7601 #define $cf_nculib_ROOT 1
7602 EOF
7603
7604         fi
7605 else
7606         NCURSES_CONFIG=none
7607 fi
7608
7609         ;;
7610 (ncurses*)
7611
7612 cf_ncuconfig_root=$cf_cv_screen
7613 cf_have_ncuconfig=no
7614
7615 if test "x${PKG_CONFIG:=none}" != xnone; then
7616         echo "$as_me:7616: checking pkg-config for $cf_ncuconfig_root" >&5
7617 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
7618         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
7619                 echo "$as_me:7619: result: yes" >&5
7620 echo "${ECHO_T}yes" >&6
7621
7622                 echo "$as_me:7622: checking if the $cf_ncuconfig_root package files work" >&5
7623 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
7624                 cf_have_ncuconfig=unknown
7625
7626                 cf_save_CPPFLAGS="$CPPFLAGS"
7627                 cf_save_LIBS="$LIBS"
7628
7629                 CPPFLAGS="$CPPFLAGS `$PKG_CONFIG --cflags $cf_ncuconfig_root`"
7630
7631 cf_add_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
7632 # Filter out duplicates - this happens with badly-designed ".pc" files...
7633 for cf_add_1lib in $LIBS
7634 do
7635         for cf_add_2lib in $cf_add_libs
7636         do
7637                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7638                 then
7639                         cf_add_1lib=
7640                         break
7641                 fi
7642         done
7643         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7644 done
7645 LIBS="$cf_add_libs"
7646
7647                 cat >conftest.$ac_ext <<_ACEOF
7648 #line 7648 "configure"
7649 #include "confdefs.h"
7650 #include <${cf_cv_ncurses_header:-curses.h}>
7651 int
7652 main ()
7653 {
7654 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
7655   ;
7656   return 0;
7657 }
7658 _ACEOF
7659 rm -f conftest.$ac_objext conftest$ac_exeext
7660 if { (eval echo "$as_me:7660: \"$ac_link\"") >&5
7661   (eval $ac_link) 2>&5
7662   ac_status=$?
7663   echo "$as_me:7663: \$? = $ac_status" >&5
7664   (exit $ac_status); } &&
7665          { ac_try='test -s conftest$ac_exeext'
7666   { (eval echo "$as_me:7666: \"$ac_try\"") >&5
7667   (eval $ac_try) 2>&5
7668   ac_status=$?
7669   echo "$as_me:7669: \$? = $ac_status" >&5
7670   (exit $ac_status); }; }; then
7671   if test "$cross_compiling" = yes; then
7672   cf_have_ncuconfig=maybe
7673 else
7674   cat >conftest.$ac_ext <<_ACEOF
7675 #line 7675 "configure"
7676 #include "confdefs.h"
7677 #include <${cf_cv_ncurses_header:-curses.h}>
7678                                 int main(void)
7679                                 { char *xx = curses_version(); return (xx == 0); }
7680 _ACEOF
7681 rm -f conftest$ac_exeext
7682 if { (eval echo "$as_me:7682: \"$ac_link\"") >&5
7683   (eval $ac_link) 2>&5
7684   ac_status=$?
7685   echo "$as_me:7685: \$? = $ac_status" >&5
7686   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
7687   { (eval echo "$as_me:7687: \"$ac_try\"") >&5
7688   (eval $ac_try) 2>&5
7689   ac_status=$?
7690   echo "$as_me:7690: \$? = $ac_status" >&5
7691   (exit $ac_status); }; }; then
7692   cf_have_ncuconfig=yes
7693 else
7694   echo "$as_me: program exited with status $ac_status" >&5
7695 echo "$as_me: failed program was:" >&5
7696 cat conftest.$ac_ext >&5
7697 cf_have_ncuconfig=no
7698 fi
7699 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
7700 fi
7701 else
7702   echo "$as_me: failed program was:" >&5
7703 cat conftest.$ac_ext >&5
7704 cf_have_ncuconfig=no
7705 fi
7706 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7707                 echo "$as_me:7707: result: $cf_have_ncuconfig" >&5
7708 echo "${ECHO_T}$cf_have_ncuconfig" >&6
7709                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
7710                 if test "$cf_have_ncuconfig" != "yes"
7711                 then
7712                         CPPFLAGS="$cf_save_CPPFLAGS"
7713                         LIBS="$cf_save_LIBS"
7714                         NCURSES_CONFIG_PKG=none
7715                 else
7716
7717 cat >>confdefs.h <<\EOF
7718 #define NCURSES 1
7719 EOF
7720
7721                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
7722                 fi
7723
7724         else
7725                 echo "$as_me:7725: result: no" >&5
7726 echo "${ECHO_T}no" >&6
7727                 NCURSES_CONFIG_PKG=none
7728         fi
7729 else
7730         NCURSES_CONFIG_PKG=none
7731 fi
7732
7733 if test "x$cf_have_ncuconfig" = "xno"; then
7734         echo "Looking for ${cf_ncuconfig_root}-config"
7735
7736 if test -n "$ac_tool_prefix"; then
7737   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7738   do
7739     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
7740 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
7741 echo "$as_me:7741: checking for $ac_word" >&5
7742 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7743 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
7744   echo $ECHO_N "(cached) $ECHO_C" >&6
7745 else
7746   if test -n "$NCURSES_CONFIG"; then
7747   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
7748 else
7749   ac_save_IFS=$IFS; IFS=$ac_path_separator
7750 ac_dummy="$PATH"
7751 for ac_dir in $ac_dummy; do
7752   IFS=$ac_save_IFS
7753   test -z "$ac_dir" && ac_dir=.
7754   $as_executable_p "$ac_dir/$ac_word" || continue
7755 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
7756 echo "$as_me:7756: found $ac_dir/$ac_word" >&5
7757 break
7758 done
7759
7760 fi
7761 fi
7762 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
7763 if test -n "$NCURSES_CONFIG"; then
7764   echo "$as_me:7764: result: $NCURSES_CONFIG" >&5
7765 echo "${ECHO_T}$NCURSES_CONFIG" >&6
7766 else
7767   echo "$as_me:7767: result: no" >&5
7768 echo "${ECHO_T}no" >&6
7769 fi
7770
7771     test -n "$NCURSES_CONFIG" && break
7772   done
7773 fi
7774 if test -z "$NCURSES_CONFIG"; then
7775   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
7776   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7777 do
7778   # Extract the first word of "$ac_prog", so it can be a program name with args.
7779 set dummy $ac_prog; ac_word=$2
7780 echo "$as_me:7780: checking for $ac_word" >&5
7781 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7782 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
7783   echo $ECHO_N "(cached) $ECHO_C" >&6
7784 else
7785   if test -n "$ac_ct_NCURSES_CONFIG"; then
7786   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
7787 else
7788   ac_save_IFS=$IFS; IFS=$ac_path_separator
7789 ac_dummy="$PATH"
7790 for ac_dir in $ac_dummy; do
7791   IFS=$ac_save_IFS
7792   test -z "$ac_dir" && ac_dir=.
7793   $as_executable_p "$ac_dir/$ac_word" || continue
7794 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
7795 echo "$as_me:7795: found $ac_dir/$ac_word" >&5
7796 break
7797 done
7798
7799 fi
7800 fi
7801 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
7802 if test -n "$ac_ct_NCURSES_CONFIG"; then
7803   echo "$as_me:7803: result: $ac_ct_NCURSES_CONFIG" >&5
7804 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
7805 else
7806   echo "$as_me:7806: result: no" >&5
7807 echo "${ECHO_T}no" >&6
7808 fi
7809
7810   test -n "$ac_ct_NCURSES_CONFIG" && break
7811 done
7812 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
7813
7814   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
7815 fi
7816
7817         if test "$NCURSES_CONFIG" != none ; then
7818
7819                 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
7820
7821 cf_add_libs="`$NCURSES_CONFIG --libs`"
7822 # Filter out duplicates - this happens with badly-designed ".pc" files...
7823 for cf_add_1lib in $LIBS
7824 do
7825         for cf_add_2lib in $cf_add_libs
7826         do
7827                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7828                 then
7829                         cf_add_1lib=
7830                         break
7831                 fi
7832         done
7833         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7834 done
7835 LIBS="$cf_add_libs"
7836
7837                 # even with config script, some packages use no-override for curses.h
7838
7839 echo "$as_me:7839: checking if we have identified curses headers" >&5
7840 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
7841 if test "${cf_cv_ncurses_header+set}" = set; then
7842   echo $ECHO_N "(cached) $ECHO_C" >&6
7843 else
7844
7845 cf_cv_ncurses_header=none
7846 for cf_header in \
7847         ncurses.h $cf_cv_screen/ncurses.h \
7848         curses.h $cf_cv_screen/curses.h
7849 do
7850 cat >conftest.$ac_ext <<_ACEOF
7851 #line 7851 "configure"
7852 #include "confdefs.h"
7853 #include <${cf_header}>
7854 int
7855 main ()
7856 {
7857 initscr(); tgoto("?", 0,0)
7858   ;
7859   return 0;
7860 }
7861 _ACEOF
7862 rm -f conftest.$ac_objext
7863 if { (eval echo "$as_me:7863: \"$ac_compile\"") >&5
7864   (eval $ac_compile) 2>&5
7865   ac_status=$?
7866   echo "$as_me:7866: \$? = $ac_status" >&5
7867   (exit $ac_status); } &&
7868          { ac_try='test -s conftest.$ac_objext'
7869   { (eval echo "$as_me:7869: \"$ac_try\"") >&5
7870   (eval $ac_try) 2>&5
7871   ac_status=$?
7872   echo "$as_me:7872: \$? = $ac_status" >&5
7873   (exit $ac_status); }; }; then
7874   cf_cv_ncurses_header=$cf_header; break
7875 else
7876   echo "$as_me: failed program was:" >&5
7877 cat conftest.$ac_ext >&5
7878 fi
7879 rm -f conftest.$ac_objext conftest.$ac_ext
7880 done
7881
7882 fi
7883 echo "$as_me:7883: result: $cf_cv_ncurses_header" >&5
7884 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
7885
7886 if test "$cf_cv_ncurses_header" = none ; then
7887         { { echo "$as_me:7887: error: No curses header-files found" >&5
7888 echo "$as_me: error: No curses header-files found" >&2;}
7889    { (exit 1); exit 1; }; }
7890 fi
7891
7892 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
7893
7894 for ac_header in $cf_cv_ncurses_header
7895 do
7896 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
7897 echo "$as_me:7897: checking for $ac_header" >&5
7898 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
7899 if eval "test \"\${$as_ac_Header+set}\" = set"; then
7900   echo $ECHO_N "(cached) $ECHO_C" >&6
7901 else
7902   cat >conftest.$ac_ext <<_ACEOF
7903 #line 7903 "configure"
7904 #include "confdefs.h"
7905 #include <$ac_header>
7906 _ACEOF
7907 if { (eval echo "$as_me:7907: \"$ac_cpp conftest.$ac_ext\"") >&5
7908   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
7909   ac_status=$?
7910   egrep -v '^ *\+' conftest.er1 >conftest.err
7911   rm -f conftest.er1
7912   cat conftest.err >&5
7913   echo "$as_me:7913: \$? = $ac_status" >&5
7914   (exit $ac_status); } >/dev/null; then
7915   if test -s conftest.err; then
7916     ac_cpp_err=$ac_c_preproc_warn_flag
7917   else
7918     ac_cpp_err=
7919   fi
7920 else
7921   ac_cpp_err=yes
7922 fi
7923 if test -z "$ac_cpp_err"; then
7924   eval "$as_ac_Header=yes"
7925 else
7926   echo "$as_me: failed program was:" >&5
7927   cat conftest.$ac_ext >&5
7928   eval "$as_ac_Header=no"
7929 fi
7930 rm -f conftest.err conftest.$ac_ext
7931 fi
7932 echo "$as_me:7932: result: `eval echo '${'$as_ac_Header'}'`" >&5
7933 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
7934 if test `eval echo '${'$as_ac_Header'}'` = yes; then
7935   cat >>confdefs.h <<EOF
7936 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
7937 EOF
7938
7939 fi
7940 done
7941
7942 cat >>confdefs.h <<\EOF
7943 #define NCURSES 1
7944 EOF
7945
7946 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
7947
7948                 cat >>confdefs.h <<EOF
7949 #define $cf_nculib_ROOT 1
7950 EOF
7951
7952                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
7953
7954         else
7955
7956 cf_ncuhdr_root=$cf_cv_screen
7957
7958 test -n "$cf_cv_curses_dir" && \
7959 test "$cf_cv_curses_dir" != "no" && { \
7960
7961 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
7962   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
7963   do
7964         while test $cf_add_incdir != /usr/include
7965         do
7966           if test -d $cf_add_incdir
7967           then
7968                 cf_have_incdir=no
7969                 if test -n "$CFLAGS$CPPFLAGS" ; then
7970                   # a loop is needed to ensure we can add subdirs of existing dirs
7971                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7972                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7973                           cf_have_incdir=yes; break
7974                         fi
7975                   done
7976                 fi
7977
7978                 if test "$cf_have_incdir" = no ; then
7979                   if test "$cf_add_incdir" = /usr/local/include ; then
7980                         if test "$GCC" = yes
7981                         then
7982                           cf_save_CPPFLAGS=$CPPFLAGS
7983                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7984                           cat >conftest.$ac_ext <<_ACEOF
7985 #line 7985 "configure"
7986 #include "confdefs.h"
7987 #include <stdio.h>
7988 int
7989 main ()
7990 {
7991 printf("Hello")
7992   ;
7993   return 0;
7994 }
7995 _ACEOF
7996 rm -f conftest.$ac_objext
7997 if { (eval echo "$as_me:7997: \"$ac_compile\"") >&5
7998   (eval $ac_compile) 2>&5
7999   ac_status=$?
8000   echo "$as_me:8000: \$? = $ac_status" >&5
8001   (exit $ac_status); } &&
8002          { ac_try='test -s conftest.$ac_objext'
8003   { (eval echo "$as_me:8003: \"$ac_try\"") >&5
8004   (eval $ac_try) 2>&5
8005   ac_status=$?
8006   echo "$as_me:8006: \$? = $ac_status" >&5
8007   (exit $ac_status); }; }; then
8008   :
8009 else
8010   echo "$as_me: failed program was:" >&5
8011 cat conftest.$ac_ext >&5
8012 cf_have_incdir=yes
8013 fi
8014 rm -f conftest.$ac_objext conftest.$ac_ext
8015                           CPPFLAGS=$cf_save_CPPFLAGS
8016                         fi
8017                   fi
8018                 fi
8019
8020                 if test "$cf_have_incdir" = no ; then
8021                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8022
8023 echo "${as_me:-configure}:8023: testing adding $cf_add_incdir to include-path ..." 1>&5
8024
8025                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8026
8027                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8028                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8029                   cf_add_incdir="$cf_top_incdir"
8030                 else
8031                   break
8032                 fi
8033           else
8034                 break
8035           fi
8036         done
8037   done
8038 fi
8039
8040 }
8041
8042 echo "$as_me:8042: checking for $cf_ncuhdr_root header in include-path" >&5
8043 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
8044 if test "${cf_cv_ncurses_h+set}" = set; then
8045   echo $ECHO_N "(cached) $ECHO_C" >&6
8046 else
8047
8048         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
8049         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
8050         for cf_header in $cf_header_list
8051         do
8052
8053         cat >conftest.$ac_ext <<_ACEOF
8054 #line 8054 "configure"
8055 #include "confdefs.h"
8056
8057 #include <$cf_header>
8058 int
8059 main ()
8060 {
8061
8062 #ifdef NCURSES_VERSION
8063
8064 printf("%s\n", NCURSES_VERSION);
8065 #else
8066 #ifdef __NCURSES_H
8067 printf("old\n");
8068 #else
8069         make an error
8070 #endif
8071 #endif
8072
8073   ;
8074   return 0;
8075 }
8076 _ACEOF
8077 rm -f conftest.$ac_objext
8078 if { (eval echo "$as_me:8078: \"$ac_compile\"") >&5
8079   (eval $ac_compile) 2>&5
8080   ac_status=$?
8081   echo "$as_me:8081: \$? = $ac_status" >&5
8082   (exit $ac_status); } &&
8083          { ac_try='test -s conftest.$ac_objext'
8084   { (eval echo "$as_me:8084: \"$ac_try\"") >&5
8085   (eval $ac_try) 2>&5
8086   ac_status=$?
8087   echo "$as_me:8087: \$? = $ac_status" >&5
8088   (exit $ac_status); }; }; then
8089   cf_cv_ncurses_h=$cf_header
8090
8091 else
8092   echo "$as_me: failed program was:" >&5
8093 cat conftest.$ac_ext >&5
8094 cf_cv_ncurses_h=no
8095 fi
8096 rm -f conftest.$ac_objext conftest.$ac_ext
8097
8098                 test "$cf_cv_ncurses_h" != no && break
8099         done
8100
8101 fi
8102 echo "$as_me:8102: result: $cf_cv_ncurses_h" >&5
8103 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
8104
8105 if test "$cf_cv_ncurses_h" != no ; then
8106         cf_cv_ncurses_header=$cf_cv_ncurses_h
8107 else
8108
8109 echo "$as_me:8109: checking for $cf_ncuhdr_root include-path" >&5
8110 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
8111 if test "${cf_cv_ncurses_h2+set}" = set; then
8112   echo $ECHO_N "(cached) $ECHO_C" >&6
8113 else
8114
8115         test -n "$verbose" && echo
8116
8117 cf_search=
8118
8119 # collect the current set of include-directories from compiler flags
8120 cf_header_path_list=""
8121 if test -n "${CFLAGS}${CPPFLAGS}" ; then
8122         for cf_header_path in $CPPFLAGS $CFLAGS
8123         do
8124                 case $cf_header_path in
8125                 (-I*)
8126                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
8127
8128 test "x$cf_header_path" != "xNONE" && \
8129 test -d "$cf_header_path" && \
8130  {
8131         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
8132         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
8133         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
8134         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
8135         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
8136         test -d $cf_header_path/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8137 }
8138
8139                         cf_header_path_list="$cf_header_path_list $cf_search"
8140                         ;;
8141                 esac
8142         done
8143 fi
8144
8145 # add the variations for the package we are looking for
8146
8147 cf_search=
8148
8149 test "x$prefix" != "xNONE" && \
8150 test -d "$prefix" && \
8151  {
8152         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
8153         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
8154         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
8155         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
8156         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
8157         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8158 }
8159
8160 for cf_subdir_prefix in \
8161         /usr \
8162         /usr/local \
8163         /usr/pkg \
8164         /opt \
8165         /opt/local \
8166         $HOME
8167 do
8168
8169 test "x$cf_subdir_prefix" != "x$prefix" && \
8170 test -d "$cf_subdir_prefix" && \
8171 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
8172         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
8173         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
8174         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
8175         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
8176         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
8177         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8178 }
8179
8180 done
8181
8182 test "$includedir" != NONE && \
8183 test "$includedir" != "/usr/include" && \
8184 test -d "$includedir" && {
8185         test -d $includedir &&    cf_search="$cf_search $includedir"
8186         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
8187 }
8188
8189 test "$oldincludedir" != NONE && \
8190 test "$oldincludedir" != "/usr/include" && \
8191 test -d "$oldincludedir" && {
8192         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
8193         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
8194 }
8195
8196 cf_search="$cf_search $cf_header_path_list"
8197
8198         test -n "$verbose" && echo search path $cf_search
8199         cf_save2_CPPFLAGS="$CPPFLAGS"
8200         for cf_incdir in $cf_search
8201         do
8202
8203 if test -n "$cf_incdir" ; then
8204   for cf_add_incdir in $cf_incdir
8205   do
8206         while test $cf_add_incdir != /usr/include
8207         do
8208           if test -d $cf_add_incdir
8209           then
8210                 cf_have_incdir=no
8211                 if test -n "$CFLAGS$CPPFLAGS" ; then
8212                   # a loop is needed to ensure we can add subdirs of existing dirs
8213                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8214                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8215                           cf_have_incdir=yes; break
8216                         fi
8217                   done
8218                 fi
8219
8220                 if test "$cf_have_incdir" = no ; then
8221                   if test "$cf_add_incdir" = /usr/local/include ; then
8222                         if test "$GCC" = yes
8223                         then
8224                           cf_save_CPPFLAGS=$CPPFLAGS
8225                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8226                           cat >conftest.$ac_ext <<_ACEOF
8227 #line 8227 "configure"
8228 #include "confdefs.h"
8229 #include <stdio.h>
8230 int
8231 main ()
8232 {
8233 printf("Hello")
8234   ;
8235   return 0;
8236 }
8237 _ACEOF
8238 rm -f conftest.$ac_objext
8239 if { (eval echo "$as_me:8239: \"$ac_compile\"") >&5
8240   (eval $ac_compile) 2>&5
8241   ac_status=$?
8242   echo "$as_me:8242: \$? = $ac_status" >&5
8243   (exit $ac_status); } &&
8244          { ac_try='test -s conftest.$ac_objext'
8245   { (eval echo "$as_me:8245: \"$ac_try\"") >&5
8246   (eval $ac_try) 2>&5
8247   ac_status=$?
8248   echo "$as_me:8248: \$? = $ac_status" >&5
8249   (exit $ac_status); }; }; then
8250   :
8251 else
8252   echo "$as_me: failed program was:" >&5
8253 cat conftest.$ac_ext >&5
8254 cf_have_incdir=yes
8255 fi
8256 rm -f conftest.$ac_objext conftest.$ac_ext
8257                           CPPFLAGS=$cf_save_CPPFLAGS
8258                         fi
8259                   fi
8260                 fi
8261
8262                 if test "$cf_have_incdir" = no ; then
8263                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8264
8265 echo "${as_me:-configure}:8265: testing adding $cf_add_incdir to include-path ..." 1>&5
8266
8267                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8268
8269                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8270                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8271                   cf_add_incdir="$cf_top_incdir"
8272                 else
8273                   break
8274                 fi
8275           else
8276                 break
8277           fi
8278         done
8279   done
8280 fi
8281
8282                 for cf_header in \
8283                         ncurses.h \
8284                         curses.h
8285                 do
8286
8287         cat >conftest.$ac_ext <<_ACEOF
8288 #line 8288 "configure"
8289 #include "confdefs.h"
8290
8291 #include <$cf_header>
8292 int
8293 main ()
8294 {
8295
8296 #ifdef NCURSES_VERSION
8297
8298 printf("%s\n", NCURSES_VERSION);
8299 #else
8300 #ifdef __NCURSES_H
8301 printf("old\n");
8302 #else
8303         make an error
8304 #endif
8305 #endif
8306
8307   ;
8308   return 0;
8309 }
8310 _ACEOF
8311 rm -f conftest.$ac_objext
8312 if { (eval echo "$as_me:8312: \"$ac_compile\"") >&5
8313   (eval $ac_compile) 2>&5
8314   ac_status=$?
8315   echo "$as_me:8315: \$? = $ac_status" >&5
8316   (exit $ac_status); } &&
8317          { ac_try='test -s conftest.$ac_objext'
8318   { (eval echo "$as_me:8318: \"$ac_try\"") >&5
8319   (eval $ac_try) 2>&5
8320   ac_status=$?
8321   echo "$as_me:8321: \$? = $ac_status" >&5
8322   (exit $ac_status); }; }; then
8323   cf_cv_ncurses_h2=$cf_header
8324
8325 else
8326   echo "$as_me: failed program was:" >&5
8327 cat conftest.$ac_ext >&5
8328 cf_cv_ncurses_h2=no
8329 fi
8330 rm -f conftest.$ac_objext conftest.$ac_ext
8331
8332                         if test "$cf_cv_ncurses_h2" != no ; then
8333                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
8334                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
8335                                 break
8336                         fi
8337                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
8338                 done
8339                 CPPFLAGS="$cf_save2_CPPFLAGS"
8340                 test "$cf_cv_ncurses_h2" != no && break
8341         done
8342         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:8342: error: not found" >&5
8343 echo "$as_me: error: not found" >&2;}
8344    { (exit 1); exit 1; }; }
8345
8346 fi
8347 echo "$as_me:8347: result: $cf_cv_ncurses_h2" >&5
8348 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
8349
8350         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
8351         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
8352         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
8353                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
8354         fi
8355
8356 if test -n "$cf_1st_incdir" ; then
8357   for cf_add_incdir in $cf_1st_incdir
8358   do
8359         while test $cf_add_incdir != /usr/include
8360         do
8361           if test -d $cf_add_incdir
8362           then
8363                 cf_have_incdir=no
8364                 if test -n "$CFLAGS$CPPFLAGS" ; then
8365                   # a loop is needed to ensure we can add subdirs of existing dirs
8366                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8367                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8368                           cf_have_incdir=yes; break
8369                         fi
8370                   done
8371                 fi
8372
8373                 if test "$cf_have_incdir" = no ; then
8374                   if test "$cf_add_incdir" = /usr/local/include ; then
8375                         if test "$GCC" = yes
8376                         then
8377                           cf_save_CPPFLAGS=$CPPFLAGS
8378                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8379                           cat >conftest.$ac_ext <<_ACEOF
8380 #line 8380 "configure"
8381 #include "confdefs.h"
8382 #include <stdio.h>
8383 int
8384 main ()
8385 {
8386 printf("Hello")
8387   ;
8388   return 0;
8389 }
8390 _ACEOF
8391 rm -f conftest.$ac_objext
8392 if { (eval echo "$as_me:8392: \"$ac_compile\"") >&5
8393   (eval $ac_compile) 2>&5
8394   ac_status=$?
8395   echo "$as_me:8395: \$? = $ac_status" >&5
8396   (exit $ac_status); } &&
8397          { ac_try='test -s conftest.$ac_objext'
8398   { (eval echo "$as_me:8398: \"$ac_try\"") >&5
8399   (eval $ac_try) 2>&5
8400   ac_status=$?
8401   echo "$as_me:8401: \$? = $ac_status" >&5
8402   (exit $ac_status); }; }; then
8403   :
8404 else
8405   echo "$as_me: failed program was:" >&5
8406 cat conftest.$ac_ext >&5
8407 cf_have_incdir=yes
8408 fi
8409 rm -f conftest.$ac_objext conftest.$ac_ext
8410                           CPPFLAGS=$cf_save_CPPFLAGS
8411                         fi
8412                   fi
8413                 fi
8414
8415                 if test "$cf_have_incdir" = no ; then
8416                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8417
8418 echo "${as_me:-configure}:8418: testing adding $cf_add_incdir to include-path ..." 1>&5
8419
8420                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8421
8422                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8423                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8424                   cf_add_incdir="$cf_top_incdir"
8425                 else
8426                   break
8427                 fi
8428           else
8429                 break
8430           fi
8431         done
8432   done
8433 fi
8434
8435 fi
8436
8437 # Set definitions to allow ifdef'ing for ncurses.h
8438
8439 case $cf_cv_ncurses_header in
8440 (*ncurses.h)
8441
8442 cat >>confdefs.h <<\EOF
8443 #define HAVE_NCURSES_H 1
8444 EOF
8445
8446         ;;
8447 esac
8448
8449 case $cf_cv_ncurses_header in
8450 (ncurses/curses.h|ncurses/ncurses.h)
8451
8452 cat >>confdefs.h <<\EOF
8453 #define HAVE_NCURSES_NCURSES_H 1
8454 EOF
8455
8456         ;;
8457 (ncursesw/curses.h|ncursesw/ncurses.h)
8458
8459 cat >>confdefs.h <<\EOF
8460 #define HAVE_NCURSESW_NCURSES_H 1
8461 EOF
8462
8463         ;;
8464 esac
8465
8466 echo "$as_me:8466: checking for terminfo header" >&5
8467 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
8468 if test "${cf_cv_term_header+set}" = set; then
8469   echo $ECHO_N "(cached) $ECHO_C" >&6
8470 else
8471
8472 case ${cf_cv_ncurses_header} in
8473 (*/ncurses.h|*/ncursesw.h)
8474         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
8475         ;;
8476 (*)
8477         cf_term_header=term.h
8478         ;;
8479 esac
8480
8481 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
8482 do
8483 cat >conftest.$ac_ext <<_ACEOF
8484 #line 8484 "configure"
8485 #include "confdefs.h"
8486 #include <stdio.h>
8487 #include <${cf_cv_ncurses_header:-curses.h}>
8488 #include <$cf_test>
8489
8490 int
8491 main ()
8492 {
8493 int x = auto_left_margin
8494   ;
8495   return 0;
8496 }
8497 _ACEOF
8498 rm -f conftest.$ac_objext
8499 if { (eval echo "$as_me:8499: \"$ac_compile\"") >&5
8500   (eval $ac_compile) 2>&5
8501   ac_status=$?
8502   echo "$as_me:8502: \$? = $ac_status" >&5
8503   (exit $ac_status); } &&
8504          { ac_try='test -s conftest.$ac_objext'
8505   { (eval echo "$as_me:8505: \"$ac_try\"") >&5
8506   (eval $ac_try) 2>&5
8507   ac_status=$?
8508   echo "$as_me:8508: \$? = $ac_status" >&5
8509   (exit $ac_status); }; }; then
8510
8511         cf_cv_term_header="$cf_test"
8512 else
8513   echo "$as_me: failed program was:" >&5
8514 cat conftest.$ac_ext >&5
8515
8516         cf_cv_term_header=unknown
8517
8518 fi
8519 rm -f conftest.$ac_objext conftest.$ac_ext
8520         test "$cf_cv_term_header" != unknown && break
8521 done
8522
8523 fi
8524 echo "$as_me:8524: result: $cf_cv_term_header" >&5
8525 echo "${ECHO_T}$cf_cv_term_header" >&6
8526
8527 # Set definitions to allow ifdef'ing to accommodate subdirectories
8528
8529 case $cf_cv_term_header in
8530 (*term.h)
8531
8532 cat >>confdefs.h <<\EOF
8533 #define HAVE_TERM_H 1
8534 EOF
8535
8536         ;;
8537 esac
8538
8539 case $cf_cv_term_header in
8540 (ncurses/term.h)
8541
8542 cat >>confdefs.h <<\EOF
8543 #define HAVE_NCURSES_TERM_H 1
8544 EOF
8545
8546         ;;
8547 (ncursesw/term.h)
8548
8549 cat >>confdefs.h <<\EOF
8550 #define HAVE_NCURSESW_TERM_H 1
8551 EOF
8552
8553         ;;
8554 esac
8555
8556 # some applications need this, but should check for NCURSES_VERSION
8557
8558 cat >>confdefs.h <<\EOF
8559 #define NCURSES 1
8560 EOF
8561
8562 echo "$as_me:8562: checking for ncurses version" >&5
8563 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
8564 if test "${cf_cv_ncurses_version+set}" = set; then
8565   echo $ECHO_N "(cached) $ECHO_C" >&6
8566 else
8567
8568         cf_cv_ncurses_version=no
8569         cf_tempfile=out$$
8570         rm -f $cf_tempfile
8571         if test "$cross_compiling" = yes; then
8572
8573         # This will not work if the preprocessor splits the line after the
8574         # Autoconf token.  The 'unproto' program does that.
8575         cat > conftest.$ac_ext <<EOF
8576 #include <${cf_cv_ncurses_header:-curses.h}>
8577 #undef Autoconf
8578 #ifdef NCURSES_VERSION
8579 Autoconf NCURSES_VERSION
8580 #else
8581 #ifdef __NCURSES_H
8582 Autoconf "old"
8583 #endif
8584 ;
8585 #endif
8586 EOF
8587         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
8588         { (eval echo "$as_me:8588: \"$cf_try\"") >&5
8589   (eval $cf_try) 2>&5
8590   ac_status=$?
8591   echo "$as_me:8591: \$? = $ac_status" >&5
8592   (exit $ac_status); }
8593         if test -f conftest.out ; then
8594                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
8595                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
8596                 rm -f conftest.out
8597         fi
8598
8599 else
8600   cat >conftest.$ac_ext <<_ACEOF
8601 #line 8601 "configure"
8602 #include "confdefs.h"
8603
8604 #include <${cf_cv_ncurses_header:-curses.h}>
8605 #include <stdio.h>
8606 int main()
8607 {
8608         FILE *fp = fopen("$cf_tempfile", "w");
8609 #ifdef NCURSES_VERSION
8610 # ifdef NCURSES_VERSION_PATCH
8611         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
8612 # else
8613         fprintf(fp, "%s\n", NCURSES_VERSION);
8614 # endif
8615 #else
8616 # ifdef __NCURSES_H
8617         fprintf(fp, "old\n");
8618 # else
8619         make an error
8620 # endif
8621 #endif
8622         ${cf_cv_main_return:-return}(0);
8623 }
8624 _ACEOF
8625 rm -f conftest$ac_exeext
8626 if { (eval echo "$as_me:8626: \"$ac_link\"") >&5
8627   (eval $ac_link) 2>&5
8628   ac_status=$?
8629   echo "$as_me:8629: \$? = $ac_status" >&5
8630   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
8631   { (eval echo "$as_me:8631: \"$ac_try\"") >&5
8632   (eval $ac_try) 2>&5
8633   ac_status=$?
8634   echo "$as_me:8634: \$? = $ac_status" >&5
8635   (exit $ac_status); }; }; then
8636
8637         cf_cv_ncurses_version=`cat $cf_tempfile`
8638 else
8639   echo "$as_me: program exited with status $ac_status" >&5
8640 echo "$as_me: failed program was:" >&5
8641 cat conftest.$ac_ext >&5
8642 fi
8643 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
8644 fi
8645         rm -f $cf_tempfile
8646
8647 fi
8648 echo "$as_me:8648: result: $cf_cv_ncurses_version" >&5
8649 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
8650 test "$cf_cv_ncurses_version" = no ||
8651 cat >>confdefs.h <<\EOF
8652 #define NCURSES 1
8653 EOF
8654
8655 cf_nculib_root=$cf_cv_screen
8656         # This works, except for the special case where we find gpm, but
8657         # ncurses is in a nonstandard location via $LIBS, and we really want
8658         # to link gpm.
8659 cf_ncurses_LIBS=""
8660 cf_ncurses_SAVE="$LIBS"
8661 echo "$as_me:8661: checking for Gpm_Open in -lgpm" >&5
8662 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
8663 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
8664   echo $ECHO_N "(cached) $ECHO_C" >&6
8665 else
8666   ac_check_lib_save_LIBS=$LIBS
8667 LIBS="-lgpm  $LIBS"
8668 cat >conftest.$ac_ext <<_ACEOF
8669 #line 8669 "configure"
8670 #include "confdefs.h"
8671
8672 /* Override any gcc2 internal prototype to avoid an error.  */
8673 #ifdef __cplusplus
8674 extern "C"
8675 #endif
8676 /* We use char because int might match the return type of a gcc2
8677    builtin and then its argument prototype would still apply.  */
8678 char Gpm_Open ();
8679 int
8680 main ()
8681 {
8682 Gpm_Open ();
8683   ;
8684   return 0;
8685 }
8686 _ACEOF
8687 rm -f conftest.$ac_objext conftest$ac_exeext
8688 if { (eval echo "$as_me:8688: \"$ac_link\"") >&5
8689   (eval $ac_link) 2>&5
8690   ac_status=$?
8691   echo "$as_me:8691: \$? = $ac_status" >&5
8692   (exit $ac_status); } &&
8693          { ac_try='test -s conftest$ac_exeext'
8694   { (eval echo "$as_me:8694: \"$ac_try\"") >&5
8695   (eval $ac_try) 2>&5
8696   ac_status=$?
8697   echo "$as_me:8697: \$? = $ac_status" >&5
8698   (exit $ac_status); }; }; then
8699   ac_cv_lib_gpm_Gpm_Open=yes
8700 else
8701   echo "$as_me: failed program was:" >&5
8702 cat conftest.$ac_ext >&5
8703 ac_cv_lib_gpm_Gpm_Open=no
8704 fi
8705 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8706 LIBS=$ac_check_lib_save_LIBS
8707 fi
8708 echo "$as_me:8708: result: $ac_cv_lib_gpm_Gpm_Open" >&5
8709 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
8710 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
8711   echo "$as_me:8711: checking for initscr in -lgpm" >&5
8712 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
8713 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
8714   echo $ECHO_N "(cached) $ECHO_C" >&6
8715 else
8716   ac_check_lib_save_LIBS=$LIBS
8717 LIBS="-lgpm  $LIBS"
8718 cat >conftest.$ac_ext <<_ACEOF
8719 #line 8719 "configure"
8720 #include "confdefs.h"
8721
8722 /* Override any gcc2 internal prototype to avoid an error.  */
8723 #ifdef __cplusplus
8724 extern "C"
8725 #endif
8726 /* We use char because int might match the return type of a gcc2
8727    builtin and then its argument prototype would still apply.  */
8728 char initscr ();
8729 int
8730 main ()
8731 {
8732 initscr ();
8733   ;
8734   return 0;
8735 }
8736 _ACEOF
8737 rm -f conftest.$ac_objext conftest$ac_exeext
8738 if { (eval echo "$as_me:8738: \"$ac_link\"") >&5
8739   (eval $ac_link) 2>&5
8740   ac_status=$?
8741   echo "$as_me:8741: \$? = $ac_status" >&5
8742   (exit $ac_status); } &&
8743          { ac_try='test -s conftest$ac_exeext'
8744   { (eval echo "$as_me:8744: \"$ac_try\"") >&5
8745   (eval $ac_try) 2>&5
8746   ac_status=$?
8747   echo "$as_me:8747: \$? = $ac_status" >&5
8748   (exit $ac_status); }; }; then
8749   ac_cv_lib_gpm_initscr=yes
8750 else
8751   echo "$as_me: failed program was:" >&5
8752 cat conftest.$ac_ext >&5
8753 ac_cv_lib_gpm_initscr=no
8754 fi
8755 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8756 LIBS=$ac_check_lib_save_LIBS
8757 fi
8758 echo "$as_me:8758: result: $ac_cv_lib_gpm_initscr" >&5
8759 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
8760 if test $ac_cv_lib_gpm_initscr = yes; then
8761   LIBS="$cf_ncurses_SAVE"
8762 else
8763   cf_ncurses_LIBS="-lgpm"
8764 fi
8765
8766 fi
8767
8768 case $host_os in
8769 (freebsd*)
8770         # This is only necessary if you are linking against an obsolete
8771         # version of ncurses (but it should do no harm, since it's static).
8772         if test "$cf_nculib_root" = ncurses ; then
8773                 echo "$as_me:8773: checking for tgoto in -lmytinfo" >&5
8774 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
8775 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
8776   echo $ECHO_N "(cached) $ECHO_C" >&6
8777 else
8778   ac_check_lib_save_LIBS=$LIBS
8779 LIBS="-lmytinfo  $LIBS"
8780 cat >conftest.$ac_ext <<_ACEOF
8781 #line 8781 "configure"
8782 #include "confdefs.h"
8783
8784 /* Override any gcc2 internal prototype to avoid an error.  */
8785 #ifdef __cplusplus
8786 extern "C"
8787 #endif
8788 /* We use char because int might match the return type of a gcc2
8789    builtin and then its argument prototype would still apply.  */
8790 char tgoto ();
8791 int
8792 main ()
8793 {
8794 tgoto ();
8795   ;
8796   return 0;
8797 }
8798 _ACEOF
8799 rm -f conftest.$ac_objext conftest$ac_exeext
8800 if { (eval echo "$as_me:8800: \"$ac_link\"") >&5
8801   (eval $ac_link) 2>&5
8802   ac_status=$?
8803   echo "$as_me:8803: \$? = $ac_status" >&5
8804   (exit $ac_status); } &&
8805          { ac_try='test -s conftest$ac_exeext'
8806   { (eval echo "$as_me:8806: \"$ac_try\"") >&5
8807   (eval $ac_try) 2>&5
8808   ac_status=$?
8809   echo "$as_me:8809: \$? = $ac_status" >&5
8810   (exit $ac_status); }; }; then
8811   ac_cv_lib_mytinfo_tgoto=yes
8812 else
8813   echo "$as_me: failed program was:" >&5
8814 cat conftest.$ac_ext >&5
8815 ac_cv_lib_mytinfo_tgoto=no
8816 fi
8817 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8818 LIBS=$ac_check_lib_save_LIBS
8819 fi
8820 echo "$as_me:8820: result: $ac_cv_lib_mytinfo_tgoto" >&5
8821 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
8822 if test $ac_cv_lib_mytinfo_tgoto = yes; then
8823   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
8824 fi
8825
8826         fi
8827         ;;
8828 esac
8829
8830 cf_add_libs="$cf_ncurses_LIBS"
8831 # Filter out duplicates - this happens with badly-designed ".pc" files...
8832 for cf_add_1lib in $LIBS
8833 do
8834         for cf_add_2lib in $cf_add_libs
8835         do
8836                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
8837                 then
8838                         cf_add_1lib=
8839                         break
8840                 fi
8841         done
8842         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
8843 done
8844 LIBS="$cf_add_libs"
8845
8846 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
8847 then
8848
8849 cf_add_libs="-l$cf_nculib_root"
8850 # Filter out duplicates - this happens with badly-designed ".pc" files...
8851 for cf_add_1lib in $LIBS
8852 do
8853         for cf_add_2lib in $cf_add_libs
8854         do
8855                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
8856                 then
8857                         cf_add_1lib=
8858                         break
8859                 fi
8860         done
8861         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
8862 done
8863 LIBS="$cf_add_libs"
8864
8865 else
8866
8867         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
8868         cf_libdir=""
8869         echo "$as_me:8869: checking for initscr" >&5
8870 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
8871 if test "${ac_cv_func_initscr+set}" = set; then
8872   echo $ECHO_N "(cached) $ECHO_C" >&6
8873 else
8874   cat >conftest.$ac_ext <<_ACEOF
8875 #line 8875 "configure"
8876 #include "confdefs.h"
8877 /* System header to define __stub macros and hopefully few prototypes,
8878     which can conflict with char initscr (); below.  */
8879 #include <assert.h>
8880 /* Override any gcc2 internal prototype to avoid an error.  */
8881 #ifdef __cplusplus
8882 extern "C"
8883 #endif
8884 /* We use char because int might match the return type of a gcc2
8885    builtin and then its argument prototype would still apply.  */
8886 char initscr ();
8887 char (*f) ();
8888
8889 int
8890 main ()
8891 {
8892 /* The GNU C library defines this for functions which it implements
8893     to always fail with ENOSYS.  Some functions are actually named
8894     something starting with __ and the normal name is an alias.  */
8895 #if defined (__stub_initscr) || defined (__stub___initscr)
8896 choke me
8897 #else
8898 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
8899 #endif
8900
8901   ;
8902   return 0;
8903 }
8904 _ACEOF
8905 rm -f conftest.$ac_objext conftest$ac_exeext
8906 if { (eval echo "$as_me:8906: \"$ac_link\"") >&5
8907   (eval $ac_link) 2>&5
8908   ac_status=$?
8909   echo "$as_me:8909: \$? = $ac_status" >&5
8910   (exit $ac_status); } &&
8911          { ac_try='test -s conftest$ac_exeext'
8912   { (eval echo "$as_me:8912: \"$ac_try\"") >&5
8913   (eval $ac_try) 2>&5
8914   ac_status=$?
8915   echo "$as_me:8915: \$? = $ac_status" >&5
8916   (exit $ac_status); }; }; then
8917   ac_cv_func_initscr=yes
8918 else
8919   echo "$as_me: failed program was:" >&5
8920 cat conftest.$ac_ext >&5
8921 ac_cv_func_initscr=no
8922 fi
8923 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8924 fi
8925 echo "$as_me:8925: result: $ac_cv_func_initscr" >&5
8926 echo "${ECHO_T}$ac_cv_func_initscr" >&6
8927 if test $ac_cv_func_initscr = yes; then
8928   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8929 else
8930
8931                 cf_save_LIBS="$LIBS"
8932                 echo "$as_me:8932: checking for initscr in -l$cf_nculib_root" >&5
8933 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
8934                 LIBS="-l$cf_nculib_root $LIBS"
8935                 cat >conftest.$ac_ext <<_ACEOF
8936 #line 8936 "configure"
8937 #include "confdefs.h"
8938 #include <${cf_cv_ncurses_header:-curses.h}>
8939 int
8940 main ()
8941 {
8942 initscr()
8943   ;
8944   return 0;
8945 }
8946 _ACEOF
8947 rm -f conftest.$ac_objext conftest$ac_exeext
8948 if { (eval echo "$as_me:8948: \"$ac_link\"") >&5
8949   (eval $ac_link) 2>&5
8950   ac_status=$?
8951   echo "$as_me:8951: \$? = $ac_status" >&5
8952   (exit $ac_status); } &&
8953          { ac_try='test -s conftest$ac_exeext'
8954   { (eval echo "$as_me:8954: \"$ac_try\"") >&5
8955   (eval $ac_try) 2>&5
8956   ac_status=$?
8957   echo "$as_me:8957: \$? = $ac_status" >&5
8958   (exit $ac_status); }; }; then
8959   echo "$as_me:8959: result: yes" >&5
8960 echo "${ECHO_T}yes" >&6
8961                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8962
8963 else
8964   echo "$as_me: failed program was:" >&5
8965 cat conftest.$ac_ext >&5
8966 echo "$as_me:8966: result: no" >&5
8967 echo "${ECHO_T}no" >&6
8968
8969 cf_search=
8970 cf_library_path_list=""
8971 if test -n "${LDFLAGS}${LIBS}" ; then
8972         for cf_library_path in $LDFLAGS $LIBS
8973         do
8974                 case $cf_library_path in
8975                 (-L*)
8976                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
8977
8978 test "x$cf_library_path" != "xNONE" && \
8979 test -d "$cf_library_path" && \
8980  {
8981         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
8982         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
8983         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
8984         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
8985         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
8986         test -d $cf_library_path/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib/$cf_nculib_root"
8987 }
8988
8989                         cf_library_path_list="$cf_library_path_list $cf_search"
8990                         ;;
8991                 esac
8992         done
8993 fi
8994
8995 cf_search=
8996
8997 test "x$prefix" != "xNONE" && \
8998 test -d "$prefix" && \
8999  {
9000         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
9001         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
9002         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
9003         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
9004         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
9005         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
9006 }
9007
9008 for cf_subdir_prefix in \
9009         /usr \
9010         /usr/local \
9011         /usr/pkg \
9012         /opt \
9013         /opt/local \
9014         $HOME
9015 do
9016
9017 test "x$cf_subdir_prefix" != "x$prefix" && \
9018 test -d "$cf_subdir_prefix" && \
9019 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
9020         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
9021         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
9022         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
9023         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
9024         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
9025         test -d $cf_subdir_prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib/$cf_nculib_root"
9026 }
9027
9028 done
9029
9030 cf_search="$cf_library_path_list $cf_search"
9031
9032                         for cf_libdir in $cf_search
9033                         do
9034                                 echo "$as_me:9034: checking for -l$cf_nculib_root in $cf_libdir" >&5
9035 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
9036                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
9037                                 cat >conftest.$ac_ext <<_ACEOF
9038 #line 9038 "configure"
9039 #include "confdefs.h"
9040 #include <${cf_cv_ncurses_header:-curses.h}>
9041 int
9042 main ()
9043 {
9044 initscr()
9045   ;
9046   return 0;
9047 }
9048 _ACEOF
9049 rm -f conftest.$ac_objext conftest$ac_exeext
9050 if { (eval echo "$as_me:9050: \"$ac_link\"") >&5
9051   (eval $ac_link) 2>&5
9052   ac_status=$?
9053   echo "$as_me:9053: \$? = $ac_status" >&5
9054   (exit $ac_status); } &&
9055          { ac_try='test -s conftest$ac_exeext'
9056   { (eval echo "$as_me:9056: \"$ac_try\"") >&5
9057   (eval $ac_try) 2>&5
9058   ac_status=$?
9059   echo "$as_me:9059: \$? = $ac_status" >&5
9060   (exit $ac_status); }; }; then
9061   echo "$as_me:9061: result: yes" >&5
9062 echo "${ECHO_T}yes" >&6
9063                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9064                                          break
9065 else
9066   echo "$as_me: failed program was:" >&5
9067 cat conftest.$ac_ext >&5
9068 echo "$as_me:9068: result: no" >&5
9069 echo "${ECHO_T}no" >&6
9070                                          LIBS="$cf_save_LIBS"
9071 fi
9072 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9073                         done
9074
9075 fi
9076 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9077
9078 fi
9079
9080 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
9081
9082 if test $cf_found_library = no ; then
9083         { { echo "$as_me:9083: error: Cannot link $cf_nculib_root library" >&5
9084 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
9085    { (exit 1); exit 1; }; }
9086 fi
9087
9088 fi
9089
9090 if test -n "$cf_ncurses_LIBS" ; then
9091         echo "$as_me:9091: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
9092 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
9093         cf_ncurses_SAVE="$LIBS"
9094         for p in $cf_ncurses_LIBS ; do
9095                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
9096                 if test "$q" != "$LIBS" ; then
9097                         LIBS="$q"
9098                 fi
9099         done
9100         cat >conftest.$ac_ext <<_ACEOF
9101 #line 9101 "configure"
9102 #include "confdefs.h"
9103 #include <${cf_cv_ncurses_header:-curses.h}>
9104 int
9105 main ()
9106 {
9107 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
9108   ;
9109   return 0;
9110 }
9111 _ACEOF
9112 rm -f conftest.$ac_objext conftest$ac_exeext
9113 if { (eval echo "$as_me:9113: \"$ac_link\"") >&5
9114   (eval $ac_link) 2>&5
9115   ac_status=$?
9116   echo "$as_me:9116: \$? = $ac_status" >&5
9117   (exit $ac_status); } &&
9118          { ac_try='test -s conftest$ac_exeext'
9119   { (eval echo "$as_me:9119: \"$ac_try\"") >&5
9120   (eval $ac_try) 2>&5
9121   ac_status=$?
9122   echo "$as_me:9122: \$? = $ac_status" >&5
9123   (exit $ac_status); }; }; then
9124   echo "$as_me:9124: result: yes" >&5
9125 echo "${ECHO_T}yes" >&6
9126 else
9127   echo "$as_me: failed program was:" >&5
9128 cat conftest.$ac_ext >&5
9129 echo "$as_me:9129: result: no" >&5
9130 echo "${ECHO_T}no" >&6
9131                  LIBS="$cf_ncurses_SAVE"
9132 fi
9133 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9134 fi
9135
9136 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9137
9138 cat >>confdefs.h <<EOF
9139 #define $cf_nculib_ROOT 1
9140 EOF
9141
9142         fi
9143 else
9144         NCURSES_CONFIG=none
9145 fi
9146
9147         ;;
9148 (pdcurses)
9149         echo "$as_me:9149: checking for X" >&5
9150 echo $ECHO_N "checking for X... $ECHO_C" >&6
9151
9152 # Check whether --with-x or --without-x was given.
9153 if test "${with_x+set}" = set; then
9154   withval="$with_x"
9155
9156 fi;
9157 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
9158 if test "x$with_x" = xno; then
9159   # The user explicitly disabled X.
9160   have_x=disabled
9161 else
9162   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
9163     # Both variables are already set.
9164     have_x=yes
9165   else
9166     if test "${ac_cv_have_x+set}" = set; then
9167   echo $ECHO_N "(cached) $ECHO_C" >&6
9168 else
9169   # One or both of the vars are not set, and there is no cached value.
9170 ac_x_includes=no ac_x_libraries=no
9171 rm -fr conftest.dir
9172 if mkdir conftest.dir; then
9173   cd conftest.dir
9174   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
9175   cat >Imakefile <<'EOF'
9176 acfindx:
9177         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
9178 EOF
9179   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
9180     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
9181     eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
9182     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
9183     for ac_extension in a so sl dylib dll; do
9184       if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
9185          test -f $ac_im_libdir/libX11.$ac_extension; then
9186         ac_im_usrlibdir=$ac_im_libdir; break
9187       fi
9188     done
9189     # Screen out bogus values from the imake configuration.  They are
9190     # bogus both because they are the default anyway, and because
9191     # using them would break gcc on systems where it needs fixed includes.
9192     case $ac_im_incroot in
9193         /usr/include) ;;
9194         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
9195     esac
9196     case $ac_im_usrlibdir in
9197         /usr/lib | /lib) ;;
9198         *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
9199     esac
9200   fi
9201   cd ..
9202   rm -fr conftest.dir
9203 fi
9204
9205 # Standard set of common directories for X headers.
9206 # Check X11 before X11Rn because it is often a symlink to the current release.
9207 ac_x_header_dirs='
9208 /usr/X11/include
9209 /usr/X11R6/include
9210 /usr/X11R5/include
9211 /usr/X11R4/include
9212
9213 /usr/include/X11
9214 /usr/include/X11R6
9215 /usr/include/X11R5
9216 /usr/include/X11R4
9217
9218 /usr/local/X11/include
9219 /usr/local/X11R6/include
9220 /usr/local/X11R5/include
9221 /usr/local/X11R4/include
9222
9223 /usr/local/include/X11
9224 /usr/local/include/X11R6
9225 /usr/local/include/X11R5
9226 /usr/local/include/X11R4
9227
9228 /usr/X386/include
9229 /usr/x386/include
9230 /usr/XFree86/include/X11
9231
9232 /usr/include
9233 /usr/local/include
9234 /usr/unsupported/include
9235 /usr/athena/include
9236 /usr/local/x11r5/include
9237 /usr/lpp/Xamples/include
9238
9239 /usr/openwin/include
9240 /usr/openwin/share/include'
9241
9242 if test "$ac_x_includes" = no; then
9243   # Guess where to find include files, by looking for Intrinsic.h.
9244   # First, try using that file with no special directory specified.
9245   cat >conftest.$ac_ext <<_ACEOF
9246 #line 9246 "configure"
9247 #include "confdefs.h"
9248 #include <X11/Intrinsic.h>
9249 _ACEOF
9250 if { (eval echo "$as_me:9250: \"$ac_cpp conftest.$ac_ext\"") >&5
9251   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
9252   ac_status=$?
9253   egrep -v '^ *\+' conftest.er1 >conftest.err
9254   rm -f conftest.er1
9255   cat conftest.err >&5
9256   echo "$as_me:9256: \$? = $ac_status" >&5
9257   (exit $ac_status); } >/dev/null; then
9258   if test -s conftest.err; then
9259     ac_cpp_err=$ac_c_preproc_warn_flag
9260   else
9261     ac_cpp_err=
9262   fi
9263 else
9264   ac_cpp_err=yes
9265 fi
9266 if test -z "$ac_cpp_err"; then
9267   # We can compile using X headers with no special include directory.
9268 ac_x_includes=
9269 else
9270   echo "$as_me: failed program was:" >&5
9271   cat conftest.$ac_ext >&5
9272   for ac_dir in $ac_x_header_dirs; do
9273   if test -r "$ac_dir/X11/Intrinsic.h"; then
9274     ac_x_includes=$ac_dir
9275     break
9276   fi
9277 done
9278 fi
9279 rm -f conftest.err conftest.$ac_ext
9280 fi # $ac_x_includes = no
9281
9282 if test "$ac_x_libraries" = no; then
9283   # Check for the libraries.
9284   # See if we find them without any special options.
9285   # Don't add to $LIBS permanently.
9286   ac_save_LIBS=$LIBS
9287   LIBS="-lXt $LIBS"
9288   cat >conftest.$ac_ext <<_ACEOF
9289 #line 9289 "configure"
9290 #include "confdefs.h"
9291 #include <X11/Intrinsic.h>
9292 int
9293 main ()
9294 {
9295 XtMalloc (0)
9296   ;
9297   return 0;
9298 }
9299 _ACEOF
9300 rm -f conftest.$ac_objext conftest$ac_exeext
9301 if { (eval echo "$as_me:9301: \"$ac_link\"") >&5
9302   (eval $ac_link) 2>&5
9303   ac_status=$?
9304   echo "$as_me:9304: \$? = $ac_status" >&5
9305   (exit $ac_status); } &&
9306          { ac_try='test -s conftest$ac_exeext'
9307   { (eval echo "$as_me:9307: \"$ac_try\"") >&5
9308   (eval $ac_try) 2>&5
9309   ac_status=$?
9310   echo "$as_me:9310: \$? = $ac_status" >&5
9311   (exit $ac_status); }; }; then
9312   LIBS=$ac_save_LIBS
9313 # We can link X programs with no special library path.
9314 ac_x_libraries=
9315 else
9316   echo "$as_me: failed program was:" >&5
9317 cat conftest.$ac_ext >&5
9318 LIBS=$ac_save_LIBS
9319 for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
9320 do
9321   # Don't even attempt the hair of trying to link an X program!
9322   for ac_extension in a so sl dylib dll; do
9323     if test -r $ac_dir/libXt.$ac_extension; then
9324       ac_x_libraries=$ac_dir
9325       break 2
9326     fi
9327   done
9328 done
9329 fi
9330 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9331 fi # $ac_x_libraries = no
9332
9333 if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then
9334   # Didn't find X anywhere.  Cache the known absence of X.
9335   ac_cv_have_x="have_x=no"
9336 else
9337   # Record where we found X for the cache.
9338   ac_cv_have_x="have_x=yes \
9339                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
9340 fi
9341 fi
9342
9343   fi
9344   eval "$ac_cv_have_x"
9345 fi # $with_x != no
9346
9347 if test "$have_x" != yes; then
9348   echo "$as_me:9348: result: $have_x" >&5
9349 echo "${ECHO_T}$have_x" >&6
9350   no_x=yes
9351 else
9352   # If each of the values was on the command line, it overrides each guess.
9353   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
9354   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
9355   # Update the cache value to reflect the command line values.
9356   ac_cv_have_x="have_x=yes \
9357                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
9358   echo "$as_me:9358: result: libraries $x_libraries, headers $x_includes" >&5
9359 echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6
9360 fi
9361
9362 if test "$no_x" = yes; then
9363   # Not all programs may use this symbol, but it does not hurt to define it.
9364
9365 cat >>confdefs.h <<\EOF
9366 #define X_DISPLAY_MISSING 1
9367 EOF
9368
9369   X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
9370 else
9371   if test -n "$x_includes"; then
9372     X_CFLAGS="$X_CFLAGS -I$x_includes"
9373   fi
9374
9375   # It would also be nice to do this for all -L options, not just this one.
9376   if test -n "$x_libraries"; then
9377     X_LIBS="$X_LIBS -L$x_libraries"
9378     # For Solaris; some versions of Sun CC require a space after -R and
9379     # others require no space.  Words are not sufficient . . . .
9380     case `(uname -sr) 2>/dev/null` in
9381     "SunOS 5"*)
9382       echo "$as_me:9382: checking whether -R must be followed by a space" >&5
9383 echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6
9384       ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
9385       cat >conftest.$ac_ext <<_ACEOF
9386 #line 9386 "configure"
9387 #include "confdefs.h"
9388
9389 int
9390 main ()
9391 {
9392
9393   ;
9394   return 0;
9395 }
9396 _ACEOF
9397 rm -f conftest.$ac_objext conftest$ac_exeext
9398 if { (eval echo "$as_me:9398: \"$ac_link\"") >&5
9399   (eval $ac_link) 2>&5
9400   ac_status=$?
9401   echo "$as_me:9401: \$? = $ac_status" >&5
9402   (exit $ac_status); } &&
9403          { ac_try='test -s conftest$ac_exeext'
9404   { (eval echo "$as_me:9404: \"$ac_try\"") >&5
9405   (eval $ac_try) 2>&5
9406   ac_status=$?
9407   echo "$as_me:9407: \$? = $ac_status" >&5
9408   (exit $ac_status); }; }; then
9409   ac_R_nospace=yes
9410 else
9411   echo "$as_me: failed program was:" >&5
9412 cat conftest.$ac_ext >&5
9413 ac_R_nospace=no
9414 fi
9415 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9416       if test $ac_R_nospace = yes; then
9417         echo "$as_me:9417: result: no" >&5
9418 echo "${ECHO_T}no" >&6
9419         X_LIBS="$X_LIBS -R$x_libraries"
9420       else
9421         LIBS="$ac_xsave_LIBS -R $x_libraries"
9422         cat >conftest.$ac_ext <<_ACEOF
9423 #line 9423 "configure"
9424 #include "confdefs.h"
9425
9426 int
9427 main ()
9428 {
9429
9430   ;
9431   return 0;
9432 }
9433 _ACEOF
9434 rm -f conftest.$ac_objext conftest$ac_exeext
9435 if { (eval echo "$as_me:9435: \"$ac_link\"") >&5
9436   (eval $ac_link) 2>&5
9437   ac_status=$?
9438   echo "$as_me:9438: \$? = $ac_status" >&5
9439   (exit $ac_status); } &&
9440          { ac_try='test -s conftest$ac_exeext'
9441   { (eval echo "$as_me:9441: \"$ac_try\"") >&5
9442   (eval $ac_try) 2>&5
9443   ac_status=$?
9444   echo "$as_me:9444: \$? = $ac_status" >&5
9445   (exit $ac_status); }; }; then
9446   ac_R_space=yes
9447 else
9448   echo "$as_me: failed program was:" >&5
9449 cat conftest.$ac_ext >&5
9450 ac_R_space=no
9451 fi
9452 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9453         if test $ac_R_space = yes; then
9454           echo "$as_me:9454: result: yes" >&5
9455 echo "${ECHO_T}yes" >&6
9456           X_LIBS="$X_LIBS -R $x_libraries"
9457         else
9458           echo "$as_me:9458: result: neither works" >&5
9459 echo "${ECHO_T}neither works" >&6
9460         fi
9461       fi
9462       LIBS=$ac_xsave_LIBS
9463     esac
9464   fi
9465
9466   # Check for system-dependent libraries X programs must link with.
9467   # Do this before checking for the system-independent R6 libraries
9468   # (-lICE), since we may need -lsocket or whatever for X linking.
9469
9470   if test "$ISC" = yes; then
9471     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
9472   else
9473     # Martyn Johnson says this is needed for Ultrix, if the X
9474     # libraries were built with DECnet support.  And Karl Berry says
9475     # the Alpha needs dnet_stub (dnet does not exist).
9476     ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
9477     cat >conftest.$ac_ext <<_ACEOF
9478 #line 9478 "configure"
9479 #include "confdefs.h"
9480
9481 /* Override any gcc2 internal prototype to avoid an error.  */
9482 #ifdef __cplusplus
9483 extern "C"
9484 #endif
9485 /* We use char because int might match the return type of a gcc2
9486    builtin and then its argument prototype would still apply.  */
9487 char XOpenDisplay ();
9488 int
9489 main ()
9490 {
9491 XOpenDisplay ();
9492   ;
9493   return 0;
9494 }
9495 _ACEOF
9496 rm -f conftest.$ac_objext conftest$ac_exeext
9497 if { (eval echo "$as_me:9497: \"$ac_link\"") >&5
9498   (eval $ac_link) 2>&5
9499   ac_status=$?
9500   echo "$as_me:9500: \$? = $ac_status" >&5
9501   (exit $ac_status); } &&
9502          { ac_try='test -s conftest$ac_exeext'
9503   { (eval echo "$as_me:9503: \"$ac_try\"") >&5
9504   (eval $ac_try) 2>&5
9505   ac_status=$?
9506   echo "$as_me:9506: \$? = $ac_status" >&5
9507   (exit $ac_status); }; }; then
9508   :
9509 else
9510   echo "$as_me: failed program was:" >&5
9511 cat conftest.$ac_ext >&5
9512 echo "$as_me:9512: checking for dnet_ntoa in -ldnet" >&5
9513 echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6
9514 if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then
9515   echo $ECHO_N "(cached) $ECHO_C" >&6
9516 else
9517   ac_check_lib_save_LIBS=$LIBS
9518 LIBS="-ldnet  $LIBS"
9519 cat >conftest.$ac_ext <<_ACEOF
9520 #line 9520 "configure"
9521 #include "confdefs.h"
9522
9523 /* Override any gcc2 internal prototype to avoid an error.  */
9524 #ifdef __cplusplus
9525 extern "C"
9526 #endif
9527 /* We use char because int might match the return type of a gcc2
9528    builtin and then its argument prototype would still apply.  */
9529 char dnet_ntoa ();
9530 int
9531 main ()
9532 {
9533 dnet_ntoa ();
9534   ;
9535   return 0;
9536 }
9537 _ACEOF
9538 rm -f conftest.$ac_objext conftest$ac_exeext
9539 if { (eval echo "$as_me:9539: \"$ac_link\"") >&5
9540   (eval $ac_link) 2>&5
9541   ac_status=$?
9542   echo "$as_me:9542: \$? = $ac_status" >&5
9543   (exit $ac_status); } &&
9544          { ac_try='test -s conftest$ac_exeext'
9545   { (eval echo "$as_me:9545: \"$ac_try\"") >&5
9546   (eval $ac_try) 2>&5
9547   ac_status=$?
9548   echo "$as_me:9548: \$? = $ac_status" >&5
9549   (exit $ac_status); }; }; then
9550   ac_cv_lib_dnet_dnet_ntoa=yes
9551 else
9552   echo "$as_me: failed program was:" >&5
9553 cat conftest.$ac_ext >&5
9554 ac_cv_lib_dnet_dnet_ntoa=no
9555 fi
9556 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9557 LIBS=$ac_check_lib_save_LIBS
9558 fi
9559 echo "$as_me:9559: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
9560 echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6
9561 if test $ac_cv_lib_dnet_dnet_ntoa = yes; then
9562   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
9563 fi
9564
9565     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
9566       echo "$as_me:9566: checking for dnet_ntoa in -ldnet_stub" >&5
9567 echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6
9568 if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then
9569   echo $ECHO_N "(cached) $ECHO_C" >&6
9570 else
9571   ac_check_lib_save_LIBS=$LIBS
9572 LIBS="-ldnet_stub  $LIBS"
9573 cat >conftest.$ac_ext <<_ACEOF
9574 #line 9574 "configure"
9575 #include "confdefs.h"
9576
9577 /* Override any gcc2 internal prototype to avoid an error.  */
9578 #ifdef __cplusplus
9579 extern "C"
9580 #endif
9581 /* We use char because int might match the return type of a gcc2
9582    builtin and then its argument prototype would still apply.  */
9583 char dnet_ntoa ();
9584 int
9585 main ()
9586 {
9587 dnet_ntoa ();
9588   ;
9589   return 0;
9590 }
9591 _ACEOF
9592 rm -f conftest.$ac_objext conftest$ac_exeext
9593 if { (eval echo "$as_me:9593: \"$ac_link\"") >&5
9594   (eval $ac_link) 2>&5
9595   ac_status=$?
9596   echo "$as_me:9596: \$? = $ac_status" >&5
9597   (exit $ac_status); } &&
9598          { ac_try='test -s conftest$ac_exeext'
9599   { (eval echo "$as_me:9599: \"$ac_try\"") >&5
9600   (eval $ac_try) 2>&5
9601   ac_status=$?
9602   echo "$as_me:9602: \$? = $ac_status" >&5
9603   (exit $ac_status); }; }; then
9604   ac_cv_lib_dnet_stub_dnet_ntoa=yes
9605 else
9606   echo "$as_me: failed program was:" >&5
9607 cat conftest.$ac_ext >&5
9608 ac_cv_lib_dnet_stub_dnet_ntoa=no
9609 fi
9610 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9611 LIBS=$ac_check_lib_save_LIBS
9612 fi
9613 echo "$as_me:9613: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
9614 echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6
9615 if test $ac_cv_lib_dnet_stub_dnet_ntoa = yes; then
9616   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
9617 fi
9618
9619     fi
9620 fi
9621 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9622     LIBS="$ac_xsave_LIBS"
9623
9624     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
9625     # to get the SysV transport functions.
9626     # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4)
9627     # needs -lnsl.
9628     # The nsl library prevents programs from opening the X display
9629     # on Irix 5.2, according to T.E. Dickey.
9630     # The functions gethostbyname, getservbyname, and inet_addr are
9631     # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
9632     echo "$as_me:9632: checking for gethostbyname" >&5
9633 echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6
9634 if test "${ac_cv_func_gethostbyname+set}" = set; then
9635   echo $ECHO_N "(cached) $ECHO_C" >&6
9636 else
9637   cat >conftest.$ac_ext <<_ACEOF
9638 #line 9638 "configure"
9639 #include "confdefs.h"
9640 /* System header to define __stub macros and hopefully few prototypes,
9641     which can conflict with char gethostbyname (); below.  */
9642 #include <assert.h>
9643 /* Override any gcc2 internal prototype to avoid an error.  */
9644 #ifdef __cplusplus
9645 extern "C"
9646 #endif
9647 /* We use char because int might match the return type of a gcc2
9648    builtin and then its argument prototype would still apply.  */
9649 char gethostbyname ();
9650 char (*f) ();
9651
9652 int
9653 main ()
9654 {
9655 /* The GNU C library defines this for functions which it implements
9656     to always fail with ENOSYS.  Some functions are actually named
9657     something starting with __ and the normal name is an alias.  */
9658 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
9659 choke me
9660 #else
9661 f = gethostbyname; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
9662 #endif
9663
9664   ;
9665   return 0;
9666 }
9667 _ACEOF
9668 rm -f conftest.$ac_objext conftest$ac_exeext
9669 if { (eval echo "$as_me:9669: \"$ac_link\"") >&5
9670   (eval $ac_link) 2>&5
9671   ac_status=$?
9672   echo "$as_me:9672: \$? = $ac_status" >&5
9673   (exit $ac_status); } &&
9674          { ac_try='test -s conftest$ac_exeext'
9675   { (eval echo "$as_me:9675: \"$ac_try\"") >&5
9676   (eval $ac_try) 2>&5
9677   ac_status=$?
9678   echo "$as_me:9678: \$? = $ac_status" >&5
9679   (exit $ac_status); }; }; then
9680   ac_cv_func_gethostbyname=yes
9681 else
9682   echo "$as_me: failed program was:" >&5
9683 cat conftest.$ac_ext >&5
9684 ac_cv_func_gethostbyname=no
9685 fi
9686 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9687 fi
9688 echo "$as_me:9688: result: $ac_cv_func_gethostbyname" >&5
9689 echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6
9690
9691     if test $ac_cv_func_gethostbyname = no; then
9692       echo "$as_me:9692: checking for gethostbyname in -lnsl" >&5
9693 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6
9694 if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
9695   echo $ECHO_N "(cached) $ECHO_C" >&6
9696 else
9697   ac_check_lib_save_LIBS=$LIBS
9698 LIBS="-lnsl  $LIBS"
9699 cat >conftest.$ac_ext <<_ACEOF
9700 #line 9700 "configure"
9701 #include "confdefs.h"
9702
9703 /* Override any gcc2 internal prototype to avoid an error.  */
9704 #ifdef __cplusplus
9705 extern "C"
9706 #endif
9707 /* We use char because int might match the return type of a gcc2
9708    builtin and then its argument prototype would still apply.  */
9709 char gethostbyname ();
9710 int
9711 main ()
9712 {
9713 gethostbyname ();
9714   ;
9715   return 0;
9716 }
9717 _ACEOF
9718 rm -f conftest.$ac_objext conftest$ac_exeext
9719 if { (eval echo "$as_me:9719: \"$ac_link\"") >&5
9720   (eval $ac_link) 2>&5
9721   ac_status=$?
9722   echo "$as_me:9722: \$? = $ac_status" >&5
9723   (exit $ac_status); } &&
9724          { ac_try='test -s conftest$ac_exeext'
9725   { (eval echo "$as_me:9725: \"$ac_try\"") >&5
9726   (eval $ac_try) 2>&5
9727   ac_status=$?
9728   echo "$as_me:9728: \$? = $ac_status" >&5
9729   (exit $ac_status); }; }; then
9730   ac_cv_lib_nsl_gethostbyname=yes
9731 else
9732   echo "$as_me: failed program was:" >&5
9733 cat conftest.$ac_ext >&5
9734 ac_cv_lib_nsl_gethostbyname=no
9735 fi
9736 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9737 LIBS=$ac_check_lib_save_LIBS
9738 fi
9739 echo "$as_me:9739: result: $ac_cv_lib_nsl_gethostbyname" >&5
9740 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6
9741 if test $ac_cv_lib_nsl_gethostbyname = yes; then
9742   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
9743 fi
9744
9745       if test $ac_cv_lib_nsl_gethostbyname = no; then
9746         echo "$as_me:9746: checking for gethostbyname in -lbsd" >&5
9747 echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6
9748 if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then
9749   echo $ECHO_N "(cached) $ECHO_C" >&6
9750 else
9751   ac_check_lib_save_LIBS=$LIBS
9752 LIBS="-lbsd  $LIBS"
9753 cat >conftest.$ac_ext <<_ACEOF
9754 #line 9754 "configure"
9755 #include "confdefs.h"
9756
9757 /* Override any gcc2 internal prototype to avoid an error.  */
9758 #ifdef __cplusplus
9759 extern "C"
9760 #endif
9761 /* We use char because int might match the return type of a gcc2
9762    builtin and then its argument prototype would still apply.  */
9763 char gethostbyname ();
9764 int
9765 main ()
9766 {
9767 gethostbyname ();
9768   ;
9769   return 0;
9770 }
9771 _ACEOF
9772 rm -f conftest.$ac_objext conftest$ac_exeext
9773 if { (eval echo "$as_me:9773: \"$ac_link\"") >&5
9774   (eval $ac_link) 2>&5
9775   ac_status=$?
9776   echo "$as_me:9776: \$? = $ac_status" >&5
9777   (exit $ac_status); } &&
9778          { ac_try='test -s conftest$ac_exeext'
9779   { (eval echo "$as_me:9779: \"$ac_try\"") >&5
9780   (eval $ac_try) 2>&5
9781   ac_status=$?
9782   echo "$as_me:9782: \$? = $ac_status" >&5
9783   (exit $ac_status); }; }; then
9784   ac_cv_lib_bsd_gethostbyname=yes
9785 else
9786   echo "$as_me: failed program was:" >&5
9787 cat conftest.$ac_ext >&5
9788 ac_cv_lib_bsd_gethostbyname=no
9789 fi
9790 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9791 LIBS=$ac_check_lib_save_LIBS
9792 fi
9793 echo "$as_me:9793: result: $ac_cv_lib_bsd_gethostbyname" >&5
9794 echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6
9795 if test $ac_cv_lib_bsd_gethostbyname = yes; then
9796   X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
9797 fi
9798
9799       fi
9800     fi
9801
9802     # lieder@skyler.mavd.honeywell.com says without -lsocket,
9803     # socket/setsockopt and other routines are undefined under SCO ODT
9804     # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
9805     # on later versions), says Simon Leinen: it contains gethostby*
9806     # variants that don't use the nameserver (or something).  -lsocket
9807     # must be given before -lnsl if both are needed.  We assume that
9808     # if connect needs -lnsl, so does gethostbyname.
9809     echo "$as_me:9809: checking for connect" >&5
9810 echo $ECHO_N "checking for connect... $ECHO_C" >&6
9811 if test "${ac_cv_func_connect+set}" = set; then
9812   echo $ECHO_N "(cached) $ECHO_C" >&6
9813 else
9814   cat >conftest.$ac_ext <<_ACEOF
9815 #line 9815 "configure"
9816 #include "confdefs.h"
9817 /* System header to define __stub macros and hopefully few prototypes,
9818     which can conflict with char connect (); below.  */
9819 #include <assert.h>
9820 /* Override any gcc2 internal prototype to avoid an error.  */
9821 #ifdef __cplusplus
9822 extern "C"
9823 #endif
9824 /* We use char because int might match the return type of a gcc2
9825    builtin and then its argument prototype would still apply.  */
9826 char connect ();
9827 char (*f) ();
9828
9829 int
9830 main ()
9831 {
9832 /* The GNU C library defines this for functions which it implements
9833     to always fail with ENOSYS.  Some functions are actually named
9834     something starting with __ and the normal name is an alias.  */
9835 #if defined (__stub_connect) || defined (__stub___connect)
9836 choke me
9837 #else
9838 f = connect; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
9839 #endif
9840
9841   ;
9842   return 0;
9843 }
9844 _ACEOF
9845 rm -f conftest.$ac_objext conftest$ac_exeext
9846 if { (eval echo "$as_me:9846: \"$ac_link\"") >&5
9847   (eval $ac_link) 2>&5
9848   ac_status=$?
9849   echo "$as_me:9849: \$? = $ac_status" >&5
9850   (exit $ac_status); } &&
9851          { ac_try='test -s conftest$ac_exeext'
9852   { (eval echo "$as_me:9852: \"$ac_try\"") >&5
9853   (eval $ac_try) 2>&5
9854   ac_status=$?
9855   echo "$as_me:9855: \$? = $ac_status" >&5
9856   (exit $ac_status); }; }; then
9857   ac_cv_func_connect=yes
9858 else
9859   echo "$as_me: failed program was:" >&5
9860 cat conftest.$ac_ext >&5
9861 ac_cv_func_connect=no
9862 fi
9863 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9864 fi
9865 echo "$as_me:9865: result: $ac_cv_func_connect" >&5
9866 echo "${ECHO_T}$ac_cv_func_connect" >&6
9867
9868     if test $ac_cv_func_connect = no; then
9869       echo "$as_me:9869: checking for connect in -lsocket" >&5
9870 echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6
9871 if test "${ac_cv_lib_socket_connect+set}" = set; then
9872   echo $ECHO_N "(cached) $ECHO_C" >&6
9873 else
9874   ac_check_lib_save_LIBS=$LIBS
9875 LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
9876 cat >conftest.$ac_ext <<_ACEOF
9877 #line 9877 "configure"
9878 #include "confdefs.h"
9879
9880 /* Override any gcc2 internal prototype to avoid an error.  */
9881 #ifdef __cplusplus
9882 extern "C"
9883 #endif
9884 /* We use char because int might match the return type of a gcc2
9885    builtin and then its argument prototype would still apply.  */
9886 char connect ();
9887 int
9888 main ()
9889 {
9890 connect ();
9891   ;
9892   return 0;
9893 }
9894 _ACEOF
9895 rm -f conftest.$ac_objext conftest$ac_exeext
9896 if { (eval echo "$as_me:9896: \"$ac_link\"") >&5
9897   (eval $ac_link) 2>&5
9898   ac_status=$?
9899   echo "$as_me:9899: \$? = $ac_status" >&5
9900   (exit $ac_status); } &&
9901          { ac_try='test -s conftest$ac_exeext'
9902   { (eval echo "$as_me:9902: \"$ac_try\"") >&5
9903   (eval $ac_try) 2>&5
9904   ac_status=$?
9905   echo "$as_me:9905: \$? = $ac_status" >&5
9906   (exit $ac_status); }; }; then
9907   ac_cv_lib_socket_connect=yes
9908 else
9909   echo "$as_me: failed program was:" >&5
9910 cat conftest.$ac_ext >&5
9911 ac_cv_lib_socket_connect=no
9912 fi
9913 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9914 LIBS=$ac_check_lib_save_LIBS
9915 fi
9916 echo "$as_me:9916: result: $ac_cv_lib_socket_connect" >&5
9917 echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6
9918 if test $ac_cv_lib_socket_connect = yes; then
9919   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
9920 fi
9921
9922     fi
9923
9924     # Guillermo Gomez says -lposix is necessary on A/UX.
9925     echo "$as_me:9925: checking for remove" >&5
9926 echo $ECHO_N "checking for remove... $ECHO_C" >&6
9927 if test "${ac_cv_func_remove+set}" = set; then
9928   echo $ECHO_N "(cached) $ECHO_C" >&6
9929 else
9930   cat >conftest.$ac_ext <<_ACEOF
9931 #line 9931 "configure"
9932 #include "confdefs.h"
9933 /* System header to define __stub macros and hopefully few prototypes,
9934     which can conflict with char remove (); below.  */
9935 #include <assert.h>
9936 /* Override any gcc2 internal prototype to avoid an error.  */
9937 #ifdef __cplusplus
9938 extern "C"
9939 #endif
9940 /* We use char because int might match the return type of a gcc2
9941    builtin and then its argument prototype would still apply.  */
9942 char remove ();
9943 char (*f) ();
9944
9945 int
9946 main ()
9947 {
9948 /* The GNU C library defines this for functions which it implements
9949     to always fail with ENOSYS.  Some functions are actually named
9950     something starting with __ and the normal name is an alias.  */
9951 #if defined (__stub_remove) || defined (__stub___remove)
9952 choke me
9953 #else
9954 f = remove; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
9955 #endif
9956
9957   ;
9958   return 0;
9959 }
9960 _ACEOF
9961 rm -f conftest.$ac_objext conftest$ac_exeext
9962 if { (eval echo "$as_me:9962: \"$ac_link\"") >&5
9963   (eval $ac_link) 2>&5
9964   ac_status=$?
9965   echo "$as_me:9965: \$? = $ac_status" >&5
9966   (exit $ac_status); } &&
9967          { ac_try='test -s conftest$ac_exeext'
9968   { (eval echo "$as_me:9968: \"$ac_try\"") >&5
9969   (eval $ac_try) 2>&5
9970   ac_status=$?
9971   echo "$as_me:9971: \$? = $ac_status" >&5
9972   (exit $ac_status); }; }; then
9973   ac_cv_func_remove=yes
9974 else
9975   echo "$as_me: failed program was:" >&5
9976 cat conftest.$ac_ext >&5
9977 ac_cv_func_remove=no
9978 fi
9979 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9980 fi
9981 echo "$as_me:9981: result: $ac_cv_func_remove" >&5
9982 echo "${ECHO_T}$ac_cv_func_remove" >&6
9983
9984     if test $ac_cv_func_remove = no; then
9985       echo "$as_me:9985: checking for remove in -lposix" >&5
9986 echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6
9987 if test "${ac_cv_lib_posix_remove+set}" = set; then
9988   echo $ECHO_N "(cached) $ECHO_C" >&6
9989 else
9990   ac_check_lib_save_LIBS=$LIBS
9991 LIBS="-lposix  $LIBS"
9992 cat >conftest.$ac_ext <<_ACEOF
9993 #line 9993 "configure"
9994 #include "confdefs.h"
9995
9996 /* Override any gcc2 internal prototype to avoid an error.  */
9997 #ifdef __cplusplus
9998 extern "C"
9999 #endif
10000 /* We use char because int might match the return type of a gcc2
10001    builtin and then its argument prototype would still apply.  */
10002 char remove ();
10003 int
10004 main ()
10005 {
10006 remove ();
10007   ;
10008   return 0;
10009 }
10010 _ACEOF
10011 rm -f conftest.$ac_objext conftest$ac_exeext
10012 if { (eval echo "$as_me:10012: \"$ac_link\"") >&5
10013   (eval $ac_link) 2>&5
10014   ac_status=$?
10015   echo "$as_me:10015: \$? = $ac_status" >&5
10016   (exit $ac_status); } &&
10017          { ac_try='test -s conftest$ac_exeext'
10018   { (eval echo "$as_me:10018: \"$ac_try\"") >&5
10019   (eval $ac_try) 2>&5
10020   ac_status=$?
10021   echo "$as_me:10021: \$? = $ac_status" >&5
10022   (exit $ac_status); }; }; then
10023   ac_cv_lib_posix_remove=yes
10024 else
10025   echo "$as_me: failed program was:" >&5
10026 cat conftest.$ac_ext >&5
10027 ac_cv_lib_posix_remove=no
10028 fi
10029 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10030 LIBS=$ac_check_lib_save_LIBS
10031 fi
10032 echo "$as_me:10032: result: $ac_cv_lib_posix_remove" >&5
10033 echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6
10034 if test $ac_cv_lib_posix_remove = yes; then
10035   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
10036 fi
10037
10038     fi
10039
10040     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
10041     echo "$as_me:10041: checking for shmat" >&5
10042 echo $ECHO_N "checking for shmat... $ECHO_C" >&6
10043 if test "${ac_cv_func_shmat+set}" = set; then
10044   echo $ECHO_N "(cached) $ECHO_C" >&6
10045 else
10046   cat >conftest.$ac_ext <<_ACEOF
10047 #line 10047 "configure"
10048 #include "confdefs.h"
10049 /* System header to define __stub macros and hopefully few prototypes,
10050     which can conflict with char shmat (); below.  */
10051 #include <assert.h>
10052 /* Override any gcc2 internal prototype to avoid an error.  */
10053 #ifdef __cplusplus
10054 extern "C"
10055 #endif
10056 /* We use char because int might match the return type of a gcc2
10057    builtin and then its argument prototype would still apply.  */
10058 char shmat ();
10059 char (*f) ();
10060
10061 int
10062 main ()
10063 {
10064 /* The GNU C library defines this for functions which it implements
10065     to always fail with ENOSYS.  Some functions are actually named
10066     something starting with __ and the normal name is an alias.  */
10067 #if defined (__stub_shmat) || defined (__stub___shmat)
10068 choke me
10069 #else
10070 f = shmat; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
10071 #endif
10072
10073   ;
10074   return 0;
10075 }
10076 _ACEOF
10077 rm -f conftest.$ac_objext conftest$ac_exeext
10078 if { (eval echo "$as_me:10078: \"$ac_link\"") >&5
10079   (eval $ac_link) 2>&5
10080   ac_status=$?
10081   echo "$as_me:10081: \$? = $ac_status" >&5
10082   (exit $ac_status); } &&
10083          { ac_try='test -s conftest$ac_exeext'
10084   { (eval echo "$as_me:10084: \"$ac_try\"") >&5
10085   (eval $ac_try) 2>&5
10086   ac_status=$?
10087   echo "$as_me:10087: \$? = $ac_status" >&5
10088   (exit $ac_status); }; }; then
10089   ac_cv_func_shmat=yes
10090 else
10091   echo "$as_me: failed program was:" >&5
10092 cat conftest.$ac_ext >&5
10093 ac_cv_func_shmat=no
10094 fi
10095 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10096 fi
10097 echo "$as_me:10097: result: $ac_cv_func_shmat" >&5
10098 echo "${ECHO_T}$ac_cv_func_shmat" >&6
10099
10100     if test $ac_cv_func_shmat = no; then
10101       echo "$as_me:10101: checking for shmat in -lipc" >&5
10102 echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6
10103 if test "${ac_cv_lib_ipc_shmat+set}" = set; then
10104   echo $ECHO_N "(cached) $ECHO_C" >&6
10105 else
10106   ac_check_lib_save_LIBS=$LIBS
10107 LIBS="-lipc  $LIBS"
10108 cat >conftest.$ac_ext <<_ACEOF
10109 #line 10109 "configure"
10110 #include "confdefs.h"
10111
10112 /* Override any gcc2 internal prototype to avoid an error.  */
10113 #ifdef __cplusplus
10114 extern "C"
10115 #endif
10116 /* We use char because int might match the return type of a gcc2
10117    builtin and then its argument prototype would still apply.  */
10118 char shmat ();
10119 int
10120 main ()
10121 {
10122 shmat ();
10123   ;
10124   return 0;
10125 }
10126 _ACEOF
10127 rm -f conftest.$ac_objext conftest$ac_exeext
10128 if { (eval echo "$as_me:10128: \"$ac_link\"") >&5
10129   (eval $ac_link) 2>&5
10130   ac_status=$?
10131   echo "$as_me:10131: \$? = $ac_status" >&5
10132   (exit $ac_status); } &&
10133          { ac_try='test -s conftest$ac_exeext'
10134   { (eval echo "$as_me:10134: \"$ac_try\"") >&5
10135   (eval $ac_try) 2>&5
10136   ac_status=$?
10137   echo "$as_me:10137: \$? = $ac_status" >&5
10138   (exit $ac_status); }; }; then
10139   ac_cv_lib_ipc_shmat=yes
10140 else
10141   echo "$as_me: failed program was:" >&5
10142 cat conftest.$ac_ext >&5
10143 ac_cv_lib_ipc_shmat=no
10144 fi
10145 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10146 LIBS=$ac_check_lib_save_LIBS
10147 fi
10148 echo "$as_me:10148: result: $ac_cv_lib_ipc_shmat" >&5
10149 echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6
10150 if test $ac_cv_lib_ipc_shmat = yes; then
10151   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
10152 fi
10153
10154     fi
10155   fi
10156
10157   # Check for libraries that X11R6 Xt/Xaw programs need.
10158   ac_save_LDFLAGS=$LDFLAGS
10159   test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
10160   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
10161   # check for ICE first), but we must link in the order -lSM -lICE or
10162   # we get undefined symbols.  So assume we have SM if we have ICE.
10163   # These have to be linked with before -lX11, unlike the other
10164   # libraries we check for below, so use a different variable.
10165   # John Interrante, Karl Berry
10166   echo "$as_me:10166: checking for IceConnectionNumber in -lICE" >&5
10167 echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6
10168 if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then
10169   echo $ECHO_N "(cached) $ECHO_C" >&6
10170 else
10171   ac_check_lib_save_LIBS=$LIBS
10172 LIBS="-lICE $X_EXTRA_LIBS $LIBS"
10173 cat >conftest.$ac_ext <<_ACEOF
10174 #line 10174 "configure"
10175 #include "confdefs.h"
10176
10177 /* Override any gcc2 internal prototype to avoid an error.  */
10178 #ifdef __cplusplus
10179 extern "C"
10180 #endif
10181 /* We use char because int might match the return type of a gcc2
10182    builtin and then its argument prototype would still apply.  */
10183 char IceConnectionNumber ();
10184 int
10185 main ()
10186 {
10187 IceConnectionNumber ();
10188   ;
10189   return 0;
10190 }
10191 _ACEOF
10192 rm -f conftest.$ac_objext conftest$ac_exeext
10193 if { (eval echo "$as_me:10193: \"$ac_link\"") >&5
10194   (eval $ac_link) 2>&5
10195   ac_status=$?
10196   echo "$as_me:10196: \$? = $ac_status" >&5
10197   (exit $ac_status); } &&
10198          { ac_try='test -s conftest$ac_exeext'
10199   { (eval echo "$as_me:10199: \"$ac_try\"") >&5
10200   (eval $ac_try) 2>&5
10201   ac_status=$?
10202   echo "$as_me:10202: \$? = $ac_status" >&5
10203   (exit $ac_status); }; }; then
10204   ac_cv_lib_ICE_IceConnectionNumber=yes
10205 else
10206   echo "$as_me: failed program was:" >&5
10207 cat conftest.$ac_ext >&5
10208 ac_cv_lib_ICE_IceConnectionNumber=no
10209 fi
10210 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10211 LIBS=$ac_check_lib_save_LIBS
10212 fi
10213 echo "$as_me:10213: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
10214 echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6
10215 if test $ac_cv_lib_ICE_IceConnectionNumber = yes; then
10216   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
10217 fi
10218
10219   LDFLAGS=$ac_save_LDFLAGS
10220
10221 fi
10222
10223 cf_x_athena=${cf_x_athena:-Xaw}
10224
10225 echo "$as_me:10225: checking if you want to link with Xaw 3d library" >&5
10226 echo $ECHO_N "checking if you want to link with Xaw 3d library... $ECHO_C" >&6
10227 withval=
10228
10229 # Check whether --with-Xaw3d or --without-Xaw3d was given.
10230 if test "${with_Xaw3d+set}" = set; then
10231   withval="$with_Xaw3d"
10232
10233 fi;
10234 if test "$withval" = yes ; then
10235         cf_x_athena=Xaw3d
10236         echo "$as_me:10236: result: yes" >&5
10237 echo "${ECHO_T}yes" >&6
10238 else
10239         echo "$as_me:10239: result: no" >&5
10240 echo "${ECHO_T}no" >&6
10241 fi
10242
10243 echo "$as_me:10243: checking if you want to link with Xaw 3d xft library" >&5
10244 echo $ECHO_N "checking if you want to link with Xaw 3d xft library... $ECHO_C" >&6
10245 withval=
10246
10247 # Check whether --with-Xaw3dxft or --without-Xaw3dxft was given.
10248 if test "${with_Xaw3dxft+set}" = set; then
10249   withval="$with_Xaw3dxft"
10250
10251 fi;
10252 if test "$withval" = yes ; then
10253         cf_x_athena=Xaw3dxft
10254         echo "$as_me:10254: result: yes" >&5
10255 echo "${ECHO_T}yes" >&6
10256 else
10257         echo "$as_me:10257: result: no" >&5
10258 echo "${ECHO_T}no" >&6
10259 fi
10260
10261 echo "$as_me:10261: checking if you want to link with neXT Athena library" >&5
10262 echo $ECHO_N "checking if you want to link with neXT Athena library... $ECHO_C" >&6
10263 withval=
10264
10265 # Check whether --with-neXtaw or --without-neXtaw was given.
10266 if test "${with_neXtaw+set}" = set; then
10267   withval="$with_neXtaw"
10268
10269 fi;
10270 if test "$withval" = yes ; then
10271         cf_x_athena=neXtaw
10272         echo "$as_me:10272: result: yes" >&5
10273 echo "${ECHO_T}yes" >&6
10274 else
10275         echo "$as_me:10275: result: no" >&5
10276 echo "${ECHO_T}no" >&6
10277 fi
10278
10279 echo "$as_me:10279: checking if you want to link with Athena-Plus library" >&5
10280 echo $ECHO_N "checking if you want to link with Athena-Plus library... $ECHO_C" >&6
10281 withval=
10282
10283 # Check whether --with-XawPlus or --without-XawPlus was given.
10284 if test "${with_XawPlus+set}" = set; then
10285   withval="$with_XawPlus"
10286
10287 fi;
10288 if test "$withval" = yes ; then
10289         cf_x_athena=XawPlus
10290         echo "$as_me:10290: result: yes" >&5
10291 echo "${ECHO_T}yes" >&6
10292 else
10293         echo "$as_me:10293: result: no" >&5
10294 echo "${ECHO_T}no" >&6
10295 fi
10296
10297 cf_x_athena_lib=""
10298
10299 if test "$PKG_CONFIG" != none ; then
10300         cf_athena_list=
10301         test "$cf_x_athena" = Xaw && cf_athena_list="xaw8 xaw7 xaw6"
10302         for cf_athena_pkg in \
10303                 $cf_athena_list \
10304                 ${cf_x_athena} \
10305                 ${cf_x_athena}-devel \
10306                 lib${cf_x_athena} \
10307                 lib${cf_x_athena}-devel
10308         do
10309
10310 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists $cf_athena_pkg; then
10311         test -n "$verbose" && echo "    found package $cf_athena_pkg" 1>&6
10312
10313 echo "${as_me:-configure}:10313: testing found package $cf_athena_pkg ..." 1>&5
10314
10315         cf_pkgconfig_incs="`$PKG_CONFIG --cflags $cf_athena_pkg 2>/dev/null`"
10316         cf_pkgconfig_libs="`$PKG_CONFIG --libs   $cf_athena_pkg 2>/dev/null`"
10317         test -n "$verbose" && echo "    package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs" 1>&6
10318
10319 echo "${as_me:-configure}:10319: testing package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs ..." 1>&5
10320
10321         test -n "$verbose" && echo "    package $cf_athena_pkg LIBS: $cf_pkgconfig_libs" 1>&6
10322
10323 echo "${as_me:-configure}:10323: testing package $cf_athena_pkg LIBS: $cf_pkgconfig_libs ..." 1>&5
10324
10325 cf_fix_cppflags=no
10326 cf_new_cflags=
10327 cf_new_cppflags=
10328 cf_new_extra_cppflags=
10329
10330 for cf_add_cflags in $cf_pkgconfig_incs
10331 do
10332 case $cf_fix_cppflags in
10333 (no)
10334         case $cf_add_cflags in
10335         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10336                 case $cf_add_cflags in
10337                 (-D*)
10338                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10339
10340                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10341                                 && test -z "${cf_tst_cflags}" \
10342                                 && cf_fix_cppflags=yes
10343
10344                         if test $cf_fix_cppflags = yes ; then
10345                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10346                                 continue
10347                         elif test "${cf_tst_cflags}" = "\"'" ; then
10348                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10349                                 continue
10350                         fi
10351                         ;;
10352                 esac
10353                 case "$CPPFLAGS" in
10354                 (*$cf_add_cflags)
10355                         ;;
10356                 (*)
10357                         case $cf_add_cflags in
10358                         (-D*)
10359                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10360
10361 CPPFLAGS=`echo "$CPPFLAGS" | \
10362         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10363                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10364
10365                                 ;;
10366                         esac
10367                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10368                         ;;
10369                 esac
10370                 ;;
10371         (*)
10372                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10373                 ;;
10374         esac
10375         ;;
10376 (yes)
10377         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10378
10379         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10380
10381         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10382                 && test -z "${cf_tst_cflags}" \
10383                 && cf_fix_cppflags=no
10384         ;;
10385 esac
10386 done
10387
10388 if test -n "$cf_new_cflags" ; then
10389
10390         CFLAGS="$CFLAGS $cf_new_cflags"
10391 fi
10392
10393 if test -n "$cf_new_cppflags" ; then
10394
10395         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10396 fi
10397
10398 if test -n "$cf_new_extra_cppflags" ; then
10399
10400         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10401 fi
10402
10403 cf_add_libs="$cf_pkgconfig_libs"
10404 # Filter out duplicates - this happens with badly-designed ".pc" files...
10405 for cf_add_1lib in $LIBS
10406 do
10407         for cf_add_2lib in $cf_add_libs
10408         do
10409                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
10410                 then
10411                         cf_add_1lib=
10412                         break
10413                 fi
10414         done
10415         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
10416 done
10417 LIBS="$cf_add_libs"
10418
10419                         cf_x_athena_lib="$cf_pkgconfig_libs"
10420
10421 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
10422
10423                         cat >>confdefs.h <<EOF
10424 #define $cf_x_athena_LIBS 1
10425 EOF
10426
10427         for cf_trim_lib in Xmu Xt X11
10428         do
10429                 case "$LIBS" in
10430                 (*-l$cf_trim_lib\ *-l$cf_trim_lib*)
10431                         LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
10432                         test -n "$verbose" && echo "    ..trimmed $LIBS" 1>&6
10433
10434 echo "${as_me:-configure}:10434: testing ..trimmed $LIBS ..." 1>&5
10435
10436                         ;;
10437                 esac
10438         done
10439
10440 echo "$as_me:10440: checking for usable $cf_x_athena/Xmu package" >&5
10441 echo $ECHO_N "checking for usable $cf_x_athena/Xmu package... $ECHO_C" >&6
10442 if test "${cf_cv_xaw_compat+set}" = set; then
10443   echo $ECHO_N "(cached) $ECHO_C" >&6
10444 else
10445
10446 cat >conftest.$ac_ext <<_ACEOF
10447 #line 10447 "configure"
10448 #include "confdefs.h"
10449
10450 #include <X11/Xmu/CharSet.h>
10451
10452 int
10453 main ()
10454 {
10455
10456 int check = XmuCompareISOLatin1("big", "small")
10457
10458   ;
10459   return 0;
10460 }
10461 _ACEOF
10462 rm -f conftest.$ac_objext conftest$ac_exeext
10463 if { (eval echo "$as_me:10463: \"$ac_link\"") >&5
10464   (eval $ac_link) 2>&5
10465   ac_status=$?
10466   echo "$as_me:10466: \$? = $ac_status" >&5
10467   (exit $ac_status); } &&
10468          { ac_try='test -s conftest$ac_exeext'
10469   { (eval echo "$as_me:10469: \"$ac_try\"") >&5
10470   (eval $ac_try) 2>&5
10471   ac_status=$?
10472   echo "$as_me:10472: \$? = $ac_status" >&5
10473   (exit $ac_status); }; }; then
10474   cf_cv_xaw_compat=yes
10475 else
10476   echo "$as_me: failed program was:" >&5
10477 cat conftest.$ac_ext >&5
10478 cf_cv_xaw_compat=no
10479 fi
10480 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10481 fi
10482 echo "$as_me:10482: result: $cf_cv_xaw_compat" >&5
10483 echo "${ECHO_T}$cf_cv_xaw_compat" >&6
10484
10485                         if test "$cf_cv_xaw_compat" = no
10486                         then
10487                                 # workaround for broken ".pc" files...
10488                                 case "$cf_x_athena_lib" in
10489                                 (*-lXmu*)
10490                                         ;;
10491                                 (*)
10492                                         test -n "$verbose" && echo "    work around broken package" 1>&6
10493
10494 echo "${as_me:-configure}:10494: testing work around broken package ..." 1>&5
10495
10496                                         cf_save_xmu="$LIBS"
10497                                         cf_first_lib=`echo "$cf_save_xmu" | sed -e 's/^  *//' -e 's/ .*//'`
10498
10499 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xmu; then
10500         test -n "$verbose" && echo "    found package xmu" 1>&6
10501
10502 echo "${as_me:-configure}:10502: testing found package xmu ..." 1>&5
10503
10504         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xmu 2>/dev/null`"
10505         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xmu 2>/dev/null`"
10506         test -n "$verbose" && echo "    package xmu CFLAGS: $cf_pkgconfig_incs" 1>&6
10507
10508 echo "${as_me:-configure}:10508: testing package xmu CFLAGS: $cf_pkgconfig_incs ..." 1>&5
10509
10510         test -n "$verbose" && echo "    package xmu LIBS: $cf_pkgconfig_libs" 1>&6
10511
10512 echo "${as_me:-configure}:10512: testing package xmu LIBS: $cf_pkgconfig_libs ..." 1>&5
10513
10514 cf_fix_cppflags=no
10515 cf_new_cflags=
10516 cf_new_cppflags=
10517 cf_new_extra_cppflags=
10518
10519 for cf_add_cflags in $cf_pkgconfig_incs
10520 do
10521 case $cf_fix_cppflags in
10522 (no)
10523         case $cf_add_cflags in
10524         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10525                 case $cf_add_cflags in
10526                 (-D*)
10527                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10528
10529                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10530                                 && test -z "${cf_tst_cflags}" \
10531                                 && cf_fix_cppflags=yes
10532
10533                         if test $cf_fix_cppflags = yes ; then
10534                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10535                                 continue
10536                         elif test "${cf_tst_cflags}" = "\"'" ; then
10537                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10538                                 continue
10539                         fi
10540                         ;;
10541                 esac
10542                 case "$CPPFLAGS" in
10543                 (*$cf_add_cflags)
10544                         ;;
10545                 (*)
10546                         case $cf_add_cflags in
10547                         (-D*)
10548                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10549
10550 CPPFLAGS=`echo "$CPPFLAGS" | \
10551         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10552                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10553
10554                                 ;;
10555                         esac
10556                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10557                         ;;
10558                 esac
10559                 ;;
10560         (*)
10561                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10562                 ;;
10563         esac
10564         ;;
10565 (yes)
10566         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10567
10568         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10569
10570         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10571                 && test -z "${cf_tst_cflags}" \
10572                 && cf_fix_cppflags=no
10573         ;;
10574 esac
10575 done
10576
10577 if test -n "$cf_new_cflags" ; then
10578
10579         CFLAGS="$CFLAGS $cf_new_cflags"
10580 fi
10581
10582 if test -n "$cf_new_cppflags" ; then
10583
10584         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10585 fi
10586
10587 if test -n "$cf_new_extra_cppflags" ; then
10588
10589         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10590 fi
10591
10592 cf_add_libs="$cf_pkgconfig_libs"
10593 # Filter out duplicates - this happens with badly-designed ".pc" files...
10594 for cf_add_1lib in $LIBS
10595 do
10596         for cf_add_2lib in $cf_add_libs
10597         do
10598                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
10599                 then
10600                         cf_add_1lib=
10601                         break
10602                 fi
10603         done
10604         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
10605 done
10606 LIBS="$cf_add_libs"
10607
10608                                                         LIBS="$cf_save_xmu"
10609
10610 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
10611
10612 echo "${as_me:-configure}:10612: testing ...before $LIBS ..." 1>&5
10613
10614 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib $cf_pkgconfig_libs %" -e 's%  % %g'`
10615 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
10616
10617 echo "${as_me:-configure}:10617: testing ...after  $LIBS ..." 1>&5
10618
10619 else
10620         cf_pkgconfig_incs=
10621         cf_pkgconfig_libs=
10622
10623 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
10624
10625 echo "${as_me:-configure}:10625: testing ...before $LIBS ..." 1>&5
10626
10627 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib -lXmu %" -e 's%  % %g'`
10628 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
10629
10630 echo "${as_me:-configure}:10630: testing ...after  $LIBS ..." 1>&5
10631
10632 fi
10633
10634         for cf_trim_lib in Xmu Xt X11
10635         do
10636                 case "$LIBS" in
10637                 (*-l$cf_trim_lib\ *-l$cf_trim_lib*)
10638                         LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
10639                         test -n "$verbose" && echo "    ..trimmed $LIBS" 1>&6
10640
10641 echo "${as_me:-configure}:10641: testing ..trimmed $LIBS ..." 1>&5
10642
10643                         ;;
10644                 esac
10645         done
10646
10647                                         ;;
10648                                 esac
10649                         fi
10650
10651                         break
10652 else
10653         cf_pkgconfig_incs=
10654         cf_pkgconfig_libs=
10655         :
10656 fi
10657
10658         done
10659 fi
10660
10661 if test -z "$cf_x_athena_lib" ; then
10662
10663 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists Xext; then
10664         test -n "$verbose" && echo "    found package Xext" 1>&6
10665
10666 echo "${as_me:-configure}:10666: testing found package Xext ..." 1>&5
10667
10668         cf_pkgconfig_incs="`$PKG_CONFIG --cflags Xext 2>/dev/null`"
10669         cf_pkgconfig_libs="`$PKG_CONFIG --libs   Xext 2>/dev/null`"
10670         test -n "$verbose" && echo "    package Xext CFLAGS: $cf_pkgconfig_incs" 1>&6
10671
10672 echo "${as_me:-configure}:10672: testing package Xext CFLAGS: $cf_pkgconfig_incs ..." 1>&5
10673
10674         test -n "$verbose" && echo "    package Xext LIBS: $cf_pkgconfig_libs" 1>&6
10675
10676 echo "${as_me:-configure}:10676: testing package Xext LIBS: $cf_pkgconfig_libs ..." 1>&5
10677
10678 cf_fix_cppflags=no
10679 cf_new_cflags=
10680 cf_new_cppflags=
10681 cf_new_extra_cppflags=
10682
10683 for cf_add_cflags in $cf_pkgconfig_incs
10684 do
10685 case $cf_fix_cppflags in
10686 (no)
10687         case $cf_add_cflags in
10688         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10689                 case $cf_add_cflags in
10690                 (-D*)
10691                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10692
10693                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10694                                 && test -z "${cf_tst_cflags}" \
10695                                 && cf_fix_cppflags=yes
10696
10697                         if test $cf_fix_cppflags = yes ; then
10698                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10699                                 continue
10700                         elif test "${cf_tst_cflags}" = "\"'" ; then
10701                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10702                                 continue
10703                         fi
10704                         ;;
10705                 esac
10706                 case "$CPPFLAGS" in
10707                 (*$cf_add_cflags)
10708                         ;;
10709                 (*)
10710                         case $cf_add_cflags in
10711                         (-D*)
10712                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10713
10714 CPPFLAGS=`echo "$CPPFLAGS" | \
10715         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10716                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10717
10718                                 ;;
10719                         esac
10720                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10721                         ;;
10722                 esac
10723                 ;;
10724         (*)
10725                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10726                 ;;
10727         esac
10728         ;;
10729 (yes)
10730         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10731
10732         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10733
10734         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10735                 && test -z "${cf_tst_cflags}" \
10736                 && cf_fix_cppflags=no
10737         ;;
10738 esac
10739 done
10740
10741 if test -n "$cf_new_cflags" ; then
10742
10743         CFLAGS="$CFLAGS $cf_new_cflags"
10744 fi
10745
10746 if test -n "$cf_new_cppflags" ; then
10747
10748         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10749 fi
10750
10751 if test -n "$cf_new_extra_cppflags" ; then
10752
10753         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10754 fi
10755
10756 cf_add_libs="$cf_pkgconfig_libs"
10757 # Filter out duplicates - this happens with badly-designed ".pc" files...
10758 for cf_add_1lib in $LIBS
10759 do
10760         for cf_add_2lib in $cf_add_libs
10761         do
10762                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
10763                 then
10764                         cf_add_1lib=
10765                         break
10766                 fi
10767         done
10768         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
10769 done
10770 LIBS="$cf_add_libs"
10771
10772         :
10773 else
10774         cf_pkgconfig_incs=
10775         cf_pkgconfig_libs=
10776
10777         echo "$as_me:10777: checking for XextCreateExtension in -lXext" >&5
10778 echo $ECHO_N "checking for XextCreateExtension in -lXext... $ECHO_C" >&6
10779 if test "${ac_cv_lib_Xext_XextCreateExtension+set}" = set; then
10780   echo $ECHO_N "(cached) $ECHO_C" >&6
10781 else
10782   ac_check_lib_save_LIBS=$LIBS
10783 LIBS="-lXext  $LIBS"
10784 cat >conftest.$ac_ext <<_ACEOF
10785 #line 10785 "configure"
10786 #include "confdefs.h"
10787
10788 /* Override any gcc2 internal prototype to avoid an error.  */
10789 #ifdef __cplusplus
10790 extern "C"
10791 #endif
10792 /* We use char because int might match the return type of a gcc2
10793    builtin and then its argument prototype would still apply.  */
10794 char XextCreateExtension ();
10795 int
10796 main ()
10797 {
10798 XextCreateExtension ();
10799   ;
10800   return 0;
10801 }
10802 _ACEOF
10803 rm -f conftest.$ac_objext conftest$ac_exeext
10804 if { (eval echo "$as_me:10804: \"$ac_link\"") >&5
10805   (eval $ac_link) 2>&5
10806   ac_status=$?
10807   echo "$as_me:10807: \$? = $ac_status" >&5
10808   (exit $ac_status); } &&
10809          { ac_try='test -s conftest$ac_exeext'
10810   { (eval echo "$as_me:10810: \"$ac_try\"") >&5
10811   (eval $ac_try) 2>&5
10812   ac_status=$?
10813   echo "$as_me:10813: \$? = $ac_status" >&5
10814   (exit $ac_status); }; }; then
10815   ac_cv_lib_Xext_XextCreateExtension=yes
10816 else
10817   echo "$as_me: failed program was:" >&5
10818 cat conftest.$ac_ext >&5
10819 ac_cv_lib_Xext_XextCreateExtension=no
10820 fi
10821 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10822 LIBS=$ac_check_lib_save_LIBS
10823 fi
10824 echo "$as_me:10824: result: $ac_cv_lib_Xext_XextCreateExtension" >&5
10825 echo "${ECHO_T}$ac_cv_lib_Xext_XextCreateExtension" >&6
10826 if test $ac_cv_lib_Xext_XextCreateExtension = yes; then
10827
10828 cf_add_libs="-lXext"
10829 # Filter out duplicates - this happens with badly-designed ".pc" files...
10830 for cf_add_1lib in $LIBS
10831 do
10832         for cf_add_2lib in $cf_add_libs
10833         do
10834                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
10835                 then
10836                         cf_add_1lib=
10837                         break
10838                 fi
10839         done
10840         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
10841 done
10842 LIBS="$cf_add_libs"
10843
10844 fi
10845
10846 fi
10847
10848 # OSX is schizoid about who owns /usr/X11 (old) versus /opt/X11 (new), and (and
10849 # in some cases has installed dummy files in the former, other cases replaced
10850 # it with a link to the new location).  This complicates the configure script.
10851 # Check for that pitfall, and recover using pkg-config
10852 #
10853 # If none of these are set, the configuration is almost certainly broken.
10854 if test -z "${X_CFLAGS}${X_PRE_LIBS}${X_LIBS}${X_EXTRA_LIBS}"
10855 then
10856
10857 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists x11; then
10858         test -n "$verbose" && echo "    found package x11" 1>&6
10859
10860 echo "${as_me:-configure}:10860: testing found package x11 ..." 1>&5
10861
10862         cf_pkgconfig_incs="`$PKG_CONFIG --cflags x11 2>/dev/null`"
10863         cf_pkgconfig_libs="`$PKG_CONFIG --libs   x11 2>/dev/null`"
10864         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
10865
10866 echo "${as_me:-configure}:10866: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
10867
10868         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
10869
10870 echo "${as_me:-configure}:10870: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
10871
10872 cf_fix_cppflags=no
10873 cf_new_cflags=
10874 cf_new_cppflags=
10875 cf_new_extra_cppflags=
10876
10877 for cf_add_cflags in $cf_pkgconfig_incs
10878 do
10879 case $cf_fix_cppflags in
10880 (no)
10881         case $cf_add_cflags in
10882         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10883                 case $cf_add_cflags in
10884                 (-D*)
10885                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10886
10887                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10888                                 && test -z "${cf_tst_cflags}" \
10889                                 && cf_fix_cppflags=yes
10890
10891                         if test $cf_fix_cppflags = yes ; then
10892                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10893                                 continue
10894                         elif test "${cf_tst_cflags}" = "\"'" ; then
10895                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10896                                 continue
10897                         fi
10898                         ;;
10899                 esac
10900                 case "$CPPFLAGS" in
10901                 (*$cf_add_cflags)
10902                         ;;
10903                 (*)
10904                         case $cf_add_cflags in
10905                         (-D*)
10906                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10907
10908 CPPFLAGS=`echo "$CPPFLAGS" | \
10909         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10910                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10911
10912                                 ;;
10913                         esac
10914                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10915                         ;;
10916                 esac
10917                 ;;
10918         (*)
10919                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10920                 ;;
10921         esac
10922         ;;
10923 (yes)
10924         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10925
10926         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10927
10928         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10929                 && test -z "${cf_tst_cflags}" \
10930                 && cf_fix_cppflags=no
10931         ;;
10932 esac
10933 done
10934
10935 if test -n "$cf_new_cflags" ; then
10936
10937         CFLAGS="$CFLAGS $cf_new_cflags"
10938 fi
10939
10940 if test -n "$cf_new_cppflags" ; then
10941
10942         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10943 fi
10944
10945 if test -n "$cf_new_extra_cppflags" ; then
10946
10947         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10948 fi
10949
10950 cf_add_libs="$cf_pkgconfig_libs"
10951 # Filter out duplicates - this happens with badly-designed ".pc" files...
10952 for cf_add_1lib in $LIBS
10953 do
10954         for cf_add_2lib in $cf_add_libs
10955         do
10956                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
10957                 then
10958                         cf_add_1lib=
10959                         break
10960                 fi
10961         done
10962         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
10963 done
10964 LIBS="$cf_add_libs"
10965
10966         :
10967 else
10968         cf_pkgconfig_incs=
10969         cf_pkgconfig_libs=
10970         { echo "$as_me:10970: WARNING: unable to find X11 library" >&5
10971 echo "$as_me: WARNING: unable to find X11 library" >&2;}
10972 fi
10973
10974 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists ice; then
10975         test -n "$verbose" && echo "    found package ice" 1>&6
10976
10977 echo "${as_me:-configure}:10977: testing found package ice ..." 1>&5
10978
10979         cf_pkgconfig_incs="`$PKG_CONFIG --cflags ice 2>/dev/null`"
10980         cf_pkgconfig_libs="`$PKG_CONFIG --libs   ice 2>/dev/null`"
10981         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
10982
10983 echo "${as_me:-configure}:10983: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
10984
10985         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
10986
10987 echo "${as_me:-configure}:10987: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
10988
10989 cf_fix_cppflags=no
10990 cf_new_cflags=
10991 cf_new_cppflags=
10992 cf_new_extra_cppflags=
10993
10994 for cf_add_cflags in $cf_pkgconfig_incs
10995 do
10996 case $cf_fix_cppflags in
10997 (no)
10998         case $cf_add_cflags in
10999         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11000                 case $cf_add_cflags in
11001                 (-D*)
11002                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11003
11004                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11005                                 && test -z "${cf_tst_cflags}" \
11006                                 && cf_fix_cppflags=yes
11007
11008                         if test $cf_fix_cppflags = yes ; then
11009                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11010                                 continue
11011                         elif test "${cf_tst_cflags}" = "\"'" ; then
11012                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11013                                 continue
11014                         fi
11015                         ;;
11016                 esac
11017                 case "$CPPFLAGS" in
11018                 (*$cf_add_cflags)
11019                         ;;
11020                 (*)
11021                         case $cf_add_cflags in
11022                         (-D*)
11023                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11024
11025 CPPFLAGS=`echo "$CPPFLAGS" | \
11026         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11027                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11028
11029                                 ;;
11030                         esac
11031                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11032                         ;;
11033                 esac
11034                 ;;
11035         (*)
11036                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11037                 ;;
11038         esac
11039         ;;
11040 (yes)
11041         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11042
11043         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11044
11045         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11046                 && test -z "${cf_tst_cflags}" \
11047                 && cf_fix_cppflags=no
11048         ;;
11049 esac
11050 done
11051
11052 if test -n "$cf_new_cflags" ; then
11053
11054         CFLAGS="$CFLAGS $cf_new_cflags"
11055 fi
11056
11057 if test -n "$cf_new_cppflags" ; then
11058
11059         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11060 fi
11061
11062 if test -n "$cf_new_extra_cppflags" ; then
11063
11064         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11065 fi
11066
11067 cf_add_libs="$cf_pkgconfig_libs"
11068 # Filter out duplicates - this happens with badly-designed ".pc" files...
11069 for cf_add_1lib in $LIBS
11070 do
11071         for cf_add_2lib in $cf_add_libs
11072         do
11073                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11074                 then
11075                         cf_add_1lib=
11076                         break
11077                 fi
11078         done
11079         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11080 done
11081 LIBS="$cf_add_libs"
11082
11083         :
11084 else
11085         cf_pkgconfig_incs=
11086         cf_pkgconfig_libs=
11087         { echo "$as_me:11087: WARNING: unable to find ICE library" >&5
11088 echo "$as_me: WARNING: unable to find ICE library" >&2;}
11089 fi
11090
11091 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists sm; then
11092         test -n "$verbose" && echo "    found package sm" 1>&6
11093
11094 echo "${as_me:-configure}:11094: testing found package sm ..." 1>&5
11095
11096         cf_pkgconfig_incs="`$PKG_CONFIG --cflags sm 2>/dev/null`"
11097         cf_pkgconfig_libs="`$PKG_CONFIG --libs   sm 2>/dev/null`"
11098         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
11099
11100 echo "${as_me:-configure}:11100: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11101
11102         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
11103
11104 echo "${as_me:-configure}:11104: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
11105
11106 cf_fix_cppflags=no
11107 cf_new_cflags=
11108 cf_new_cppflags=
11109 cf_new_extra_cppflags=
11110
11111 for cf_add_cflags in $cf_pkgconfig_incs
11112 do
11113 case $cf_fix_cppflags in
11114 (no)
11115         case $cf_add_cflags in
11116         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11117                 case $cf_add_cflags in
11118                 (-D*)
11119                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11120
11121                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11122                                 && test -z "${cf_tst_cflags}" \
11123                                 && cf_fix_cppflags=yes
11124
11125                         if test $cf_fix_cppflags = yes ; then
11126                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11127                                 continue
11128                         elif test "${cf_tst_cflags}" = "\"'" ; then
11129                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11130                                 continue
11131                         fi
11132                         ;;
11133                 esac
11134                 case "$CPPFLAGS" in
11135                 (*$cf_add_cflags)
11136                         ;;
11137                 (*)
11138                         case $cf_add_cflags in
11139                         (-D*)
11140                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11141
11142 CPPFLAGS=`echo "$CPPFLAGS" | \
11143         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11144                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11145
11146                                 ;;
11147                         esac
11148                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11149                         ;;
11150                 esac
11151                 ;;
11152         (*)
11153                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11154                 ;;
11155         esac
11156         ;;
11157 (yes)
11158         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11159
11160         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11161
11162         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11163                 && test -z "${cf_tst_cflags}" \
11164                 && cf_fix_cppflags=no
11165         ;;
11166 esac
11167 done
11168
11169 if test -n "$cf_new_cflags" ; then
11170
11171         CFLAGS="$CFLAGS $cf_new_cflags"
11172 fi
11173
11174 if test -n "$cf_new_cppflags" ; then
11175
11176         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11177 fi
11178
11179 if test -n "$cf_new_extra_cppflags" ; then
11180
11181         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11182 fi
11183
11184 cf_add_libs="$cf_pkgconfig_libs"
11185 # Filter out duplicates - this happens with badly-designed ".pc" files...
11186 for cf_add_1lib in $LIBS
11187 do
11188         for cf_add_2lib in $cf_add_libs
11189         do
11190                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11191                 then
11192                         cf_add_1lib=
11193                         break
11194                 fi
11195         done
11196         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11197 done
11198 LIBS="$cf_add_libs"
11199
11200         :
11201 else
11202         cf_pkgconfig_incs=
11203         cf_pkgconfig_libs=
11204         { echo "$as_me:11204: WARNING: unable to find SM library" >&5
11205 echo "$as_me: WARNING: unable to find SM library" >&2;}
11206 fi
11207
11208 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xt; then
11209         test -n "$verbose" && echo "    found package xt" 1>&6
11210
11211 echo "${as_me:-configure}:11211: testing found package xt ..." 1>&5
11212
11213         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xt 2>/dev/null`"
11214         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xt 2>/dev/null`"
11215         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
11216
11217 echo "${as_me:-configure}:11217: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11218
11219         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
11220
11221 echo "${as_me:-configure}:11221: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
11222
11223 cf_fix_cppflags=no
11224 cf_new_cflags=
11225 cf_new_cppflags=
11226 cf_new_extra_cppflags=
11227
11228 for cf_add_cflags in $cf_pkgconfig_incs
11229 do
11230 case $cf_fix_cppflags in
11231 (no)
11232         case $cf_add_cflags in
11233         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11234                 case $cf_add_cflags in
11235                 (-D*)
11236                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11237
11238                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11239                                 && test -z "${cf_tst_cflags}" \
11240                                 && cf_fix_cppflags=yes
11241
11242                         if test $cf_fix_cppflags = yes ; then
11243                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11244                                 continue
11245                         elif test "${cf_tst_cflags}" = "\"'" ; then
11246                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11247                                 continue
11248                         fi
11249                         ;;
11250                 esac
11251                 case "$CPPFLAGS" in
11252                 (*$cf_add_cflags)
11253                         ;;
11254                 (*)
11255                         case $cf_add_cflags in
11256                         (-D*)
11257                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11258
11259 CPPFLAGS=`echo "$CPPFLAGS" | \
11260         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11261                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11262
11263                                 ;;
11264                         esac
11265                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11266                         ;;
11267                 esac
11268                 ;;
11269         (*)
11270                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11271                 ;;
11272         esac
11273         ;;
11274 (yes)
11275         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11276
11277         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11278
11279         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11280                 && test -z "${cf_tst_cflags}" \
11281                 && cf_fix_cppflags=no
11282         ;;
11283 esac
11284 done
11285
11286 if test -n "$cf_new_cflags" ; then
11287
11288         CFLAGS="$CFLAGS $cf_new_cflags"
11289 fi
11290
11291 if test -n "$cf_new_cppflags" ; then
11292
11293         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11294 fi
11295
11296 if test -n "$cf_new_extra_cppflags" ; then
11297
11298         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11299 fi
11300
11301 cf_add_libs="$cf_pkgconfig_libs"
11302 # Filter out duplicates - this happens with badly-designed ".pc" files...
11303 for cf_add_1lib in $LIBS
11304 do
11305         for cf_add_2lib in $cf_add_libs
11306         do
11307                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11308                 then
11309                         cf_add_1lib=
11310                         break
11311                 fi
11312         done
11313         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11314 done
11315 LIBS="$cf_add_libs"
11316
11317         :
11318 else
11319         cf_pkgconfig_incs=
11320         cf_pkgconfig_libs=
11321         { echo "$as_me:11321: WARNING: unable to find Xt library" >&5
11322 echo "$as_me: WARNING: unable to find Xt library" >&2;}
11323 fi
11324
11325 fi
11326
11327 cf_have_X_LIBS=no
11328
11329 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xt; then
11330         test -n "$verbose" && echo "    found package xt" 1>&6
11331
11332 echo "${as_me:-configure}:11332: testing found package xt ..." 1>&5
11333
11334         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xt 2>/dev/null`"
11335         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xt 2>/dev/null`"
11336         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
11337
11338 echo "${as_me:-configure}:11338: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11339
11340         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
11341
11342 echo "${as_me:-configure}:11342: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
11343
11344 cf_fix_cppflags=no
11345 cf_new_cflags=
11346 cf_new_cppflags=
11347 cf_new_extra_cppflags=
11348
11349 for cf_add_cflags in $cf_pkgconfig_incs
11350 do
11351 case $cf_fix_cppflags in
11352 (no)
11353         case $cf_add_cflags in
11354         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11355                 case $cf_add_cflags in
11356                 (-D*)
11357                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11358
11359                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11360                                 && test -z "${cf_tst_cflags}" \
11361                                 && cf_fix_cppflags=yes
11362
11363                         if test $cf_fix_cppflags = yes ; then
11364                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11365                                 continue
11366                         elif test "${cf_tst_cflags}" = "\"'" ; then
11367                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11368                                 continue
11369                         fi
11370                         ;;
11371                 esac
11372                 case "$CPPFLAGS" in
11373                 (*$cf_add_cflags)
11374                         ;;
11375                 (*)
11376                         case $cf_add_cflags in
11377                         (-D*)
11378                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11379
11380 CPPFLAGS=`echo "$CPPFLAGS" | \
11381         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11382                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11383
11384                                 ;;
11385                         esac
11386                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11387                         ;;
11388                 esac
11389                 ;;
11390         (*)
11391                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11392                 ;;
11393         esac
11394         ;;
11395 (yes)
11396         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11397
11398         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11399
11400         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11401                 && test -z "${cf_tst_cflags}" \
11402                 && cf_fix_cppflags=no
11403         ;;
11404 esac
11405 done
11406
11407 if test -n "$cf_new_cflags" ; then
11408
11409         CFLAGS="$CFLAGS $cf_new_cflags"
11410 fi
11411
11412 if test -n "$cf_new_cppflags" ; then
11413
11414         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11415 fi
11416
11417 if test -n "$cf_new_extra_cppflags" ; then
11418
11419         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11420 fi
11421
11422 cf_add_libs="$cf_pkgconfig_libs"
11423 # Filter out duplicates - this happens with badly-designed ".pc" files...
11424 for cf_add_1lib in $LIBS
11425 do
11426         for cf_add_2lib in $cf_add_libs
11427         do
11428                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11429                 then
11430                         cf_add_1lib=
11431                         break
11432                 fi
11433         done
11434         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11435 done
11436 LIBS="$cf_add_libs"
11437
11438         case "x$LIBS" in
11439         (*-lX11*)
11440                 ;;
11441         (*)
11442 # we have an "xt" package, but it may omit Xt's dependency on X11
11443 echo "$as_me:11443: checking for usable X dependency" >&5
11444 echo $ECHO_N "checking for usable X dependency... $ECHO_C" >&6
11445 if test "${cf_cv_xt_x11_compat+set}" = set; then
11446   echo $ECHO_N "(cached) $ECHO_C" >&6
11447 else
11448
11449 cat >conftest.$ac_ext <<_ACEOF
11450 #line 11450 "configure"
11451 #include "confdefs.h"
11452
11453 #include <X11/Xlib.h>
11454
11455 int
11456 main ()
11457 {
11458
11459         int rc1 = XDrawLine((Display*) 0, (Drawable) 0, (GC) 0, 0, 0, 0, 0);
11460         int rc2 = XClearWindow((Display*) 0, (Window) 0);
11461         int rc3 = XMoveWindow((Display*) 0, (Window) 0, 0, 0);
11462         int rc4 = XMoveResizeWindow((Display*)0, (Window)0, 0, 0, 0, 0);
11463
11464   ;
11465   return 0;
11466 }
11467 _ACEOF
11468 rm -f conftest.$ac_objext conftest$ac_exeext
11469 if { (eval echo "$as_me:11469: \"$ac_link\"") >&5
11470   (eval $ac_link) 2>&5
11471   ac_status=$?
11472   echo "$as_me:11472: \$? = $ac_status" >&5
11473   (exit $ac_status); } &&
11474          { ac_try='test -s conftest$ac_exeext'
11475   { (eval echo "$as_me:11475: \"$ac_try\"") >&5
11476   (eval $ac_try) 2>&5
11477   ac_status=$?
11478   echo "$as_me:11478: \$? = $ac_status" >&5
11479   (exit $ac_status); }; }; then
11480   cf_cv_xt_x11_compat=yes
11481 else
11482   echo "$as_me: failed program was:" >&5
11483 cat conftest.$ac_ext >&5
11484 cf_cv_xt_x11_compat=no
11485 fi
11486 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11487 fi
11488 echo "$as_me:11488: result: $cf_cv_xt_x11_compat" >&5
11489 echo "${ECHO_T}$cf_cv_xt_x11_compat" >&6
11490                 if test "$cf_cv_xt_x11_compat" = no
11491                 then
11492                         test -n "$verbose" && echo "    work around broken X11 dependency" 1>&6
11493
11494 echo "${as_me:-configure}:11494: testing work around broken X11 dependency ..." 1>&5
11495
11496                         # 2010/11/19 - good enough until a working Xt on Xcb is delivered.
11497
11498 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists x11; then
11499         test -n "$verbose" && echo "    found package x11" 1>&6
11500
11501 echo "${as_me:-configure}:11501: testing found package x11 ..." 1>&5
11502
11503         cf_pkgconfig_incs="`$PKG_CONFIG --cflags x11 2>/dev/null`"
11504         cf_pkgconfig_libs="`$PKG_CONFIG --libs   x11 2>/dev/null`"
11505         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
11506
11507 echo "${as_me:-configure}:11507: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11508
11509         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
11510
11511 echo "${as_me:-configure}:11511: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
11512
11513 cf_fix_cppflags=no
11514 cf_new_cflags=
11515 cf_new_cppflags=
11516 cf_new_extra_cppflags=
11517
11518 for cf_add_cflags in $cf_pkgconfig_incs
11519 do
11520 case $cf_fix_cppflags in
11521 (no)
11522         case $cf_add_cflags in
11523         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11524                 case $cf_add_cflags in
11525                 (-D*)
11526                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11527
11528                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11529                                 && test -z "${cf_tst_cflags}" \
11530                                 && cf_fix_cppflags=yes
11531
11532                         if test $cf_fix_cppflags = yes ; then
11533                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11534                                 continue
11535                         elif test "${cf_tst_cflags}" = "\"'" ; then
11536                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11537                                 continue
11538                         fi
11539                         ;;
11540                 esac
11541                 case "$CPPFLAGS" in
11542                 (*$cf_add_cflags)
11543                         ;;
11544                 (*)
11545                         case $cf_add_cflags in
11546                         (-D*)
11547                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11548
11549 CPPFLAGS=`echo "$CPPFLAGS" | \
11550         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11551                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11552
11553                                 ;;
11554                         esac
11555                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11556                         ;;
11557                 esac
11558                 ;;
11559         (*)
11560                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11561                 ;;
11562         esac
11563         ;;
11564 (yes)
11565         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11566
11567         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11568
11569         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11570                 && test -z "${cf_tst_cflags}" \
11571                 && cf_fix_cppflags=no
11572         ;;
11573 esac
11574 done
11575
11576 if test -n "$cf_new_cflags" ; then
11577
11578         CFLAGS="$CFLAGS $cf_new_cflags"
11579 fi
11580
11581 if test -n "$cf_new_cppflags" ; then
11582
11583         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11584 fi
11585
11586 if test -n "$cf_new_extra_cppflags" ; then
11587
11588         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11589 fi
11590
11591 cf_add_libs="$cf_pkgconfig_libs"
11592 # Filter out duplicates - this happens with badly-designed ".pc" files...
11593 for cf_add_1lib in $LIBS
11594 do
11595         for cf_add_2lib in $cf_add_libs
11596         do
11597                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11598                 then
11599                         cf_add_1lib=
11600                         break
11601                 fi
11602         done
11603         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11604 done
11605 LIBS="$cf_add_libs"
11606
11607         :
11608 else
11609         cf_pkgconfig_incs=
11610         cf_pkgconfig_libs=
11611
11612 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
11613
11614 echo "${as_me:-configure}:11614: testing ...before $LIBS ..." 1>&5
11615
11616 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%-lXt %-lXt -lX11 %" -e 's%  % %g'`
11617 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
11618
11619 echo "${as_me:-configure}:11619: testing ...after  $LIBS ..." 1>&5
11620
11621 fi
11622
11623                 fi
11624                 ;;
11625         esac
11626
11627 echo "$as_me:11627: checking for usable X Toolkit package" >&5
11628 echo $ECHO_N "checking for usable X Toolkit package... $ECHO_C" >&6
11629 if test "${cf_cv_xt_ice_compat+set}" = set; then
11630   echo $ECHO_N "(cached) $ECHO_C" >&6
11631 else
11632
11633 cat >conftest.$ac_ext <<_ACEOF
11634 #line 11634 "configure"
11635 #include "confdefs.h"
11636
11637 #include <X11/Shell.h>
11638
11639 int
11640 main ()
11641 {
11642 int num = IceConnectionNumber(0)
11643
11644   ;
11645   return 0;
11646 }
11647 _ACEOF
11648 rm -f conftest.$ac_objext conftest$ac_exeext
11649 if { (eval echo "$as_me:11649: \"$ac_link\"") >&5
11650   (eval $ac_link) 2>&5
11651   ac_status=$?
11652   echo "$as_me:11652: \$? = $ac_status" >&5
11653   (exit $ac_status); } &&
11654          { ac_try='test -s conftest$ac_exeext'
11655   { (eval echo "$as_me:11655: \"$ac_try\"") >&5
11656   (eval $ac_try) 2>&5
11657   ac_status=$?
11658   echo "$as_me:11658: \$? = $ac_status" >&5
11659   (exit $ac_status); }; }; then
11660   cf_cv_xt_ice_compat=yes
11661 else
11662   echo "$as_me: failed program was:" >&5
11663 cat conftest.$ac_ext >&5
11664 cf_cv_xt_ice_compat=no
11665 fi
11666 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11667 fi
11668 echo "$as_me:11668: result: $cf_cv_xt_ice_compat" >&5
11669 echo "${ECHO_T}$cf_cv_xt_ice_compat" >&6
11670
11671         if test "$cf_cv_xt_ice_compat" = no
11672         then
11673                 # workaround for broken ".pc" files used for X Toolkit.
11674                 case "x$X_PRE_LIBS" in
11675                 (*-lICE*)
11676                         case "x$LIBS" in
11677                         (*-lICE*)
11678                                 ;;
11679                         (*)
11680                                 test -n "$verbose" && echo "    work around broken ICE dependency" 1>&6
11681
11682 echo "${as_me:-configure}:11682: testing work around broken ICE dependency ..." 1>&5
11683
11684 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists ice; then
11685         test -n "$verbose" && echo "    found package ice" 1>&6
11686
11687 echo "${as_me:-configure}:11687: testing found package ice ..." 1>&5
11688
11689         cf_pkgconfig_incs="`$PKG_CONFIG --cflags ice 2>/dev/null`"
11690         cf_pkgconfig_libs="`$PKG_CONFIG --libs   ice 2>/dev/null`"
11691         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
11692
11693 echo "${as_me:-configure}:11693: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11694
11695         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
11696
11697 echo "${as_me:-configure}:11697: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
11698
11699 cf_fix_cppflags=no
11700 cf_new_cflags=
11701 cf_new_cppflags=
11702 cf_new_extra_cppflags=
11703
11704 for cf_add_cflags in $cf_pkgconfig_incs
11705 do
11706 case $cf_fix_cppflags in
11707 (no)
11708         case $cf_add_cflags in
11709         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11710                 case $cf_add_cflags in
11711                 (-D*)
11712                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11713
11714                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11715                                 && test -z "${cf_tst_cflags}" \
11716                                 && cf_fix_cppflags=yes
11717
11718                         if test $cf_fix_cppflags = yes ; then
11719                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11720                                 continue
11721                         elif test "${cf_tst_cflags}" = "\"'" ; then
11722                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11723                                 continue
11724                         fi
11725                         ;;
11726                 esac
11727                 case "$CPPFLAGS" in
11728                 (*$cf_add_cflags)
11729                         ;;
11730                 (*)
11731                         case $cf_add_cflags in
11732                         (-D*)
11733                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11734
11735 CPPFLAGS=`echo "$CPPFLAGS" | \
11736         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11737                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11738
11739                                 ;;
11740                         esac
11741                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11742                         ;;
11743                 esac
11744                 ;;
11745         (*)
11746                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11747                 ;;
11748         esac
11749         ;;
11750 (yes)
11751         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11752
11753         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11754
11755         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11756                 && test -z "${cf_tst_cflags}" \
11757                 && cf_fix_cppflags=no
11758         ;;
11759 esac
11760 done
11761
11762 if test -n "$cf_new_cflags" ; then
11763
11764         CFLAGS="$CFLAGS $cf_new_cflags"
11765 fi
11766
11767 if test -n "$cf_new_cppflags" ; then
11768
11769         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11770 fi
11771
11772 if test -n "$cf_new_extra_cppflags" ; then
11773
11774         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11775 fi
11776
11777 cf_add_libs="$cf_pkgconfig_libs"
11778 # Filter out duplicates - this happens with badly-designed ".pc" files...
11779 for cf_add_1lib in $LIBS
11780 do
11781         for cf_add_2lib in $cf_add_libs
11782         do
11783                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11784                 then
11785                         cf_add_1lib=
11786                         break
11787                 fi
11788         done
11789         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11790 done
11791 LIBS="$cf_add_libs"
11792
11793 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists sm; then
11794         test -n "$verbose" && echo "    found package sm" 1>&6
11795
11796 echo "${as_me:-configure}:11796: testing found package sm ..." 1>&5
11797
11798         cf_pkgconfig_incs="`$PKG_CONFIG --cflags sm 2>/dev/null`"
11799         cf_pkgconfig_libs="`$PKG_CONFIG --libs   sm 2>/dev/null`"
11800         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
11801
11802 echo "${as_me:-configure}:11802: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11803
11804         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
11805
11806 echo "${as_me:-configure}:11806: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
11807
11808 cf_fix_cppflags=no
11809 cf_new_cflags=
11810 cf_new_cppflags=
11811 cf_new_extra_cppflags=
11812
11813 for cf_add_cflags in $cf_pkgconfig_incs
11814 do
11815 case $cf_fix_cppflags in
11816 (no)
11817         case $cf_add_cflags in
11818         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11819                 case $cf_add_cflags in
11820                 (-D*)
11821                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11822
11823                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11824                                 && test -z "${cf_tst_cflags}" \
11825                                 && cf_fix_cppflags=yes
11826
11827                         if test $cf_fix_cppflags = yes ; then
11828                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11829                                 continue
11830                         elif test "${cf_tst_cflags}" = "\"'" ; then
11831                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11832                                 continue
11833                         fi
11834                         ;;
11835                 esac
11836                 case "$CPPFLAGS" in
11837                 (*$cf_add_cflags)
11838                         ;;
11839                 (*)
11840                         case $cf_add_cflags in
11841                         (-D*)
11842                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11843
11844 CPPFLAGS=`echo "$CPPFLAGS" | \
11845         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11846                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11847
11848                                 ;;
11849                         esac
11850                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11851                         ;;
11852                 esac
11853                 ;;
11854         (*)
11855                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11856                 ;;
11857         esac
11858         ;;
11859 (yes)
11860         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11861
11862         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11863
11864         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11865                 && test -z "${cf_tst_cflags}" \
11866                 && cf_fix_cppflags=no
11867         ;;
11868 esac
11869 done
11870
11871 if test -n "$cf_new_cflags" ; then
11872
11873         CFLAGS="$CFLAGS $cf_new_cflags"
11874 fi
11875
11876 if test -n "$cf_new_cppflags" ; then
11877
11878         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11879 fi
11880
11881 if test -n "$cf_new_extra_cppflags" ; then
11882
11883         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11884 fi
11885
11886 cf_add_libs="$cf_pkgconfig_libs"
11887 # Filter out duplicates - this happens with badly-designed ".pc" files...
11888 for cf_add_1lib in $LIBS
11889 do
11890         for cf_add_2lib in $cf_add_libs
11891         do
11892                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11893                 then
11894                         cf_add_1lib=
11895                         break
11896                 fi
11897         done
11898         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11899 done
11900 LIBS="$cf_add_libs"
11901
11902         :
11903 else
11904         cf_pkgconfig_incs=
11905         cf_pkgconfig_libs=
11906         :
11907 fi
11908
11909 else
11910         cf_pkgconfig_incs=
11911         cf_pkgconfig_libs=
11912
11913 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
11914
11915 echo "${as_me:-configure}:11915: testing ...before $LIBS ..." 1>&5
11916
11917 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%-lXt %-lXt $X_PRE_LIBS %" -e 's%  % %g'`
11918 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
11919
11920 echo "${as_me:-configure}:11920: testing ...after  $LIBS ..." 1>&5
11921
11922 fi
11923
11924                                 ;;
11925                         esac
11926                         ;;
11927                 esac
11928         fi
11929
11930         cf_have_X_LIBS=yes
11931
11932 else
11933         cf_pkgconfig_incs=
11934         cf_pkgconfig_libs=
11935
11936         LDFLAGS="$X_LIBS $LDFLAGS"
11937
11938 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
11939
11940 echo "${as_me:-configure}:11940: testing checking additions to CFLAGS ..." 1>&5
11941
11942 cf_check_cflags="$CFLAGS"
11943 cf_check_cppflags="$CPPFLAGS"
11944
11945 cf_fix_cppflags=no
11946 cf_new_cflags=
11947 cf_new_cppflags=
11948 cf_new_extra_cppflags=
11949
11950 for cf_add_cflags in $X_CFLAGS
11951 do
11952 case $cf_fix_cppflags in
11953 (no)
11954         case $cf_add_cflags in
11955         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11956                 case $cf_add_cflags in
11957                 (-D*)
11958                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11959
11960                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11961                                 && test -z "${cf_tst_cflags}" \
11962                                 && cf_fix_cppflags=yes
11963
11964                         if test $cf_fix_cppflags = yes ; then
11965                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11966                                 continue
11967                         elif test "${cf_tst_cflags}" = "\"'" ; then
11968                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11969                                 continue
11970                         fi
11971                         ;;
11972                 esac
11973                 case "$CPPFLAGS" in
11974                 (*$cf_add_cflags)
11975                         ;;
11976                 (*)
11977                         case $cf_add_cflags in
11978                         (-D*)
11979                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11980
11981 CPPFLAGS=`echo "$CPPFLAGS" | \
11982         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11983                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11984
11985                                 ;;
11986                         esac
11987                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11988                         ;;
11989                 esac
11990                 ;;
11991         (*)
11992                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11993                 ;;
11994         esac
11995         ;;
11996 (yes)
11997         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11998
11999         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12000
12001         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12002                 && test -z "${cf_tst_cflags}" \
12003                 && cf_fix_cppflags=no
12004         ;;
12005 esac
12006 done
12007
12008 if test -n "$cf_new_cflags" ; then
12009         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
12010
12011 echo "${as_me:-configure}:12011: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
12012
12013         CFLAGS="$CFLAGS $cf_new_cflags"
12014 fi
12015
12016 if test -n "$cf_new_cppflags" ; then
12017         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
12018
12019 echo "${as_me:-configure}:12019: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
12020
12021         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
12022 fi
12023
12024 if test -n "$cf_new_extra_cppflags" ; then
12025         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
12026
12027 echo "${as_me:-configure}:12027: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
12028
12029         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
12030 fi
12031
12032 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
12033 cat >conftest.$ac_ext <<_ACEOF
12034 #line 12034 "configure"
12035 #include "confdefs.h"
12036 #include <stdio.h>
12037 int
12038 main ()
12039 {
12040 printf("Hello world");
12041   ;
12042   return 0;
12043 }
12044 _ACEOF
12045 rm -f conftest.$ac_objext conftest$ac_exeext
12046 if { (eval echo "$as_me:12046: \"$ac_link\"") >&5
12047   (eval $ac_link) 2>&5
12048   ac_status=$?
12049   echo "$as_me:12049: \$? = $ac_status" >&5
12050   (exit $ac_status); } &&
12051          { ac_try='test -s conftest$ac_exeext'
12052   { (eval echo "$as_me:12052: \"$ac_try\"") >&5
12053   (eval $ac_try) 2>&5
12054   ac_status=$?
12055   echo "$as_me:12055: \$? = $ac_status" >&5
12056   (exit $ac_status); }; }; then
12057   :
12058 else
12059   echo "$as_me: failed program was:" >&5
12060 cat conftest.$ac_ext >&5
12061 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
12062
12063 echo "${as_me:-configure}:12063: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
12064
12065          if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
12066                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
12067
12068 echo "${as_me:-configure}:12068: testing but keeping change to \$CPPFLAGS ..." 1>&5
12069
12070          fi
12071          CFLAGS="$cf_check_flags"
12072 fi
12073 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12074 fi
12075
12076         echo "$as_me:12076: checking for XOpenDisplay" >&5
12077 echo $ECHO_N "checking for XOpenDisplay... $ECHO_C" >&6
12078 if test "${ac_cv_func_XOpenDisplay+set}" = set; then
12079   echo $ECHO_N "(cached) $ECHO_C" >&6
12080 else
12081   cat >conftest.$ac_ext <<_ACEOF
12082 #line 12082 "configure"
12083 #include "confdefs.h"
12084 /* System header to define __stub macros and hopefully few prototypes,
12085     which can conflict with char XOpenDisplay (); below.  */
12086 #include <assert.h>
12087 /* Override any gcc2 internal prototype to avoid an error.  */
12088 #ifdef __cplusplus
12089 extern "C"
12090 #endif
12091 /* We use char because int might match the return type of a gcc2
12092    builtin and then its argument prototype would still apply.  */
12093 char XOpenDisplay ();
12094 char (*f) ();
12095
12096 int
12097 main ()
12098 {
12099 /* The GNU C library defines this for functions which it implements
12100     to always fail with ENOSYS.  Some functions are actually named
12101     something starting with __ and the normal name is an alias.  */
12102 #if defined (__stub_XOpenDisplay) || defined (__stub___XOpenDisplay)
12103 choke me
12104 #else
12105 f = XOpenDisplay; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
12106 #endif
12107
12108   ;
12109   return 0;
12110 }
12111 _ACEOF
12112 rm -f conftest.$ac_objext conftest$ac_exeext
12113 if { (eval echo "$as_me:12113: \"$ac_link\"") >&5
12114   (eval $ac_link) 2>&5
12115   ac_status=$?
12116   echo "$as_me:12116: \$? = $ac_status" >&5
12117   (exit $ac_status); } &&
12118          { ac_try='test -s conftest$ac_exeext'
12119   { (eval echo "$as_me:12119: \"$ac_try\"") >&5
12120   (eval $ac_try) 2>&5
12121   ac_status=$?
12122   echo "$as_me:12122: \$? = $ac_status" >&5
12123   (exit $ac_status); }; }; then
12124   ac_cv_func_XOpenDisplay=yes
12125 else
12126   echo "$as_me: failed program was:" >&5
12127 cat conftest.$ac_ext >&5
12128 ac_cv_func_XOpenDisplay=no
12129 fi
12130 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12131 fi
12132 echo "$as_me:12132: result: $ac_cv_func_XOpenDisplay" >&5
12133 echo "${ECHO_T}$ac_cv_func_XOpenDisplay" >&6
12134 if test $ac_cv_func_XOpenDisplay = yes; then
12135   :
12136 else
12137
12138         echo "$as_me:12138: checking for XOpenDisplay in -lX11" >&5
12139 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
12140 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
12141   echo $ECHO_N "(cached) $ECHO_C" >&6
12142 else
12143   ac_check_lib_save_LIBS=$LIBS
12144 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
12145 cat >conftest.$ac_ext <<_ACEOF
12146 #line 12146 "configure"
12147 #include "confdefs.h"
12148
12149 /* Override any gcc2 internal prototype to avoid an error.  */
12150 #ifdef __cplusplus
12151 extern "C"
12152 #endif
12153 /* We use char because int might match the return type of a gcc2
12154    builtin and then its argument prototype would still apply.  */
12155 char XOpenDisplay ();
12156 int
12157 main ()
12158 {
12159 XOpenDisplay ();
12160   ;
12161   return 0;
12162 }
12163 _ACEOF
12164 rm -f conftest.$ac_objext conftest$ac_exeext
12165 if { (eval echo "$as_me:12165: \"$ac_link\"") >&5
12166   (eval $ac_link) 2>&5
12167   ac_status=$?
12168   echo "$as_me:12168: \$? = $ac_status" >&5
12169   (exit $ac_status); } &&
12170          { ac_try='test -s conftest$ac_exeext'
12171   { (eval echo "$as_me:12171: \"$ac_try\"") >&5
12172   (eval $ac_try) 2>&5
12173   ac_status=$?
12174   echo "$as_me:12174: \$? = $ac_status" >&5
12175   (exit $ac_status); }; }; then
12176   ac_cv_lib_X11_XOpenDisplay=yes
12177 else
12178   echo "$as_me: failed program was:" >&5
12179 cat conftest.$ac_ext >&5
12180 ac_cv_lib_X11_XOpenDisplay=no
12181 fi
12182 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12183 LIBS=$ac_check_lib_save_LIBS
12184 fi
12185 echo "$as_me:12185: result: $ac_cv_lib_X11_XOpenDisplay" >&5
12186 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
12187 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
12188
12189 cf_add_libs="-lX11"
12190 # Filter out duplicates - this happens with badly-designed ".pc" files...
12191 for cf_add_1lib in $LIBS
12192 do
12193         for cf_add_2lib in $cf_add_libs
12194         do
12195                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12196                 then
12197                         cf_add_1lib=
12198                         break
12199                 fi
12200         done
12201         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12202 done
12203 LIBS="$cf_add_libs"
12204
12205 fi
12206
12207 fi
12208
12209         echo "$as_me:12209: checking for XtAppInitialize" >&5
12210 echo $ECHO_N "checking for XtAppInitialize... $ECHO_C" >&6
12211 if test "${ac_cv_func_XtAppInitialize+set}" = set; then
12212   echo $ECHO_N "(cached) $ECHO_C" >&6
12213 else
12214   cat >conftest.$ac_ext <<_ACEOF
12215 #line 12215 "configure"
12216 #include "confdefs.h"
12217 /* System header to define __stub macros and hopefully few prototypes,
12218     which can conflict with char XtAppInitialize (); below.  */
12219 #include <assert.h>
12220 /* Override any gcc2 internal prototype to avoid an error.  */
12221 #ifdef __cplusplus
12222 extern "C"
12223 #endif
12224 /* We use char because int might match the return type of a gcc2
12225    builtin and then its argument prototype would still apply.  */
12226 char XtAppInitialize ();
12227 char (*f) ();
12228
12229 int
12230 main ()
12231 {
12232 /* The GNU C library defines this for functions which it implements
12233     to always fail with ENOSYS.  Some functions are actually named
12234     something starting with __ and the normal name is an alias.  */
12235 #if defined (__stub_XtAppInitialize) || defined (__stub___XtAppInitialize)
12236 choke me
12237 #else
12238 f = XtAppInitialize; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
12239 #endif
12240
12241   ;
12242   return 0;
12243 }
12244 _ACEOF
12245 rm -f conftest.$ac_objext conftest$ac_exeext
12246 if { (eval echo "$as_me:12246: \"$ac_link\"") >&5
12247   (eval $ac_link) 2>&5
12248   ac_status=$?
12249   echo "$as_me:12249: \$? = $ac_status" >&5
12250   (exit $ac_status); } &&
12251          { ac_try='test -s conftest$ac_exeext'
12252   { (eval echo "$as_me:12252: \"$ac_try\"") >&5
12253   (eval $ac_try) 2>&5
12254   ac_status=$?
12255   echo "$as_me:12255: \$? = $ac_status" >&5
12256   (exit $ac_status); }; }; then
12257   ac_cv_func_XtAppInitialize=yes
12258 else
12259   echo "$as_me: failed program was:" >&5
12260 cat conftest.$ac_ext >&5
12261 ac_cv_func_XtAppInitialize=no
12262 fi
12263 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12264 fi
12265 echo "$as_me:12265: result: $ac_cv_func_XtAppInitialize" >&5
12266 echo "${ECHO_T}$ac_cv_func_XtAppInitialize" >&6
12267 if test $ac_cv_func_XtAppInitialize = yes; then
12268   :
12269 else
12270
12271         echo "$as_me:12271: checking for XtAppInitialize in -lXt" >&5
12272 echo $ECHO_N "checking for XtAppInitialize in -lXt... $ECHO_C" >&6
12273 if test "${ac_cv_lib_Xt_XtAppInitialize+set}" = set; then
12274   echo $ECHO_N "(cached) $ECHO_C" >&6
12275 else
12276   ac_check_lib_save_LIBS=$LIBS
12277 LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
12278 cat >conftest.$ac_ext <<_ACEOF
12279 #line 12279 "configure"
12280 #include "confdefs.h"
12281
12282 /* Override any gcc2 internal prototype to avoid an error.  */
12283 #ifdef __cplusplus
12284 extern "C"
12285 #endif
12286 /* We use char because int might match the return type of a gcc2
12287    builtin and then its argument prototype would still apply.  */
12288 char XtAppInitialize ();
12289 int
12290 main ()
12291 {
12292 XtAppInitialize ();
12293   ;
12294   return 0;
12295 }
12296 _ACEOF
12297 rm -f conftest.$ac_objext conftest$ac_exeext
12298 if { (eval echo "$as_me:12298: \"$ac_link\"") >&5
12299   (eval $ac_link) 2>&5
12300   ac_status=$?
12301   echo "$as_me:12301: \$? = $ac_status" >&5
12302   (exit $ac_status); } &&
12303          { ac_try='test -s conftest$ac_exeext'
12304   { (eval echo "$as_me:12304: \"$ac_try\"") >&5
12305   (eval $ac_try) 2>&5
12306   ac_status=$?
12307   echo "$as_me:12307: \$? = $ac_status" >&5
12308   (exit $ac_status); }; }; then
12309   ac_cv_lib_Xt_XtAppInitialize=yes
12310 else
12311   echo "$as_me: failed program was:" >&5
12312 cat conftest.$ac_ext >&5
12313 ac_cv_lib_Xt_XtAppInitialize=no
12314 fi
12315 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12316 LIBS=$ac_check_lib_save_LIBS
12317 fi
12318 echo "$as_me:12318: result: $ac_cv_lib_Xt_XtAppInitialize" >&5
12319 echo "${ECHO_T}$ac_cv_lib_Xt_XtAppInitialize" >&6
12320 if test $ac_cv_lib_Xt_XtAppInitialize = yes; then
12321
12322 cat >>confdefs.h <<\EOF
12323 #define HAVE_LIBXT 1
12324 EOF
12325
12326                  cf_have_X_LIBS=Xt
12327                  LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS"
12328 fi
12329
12330 fi
12331
12332 fi
12333
12334 if test $cf_have_X_LIBS = no ; then
12335         { echo "$as_me:12335: WARNING: Unable to successfully link X Toolkit library (-lXt) with
12336 test program.  You will have to check and add the proper libraries by hand
12337 to makefile." >&5
12338 echo "$as_me: WARNING: Unable to successfully link X Toolkit library (-lXt) with
12339 test program.  You will have to check and add the proper libraries by hand
12340 to makefile." >&2;}
12341 fi
12342
12343 cf_x_athena_root=$cf_x_athena
12344 cf_x_athena_inc=""
12345
12346 for cf_path in default \
12347         /usr/contrib/X11R6 \
12348         /usr/contrib/X11R5 \
12349         /usr/lib/X11R5 \
12350         /usr/local
12351 do
12352         if test -z "$cf_x_athena_inc" ; then
12353                 cf_save="$CPPFLAGS"
12354                 cf_test=X11/$cf_x_athena_root/SimpleMenu.h
12355                 if test $cf_path != default ; then
12356                         CPPFLAGS="$cf_save -I$cf_path/include"
12357                         echo "$as_me:12357: checking for $cf_test in $cf_path" >&5
12358 echo $ECHO_N "checking for $cf_test in $cf_path... $ECHO_C" >&6
12359                 else
12360                         echo "$as_me:12360: checking for $cf_test" >&5
12361 echo $ECHO_N "checking for $cf_test... $ECHO_C" >&6
12362                 fi
12363                 cat >conftest.$ac_ext <<_ACEOF
12364 #line 12364 "configure"
12365 #include "confdefs.h"
12366
12367 #include <X11/Intrinsic.h>
12368 #include <$cf_test>
12369 int
12370 main ()
12371 {
12372
12373   ;
12374   return 0;
12375 }
12376 _ACEOF
12377 rm -f conftest.$ac_objext
12378 if { (eval echo "$as_me:12378: \"$ac_compile\"") >&5
12379   (eval $ac_compile) 2>&5
12380   ac_status=$?
12381   echo "$as_me:12381: \$? = $ac_status" >&5
12382   (exit $ac_status); } &&
12383          { ac_try='test -s conftest.$ac_objext'
12384   { (eval echo "$as_me:12384: \"$ac_try\"") >&5
12385   (eval $ac_try) 2>&5
12386   ac_status=$?
12387   echo "$as_me:12387: \$? = $ac_status" >&5
12388   (exit $ac_status); }; }; then
12389   cf_result=yes
12390 else
12391   echo "$as_me: failed program was:" >&5
12392 cat conftest.$ac_ext >&5
12393 cf_result=no
12394 fi
12395 rm -f conftest.$ac_objext conftest.$ac_ext
12396                 echo "$as_me:12396: result: $cf_result" >&5
12397 echo "${ECHO_T}$cf_result" >&6
12398                 if test "$cf_result" = yes ; then
12399                         cf_x_athena_inc=$cf_path
12400                         break
12401                 else
12402                         CPPFLAGS="$cf_save"
12403                 fi
12404         fi
12405 done
12406
12407 if test -z "$cf_x_athena_inc" ; then
12408         { echo "$as_me:12408: WARNING: Unable to successfully find Athena header files with test program" >&5
12409 echo "$as_me: WARNING: Unable to successfully find Athena header files with test program" >&2;}
12410 elif test "$cf_x_athena_inc" != default ; then
12411         CPPFLAGS="$CPPFLAGS -I$cf_x_athena_inc"
12412 fi
12413
12414 cf_x_athena_root=$cf_x_athena
12415 cf_x_athena_lib=""
12416
12417 for cf_path in default \
12418         /usr/contrib/X11R6 \
12419         /usr/contrib/X11R5 \
12420         /usr/lib/X11R5 \
12421         /usr/local
12422 do
12423         for cf_lib in \
12424                 ${cf_x_athena_root} \
12425                 ${cf_x_athena_root}7 \
12426                 ${cf_x_athena_root}6
12427         do
12428         for cf_libs in \
12429                 "-l$cf_lib -lXmu" \
12430                 "-l$cf_lib -lXpm -lXmu" \
12431                 "-l${cf_lib}_s -lXmu_s"
12432         do
12433                 if test -z "$cf_x_athena_lib" ; then
12434                         cf_save="$LIBS"
12435                         cf_test=XawSimpleMenuAddGlobalActions
12436                         if test $cf_path != default ; then
12437
12438 cf_add_libs="-L$cf_path/lib $cf_libs"
12439 # Filter out duplicates - this happens with badly-designed ".pc" files...
12440 for cf_add_1lib in $LIBS
12441 do
12442         for cf_add_2lib in $cf_add_libs
12443         do
12444                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12445                 then
12446                         cf_add_1lib=
12447                         break
12448                 fi
12449         done
12450         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12451 done
12452 LIBS="$cf_add_libs"
12453
12454                                 echo "$as_me:12454: checking for $cf_libs in $cf_path" >&5
12455 echo $ECHO_N "checking for $cf_libs in $cf_path... $ECHO_C" >&6
12456                         else
12457
12458 cf_add_libs="$cf_libs"
12459 # Filter out duplicates - this happens with badly-designed ".pc" files...
12460 for cf_add_1lib in $LIBS
12461 do
12462         for cf_add_2lib in $cf_add_libs
12463         do
12464                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12465                 then
12466                         cf_add_1lib=
12467                         break
12468                 fi
12469         done
12470         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12471 done
12472 LIBS="$cf_add_libs"
12473
12474                                 echo "$as_me:12474: checking for $cf_test in $cf_libs" >&5
12475 echo $ECHO_N "checking for $cf_test in $cf_libs... $ECHO_C" >&6
12476                         fi
12477                         cat >conftest.$ac_ext <<_ACEOF
12478 #line 12478 "configure"
12479 #include "confdefs.h"
12480
12481 #include <X11/Intrinsic.h>
12482 #include <X11/$cf_x_athena_root/SimpleMenu.h>
12483
12484 int
12485 main ()
12486 {
12487
12488 $cf_test((XtAppContext) 0)
12489   ;
12490   return 0;
12491 }
12492 _ACEOF
12493 rm -f conftest.$ac_objext conftest$ac_exeext
12494 if { (eval echo "$as_me:12494: \"$ac_link\"") >&5
12495   (eval $ac_link) 2>&5
12496   ac_status=$?
12497   echo "$as_me:12497: \$? = $ac_status" >&5
12498   (exit $ac_status); } &&
12499          { ac_try='test -s conftest$ac_exeext'
12500   { (eval echo "$as_me:12500: \"$ac_try\"") >&5
12501   (eval $ac_try) 2>&5
12502   ac_status=$?
12503   echo "$as_me:12503: \$? = $ac_status" >&5
12504   (exit $ac_status); }; }; then
12505   cf_result=yes
12506 else
12507   echo "$as_me: failed program was:" >&5
12508 cat conftest.$ac_ext >&5
12509 cf_result=no
12510 fi
12511 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12512                         echo "$as_me:12512: result: $cf_result" >&5
12513 echo "${ECHO_T}$cf_result" >&6
12514                         if test "$cf_result" = yes ; then
12515                                 cf_x_athena_lib="$cf_libs"
12516                                 break
12517                         fi
12518                         LIBS="$cf_save"
12519                 fi
12520         done # cf_libs
12521                 test -n "$cf_x_athena_lib" && break
12522         done # cf_lib
12523 done
12524
12525 if test -z "$cf_x_athena_lib" ; then
12526         { { echo "$as_me:12526: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&5
12527 echo "$as_me: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&2;}
12528    { (exit 1); exit 1; }; }
12529 fi
12530
12531 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
12532
12533 cat >>confdefs.h <<EOF
12534 #define $cf_x_athena_LIBS 1
12535 EOF
12536
12537 fi
12538
12539 if test -n "$ac_tool_prefix"; then
12540   for ac_prog in xcurses-config
12541   do
12542     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
12543 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
12544 echo "$as_me:12544: checking for $ac_word" >&5
12545 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
12546 if test "${ac_cv_prog_XCURSES_CONFIG+set}" = set; then
12547   echo $ECHO_N "(cached) $ECHO_C" >&6
12548 else
12549   if test -n "$XCURSES_CONFIG"; then
12550   ac_cv_prog_XCURSES_CONFIG="$XCURSES_CONFIG" # Let the user override the test.
12551 else
12552   ac_save_IFS=$IFS; IFS=$ac_path_separator
12553 ac_dummy="$PATH"
12554 for ac_dir in $ac_dummy; do
12555   IFS=$ac_save_IFS
12556   test -z "$ac_dir" && ac_dir=.
12557   $as_executable_p "$ac_dir/$ac_word" || continue
12558 ac_cv_prog_XCURSES_CONFIG="$ac_tool_prefix$ac_prog"
12559 echo "$as_me:12559: found $ac_dir/$ac_word" >&5
12560 break
12561 done
12562
12563 fi
12564 fi
12565 XCURSES_CONFIG=$ac_cv_prog_XCURSES_CONFIG
12566 if test -n "$XCURSES_CONFIG"; then
12567   echo "$as_me:12567: result: $XCURSES_CONFIG" >&5
12568 echo "${ECHO_T}$XCURSES_CONFIG" >&6
12569 else
12570   echo "$as_me:12570: result: no" >&5
12571 echo "${ECHO_T}no" >&6
12572 fi
12573
12574     test -n "$XCURSES_CONFIG" && break
12575   done
12576 fi
12577 if test -z "$XCURSES_CONFIG"; then
12578   ac_ct_XCURSES_CONFIG=$XCURSES_CONFIG
12579   for ac_prog in xcurses-config
12580 do
12581   # Extract the first word of "$ac_prog", so it can be a program name with args.
12582 set dummy $ac_prog; ac_word=$2
12583 echo "$as_me:12583: checking for $ac_word" >&5
12584 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
12585 if test "${ac_cv_prog_ac_ct_XCURSES_CONFIG+set}" = set; then
12586   echo $ECHO_N "(cached) $ECHO_C" >&6
12587 else
12588   if test -n "$ac_ct_XCURSES_CONFIG"; then
12589   ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_ct_XCURSES_CONFIG" # Let the user override the test.
12590 else
12591   ac_save_IFS=$IFS; IFS=$ac_path_separator
12592 ac_dummy="$PATH"
12593 for ac_dir in $ac_dummy; do
12594   IFS=$ac_save_IFS
12595   test -z "$ac_dir" && ac_dir=.
12596   $as_executable_p "$ac_dir/$ac_word" || continue
12597 ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_prog"
12598 echo "$as_me:12598: found $ac_dir/$ac_word" >&5
12599 break
12600 done
12601
12602 fi
12603 fi
12604 ac_ct_XCURSES_CONFIG=$ac_cv_prog_ac_ct_XCURSES_CONFIG
12605 if test -n "$ac_ct_XCURSES_CONFIG"; then
12606   echo "$as_me:12606: result: $ac_ct_XCURSES_CONFIG" >&5
12607 echo "${ECHO_T}$ac_ct_XCURSES_CONFIG" >&6
12608 else
12609   echo "$as_me:12609: result: no" >&5
12610 echo "${ECHO_T}no" >&6
12611 fi
12612
12613   test -n "$ac_ct_XCURSES_CONFIG" && break
12614 done
12615 test -n "$ac_ct_XCURSES_CONFIG" || ac_ct_XCURSES_CONFIG="none"
12616
12617   XCURSES_CONFIG=$ac_ct_XCURSES_CONFIG
12618 fi
12619
12620 if test "$XCURSES_CONFIG" != none ; then
12621
12622 CPPFLAGS="$CPPFLAGS `$XCURSES_CONFIG --cflags`"
12623
12624 cf_add_libs="`$XCURSES_CONFIG --libs`"
12625 # Filter out duplicates - this happens with badly-designed ".pc" files...
12626 for cf_add_1lib in $LIBS
12627 do
12628         for cf_add_2lib in $cf_add_libs
12629         do
12630                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12631                 then
12632                         cf_add_1lib=
12633                         break
12634                 fi
12635         done
12636         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12637 done
12638 LIBS="$cf_add_libs"
12639
12640 cf_cv_lib_XCurses=yes
12641
12642 else
12643
12644 LDFLAGS="$LDFLAGS $X_LIBS"
12645
12646 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
12647
12648 echo "${as_me:-configure}:12648: testing checking additions to CFLAGS ..." 1>&5
12649
12650 cf_check_cflags="$CFLAGS"
12651 cf_check_cppflags="$CPPFLAGS"
12652
12653 cf_fix_cppflags=no
12654 cf_new_cflags=
12655 cf_new_cppflags=
12656 cf_new_extra_cppflags=
12657
12658 for cf_add_cflags in $X_CFLAGS
12659 do
12660 case $cf_fix_cppflags in
12661 (no)
12662         case $cf_add_cflags in
12663         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12664                 case $cf_add_cflags in
12665                 (-D*)
12666                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12667
12668                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12669                                 && test -z "${cf_tst_cflags}" \
12670                                 && cf_fix_cppflags=yes
12671
12672                         if test $cf_fix_cppflags = yes ; then
12673                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12674                                 continue
12675                         elif test "${cf_tst_cflags}" = "\"'" ; then
12676                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12677                                 continue
12678                         fi
12679                         ;;
12680                 esac
12681                 case "$CPPFLAGS" in
12682                 (*$cf_add_cflags)
12683                         ;;
12684                 (*)
12685                         case $cf_add_cflags in
12686                         (-D*)
12687                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12688
12689 CPPFLAGS=`echo "$CPPFLAGS" | \
12690         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12691                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12692
12693                                 ;;
12694                         esac
12695                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
12696                         ;;
12697                 esac
12698                 ;;
12699         (*)
12700                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
12701                 ;;
12702         esac
12703         ;;
12704 (yes)
12705         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12706
12707         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12708
12709         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12710                 && test -z "${cf_tst_cflags}" \
12711                 && cf_fix_cppflags=no
12712         ;;
12713 esac
12714 done
12715
12716 if test -n "$cf_new_cflags" ; then
12717         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
12718
12719 echo "${as_me:-configure}:12719: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
12720
12721         CFLAGS="$CFLAGS $cf_new_cflags"
12722 fi
12723
12724 if test -n "$cf_new_cppflags" ; then
12725         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
12726
12727 echo "${as_me:-configure}:12727: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
12728
12729         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
12730 fi
12731
12732 if test -n "$cf_new_extra_cppflags" ; then
12733         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
12734
12735 echo "${as_me:-configure}:12735: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
12736
12737         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
12738 fi
12739
12740 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
12741 cat >conftest.$ac_ext <<_ACEOF
12742 #line 12742 "configure"
12743 #include "confdefs.h"
12744 #include <stdio.h>
12745 int
12746 main ()
12747 {
12748 printf("Hello world");
12749   ;
12750   return 0;
12751 }
12752 _ACEOF
12753 rm -f conftest.$ac_objext conftest$ac_exeext
12754 if { (eval echo "$as_me:12754: \"$ac_link\"") >&5
12755   (eval $ac_link) 2>&5
12756   ac_status=$?
12757   echo "$as_me:12757: \$? = $ac_status" >&5
12758   (exit $ac_status); } &&
12759          { ac_try='test -s conftest$ac_exeext'
12760   { (eval echo "$as_me:12760: \"$ac_try\"") >&5
12761   (eval $ac_try) 2>&5
12762   ac_status=$?
12763   echo "$as_me:12763: \$? = $ac_status" >&5
12764   (exit $ac_status); }; }; then
12765   :
12766 else
12767   echo "$as_me: failed program was:" >&5
12768 cat conftest.$ac_ext >&5
12769 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
12770
12771 echo "${as_me:-configure}:12771: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
12772
12773          if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
12774                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
12775
12776 echo "${as_me:-configure}:12776: testing but keeping change to \$CPPFLAGS ..." 1>&5
12777
12778          fi
12779          CFLAGS="$cf_check_flags"
12780 fi
12781 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12782 fi
12783
12784 echo "$as_me:12784: checking for XOpenDisplay in -lX11" >&5
12785 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
12786 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
12787   echo $ECHO_N "(cached) $ECHO_C" >&6
12788 else
12789   ac_check_lib_save_LIBS=$LIBS
12790 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
12791 cat >conftest.$ac_ext <<_ACEOF
12792 #line 12792 "configure"
12793 #include "confdefs.h"
12794
12795 /* Override any gcc2 internal prototype to avoid an error.  */
12796 #ifdef __cplusplus
12797 extern "C"
12798 #endif
12799 /* We use char because int might match the return type of a gcc2
12800    builtin and then its argument prototype would still apply.  */
12801 char XOpenDisplay ();
12802 int
12803 main ()
12804 {
12805 XOpenDisplay ();
12806   ;
12807   return 0;
12808 }
12809 _ACEOF
12810 rm -f conftest.$ac_objext conftest$ac_exeext
12811 if { (eval echo "$as_me:12811: \"$ac_link\"") >&5
12812   (eval $ac_link) 2>&5
12813   ac_status=$?
12814   echo "$as_me:12814: \$? = $ac_status" >&5
12815   (exit $ac_status); } &&
12816          { ac_try='test -s conftest$ac_exeext'
12817   { (eval echo "$as_me:12817: \"$ac_try\"") >&5
12818   (eval $ac_try) 2>&5
12819   ac_status=$?
12820   echo "$as_me:12820: \$? = $ac_status" >&5
12821   (exit $ac_status); }; }; then
12822   ac_cv_lib_X11_XOpenDisplay=yes
12823 else
12824   echo "$as_me: failed program was:" >&5
12825 cat conftest.$ac_ext >&5
12826 ac_cv_lib_X11_XOpenDisplay=no
12827 fi
12828 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12829 LIBS=$ac_check_lib_save_LIBS
12830 fi
12831 echo "$as_me:12831: result: $ac_cv_lib_X11_XOpenDisplay" >&5
12832 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
12833 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
12834
12835 cf_add_libs="-lX11"
12836 # Filter out duplicates - this happens with badly-designed ".pc" files...
12837 for cf_add_1lib in $LIBS
12838 do
12839         for cf_add_2lib in $cf_add_libs
12840         do
12841                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12842                 then
12843                         cf_add_1lib=
12844                         break
12845                 fi
12846         done
12847         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12848 done
12849 LIBS="$cf_add_libs"
12850
12851 fi
12852
12853 echo "$as_me:12853: checking for XCurses library" >&5
12854 echo $ECHO_N "checking for XCurses library... $ECHO_C" >&6
12855 if test "${cf_cv_lib_XCurses+set}" = set; then
12856   echo $ECHO_N "(cached) $ECHO_C" >&6
12857 else
12858
12859 cf_add_libs="-lXCurses"
12860 # Filter out duplicates - this happens with badly-designed ".pc" files...
12861 for cf_add_1lib in $LIBS
12862 do
12863         for cf_add_2lib in $cf_add_libs
12864         do
12865                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12866                 then
12867                         cf_add_1lib=
12868                         break
12869                 fi
12870         done
12871         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12872 done
12873 LIBS="$cf_add_libs"
12874
12875 cat >conftest.$ac_ext <<_ACEOF
12876 #line 12876 "configure"
12877 #include "confdefs.h"
12878
12879 #include <xcurses.h>
12880 char *XCursesProgramName = "test";
12881
12882 int
12883 main ()
12884 {
12885 XCursesExit();
12886   ;
12887   return 0;
12888 }
12889 _ACEOF
12890 rm -f conftest.$ac_objext conftest$ac_exeext
12891 if { (eval echo "$as_me:12891: \"$ac_link\"") >&5
12892   (eval $ac_link) 2>&5
12893   ac_status=$?
12894   echo "$as_me:12894: \$? = $ac_status" >&5
12895   (exit $ac_status); } &&
12896          { ac_try='test -s conftest$ac_exeext'
12897   { (eval echo "$as_me:12897: \"$ac_try\"") >&5
12898   (eval $ac_try) 2>&5
12899   ac_status=$?
12900   echo "$as_me:12900: \$? = $ac_status" >&5
12901   (exit $ac_status); }; }; then
12902   cf_cv_lib_XCurses=yes
12903 else
12904   echo "$as_me: failed program was:" >&5
12905 cat conftest.$ac_ext >&5
12906 cf_cv_lib_XCurses=no
12907 fi
12908 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12909
12910 fi
12911 echo "$as_me:12911: result: $cf_cv_lib_XCurses" >&5
12912 echo "${ECHO_T}$cf_cv_lib_XCurses" >&6
12913
12914 fi
12915
12916 if test $cf_cv_lib_XCurses = yes ; then
12917
12918 cat >>confdefs.h <<\EOF
12919 #define UNIX 1
12920 EOF
12921
12922 cat >>confdefs.h <<\EOF
12923 #define XCURSES 1
12924 EOF
12925
12926         echo "$as_me:12926: checking for xcurses.h" >&5
12927 echo $ECHO_N "checking for xcurses.h... $ECHO_C" >&6
12928 if test "${ac_cv_header_xcurses_h+set}" = set; then
12929   echo $ECHO_N "(cached) $ECHO_C" >&6
12930 else
12931   cat >conftest.$ac_ext <<_ACEOF
12932 #line 12932 "configure"
12933 #include "confdefs.h"
12934 #include <xcurses.h>
12935 _ACEOF
12936 if { (eval echo "$as_me:12936: \"$ac_cpp conftest.$ac_ext\"") >&5
12937   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
12938   ac_status=$?
12939   egrep -v '^ *\+' conftest.er1 >conftest.err
12940   rm -f conftest.er1
12941   cat conftest.err >&5
12942   echo "$as_me:12942: \$? = $ac_status" >&5
12943   (exit $ac_status); } >/dev/null; then
12944   if test -s conftest.err; then
12945     ac_cpp_err=$ac_c_preproc_warn_flag
12946   else
12947     ac_cpp_err=
12948   fi
12949 else
12950   ac_cpp_err=yes
12951 fi
12952 if test -z "$ac_cpp_err"; then
12953   ac_cv_header_xcurses_h=yes
12954 else
12955   echo "$as_me: failed program was:" >&5
12956   cat conftest.$ac_ext >&5
12957   ac_cv_header_xcurses_h=no
12958 fi
12959 rm -f conftest.err conftest.$ac_ext
12960 fi
12961 echo "$as_me:12961: result: $ac_cv_header_xcurses_h" >&5
12962 echo "${ECHO_T}$ac_cv_header_xcurses_h" >&6
12963 if test $ac_cv_header_xcurses_h = yes; then
12964
12965 cat >>confdefs.h <<\EOF
12966 #define HAVE_XCURSES 1
12967 EOF
12968
12969 fi
12970
12971 else
12972         { { echo "$as_me:12972: error: Cannot link with XCurses" >&5
12973 echo "$as_me: error: Cannot link with XCurses" >&2;}
12974    { (exit 1); exit 1; }; }
12975 fi
12976
12977         ;;
12978 (*)
12979         { { echo "$as_me:12979: error: unexpected screen-value: $cf_cv_screen" >&5
12980 echo "$as_me: error: unexpected screen-value: $cf_cv_screen" >&2;}
12981    { (exit 1); exit 1; }; }
12982         ;;
12983 esac
12984
12985 case $cf_cv_screen in
12986 (ncurses*)
12987         cf_cv_libtype=`echo "$cf_cv_screen" | sed -e 's/^ncurses//'`
12988         ;;
12989 (curses|curses_*)
12990
12991 echo "$as_me:12991: checking for NetBSD form.h" >&5
12992 echo $ECHO_N "checking for NetBSD form.h... $ECHO_C" >&6
12993 if test "${cf_cv_netbsd_form_h+set}" = set; then
12994   echo $ECHO_N "(cached) $ECHO_C" >&6
12995 else
12996
12997 cat >conftest.$ac_ext <<_ACEOF
12998 #line 12998 "configure"
12999 #include "confdefs.h"
13000
13001 #include <${cf_cv_ncurses_header:-curses.h}>
13002 #include <form.h>
13003
13004 int
13005 main ()
13006 {
13007
13008         FORM *form;
13009         int y = current_field(form)->cursor_ypos;
13010         int x = current_field(form)->cursor_xpos;
13011
13012   ;
13013   return 0;
13014 }
13015 _ACEOF
13016 rm -f conftest.$ac_objext
13017 if { (eval echo "$as_me:13017: \"$ac_compile\"") >&5
13018   (eval $ac_compile) 2>&5
13019   ac_status=$?
13020   echo "$as_me:13020: \$? = $ac_status" >&5
13021   (exit $ac_status); } &&
13022          { ac_try='test -s conftest.$ac_objext'
13023   { (eval echo "$as_me:13023: \"$ac_try\"") >&5
13024   (eval $ac_try) 2>&5
13025   ac_status=$?
13026   echo "$as_me:13026: \$? = $ac_status" >&5
13027   (exit $ac_status); }; }; then
13028   cf_cv_netbsd_form_h=yes
13029
13030 else
13031   echo "$as_me: failed program was:" >&5
13032 cat conftest.$ac_ext >&5
13033 cf_cv_netbsd_form_h=no
13034 fi
13035 rm -f conftest.$ac_objext conftest.$ac_ext
13036
13037 fi
13038 echo "$as_me:13038: result: $cf_cv_netbsd_form_h" >&5
13039 echo "${ECHO_T}$cf_cv_netbsd_form_h" >&6
13040
13041 test "$cf_cv_netbsd_form_h" = yes &&
13042 cat >>confdefs.h <<\EOF
13043 #define HAVE_NETBSD_FORM_H 1
13044 EOF
13045
13046 echo "$as_me:13046: checking for NetBSD menu.h" >&5
13047 echo $ECHO_N "checking for NetBSD menu.h... $ECHO_C" >&6
13048 if test "${cf_cv_netbsd_menu_h+set}" = set; then
13049   echo $ECHO_N "(cached) $ECHO_C" >&6
13050 else
13051
13052 cat >conftest.$ac_ext <<_ACEOF
13053 #line 13053 "configure"
13054 #include "confdefs.h"
13055
13056 #include <${cf_cv_ncurses_header:-curses.h}>
13057 #include <menu.h>
13058
13059 int
13060 main ()
13061 {
13062
13063         MENU *menu;
13064         int y = menu->max_item_width;
13065
13066   ;
13067   return 0;
13068 }
13069 _ACEOF
13070 rm -f conftest.$ac_objext
13071 if { (eval echo "$as_me:13071: \"$ac_compile\"") >&5
13072   (eval $ac_compile) 2>&5
13073   ac_status=$?
13074   echo "$as_me:13074: \$? = $ac_status" >&5
13075   (exit $ac_status); } &&
13076          { ac_try='test -s conftest.$ac_objext'
13077   { (eval echo "$as_me:13077: \"$ac_try\"") >&5
13078   (eval $ac_try) 2>&5
13079   ac_status=$?
13080   echo "$as_me:13080: \$? = $ac_status" >&5
13081   (exit $ac_status); }; }; then
13082   cf_cv_netbsd_menu_h=yes
13083
13084 else
13085   echo "$as_me: failed program was:" >&5
13086 cat conftest.$ac_ext >&5
13087 cf_cv_netbsd_menu_h=no
13088 fi
13089 rm -f conftest.$ac_objext conftest.$ac_ext
13090
13091 fi
13092 echo "$as_me:13092: result: $cf_cv_netbsd_menu_h" >&5
13093 echo "${ECHO_T}$cf_cv_netbsd_menu_h" >&6
13094
13095 test "$cf_cv_netbsd_menu_h" = yes &&
13096 cat >>confdefs.h <<\EOF
13097 #define HAVE_NETBSD_MENU_H 1
13098 EOF
13099
13100         ;;
13101 esac
13102
13103 case $cf_cv_screen in
13104 (pdcurses)
13105         ;;
13106 (*)
13107         # look for curses-related libraries
13108
13109 as_ac_Lib=`echo "ac_cv_lib_panel$cf_cv_libtype''_new_panel" | $as_tr_sh`
13110 echo "$as_me:13110: checking for new_panel in -lpanel$cf_cv_libtype" >&5
13111 echo $ECHO_N "checking for new_panel in -lpanel$cf_cv_libtype... $ECHO_C" >&6
13112 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
13113   echo $ECHO_N "(cached) $ECHO_C" >&6
13114 else
13115   ac_check_lib_save_LIBS=$LIBS
13116 LIBS="-lpanel$cf_cv_libtype  $LIBS"
13117 cat >conftest.$ac_ext <<_ACEOF
13118 #line 13118 "configure"
13119 #include "confdefs.h"
13120
13121 /* Override any gcc2 internal prototype to avoid an error.  */
13122 #ifdef __cplusplus
13123 extern "C"
13124 #endif
13125 /* We use char because int might match the return type of a gcc2
13126    builtin and then its argument prototype would still apply.  */
13127 char new_panel ();
13128 int
13129 main ()
13130 {
13131 new_panel ();
13132   ;
13133   return 0;
13134 }
13135 _ACEOF
13136 rm -f conftest.$ac_objext conftest$ac_exeext
13137 if { (eval echo "$as_me:13137: \"$ac_link\"") >&5
13138   (eval $ac_link) 2>&5
13139   ac_status=$?
13140   echo "$as_me:13140: \$? = $ac_status" >&5
13141   (exit $ac_status); } &&
13142          { ac_try='test -s conftest$ac_exeext'
13143   { (eval echo "$as_me:13143: \"$ac_try\"") >&5
13144   (eval $ac_try) 2>&5
13145   ac_status=$?
13146   echo "$as_me:13146: \$? = $ac_status" >&5
13147   (exit $ac_status); }; }; then
13148   eval "$as_ac_Lib=yes"
13149 else
13150   echo "$as_me: failed program was:" >&5
13151 cat conftest.$ac_ext >&5
13152 eval "$as_ac_Lib=no"
13153 fi
13154 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13155 LIBS=$ac_check_lib_save_LIBS
13156 fi
13157 echo "$as_me:13157: result: `eval echo '${'$as_ac_Lib'}'`" >&5
13158 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
13159 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
13160
13161 cf_upper=`echo "have_libpanel" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
13162
13163 cf_add_libs="-lpanel$cf_cv_libtype"
13164 # Filter out duplicates - this happens with badly-designed ".pc" files...
13165 for cf_add_1lib in $LIBS
13166 do
13167         for cf_add_2lib in $cf_add_libs
13168         do
13169                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13170                 then
13171                         cf_add_1lib=
13172                         break
13173                 fi
13174         done
13175         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13176 done
13177 LIBS="$cf_add_libs"
13178
13179 cat >>confdefs.h <<EOF
13180 #define $cf_upper 1
13181 EOF
13182
13183 fi
13184
13185 as_ac_Lib=`echo "ac_cv_lib_menu$cf_cv_libtype''_menu_driver" | $as_tr_sh`
13186 echo "$as_me:13186: checking for menu_driver in -lmenu$cf_cv_libtype" >&5
13187 echo $ECHO_N "checking for menu_driver in -lmenu$cf_cv_libtype... $ECHO_C" >&6
13188 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
13189   echo $ECHO_N "(cached) $ECHO_C" >&6
13190 else
13191   ac_check_lib_save_LIBS=$LIBS
13192 LIBS="-lmenu$cf_cv_libtype  $LIBS"
13193 cat >conftest.$ac_ext <<_ACEOF
13194 #line 13194 "configure"
13195 #include "confdefs.h"
13196
13197 /* Override any gcc2 internal prototype to avoid an error.  */
13198 #ifdef __cplusplus
13199 extern "C"
13200 #endif
13201 /* We use char because int might match the return type of a gcc2
13202    builtin and then its argument prototype would still apply.  */
13203 char menu_driver ();
13204 int
13205 main ()
13206 {
13207 menu_driver ();
13208   ;
13209   return 0;
13210 }
13211 _ACEOF
13212 rm -f conftest.$ac_objext conftest$ac_exeext
13213 if { (eval echo "$as_me:13213: \"$ac_link\"") >&5
13214   (eval $ac_link) 2>&5
13215   ac_status=$?
13216   echo "$as_me:13216: \$? = $ac_status" >&5
13217   (exit $ac_status); } &&
13218          { ac_try='test -s conftest$ac_exeext'
13219   { (eval echo "$as_me:13219: \"$ac_try\"") >&5
13220   (eval $ac_try) 2>&5
13221   ac_status=$?
13222   echo "$as_me:13222: \$? = $ac_status" >&5
13223   (exit $ac_status); }; }; then
13224   eval "$as_ac_Lib=yes"
13225 else
13226   echo "$as_me: failed program was:" >&5
13227 cat conftest.$ac_ext >&5
13228 eval "$as_ac_Lib=no"
13229 fi
13230 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13231 LIBS=$ac_check_lib_save_LIBS
13232 fi
13233 echo "$as_me:13233: result: `eval echo '${'$as_ac_Lib'}'`" >&5
13234 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
13235 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
13236
13237 cf_upper=`echo "have_libmenu" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
13238
13239 cf_add_libs="-lmenu$cf_cv_libtype"
13240 # Filter out duplicates - this happens with badly-designed ".pc" files...
13241 for cf_add_1lib in $LIBS
13242 do
13243         for cf_add_2lib in $cf_add_libs
13244         do
13245                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13246                 then
13247                         cf_add_1lib=
13248                         break
13249                 fi
13250         done
13251         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13252 done
13253 LIBS="$cf_add_libs"
13254
13255 cat >>confdefs.h <<EOF
13256 #define $cf_upper 1
13257 EOF
13258
13259 fi
13260
13261 as_ac_Lib=`echo "ac_cv_lib_form$cf_cv_libtype''_form_driver" | $as_tr_sh`
13262 echo "$as_me:13262: checking for form_driver in -lform$cf_cv_libtype" >&5
13263 echo $ECHO_N "checking for form_driver in -lform$cf_cv_libtype... $ECHO_C" >&6
13264 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
13265   echo $ECHO_N "(cached) $ECHO_C" >&6
13266 else
13267   ac_check_lib_save_LIBS=$LIBS
13268 LIBS="-lform$cf_cv_libtype  $LIBS"
13269 cat >conftest.$ac_ext <<_ACEOF
13270 #line 13270 "configure"
13271 #include "confdefs.h"
13272
13273 /* Override any gcc2 internal prototype to avoid an error.  */
13274 #ifdef __cplusplus
13275 extern "C"
13276 #endif
13277 /* We use char because int might match the return type of a gcc2
13278    builtin and then its argument prototype would still apply.  */
13279 char form_driver ();
13280 int
13281 main ()
13282 {
13283 form_driver ();
13284   ;
13285   return 0;
13286 }
13287 _ACEOF
13288 rm -f conftest.$ac_objext conftest$ac_exeext
13289 if { (eval echo "$as_me:13289: \"$ac_link\"") >&5
13290   (eval $ac_link) 2>&5
13291   ac_status=$?
13292   echo "$as_me:13292: \$? = $ac_status" >&5
13293   (exit $ac_status); } &&
13294          { ac_try='test -s conftest$ac_exeext'
13295   { (eval echo "$as_me:13295: \"$ac_try\"") >&5
13296   (eval $ac_try) 2>&5
13297   ac_status=$?
13298   echo "$as_me:13298: \$? = $ac_status" >&5
13299   (exit $ac_status); }; }; then
13300   eval "$as_ac_Lib=yes"
13301 else
13302   echo "$as_me: failed program was:" >&5
13303 cat conftest.$ac_ext >&5
13304 eval "$as_ac_Lib=no"
13305 fi
13306 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13307 LIBS=$ac_check_lib_save_LIBS
13308 fi
13309 echo "$as_me:13309: result: `eval echo '${'$as_ac_Lib'}'`" >&5
13310 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
13311 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
13312
13313 cf_upper=`echo "have_libform" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
13314
13315 cf_add_libs="-lform$cf_cv_libtype"
13316 # Filter out duplicates - this happens with badly-designed ".pc" files...
13317 for cf_add_1lib in $LIBS
13318 do
13319         for cf_add_2lib in $cf_add_libs
13320         do
13321                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13322                 then
13323                         cf_add_1lib=
13324                         break
13325                 fi
13326         done
13327         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13328 done
13329 LIBS="$cf_add_libs"
13330
13331 cat >>confdefs.h <<EOF
13332 #define $cf_upper 1
13333 EOF
13334
13335 fi
13336
13337         # look for curses-related headers
13338
13339 for ac_header in \
13340                 nc_alloc.h \
13341                 nomacros.h \
13342                 form.h \
13343                 menu.h \
13344                 panel.h \
13345                 term_entry.h \
13346
13347 do
13348 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
13349 echo "$as_me:13349: checking for $ac_header" >&5
13350 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
13351 if eval "test \"\${$as_ac_Header+set}\" = set"; then
13352   echo $ECHO_N "(cached) $ECHO_C" >&6
13353 else
13354   cat >conftest.$ac_ext <<_ACEOF
13355 #line 13355 "configure"
13356 #include "confdefs.h"
13357 #include <$ac_header>
13358 _ACEOF
13359 if { (eval echo "$as_me:13359: \"$ac_cpp conftest.$ac_ext\"") >&5
13360   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13361   ac_status=$?
13362   egrep -v '^ *\+' conftest.er1 >conftest.err
13363   rm -f conftest.er1
13364   cat conftest.err >&5
13365   echo "$as_me:13365: \$? = $ac_status" >&5
13366   (exit $ac_status); } >/dev/null; then
13367   if test -s conftest.err; then
13368     ac_cpp_err=$ac_c_preproc_warn_flag
13369   else
13370     ac_cpp_err=
13371   fi
13372 else
13373   ac_cpp_err=yes
13374 fi
13375 if test -z "$ac_cpp_err"; then
13376   eval "$as_ac_Header=yes"
13377 else
13378   echo "$as_me: failed program was:" >&5
13379   cat conftest.$ac_ext >&5
13380   eval "$as_ac_Header=no"
13381 fi
13382 rm -f conftest.err conftest.$ac_ext
13383 fi
13384 echo "$as_me:13384: result: `eval echo '${'$as_ac_Header'}'`" >&5
13385 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
13386 if test `eval echo '${'$as_ac_Header'}'` = yes; then
13387   cat >>confdefs.h <<EOF
13388 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
13389 EOF
13390
13391 fi
13392 done
13393
13394         ;;
13395 esac
13396
13397 echo "$as_me:13397: checking for ANSI C header files" >&5
13398 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
13399 if test "${ac_cv_header_stdc+set}" = set; then
13400   echo $ECHO_N "(cached) $ECHO_C" >&6
13401 else
13402   cat >conftest.$ac_ext <<_ACEOF
13403 #line 13403 "configure"
13404 #include "confdefs.h"
13405 #include <stdlib.h>
13406 #include <stdarg.h>
13407 #include <string.h>
13408 #include <float.h>
13409
13410 _ACEOF
13411 if { (eval echo "$as_me:13411: \"$ac_cpp conftest.$ac_ext\"") >&5
13412   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13413   ac_status=$?
13414   egrep -v '^ *\+' conftest.er1 >conftest.err
13415   rm -f conftest.er1
13416   cat conftest.err >&5
13417   echo "$as_me:13417: \$? = $ac_status" >&5
13418   (exit $ac_status); } >/dev/null; then
13419   if test -s conftest.err; then
13420     ac_cpp_err=$ac_c_preproc_warn_flag
13421   else
13422     ac_cpp_err=
13423   fi
13424 else
13425   ac_cpp_err=yes
13426 fi
13427 if test -z "$ac_cpp_err"; then
13428   ac_cv_header_stdc=yes
13429 else
13430   echo "$as_me: failed program was:" >&5
13431   cat conftest.$ac_ext >&5
13432   ac_cv_header_stdc=no
13433 fi
13434 rm -f conftest.err conftest.$ac_ext
13435
13436 if test $ac_cv_header_stdc = yes; then
13437   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
13438   cat >conftest.$ac_ext <<_ACEOF
13439 #line 13439 "configure"
13440 #include "confdefs.h"
13441 #include <string.h>
13442
13443 _ACEOF
13444 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13445   egrep "memchr" >/dev/null 2>&1; then
13446   :
13447 else
13448   ac_cv_header_stdc=no
13449 fi
13450 rm -rf conftest*
13451
13452 fi
13453
13454 if test $ac_cv_header_stdc = yes; then
13455   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
13456   cat >conftest.$ac_ext <<_ACEOF
13457 #line 13457 "configure"
13458 #include "confdefs.h"
13459 #include <stdlib.h>
13460
13461 _ACEOF
13462 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13463   egrep "free" >/dev/null 2>&1; then
13464   :
13465 else
13466   ac_cv_header_stdc=no
13467 fi
13468 rm -rf conftest*
13469
13470 fi
13471
13472 if test $ac_cv_header_stdc = yes; then
13473   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
13474   if test "$cross_compiling" = yes; then
13475   :
13476 else
13477   cat >conftest.$ac_ext <<_ACEOF
13478 #line 13478 "configure"
13479 #include "confdefs.h"
13480 #include <ctype.h>
13481 #if ((' ' & 0x0FF) == 0x020)
13482 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
13483 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
13484 #else
13485 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
13486                      || ('j' <= (c) && (c) <= 'r') \
13487                      || ('s' <= (c) && (c) <= 'z'))
13488 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
13489 #endif
13490
13491 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
13492 int
13493 main ()
13494 {
13495   int i;
13496   for (i = 0; i < 256; i++)
13497     if (XOR (islower (i), ISLOWER (i))
13498         || toupper (i) != TOUPPER (i))
13499       $ac_main_return(2);
13500   $ac_main_return (0);
13501 }
13502 _ACEOF
13503 rm -f conftest$ac_exeext
13504 if { (eval echo "$as_me:13504: \"$ac_link\"") >&5
13505   (eval $ac_link) 2>&5
13506   ac_status=$?
13507   echo "$as_me:13507: \$? = $ac_status" >&5
13508   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
13509   { (eval echo "$as_me:13509: \"$ac_try\"") >&5
13510   (eval $ac_try) 2>&5
13511   ac_status=$?
13512   echo "$as_me:13512: \$? = $ac_status" >&5
13513   (exit $ac_status); }; }; then
13514   :
13515 else
13516   echo "$as_me: program exited with status $ac_status" >&5
13517 echo "$as_me: failed program was:" >&5
13518 cat conftest.$ac_ext >&5
13519 ac_cv_header_stdc=no
13520 fi
13521 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
13522 fi
13523 fi
13524 fi
13525 echo "$as_me:13525: result: $ac_cv_header_stdc" >&5
13526 echo "${ECHO_T}$ac_cv_header_stdc" >&6
13527 if test $ac_cv_header_stdc = yes; then
13528
13529 cat >>confdefs.h <<\EOF
13530 #define STDC_HEADERS 1
13531 EOF
13532
13533 fi
13534
13535 echo "$as_me:13535: checking whether time.h and sys/time.h may both be included" >&5
13536 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
13537 if test "${ac_cv_header_time+set}" = set; then
13538   echo $ECHO_N "(cached) $ECHO_C" >&6
13539 else
13540   cat >conftest.$ac_ext <<_ACEOF
13541 #line 13541 "configure"
13542 #include "confdefs.h"
13543 #include <sys/types.h>
13544 #include <sys/time.h>
13545 #include <time.h>
13546
13547 int
13548 main ()
13549 {
13550 if ((struct tm *) 0)
13551 return 0;
13552   ;
13553   return 0;
13554 }
13555 _ACEOF
13556 rm -f conftest.$ac_objext
13557 if { (eval echo "$as_me:13557: \"$ac_compile\"") >&5
13558   (eval $ac_compile) 2>&5
13559   ac_status=$?
13560   echo "$as_me:13560: \$? = $ac_status" >&5
13561   (exit $ac_status); } &&
13562          { ac_try='test -s conftest.$ac_objext'
13563   { (eval echo "$as_me:13563: \"$ac_try\"") >&5
13564   (eval $ac_try) 2>&5
13565   ac_status=$?
13566   echo "$as_me:13566: \$? = $ac_status" >&5
13567   (exit $ac_status); }; }; then
13568   ac_cv_header_time=yes
13569 else
13570   echo "$as_me: failed program was:" >&5
13571 cat conftest.$ac_ext >&5
13572 ac_cv_header_time=no
13573 fi
13574 rm -f conftest.$ac_objext conftest.$ac_ext
13575 fi
13576 echo "$as_me:13576: result: $ac_cv_header_time" >&5
13577 echo "${ECHO_T}$ac_cv_header_time" >&6
13578 if test $ac_cv_header_time = yes; then
13579
13580 cat >>confdefs.h <<\EOF
13581 #define TIME_WITH_SYS_TIME 1
13582 EOF
13583
13584 fi
13585
13586 for ac_header in \
13587 getopt.h \
13588 locale.h \
13589 math.h \
13590 stdarg.h \
13591 sys/ioctl.h \
13592 sys/select.h \
13593 sys/time.h \
13594 termios.h \
13595 unistd.h \
13596
13597 do
13598 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
13599 echo "$as_me:13599: checking for $ac_header" >&5
13600 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
13601 if eval "test \"\${$as_ac_Header+set}\" = set"; then
13602   echo $ECHO_N "(cached) $ECHO_C" >&6
13603 else
13604   cat >conftest.$ac_ext <<_ACEOF
13605 #line 13605 "configure"
13606 #include "confdefs.h"
13607 #include <$ac_header>
13608 _ACEOF
13609 if { (eval echo "$as_me:13609: \"$ac_cpp conftest.$ac_ext\"") >&5
13610   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13611   ac_status=$?
13612   egrep -v '^ *\+' conftest.er1 >conftest.err
13613   rm -f conftest.er1
13614   cat conftest.err >&5
13615   echo "$as_me:13615: \$? = $ac_status" >&5
13616   (exit $ac_status); } >/dev/null; then
13617   if test -s conftest.err; then
13618     ac_cpp_err=$ac_c_preproc_warn_flag
13619   else
13620     ac_cpp_err=
13621   fi
13622 else
13623   ac_cpp_err=yes
13624 fi
13625 if test -z "$ac_cpp_err"; then
13626   eval "$as_ac_Header=yes"
13627 else
13628   echo "$as_me: failed program was:" >&5
13629   cat conftest.$ac_ext >&5
13630   eval "$as_ac_Header=no"
13631 fi
13632 rm -f conftest.err conftest.$ac_ext
13633 fi
13634 echo "$as_me:13634: result: `eval echo '${'$as_ac_Header'}'`" >&5
13635 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
13636 if test `eval echo '${'$as_ac_Header'}'` = yes; then
13637   cat >>confdefs.h <<EOF
13638 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
13639 EOF
13640
13641 fi
13642 done
13643
13644 for ac_header in unistd.h getopt.h
13645 do
13646 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
13647 echo "$as_me:13647: checking for $ac_header" >&5
13648 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
13649 if eval "test \"\${$as_ac_Header+set}\" = set"; then
13650   echo $ECHO_N "(cached) $ECHO_C" >&6
13651 else
13652   cat >conftest.$ac_ext <<_ACEOF
13653 #line 13653 "configure"
13654 #include "confdefs.h"
13655 #include <$ac_header>
13656 _ACEOF
13657 if { (eval echo "$as_me:13657: \"$ac_cpp conftest.$ac_ext\"") >&5
13658   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13659   ac_status=$?
13660   egrep -v '^ *\+' conftest.er1 >conftest.err
13661   rm -f conftest.er1
13662   cat conftest.err >&5
13663   echo "$as_me:13663: \$? = $ac_status" >&5
13664   (exit $ac_status); } >/dev/null; then
13665   if test -s conftest.err; then
13666     ac_cpp_err=$ac_c_preproc_warn_flag
13667   else
13668     ac_cpp_err=
13669   fi
13670 else
13671   ac_cpp_err=yes
13672 fi
13673 if test -z "$ac_cpp_err"; then
13674   eval "$as_ac_Header=yes"
13675 else
13676   echo "$as_me: failed program was:" >&5
13677   cat conftest.$ac_ext >&5
13678   eval "$as_ac_Header=no"
13679 fi
13680 rm -f conftest.err conftest.$ac_ext
13681 fi
13682 echo "$as_me:13682: result: `eval echo '${'$as_ac_Header'}'`" >&5
13683 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
13684 if test `eval echo '${'$as_ac_Header'}'` = yes; then
13685   cat >>confdefs.h <<EOF
13686 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
13687 EOF
13688
13689 fi
13690 done
13691
13692 echo "$as_me:13692: checking for header declaring getopt variables" >&5
13693 echo $ECHO_N "checking for header declaring getopt variables... $ECHO_C" >&6
13694 if test "${cf_cv_getopt_header+set}" = set; then
13695   echo $ECHO_N "(cached) $ECHO_C" >&6
13696 else
13697
13698 cf_cv_getopt_header=none
13699 for cf_header in stdio.h stdlib.h unistd.h getopt.h
13700 do
13701 cat >conftest.$ac_ext <<_ACEOF
13702 #line 13702 "configure"
13703 #include "confdefs.h"
13704
13705 #include <$cf_header>
13706 int
13707 main ()
13708 {
13709 int x = optind; char *y = optarg
13710   ;
13711   return 0;
13712 }
13713 _ACEOF
13714 rm -f conftest.$ac_objext
13715 if { (eval echo "$as_me:13715: \"$ac_compile\"") >&5
13716   (eval $ac_compile) 2>&5
13717   ac_status=$?
13718   echo "$as_me:13718: \$? = $ac_status" >&5
13719   (exit $ac_status); } &&
13720          { ac_try='test -s conftest.$ac_objext'
13721   { (eval echo "$as_me:13721: \"$ac_try\"") >&5
13722   (eval $ac_try) 2>&5
13723   ac_status=$?
13724   echo "$as_me:13724: \$? = $ac_status" >&5
13725   (exit $ac_status); }; }; then
13726   cf_cv_getopt_header=$cf_header
13727  break
13728 else
13729   echo "$as_me: failed program was:" >&5
13730 cat conftest.$ac_ext >&5
13731 fi
13732 rm -f conftest.$ac_objext conftest.$ac_ext
13733 done
13734
13735 fi
13736 echo "$as_me:13736: result: $cf_cv_getopt_header" >&5
13737 echo "${ECHO_T}$cf_cv_getopt_header" >&6
13738 if test $cf_cv_getopt_header != none ; then
13739
13740 cat >>confdefs.h <<\EOF
13741 #define HAVE_GETOPT_HEADER 1
13742 EOF
13743
13744 fi
13745 if test $cf_cv_getopt_header = getopt.h ; then
13746
13747 cat >>confdefs.h <<\EOF
13748 #define NEED_GETOPT_H 1
13749 EOF
13750
13751 fi
13752
13753 for ac_func in \
13754 getopt \
13755 gettimeofday \
13756
13757 do
13758 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
13759 echo "$as_me:13759: checking for $ac_func" >&5
13760 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
13761 if eval "test \"\${$as_ac_var+set}\" = set"; then
13762   echo $ECHO_N "(cached) $ECHO_C" >&6
13763 else
13764   cat >conftest.$ac_ext <<_ACEOF
13765 #line 13765 "configure"
13766 #include "confdefs.h"
13767 /* System header to define __stub macros and hopefully few prototypes,
13768     which can conflict with char $ac_func (); below.  */
13769 #include <assert.h>
13770 /* Override any gcc2 internal prototype to avoid an error.  */
13771 #ifdef __cplusplus
13772 extern "C"
13773 #endif
13774 /* We use char because int might match the return type of a gcc2
13775    builtin and then its argument prototype would still apply.  */
13776 char $ac_func ();
13777 char (*f) ();
13778
13779 int
13780 main ()
13781 {
13782 /* The GNU C library defines this for functions which it implements
13783     to always fail with ENOSYS.  Some functions are actually named
13784     something starting with __ and the normal name is an alias.  */
13785 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
13786 choke me
13787 #else
13788 f = $ac_func; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
13789 #endif
13790
13791   ;
13792   return 0;
13793 }
13794 _ACEOF
13795 rm -f conftest.$ac_objext conftest$ac_exeext
13796 if { (eval echo "$as_me:13796: \"$ac_link\"") >&5
13797   (eval $ac_link) 2>&5
13798   ac_status=$?
13799   echo "$as_me:13799: \$? = $ac_status" >&5
13800   (exit $ac_status); } &&
13801          { ac_try='test -s conftest$ac_exeext'
13802   { (eval echo "$as_me:13802: \"$ac_try\"") >&5
13803   (eval $ac_try) 2>&5
13804   ac_status=$?
13805   echo "$as_me:13805: \$? = $ac_status" >&5
13806   (exit $ac_status); }; }; then
13807   eval "$as_ac_var=yes"
13808 else
13809   echo "$as_me: failed program was:" >&5
13810 cat conftest.$ac_ext >&5
13811 eval "$as_ac_var=no"
13812 fi
13813 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13814 fi
13815 echo "$as_me:13815: result: `eval echo '${'$as_ac_var'}'`" >&5
13816 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
13817 if test `eval echo '${'$as_ac_var'}'` = yes; then
13818   cat >>confdefs.h <<EOF
13819 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
13820 EOF
13821
13822 fi
13823 done
13824
13825 if test "x$ac_cv_func_getopt" = xno; then
13826         { { echo "$as_me:13826: error: getopt is required for building programs" >&5
13827 echo "$as_me: error: getopt is required for building programs" >&2;}
13828    { (exit 1); exit 1; }; }
13829 fi
13830
13831 if test "$cf_enable_widec" = yes; then
13832
13833 for ac_func in \
13834 mblen \
13835 mbrlen \
13836 mbrtowc \
13837 mbsrtowcs \
13838 mbstowcs \
13839 mbtowc \
13840 wcsrtombs \
13841 wcstombs \
13842
13843 do
13844 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
13845 echo "$as_me:13845: checking for $ac_func" >&5
13846 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
13847 if eval "test \"\${$as_ac_var+set}\" = set"; then
13848   echo $ECHO_N "(cached) $ECHO_C" >&6
13849 else
13850   cat >conftest.$ac_ext <<_ACEOF
13851 #line 13851 "configure"
13852 #include "confdefs.h"
13853 /* System header to define __stub macros and hopefully few prototypes,
13854     which can conflict with char $ac_func (); below.  */
13855 #include <assert.h>
13856 /* Override any gcc2 internal prototype to avoid an error.  */
13857 #ifdef __cplusplus
13858 extern "C"
13859 #endif
13860 /* We use char because int might match the return type of a gcc2
13861    builtin and then its argument prototype would still apply.  */
13862 char $ac_func ();
13863 char (*f) ();
13864
13865 int
13866 main ()
13867 {
13868 /* The GNU C library defines this for functions which it implements
13869     to always fail with ENOSYS.  Some functions are actually named
13870     something starting with __ and the normal name is an alias.  */
13871 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
13872 choke me
13873 #else
13874 f = $ac_func; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
13875 #endif
13876
13877   ;
13878   return 0;
13879 }
13880 _ACEOF
13881 rm -f conftest.$ac_objext conftest$ac_exeext
13882 if { (eval echo "$as_me:13882: \"$ac_link\"") >&5
13883   (eval $ac_link) 2>&5
13884   ac_status=$?
13885   echo "$as_me:13885: \$? = $ac_status" >&5
13886   (exit $ac_status); } &&
13887          { ac_try='test -s conftest$ac_exeext'
13888   { (eval echo "$as_me:13888: \"$ac_try\"") >&5
13889   (eval $ac_try) 2>&5
13890   ac_status=$?
13891   echo "$as_me:13891: \$? = $ac_status" >&5
13892   (exit $ac_status); }; }; then
13893   eval "$as_ac_var=yes"
13894 else
13895   echo "$as_me: failed program was:" >&5
13896 cat conftest.$ac_ext >&5
13897 eval "$as_ac_var=no"
13898 fi
13899 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13900 fi
13901 echo "$as_me:13901: result: `eval echo '${'$as_ac_var'}'`" >&5
13902 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
13903 if test `eval echo '${'$as_ac_var'}'` = yes; then
13904   cat >>confdefs.h <<EOF
13905 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
13906 EOF
13907
13908 fi
13909 done
13910
13911 fi
13912
13913 echo "$as_me:13913: checking if we must define _XOPEN_SOURCE_EXTENDED" >&5
13914 echo $ECHO_N "checking if we must define _XOPEN_SOURCE_EXTENDED... $ECHO_C" >&6
13915 if test "${cf_cv_need_xopen_extension+set}" = set; then
13916   echo $ECHO_N "(cached) $ECHO_C" >&6
13917 else
13918
13919 cat >conftest.$ac_ext <<_ACEOF
13920 #line 13920 "configure"
13921 #include "confdefs.h"
13922
13923 #include <stdlib.h>
13924 #include <${cf_cv_ncurses_header:-curses.h}>
13925 int
13926 main ()
13927 {
13928
13929 #if defined(NCURSES_VERSION_PATCH)
13930 #if (NCURSES_VERSION_PATCH < 20100501) && (NCURSES_VERSION_PATCH >= 20100403)
13931         make an error
13932 #endif
13933 #endif
13934         long x = winnstr(stdscr, "", 0);
13935         int x1, y1;
13936         getbegyx(stdscr, y1, x1)
13937   ;
13938   return 0;
13939 }
13940 _ACEOF
13941 rm -f conftest.$ac_objext conftest$ac_exeext
13942 if { (eval echo "$as_me:13942: \"$ac_link\"") >&5
13943   (eval $ac_link) 2>&5
13944   ac_status=$?
13945   echo "$as_me:13945: \$? = $ac_status" >&5
13946   (exit $ac_status); } &&
13947          { ac_try='test -s conftest$ac_exeext'
13948   { (eval echo "$as_me:13948: \"$ac_try\"") >&5
13949   (eval $ac_try) 2>&5
13950   ac_status=$?
13951   echo "$as_me:13951: \$? = $ac_status" >&5
13952   (exit $ac_status); }; }; then
13953   cf_cv_need_xopen_extension=no
13954 else
13955   echo "$as_me: failed program was:" >&5
13956 cat conftest.$ac_ext >&5
13957 cat >conftest.$ac_ext <<_ACEOF
13958 #line 13958 "configure"
13959 #include "confdefs.h"
13960
13961 #define _XOPEN_SOURCE_EXTENDED
13962 #include <stdlib.h>
13963 #include <${cf_cv_ncurses_header:-curses.h}>
13964 int
13965 main ()
13966 {
13967
13968 #ifdef NCURSES_VERSION
13969         cchar_t check;
13970         int check2 = curs_set((int)sizeof(check));
13971 #endif
13972         long x = winnstr(stdscr, "", 0);
13973         int x1, y1;
13974         getbegyx(stdscr, y1, x1)
13975   ;
13976   return 0;
13977 }
13978 _ACEOF
13979 rm -f conftest.$ac_objext conftest$ac_exeext
13980 if { (eval echo "$as_me:13980: \"$ac_link\"") >&5
13981   (eval $ac_link) 2>&5
13982   ac_status=$?
13983   echo "$as_me:13983: \$? = $ac_status" >&5
13984   (exit $ac_status); } &&
13985          { ac_try='test -s conftest$ac_exeext'
13986   { (eval echo "$as_me:13986: \"$ac_try\"") >&5
13987   (eval $ac_try) 2>&5
13988   ac_status=$?
13989   echo "$as_me:13989: \$? = $ac_status" >&5
13990   (exit $ac_status); }; }; then
13991   cf_cv_need_xopen_extension=yes
13992 else
13993   echo "$as_me: failed program was:" >&5
13994 cat conftest.$ac_ext >&5
13995 cf_cv_need_xopen_extension=unknown
13996 fi
13997 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13998 fi
13999 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14000 fi
14001 echo "$as_me:14001: result: $cf_cv_need_xopen_extension" >&5
14002 echo "${ECHO_T}$cf_cv_need_xopen_extension" >&6
14003 test $cf_cv_need_xopen_extension = yes && CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED"
14004
14005 echo "$as_me:14005: checking for term.h" >&5
14006 echo $ECHO_N "checking for term.h... $ECHO_C" >&6
14007 if test "${cf_cv_term_header+set}" = set; then
14008   echo $ECHO_N "(cached) $ECHO_C" >&6
14009 else
14010
14011 # If we found <ncurses/curses.h>, look for <ncurses/term.h>, but always look
14012 # for <term.h> if we do not find the variant.
14013
14014 cf_header_list="term.h ncurses/term.h ncursesw/term.h"
14015
14016 case ${cf_cv_ncurses_header:-curses.h} in
14017 (*/*)
14018         cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`term.h
14019         cf_header_list="$cf_header_item $cf_header_list"
14020         ;;
14021 esac
14022
14023 for cf_header in $cf_header_list
14024 do
14025         cat >conftest.$ac_ext <<_ACEOF
14026 #line 14026 "configure"
14027 #include "confdefs.h"
14028
14029 #include <${cf_cv_ncurses_header:-curses.h}>
14030 #include <${cf_header}>
14031 int
14032 main ()
14033 {
14034 WINDOW *x
14035   ;
14036   return 0;
14037 }
14038 _ACEOF
14039 rm -f conftest.$ac_objext
14040 if { (eval echo "$as_me:14040: \"$ac_compile\"") >&5
14041   (eval $ac_compile) 2>&5
14042   ac_status=$?
14043   echo "$as_me:14043: \$? = $ac_status" >&5
14044   (exit $ac_status); } &&
14045          { ac_try='test -s conftest.$ac_objext'
14046   { (eval echo "$as_me:14046: \"$ac_try\"") >&5
14047   (eval $ac_try) 2>&5
14048   ac_status=$?
14049   echo "$as_me:14049: \$? = $ac_status" >&5
14050   (exit $ac_status); }; }; then
14051   cf_cv_term_header=$cf_header
14052          break
14053 else
14054   echo "$as_me: failed program was:" >&5
14055 cat conftest.$ac_ext >&5
14056 cf_cv_term_header=no
14057 fi
14058 rm -f conftest.$ac_objext conftest.$ac_ext
14059 done
14060
14061 case $cf_cv_term_header in
14062 (no)
14063         # If curses is ncurses, some packagers still mess it up by trying to make
14064         # us use GNU termcap.  This handles the most common case.
14065         for cf_header in ncurses/term.h ncursesw/term.h
14066         do
14067                 cat >conftest.$ac_ext <<_ACEOF
14068 #line 14068 "configure"
14069 #include "confdefs.h"
14070
14071 #include <${cf_cv_ncurses_header:-curses.h}>
14072 #ifdef NCURSES_VERSION
14073 #include <${cf_header}>
14074 #else
14075 make an error
14076 #endif
14077 int
14078 main ()
14079 {
14080 WINDOW *x
14081   ;
14082   return 0;
14083 }
14084 _ACEOF
14085 rm -f conftest.$ac_objext
14086 if { (eval echo "$as_me:14086: \"$ac_compile\"") >&5
14087   (eval $ac_compile) 2>&5
14088   ac_status=$?
14089   echo "$as_me:14089: \$? = $ac_status" >&5
14090   (exit $ac_status); } &&
14091          { ac_try='test -s conftest.$ac_objext'
14092   { (eval echo "$as_me:14092: \"$ac_try\"") >&5
14093   (eval $ac_try) 2>&5
14094   ac_status=$?
14095   echo "$as_me:14095: \$? = $ac_status" >&5
14096   (exit $ac_status); }; }; then
14097   cf_cv_term_header=$cf_header
14098                          break
14099 else
14100   echo "$as_me: failed program was:" >&5
14101 cat conftest.$ac_ext >&5
14102 cf_cv_term_header=no
14103 fi
14104 rm -f conftest.$ac_objext conftest.$ac_ext
14105         done
14106         ;;
14107 esac
14108
14109 fi
14110 echo "$as_me:14110: result: $cf_cv_term_header" >&5
14111 echo "${ECHO_T}$cf_cv_term_header" >&6
14112
14113 case $cf_cv_term_header in
14114 (term.h)
14115
14116 cat >>confdefs.h <<\EOF
14117 #define HAVE_TERM_H 1
14118 EOF
14119
14120         ;;
14121 (ncurses/term.h)
14122
14123 cat >>confdefs.h <<\EOF
14124 #define HAVE_NCURSES_TERM_H 1
14125 EOF
14126
14127         ;;
14128 (ncursesw/term.h)
14129
14130 cat >>confdefs.h <<\EOF
14131 #define HAVE_NCURSESW_TERM_H 1
14132 EOF
14133
14134         ;;
14135 esac
14136
14137 echo "$as_me:14137: checking for unctrl.h" >&5
14138 echo $ECHO_N "checking for unctrl.h... $ECHO_C" >&6
14139 if test "${cf_cv_unctrl_header+set}" = set; then
14140   echo $ECHO_N "(cached) $ECHO_C" >&6
14141 else
14142
14143 # If we found <ncurses/curses.h>, look for <ncurses/unctrl.h>, but always look
14144 # for <unctrl.h> if we do not find the variant.
14145
14146 cf_header_list="unctrl.h ncurses/unctrl.h ncursesw/unctrl.h"
14147
14148 case ${cf_cv_ncurses_header:-curses.h} in
14149 (*/*)
14150         cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`unctrl.h
14151         cf_header_list="$cf_header_item $cf_header_list"
14152         ;;
14153 esac
14154
14155 for cf_header in $cf_header_list
14156 do
14157         cat >conftest.$ac_ext <<_ACEOF
14158 #line 14158 "configure"
14159 #include "confdefs.h"
14160
14161 #include <${cf_cv_ncurses_header:-curses.h}>
14162 #include <${cf_header}>
14163 int
14164 main ()
14165 {
14166 WINDOW *x
14167   ;
14168   return 0;
14169 }
14170 _ACEOF
14171 rm -f conftest.$ac_objext
14172 if { (eval echo "$as_me:14172: \"$ac_compile\"") >&5
14173   (eval $ac_compile) 2>&5
14174   ac_status=$?
14175   echo "$as_me:14175: \$? = $ac_status" >&5
14176   (exit $ac_status); } &&
14177          { ac_try='test -s conftest.$ac_objext'
14178   { (eval echo "$as_me:14178: \"$ac_try\"") >&5
14179   (eval $ac_try) 2>&5
14180   ac_status=$?
14181   echo "$as_me:14181: \$? = $ac_status" >&5
14182   (exit $ac_status); }; }; then
14183   cf_cv_unctrl_header=$cf_header
14184          break
14185 else
14186   echo "$as_me: failed program was:" >&5
14187 cat conftest.$ac_ext >&5
14188 cf_cv_unctrl_header=no
14189 fi
14190 rm -f conftest.$ac_objext conftest.$ac_ext
14191 done
14192
14193 fi
14194 echo "$as_me:14194: result: $cf_cv_unctrl_header" >&5
14195 echo "${ECHO_T}$cf_cv_unctrl_header" >&6
14196
14197 case $cf_cv_unctrl_header in
14198 (no)
14199         { echo "$as_me:14199: WARNING: unctrl.h header not found" >&5
14200 echo "$as_me: WARNING: unctrl.h header not found" >&2;}
14201         ;;
14202 esac
14203
14204 case $cf_cv_unctrl_header in
14205 (unctrl.h)
14206
14207 cat >>confdefs.h <<\EOF
14208 #define HAVE_UNCTRL_H 1
14209 EOF
14210
14211         ;;
14212 (ncurses/unctrl.h)
14213
14214 cat >>confdefs.h <<\EOF
14215 #define HAVE_NCURSES_UNCTRL_H 1
14216 EOF
14217
14218         ;;
14219 (ncursesw/unctrl.h)
14220
14221 cat >>confdefs.h <<\EOF
14222 #define HAVE_NCURSESW_UNCTRL_H 1
14223 EOF
14224
14225         ;;
14226 esac
14227
14228 for cf_func in \
14229 assume_default_colors \
14230 chgat \
14231 color_set \
14232 filter \
14233 getbegx \
14234 getcurx \
14235 getmaxx \
14236 getnstr \
14237 getparx \
14238 getwin \
14239 mvvline \
14240 mvwvline \
14241 napms \
14242 putwin \
14243 resize_term \
14244 resizeterm \
14245 ripoffline \
14246 scr_dump \
14247 setupterm \
14248 slk_color \
14249 slk_init \
14250 termattrs \
14251 tgetent \
14252 tigetnum \
14253 tigetstr \
14254 typeahead \
14255 use_default_colors \
14256 use_env \
14257 use_extended_names \
14258 use_screen \
14259 use_window \
14260 vid_puts \
14261 vidputs \
14262 vsscanf \
14263 vw_printw \
14264 wchgat \
14265 winsstr \
14266 wresize \
14267 wsyncdown \
14268
14269 do
14270
14271 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14272
14273         echo "$as_me:14273: checking for ${cf_func}" >&5
14274 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
14275
14276 echo "${as_me:-configure}:14276: testing ${cf_func} ..." 1>&5
14277
14278         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
14279   echo $ECHO_N "(cached) $ECHO_C" >&6
14280 else
14281
14282                 eval cf_result='$ac_cv_func_'$cf_func
14283                 if test ".$cf_result" != ".no"; then
14284                         cat >conftest.$ac_ext <<_ACEOF
14285 #line 14285 "configure"
14286 #include "confdefs.h"
14287
14288 #ifdef HAVE_XCURSES
14289 #include <xcurses.h>
14290 char * XCursesProgramName = "test";
14291 #else
14292 #include <${cf_cv_ncurses_header:-curses.h}>
14293 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
14294 #include <ncursesw/term.h>
14295 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
14296 #include <ncurses/term.h>
14297 #elif defined(HAVE_TERM_H)
14298 #include <term.h>
14299 #endif
14300 #endif
14301
14302 int
14303 main ()
14304 {
14305
14306 #ifndef ${cf_func}
14307 long foo = (long)(&${cf_func});
14308 fprintf(stderr, "testing linkage of $cf_func:%p\n", foo);
14309 if (foo + 1234 > 5678)
14310         ${cf_cv_main_return:-return}(foo);
14311 #endif
14312
14313   ;
14314   return 0;
14315 }
14316 _ACEOF
14317 rm -f conftest.$ac_objext conftest$ac_exeext
14318 if { (eval echo "$as_me:14318: \"$ac_link\"") >&5
14319   (eval $ac_link) 2>&5
14320   ac_status=$?
14321   echo "$as_me:14321: \$? = $ac_status" >&5
14322   (exit $ac_status); } &&
14323          { ac_try='test -s conftest$ac_exeext'
14324   { (eval echo "$as_me:14324: \"$ac_try\"") >&5
14325   (eval $ac_try) 2>&5
14326   ac_status=$?
14327   echo "$as_me:14327: \$? = $ac_status" >&5
14328   (exit $ac_status); }; }; then
14329   cf_result=yes
14330 else
14331   echo "$as_me: failed program was:" >&5
14332 cat conftest.$ac_ext >&5
14333 cf_result=no
14334 fi
14335 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14336                 fi
14337                 eval 'cf_cv_func_'$cf_func'=$cf_result'
14338
14339 fi
14340
14341         # use the computed/retrieved cache-value:
14342         eval 'cf_result=$cf_cv_func_'$cf_func
14343         echo "$as_me:14343: result: $cf_result" >&5
14344 echo "${ECHO_T}$cf_result" >&6
14345         if test $cf_result != no; then
14346                 cat >>confdefs.h <<EOF
14347 #define HAVE_${cf_tr_func} 1
14348 EOF
14349
14350         fi
14351 done
14352
14353 for cf_func in tputs
14354 do
14355
14356 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14357
14358         echo "$as_me:14358: checking for ${cf_func}" >&5
14359 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
14360
14361 echo "${as_me:-configure}:14361: testing ${cf_func} ..." 1>&5
14362
14363         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
14364   echo $ECHO_N "(cached) $ECHO_C" >&6
14365 else
14366
14367                 eval cf_result='$ac_cv_func_'$cf_func
14368                 if test ".$cf_result" != ".no"; then
14369                         cat >conftest.$ac_ext <<_ACEOF
14370 #line 14370 "configure"
14371 #include "confdefs.h"
14372
14373 #ifdef HAVE_XCURSES
14374 #include <xcurses.h>
14375 char * XCursesProgramName = "test";
14376 #else
14377 #include <${cf_cv_ncurses_header:-curses.h}>
14378 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
14379 #include <ncursesw/term.h>
14380 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
14381 #include <ncurses/term.h>
14382 #elif defined(HAVE_TERM_H)
14383 #include <term.h>
14384 #endif
14385 #endif
14386
14387 int
14388 main ()
14389 {
14390
14391 #ifndef ${cf_func}
14392 long foo = (long)(&${cf_func});
14393 fprintf(stderr, "testing linkage of $cf_func:%p\n", foo);
14394 if (foo + 1234 > 5678)
14395         ${cf_cv_main_return:-return}(foo);
14396 #endif
14397
14398   ;
14399   return 0;
14400 }
14401 _ACEOF
14402 rm -f conftest.$ac_objext conftest$ac_exeext
14403 if { (eval echo "$as_me:14403: \"$ac_link\"") >&5
14404   (eval $ac_link) 2>&5
14405   ac_status=$?
14406   echo "$as_me:14406: \$? = $ac_status" >&5
14407   (exit $ac_status); } &&
14408          { ac_try='test -s conftest$ac_exeext'
14409   { (eval echo "$as_me:14409: \"$ac_try\"") >&5
14410   (eval $ac_try) 2>&5
14411   ac_status=$?
14412   echo "$as_me:14412: \$? = $ac_status" >&5
14413   (exit $ac_status); }; }; then
14414   cf_result=yes
14415 else
14416   echo "$as_me: failed program was:" >&5
14417 cat conftest.$ac_ext >&5
14418 cf_result=no
14419 fi
14420 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14421                 fi
14422                 eval 'cf_cv_func_'$cf_func'=$cf_result'
14423
14424 fi
14425
14426         # use the computed/retrieved cache-value:
14427         eval 'cf_result=$cf_cv_func_'$cf_func
14428         echo "$as_me:14428: result: $cf_result" >&5
14429 echo "${ECHO_T}$cf_result" >&6
14430         if test $cf_result != no; then
14431                 cat >>confdefs.h <<EOF
14432 #define HAVE_${cf_tr_func} 1
14433 EOF
14434
14435         fi
14436 done
14437
14438 if test x$cf_cv_func_tputs = xyes
14439 then
14440         cf_done=no
14441         for cf_arg in int char
14442         do
14443                 for cf_ret in int void
14444                 do
14445                         if test $cf_ret = void
14446                         then
14447                                 cf_return="/* nothing */"
14448                         else
14449                                 cf_return="return value"
14450                         fi
14451                         cat >conftest.$ac_ext <<_ACEOF
14452 #line 14452 "configure"
14453 #include "confdefs.h"
14454
14455 #include <${cf_cv_ncurses_header:-curses.h}>
14456 #include <$cf_cv_term_header>
14457
14458 static $cf_ret outc($cf_arg value) { $cf_return; }
14459
14460 int
14461 main ()
14462 {
14463
14464         tputs("hello", 0, outc);
14465         ${cf_cv_main_return:-return}(0);
14466
14467   ;
14468   return 0;
14469 }
14470 _ACEOF
14471 rm -f conftest.$ac_objext
14472 if { (eval echo "$as_me:14472: \"$ac_compile\"") >&5
14473   (eval $ac_compile) 2>&5
14474   ac_status=$?
14475   echo "$as_me:14475: \$? = $ac_status" >&5
14476   (exit $ac_status); } &&
14477          { ac_try='test -s conftest.$ac_objext'
14478   { (eval echo "$as_me:14478: \"$ac_try\"") >&5
14479   (eval $ac_try) 2>&5
14480   ac_status=$?
14481   echo "$as_me:14481: \$? = $ac_status" >&5
14482   (exit $ac_status); }; }; then
14483
14484                 test -n "$verbose" && echo "    prototype $cf_ret func($cf_arg value)" 1>&6
14485
14486 echo "${as_me:-configure}:14486: testing prototype $cf_ret func($cf_arg value) ..." 1>&5
14487
14488                 cat >>confdefs.h <<EOF
14489 #define TPUTS_ARG               $cf_arg
14490 #define TPUTS_PROTO(func,value) $cf_ret func(TPUTS_ARG value)
14491 #define TPUTS_RETURN(value)     $cf_return
14492 EOF
14493                 cf_done=yes
14494                 break
14495
14496 else
14497   echo "$as_me: failed program was:" >&5
14498 cat conftest.$ac_ext >&5
14499 fi
14500 rm -f conftest.$ac_objext conftest.$ac_ext
14501                 done
14502                 test $cf_done = yes && break
14503         done
14504 fi
14505
14506 echo "$as_me:14506: checking for ncurses extended functions" >&5
14507 echo $ECHO_N "checking for ncurses extended functions... $ECHO_C" >&6
14508 if test "${cf_cv_ncurses_ext_funcs+set}" = set; then
14509   echo $ECHO_N "(cached) $ECHO_C" >&6
14510 else
14511
14512 cat >conftest.$ac_ext <<_ACEOF
14513 #line 14513 "configure"
14514 #include "confdefs.h"
14515
14516 #include <${cf_cv_ncurses_header:-curses.h}>
14517 int
14518 main ()
14519 {
14520
14521 int x = NCURSES_EXT_FUNCS
14522
14523   ;
14524   return 0;
14525 }
14526 _ACEOF
14527 rm -f conftest.$ac_objext
14528 if { (eval echo "$as_me:14528: \"$ac_compile\"") >&5
14529   (eval $ac_compile) 2>&5
14530   ac_status=$?
14531   echo "$as_me:14531: \$? = $ac_status" >&5
14532   (exit $ac_status); } &&
14533          { ac_try='test -s conftest.$ac_objext'
14534   { (eval echo "$as_me:14534: \"$ac_try\"") >&5
14535   (eval $ac_try) 2>&5
14536   ac_status=$?
14537   echo "$as_me:14537: \$? = $ac_status" >&5
14538   (exit $ac_status); }; }; then
14539   cf_cv_ncurses_ext_funcs=defined
14540 else
14541   echo "$as_me: failed program was:" >&5
14542 cat conftest.$ac_ext >&5
14543
14544 cat >conftest.$ac_ext <<_ACEOF
14545 #line 14545 "configure"
14546 #include "confdefs.h"
14547
14548 #include <${cf_cv_ncurses_header:-curses.h}>
14549 int
14550 main ()
14551 {
14552
14553         (void) assume_default_colors (0, 0);
14554         (void) curses_version ();
14555         (void) define_key (0, 0);
14556         (void) is_term_resized (0, 0);
14557         (void) key_defined (0);
14558         (void) keybound (0, 0);
14559         (void) keyok (0, 0);
14560         (void) resize_term (0, 0);
14561         (void) resizeterm (0, 0);
14562         (void) use_default_colors ();
14563         (void) use_extended_names (0);
14564         (void) wresize (0, 0, 0);
14565   ;
14566   return 0;
14567 }
14568 _ACEOF
14569 rm -f conftest.$ac_objext conftest$ac_exeext
14570 if { (eval echo "$as_me:14570: \"$ac_link\"") >&5
14571   (eval $ac_link) 2>&5
14572   ac_status=$?
14573   echo "$as_me:14573: \$? = $ac_status" >&5
14574   (exit $ac_status); } &&
14575          { ac_try='test -s conftest$ac_exeext'
14576   { (eval echo "$as_me:14576: \"$ac_try\"") >&5
14577   (eval $ac_try) 2>&5
14578   ac_status=$?
14579   echo "$as_me:14579: \$? = $ac_status" >&5
14580   (exit $ac_status); }; }; then
14581   cf_cv_ncurses_ext_funcs=yes
14582 else
14583   echo "$as_me: failed program was:" >&5
14584 cat conftest.$ac_ext >&5
14585 cf_cv_ncurses_ext_funcs=no
14586 fi
14587 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14588
14589 fi
14590 rm -f conftest.$ac_objext conftest.$ac_ext
14591
14592 fi
14593 echo "$as_me:14593: result: $cf_cv_ncurses_ext_funcs" >&5
14594 echo "${ECHO_T}$cf_cv_ncurses_ext_funcs" >&6
14595 test "$cf_cv_ncurses_ext_funcs" = yes &&
14596 cat >>confdefs.h <<\EOF
14597 #define NCURSES_EXT_FUNCS 1
14598 EOF
14599
14600 if test "$cf_enable_widec" = yes
14601 then
14602         # workaround for systems with ncurses before 20111029, due to change of
14603         # feature test macro from _XPG5 to _XOPEN_SOURCE
14604         if test -n "$cf_cv_ncurses_version" && test "x$cf_cv_ncurses_version" != xno
14605         then
14606                 cf_define_xpg5=no
14607                 echo "$as_me:14607: checking if _XPG5 should be defined to enable wide-characters" >&5
14608 echo $ECHO_N "checking if _XPG5 should be defined to enable wide-characters... $ECHO_C" >&6
14609
14610                 cat >conftest.$ac_ext <<_ACEOF
14611 #line 14611 "configure"
14612 #include "confdefs.h"
14613
14614 #include <${cf_cv_ncurses_header:-curses.h}>
14615 int
14616 main ()
14617 {
14618 int x = _XPG5
14619   ;
14620   return 0;
14621 }
14622 _ACEOF
14623 rm -f conftest.$ac_objext
14624 if { (eval echo "$as_me:14624: \"$ac_compile\"") >&5
14625   (eval $ac_compile) 2>&5
14626   ac_status=$?
14627   echo "$as_me:14627: \$? = $ac_status" >&5
14628   (exit $ac_status); } &&
14629          { ac_try='test -s conftest.$ac_objext'
14630   { (eval echo "$as_me:14630: \"$ac_try\"") >&5
14631   (eval $ac_try) 2>&5
14632   ac_status=$?
14633   echo "$as_me:14633: \$? = $ac_status" >&5
14634   (exit $ac_status); }; }; then
14635   :
14636 else
14637   echo "$as_me: failed program was:" >&5
14638 cat conftest.$ac_ext >&5
14639 cf_save_cppflags="$CPPFLAGS"
14640                          CPPFLAGS="$CPPFLAGS -D_XPG5"
14641                          cat >conftest.$ac_ext <<_ACEOF
14642 #line 14642 "configure"
14643 #include "confdefs.h"
14644
14645 #include <${cf_cv_ncurses_header:-curses.h}>
14646 int
14647 main ()
14648 {
14649 int x = _XPG5
14650   ;
14651   return 0;
14652 }
14653 _ACEOF
14654 rm -f conftest.$ac_objext
14655 if { (eval echo "$as_me:14655: \"$ac_compile\"") >&5
14656   (eval $ac_compile) 2>&5
14657   ac_status=$?
14658   echo "$as_me:14658: \$? = $ac_status" >&5
14659   (exit $ac_status); } &&
14660          { ac_try='test -s conftest.$ac_objext'
14661   { (eval echo "$as_me:14661: \"$ac_try\"") >&5
14662   (eval $ac_try) 2>&5
14663   ac_status=$?
14664   echo "$as_me:14664: \$? = $ac_status" >&5
14665   (exit $ac_status); }; }; then
14666   cf_define_xpg5=yes
14667 else
14668   echo "$as_me: failed program was:" >&5
14669 cat conftest.$ac_ext >&5
14670 fi
14671 rm -f conftest.$ac_objext conftest.$ac_ext
14672                          CPPFLAGS="$cf_save_cppflags"
14673 fi
14674 rm -f conftest.$ac_objext conftest.$ac_ext
14675                 echo "$as_me:14675: result: $cf_define_xpg5" >&5
14676 echo "${ECHO_T}$cf_define_xpg5" >&6
14677
14678                 if test "$cf_define_xpg5" = yes
14679                 then
14680                         CPPFLAGS="$CPPFLAGS -D_XPG5"
14681                 fi
14682         fi
14683
14684         echo "$as_me:14684: checking for wide-character functions" >&5
14685 echo $ECHO_N "checking for wide-character functions... $ECHO_C" >&6
14686 if test "${cf_cv_widechar_funcs+set}" = set; then
14687   echo $ECHO_N "(cached) $ECHO_C" >&6
14688 else
14689
14690         cat >conftest.$ac_ext <<_ACEOF
14691 #line 14691 "configure"
14692 #include "confdefs.h"
14693
14694 #include <${cf_cv_ncurses_header:-curses.h}>
14695 int
14696 main ()
14697 {
14698
14699                 static wchar_t src_wchar[2];
14700                 static cchar_t dst_cchar;
14701                 setcchar(&dst_cchar, src_wchar, A_NORMAL, 0, (void *) 0);
14702
14703   ;
14704   return 0;
14705 }
14706 _ACEOF
14707 rm -f conftest.$ac_objext conftest$ac_exeext
14708 if { (eval echo "$as_me:14708: \"$ac_link\"") >&5
14709   (eval $ac_link) 2>&5
14710   ac_status=$?
14711   echo "$as_me:14711: \$? = $ac_status" >&5
14712   (exit $ac_status); } &&
14713          { ac_try='test -s conftest$ac_exeext'
14714   { (eval echo "$as_me:14714: \"$ac_try\"") >&5
14715   (eval $ac_try) 2>&5
14716   ac_status=$?
14717   echo "$as_me:14717: \$? = $ac_status" >&5
14718   (exit $ac_status); }; }; then
14719   cf_cv_widechar_funcs=yes
14720 else
14721   echo "$as_me: failed program was:" >&5
14722 cat conftest.$ac_ext >&5
14723 cf_cv_widechar_funcs=no
14724 fi
14725 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14726
14727 fi
14728 echo "$as_me:14728: result: $cf_cv_widechar_funcs" >&5
14729 echo "${ECHO_T}$cf_cv_widechar_funcs" >&6
14730         if test "$cf_cv_widechar_funcs" != no ; then
14731
14732 cat >>confdefs.h <<\EOF
14733 #define USE_WIDEC_SUPPORT 1
14734 EOF
14735
14736         else
14737                 cat >>confdefs.h <<\EOF
14738 #define USE_WIDEC_SUPPORT 0
14739 EOF
14740
14741         fi
14742 else
14743         cat >>confdefs.h <<\EOF
14744 #define USE_WIDEC_SUPPORT 0
14745 EOF
14746
14747 fi
14748
14749 echo "$as_me:14749: checking if $cf_cv_screen library uses pthreads" >&5
14750 echo $ECHO_N "checking if $cf_cv_screen library uses pthreads... $ECHO_C" >&6
14751 if test "${cf_cv_use_pthreads+set}" = set; then
14752   echo $ECHO_N "(cached) $ECHO_C" >&6
14753 else
14754
14755 cat >conftest.$ac_ext <<_ACEOF
14756 #line 14756 "configure"
14757 #include "confdefs.h"
14758
14759 #include <${cf_cv_ncurses_header:-curses.h}>
14760 extern void _nc_init_pthreads(void);
14761
14762 int
14763 main ()
14764 {
14765
14766         initscr();
14767         _nc_init_pthreads();
14768
14769   ;
14770   return 0;
14771 }
14772 _ACEOF
14773 rm -f conftest.$ac_objext conftest$ac_exeext
14774 if { (eval echo "$as_me:14774: \"$ac_link\"") >&5
14775   (eval $ac_link) 2>&5
14776   ac_status=$?
14777   echo "$as_me:14777: \$? = $ac_status" >&5
14778   (exit $ac_status); } &&
14779          { ac_try='test -s conftest$ac_exeext'
14780   { (eval echo "$as_me:14780: \"$ac_try\"") >&5
14781   (eval $ac_try) 2>&5
14782   ac_status=$?
14783   echo "$as_me:14783: \$? = $ac_status" >&5
14784   (exit $ac_status); }; }; then
14785   cf_cv_use_pthreads=yes
14786 else
14787   echo "$as_me: failed program was:" >&5
14788 cat conftest.$ac_ext >&5
14789 cf_cv_use_pthreads=no
14790 fi
14791 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14792
14793 fi
14794 echo "$as_me:14794: result: $cf_cv_use_pthreads" >&5
14795 echo "${ECHO_T}$cf_cv_use_pthreads" >&6
14796 test $cf_cv_use_pthreads = yes && cat >>confdefs.h <<\EOF
14797 #define USE_PTHREADS 1
14798 EOF
14799
14800 echo "$as_me:14800: checking if sys/time.h works with sys/select.h" >&5
14801 echo $ECHO_N "checking if sys/time.h works with sys/select.h... $ECHO_C" >&6
14802 if test "${cf_cv_sys_time_select+set}" = set; then
14803   echo $ECHO_N "(cached) $ECHO_C" >&6
14804 else
14805
14806 cat >conftest.$ac_ext <<_ACEOF
14807 #line 14807 "configure"
14808 #include "confdefs.h"
14809
14810 #include <sys/types.h>
14811 #ifdef HAVE_SYS_TIME_H
14812 #include <sys/time.h>
14813 #endif
14814 #ifdef HAVE_SYS_SELECT_H
14815 #include <sys/select.h>
14816 #endif
14817
14818 int
14819 main ()
14820 {
14821
14822   ;
14823   return 0;
14824 }
14825 _ACEOF
14826 rm -f conftest.$ac_objext
14827 if { (eval echo "$as_me:14827: \"$ac_compile\"") >&5
14828   (eval $ac_compile) 2>&5
14829   ac_status=$?
14830   echo "$as_me:14830: \$? = $ac_status" >&5
14831   (exit $ac_status); } &&
14832          { ac_try='test -s conftest.$ac_objext'
14833   { (eval echo "$as_me:14833: \"$ac_try\"") >&5
14834   (eval $ac_try) 2>&5
14835   ac_status=$?
14836   echo "$as_me:14836: \$? = $ac_status" >&5
14837   (exit $ac_status); }; }; then
14838   cf_cv_sys_time_select=yes
14839 else
14840   echo "$as_me: failed program was:" >&5
14841 cat conftest.$ac_ext >&5
14842 cf_cv_sys_time_select=no
14843 fi
14844 rm -f conftest.$ac_objext conftest.$ac_ext
14845
14846 fi
14847
14848 echo "$as_me:14848: result: $cf_cv_sys_time_select" >&5
14849 echo "${ECHO_T}$cf_cv_sys_time_select" >&6
14850 test "$cf_cv_sys_time_select" = yes &&
14851 cat >>confdefs.h <<\EOF
14852 #define HAVE_SYS_TIME_SELECT 1
14853 EOF
14854
14855 # special check for test/ditto.c
14856
14857 echo "$as_me:14857: checking for openpty in -lutil" >&5
14858 echo $ECHO_N "checking for openpty in -lutil... $ECHO_C" >&6
14859 if test "${ac_cv_lib_util_openpty+set}" = set; then
14860   echo $ECHO_N "(cached) $ECHO_C" >&6
14861 else
14862   ac_check_lib_save_LIBS=$LIBS
14863 LIBS="-lutil  $LIBS"
14864 cat >conftest.$ac_ext <<_ACEOF
14865 #line 14865 "configure"
14866 #include "confdefs.h"
14867
14868 /* Override any gcc2 internal prototype to avoid an error.  */
14869 #ifdef __cplusplus
14870 extern "C"
14871 #endif
14872 /* We use char because int might match the return type of a gcc2
14873    builtin and then its argument prototype would still apply.  */
14874 char openpty ();
14875 int
14876 main ()
14877 {
14878 openpty ();
14879   ;
14880   return 0;
14881 }
14882 _ACEOF
14883 rm -f conftest.$ac_objext conftest$ac_exeext
14884 if { (eval echo "$as_me:14884: \"$ac_link\"") >&5
14885   (eval $ac_link) 2>&5
14886   ac_status=$?
14887   echo "$as_me:14887: \$? = $ac_status" >&5
14888   (exit $ac_status); } &&
14889          { ac_try='test -s conftest$ac_exeext'
14890   { (eval echo "$as_me:14890: \"$ac_try\"") >&5
14891   (eval $ac_try) 2>&5
14892   ac_status=$?
14893   echo "$as_me:14893: \$? = $ac_status" >&5
14894   (exit $ac_status); }; }; then
14895   ac_cv_lib_util_openpty=yes
14896 else
14897   echo "$as_me: failed program was:" >&5
14898 cat conftest.$ac_ext >&5
14899 ac_cv_lib_util_openpty=no
14900 fi
14901 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14902 LIBS=$ac_check_lib_save_LIBS
14903 fi
14904 echo "$as_me:14904: result: $ac_cv_lib_util_openpty" >&5
14905 echo "${ECHO_T}$ac_cv_lib_util_openpty" >&6
14906 if test $ac_cv_lib_util_openpty = yes; then
14907   cf_cv_lib_util=yes
14908 else
14909   cf_cv_lib_util=no
14910 fi
14911
14912 echo "$as_me:14912: checking for openpty header" >&5
14913 echo $ECHO_N "checking for openpty header... $ECHO_C" >&6
14914 if test "${cf_cv_func_openpty+set}" = set; then
14915   echo $ECHO_N "(cached) $ECHO_C" >&6
14916 else
14917
14918         cf_save_LIBS="$LIBS"
14919         test $cf_cv_lib_util = yes && {
14920 cf_add_libs="-lutil"
14921 # Filter out duplicates - this happens with badly-designed ".pc" files...
14922 for cf_add_1lib in $LIBS
14923 do
14924         for cf_add_2lib in $cf_add_libs
14925         do
14926                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
14927                 then
14928                         cf_add_1lib=
14929                         break
14930                 fi
14931         done
14932         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
14933 done
14934 LIBS="$cf_add_libs"
14935  }
14936         for cf_header in pty.h libutil.h util.h
14937         do
14938         cat >conftest.$ac_ext <<_ACEOF
14939 #line 14939 "configure"
14940 #include "confdefs.h"
14941
14942 #include <$cf_header>
14943
14944 int
14945 main ()
14946 {
14947
14948         int x = openpty((int *)0, (int *)0, (char *)0,
14949                                    (struct termios *)0, (struct winsize *)0);
14950
14951   ;
14952   return 0;
14953 }
14954 _ACEOF
14955 rm -f conftest.$ac_objext conftest$ac_exeext
14956 if { (eval echo "$as_me:14956: \"$ac_link\"") >&5
14957   (eval $ac_link) 2>&5
14958   ac_status=$?
14959   echo "$as_me:14959: \$? = $ac_status" >&5
14960   (exit $ac_status); } &&
14961          { ac_try='test -s conftest$ac_exeext'
14962   { (eval echo "$as_me:14962: \"$ac_try\"") >&5
14963   (eval $ac_try) 2>&5
14964   ac_status=$?
14965   echo "$as_me:14965: \$? = $ac_status" >&5
14966   (exit $ac_status); }; }; then
14967
14968                 cf_cv_func_openpty=$cf_header
14969                 break
14970
14971 else
14972   echo "$as_me: failed program was:" >&5
14973 cat conftest.$ac_ext >&5
14974
14975                 cf_cv_func_openpty=no
14976
14977 fi
14978 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14979         done
14980         LIBS="$cf_save_LIBS"
14981
14982 fi
14983 echo "$as_me:14983: result: $cf_cv_func_openpty" >&5
14984 echo "${ECHO_T}$cf_cv_func_openpty" >&6
14985
14986 if test "$cf_cv_func_openpty" != no ; then
14987
14988 cat >>confdefs.h <<EOF
14989 #define USE_OPENPTY_HEADER <$cf_cv_func_openpty>
14990 EOF
14991
14992 cat >>confdefs.h <<\EOF
14993 #define USE_XTERM_PTY 1
14994 EOF
14995
14996         if test "x$cf_cv_lib_util" = xyes ; then
14997
14998 cf_add_libs="-lutil"
14999 # Filter out duplicates - this happens with badly-designed ".pc" files...
15000 for cf_add_1lib in $TEST_LIBS
15001 do
15002         for cf_add_2lib in $cf_add_libs
15003         do
15004                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
15005                 then
15006                         cf_add_1lib=
15007                         break
15008                 fi
15009         done
15010         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
15011 done
15012 TEST_LIBS="$cf_add_libs"
15013
15014         fi
15015 fi
15016
15017 echo "$as_me:15017: checking for function curses_version" >&5
15018 echo $ECHO_N "checking for function curses_version... $ECHO_C" >&6
15019 if test "${cf_cv_func_curses_version+set}" = set; then
15020   echo $ECHO_N "(cached) $ECHO_C" >&6
15021 else
15022
15023 if test "$cross_compiling" = yes; then
15024   cf_cv_func_curses_version=unknown
15025 else
15026   cat >conftest.$ac_ext <<_ACEOF
15027 #line 15027 "configure"
15028 #include "confdefs.h"
15029
15030 #include <${cf_cv_ncurses_header:-curses.h}>
15031 int main()
15032 {
15033         char temp[1024];
15034         sprintf(temp, "%s\n", curses_version());
15035         ${cf_cv_main_return:-return}(0);
15036 }
15037
15038 _ACEOF
15039 rm -f conftest$ac_exeext
15040 if { (eval echo "$as_me:15040: \"$ac_link\"") >&5
15041   (eval $ac_link) 2>&5
15042   ac_status=$?
15043   echo "$as_me:15043: \$? = $ac_status" >&5
15044   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
15045   { (eval echo "$as_me:15045: \"$ac_try\"") >&5
15046   (eval $ac_try) 2>&5
15047   ac_status=$?
15048   echo "$as_me:15048: \$? = $ac_status" >&5
15049   (exit $ac_status); }; }; then
15050   cf_cv_func_curses_version=yes
15051
15052 else
15053   echo "$as_me: program exited with status $ac_status" >&5
15054 echo "$as_me: failed program was:" >&5
15055 cat conftest.$ac_ext >&5
15056 cf_cv_func_curses_version=no
15057
15058 fi
15059 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
15060 fi
15061 rm -f core
15062 fi
15063 echo "$as_me:15063: result: $cf_cv_func_curses_version" >&5
15064 echo "${ECHO_T}$cf_cv_func_curses_version" >&6
15065 test "$cf_cv_func_curses_version" = yes &&
15066 cat >>confdefs.h <<\EOF
15067 #define HAVE_CURSES_VERSION 1
15068 EOF
15069
15070 echo "$as_me:15070: checking for alternate character set array" >&5
15071 echo $ECHO_N "checking for alternate character set array... $ECHO_C" >&6
15072 if test "${cf_cv_curses_acs_map+set}" = set; then
15073   echo $ECHO_N "(cached) $ECHO_C" >&6
15074 else
15075
15076 cf_cv_curses_acs_map=unknown
15077 for name in acs_map _acs_map __acs_map ${NCURSES_WRAP_PREFIX}acs_map
15078 do
15079 cat >conftest.$ac_ext <<_ACEOF
15080 #line 15080 "configure"
15081 #include "confdefs.h"
15082
15083 #include <${cf_cv_ncurses_header:-curses.h}>
15084
15085 int
15086 main ()
15087 {
15088
15089 $name['k'] = ACS_PLUS
15090
15091   ;
15092   return 0;
15093 }
15094 _ACEOF
15095 rm -f conftest.$ac_objext conftest$ac_exeext
15096 if { (eval echo "$as_me:15096: \"$ac_link\"") >&5
15097   (eval $ac_link) 2>&5
15098   ac_status=$?
15099   echo "$as_me:15099: \$? = $ac_status" >&5
15100   (exit $ac_status); } &&
15101          { ac_try='test -s conftest$ac_exeext'
15102   { (eval echo "$as_me:15102: \"$ac_try\"") >&5
15103   (eval $ac_try) 2>&5
15104   ac_status=$?
15105   echo "$as_me:15105: \$? = $ac_status" >&5
15106   (exit $ac_status); }; }; then
15107   cf_cv_curses_acs_map=$name; break
15108 else
15109   echo "$as_me: failed program was:" >&5
15110 cat conftest.$ac_ext >&5
15111 fi
15112 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15113 done
15114
15115 fi
15116 echo "$as_me:15116: result: $cf_cv_curses_acs_map" >&5
15117 echo "${ECHO_T}$cf_cv_curses_acs_map" >&6
15118
15119 test "$cf_cv_curses_acs_map" != unknown &&
15120 cat >>confdefs.h <<EOF
15121 #define CURSES_ACS_ARRAY $cf_cv_curses_acs_map
15122 EOF
15123
15124 if test "$cf_enable_widec" = yes; then
15125
15126 echo "$as_me:15126: checking for wide alternate character set array" >&5
15127 echo $ECHO_N "checking for wide alternate character set array... $ECHO_C" >&6
15128 if test "${cf_cv_curses_wacs_map+set}" = set; then
15129   echo $ECHO_N "(cached) $ECHO_C" >&6
15130 else
15131
15132         cf_cv_curses_wacs_map=unknown
15133         for name in wacs_map _wacs_map __wacs_map _nc_wacs _wacs_char
15134         do
15135         cat >conftest.$ac_ext <<_ACEOF
15136 #line 15136 "configure"
15137 #include "confdefs.h"
15138
15139 #ifndef _XOPEN_SOURCE_EXTENDED
15140 #define _XOPEN_SOURCE_EXTENDED
15141 #endif
15142 #include <${cf_cv_ncurses_header:-curses.h}>
15143 int
15144 main ()
15145 {
15146 void *foo = &($name['k'])
15147   ;
15148   return 0;
15149 }
15150 _ACEOF
15151 rm -f conftest.$ac_objext conftest$ac_exeext
15152 if { (eval echo "$as_me:15152: \"$ac_link\"") >&5
15153   (eval $ac_link) 2>&5
15154   ac_status=$?
15155   echo "$as_me:15155: \$? = $ac_status" >&5
15156   (exit $ac_status); } &&
15157          { ac_try='test -s conftest$ac_exeext'
15158   { (eval echo "$as_me:15158: \"$ac_try\"") >&5
15159   (eval $ac_try) 2>&5
15160   ac_status=$?
15161   echo "$as_me:15161: \$? = $ac_status" >&5
15162   (exit $ac_status); }; }; then
15163   cf_cv_curses_wacs_map=$name
15164          break
15165 else
15166   echo "$as_me: failed program was:" >&5
15167 cat conftest.$ac_ext >&5
15168 fi
15169 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15170         done
15171 fi
15172 echo "$as_me:15172: result: $cf_cv_curses_wacs_map" >&5
15173 echo "${ECHO_T}$cf_cv_curses_wacs_map" >&6
15174
15175 test "$cf_cv_curses_wacs_map" != unknown &&
15176 cat >>confdefs.h <<EOF
15177 #define CURSES_WACS_ARRAY $cf_cv_curses_wacs_map
15178 EOF
15179
15180 echo "$as_me:15180: checking for wide alternate character constants" >&5
15181 echo $ECHO_N "checking for wide alternate character constants... $ECHO_C" >&6
15182 if test "${cf_cv_curses_wacs_symbols+set}" = set; then
15183   echo $ECHO_N "(cached) $ECHO_C" >&6
15184 else
15185
15186 cf_cv_curses_wacs_symbols=no
15187 if test "$cf_cv_curses_wacs_map" != unknown
15188 then
15189         cat >conftest.$ac_ext <<_ACEOF
15190 #line 15190 "configure"
15191 #include "confdefs.h"
15192
15193 #ifndef _XOPEN_SOURCE_EXTENDED
15194 #define _XOPEN_SOURCE_EXTENDED
15195 #endif
15196 #include <${cf_cv_ncurses_header:-curses.h}>
15197 int
15198 main ()
15199 {
15200 cchar_t *foo = WACS_PLUS;
15201          $cf_cv_curses_wacs_map['k'] = *WACS_PLUS
15202   ;
15203   return 0;
15204 }
15205 _ACEOF
15206 rm -f conftest.$ac_objext conftest$ac_exeext
15207 if { (eval echo "$as_me:15207: \"$ac_link\"") >&5
15208   (eval $ac_link) 2>&5
15209   ac_status=$?
15210   echo "$as_me:15210: \$? = $ac_status" >&5
15211   (exit $ac_status); } &&
15212          { ac_try='test -s conftest$ac_exeext'
15213   { (eval echo "$as_me:15213: \"$ac_try\"") >&5
15214   (eval $ac_try) 2>&5
15215   ac_status=$?
15216   echo "$as_me:15216: \$? = $ac_status" >&5
15217   (exit $ac_status); }; }; then
15218   cf_cv_curses_wacs_symbols=yes
15219 else
15220   echo "$as_me: failed program was:" >&5
15221 cat conftest.$ac_ext >&5
15222 fi
15223 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15224 else
15225         cat >conftest.$ac_ext <<_ACEOF
15226 #line 15226 "configure"
15227 #include "confdefs.h"
15228
15229 #ifndef _XOPEN_SOURCE_EXTENDED
15230 #define _XOPEN_SOURCE_EXTENDED
15231 #endif
15232 #include <${cf_cv_ncurses_header:-curses.h}>
15233 int
15234 main ()
15235 {
15236 cchar_t *foo = WACS_PLUS
15237   ;
15238   return 0;
15239 }
15240 _ACEOF
15241 rm -f conftest.$ac_objext conftest$ac_exeext
15242 if { (eval echo "$as_me:15242: \"$ac_link\"") >&5
15243   (eval $ac_link) 2>&5
15244   ac_status=$?
15245   echo "$as_me:15245: \$? = $ac_status" >&5
15246   (exit $ac_status); } &&
15247          { ac_try='test -s conftest$ac_exeext'
15248   { (eval echo "$as_me:15248: \"$ac_try\"") >&5
15249   (eval $ac_try) 2>&5
15250   ac_status=$?
15251   echo "$as_me:15251: \$? = $ac_status" >&5
15252   (exit $ac_status); }; }; then
15253   cf_cv_curses_wacs_symbols=yes
15254 else
15255   echo "$as_me: failed program was:" >&5
15256 cat conftest.$ac_ext >&5
15257 fi
15258 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15259 fi
15260
15261 fi
15262 echo "$as_me:15262: result: $cf_cv_curses_wacs_symbols" >&5
15263 echo "${ECHO_T}$cf_cv_curses_wacs_symbols" >&6
15264
15265 test "$cf_cv_curses_wacs_symbols" != no &&
15266 cat >>confdefs.h <<\EOF
15267 #define CURSES_WACS_SYMBOLS 1
15268 EOF
15269
15270 fi
15271
15272 echo "$as_me:15272: checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}" >&5
15273 echo $ECHO_N "checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
15274 cat >conftest.$ac_ext <<_ACEOF
15275 #line 15275 "configure"
15276 #include "confdefs.h"
15277
15278 #ifndef _XOPEN_SOURCE_EXTENDED
15279 #define _XOPEN_SOURCE_EXTENDED
15280 #endif
15281 #include <${cf_cv_ncurses_header:-curses.h}>
15282 int
15283 main ()
15284 {
15285
15286 attr_t foo
15287
15288   ;
15289   return 0;
15290 }
15291 _ACEOF
15292 rm -f conftest.$ac_objext
15293 if { (eval echo "$as_me:15293: \"$ac_compile\"") >&5
15294   (eval $ac_compile) 2>&5
15295   ac_status=$?
15296   echo "$as_me:15296: \$? = $ac_status" >&5
15297   (exit $ac_status); } &&
15298          { ac_try='test -s conftest.$ac_objext'
15299   { (eval echo "$as_me:15299: \"$ac_try\"") >&5
15300   (eval $ac_try) 2>&5
15301   ac_status=$?
15302   echo "$as_me:15302: \$? = $ac_status" >&5
15303   (exit $ac_status); }; }; then
15304   cf_result=yes
15305 else
15306   echo "$as_me: failed program was:" >&5
15307 cat conftest.$ac_ext >&5
15308 cf_result=no
15309 fi
15310 rm -f conftest.$ac_objext conftest.$ac_ext
15311 echo "$as_me:15311: result: $cf_result" >&5
15312 echo "${ECHO_T}$cf_result" >&6
15313 if test $cf_result = yes ; then
15314
15315 cf_result=`echo "have_type_attr_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15316
15317 cat >>confdefs.h <<EOF
15318 #define $cf_result 1
15319 EOF
15320
15321 else
15322
15323 cat >>confdefs.h <<EOF
15324 #define attr_t long
15325 EOF
15326
15327 fi
15328
15329 if test "$cf_enable_widec" = yes; then
15330
15331 # This is needed on Tru64 5.0 to declare mbstate_t
15332 echo "$as_me:15332: checking if we must include wchar.h to declare mbstate_t" >&5
15333 echo $ECHO_N "checking if we must include wchar.h to declare mbstate_t... $ECHO_C" >&6
15334 if test "${cf_cv_mbstate_t+set}" = set; then
15335   echo $ECHO_N "(cached) $ECHO_C" >&6
15336 else
15337
15338 cat >conftest.$ac_ext <<_ACEOF
15339 #line 15339 "configure"
15340 #include "confdefs.h"
15341
15342 #include <stdlib.h>
15343 #include <stdarg.h>
15344 #include <stdio.h>
15345 #ifdef HAVE_LIBUTF8_H
15346 #include <libutf8.h>
15347 #endif
15348 int
15349 main ()
15350 {
15351 mbstate_t state
15352   ;
15353   return 0;
15354 }
15355 _ACEOF
15356 rm -f conftest.$ac_objext
15357 if { (eval echo "$as_me:15357: \"$ac_compile\"") >&5
15358   (eval $ac_compile) 2>&5
15359   ac_status=$?
15360   echo "$as_me:15360: \$? = $ac_status" >&5
15361   (exit $ac_status); } &&
15362          { ac_try='test -s conftest.$ac_objext'
15363   { (eval echo "$as_me:15363: \"$ac_try\"") >&5
15364   (eval $ac_try) 2>&5
15365   ac_status=$?
15366   echo "$as_me:15366: \$? = $ac_status" >&5
15367   (exit $ac_status); }; }; then
15368   cf_cv_mbstate_t=no
15369 else
15370   echo "$as_me: failed program was:" >&5
15371 cat conftest.$ac_ext >&5
15372 cat >conftest.$ac_ext <<_ACEOF
15373 #line 15373 "configure"
15374 #include "confdefs.h"
15375
15376 #include <stdlib.h>
15377 #include <stdarg.h>
15378 #include <stdio.h>
15379 #include <wchar.h>
15380 #ifdef HAVE_LIBUTF8_H
15381 #include <libutf8.h>
15382 #endif
15383 int
15384 main ()
15385 {
15386 mbstate_t value
15387   ;
15388   return 0;
15389 }
15390 _ACEOF
15391 rm -f conftest.$ac_objext
15392 if { (eval echo "$as_me:15392: \"$ac_compile\"") >&5
15393   (eval $ac_compile) 2>&5
15394   ac_status=$?
15395   echo "$as_me:15395: \$? = $ac_status" >&5
15396   (exit $ac_status); } &&
15397          { ac_try='test -s conftest.$ac_objext'
15398   { (eval echo "$as_me:15398: \"$ac_try\"") >&5
15399   (eval $ac_try) 2>&5
15400   ac_status=$?
15401   echo "$as_me:15401: \$? = $ac_status" >&5
15402   (exit $ac_status); }; }; then
15403   cf_cv_mbstate_t=yes
15404 else
15405   echo "$as_me: failed program was:" >&5
15406 cat conftest.$ac_ext >&5
15407 cf_cv_mbstate_t=unknown
15408 fi
15409 rm -f conftest.$ac_objext conftest.$ac_ext
15410 fi
15411 rm -f conftest.$ac_objext conftest.$ac_ext
15412 fi
15413 echo "$as_me:15413: result: $cf_cv_mbstate_t" >&5
15414 echo "${ECHO_T}$cf_cv_mbstate_t" >&6
15415
15416 if test "$cf_cv_mbstate_t" = yes ; then
15417
15418 cat >>confdefs.h <<\EOF
15419 #define NEED_WCHAR_H 1
15420 EOF
15421
15422         NEED_WCHAR_H=1
15423 fi
15424
15425 # if we do not find mbstate_t in either place, use substitution to provide a fallback.
15426 if test "$cf_cv_mbstate_t" = unknown ; then
15427         NCURSES_MBSTATE_T=1
15428 fi
15429
15430 # if we find mbstate_t in either place, use substitution to provide a fallback.
15431 if test "$cf_cv_mbstate_t" != unknown ; then
15432         NCURSES_OK_MBSTATE_T=1
15433 fi
15434
15435 # This is needed on Tru64 5.0 to declare wchar_t
15436 echo "$as_me:15436: checking if we must include wchar.h to declare wchar_t" >&5
15437 echo $ECHO_N "checking if we must include wchar.h to declare wchar_t... $ECHO_C" >&6
15438 if test "${cf_cv_wchar_t+set}" = set; then
15439   echo $ECHO_N "(cached) $ECHO_C" >&6
15440 else
15441
15442 cat >conftest.$ac_ext <<_ACEOF
15443 #line 15443 "configure"
15444 #include "confdefs.h"
15445
15446 #include <stdlib.h>
15447 #include <stdarg.h>
15448 #include <stdio.h>
15449 #ifdef HAVE_LIBUTF8_H
15450 #include <libutf8.h>
15451 #endif
15452 int
15453 main ()
15454 {
15455 wchar_t state
15456   ;
15457   return 0;
15458 }
15459 _ACEOF
15460 rm -f conftest.$ac_objext
15461 if { (eval echo "$as_me:15461: \"$ac_compile\"") >&5
15462   (eval $ac_compile) 2>&5
15463   ac_status=$?
15464   echo "$as_me:15464: \$? = $ac_status" >&5
15465   (exit $ac_status); } &&
15466          { ac_try='test -s conftest.$ac_objext'
15467   { (eval echo "$as_me:15467: \"$ac_try\"") >&5
15468   (eval $ac_try) 2>&5
15469   ac_status=$?
15470   echo "$as_me:15470: \$? = $ac_status" >&5
15471   (exit $ac_status); }; }; then
15472   cf_cv_wchar_t=no
15473 else
15474   echo "$as_me: failed program was:" >&5
15475 cat conftest.$ac_ext >&5
15476 cat >conftest.$ac_ext <<_ACEOF
15477 #line 15477 "configure"
15478 #include "confdefs.h"
15479
15480 #include <stdlib.h>
15481 #include <stdarg.h>
15482 #include <stdio.h>
15483 #include <wchar.h>
15484 #ifdef HAVE_LIBUTF8_H
15485 #include <libutf8.h>
15486 #endif
15487 int
15488 main ()
15489 {
15490 wchar_t value
15491   ;
15492   return 0;
15493 }
15494 _ACEOF
15495 rm -f conftest.$ac_objext
15496 if { (eval echo "$as_me:15496: \"$ac_compile\"") >&5
15497   (eval $ac_compile) 2>&5
15498   ac_status=$?
15499   echo "$as_me:15499: \$? = $ac_status" >&5
15500   (exit $ac_status); } &&
15501          { ac_try='test -s conftest.$ac_objext'
15502   { (eval echo "$as_me:15502: \"$ac_try\"") >&5
15503   (eval $ac_try) 2>&5
15504   ac_status=$?
15505   echo "$as_me:15505: \$? = $ac_status" >&5
15506   (exit $ac_status); }; }; then
15507   cf_cv_wchar_t=yes
15508 else
15509   echo "$as_me: failed program was:" >&5
15510 cat conftest.$ac_ext >&5
15511 cf_cv_wchar_t=unknown
15512 fi
15513 rm -f conftest.$ac_objext conftest.$ac_ext
15514 fi
15515 rm -f conftest.$ac_objext conftest.$ac_ext
15516 fi
15517 echo "$as_me:15517: result: $cf_cv_wchar_t" >&5
15518 echo "${ECHO_T}$cf_cv_wchar_t" >&6
15519
15520 if test "$cf_cv_wchar_t" = yes ; then
15521
15522 cat >>confdefs.h <<\EOF
15523 #define NEED_WCHAR_H 1
15524 EOF
15525
15526         NEED_WCHAR_H=1
15527 fi
15528
15529 # if we do not find wchar_t in either place, use substitution to provide a fallback.
15530 if test "$cf_cv_wchar_t" = unknown ; then
15531         NCURSES_WCHAR_T=1
15532 fi
15533
15534 # if we find wchar_t in either place, use substitution to provide a fallback.
15535 if test "$cf_cv_wchar_t" != unknown ; then
15536         NCURSES_OK_WCHAR_T=1
15537 fi
15538
15539 # This is needed on Tru64 5.0 to declare wint_t
15540 echo "$as_me:15540: checking if we must include wchar.h to declare wint_t" >&5
15541 echo $ECHO_N "checking if we must include wchar.h to declare wint_t... $ECHO_C" >&6
15542 if test "${cf_cv_wint_t+set}" = set; then
15543   echo $ECHO_N "(cached) $ECHO_C" >&6
15544 else
15545
15546 cat >conftest.$ac_ext <<_ACEOF
15547 #line 15547 "configure"
15548 #include "confdefs.h"
15549
15550 #include <stdlib.h>
15551 #include <stdarg.h>
15552 #include <stdio.h>
15553 #ifdef HAVE_LIBUTF8_H
15554 #include <libutf8.h>
15555 #endif
15556 int
15557 main ()
15558 {
15559 wint_t state
15560   ;
15561   return 0;
15562 }
15563 _ACEOF
15564 rm -f conftest.$ac_objext
15565 if { (eval echo "$as_me:15565: \"$ac_compile\"") >&5
15566   (eval $ac_compile) 2>&5
15567   ac_status=$?
15568   echo "$as_me:15568: \$? = $ac_status" >&5
15569   (exit $ac_status); } &&
15570          { ac_try='test -s conftest.$ac_objext'
15571   { (eval echo "$as_me:15571: \"$ac_try\"") >&5
15572   (eval $ac_try) 2>&5
15573   ac_status=$?
15574   echo "$as_me:15574: \$? = $ac_status" >&5
15575   (exit $ac_status); }; }; then
15576   cf_cv_wint_t=no
15577 else
15578   echo "$as_me: failed program was:" >&5
15579 cat conftest.$ac_ext >&5
15580 cat >conftest.$ac_ext <<_ACEOF
15581 #line 15581 "configure"
15582 #include "confdefs.h"
15583
15584 #include <stdlib.h>
15585 #include <stdarg.h>
15586 #include <stdio.h>
15587 #include <wchar.h>
15588 #ifdef HAVE_LIBUTF8_H
15589 #include <libutf8.h>
15590 #endif
15591 int
15592 main ()
15593 {
15594 wint_t value
15595   ;
15596   return 0;
15597 }
15598 _ACEOF
15599 rm -f conftest.$ac_objext
15600 if { (eval echo "$as_me:15600: \"$ac_compile\"") >&5
15601   (eval $ac_compile) 2>&5
15602   ac_status=$?
15603   echo "$as_me:15603: \$? = $ac_status" >&5
15604   (exit $ac_status); } &&
15605          { ac_try='test -s conftest.$ac_objext'
15606   { (eval echo "$as_me:15606: \"$ac_try\"") >&5
15607   (eval $ac_try) 2>&5
15608   ac_status=$?
15609   echo "$as_me:15609: \$? = $ac_status" >&5
15610   (exit $ac_status); }; }; then
15611   cf_cv_wint_t=yes
15612 else
15613   echo "$as_me: failed program was:" >&5
15614 cat conftest.$ac_ext >&5
15615 cf_cv_wint_t=unknown
15616 fi
15617 rm -f conftest.$ac_objext conftest.$ac_ext
15618 fi
15619 rm -f conftest.$ac_objext conftest.$ac_ext
15620 fi
15621 echo "$as_me:15621: result: $cf_cv_wint_t" >&5
15622 echo "${ECHO_T}$cf_cv_wint_t" >&6
15623
15624 if test "$cf_cv_wint_t" = yes ; then
15625
15626 cat >>confdefs.h <<\EOF
15627 #define NEED_WCHAR_H 1
15628 EOF
15629
15630         NEED_WCHAR_H=1
15631 fi
15632
15633 # if we do not find wint_t in either place, use substitution to provide a fallback.
15634 if test "$cf_cv_wint_t" = unknown ; then
15635         NCURSES_WINT_T=1
15636 fi
15637
15638 # if we find wint_t in either place, use substitution to provide a fallback.
15639 if test "$cf_cv_wint_t" != unknown ; then
15640         NCURSES_OK_WINT_T=1
15641 fi
15642
15643         if test "$NCURSES_OK_MBSTATE_T" = 0 ; then
15644
15645 echo "$as_me:15645: checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}" >&5
15646 echo $ECHO_N "checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
15647 cat >conftest.$ac_ext <<_ACEOF
15648 #line 15648 "configure"
15649 #include "confdefs.h"
15650
15651 #ifndef _XOPEN_SOURCE_EXTENDED
15652 #define _XOPEN_SOURCE_EXTENDED
15653 #endif
15654 #include <${cf_cv_ncurses_header:-curses.h}>
15655 int
15656 main ()
15657 {
15658
15659 mbstate_t foo
15660
15661   ;
15662   return 0;
15663 }
15664 _ACEOF
15665 rm -f conftest.$ac_objext
15666 if { (eval echo "$as_me:15666: \"$ac_compile\"") >&5
15667   (eval $ac_compile) 2>&5
15668   ac_status=$?
15669   echo "$as_me:15669: \$? = $ac_status" >&5
15670   (exit $ac_status); } &&
15671          { ac_try='test -s conftest.$ac_objext'
15672   { (eval echo "$as_me:15672: \"$ac_try\"") >&5
15673   (eval $ac_try) 2>&5
15674   ac_status=$?
15675   echo "$as_me:15675: \$? = $ac_status" >&5
15676   (exit $ac_status); }; }; then
15677   cf_result=yes
15678 else
15679   echo "$as_me: failed program was:" >&5
15680 cat conftest.$ac_ext >&5
15681 cf_result=no
15682 fi
15683 rm -f conftest.$ac_objext conftest.$ac_ext
15684 echo "$as_me:15684: result: $cf_result" >&5
15685 echo "${ECHO_T}$cf_result" >&6
15686 if test $cf_result = yes ; then
15687
15688 cf_result=`echo "have_type_mbstate_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15689
15690 cat >>confdefs.h <<EOF
15691 #define $cf_result 1
15692 EOF
15693
15694 else
15695
15696 cat >>confdefs.h <<EOF
15697 #define mbstate_t long
15698 EOF
15699
15700 fi
15701
15702         fi
15703
15704         if test "$NCURSES_OK_WCHAR_T" = 0 ; then
15705
15706 echo "$as_me:15706: checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}" >&5
15707 echo $ECHO_N "checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
15708 cat >conftest.$ac_ext <<_ACEOF
15709 #line 15709 "configure"
15710 #include "confdefs.h"
15711
15712 #ifndef _XOPEN_SOURCE_EXTENDED
15713 #define _XOPEN_SOURCE_EXTENDED
15714 #endif
15715 #include <${cf_cv_ncurses_header:-curses.h}>
15716 int
15717 main ()
15718 {
15719
15720 wchar_t foo
15721
15722   ;
15723   return 0;
15724 }
15725 _ACEOF
15726 rm -f conftest.$ac_objext
15727 if { (eval echo "$as_me:15727: \"$ac_compile\"") >&5
15728   (eval $ac_compile) 2>&5
15729   ac_status=$?
15730   echo "$as_me:15730: \$? = $ac_status" >&5
15731   (exit $ac_status); } &&
15732          { ac_try='test -s conftest.$ac_objext'
15733   { (eval echo "$as_me:15733: \"$ac_try\"") >&5
15734   (eval $ac_try) 2>&5
15735   ac_status=$?
15736   echo "$as_me:15736: \$? = $ac_status" >&5
15737   (exit $ac_status); }; }; then
15738   cf_result=yes
15739 else
15740   echo "$as_me: failed program was:" >&5
15741 cat conftest.$ac_ext >&5
15742 cf_result=no
15743 fi
15744 rm -f conftest.$ac_objext conftest.$ac_ext
15745 echo "$as_me:15745: result: $cf_result" >&5
15746 echo "${ECHO_T}$cf_result" >&6
15747 if test $cf_result = yes ; then
15748
15749 cf_result=`echo "have_type_wchar_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15750
15751 cat >>confdefs.h <<EOF
15752 #define $cf_result 1
15753 EOF
15754
15755 else
15756
15757 cat >>confdefs.h <<EOF
15758 #define wchar_t long
15759 EOF
15760
15761 fi
15762
15763         fi
15764
15765         if test "$NCURSES_OK_WINT_T" = 0 ; then
15766
15767 echo "$as_me:15767: checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}" >&5
15768 echo $ECHO_N "checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
15769 cat >conftest.$ac_ext <<_ACEOF
15770 #line 15770 "configure"
15771 #include "confdefs.h"
15772
15773 #ifndef _XOPEN_SOURCE_EXTENDED
15774 #define _XOPEN_SOURCE_EXTENDED
15775 #endif
15776 #include <${cf_cv_ncurses_header:-curses.h}>
15777 int
15778 main ()
15779 {
15780
15781 wint_t foo
15782
15783   ;
15784   return 0;
15785 }
15786 _ACEOF
15787 rm -f conftest.$ac_objext
15788 if { (eval echo "$as_me:15788: \"$ac_compile\"") >&5
15789   (eval $ac_compile) 2>&5
15790   ac_status=$?
15791   echo "$as_me:15791: \$? = $ac_status" >&5
15792   (exit $ac_status); } &&
15793          { ac_try='test -s conftest.$ac_objext'
15794   { (eval echo "$as_me:15794: \"$ac_try\"") >&5
15795   (eval $ac_try) 2>&5
15796   ac_status=$?
15797   echo "$as_me:15797: \$? = $ac_status" >&5
15798   (exit $ac_status); }; }; then
15799   cf_result=yes
15800 else
15801   echo "$as_me: failed program was:" >&5
15802 cat conftest.$ac_ext >&5
15803 cf_result=no
15804 fi
15805 rm -f conftest.$ac_objext conftest.$ac_ext
15806 echo "$as_me:15806: result: $cf_result" >&5
15807 echo "${ECHO_T}$cf_result" >&6
15808 if test $cf_result = yes ; then
15809
15810 cf_result=`echo "have_type_wint_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15811
15812 cat >>confdefs.h <<EOF
15813 #define $cf_result 1
15814 EOF
15815
15816 else
15817
15818 cat >>confdefs.h <<EOF
15819 #define wint_t long
15820 EOF
15821
15822 fi
15823
15824         fi
15825 fi
15826
15827 echo "$as_me:15827: checking for data ospeed declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
15828 echo $ECHO_N "checking for data ospeed declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
15829
15830 cat >conftest.$ac_ext <<_ACEOF
15831 #line 15831 "configure"
15832 #include "confdefs.h"
15833
15834 #ifdef HAVE_XCURSES
15835 #include <xcurses.h>
15836 char * XCursesProgramName = "test";
15837 #else
15838 #include <${cf_cv_ncurses_header:-curses.h}>
15839 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
15840 #include <ncursesw/term.h>
15841 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
15842 #include <ncurses/term.h>
15843 #elif defined(HAVE_TERM_H)
15844 #include <term.h>
15845 #endif
15846 #endif
15847
15848 int
15849 main ()
15850 {
15851
15852 void *foo = &(ospeed)
15853
15854   ;
15855   return 0;
15856 }
15857 _ACEOF
15858 rm -f conftest.$ac_objext
15859 if { (eval echo "$as_me:15859: \"$ac_compile\"") >&5
15860   (eval $ac_compile) 2>&5
15861   ac_status=$?
15862   echo "$as_me:15862: \$? = $ac_status" >&5
15863   (exit $ac_status); } &&
15864          { ac_try='test -s conftest.$ac_objext'
15865   { (eval echo "$as_me:15865: \"$ac_try\"") >&5
15866   (eval $ac_try) 2>&5
15867   ac_status=$?
15868   echo "$as_me:15868: \$? = $ac_status" >&5
15869   (exit $ac_status); }; }; then
15870   cf_result=yes
15871 else
15872   echo "$as_me: failed program was:" >&5
15873 cat conftest.$ac_ext >&5
15874 cf_result=no
15875 fi
15876 rm -f conftest.$ac_objext conftest.$ac_ext
15877 echo "$as_me:15877: result: $cf_result" >&5
15878 echo "${ECHO_T}$cf_result" >&6
15879
15880 if test $cf_result = yes ; then
15881
15882 cf_result=`echo "have_curses_data_ospeed" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15883
15884         cat >>confdefs.h <<EOF
15885 #define $cf_result 1
15886 EOF
15887
15888 else
15889         echo "$as_me:15889: checking for data ospeed in library" >&5
15890 echo $ECHO_N "checking for data ospeed in library... $ECHO_C" >&6
15891         # BSD linkers insist on making weak linkage, but resolve at runtime.
15892         if test "$cross_compiling" = yes; then
15893
15894         # cross-compiling
15895         cat >conftest.$ac_ext <<_ACEOF
15896 #line 15896 "configure"
15897 #include "confdefs.h"
15898
15899 #ifdef HAVE_XCURSES
15900 #include <xcurses.h>
15901 char * XCursesProgramName = "test";
15902 #else
15903 #include <${cf_cv_ncurses_header:-curses.h}>
15904 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
15905 #include <ncursesw/term.h>
15906 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
15907 #include <ncurses/term.h>
15908 #elif defined(HAVE_TERM_H)
15909 #include <term.h>
15910 #endif
15911 #endif
15912
15913 extern char ospeed;
15914 int
15915 main ()
15916 {
15917
15918         do {
15919                 void *foo = &(ospeed);
15920                 fprintf(stderr, "testing linkage of ospeed:%p\n", foo);
15921                 ${cf_cv_main_return:-return}(foo == 0);
15922         } while (0)
15923
15924   ;
15925   return 0;
15926 }
15927 _ACEOF
15928 rm -f conftest.$ac_objext 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); } &&
15934          { ac_try='test -s conftest$ac_exeext'
15935   { (eval echo "$as_me:15935: \"$ac_try\"") >&5
15936   (eval $ac_try) 2>&5
15937   ac_status=$?
15938   echo "$as_me:15938: \$? = $ac_status" >&5
15939   (exit $ac_status); }; }; then
15940   cf_result=yes
15941 else
15942   echo "$as_me: failed program was:" >&5
15943 cat conftest.$ac_ext >&5
15944 cf_result=no
15945 fi
15946 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15947
15948 else
15949   cat >conftest.$ac_ext <<_ACEOF
15950 #line 15950 "configure"
15951 #include "confdefs.h"
15952
15953 #ifdef HAVE_XCURSES
15954 #include <xcurses.h>
15955 char * XCursesProgramName = "test";
15956 #else
15957 #include <${cf_cv_ncurses_header:-curses.h}>
15958 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
15959 #include <ncursesw/term.h>
15960 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
15961 #include <ncurses/term.h>
15962 #elif defined(HAVE_TERM_H)
15963 #include <term.h>
15964 #endif
15965 #endif
15966
15967 extern char ospeed;
15968 int main(void)
15969 {
15970         void *foo = &(ospeed);
15971         fprintf(stderr, "testing linkage of ospeed:%p\n", foo);
15972         ${cf_cv_main_return:-return}(foo == 0);
15973 }
15974 _ACEOF
15975 rm -f conftest$ac_exeext
15976 if { (eval echo "$as_me:15976: \"$ac_link\"") >&5
15977   (eval $ac_link) 2>&5
15978   ac_status=$?
15979   echo "$as_me:15979: \$? = $ac_status" >&5
15980   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
15981   { (eval echo "$as_me:15981: \"$ac_try\"") >&5
15982   (eval $ac_try) 2>&5
15983   ac_status=$?
15984   echo "$as_me:15984: \$? = $ac_status" >&5
15985   (exit $ac_status); }; }; then
15986   cf_result=yes
15987 else
15988   echo "$as_me: program exited with status $ac_status" >&5
15989 echo "$as_me: failed program was:" >&5
15990 cat conftest.$ac_ext >&5
15991 cf_result=no
15992 fi
15993 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
15994 fi
15995         echo "$as_me:15995: result: $cf_result" >&5
15996 echo "${ECHO_T}$cf_result" >&6
15997         if test $cf_result = yes ; then
15998
15999 cf_result=`echo "decl_curses_data_ospeed" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16000
16001                 cat >>confdefs.h <<EOF
16002 #define $cf_result 1
16003 EOF
16004
16005         fi
16006 fi
16007
16008 echo "$as_me:16008: checking for data boolnames declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
16009 echo $ECHO_N "checking for data boolnames declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
16010
16011 cat >conftest.$ac_ext <<_ACEOF
16012 #line 16012 "configure"
16013 #include "confdefs.h"
16014
16015 #ifdef HAVE_XCURSES
16016 #include <xcurses.h>
16017 char * XCursesProgramName = "test";
16018 #else
16019 #include <${cf_cv_ncurses_header:-curses.h}>
16020 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16021 #include <ncursesw/term.h>
16022 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16023 #include <ncurses/term.h>
16024 #elif defined(HAVE_TERM_H)
16025 #include <term.h>
16026 #endif
16027 #endif
16028
16029 int
16030 main ()
16031 {
16032
16033 void *foo = &(boolnames)
16034
16035   ;
16036   return 0;
16037 }
16038 _ACEOF
16039 rm -f conftest.$ac_objext
16040 if { (eval echo "$as_me:16040: \"$ac_compile\"") >&5
16041   (eval $ac_compile) 2>&5
16042   ac_status=$?
16043   echo "$as_me:16043: \$? = $ac_status" >&5
16044   (exit $ac_status); } &&
16045          { ac_try='test -s conftest.$ac_objext'
16046   { (eval echo "$as_me:16046: \"$ac_try\"") >&5
16047   (eval $ac_try) 2>&5
16048   ac_status=$?
16049   echo "$as_me:16049: \$? = $ac_status" >&5
16050   (exit $ac_status); }; }; then
16051   cf_result=yes
16052 else
16053   echo "$as_me: failed program was:" >&5
16054 cat conftest.$ac_ext >&5
16055 cf_result=no
16056 fi
16057 rm -f conftest.$ac_objext conftest.$ac_ext
16058 echo "$as_me:16058: result: $cf_result" >&5
16059 echo "${ECHO_T}$cf_result" >&6
16060
16061 if test $cf_result = yes ; then
16062
16063 cf_result=`echo "have_curses_data_boolnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16064
16065         cat >>confdefs.h <<EOF
16066 #define $cf_result 1
16067 EOF
16068
16069 else
16070         echo "$as_me:16070: checking for data boolnames in library" >&5
16071 echo $ECHO_N "checking for data boolnames in library... $ECHO_C" >&6
16072         # BSD linkers insist on making weak linkage, but resolve at runtime.
16073         if test "$cross_compiling" = yes; then
16074
16075         # cross-compiling
16076         cat >conftest.$ac_ext <<_ACEOF
16077 #line 16077 "configure"
16078 #include "confdefs.h"
16079
16080 #ifdef HAVE_XCURSES
16081 #include <xcurses.h>
16082 char * XCursesProgramName = "test";
16083 #else
16084 #include <${cf_cv_ncurses_header:-curses.h}>
16085 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16086 #include <ncursesw/term.h>
16087 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16088 #include <ncurses/term.h>
16089 #elif defined(HAVE_TERM_H)
16090 #include <term.h>
16091 #endif
16092 #endif
16093
16094 extern char boolnames;
16095 int
16096 main ()
16097 {
16098
16099         do {
16100                 void *foo = &(boolnames);
16101                 fprintf(stderr, "testing linkage of boolnames:%p\n", foo);
16102                 ${cf_cv_main_return:-return}(foo == 0);
16103         } while (0)
16104
16105   ;
16106   return 0;
16107 }
16108 _ACEOF
16109 rm -f conftest.$ac_objext conftest$ac_exeext
16110 if { (eval echo "$as_me:16110: \"$ac_link\"") >&5
16111   (eval $ac_link) 2>&5
16112   ac_status=$?
16113   echo "$as_me:16113: \$? = $ac_status" >&5
16114   (exit $ac_status); } &&
16115          { ac_try='test -s conftest$ac_exeext'
16116   { (eval echo "$as_me:16116: \"$ac_try\"") >&5
16117   (eval $ac_try) 2>&5
16118   ac_status=$?
16119   echo "$as_me:16119: \$? = $ac_status" >&5
16120   (exit $ac_status); }; }; then
16121   cf_result=yes
16122 else
16123   echo "$as_me: failed program was:" >&5
16124 cat conftest.$ac_ext >&5
16125 cf_result=no
16126 fi
16127 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16128
16129 else
16130   cat >conftest.$ac_ext <<_ACEOF
16131 #line 16131 "configure"
16132 #include "confdefs.h"
16133
16134 #ifdef HAVE_XCURSES
16135 #include <xcurses.h>
16136 char * XCursesProgramName = "test";
16137 #else
16138 #include <${cf_cv_ncurses_header:-curses.h}>
16139 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16140 #include <ncursesw/term.h>
16141 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16142 #include <ncurses/term.h>
16143 #elif defined(HAVE_TERM_H)
16144 #include <term.h>
16145 #endif
16146 #endif
16147
16148 extern char boolnames;
16149 int main(void)
16150 {
16151         void *foo = &(boolnames);
16152         fprintf(stderr, "testing linkage of boolnames:%p\n", foo);
16153         ${cf_cv_main_return:-return}(foo == 0);
16154 }
16155 _ACEOF
16156 rm -f conftest$ac_exeext
16157 if { (eval echo "$as_me:16157: \"$ac_link\"") >&5
16158   (eval $ac_link) 2>&5
16159   ac_status=$?
16160   echo "$as_me:16160: \$? = $ac_status" >&5
16161   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
16162   { (eval echo "$as_me:16162: \"$ac_try\"") >&5
16163   (eval $ac_try) 2>&5
16164   ac_status=$?
16165   echo "$as_me:16165: \$? = $ac_status" >&5
16166   (exit $ac_status); }; }; then
16167   cf_result=yes
16168 else
16169   echo "$as_me: program exited with status $ac_status" >&5
16170 echo "$as_me: failed program was:" >&5
16171 cat conftest.$ac_ext >&5
16172 cf_result=no
16173 fi
16174 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
16175 fi
16176         echo "$as_me:16176: result: $cf_result" >&5
16177 echo "${ECHO_T}$cf_result" >&6
16178         if test $cf_result = yes ; then
16179
16180 cf_result=`echo "decl_curses_data_boolnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16181
16182                 cat >>confdefs.h <<EOF
16183 #define $cf_result 1
16184 EOF
16185
16186         fi
16187 fi
16188
16189 echo "$as_me:16189: checking for data boolfnames declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
16190 echo $ECHO_N "checking for data boolfnames declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
16191
16192 cat >conftest.$ac_ext <<_ACEOF
16193 #line 16193 "configure"
16194 #include "confdefs.h"
16195
16196 #ifdef HAVE_XCURSES
16197 #include <xcurses.h>
16198 char * XCursesProgramName = "test";
16199 #else
16200 #include <${cf_cv_ncurses_header:-curses.h}>
16201 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16202 #include <ncursesw/term.h>
16203 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16204 #include <ncurses/term.h>
16205 #elif defined(HAVE_TERM_H)
16206 #include <term.h>
16207 #endif
16208 #endif
16209
16210 int
16211 main ()
16212 {
16213
16214 void *foo = &(boolfnames)
16215
16216   ;
16217   return 0;
16218 }
16219 _ACEOF
16220 rm -f conftest.$ac_objext
16221 if { (eval echo "$as_me:16221: \"$ac_compile\"") >&5
16222   (eval $ac_compile) 2>&5
16223   ac_status=$?
16224   echo "$as_me:16224: \$? = $ac_status" >&5
16225   (exit $ac_status); } &&
16226          { ac_try='test -s conftest.$ac_objext'
16227   { (eval echo "$as_me:16227: \"$ac_try\"") >&5
16228   (eval $ac_try) 2>&5
16229   ac_status=$?
16230   echo "$as_me:16230: \$? = $ac_status" >&5
16231   (exit $ac_status); }; }; then
16232   cf_result=yes
16233 else
16234   echo "$as_me: failed program was:" >&5
16235 cat conftest.$ac_ext >&5
16236 cf_result=no
16237 fi
16238 rm -f conftest.$ac_objext conftest.$ac_ext
16239 echo "$as_me:16239: result: $cf_result" >&5
16240 echo "${ECHO_T}$cf_result" >&6
16241
16242 if test $cf_result = yes ; then
16243
16244 cf_result=`echo "have_curses_data_boolfnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16245
16246         cat >>confdefs.h <<EOF
16247 #define $cf_result 1
16248 EOF
16249
16250 else
16251         echo "$as_me:16251: checking for data boolfnames in library" >&5
16252 echo $ECHO_N "checking for data boolfnames in library... $ECHO_C" >&6
16253         # BSD linkers insist on making weak linkage, but resolve at runtime.
16254         if test "$cross_compiling" = yes; then
16255
16256         # cross-compiling
16257         cat >conftest.$ac_ext <<_ACEOF
16258 #line 16258 "configure"
16259 #include "confdefs.h"
16260
16261 #ifdef HAVE_XCURSES
16262 #include <xcurses.h>
16263 char * XCursesProgramName = "test";
16264 #else
16265 #include <${cf_cv_ncurses_header:-curses.h}>
16266 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16267 #include <ncursesw/term.h>
16268 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16269 #include <ncurses/term.h>
16270 #elif defined(HAVE_TERM_H)
16271 #include <term.h>
16272 #endif
16273 #endif
16274
16275 extern char boolfnames;
16276 int
16277 main ()
16278 {
16279
16280         do {
16281                 void *foo = &(boolfnames);
16282                 fprintf(stderr, "testing linkage of boolfnames:%p\n", foo);
16283                 ${cf_cv_main_return:-return}(foo == 0);
16284         } while (0)
16285
16286   ;
16287   return 0;
16288 }
16289 _ACEOF
16290 rm -f conftest.$ac_objext conftest$ac_exeext
16291 if { (eval echo "$as_me:16291: \"$ac_link\"") >&5
16292   (eval $ac_link) 2>&5
16293   ac_status=$?
16294   echo "$as_me:16294: \$? = $ac_status" >&5
16295   (exit $ac_status); } &&
16296          { ac_try='test -s conftest$ac_exeext'
16297   { (eval echo "$as_me:16297: \"$ac_try\"") >&5
16298   (eval $ac_try) 2>&5
16299   ac_status=$?
16300   echo "$as_me:16300: \$? = $ac_status" >&5
16301   (exit $ac_status); }; }; then
16302   cf_result=yes
16303 else
16304   echo "$as_me: failed program was:" >&5
16305 cat conftest.$ac_ext >&5
16306 cf_result=no
16307 fi
16308 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16309
16310 else
16311   cat >conftest.$ac_ext <<_ACEOF
16312 #line 16312 "configure"
16313 #include "confdefs.h"
16314
16315 #ifdef HAVE_XCURSES
16316 #include <xcurses.h>
16317 char * XCursesProgramName = "test";
16318 #else
16319 #include <${cf_cv_ncurses_header:-curses.h}>
16320 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16321 #include <ncursesw/term.h>
16322 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16323 #include <ncurses/term.h>
16324 #elif defined(HAVE_TERM_H)
16325 #include <term.h>
16326 #endif
16327 #endif
16328
16329 extern char boolfnames;
16330 int main(void)
16331 {
16332         void *foo = &(boolfnames);
16333         fprintf(stderr, "testing linkage of boolfnames:%p\n", foo);
16334         ${cf_cv_main_return:-return}(foo == 0);
16335 }
16336 _ACEOF
16337 rm -f conftest$ac_exeext
16338 if { (eval echo "$as_me:16338: \"$ac_link\"") >&5
16339   (eval $ac_link) 2>&5
16340   ac_status=$?
16341   echo "$as_me:16341: \$? = $ac_status" >&5
16342   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
16343   { (eval echo "$as_me:16343: \"$ac_try\"") >&5
16344   (eval $ac_try) 2>&5
16345   ac_status=$?
16346   echo "$as_me:16346: \$? = $ac_status" >&5
16347   (exit $ac_status); }; }; then
16348   cf_result=yes
16349 else
16350   echo "$as_me: program exited with status $ac_status" >&5
16351 echo "$as_me: failed program was:" >&5
16352 cat conftest.$ac_ext >&5
16353 cf_result=no
16354 fi
16355 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
16356 fi
16357         echo "$as_me:16357: result: $cf_result" >&5
16358 echo "${ECHO_T}$cf_result" >&6
16359         if test $cf_result = yes ; then
16360
16361 cf_result=`echo "decl_curses_data_boolfnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16362
16363                 cat >>confdefs.h <<EOF
16364 #define $cf_result 1
16365 EOF
16366
16367         fi
16368 fi
16369
16370 if ( test "$GCC" = yes || test "$GXX" = yes )
16371 then
16372 echo "$as_me:16372: checking if you want to turn on gcc warnings" >&5
16373 echo $ECHO_N "checking if you want to turn on gcc warnings... $ECHO_C" >&6
16374
16375 # Check whether --enable-warnings or --disable-warnings was given.
16376 if test "${enable_warnings+set}" = set; then
16377   enableval="$enable_warnings"
16378   test "$enableval" != yes && enableval=no
16379         if test "$enableval" != "no" ; then
16380     with_warnings=yes
16381         else
16382                 with_warnings=no
16383         fi
16384 else
16385   enableval=no
16386         with_warnings=no
16387
16388 fi;
16389 echo "$as_me:16389: result: $with_warnings" >&5
16390 echo "${ECHO_T}$with_warnings" >&6
16391 if test "$with_warnings" = "yes"
16392 then
16393
16394 if test "$GCC" = yes
16395 then
16396 cat > conftest.i <<EOF
16397 #ifndef GCC_PRINTF
16398 #define GCC_PRINTF 0
16399 #endif
16400 #ifndef GCC_SCANF
16401 #define GCC_SCANF 0
16402 #endif
16403 #ifndef GCC_NORETURN
16404 #define GCC_NORETURN /* nothing */
16405 #endif
16406 #ifndef GCC_UNUSED
16407 #define GCC_UNUSED /* nothing */
16408 #endif
16409 EOF
16410 if test "$GCC" = yes
16411 then
16412         { echo "$as_me:16412: checking for $CC __attribute__ directives..." >&5
16413 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
16414 cat > conftest.$ac_ext <<EOF
16415 #line 16415 "${as_me:-configure}"
16416 #include "confdefs.h"
16417 #include "conftest.h"
16418 #include "conftest.i"
16419 #if     GCC_PRINTF
16420 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
16421 #else
16422 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
16423 #endif
16424 #if     GCC_SCANF
16425 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
16426 #else
16427 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
16428 #endif
16429 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
16430 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
16431 extern void foo(void) GCC_NORETURN;
16432 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
16433 EOF
16434         cf_printf_attribute=no
16435         cf_scanf_attribute=no
16436         for cf_attribute in scanf printf unused noreturn
16437         do
16438
16439 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16440
16441                 cf_directive="__attribute__(($cf_attribute))"
16442                 echo "checking for $CC $cf_directive" 1>&5
16443
16444                 case $cf_attribute in
16445                 (printf)
16446                         cf_printf_attribute=yes
16447                         cat >conftest.h <<EOF
16448 #define GCC_$cf_ATTRIBUTE 1
16449 EOF
16450                         ;;
16451                 (scanf)
16452                         cf_scanf_attribute=yes
16453                         cat >conftest.h <<EOF
16454 #define GCC_$cf_ATTRIBUTE 1
16455 EOF
16456                         ;;
16457                 (*)
16458                         cat >conftest.h <<EOF
16459 #define GCC_$cf_ATTRIBUTE $cf_directive
16460 EOF
16461                         ;;
16462                 esac
16463
16464                 if { (eval echo "$as_me:16464: \"$ac_compile\"") >&5
16465   (eval $ac_compile) 2>&5
16466   ac_status=$?
16467   echo "$as_me:16467: \$? = $ac_status" >&5
16468   (exit $ac_status); }; then
16469                         test -n "$verbose" && echo "$as_me:16469: result: ... $cf_attribute" >&5
16470 echo "${ECHO_T}... $cf_attribute" >&6
16471                         cat conftest.h >>confdefs.h
16472                         case $cf_attribute in
16473                         (noreturn)
16474
16475 cat >>confdefs.h <<EOF
16476 #define GCC_NORETURN $cf_directive
16477 EOF
16478
16479                                 ;;
16480                         (printf)
16481                                 cf_value='/* nothing */'
16482                                 if test "$cf_printf_attribute" != no ; then
16483                                         cf_value='__attribute__((format(printf,fmt,var)))'
16484
16485 cat >>confdefs.h <<\EOF
16486 #define GCC_PRINTF 1
16487 EOF
16488
16489                                 fi
16490
16491 cat >>confdefs.h <<EOF
16492 #define GCC_PRINTFLIKE(fmt,var) $cf_value
16493 EOF
16494
16495                                 ;;
16496                         (scanf)
16497                                 cf_value='/* nothing */'
16498                                 if test "$cf_scanf_attribute" != no ; then
16499                                         cf_value='__attribute__((format(scanf,fmt,var)))'
16500
16501 cat >>confdefs.h <<\EOF
16502 #define GCC_SCANF 1
16503 EOF
16504
16505                                 fi
16506
16507 cat >>confdefs.h <<EOF
16508 #define GCC_SCANFLIKE(fmt,var) $cf_value
16509 EOF
16510
16511                                 ;;
16512                         (unused)
16513
16514 cat >>confdefs.h <<EOF
16515 #define GCC_UNUSED $cf_directive
16516 EOF
16517
16518                                 ;;
16519                         esac
16520                 fi
16521         done
16522 else
16523         fgrep define conftest.i >>confdefs.h
16524 fi
16525 rm -rf conftest*
16526 fi
16527
16528 INTEL_COMPILER=no
16529
16530 if test "$GCC" = yes ; then
16531         case $host_os in
16532         (linux*|gnu*)
16533                 echo "$as_me:16533: checking if this is really Intel C compiler" >&5
16534 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
16535                 cf_save_CFLAGS="$CFLAGS"
16536                 CFLAGS="$CFLAGS -no-gcc"
16537                 cat >conftest.$ac_ext <<_ACEOF
16538 #line 16538 "configure"
16539 #include "confdefs.h"
16540
16541 int
16542 main ()
16543 {
16544
16545 #ifdef __INTEL_COMPILER
16546 #else
16547 make an error
16548 #endif
16549
16550   ;
16551   return 0;
16552 }
16553 _ACEOF
16554 rm -f conftest.$ac_objext
16555 if { (eval echo "$as_me:16555: \"$ac_compile\"") >&5
16556   (eval $ac_compile) 2>&5
16557   ac_status=$?
16558   echo "$as_me:16558: \$? = $ac_status" >&5
16559   (exit $ac_status); } &&
16560          { ac_try='test -s conftest.$ac_objext'
16561   { (eval echo "$as_me:16561: \"$ac_try\"") >&5
16562   (eval $ac_try) 2>&5
16563   ac_status=$?
16564   echo "$as_me:16564: \$? = $ac_status" >&5
16565   (exit $ac_status); }; }; then
16566   INTEL_COMPILER=yes
16567 cf_save_CFLAGS="$cf_save_CFLAGS -we147"
16568
16569 else
16570   echo "$as_me: failed program was:" >&5
16571 cat conftest.$ac_ext >&5
16572 fi
16573 rm -f conftest.$ac_objext conftest.$ac_ext
16574                 CFLAGS="$cf_save_CFLAGS"
16575                 echo "$as_me:16575: result: $INTEL_COMPILER" >&5
16576 echo "${ECHO_T}$INTEL_COMPILER" >&6
16577                 ;;
16578         esac
16579 fi
16580
16581 CLANG_COMPILER=no
16582
16583 if test "$GCC" = yes ; then
16584         echo "$as_me:16584: checking if this is really Clang C compiler" >&5
16585 echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6
16586         cf_save_CFLAGS="$CFLAGS"
16587         CFLAGS="$CFLAGS -Qunused-arguments"
16588         cat >conftest.$ac_ext <<_ACEOF
16589 #line 16589 "configure"
16590 #include "confdefs.h"
16591
16592 int
16593 main ()
16594 {
16595
16596 #ifdef __clang__
16597 #else
16598 make an error
16599 #endif
16600
16601   ;
16602   return 0;
16603 }
16604 _ACEOF
16605 rm -f conftest.$ac_objext
16606 if { (eval echo "$as_me:16606: \"$ac_compile\"") >&5
16607   (eval $ac_compile) 2>&5
16608   ac_status=$?
16609   echo "$as_me:16609: \$? = $ac_status" >&5
16610   (exit $ac_status); } &&
16611          { ac_try='test -s conftest.$ac_objext'
16612   { (eval echo "$as_me:16612: \"$ac_try\"") >&5
16613   (eval $ac_try) 2>&5
16614   ac_status=$?
16615   echo "$as_me:16615: \$? = $ac_status" >&5
16616   (exit $ac_status); }; }; then
16617   CLANG_COMPILER=yes
16618 cf_save_CFLAGS="$cf_save_CFLAGS -Qunused-arguments"
16619
16620 else
16621   echo "$as_me: failed program was:" >&5
16622 cat conftest.$ac_ext >&5
16623 fi
16624 rm -f conftest.$ac_objext conftest.$ac_ext
16625         CFLAGS="$cf_save_CFLAGS"
16626         echo "$as_me:16626: result: $CLANG_COMPILER" >&5
16627 echo "${ECHO_T}$CLANG_COMPILER" >&6
16628 fi
16629
16630 cat > conftest.$ac_ext <<EOF
16631 #line 16631 "${as_me:-configure}"
16632 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
16633 EOF
16634
16635 if test "$INTEL_COMPILER" = yes
16636 then
16637 # The "-wdXXX" options suppress warnings:
16638 # remark #1419: external declaration in primary source file
16639 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
16640 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
16641 # remark #193: zero used for undefined preprocessing identifier
16642 # remark #593: variable "curs_sb_left_arrow" was set but never used
16643 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
16644 # remark #869: parameter "tw" was never referenced
16645 # remark #981: operands are evaluated in unspecified order
16646 # warning #279: controlling expression is constant
16647
16648         { echo "$as_me:16648: checking for $CC warning options..." >&5
16649 echo "$as_me: checking for $CC warning options..." >&6;}
16650         cf_save_CFLAGS="$CFLAGS"
16651         EXTRA_CFLAGS="-Wall"
16652         for cf_opt in \
16653                 wd1419 \
16654                 wd1683 \
16655                 wd1684 \
16656                 wd193 \
16657                 wd593 \
16658                 wd279 \
16659                 wd810 \
16660                 wd869 \
16661                 wd981
16662         do
16663                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
16664                 if { (eval echo "$as_me:16664: \"$ac_compile\"") >&5
16665   (eval $ac_compile) 2>&5
16666   ac_status=$?
16667   echo "$as_me:16667: \$? = $ac_status" >&5
16668   (exit $ac_status); }; then
16669                         test -n "$verbose" && echo "$as_me:16669: result: ... -$cf_opt" >&5
16670 echo "${ECHO_T}... -$cf_opt" >&6
16671                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
16672                 fi
16673         done
16674         CFLAGS="$cf_save_CFLAGS"
16675
16676 elif test "$GCC" = yes
16677 then
16678         { echo "$as_me:16678: checking for $CC warning options..." >&5
16679 echo "$as_me: checking for $CC warning options..." >&6;}
16680         cf_save_CFLAGS="$CFLAGS"
16681         EXTRA_CFLAGS=
16682         cf_warn_CONST=""
16683         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
16684         cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
16685         test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
16686         for cf_opt in W Wall \
16687                 Wbad-function-cast \
16688                 Wcast-align \
16689                 Wcast-qual \
16690                 Wdeclaration-after-statement \
16691                 Wextra \
16692                 Winline \
16693                 Wmissing-declarations \
16694                 Wmissing-prototypes \
16695                 Wnested-externs \
16696                 Wpointer-arith \
16697                 Wshadow \
16698                 Wstrict-prototypes \
16699                 Wundef $cf_gcc_warnings $cf_warn_CONST
16700         do
16701                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
16702                 if { (eval echo "$as_me:16702: \"$ac_compile\"") >&5
16703   (eval $ac_compile) 2>&5
16704   ac_status=$?
16705   echo "$as_me:16705: \$? = $ac_status" >&5
16706   (exit $ac_status); }; then
16707                         test -n "$verbose" && echo "$as_me:16707: result: ... -$cf_opt" >&5
16708 echo "${ECHO_T}... -$cf_opt" >&6
16709                         case $cf_opt in
16710                         (Wcast-qual)
16711                                 CPPFLAGS="$CPPFLAGS -DXTSTRINGDEFINES"
16712                                 ;;
16713                         (Winline)
16714                                 case $GCC_VERSION in
16715                                 ([34].*)
16716                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
16717
16718 echo "${as_me:-configure}:16718: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
16719
16720                                         continue;;
16721                                 esac
16722                                 ;;
16723                         (Wpointer-arith)
16724                                 case $GCC_VERSION in
16725                                 ([12].*)
16726                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
16727
16728 echo "${as_me:-configure}:16728: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
16729
16730                                         continue;;
16731                                 esac
16732                                 ;;
16733                         esac
16734                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
16735                 fi
16736         done
16737         CFLAGS="$cf_save_CFLAGS"
16738 fi
16739 rm -rf conftest*
16740
16741 fi
16742 fi
16743
16744 echo "$as_me:16744: checking if you want to use dmalloc for testing" >&5
16745 echo $ECHO_N "checking if you want to use dmalloc for testing... $ECHO_C" >&6
16746
16747 # Check whether --with-dmalloc or --without-dmalloc was given.
16748 if test "${with_dmalloc+set}" = set; then
16749   withval="$with_dmalloc"
16750
16751 cat >>confdefs.h <<EOF
16752 #define USE_DMALLOC 1
16753 EOF
16754
16755         : ${with_cflags:=-g}
16756         : ${with_no_leaks:=yes}
16757          with_dmalloc=yes
16758 else
16759   with_dmalloc=
16760 fi;
16761 echo "$as_me:16761: result: ${with_dmalloc:-no}" >&5
16762 echo "${ECHO_T}${with_dmalloc:-no}" >&6
16763
16764 case .$with_cflags in
16765 (.*-g*)
16766         case .$CFLAGS in
16767         (.*-g*)
16768                 ;;
16769         (*)
16770
16771 cf_fix_cppflags=no
16772 cf_new_cflags=
16773 cf_new_cppflags=
16774 cf_new_extra_cppflags=
16775
16776 for cf_add_cflags in -g
16777 do
16778 case $cf_fix_cppflags in
16779 (no)
16780         case $cf_add_cflags in
16781         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
16782                 case $cf_add_cflags in
16783                 (-D*)
16784                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
16785
16786                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16787                                 && test -z "${cf_tst_cflags}" \
16788                                 && cf_fix_cppflags=yes
16789
16790                         if test $cf_fix_cppflags = yes ; then
16791                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
16792                                 continue
16793                         elif test "${cf_tst_cflags}" = "\"'" ; then
16794                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
16795                                 continue
16796                         fi
16797                         ;;
16798                 esac
16799                 case "$CPPFLAGS" in
16800                 (*$cf_add_cflags)
16801                         ;;
16802                 (*)
16803                         case $cf_add_cflags in
16804                         (-D*)
16805                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
16806
16807 CPPFLAGS=`echo "$CPPFLAGS" | \
16808         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
16809                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
16810
16811                                 ;;
16812                         esac
16813                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
16814                         ;;
16815                 esac
16816                 ;;
16817         (*)
16818                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
16819                 ;;
16820         esac
16821         ;;
16822 (yes)
16823         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
16824
16825         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
16826
16827         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16828                 && test -z "${cf_tst_cflags}" \
16829                 && cf_fix_cppflags=no
16830         ;;
16831 esac
16832 done
16833
16834 if test -n "$cf_new_cflags" ; then
16835
16836         CFLAGS="$CFLAGS $cf_new_cflags"
16837 fi
16838
16839 if test -n "$cf_new_cppflags" ; then
16840
16841         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
16842 fi
16843
16844 if test -n "$cf_new_extra_cppflags" ; then
16845
16846         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
16847 fi
16848
16849                 ;;
16850         esac
16851         ;;
16852 esac
16853
16854 if test "$with_dmalloc" = yes ; then
16855         echo "$as_me:16855: checking for dmalloc.h" >&5
16856 echo $ECHO_N "checking for dmalloc.h... $ECHO_C" >&6
16857 if test "${ac_cv_header_dmalloc_h+set}" = set; then
16858   echo $ECHO_N "(cached) $ECHO_C" >&6
16859 else
16860   cat >conftest.$ac_ext <<_ACEOF
16861 #line 16861 "configure"
16862 #include "confdefs.h"
16863 #include <dmalloc.h>
16864 _ACEOF
16865 if { (eval echo "$as_me:16865: \"$ac_cpp conftest.$ac_ext\"") >&5
16866   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
16867   ac_status=$?
16868   egrep -v '^ *\+' conftest.er1 >conftest.err
16869   rm -f conftest.er1
16870   cat conftest.err >&5
16871   echo "$as_me:16871: \$? = $ac_status" >&5
16872   (exit $ac_status); } >/dev/null; then
16873   if test -s conftest.err; then
16874     ac_cpp_err=$ac_c_preproc_warn_flag
16875   else
16876     ac_cpp_err=
16877   fi
16878 else
16879   ac_cpp_err=yes
16880 fi
16881 if test -z "$ac_cpp_err"; then
16882   ac_cv_header_dmalloc_h=yes
16883 else
16884   echo "$as_me: failed program was:" >&5
16885   cat conftest.$ac_ext >&5
16886   ac_cv_header_dmalloc_h=no
16887 fi
16888 rm -f conftest.err conftest.$ac_ext
16889 fi
16890 echo "$as_me:16890: result: $ac_cv_header_dmalloc_h" >&5
16891 echo "${ECHO_T}$ac_cv_header_dmalloc_h" >&6
16892 if test $ac_cv_header_dmalloc_h = yes; then
16893
16894 echo "$as_me:16894: checking for dmalloc_debug in -ldmalloc" >&5
16895 echo $ECHO_N "checking for dmalloc_debug in -ldmalloc... $ECHO_C" >&6
16896 if test "${ac_cv_lib_dmalloc_dmalloc_debug+set}" = set; then
16897   echo $ECHO_N "(cached) $ECHO_C" >&6
16898 else
16899   ac_check_lib_save_LIBS=$LIBS
16900 LIBS="-ldmalloc  $LIBS"
16901 cat >conftest.$ac_ext <<_ACEOF
16902 #line 16902 "configure"
16903 #include "confdefs.h"
16904
16905 /* Override any gcc2 internal prototype to avoid an error.  */
16906 #ifdef __cplusplus
16907 extern "C"
16908 #endif
16909 /* We use char because int might match the return type of a gcc2
16910    builtin and then its argument prototype would still apply.  */
16911 char dmalloc_debug ();
16912 int
16913 main ()
16914 {
16915 dmalloc_debug ();
16916   ;
16917   return 0;
16918 }
16919 _ACEOF
16920 rm -f conftest.$ac_objext conftest$ac_exeext
16921 if { (eval echo "$as_me:16921: \"$ac_link\"") >&5
16922   (eval $ac_link) 2>&5
16923   ac_status=$?
16924   echo "$as_me:16924: \$? = $ac_status" >&5
16925   (exit $ac_status); } &&
16926          { ac_try='test -s conftest$ac_exeext'
16927   { (eval echo "$as_me:16927: \"$ac_try\"") >&5
16928   (eval $ac_try) 2>&5
16929   ac_status=$?
16930   echo "$as_me:16930: \$? = $ac_status" >&5
16931   (exit $ac_status); }; }; then
16932   ac_cv_lib_dmalloc_dmalloc_debug=yes
16933 else
16934   echo "$as_me: failed program was:" >&5
16935 cat conftest.$ac_ext >&5
16936 ac_cv_lib_dmalloc_dmalloc_debug=no
16937 fi
16938 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16939 LIBS=$ac_check_lib_save_LIBS
16940 fi
16941 echo "$as_me:16941: result: $ac_cv_lib_dmalloc_dmalloc_debug" >&5
16942 echo "${ECHO_T}$ac_cv_lib_dmalloc_dmalloc_debug" >&6
16943 if test $ac_cv_lib_dmalloc_dmalloc_debug = yes; then
16944   cat >>confdefs.h <<EOF
16945 #define HAVE_LIBDMALLOC 1
16946 EOF
16947
16948   LIBS="-ldmalloc $LIBS"
16949
16950 fi
16951
16952 fi
16953
16954 fi
16955
16956 echo "$as_me:16956: checking if you want to use dbmalloc for testing" >&5
16957 echo $ECHO_N "checking if you want to use dbmalloc for testing... $ECHO_C" >&6
16958
16959 # Check whether --with-dbmalloc or --without-dbmalloc was given.
16960 if test "${with_dbmalloc+set}" = set; then
16961   withval="$with_dbmalloc"
16962
16963 cat >>confdefs.h <<EOF
16964 #define USE_DBMALLOC 1
16965 EOF
16966
16967         : ${with_cflags:=-g}
16968         : ${with_no_leaks:=yes}
16969          with_dbmalloc=yes
16970 else
16971   with_dbmalloc=
16972 fi;
16973 echo "$as_me:16973: result: ${with_dbmalloc:-no}" >&5
16974 echo "${ECHO_T}${with_dbmalloc:-no}" >&6
16975
16976 case .$with_cflags in
16977 (.*-g*)
16978         case .$CFLAGS in
16979         (.*-g*)
16980                 ;;
16981         (*)
16982
16983 cf_fix_cppflags=no
16984 cf_new_cflags=
16985 cf_new_cppflags=
16986 cf_new_extra_cppflags=
16987
16988 for cf_add_cflags in -g
16989 do
16990 case $cf_fix_cppflags in
16991 (no)
16992         case $cf_add_cflags in
16993         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
16994                 case $cf_add_cflags in
16995                 (-D*)
16996                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
16997
16998                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16999                                 && test -z "${cf_tst_cflags}" \
17000                                 && cf_fix_cppflags=yes
17001
17002                         if test $cf_fix_cppflags = yes ; then
17003                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
17004                                 continue
17005                         elif test "${cf_tst_cflags}" = "\"'" ; then
17006                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
17007                                 continue
17008                         fi
17009                         ;;
17010                 esac
17011                 case "$CPPFLAGS" in
17012                 (*$cf_add_cflags)
17013                         ;;
17014                 (*)
17015                         case $cf_add_cflags in
17016                         (-D*)
17017                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
17018
17019 CPPFLAGS=`echo "$CPPFLAGS" | \
17020         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
17021                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
17022
17023                                 ;;
17024                         esac
17025                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
17026                         ;;
17027                 esac
17028                 ;;
17029         (*)
17030                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
17031                 ;;
17032         esac
17033         ;;
17034 (yes)
17035         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
17036
17037         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
17038
17039         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17040                 && test -z "${cf_tst_cflags}" \
17041                 && cf_fix_cppflags=no
17042         ;;
17043 esac
17044 done
17045
17046 if test -n "$cf_new_cflags" ; then
17047
17048         CFLAGS="$CFLAGS $cf_new_cflags"
17049 fi
17050
17051 if test -n "$cf_new_cppflags" ; then
17052
17053         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
17054 fi
17055
17056 if test -n "$cf_new_extra_cppflags" ; then
17057
17058         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
17059 fi
17060
17061                 ;;
17062         esac
17063         ;;
17064 esac
17065
17066 if test "$with_dbmalloc" = yes ; then
17067         echo "$as_me:17067: checking for dbmalloc.h" >&5
17068 echo $ECHO_N "checking for dbmalloc.h... $ECHO_C" >&6
17069 if test "${ac_cv_header_dbmalloc_h+set}" = set; then
17070   echo $ECHO_N "(cached) $ECHO_C" >&6
17071 else
17072   cat >conftest.$ac_ext <<_ACEOF
17073 #line 17073 "configure"
17074 #include "confdefs.h"
17075 #include <dbmalloc.h>
17076 _ACEOF
17077 if { (eval echo "$as_me:17077: \"$ac_cpp conftest.$ac_ext\"") >&5
17078   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
17079   ac_status=$?
17080   egrep -v '^ *\+' conftest.er1 >conftest.err
17081   rm -f conftest.er1
17082   cat conftest.err >&5
17083   echo "$as_me:17083: \$? = $ac_status" >&5
17084   (exit $ac_status); } >/dev/null; then
17085   if test -s conftest.err; then
17086     ac_cpp_err=$ac_c_preproc_warn_flag
17087   else
17088     ac_cpp_err=
17089   fi
17090 else
17091   ac_cpp_err=yes
17092 fi
17093 if test -z "$ac_cpp_err"; then
17094   ac_cv_header_dbmalloc_h=yes
17095 else
17096   echo "$as_me: failed program was:" >&5
17097   cat conftest.$ac_ext >&5
17098   ac_cv_header_dbmalloc_h=no
17099 fi
17100 rm -f conftest.err conftest.$ac_ext
17101 fi
17102 echo "$as_me:17102: result: $ac_cv_header_dbmalloc_h" >&5
17103 echo "${ECHO_T}$ac_cv_header_dbmalloc_h" >&6
17104 if test $ac_cv_header_dbmalloc_h = yes; then
17105
17106 echo "$as_me:17106: checking for debug_malloc in -ldbmalloc" >&5
17107 echo $ECHO_N "checking for debug_malloc in -ldbmalloc... $ECHO_C" >&6
17108 if test "${ac_cv_lib_dbmalloc_debug_malloc+set}" = set; then
17109   echo $ECHO_N "(cached) $ECHO_C" >&6
17110 else
17111   ac_check_lib_save_LIBS=$LIBS
17112 LIBS="-ldbmalloc  $LIBS"
17113 cat >conftest.$ac_ext <<_ACEOF
17114 #line 17114 "configure"
17115 #include "confdefs.h"
17116
17117 /* Override any gcc2 internal prototype to avoid an error.  */
17118 #ifdef __cplusplus
17119 extern "C"
17120 #endif
17121 /* We use char because int might match the return type of a gcc2
17122    builtin and then its argument prototype would still apply.  */
17123 char debug_malloc ();
17124 int
17125 main ()
17126 {
17127 debug_malloc ();
17128   ;
17129   return 0;
17130 }
17131 _ACEOF
17132 rm -f conftest.$ac_objext conftest$ac_exeext
17133 if { (eval echo "$as_me:17133: \"$ac_link\"") >&5
17134   (eval $ac_link) 2>&5
17135   ac_status=$?
17136   echo "$as_me:17136: \$? = $ac_status" >&5
17137   (exit $ac_status); } &&
17138          { ac_try='test -s conftest$ac_exeext'
17139   { (eval echo "$as_me:17139: \"$ac_try\"") >&5
17140   (eval $ac_try) 2>&5
17141   ac_status=$?
17142   echo "$as_me:17142: \$? = $ac_status" >&5
17143   (exit $ac_status); }; }; then
17144   ac_cv_lib_dbmalloc_debug_malloc=yes
17145 else
17146   echo "$as_me: failed program was:" >&5
17147 cat conftest.$ac_ext >&5
17148 ac_cv_lib_dbmalloc_debug_malloc=no
17149 fi
17150 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17151 LIBS=$ac_check_lib_save_LIBS
17152 fi
17153 echo "$as_me:17153: result: $ac_cv_lib_dbmalloc_debug_malloc" >&5
17154 echo "${ECHO_T}$ac_cv_lib_dbmalloc_debug_malloc" >&6
17155 if test $ac_cv_lib_dbmalloc_debug_malloc = yes; then
17156   cat >>confdefs.h <<EOF
17157 #define HAVE_LIBDBMALLOC 1
17158 EOF
17159
17160   LIBS="-ldbmalloc $LIBS"
17161
17162 fi
17163
17164 fi
17165
17166 fi
17167
17168 echo "$as_me:17168: checking if you want to use valgrind for testing" >&5
17169 echo $ECHO_N "checking if you want to use valgrind for testing... $ECHO_C" >&6
17170
17171 # Check whether --with-valgrind or --without-valgrind was given.
17172 if test "${with_valgrind+set}" = set; then
17173   withval="$with_valgrind"
17174
17175 cat >>confdefs.h <<EOF
17176 #define USE_VALGRIND 1
17177 EOF
17178
17179         : ${with_cflags:=-g}
17180         : ${with_no_leaks:=yes}
17181          with_valgrind=yes
17182 else
17183   with_valgrind=
17184 fi;
17185 echo "$as_me:17185: result: ${with_valgrind:-no}" >&5
17186 echo "${ECHO_T}${with_valgrind:-no}" >&6
17187
17188 case .$with_cflags in
17189 (.*-g*)
17190         case .$CFLAGS in
17191         (.*-g*)
17192                 ;;
17193         (*)
17194
17195 cf_fix_cppflags=no
17196 cf_new_cflags=
17197 cf_new_cppflags=
17198 cf_new_extra_cppflags=
17199
17200 for cf_add_cflags in -g
17201 do
17202 case $cf_fix_cppflags in
17203 (no)
17204         case $cf_add_cflags in
17205         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
17206                 case $cf_add_cflags in
17207                 (-D*)
17208                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
17209
17210                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17211                                 && test -z "${cf_tst_cflags}" \
17212                                 && cf_fix_cppflags=yes
17213
17214                         if test $cf_fix_cppflags = yes ; then
17215                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
17216                                 continue
17217                         elif test "${cf_tst_cflags}" = "\"'" ; then
17218                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
17219                                 continue
17220                         fi
17221                         ;;
17222                 esac
17223                 case "$CPPFLAGS" in
17224                 (*$cf_add_cflags)
17225                         ;;
17226                 (*)
17227                         case $cf_add_cflags in
17228                         (-D*)
17229                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
17230
17231 CPPFLAGS=`echo "$CPPFLAGS" | \
17232         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
17233                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
17234
17235                                 ;;
17236                         esac
17237                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
17238                         ;;
17239                 esac
17240                 ;;
17241         (*)
17242                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
17243                 ;;
17244         esac
17245         ;;
17246 (yes)
17247         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
17248
17249         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
17250
17251         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17252                 && test -z "${cf_tst_cflags}" \
17253                 && cf_fix_cppflags=no
17254         ;;
17255 esac
17256 done
17257
17258 if test -n "$cf_new_cflags" ; then
17259
17260         CFLAGS="$CFLAGS $cf_new_cflags"
17261 fi
17262
17263 if test -n "$cf_new_cppflags" ; then
17264
17265         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
17266 fi
17267
17268 if test -n "$cf_new_extra_cppflags" ; then
17269
17270         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
17271 fi
17272
17273                 ;;
17274         esac
17275         ;;
17276 esac
17277
17278 echo "$as_me:17278: checking if you want to perform memory-leak testing" >&5
17279 echo $ECHO_N "checking if you want to perform memory-leak testing... $ECHO_C" >&6
17280
17281 # Check whether --enable-leaks or --disable-leaks was given.
17282 if test "${enable_leaks+set}" = set; then
17283   enableval="$enable_leaks"
17284   if test "x$enableval" = xno; then with_no_leaks=yes; else with_no_leaks=no; fi
17285 else
17286   : ${with_no_leaks:=no}
17287 fi;
17288 echo "$as_me:17288: result: $with_no_leaks" >&5
17289 echo "${ECHO_T}$with_no_leaks" >&6
17290
17291 if test "$with_no_leaks" = yes ; then
17292
17293 cat >>confdefs.h <<\EOF
17294 #define NO_LEAKS 1
17295 EOF
17296
17297 cat >>confdefs.h <<\EOF
17298 #define YY_NO_LEAKS 1
17299 EOF
17300
17301 fi
17302
17303 LD_RPATH_OPT=
17304 echo "$as_me:17304: checking for an rpath option" >&5
17305 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
17306 case $cf_cv_system_name in
17307 (irix*)
17308         if test "$GCC" = yes; then
17309                 LD_RPATH_OPT="-Wl,-rpath,"
17310         else
17311                 LD_RPATH_OPT="-rpath "
17312         fi
17313         ;;
17314 (linux*|gnu*|k*bsd*-gnu)
17315         LD_RPATH_OPT="-Wl,-rpath,"
17316         ;;
17317 (openbsd[2-9].*|mirbsd*)
17318         LD_RPATH_OPT="-Wl,-rpath,"
17319         ;;
17320 (dragonfly*|freebsd*)
17321         LD_RPATH_OPT="-rpath "
17322         ;;
17323 (netbsd*)
17324         LD_RPATH_OPT="-Wl,-rpath,"
17325         ;;
17326 (osf*|mls+*)
17327         LD_RPATH_OPT="-rpath "
17328         ;;
17329 (solaris2*)
17330         LD_RPATH_OPT="-R"
17331         ;;
17332 (*)
17333         ;;
17334 esac
17335 echo "$as_me:17335: result: $LD_RPATH_OPT" >&5
17336 echo "${ECHO_T}$LD_RPATH_OPT" >&6
17337
17338 case "x$LD_RPATH_OPT" in
17339 (x-R*)
17340         echo "$as_me:17340: checking if we need a space after rpath option" >&5
17341 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
17342         cf_save_LIBS="$LIBS"
17343
17344 cf_add_libs="${LD_RPATH_OPT}$libdir"
17345 # Filter out duplicates - this happens with badly-designed ".pc" files...
17346 for cf_add_1lib in $LIBS
17347 do
17348         for cf_add_2lib in $cf_add_libs
17349         do
17350                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
17351                 then
17352                         cf_add_1lib=
17353                         break
17354                 fi
17355         done
17356         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
17357 done
17358 LIBS="$cf_add_libs"
17359
17360         cat >conftest.$ac_ext <<_ACEOF
17361 #line 17361 "configure"
17362 #include "confdefs.h"
17363
17364 int
17365 main ()
17366 {
17367
17368   ;
17369   return 0;
17370 }
17371 _ACEOF
17372 rm -f conftest.$ac_objext conftest$ac_exeext
17373 if { (eval echo "$as_me:17373: \"$ac_link\"") >&5
17374   (eval $ac_link) 2>&5
17375   ac_status=$?
17376   echo "$as_me:17376: \$? = $ac_status" >&5
17377   (exit $ac_status); } &&
17378          { ac_try='test -s conftest$ac_exeext'
17379   { (eval echo "$as_me:17379: \"$ac_try\"") >&5
17380   (eval $ac_try) 2>&5
17381   ac_status=$?
17382   echo "$as_me:17382: \$? = $ac_status" >&5
17383   (exit $ac_status); }; }; then
17384   cf_rpath_space=no
17385 else
17386   echo "$as_me: failed program was:" >&5
17387 cat conftest.$ac_ext >&5
17388 cf_rpath_space=yes
17389 fi
17390 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17391         LIBS="$cf_save_LIBS"
17392         echo "$as_me:17392: result: $cf_rpath_space" >&5
17393 echo "${ECHO_T}$cf_rpath_space" >&6
17394         test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
17395         ;;
17396 esac
17397
17398 echo "$as_me:17398: checking if rpath-hack should be disabled" >&5
17399 echo $ECHO_N "checking if rpath-hack should be disabled... $ECHO_C" >&6
17400
17401 # Check whether --enable-rpath-hack or --disable-rpath-hack was given.
17402 if test "${enable_rpath_hack+set}" = set; then
17403   enableval="$enable_rpath_hack"
17404   test "$enableval" != no && enableval=yes
17405         if test "$enableval" != "yes" ; then
17406     cf_disable_rpath_hack=yes
17407         else
17408                 cf_disable_rpath_hack=no
17409         fi
17410 else
17411   enableval=yes
17412         cf_disable_rpath_hack=no
17413
17414 fi;
17415 echo "$as_me:17415: result: $cf_disable_rpath_hack" >&5
17416 echo "${ECHO_T}$cf_disable_rpath_hack" >&6
17417 if test "$cf_disable_rpath_hack" = no ; then
17418
17419 echo "$as_me:17419: checking for updated LDFLAGS" >&5
17420 echo $ECHO_N "checking for updated LDFLAGS... $ECHO_C" >&6
17421 if test -n "$LD_RPATH_OPT" ; then
17422         echo "$as_me:17422: result: maybe" >&5
17423 echo "${ECHO_T}maybe" >&6
17424
17425         for ac_prog in ldd
17426 do
17427   # Extract the first word of "$ac_prog", so it can be a program name with args.
17428 set dummy $ac_prog; ac_word=$2
17429 echo "$as_me:17429: checking for $ac_word" >&5
17430 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
17431 if test "${ac_cv_prog_cf_ldd_prog+set}" = set; then
17432   echo $ECHO_N "(cached) $ECHO_C" >&6
17433 else
17434   if test -n "$cf_ldd_prog"; then
17435   ac_cv_prog_cf_ldd_prog="$cf_ldd_prog" # Let the user override the test.
17436 else
17437   ac_save_IFS=$IFS; IFS=$ac_path_separator
17438 ac_dummy="$PATH"
17439 for ac_dir in $ac_dummy; do
17440   IFS=$ac_save_IFS
17441   test -z "$ac_dir" && ac_dir=.
17442   $as_executable_p "$ac_dir/$ac_word" || continue
17443 ac_cv_prog_cf_ldd_prog="$ac_prog"
17444 echo "$as_me:17444: found $ac_dir/$ac_word" >&5
17445 break
17446 done
17447
17448 fi
17449 fi
17450 cf_ldd_prog=$ac_cv_prog_cf_ldd_prog
17451 if test -n "$cf_ldd_prog"; then
17452   echo "$as_me:17452: result: $cf_ldd_prog" >&5
17453 echo "${ECHO_T}$cf_ldd_prog" >&6
17454 else
17455   echo "$as_me:17455: result: no" >&5
17456 echo "${ECHO_T}no" >&6
17457 fi
17458
17459   test -n "$cf_ldd_prog" && break
17460 done
17461 test -n "$cf_ldd_prog" || cf_ldd_prog="no"
17462
17463         cf_rpath_list="/usr/lib /lib"
17464         if test "$cf_ldd_prog" != no
17465         then
17466                 cf_rpath_oops=
17467
17468 cat >conftest.$ac_ext <<_ACEOF
17469 #line 17469 "configure"
17470 #include "confdefs.h"
17471 #include <stdio.h>
17472 int
17473 main ()
17474 {
17475 printf("Hello");
17476   ;
17477   return 0;
17478 }
17479 _ACEOF
17480 rm -f conftest.$ac_objext conftest$ac_exeext
17481 if { (eval echo "$as_me:17481: \"$ac_link\"") >&5
17482   (eval $ac_link) 2>&5
17483   ac_status=$?
17484   echo "$as_me:17484: \$? = $ac_status" >&5
17485   (exit $ac_status); } &&
17486          { ac_try='test -s conftest$ac_exeext'
17487   { (eval echo "$as_me:17487: \"$ac_try\"") >&5
17488   (eval $ac_try) 2>&5
17489   ac_status=$?
17490   echo "$as_me:17490: \$? = $ac_status" >&5
17491   (exit $ac_status); }; }; then
17492   cf_rpath_oops=`$cf_ldd_prog conftest$ac_exeext | fgrep ' not found' | sed -e 's% =>.*$%%' |sort | uniq`
17493                  cf_rpath_list=`$cf_ldd_prog conftest$ac_exeext | fgrep / | sed -e 's%^.*[      ]/%/%' -e 's%/[^/][^/]*$%%' |sort | uniq`
17494 else
17495   echo "$as_me: failed program was:" >&5
17496 cat conftest.$ac_ext >&5
17497 fi
17498 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17499
17500                 # If we passed the link-test, but get a "not found" on a given library,
17501                 # this could be due to inept reconfiguration of gcc to make it only
17502                 # partly honor /usr/local/lib (or whatever).  Sometimes this behavior
17503                 # is intentional, e.g., installing gcc in /usr/bin and suppressing the
17504                 # /usr/local libraries.
17505                 if test -n "$cf_rpath_oops"
17506                 then
17507                         for cf_rpath_src in $cf_rpath_oops
17508                         do
17509                                 for cf_rpath_dir in \
17510                                         /usr/local \
17511                                         /usr/pkg \
17512                                         /opt/sfw
17513                                 do
17514                                         if test -f $cf_rpath_dir/lib/$cf_rpath_src
17515                                         then
17516                                                 test -n "$verbose" && echo "    ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src" 1>&6
17517
17518 echo "${as_me:-configure}:17518: testing ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src ..." 1>&5
17519
17520                                                 LDFLAGS="$LDFLAGS -L$cf_rpath_dir/lib"
17521                                                 break
17522                                         fi
17523                                 done
17524                         done
17525                 fi
17526         fi
17527
17528         test -n "$verbose" && echo "    ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
17529
17530 echo "${as_me:-configure}:17530: testing ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
17531
17532 test -n "$verbose" && echo "    ...checking LDFLAGS $LDFLAGS" 1>&6
17533
17534 echo "${as_me:-configure}:17534: testing ...checking LDFLAGS $LDFLAGS ..." 1>&5
17535
17536 cf_rpath_dst=
17537 for cf_rpath_src in $LDFLAGS
17538 do
17539         case $cf_rpath_src in
17540         (-L*)
17541
17542                 # check if this refers to a directory which we will ignore
17543                 cf_rpath_skip=no
17544                 if test -n "$cf_rpath_list"
17545                 then
17546                         for cf_rpath_item in $cf_rpath_list
17547                         do
17548                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
17549                                 then
17550                                         cf_rpath_skip=yes
17551                                         break
17552                                 fi
17553                         done
17554                 fi
17555
17556                 if test "$cf_rpath_skip" = no
17557                 then
17558                         # transform the option
17559                         if test "$LD_RPATH_OPT" = "-R " ; then
17560                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
17561                         else
17562                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
17563                         fi
17564
17565                         # if we have not already added this, add it now
17566                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
17567                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
17568                         then
17569                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
17570
17571 echo "${as_me:-configure}:17571: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
17572
17573                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
17574                         fi
17575                 fi
17576                 ;;
17577         esac
17578         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
17579 done
17580 LDFLAGS=$cf_rpath_dst
17581
17582 test -n "$verbose" && echo "    ...checked LDFLAGS $LDFLAGS" 1>&6
17583
17584 echo "${as_me:-configure}:17584: testing ...checked LDFLAGS $LDFLAGS ..." 1>&5
17585
17586 test -n "$verbose" && echo "    ...checking LIBS $LIBS" 1>&6
17587
17588 echo "${as_me:-configure}:17588: testing ...checking LIBS $LIBS ..." 1>&5
17589
17590 cf_rpath_dst=
17591 for cf_rpath_src in $LIBS
17592 do
17593         case $cf_rpath_src in
17594         (-L*)
17595
17596                 # check if this refers to a directory which we will ignore
17597                 cf_rpath_skip=no
17598                 if test -n "$cf_rpath_list"
17599                 then
17600                         for cf_rpath_item in $cf_rpath_list
17601                         do
17602                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
17603                                 then
17604                                         cf_rpath_skip=yes
17605                                         break
17606                                 fi
17607                         done
17608                 fi
17609
17610                 if test "$cf_rpath_skip" = no
17611                 then
17612                         # transform the option
17613                         if test "$LD_RPATH_OPT" = "-R " ; then
17614                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
17615                         else
17616                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
17617                         fi
17618
17619                         # if we have not already added this, add it now
17620                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
17621                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
17622                         then
17623                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
17624
17625 echo "${as_me:-configure}:17625: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
17626
17627                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
17628                         fi
17629                 fi
17630                 ;;
17631         esac
17632         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
17633 done
17634 LIBS=$cf_rpath_dst
17635
17636 test -n "$verbose" && echo "    ...checked LIBS $LIBS" 1>&6
17637
17638 echo "${as_me:-configure}:17638: testing ...checked LIBS $LIBS ..." 1>&5
17639
17640         test -n "$verbose" && echo "    ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
17641
17642 echo "${as_me:-configure}:17642: testing ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
17643
17644 else
17645         echo "$as_me:17645: result: no" >&5
17646 echo "${ECHO_T}no" >&6
17647 fi
17648
17649 fi
17650
17651 TEST_ARGS="$LIBS"
17652 LIBS=
17653
17654 ac_config_files="$ac_config_files Makefile"
17655 ac_config_commands="$ac_config_commands default"
17656 cat >confcache <<\_ACEOF
17657 # This file is a shell script that caches the results of configure
17658 # tests run on this system so they can be shared between configure
17659 # scripts and configure runs, see configure's option --config-cache.
17660 # It is not useful on other systems.  If it contains results you don't
17661 # want to keep, you may remove or edit it.
17662 #
17663 # config.status only pays attention to the cache file if you give it
17664 # the --recheck option to rerun configure.
17665 #
17666 # `ac_cv_env_foo' variables (set or unset) will be overriden when
17667 # loading this file, other *unset* `ac_cv_foo' will be assigned the
17668 # following values.
17669
17670 _ACEOF
17671
17672 # The following way of writing the cache mishandles newlines in values,
17673 # but we know of no workaround that is simple, portable, and efficient.
17674 # So, don't put newlines in cache variables' values.
17675 # Ultrix sh set writes to stderr and can't be redirected directly,
17676 # and sets the high bit in the cache file unless we assign to the vars.
17677 {
17678   (set) 2>&1 |
17679     case `(ac_space=' '; set | grep ac_space) 2>&1` in
17680     *ac_space=\ *)
17681       # `set' does not quote correctly, so add quotes (double-quote
17682       # substitution turns \\\\ into \\, and sed turns \\ into \).
17683       sed -n \
17684         "s/'/'\\\\''/g;
17685           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
17686       ;;
17687     *)
17688       # `set' quotes correctly as required by POSIX, so do not add quotes.
17689       sed -n \
17690         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
17691       ;;
17692     esac;
17693 } |
17694   sed '
17695      t clear
17696      : clear
17697      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
17698      t end
17699      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
17700      : end' >>confcache
17701 if cmp -s $cache_file confcache; then :; else
17702   if test -w $cache_file; then
17703     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
17704     cat confcache >$cache_file
17705   else
17706     echo "not updating unwritable cache $cache_file"
17707   fi
17708 fi
17709 rm -f confcache
17710
17711 test "x$prefix" = xNONE && prefix=$ac_default_prefix
17712 # Let make expand exec_prefix.
17713 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
17714
17715 # VPATH may cause trouble with some makes, so we remove $(srcdir),
17716 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
17717 # trailing colons and then remove the whole line if VPATH becomes empty
17718 # (actually we leave an empty line to preserve line numbers).
17719 if test "x$srcdir" = x.; then
17720   ac_vpsub='/^[         ]*VPATH[        ]*=/{
17721 s/:*\$(srcdir):*/:/;
17722 s/:*\${srcdir}:*/:/;
17723 s/:*@srcdir@:*/:/;
17724 s/^\([^=]*=[    ]*\):*/\1/;
17725 s/:*$//;
17726 s/^[^=]*=[      ]*$//;
17727 }'
17728 fi
17729
17730 DEFS=-DHAVE_CONFIG_H
17731
17732 : ${CONFIG_STATUS=./config.status}
17733 ac_clean_files_save=$ac_clean_files
17734 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
17735 { echo "$as_me:17735: creating $CONFIG_STATUS" >&5
17736 echo "$as_me: creating $CONFIG_STATUS" >&6;}
17737 cat >$CONFIG_STATUS <<_ACEOF
17738 #! $SHELL
17739 # Generated automatically by configure.
17740 # Run this file to recreate the current configuration.
17741 # Compiler output produced by configure, useful for debugging
17742 # configure, is in config.log if it exists.
17743
17744 debug=false
17745 SHELL=\${CONFIG_SHELL-$SHELL}
17746 ac_cs_invocation="\$0 \$@"
17747
17748 _ACEOF
17749
17750 cat >>$CONFIG_STATUS <<\_ACEOF
17751 # Be Bourne compatible
17752 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
17753   emulate sh
17754   NULLCMD=:
17755 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
17756   set -o posix
17757 fi
17758
17759 # Name of the executable.
17760 as_me=`echo "$0" |sed 's,.*[\\/],,'`
17761
17762 if expr a : '\(a\)' >/dev/null 2>&1; then
17763   as_expr=expr
17764 else
17765   as_expr=false
17766 fi
17767
17768 rm -f conf$$ conf$$.exe conf$$.file
17769 echo >conf$$.file
17770 if ln -s conf$$.file conf$$ 2>/dev/null; then
17771   # We could just check for DJGPP; but this test a) works b) is more generic
17772   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
17773   if test -f conf$$.exe; then
17774     # Don't use ln at all; we don't have any links
17775     as_ln_s='cp -p'
17776   else
17777     as_ln_s='ln -s'
17778   fi
17779 elif ln conf$$.file conf$$ 2>/dev/null; then
17780   as_ln_s=ln
17781 else
17782   as_ln_s='cp -p'
17783 fi
17784 rm -f conf$$ conf$$.exe conf$$.file
17785
17786 as_executable_p="test -f"
17787
17788 # Support unset when possible.
17789 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
17790   as_unset=unset
17791 else
17792   as_unset=false
17793 fi
17794
17795 # NLS nuisances.
17796 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
17797 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
17798 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
17799 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
17800 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
17801 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
17802 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
17803 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
17804
17805 # IFS
17806 # We need space, tab and new line, in precisely that order.
17807 as_nl='
17808 '
17809 IFS="   $as_nl"
17810
17811 # CDPATH.
17812 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
17813
17814 exec 6>&1
17815
17816 _ACEOF
17817
17818 # Files that config.status was made for.
17819 if test -n "$ac_config_files"; then
17820   echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
17821 fi
17822
17823 if test -n "$ac_config_headers"; then
17824   echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
17825 fi
17826
17827 if test -n "$ac_config_links"; then
17828   echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
17829 fi
17830
17831 if test -n "$ac_config_commands"; then
17832   echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
17833 fi
17834
17835 cat >>$CONFIG_STATUS <<\EOF
17836
17837 ac_cs_usage="\
17838 \`$as_me' instantiates files from templates according to the
17839 current configuration.
17840
17841 Usage: $0 [OPTIONS] [FILE]...
17842
17843   -h, --help       print this help, then exit
17844   -V, --version    print version number, then exit
17845   -d, --debug      don't remove temporary files
17846       --recheck    update $as_me by reconfiguring in the same conditions
17847   --file=FILE[:TEMPLATE]
17848                    instantiate the configuration file FILE
17849   --header=FILE[:TEMPLATE]
17850                    instantiate the configuration header FILE
17851
17852 Configuration files:
17853 $config_files
17854
17855 Configuration headers:
17856 $config_headers
17857
17858 Configuration commands:
17859 $config_commands
17860
17861 Report bugs to <dickey@invisible-island.net>."
17862 EOF
17863
17864 cat >>$CONFIG_STATUS <<EOF
17865 ac_cs_version="\\
17866 config.status
17867 configured by $0, generated by GNU Autoconf 2.52.20150926,
17868   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
17869
17870 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
17871 Free Software Foundation, Inc.
17872 This config.status script is free software; the Free Software Foundation
17873 gives unlimited permission to copy, distribute and modify it."
17874 srcdir=$srcdir
17875 INSTALL="$INSTALL"
17876 EOF
17877
17878 cat >>$CONFIG_STATUS <<\EOF
17879 # If no file are specified by the user, then we need to provide default
17880 # value.  By we need to know if files were specified by the user.
17881 ac_need_defaults=:
17882 while test $# != 0
17883 do
17884   case $1 in
17885   --*=*)
17886     ac_option=`expr "x$1" : 'x\([^=]*\)='`
17887     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
17888     shift
17889     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
17890     shift
17891     ;;
17892   -*);;
17893   *) # This is not an option, so the user has probably given explicit
17894      # arguments.
17895      ac_need_defaults=false;;
17896   esac
17897
17898   case $1 in
17899   # Handling of the options.
17900 EOF
17901 cat >>$CONFIG_STATUS <<EOF
17902   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
17903     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
17904     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
17905 EOF
17906 cat >>$CONFIG_STATUS <<\EOF
17907   --version | --vers* | -V )
17908     echo "$ac_cs_version"; exit 0 ;;
17909   --he | --h)
17910     # Conflict between --help and --header
17911     { { echo "$as_me:17911: error: ambiguous option: $1
17912 Try \`$0 --help' for more information." >&5
17913 echo "$as_me: error: ambiguous option: $1
17914 Try \`$0 --help' for more information." >&2;}
17915    { (exit 1); exit 1; }; };;
17916   --help | --hel | -h )
17917     echo "$ac_cs_usage"; exit 0 ;;
17918   --debug | --d* | -d )
17919     debug=: ;;
17920   --file | --fil | --fi | --f )
17921     shift
17922     CONFIG_FILES="$CONFIG_FILES $1"
17923     ac_need_defaults=false;;
17924   --header | --heade | --head | --hea )
17925     shift
17926     CONFIG_HEADERS="$CONFIG_HEADERS $1"
17927     ac_need_defaults=false;;
17928
17929   # This is an error.
17930   -*) { { echo "$as_me:17930: error: unrecognized option: $1
17931 Try \`$0 --help' for more information." >&5
17932 echo "$as_me: error: unrecognized option: $1
17933 Try \`$0 --help' for more information." >&2;}
17934    { (exit 1); exit 1; }; } ;;
17935
17936   *) ac_config_targets="$ac_config_targets $1" ;;
17937
17938   esac
17939   shift
17940 done
17941
17942 exec 5>>config.log
17943 cat >&5 << _ACEOF
17944
17945 ## ----------------------- ##
17946 ## Running config.status.  ##
17947 ## ----------------------- ##
17948
17949 This file was extended by $as_me 2.52.20150926, executed with
17950   CONFIG_FILES    = $CONFIG_FILES
17951   CONFIG_HEADERS  = $CONFIG_HEADERS
17952   CONFIG_LINKS    = $CONFIG_LINKS
17953   CONFIG_COMMANDS = $CONFIG_COMMANDS
17954   > $ac_cs_invocation
17955 on `(hostname || uname -n) 2>/dev/null | sed 1q`
17956
17957 _ACEOF
17958 EOF
17959
17960 cat >>$CONFIG_STATUS <<EOF
17961 #
17962 # INIT-COMMANDS section.
17963 #
17964
17965 AWK="$AWK"
17966 ECHO_CC="$ECHO_CC"
17967 ECHO_LD="$ECHO_LD"
17968 SHOW_CC="$SHOW_LD"
17969
17970 EOF
17971
17972 cat >>$CONFIG_STATUS <<\EOF
17973 for ac_config_target in $ac_config_targets
17974 do
17975   case "$ac_config_target" in
17976   # Handling of arguments.
17977   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
17978   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
17979   "ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS ncurses_cfg.h:ncurses_tst.hin" ;;
17980   *) { { echo "$as_me:17980: error: invalid argument: $ac_config_target" >&5
17981 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
17982    { (exit 1); exit 1; }; };;
17983   esac
17984 done
17985
17986 # If the user did not use the arguments to specify the items to instantiate,
17987 # then the envvar interface is used.  Set only those that are not.
17988 # We use the long form for the default assignment because of an extremely
17989 # bizarre bug on SunOS 4.1.3.
17990 if $ac_need_defaults; then
17991   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
17992   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
17993   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
17994 fi
17995
17996 # Create a temporary directory, and hook for its removal unless debugging.
17997 $debug ||
17998 {
17999   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
18000   trap '{ (exit 1); exit 1; }' 1 2 13 15
18001 }
18002
18003 # Create a (secure) tmp directory for tmp files.
18004 : ${TMPDIR=/tmp}
18005 {
18006   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
18007   test -n "$tmp" && test -d "$tmp"
18008 }  ||
18009 {
18010   tmp=$TMPDIR/cs$$-$RANDOM
18011   (umask 077 && mkdir $tmp)
18012 } ||
18013 {
18014    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
18015    { (exit 1); exit 1; }
18016 }
18017
18018 EOF
18019
18020 cat >>$CONFIG_STATUS <<EOF
18021
18022 #
18023 # CONFIG_FILES section.
18024 #
18025
18026 # No need to generate the scripts if there are no CONFIG_FILES.
18027 # This happens for instance when ./config.status config.h
18028 if test -n "\$CONFIG_FILES"; then
18029   # Protect against being on the right side of a sed subst in config.status.
18030   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
18031    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
18032 s,@SHELL@,$SHELL,;t t
18033 s,@exec_prefix@,$exec_prefix,;t t
18034 s,@prefix@,$prefix,;t t
18035 s,@program_transform_name@,$program_transform_name,;t t
18036 s,@bindir@,$bindir,;t t
18037 s,@sbindir@,$sbindir,;t t
18038 s,@libexecdir@,$libexecdir,;t t
18039 s,@datarootdir@,$datarootdir,;t t
18040 s,@datadir@,$datadir,;t t
18041 s,@sysconfdir@,$sysconfdir,;t t
18042 s,@sharedstatedir@,$sharedstatedir,;t t
18043 s,@localstatedir@,$localstatedir,;t t
18044 s,@libdir@,$libdir,;t t
18045 s,@includedir@,$includedir,;t t
18046 s,@oldincludedir@,$oldincludedir,;t t
18047 s,@infodir@,$infodir,;t t
18048 s,@mandir@,$mandir,;t t
18049 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
18050 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
18051 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
18052 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
18053 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
18054 s,@build_alias@,$build_alias,;t t
18055 s,@host_alias@,$host_alias,;t t
18056 s,@target_alias@,$target_alias,;t t
18057 s,@ECHO_C@,$ECHO_C,;t t
18058 s,@ECHO_N@,$ECHO_N,;t t
18059 s,@ECHO_T@,$ECHO_T,;t t
18060 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
18061 s,@DEFS@,$DEFS,;t t
18062 s,@LIBS@,$LIBS,;t t
18063 s,@build@,$build,;t t
18064 s,@build_cpu@,$build_cpu,;t t
18065 s,@build_vendor@,$build_vendor,;t t
18066 s,@build_os@,$build_os,;t t
18067 s,@host@,$host,;t t
18068 s,@host_cpu@,$host_cpu,;t t
18069 s,@host_vendor@,$host_vendor,;t t
18070 s,@host_os@,$host_os,;t t
18071 s,@SET_MAKE@,$SET_MAKE,;t t
18072 s,@CC@,$CC,;t t
18073 s,@CFLAGS@,$CFLAGS,;t t
18074 s,@LDFLAGS@,$LDFLAGS,;t t
18075 s,@CPPFLAGS@,$CPPFLAGS,;t t
18076 s,@ac_ct_CC@,$ac_ct_CC,;t t
18077 s,@EXEEXT@,$EXEEXT,;t t
18078 s,@OBJEXT@,$OBJEXT,;t t
18079 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
18080 s,@CPP@,$CPP,;t t
18081 s,@AWK@,$AWK,;t t
18082 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
18083 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
18084 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
18085 s,@LINT@,$LINT,;t t
18086 s,@LINT_OPTS@,$LINT_OPTS,;t t
18087 s,@CTAGS@,$CTAGS,;t t
18088 s,@ETAGS@,$ETAGS,;t t
18089 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
18090 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
18091 s,@MATH_LIB@,$MATH_LIB,;t t
18092 s,@top_builddir@,$top_builddir,;t t
18093 s,@CC_G_OPT@,$CC_G_OPT,;t t
18094 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
18095 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
18096 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
18097 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
18098 s,@LD@,$LD,;t t
18099 s,@LDFLAGS_SHARED@,$LDFLAGS_SHARED,;t t
18100 s,@LDFLAGS_STATIC@,$LDFLAGS_STATIC,;t t
18101 s,@LD_MODEL@,$LD_MODEL,;t t
18102 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
18103 s,@LIBTOOL@,$LIBTOOL,;t t
18104 s,@LIBTOOL_OPTS@,$LIBTOOL_OPTS,;t t
18105 s,@LIB_CLEAN@,$LIB_CLEAN,;t t
18106 s,@LIB_COMPILE@,$LIB_COMPILE,;t t
18107 s,@LIB_LINK@,$LIB_LINK,;t t
18108 s,@LINK_TESTS@,$LINK_TESTS,;t t
18109 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
18110 s,@PACKAGE@,$PACKAGE,;t t
18111 s,@PTHREAD@,$PTHREAD,;t t
18112 s,@TEST_ARGS@,$TEST_ARGS,;t t
18113 s,@TEST_DEPS@,$TEST_DEPS,;t t
18114 s,@TEST_LIBS@,$TEST_LIBS,;t t
18115 s,@TINFO_LDFLAGS@,$TINFO_LDFLAGS,;t t
18116 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
18117 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
18118 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
18119 s,@includesubdir@,$includesubdir,;t t
18120 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
18121 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
18122 s,@ECHO_LT@,$ECHO_LT,;t t
18123 s,@ECHO_LD@,$ECHO_LD,;t t
18124 s,@RULE_CC@,$RULE_CC,;t t
18125 s,@SHOW_CC@,$SHOW_CC,;t t
18126 s,@ECHO_CC@,$ECHO_CC,;t t
18127 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
18128 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
18129 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
18130 s,@X_CFLAGS@,$X_CFLAGS,;t t
18131 s,@X_PRE_LIBS@,$X_PRE_LIBS,;t t
18132 s,@X_LIBS@,$X_LIBS,;t t
18133 s,@X_EXTRA_LIBS@,$X_EXTRA_LIBS,;t t
18134 s,@XCURSES_CONFIG@,$XCURSES_CONFIG,;t t
18135 s,@ac_ct_XCURSES_CONFIG@,$ac_ct_XCURSES_CONFIG,;t t
18136 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
18137 s,@cf_ldd_prog@,$cf_ldd_prog,;t t
18138 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
18139 CEOF
18140
18141 EOF
18142
18143   cat >>$CONFIG_STATUS <<\EOF
18144   # Split the substitutions into bite-sized pieces for seds with
18145   # small command number limits, like on Digital OSF/1 and HP-UX.
18146   ac_max_sed_lines=48
18147   ac_sed_frag=1 # Number of current file.
18148   ac_beg=1 # First line for current file.
18149   ac_end=$ac_max_sed_lines # Line after last line for current file.
18150   ac_more_lines=:
18151   ac_sed_cmds=
18152   while $ac_more_lines; do
18153     if test $ac_beg -gt 1; then
18154       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
18155     else
18156       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
18157     fi
18158     if test ! -s $tmp/subs.frag; then
18159       ac_more_lines=false
18160     else
18161       # The purpose of the label and of the branching condition is to
18162       # speed up the sed processing (if there are no `@' at all, there
18163       # is no need to browse any of the substitutions).
18164       # These are the two extra sed commands mentioned above.
18165       (echo ':t
18166   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
18167       # It is possible to make a multiline substitution using escaped newlines.
18168       # Ensure that we do not split the substitution between script fragments.
18169       ac_BEG=$ac_end
18170       ac_END=`expr $ac_end + $ac_max_sed_lines`
18171       sed "1,${ac_BEG}d; ${ac_END}p; q" $tmp/subs.sed >$tmp/subs.next
18172       if test -s $tmp/subs.next; then
18173         grep '^s,@[^@,][^@,]*@,.*\\$' $tmp/subs.next >$tmp/subs.edit
18174         if test ! -s $tmp/subs.edit; then
18175           grep "^s,@[^@,][^@,]*@,.*,;t t$" $tmp/subs.next >$tmp/subs.edit
18176           if test ! -s $tmp/subs.edit; then
18177             if test $ac_beg -gt 1; then
18178               ac_end=`expr $ac_end - 1`
18179               continue
18180             fi
18181           fi
18182         fi
18183       fi
18184
18185       if test -z "$ac_sed_cmds"; then
18186         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
18187       else
18188         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
18189       fi
18190       ac_sed_frag=`expr $ac_sed_frag + 1`
18191       ac_beg=$ac_end
18192       ac_end=`expr $ac_end + $ac_max_sed_lines`
18193     fi
18194   done
18195   if test -z "$ac_sed_cmds"; then
18196     ac_sed_cmds=cat
18197   fi
18198 fi # test -n "$CONFIG_FILES"
18199
18200 EOF
18201 cat >>$CONFIG_STATUS <<\EOF
18202 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
18203   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
18204   case $ac_file in
18205   - | *:- | *:-:* ) # input from stdin
18206         cat >$tmp/stdin
18207         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
18208         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
18209   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
18210         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
18211   * )   ac_file_in=$ac_file.in ;;
18212   esac
18213
18214   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
18215   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
18216          X"$ac_file" : 'X\(//\)[^/]' \| \
18217          X"$ac_file" : 'X\(//\)$' \| \
18218          X"$ac_file" : 'X\(/\)' \| \
18219          .     : '\(.\)' 2>/dev/null ||
18220 echo X"$ac_file" |
18221     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
18222           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
18223           /^X\(\/\/\)$/{ s//\1/; q; }
18224           /^X\(\/\).*/{ s//\1/; q; }
18225           s/.*/./; q'`
18226   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
18227     { case "$ac_dir" in
18228   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
18229   *)                      as_incr_dir=.;;
18230 esac
18231 as_dummy="$ac_dir"
18232 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
18233   case $as_mkdir_dir in
18234     # Skip DOS drivespec
18235     ?:) as_incr_dir=$as_mkdir_dir ;;
18236     *)
18237       as_incr_dir=$as_incr_dir/$as_mkdir_dir
18238       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
18239     ;;
18240   esac
18241 done; }
18242
18243     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
18244     # A "../" for each directory in $ac_dir_suffix.
18245     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
18246   else
18247     ac_dir_suffix= ac_dots=
18248   fi
18249
18250   case $srcdir in
18251   .)  ac_srcdir=.
18252       if test -z "$ac_dots"; then
18253          ac_top_srcdir=.
18254       else
18255          ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'`
18256       fi ;;
18257   [\\/]* | ?:[\\/]* )
18258       ac_srcdir=$srcdir$ac_dir_suffix;
18259       ac_top_srcdir=$srcdir ;;
18260   *) # Relative path.
18261     ac_srcdir=$ac_dots$srcdir$ac_dir_suffix
18262     ac_top_srcdir=$ac_dots$srcdir ;;
18263   esac
18264
18265   case $INSTALL in
18266   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
18267   *) ac_INSTALL=$ac_dots$INSTALL ;;
18268   esac
18269
18270   if test x"$ac_file" != x-; then
18271     { echo "$as_me:18271: creating $ac_file" >&5
18272 echo "$as_me: creating $ac_file" >&6;}
18273     rm -f "$ac_file"
18274   fi
18275   # Let's still pretend it is `configure' which instantiates (i.e., don't
18276   # use $as_me), people would be surprised to read:
18277   #    /* config.h.  Generated automatically by config.status.  */
18278   configure_input="Generated automatically from `echo $ac_file_in |
18279                                                  sed 's,.*/,,'` by configure."
18280
18281   # First look for the input files in the build tree, otherwise in the
18282   # src tree.
18283   ac_file_inputs=`IFS=:
18284     for f in $ac_file_in; do
18285       case $f in
18286       -) echo $tmp/stdin ;;
18287       [\\/$]*)
18288          # Absolute (can't be DOS-style, as IFS=:)
18289          test -f "$f" || { { echo "$as_me:18289: error: cannot find input file: $f" >&5
18290 echo "$as_me: error: cannot find input file: $f" >&2;}
18291    { (exit 1); exit 1; }; }
18292          echo $f;;
18293       *) # Relative
18294          if test -f "$f"; then
18295            # Build tree
18296            echo $f
18297          elif test -f "$srcdir/$f"; then
18298            # Source tree
18299            echo $srcdir/$f
18300          else
18301            # /dev/null tree
18302            { { echo "$as_me:18302: error: cannot find input file: $f" >&5
18303 echo "$as_me: error: cannot find input file: $f" >&2;}
18304    { (exit 1); exit 1; }; }
18305          fi;;
18306       esac
18307     done` || { (exit 1); exit 1; }
18308 EOF
18309 cat >>$CONFIG_STATUS <<\EOF
18310   ac_warn_datarootdir=no
18311   if test x"$ac_file" != x-; then
18312     for ac_item in $ac_file_inputs
18313     do
18314       ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' $ac_item`
18315       if test -n "$ac_seen"; then
18316         ac_used=`grep '@datarootdir@' $ac_item`
18317         if test -z "$ac_used"; then
18318           { echo "$as_me:18318: WARNING: datarootdir was used implicitly but not set:
18319 $ac_seen" >&5
18320 echo "$as_me: WARNING: datarootdir was used implicitly but not set:
18321 $ac_seen" >&2;}
18322           ac_warn_datarootdir=yes
18323         fi
18324       fi
18325       ac_seen=`grep '${datarootdir}' $ac_item`
18326       if test -n "$ac_seen"; then
18327         { echo "$as_me:18327: WARNING: datarootdir was used explicitly but not set:
18328 $ac_seen" >&5
18329 echo "$as_me: WARNING: datarootdir was used explicitly but not set:
18330 $ac_seen" >&2;}
18331         ac_warn_datarootdir=yes
18332       fi
18333     done
18334   fi
18335
18336 if test "x$ac_warn_datarootdir" = xyes; then
18337   ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
18338 fi
18339
18340 EOF
18341 cat >>$CONFIG_STATUS <<EOF
18342   sed "$ac_vpsub
18343 $extrasub
18344 EOF
18345 cat >>$CONFIG_STATUS <<\EOF
18346 :t
18347 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
18348 s,@configure_input@,$configure_input,;t t
18349 s,@srcdir@,$ac_srcdir,;t t
18350 s,@top_srcdir@,$ac_top_srcdir,;t t
18351 s,@INSTALL@,$ac_INSTALL,;t t
18352 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
18353   rm -f $tmp/stdin
18354   if test x"$ac_file" != x-; then
18355     cp $tmp/out $ac_file
18356
18357     for ac_name in prefix exec_prefix datarootdir
18358     do
18359         ac_seen=`fgrep -n '${'$ac_name'[:=].*}' $ac_file`
18360         if test -n "$ac_seen"; then
18361             ac_init=`egrep '[   ]*'$ac_name'[   ]*=' $ac_file`
18362             if test -z "$ac_init"; then
18363               ac_seen=`echo "$ac_seen" |sed -e 's,^,'$ac_file':,'`
18364               { echo "$as_me:18364: WARNING: Variable $ac_name is used but was not set:
18365 $ac_seen" >&5
18366 echo "$as_me: WARNING: Variable $ac_name is used but was not set:
18367 $ac_seen" >&2;}
18368             fi
18369         fi
18370     done
18371     egrep -n '@[a-z_][a-z_0-9]+@' $ac_file >$tmp/out
18372     egrep -n '@[A-Z_][A-Z_0-9]+@' $ac_file >>$tmp/out
18373     if test -s $tmp/out; then
18374       ac_seen=`sed -e 's,^,'$ac_file':,' < $tmp/out`
18375       { echo "$as_me:18375: WARNING: Some variables may not be substituted:
18376 $ac_seen" >&5
18377 echo "$as_me: WARNING: Some variables may not be substituted:
18378 $ac_seen" >&2;}
18379     fi
18380   else
18381     cat $tmp/out
18382   fi
18383   rm -f $tmp/out
18384
18385 done
18386 EOF
18387 cat >>$CONFIG_STATUS <<\EOF
18388
18389 #
18390 # CONFIG_HEADER section.
18391 #
18392
18393 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
18394 # NAME is the cpp macro being defined and VALUE is the value it is being given.
18395 #
18396 # ac_d sets the value in "#define NAME VALUE" lines.
18397 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
18398 ac_dB='[        ].*$,\1#\2'
18399 ac_dC=' '
18400 ac_dD=',;t'
18401 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
18402 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
18403 ac_iB='\([      ]\),\1#\2define\3'
18404 ac_iC=' '
18405 ac_iD='\4,;t'
18406 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
18407 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
18408 ac_uB='$,\1#\2define\3'
18409 ac_uC=' '
18410 ac_uD=',;t'
18411
18412 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
18413   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
18414   case $ac_file in
18415   - | *:- | *:-:* ) # input from stdin
18416         cat >$tmp/stdin
18417         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
18418         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
18419   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
18420         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
18421   * )   ac_file_in=$ac_file.in ;;
18422   esac
18423
18424   test x"$ac_file" != x- && { echo "$as_me:18424: creating $ac_file" >&5
18425 echo "$as_me: creating $ac_file" >&6;}
18426
18427   # First look for the input files in the build tree, otherwise in the
18428   # src tree.
18429   ac_file_inputs=`IFS=:
18430     for f in $ac_file_in; do
18431       case $f in
18432       -) echo $tmp/stdin ;;
18433       [\\/$]*)
18434          # Absolute (can't be DOS-style, as IFS=:)
18435          test -f "$f" || { { echo "$as_me:18435: error: cannot find input file: $f" >&5
18436 echo "$as_me: error: cannot find input file: $f" >&2;}
18437    { (exit 1); exit 1; }; }
18438          echo $f;;
18439       *) # Relative
18440          if test -f "$f"; then
18441            # Build tree
18442            echo $f
18443          elif test -f "$srcdir/$f"; then
18444            # Source tree
18445            echo $srcdir/$f
18446          else
18447            # /dev/null tree
18448            { { echo "$as_me:18448: error: cannot find input file: $f" >&5
18449 echo "$as_me: error: cannot find input file: $f" >&2;}
18450    { (exit 1); exit 1; }; }
18451          fi;;
18452       esac
18453     done` || { (exit 1); exit 1; }
18454   # Remove the trailing spaces.
18455   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
18456
18457 EOF
18458
18459 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
18460 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
18461 # be either 'cat' or 'sort'.
18462 cat confdefs.h | uniq >conftest.vals
18463
18464 # Break up conftest.vals because some shells have a limit on
18465 # the size of here documents, and old seds have small limits too.
18466
18467 rm -f conftest.tail
18468 echo '  rm -f conftest.frag' >> $CONFIG_STATUS
18469 while grep . conftest.vals >/dev/null
18470 do
18471   # Write chunks of a limited-size here document to conftest.frag.
18472   echo '  cat >> conftest.frag <<CEOF' >> $CONFIG_STATUS
18473   sed ${ac_max_here_lines}q conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> $CONFIG_STATUS
18474   echo 'CEOF' >> $CONFIG_STATUS
18475   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
18476   rm -f conftest.vals
18477   mv conftest.tail conftest.vals
18478 done
18479 rm -f conftest.vals
18480
18481 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
18482 # marker @DEFS@.
18483 echo '  cat >> conftest.edit <<CEOF
18484 /@DEFS@/r conftest.frag
18485 /@DEFS@/d
18486 CEOF
18487 sed -f conftest.edit $tmp/in > $tmp/out
18488 rm -f $tmp/in
18489 mv $tmp/out $tmp/in
18490 rm -f conftest.edit conftest.frag
18491 ' >> $CONFIG_STATUS
18492
18493 cat >>$CONFIG_STATUS <<\EOF
18494   # Let's still pretend it is `configure' which instantiates (i.e., don't
18495   # use $as_me), people would be surprised to read:
18496   #    /* config.h.  Generated automatically by config.status.  */
18497   if test x"$ac_file" = x-; then
18498     echo "/* Generated automatically by configure.  */" >$tmp/config.h
18499   else
18500     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
18501   fi
18502   cat $tmp/in >>$tmp/config.h
18503   rm -f $tmp/in
18504   if test x"$ac_file" != x-; then
18505     if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
18506       { echo "$as_me:18506: $ac_file is unchanged" >&5
18507 echo "$as_me: $ac_file is unchanged" >&6;}
18508     else
18509       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
18510          X"$ac_file" : 'X\(//\)[^/]' \| \
18511          X"$ac_file" : 'X\(//\)$' \| \
18512          X"$ac_file" : 'X\(/\)' \| \
18513          .     : '\(.\)' 2>/dev/null ||
18514 echo X"$ac_file" |
18515     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
18516           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
18517           /^X\(\/\/\)$/{ s//\1/; q; }
18518           /^X\(\/\).*/{ s//\1/; q; }
18519           s/.*/./; q'`
18520       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
18521         { case "$ac_dir" in
18522   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
18523   *)                      as_incr_dir=.;;
18524 esac
18525 as_dummy="$ac_dir"
18526 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
18527   case $as_mkdir_dir in
18528     # Skip DOS drivespec
18529     ?:) as_incr_dir=$as_mkdir_dir ;;
18530     *)
18531       as_incr_dir=$as_incr_dir/$as_mkdir_dir
18532       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
18533     ;;
18534   esac
18535 done; }
18536
18537       fi
18538       rm -f $ac_file
18539       mv $tmp/config.h $ac_file
18540     fi
18541   else
18542     cat $tmp/config.h
18543     rm -f $tmp/config.h
18544   fi
18545 done
18546 EOF
18547 cat >>$CONFIG_STATUS <<\EOF
18548 #
18549 # CONFIG_COMMANDS section.
18550 #
18551 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
18552   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
18553   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
18554
18555   case $ac_dest in
18556     default )
18557
18558 for cf_dir in .
18559 do
18560         if test ! -d $srcdir/$cf_dir; then
18561                 continue
18562         elif test -f $srcdir/$cf_dir/programs; then
18563                 $AWK -f $srcdir/mk-test.awk INSTALL=yes ECHO_LINK="$ECHO_LD" $srcdir/$cf_dir/programs >>$cf_dir/Makefile
18564         fi
18565 done
18566
18567         cat >>Makefile <<TEST_EOF
18568
18569 # These rules are generated so we do not rely on suffix rules, which do not
18570 # work consistently for different make-programs (the '\$(MODEL)/' confuses
18571 # some, and the '\$x' confuses others).
18572 TEST_EOF
18573
18574 LIST=`sed -e 's/[       ].*//' -e '/^[#@]/d' $srcdir/modules`
18575 for N in $LIST
18576 do
18577         cat >>Makefile <<TEST_EOF
18578
18579 \$(MODEL)/$N.o : \$(srcdir)/$N.c \\
18580         \$(srcdir)/test.priv.h \\
18581         ncurses_cfg.h
18582         $SHOW_CC
18583         $ECHO_CC\$(CC) -c \$(CFLAGS_DEFAULT) \$(srcdir)/$N.c
18584 TEST_EOF
18585 done
18586
18587 if test -f ../config.guess && test -f ../config.sub
18588 then
18589         cat >>Makefile <<TEST_EOF
18590
18591 # if we used CF_INHERIT for getting these files, we can remove them
18592 distclean::
18593         rm -f config.guess config.sub
18594 TEST_EOF
18595 fi
18596  ;;
18597   esac
18598 done
18599 EOF
18600
18601 cat >>$CONFIG_STATUS <<\EOF
18602
18603 { (exit 0); exit 0; }
18604 EOF
18605 chmod +x $CONFIG_STATUS
18606 ac_clean_files=$ac_clean_files_save
18607
18608 # configure is writing to config.log, and then calls config.status.
18609 # config.status does its own redirection, appending to config.log.
18610 # Unfortunately, on DOS this fails, as config.log is still kept open
18611 # by configure, so config.status won't be able to write to it; its
18612 # output is simply discarded.  So we exec the FD to /dev/null,
18613 # effectively closing config.log, so it can be properly (re)opened and
18614 # appended to by config.status.  When coming back to configure, we
18615 # need to make the FD available again.
18616 if test "$no_create" != yes; then
18617   ac_cs_success=:
18618   exec 5>/dev/null
18619   $SHELL $CONFIG_STATUS || ac_cs_success=false
18620   exec 5>>config.log
18621   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
18622   # would make configure fail if this is the last instruction.
18623   $ac_cs_success || { (exit 1); exit 1; }
18624 fi
18625