]> ncurses.scripts.mit.edu Git - ncurses.git/blob - test/configure
52d95deee1a9731e74a96241261cb95ad3294bce
[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 : ${cf_nculib_root:=$cf_cv_screen}
12986 echo "$as_me:12986: checking if $cf_nculib_root uses pthreads" >&5
12987 echo $ECHO_N "checking if $cf_nculib_root uses pthreads... $ECHO_C" >&6
12988 if test "${cf_cv_ncurses_pthreads+set}" = set; then
12989   echo $ECHO_N "(cached) $ECHO_C" >&6
12990 else
12991
12992         as_ac_Lib=`echo "ac_cv_lib_$cf_nculib_root''__nc_init_pthreads" | $as_tr_sh`
12993 echo "$as_me:12993: checking for _nc_init_pthreads in -l$cf_nculib_root" >&5
12994 echo $ECHO_N "checking for _nc_init_pthreads in -l$cf_nculib_root... $ECHO_C" >&6
12995 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
12996   echo $ECHO_N "(cached) $ECHO_C" >&6
12997 else
12998   ac_check_lib_save_LIBS=$LIBS
12999 LIBS="-l$cf_nculib_root  $LIBS"
13000 cat >conftest.$ac_ext <<_ACEOF
13001 #line 13001 "configure"
13002 #include "confdefs.h"
13003
13004 /* Override any gcc2 internal prototype to avoid an error.  */
13005 #ifdef __cplusplus
13006 extern "C"
13007 #endif
13008 /* We use char because int might match the return type of a gcc2
13009    builtin and then its argument prototype would still apply.  */
13010 char _nc_init_pthreads ();
13011 int
13012 main ()
13013 {
13014 _nc_init_pthreads ();
13015   ;
13016   return 0;
13017 }
13018 _ACEOF
13019 rm -f conftest.$ac_objext conftest$ac_exeext
13020 if { (eval echo "$as_me:13020: \"$ac_link\"") >&5
13021   (eval $ac_link) 2>&5
13022   ac_status=$?
13023   echo "$as_me:13023: \$? = $ac_status" >&5
13024   (exit $ac_status); } &&
13025          { ac_try='test -s conftest$ac_exeext'
13026   { (eval echo "$as_me:13026: \"$ac_try\"") >&5
13027   (eval $ac_try) 2>&5
13028   ac_status=$?
13029   echo "$as_me:13029: \$? = $ac_status" >&5
13030   (exit $ac_status); }; }; then
13031   eval "$as_ac_Lib=yes"
13032 else
13033   echo "$as_me: failed program was:" >&5
13034 cat conftest.$ac_ext >&5
13035 eval "$as_ac_Lib=no"
13036 fi
13037 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13038 LIBS=$ac_check_lib_save_LIBS
13039 fi
13040 echo "$as_me:13040: result: `eval echo '${'$as_ac_Lib'}'`" >&5
13041 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
13042 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
13043   cf_cv_ncurses_pthreads=yes
13044 else
13045   cf_cv_ncurses_pthreads=no
13046 fi
13047
13048 fi
13049 echo "$as_me:13049: result: $cf_cv_ncurses_pthreads" >&5
13050 echo "${ECHO_T}$cf_cv_ncurses_pthreads" >&6
13051 if test "$cf_cv_ncurses_pthreads" = yes
13052 then
13053
13054 cf_add_libs="-lpthread"
13055 # Filter out duplicates - this happens with badly-designed ".pc" files...
13056 for cf_add_1lib in $LIBS
13057 do
13058         for cf_add_2lib in $cf_add_libs
13059         do
13060                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13061                 then
13062                         cf_add_1lib=
13063                         break
13064                 fi
13065         done
13066         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13067 done
13068 LIBS="$cf_add_libs"
13069
13070 fi
13071
13072 case $cf_cv_screen in
13073 (ncurses*)
13074         cf_cv_libtype=`echo "$cf_cv_screen" | sed -e 's/^ncurses//'`
13075         ;;
13076 (curses|curses_*)
13077
13078 echo "$as_me:13078: checking for NetBSD form.h" >&5
13079 echo $ECHO_N "checking for NetBSD form.h... $ECHO_C" >&6
13080 if test "${cf_cv_netbsd_form_h+set}" = set; then
13081   echo $ECHO_N "(cached) $ECHO_C" >&6
13082 else
13083
13084 cat >conftest.$ac_ext <<_ACEOF
13085 #line 13085 "configure"
13086 #include "confdefs.h"
13087
13088 #include <${cf_cv_ncurses_header:-curses.h}>
13089 #include <form.h>
13090
13091 int
13092 main ()
13093 {
13094
13095         FORM *form;
13096         int y = current_field(form)->cursor_ypos;
13097         int x = current_field(form)->cursor_xpos;
13098
13099   ;
13100   return 0;
13101 }
13102 _ACEOF
13103 rm -f conftest.$ac_objext
13104 if { (eval echo "$as_me:13104: \"$ac_compile\"") >&5
13105   (eval $ac_compile) 2>&5
13106   ac_status=$?
13107   echo "$as_me:13107: \$? = $ac_status" >&5
13108   (exit $ac_status); } &&
13109          { ac_try='test -s conftest.$ac_objext'
13110   { (eval echo "$as_me:13110: \"$ac_try\"") >&5
13111   (eval $ac_try) 2>&5
13112   ac_status=$?
13113   echo "$as_me:13113: \$? = $ac_status" >&5
13114   (exit $ac_status); }; }; then
13115   cf_cv_netbsd_form_h=yes
13116
13117 else
13118   echo "$as_me: failed program was:" >&5
13119 cat conftest.$ac_ext >&5
13120 cf_cv_netbsd_form_h=no
13121 fi
13122 rm -f conftest.$ac_objext conftest.$ac_ext
13123
13124 fi
13125 echo "$as_me:13125: result: $cf_cv_netbsd_form_h" >&5
13126 echo "${ECHO_T}$cf_cv_netbsd_form_h" >&6
13127
13128 test "$cf_cv_netbsd_form_h" = yes &&
13129 cat >>confdefs.h <<\EOF
13130 #define HAVE_NETBSD_FORM_H 1
13131 EOF
13132
13133 echo "$as_me:13133: checking for NetBSD menu.h" >&5
13134 echo $ECHO_N "checking for NetBSD menu.h... $ECHO_C" >&6
13135 if test "${cf_cv_netbsd_menu_h+set}" = set; then
13136   echo $ECHO_N "(cached) $ECHO_C" >&6
13137 else
13138
13139 cat >conftest.$ac_ext <<_ACEOF
13140 #line 13140 "configure"
13141 #include "confdefs.h"
13142
13143 #include <${cf_cv_ncurses_header:-curses.h}>
13144 #include <menu.h>
13145
13146 int
13147 main ()
13148 {
13149
13150         MENU *menu;
13151         int y = menu->max_item_width;
13152
13153   ;
13154   return 0;
13155 }
13156 _ACEOF
13157 rm -f conftest.$ac_objext
13158 if { (eval echo "$as_me:13158: \"$ac_compile\"") >&5
13159   (eval $ac_compile) 2>&5
13160   ac_status=$?
13161   echo "$as_me:13161: \$? = $ac_status" >&5
13162   (exit $ac_status); } &&
13163          { ac_try='test -s conftest.$ac_objext'
13164   { (eval echo "$as_me:13164: \"$ac_try\"") >&5
13165   (eval $ac_try) 2>&5
13166   ac_status=$?
13167   echo "$as_me:13167: \$? = $ac_status" >&5
13168   (exit $ac_status); }; }; then
13169   cf_cv_netbsd_menu_h=yes
13170
13171 else
13172   echo "$as_me: failed program was:" >&5
13173 cat conftest.$ac_ext >&5
13174 cf_cv_netbsd_menu_h=no
13175 fi
13176 rm -f conftest.$ac_objext conftest.$ac_ext
13177
13178 fi
13179 echo "$as_me:13179: result: $cf_cv_netbsd_menu_h" >&5
13180 echo "${ECHO_T}$cf_cv_netbsd_menu_h" >&6
13181
13182 test "$cf_cv_netbsd_menu_h" = yes &&
13183 cat >>confdefs.h <<\EOF
13184 #define HAVE_NETBSD_MENU_H 1
13185 EOF
13186
13187         ;;
13188 esac
13189
13190 case $cf_cv_screen in
13191 (pdcurses)
13192         ;;
13193 (*)
13194         # look for curses-related libraries
13195
13196 as_ac_Lib=`echo "ac_cv_lib_panel$cf_cv_libtype''_new_panel" | $as_tr_sh`
13197 echo "$as_me:13197: checking for new_panel in -lpanel$cf_cv_libtype" >&5
13198 echo $ECHO_N "checking for new_panel in -lpanel$cf_cv_libtype... $ECHO_C" >&6
13199 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
13200   echo $ECHO_N "(cached) $ECHO_C" >&6
13201 else
13202   ac_check_lib_save_LIBS=$LIBS
13203 LIBS="-lpanel$cf_cv_libtype  $LIBS"
13204 cat >conftest.$ac_ext <<_ACEOF
13205 #line 13205 "configure"
13206 #include "confdefs.h"
13207
13208 /* Override any gcc2 internal prototype to avoid an error.  */
13209 #ifdef __cplusplus
13210 extern "C"
13211 #endif
13212 /* We use char because int might match the return type of a gcc2
13213    builtin and then its argument prototype would still apply.  */
13214 char new_panel ();
13215 int
13216 main ()
13217 {
13218 new_panel ();
13219   ;
13220   return 0;
13221 }
13222 _ACEOF
13223 rm -f conftest.$ac_objext conftest$ac_exeext
13224 if { (eval echo "$as_me:13224: \"$ac_link\"") >&5
13225   (eval $ac_link) 2>&5
13226   ac_status=$?
13227   echo "$as_me:13227: \$? = $ac_status" >&5
13228   (exit $ac_status); } &&
13229          { ac_try='test -s conftest$ac_exeext'
13230   { (eval echo "$as_me:13230: \"$ac_try\"") >&5
13231   (eval $ac_try) 2>&5
13232   ac_status=$?
13233   echo "$as_me:13233: \$? = $ac_status" >&5
13234   (exit $ac_status); }; }; then
13235   eval "$as_ac_Lib=yes"
13236 else
13237   echo "$as_me: failed program was:" >&5
13238 cat conftest.$ac_ext >&5
13239 eval "$as_ac_Lib=no"
13240 fi
13241 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13242 LIBS=$ac_check_lib_save_LIBS
13243 fi
13244 echo "$as_me:13244: result: `eval echo '${'$as_ac_Lib'}'`" >&5
13245 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
13246 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
13247
13248 cf_upper=`echo "have_libpanel" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
13249
13250 cf_add_libs="-lpanel$cf_cv_libtype"
13251 # Filter out duplicates - this happens with badly-designed ".pc" files...
13252 for cf_add_1lib in $LIBS
13253 do
13254         for cf_add_2lib in $cf_add_libs
13255         do
13256                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13257                 then
13258                         cf_add_1lib=
13259                         break
13260                 fi
13261         done
13262         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13263 done
13264 LIBS="$cf_add_libs"
13265
13266 cat >>confdefs.h <<EOF
13267 #define $cf_upper 1
13268 EOF
13269
13270 fi
13271
13272 as_ac_Lib=`echo "ac_cv_lib_menu$cf_cv_libtype''_menu_driver" | $as_tr_sh`
13273 echo "$as_me:13273: checking for menu_driver in -lmenu$cf_cv_libtype" >&5
13274 echo $ECHO_N "checking for menu_driver in -lmenu$cf_cv_libtype... $ECHO_C" >&6
13275 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
13276   echo $ECHO_N "(cached) $ECHO_C" >&6
13277 else
13278   ac_check_lib_save_LIBS=$LIBS
13279 LIBS="-lmenu$cf_cv_libtype  $LIBS"
13280 cat >conftest.$ac_ext <<_ACEOF
13281 #line 13281 "configure"
13282 #include "confdefs.h"
13283
13284 /* Override any gcc2 internal prototype to avoid an error.  */
13285 #ifdef __cplusplus
13286 extern "C"
13287 #endif
13288 /* We use char because int might match the return type of a gcc2
13289    builtin and then its argument prototype would still apply.  */
13290 char menu_driver ();
13291 int
13292 main ()
13293 {
13294 menu_driver ();
13295   ;
13296   return 0;
13297 }
13298 _ACEOF
13299 rm -f conftest.$ac_objext conftest$ac_exeext
13300 if { (eval echo "$as_me:13300: \"$ac_link\"") >&5
13301   (eval $ac_link) 2>&5
13302   ac_status=$?
13303   echo "$as_me:13303: \$? = $ac_status" >&5
13304   (exit $ac_status); } &&
13305          { ac_try='test -s conftest$ac_exeext'
13306   { (eval echo "$as_me:13306: \"$ac_try\"") >&5
13307   (eval $ac_try) 2>&5
13308   ac_status=$?
13309   echo "$as_me:13309: \$? = $ac_status" >&5
13310   (exit $ac_status); }; }; then
13311   eval "$as_ac_Lib=yes"
13312 else
13313   echo "$as_me: failed program was:" >&5
13314 cat conftest.$ac_ext >&5
13315 eval "$as_ac_Lib=no"
13316 fi
13317 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13318 LIBS=$ac_check_lib_save_LIBS
13319 fi
13320 echo "$as_me:13320: result: `eval echo '${'$as_ac_Lib'}'`" >&5
13321 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
13322 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
13323
13324 cf_upper=`echo "have_libmenu" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
13325
13326 cf_add_libs="-lmenu$cf_cv_libtype"
13327 # Filter out duplicates - this happens with badly-designed ".pc" files...
13328 for cf_add_1lib in $LIBS
13329 do
13330         for cf_add_2lib in $cf_add_libs
13331         do
13332                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13333                 then
13334                         cf_add_1lib=
13335                         break
13336                 fi
13337         done
13338         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13339 done
13340 LIBS="$cf_add_libs"
13341
13342 cat >>confdefs.h <<EOF
13343 #define $cf_upper 1
13344 EOF
13345
13346 fi
13347
13348 as_ac_Lib=`echo "ac_cv_lib_form$cf_cv_libtype''_form_driver" | $as_tr_sh`
13349 echo "$as_me:13349: checking for form_driver in -lform$cf_cv_libtype" >&5
13350 echo $ECHO_N "checking for form_driver in -lform$cf_cv_libtype... $ECHO_C" >&6
13351 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
13352   echo $ECHO_N "(cached) $ECHO_C" >&6
13353 else
13354   ac_check_lib_save_LIBS=$LIBS
13355 LIBS="-lform$cf_cv_libtype  $LIBS"
13356 cat >conftest.$ac_ext <<_ACEOF
13357 #line 13357 "configure"
13358 #include "confdefs.h"
13359
13360 /* Override any gcc2 internal prototype to avoid an error.  */
13361 #ifdef __cplusplus
13362 extern "C"
13363 #endif
13364 /* We use char because int might match the return type of a gcc2
13365    builtin and then its argument prototype would still apply.  */
13366 char form_driver ();
13367 int
13368 main ()
13369 {
13370 form_driver ();
13371   ;
13372   return 0;
13373 }
13374 _ACEOF
13375 rm -f conftest.$ac_objext conftest$ac_exeext
13376 if { (eval echo "$as_me:13376: \"$ac_link\"") >&5
13377   (eval $ac_link) 2>&5
13378   ac_status=$?
13379   echo "$as_me:13379: \$? = $ac_status" >&5
13380   (exit $ac_status); } &&
13381          { ac_try='test -s conftest$ac_exeext'
13382   { (eval echo "$as_me:13382: \"$ac_try\"") >&5
13383   (eval $ac_try) 2>&5
13384   ac_status=$?
13385   echo "$as_me:13385: \$? = $ac_status" >&5
13386   (exit $ac_status); }; }; then
13387   eval "$as_ac_Lib=yes"
13388 else
13389   echo "$as_me: failed program was:" >&5
13390 cat conftest.$ac_ext >&5
13391 eval "$as_ac_Lib=no"
13392 fi
13393 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13394 LIBS=$ac_check_lib_save_LIBS
13395 fi
13396 echo "$as_me:13396: result: `eval echo '${'$as_ac_Lib'}'`" >&5
13397 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
13398 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
13399
13400 cf_upper=`echo "have_libform" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
13401
13402 cf_add_libs="-lform$cf_cv_libtype"
13403 # Filter out duplicates - this happens with badly-designed ".pc" files...
13404 for cf_add_1lib in $LIBS
13405 do
13406         for cf_add_2lib in $cf_add_libs
13407         do
13408                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13409                 then
13410                         cf_add_1lib=
13411                         break
13412                 fi
13413         done
13414         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13415 done
13416 LIBS="$cf_add_libs"
13417
13418 cat >>confdefs.h <<EOF
13419 #define $cf_upper 1
13420 EOF
13421
13422 fi
13423
13424         # look for curses-related headers
13425
13426 for ac_header in \
13427                 nc_alloc.h \
13428                 nomacros.h \
13429                 form.h \
13430                 menu.h \
13431                 panel.h \
13432                 term_entry.h \
13433
13434 do
13435 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
13436 echo "$as_me:13436: checking for $ac_header" >&5
13437 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
13438 if eval "test \"\${$as_ac_Header+set}\" = set"; then
13439   echo $ECHO_N "(cached) $ECHO_C" >&6
13440 else
13441   cat >conftest.$ac_ext <<_ACEOF
13442 #line 13442 "configure"
13443 #include "confdefs.h"
13444 #include <$ac_header>
13445 _ACEOF
13446 if { (eval echo "$as_me:13446: \"$ac_cpp conftest.$ac_ext\"") >&5
13447   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13448   ac_status=$?
13449   egrep -v '^ *\+' conftest.er1 >conftest.err
13450   rm -f conftest.er1
13451   cat conftest.err >&5
13452   echo "$as_me:13452: \$? = $ac_status" >&5
13453   (exit $ac_status); } >/dev/null; then
13454   if test -s conftest.err; then
13455     ac_cpp_err=$ac_c_preproc_warn_flag
13456   else
13457     ac_cpp_err=
13458   fi
13459 else
13460   ac_cpp_err=yes
13461 fi
13462 if test -z "$ac_cpp_err"; then
13463   eval "$as_ac_Header=yes"
13464 else
13465   echo "$as_me: failed program was:" >&5
13466   cat conftest.$ac_ext >&5
13467   eval "$as_ac_Header=no"
13468 fi
13469 rm -f conftest.err conftest.$ac_ext
13470 fi
13471 echo "$as_me:13471: result: `eval echo '${'$as_ac_Header'}'`" >&5
13472 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
13473 if test `eval echo '${'$as_ac_Header'}'` = yes; then
13474   cat >>confdefs.h <<EOF
13475 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
13476 EOF
13477
13478 fi
13479 done
13480
13481         ;;
13482 esac
13483
13484 echo "$as_me:13484: checking for ANSI C header files" >&5
13485 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
13486 if test "${ac_cv_header_stdc+set}" = set; then
13487   echo $ECHO_N "(cached) $ECHO_C" >&6
13488 else
13489   cat >conftest.$ac_ext <<_ACEOF
13490 #line 13490 "configure"
13491 #include "confdefs.h"
13492 #include <stdlib.h>
13493 #include <stdarg.h>
13494 #include <string.h>
13495 #include <float.h>
13496
13497 _ACEOF
13498 if { (eval echo "$as_me:13498: \"$ac_cpp conftest.$ac_ext\"") >&5
13499   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13500   ac_status=$?
13501   egrep -v '^ *\+' conftest.er1 >conftest.err
13502   rm -f conftest.er1
13503   cat conftest.err >&5
13504   echo "$as_me:13504: \$? = $ac_status" >&5
13505   (exit $ac_status); } >/dev/null; then
13506   if test -s conftest.err; then
13507     ac_cpp_err=$ac_c_preproc_warn_flag
13508   else
13509     ac_cpp_err=
13510   fi
13511 else
13512   ac_cpp_err=yes
13513 fi
13514 if test -z "$ac_cpp_err"; then
13515   ac_cv_header_stdc=yes
13516 else
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 conftest.err conftest.$ac_ext
13522
13523 if test $ac_cv_header_stdc = yes; then
13524   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
13525   cat >conftest.$ac_ext <<_ACEOF
13526 #line 13526 "configure"
13527 #include "confdefs.h"
13528 #include <string.h>
13529
13530 _ACEOF
13531 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13532   egrep "memchr" >/dev/null 2>&1; then
13533   :
13534 else
13535   ac_cv_header_stdc=no
13536 fi
13537 rm -rf conftest*
13538
13539 fi
13540
13541 if test $ac_cv_header_stdc = yes; then
13542   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
13543   cat >conftest.$ac_ext <<_ACEOF
13544 #line 13544 "configure"
13545 #include "confdefs.h"
13546 #include <stdlib.h>
13547
13548 _ACEOF
13549 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13550   egrep "free" >/dev/null 2>&1; then
13551   :
13552 else
13553   ac_cv_header_stdc=no
13554 fi
13555 rm -rf conftest*
13556
13557 fi
13558
13559 if test $ac_cv_header_stdc = yes; then
13560   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
13561   if test "$cross_compiling" = yes; then
13562   :
13563 else
13564   cat >conftest.$ac_ext <<_ACEOF
13565 #line 13565 "configure"
13566 #include "confdefs.h"
13567 #include <ctype.h>
13568 #if ((' ' & 0x0FF) == 0x020)
13569 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
13570 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
13571 #else
13572 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
13573                      || ('j' <= (c) && (c) <= 'r') \
13574                      || ('s' <= (c) && (c) <= 'z'))
13575 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
13576 #endif
13577
13578 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
13579 int
13580 main ()
13581 {
13582   int i;
13583   for (i = 0; i < 256; i++)
13584     if (XOR (islower (i), ISLOWER (i))
13585         || toupper (i) != TOUPPER (i))
13586       $ac_main_return(2);
13587   $ac_main_return (0);
13588 }
13589 _ACEOF
13590 rm -f conftest$ac_exeext
13591 if { (eval echo "$as_me:13591: \"$ac_link\"") >&5
13592   (eval $ac_link) 2>&5
13593   ac_status=$?
13594   echo "$as_me:13594: \$? = $ac_status" >&5
13595   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
13596   { (eval echo "$as_me:13596: \"$ac_try\"") >&5
13597   (eval $ac_try) 2>&5
13598   ac_status=$?
13599   echo "$as_me:13599: \$? = $ac_status" >&5
13600   (exit $ac_status); }; }; then
13601   :
13602 else
13603   echo "$as_me: program exited with status $ac_status" >&5
13604 echo "$as_me: failed program was:" >&5
13605 cat conftest.$ac_ext >&5
13606 ac_cv_header_stdc=no
13607 fi
13608 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
13609 fi
13610 fi
13611 fi
13612 echo "$as_me:13612: result: $ac_cv_header_stdc" >&5
13613 echo "${ECHO_T}$ac_cv_header_stdc" >&6
13614 if test $ac_cv_header_stdc = yes; then
13615
13616 cat >>confdefs.h <<\EOF
13617 #define STDC_HEADERS 1
13618 EOF
13619
13620 fi
13621
13622 echo "$as_me:13622: checking whether time.h and sys/time.h may both be included" >&5
13623 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
13624 if test "${ac_cv_header_time+set}" = set; then
13625   echo $ECHO_N "(cached) $ECHO_C" >&6
13626 else
13627   cat >conftest.$ac_ext <<_ACEOF
13628 #line 13628 "configure"
13629 #include "confdefs.h"
13630 #include <sys/types.h>
13631 #include <sys/time.h>
13632 #include <time.h>
13633
13634 int
13635 main ()
13636 {
13637 if ((struct tm *) 0)
13638 return 0;
13639   ;
13640   return 0;
13641 }
13642 _ACEOF
13643 rm -f conftest.$ac_objext
13644 if { (eval echo "$as_me:13644: \"$ac_compile\"") >&5
13645   (eval $ac_compile) 2>&5
13646   ac_status=$?
13647   echo "$as_me:13647: \$? = $ac_status" >&5
13648   (exit $ac_status); } &&
13649          { ac_try='test -s conftest.$ac_objext'
13650   { (eval echo "$as_me:13650: \"$ac_try\"") >&5
13651   (eval $ac_try) 2>&5
13652   ac_status=$?
13653   echo "$as_me:13653: \$? = $ac_status" >&5
13654   (exit $ac_status); }; }; then
13655   ac_cv_header_time=yes
13656 else
13657   echo "$as_me: failed program was:" >&5
13658 cat conftest.$ac_ext >&5
13659 ac_cv_header_time=no
13660 fi
13661 rm -f conftest.$ac_objext conftest.$ac_ext
13662 fi
13663 echo "$as_me:13663: result: $ac_cv_header_time" >&5
13664 echo "${ECHO_T}$ac_cv_header_time" >&6
13665 if test $ac_cv_header_time = yes; then
13666
13667 cat >>confdefs.h <<\EOF
13668 #define TIME_WITH_SYS_TIME 1
13669 EOF
13670
13671 fi
13672
13673 for ac_header in \
13674 getopt.h \
13675 locale.h \
13676 math.h \
13677 stdarg.h \
13678 sys/ioctl.h \
13679 sys/select.h \
13680 sys/time.h \
13681 termios.h \
13682 unistd.h \
13683
13684 do
13685 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
13686 echo "$as_me:13686: checking for $ac_header" >&5
13687 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
13688 if eval "test \"\${$as_ac_Header+set}\" = set"; then
13689   echo $ECHO_N "(cached) $ECHO_C" >&6
13690 else
13691   cat >conftest.$ac_ext <<_ACEOF
13692 #line 13692 "configure"
13693 #include "confdefs.h"
13694 #include <$ac_header>
13695 _ACEOF
13696 if { (eval echo "$as_me:13696: \"$ac_cpp conftest.$ac_ext\"") >&5
13697   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13698   ac_status=$?
13699   egrep -v '^ *\+' conftest.er1 >conftest.err
13700   rm -f conftest.er1
13701   cat conftest.err >&5
13702   echo "$as_me:13702: \$? = $ac_status" >&5
13703   (exit $ac_status); } >/dev/null; then
13704   if test -s conftest.err; then
13705     ac_cpp_err=$ac_c_preproc_warn_flag
13706   else
13707     ac_cpp_err=
13708   fi
13709 else
13710   ac_cpp_err=yes
13711 fi
13712 if test -z "$ac_cpp_err"; then
13713   eval "$as_ac_Header=yes"
13714 else
13715   echo "$as_me: failed program was:" >&5
13716   cat conftest.$ac_ext >&5
13717   eval "$as_ac_Header=no"
13718 fi
13719 rm -f conftest.err conftest.$ac_ext
13720 fi
13721 echo "$as_me:13721: result: `eval echo '${'$as_ac_Header'}'`" >&5
13722 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
13723 if test `eval echo '${'$as_ac_Header'}'` = yes; then
13724   cat >>confdefs.h <<EOF
13725 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
13726 EOF
13727
13728 fi
13729 done
13730
13731 for ac_header in unistd.h getopt.h
13732 do
13733 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
13734 echo "$as_me:13734: checking for $ac_header" >&5
13735 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
13736 if eval "test \"\${$as_ac_Header+set}\" = set"; then
13737   echo $ECHO_N "(cached) $ECHO_C" >&6
13738 else
13739   cat >conftest.$ac_ext <<_ACEOF
13740 #line 13740 "configure"
13741 #include "confdefs.h"
13742 #include <$ac_header>
13743 _ACEOF
13744 if { (eval echo "$as_me:13744: \"$ac_cpp conftest.$ac_ext\"") >&5
13745   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13746   ac_status=$?
13747   egrep -v '^ *\+' conftest.er1 >conftest.err
13748   rm -f conftest.er1
13749   cat conftest.err >&5
13750   echo "$as_me:13750: \$? = $ac_status" >&5
13751   (exit $ac_status); } >/dev/null; then
13752   if test -s conftest.err; then
13753     ac_cpp_err=$ac_c_preproc_warn_flag
13754   else
13755     ac_cpp_err=
13756   fi
13757 else
13758   ac_cpp_err=yes
13759 fi
13760 if test -z "$ac_cpp_err"; then
13761   eval "$as_ac_Header=yes"
13762 else
13763   echo "$as_me: failed program was:" >&5
13764   cat conftest.$ac_ext >&5
13765   eval "$as_ac_Header=no"
13766 fi
13767 rm -f conftest.err conftest.$ac_ext
13768 fi
13769 echo "$as_me:13769: result: `eval echo '${'$as_ac_Header'}'`" >&5
13770 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
13771 if test `eval echo '${'$as_ac_Header'}'` = yes; then
13772   cat >>confdefs.h <<EOF
13773 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
13774 EOF
13775
13776 fi
13777 done
13778
13779 echo "$as_me:13779: checking for header declaring getopt variables" >&5
13780 echo $ECHO_N "checking for header declaring getopt variables... $ECHO_C" >&6
13781 if test "${cf_cv_getopt_header+set}" = set; then
13782   echo $ECHO_N "(cached) $ECHO_C" >&6
13783 else
13784
13785 cf_cv_getopt_header=none
13786 for cf_header in stdio.h stdlib.h unistd.h getopt.h
13787 do
13788 cat >conftest.$ac_ext <<_ACEOF
13789 #line 13789 "configure"
13790 #include "confdefs.h"
13791
13792 #include <$cf_header>
13793 int
13794 main ()
13795 {
13796 int x = optind; char *y = optarg
13797   ;
13798   return 0;
13799 }
13800 _ACEOF
13801 rm -f conftest.$ac_objext
13802 if { (eval echo "$as_me:13802: \"$ac_compile\"") >&5
13803   (eval $ac_compile) 2>&5
13804   ac_status=$?
13805   echo "$as_me:13805: \$? = $ac_status" >&5
13806   (exit $ac_status); } &&
13807          { ac_try='test -s conftest.$ac_objext'
13808   { (eval echo "$as_me:13808: \"$ac_try\"") >&5
13809   (eval $ac_try) 2>&5
13810   ac_status=$?
13811   echo "$as_me:13811: \$? = $ac_status" >&5
13812   (exit $ac_status); }; }; then
13813   cf_cv_getopt_header=$cf_header
13814  break
13815 else
13816   echo "$as_me: failed program was:" >&5
13817 cat conftest.$ac_ext >&5
13818 fi
13819 rm -f conftest.$ac_objext conftest.$ac_ext
13820 done
13821
13822 fi
13823 echo "$as_me:13823: result: $cf_cv_getopt_header" >&5
13824 echo "${ECHO_T}$cf_cv_getopt_header" >&6
13825 if test $cf_cv_getopt_header != none ; then
13826
13827 cat >>confdefs.h <<\EOF
13828 #define HAVE_GETOPT_HEADER 1
13829 EOF
13830
13831 fi
13832 if test $cf_cv_getopt_header = getopt.h ; then
13833
13834 cat >>confdefs.h <<\EOF
13835 #define NEED_GETOPT_H 1
13836 EOF
13837
13838 fi
13839
13840 for ac_func in \
13841 getopt \
13842 gettimeofday \
13843
13844 do
13845 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
13846 echo "$as_me:13846: checking for $ac_func" >&5
13847 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
13848 if eval "test \"\${$as_ac_var+set}\" = set"; then
13849   echo $ECHO_N "(cached) $ECHO_C" >&6
13850 else
13851   cat >conftest.$ac_ext <<_ACEOF
13852 #line 13852 "configure"
13853 #include "confdefs.h"
13854 /* System header to define __stub macros and hopefully few prototypes,
13855     which can conflict with char $ac_func (); below.  */
13856 #include <assert.h>
13857 /* Override any gcc2 internal prototype to avoid an error.  */
13858 #ifdef __cplusplus
13859 extern "C"
13860 #endif
13861 /* We use char because int might match the return type of a gcc2
13862    builtin and then its argument prototype would still apply.  */
13863 char $ac_func ();
13864 char (*f) ();
13865
13866 int
13867 main ()
13868 {
13869 /* The GNU C library defines this for functions which it implements
13870     to always fail with ENOSYS.  Some functions are actually named
13871     something starting with __ and the normal name is an alias.  */
13872 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
13873 choke me
13874 #else
13875 f = $ac_func; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
13876 #endif
13877
13878   ;
13879   return 0;
13880 }
13881 _ACEOF
13882 rm -f conftest.$ac_objext conftest$ac_exeext
13883 if { (eval echo "$as_me:13883: \"$ac_link\"") >&5
13884   (eval $ac_link) 2>&5
13885   ac_status=$?
13886   echo "$as_me:13886: \$? = $ac_status" >&5
13887   (exit $ac_status); } &&
13888          { ac_try='test -s conftest$ac_exeext'
13889   { (eval echo "$as_me:13889: \"$ac_try\"") >&5
13890   (eval $ac_try) 2>&5
13891   ac_status=$?
13892   echo "$as_me:13892: \$? = $ac_status" >&5
13893   (exit $ac_status); }; }; then
13894   eval "$as_ac_var=yes"
13895 else
13896   echo "$as_me: failed program was:" >&5
13897 cat conftest.$ac_ext >&5
13898 eval "$as_ac_var=no"
13899 fi
13900 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13901 fi
13902 echo "$as_me:13902: result: `eval echo '${'$as_ac_var'}'`" >&5
13903 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
13904 if test `eval echo '${'$as_ac_var'}'` = yes; then
13905   cat >>confdefs.h <<EOF
13906 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
13907 EOF
13908
13909 fi
13910 done
13911
13912 if test "x$ac_cv_func_getopt" = xno; then
13913         { { echo "$as_me:13913: error: getopt is required for building programs" >&5
13914 echo "$as_me: error: getopt is required for building programs" >&2;}
13915    { (exit 1); exit 1; }; }
13916 fi
13917
13918 if test "$cf_enable_widec" = yes; then
13919
13920 for ac_func in \
13921 mblen \
13922 mbrlen \
13923 mbrtowc \
13924 mbsrtowcs \
13925 mbstowcs \
13926 mbtowc \
13927 wcsrtombs \
13928 wcstombs \
13929
13930 do
13931 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
13932 echo "$as_me:13932: checking for $ac_func" >&5
13933 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
13934 if eval "test \"\${$as_ac_var+set}\" = set"; then
13935   echo $ECHO_N "(cached) $ECHO_C" >&6
13936 else
13937   cat >conftest.$ac_ext <<_ACEOF
13938 #line 13938 "configure"
13939 #include "confdefs.h"
13940 /* System header to define __stub macros and hopefully few prototypes,
13941     which can conflict with char $ac_func (); below.  */
13942 #include <assert.h>
13943 /* Override any gcc2 internal prototype to avoid an error.  */
13944 #ifdef __cplusplus
13945 extern "C"
13946 #endif
13947 /* We use char because int might match the return type of a gcc2
13948    builtin and then its argument prototype would still apply.  */
13949 char $ac_func ();
13950 char (*f) ();
13951
13952 int
13953 main ()
13954 {
13955 /* The GNU C library defines this for functions which it implements
13956     to always fail with ENOSYS.  Some functions are actually named
13957     something starting with __ and the normal name is an alias.  */
13958 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
13959 choke me
13960 #else
13961 f = $ac_func; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
13962 #endif
13963
13964   ;
13965   return 0;
13966 }
13967 _ACEOF
13968 rm -f conftest.$ac_objext conftest$ac_exeext
13969 if { (eval echo "$as_me:13969: \"$ac_link\"") >&5
13970   (eval $ac_link) 2>&5
13971   ac_status=$?
13972   echo "$as_me:13972: \$? = $ac_status" >&5
13973   (exit $ac_status); } &&
13974          { ac_try='test -s conftest$ac_exeext'
13975   { (eval echo "$as_me:13975: \"$ac_try\"") >&5
13976   (eval $ac_try) 2>&5
13977   ac_status=$?
13978   echo "$as_me:13978: \$? = $ac_status" >&5
13979   (exit $ac_status); }; }; then
13980   eval "$as_ac_var=yes"
13981 else
13982   echo "$as_me: failed program was:" >&5
13983 cat conftest.$ac_ext >&5
13984 eval "$as_ac_var=no"
13985 fi
13986 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13987 fi
13988 echo "$as_me:13988: result: `eval echo '${'$as_ac_var'}'`" >&5
13989 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
13990 if test `eval echo '${'$as_ac_var'}'` = yes; then
13991   cat >>confdefs.h <<EOF
13992 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
13993 EOF
13994
13995 fi
13996 done
13997
13998 fi
13999
14000 echo "$as_me:14000: checking definition to turn on extended curses functions" >&5
14001 echo $ECHO_N "checking definition to turn on extended curses functions... $ECHO_C" >&6
14002 if test "${cf_cv_need_xopen_extension+set}" = set; then
14003   echo $ECHO_N "(cached) $ECHO_C" >&6
14004 else
14005
14006 cf_cv_need_xopen_extension=unknown
14007 cat >conftest.$ac_ext <<_ACEOF
14008 #line 14008 "configure"
14009 #include "confdefs.h"
14010
14011 #include <stdlib.h>
14012 #include <${cf_cv_ncurses_header:-curses.h}>
14013 int
14014 main ()
14015 {
14016
14017 #if defined(NCURSES_VERSION_PATCH)
14018 #if (NCURSES_VERSION_PATCH < 20100501) && (NCURSES_VERSION_PATCH >= 20100403)
14019         make an error
14020 #endif
14021 #endif
14022 #ifdef NCURSES_VERSION
14023         cchar_t check;
14024         int check2 = curs_set((int)sizeof(check));
14025 #endif
14026         long x = winnstr(stdscr, "", 0);
14027         int x1, y1;
14028         getbegyx(stdscr, y1, x1)
14029   ;
14030   return 0;
14031 }
14032 _ACEOF
14033 rm -f conftest.$ac_objext conftest$ac_exeext
14034 if { (eval echo "$as_me:14034: \"$ac_link\"") >&5
14035   (eval $ac_link) 2>&5
14036   ac_status=$?
14037   echo "$as_me:14037: \$? = $ac_status" >&5
14038   (exit $ac_status); } &&
14039          { ac_try='test -s conftest$ac_exeext'
14040   { (eval echo "$as_me:14040: \"$ac_try\"") >&5
14041   (eval $ac_try) 2>&5
14042   ac_status=$?
14043   echo "$as_me:14043: \$? = $ac_status" >&5
14044   (exit $ac_status); }; }; then
14045   cf_cv_need_xopen_extension=none
14046 else
14047   echo "$as_me: failed program was:" >&5
14048 cat conftest.$ac_ext >&5
14049
14050         for cf_try_xopen_extension in _XOPEN_SOURCE_EXTENDED NCURSES_WIDECHAR
14051         do
14052                 cat >conftest.$ac_ext <<_ACEOF
14053 #line 14053 "configure"
14054 #include "confdefs.h"
14055
14056 #define $cf_try_xopen_extension 1
14057 #include <stdlib.h>
14058 #include <${cf_cv_ncurses_header:-curses.h}>
14059 int
14060 main ()
14061 {
14062
14063 #ifdef NCURSES_VERSION
14064                 cchar_t check;
14065                 int check2 = curs_set((int)sizeof(check));
14066 #endif
14067                 long x = winnstr(stdscr, "", 0);
14068                 int x1, y1;
14069                 getbegyx(stdscr, y1, x1)
14070   ;
14071   return 0;
14072 }
14073 _ACEOF
14074 rm -f conftest.$ac_objext conftest$ac_exeext
14075 if { (eval echo "$as_me:14075: \"$ac_link\"") >&5
14076   (eval $ac_link) 2>&5
14077   ac_status=$?
14078   echo "$as_me:14078: \$? = $ac_status" >&5
14079   (exit $ac_status); } &&
14080          { ac_try='test -s conftest$ac_exeext'
14081   { (eval echo "$as_me:14081: \"$ac_try\"") >&5
14082   (eval $ac_try) 2>&5
14083   ac_status=$?
14084   echo "$as_me:14084: \$? = $ac_status" >&5
14085   (exit $ac_status); }; }; then
14086   cf_cv_need_xopen_extension=$cf_try_xopen_extension; break
14087 else
14088   echo "$as_me: failed program was:" >&5
14089 cat conftest.$ac_ext >&5
14090 fi
14091 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14092         done
14093
14094 fi
14095 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14096
14097 fi
14098 echo "$as_me:14098: result: $cf_cv_need_xopen_extension" >&5
14099 echo "${ECHO_T}$cf_cv_need_xopen_extension" >&6
14100
14101 case $cf_cv_need_xopen_extension in
14102 (*_*)
14103         CPPFLAGS="$CPPFLAGS -D$cf_cv_need_xopen_extension"
14104         ;;
14105 esac
14106
14107 echo "$as_me:14107: checking for term.h" >&5
14108 echo $ECHO_N "checking for term.h... $ECHO_C" >&6
14109 if test "${cf_cv_term_header+set}" = set; then
14110   echo $ECHO_N "(cached) $ECHO_C" >&6
14111 else
14112
14113 # If we found <ncurses/curses.h>, look for <ncurses/term.h>, but always look
14114 # for <term.h> if we do not find the variant.
14115
14116 cf_header_list="term.h ncurses/term.h ncursesw/term.h"
14117
14118 case ${cf_cv_ncurses_header:-curses.h} in
14119 (*/*)
14120         cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`term.h
14121         cf_header_list="$cf_header_item $cf_header_list"
14122         ;;
14123 esac
14124
14125 for cf_header in $cf_header_list
14126 do
14127         cat >conftest.$ac_ext <<_ACEOF
14128 #line 14128 "configure"
14129 #include "confdefs.h"
14130
14131 #include <${cf_cv_ncurses_header:-curses.h}>
14132 #include <${cf_header}>
14133 int
14134 main ()
14135 {
14136 WINDOW *x
14137   ;
14138   return 0;
14139 }
14140 _ACEOF
14141 rm -f conftest.$ac_objext
14142 if { (eval echo "$as_me:14142: \"$ac_compile\"") >&5
14143   (eval $ac_compile) 2>&5
14144   ac_status=$?
14145   echo "$as_me:14145: \$? = $ac_status" >&5
14146   (exit $ac_status); } &&
14147          { ac_try='test -s conftest.$ac_objext'
14148   { (eval echo "$as_me:14148: \"$ac_try\"") >&5
14149   (eval $ac_try) 2>&5
14150   ac_status=$?
14151   echo "$as_me:14151: \$? = $ac_status" >&5
14152   (exit $ac_status); }; }; then
14153   cf_cv_term_header=$cf_header
14154          break
14155 else
14156   echo "$as_me: failed program was:" >&5
14157 cat conftest.$ac_ext >&5
14158 cf_cv_term_header=no
14159 fi
14160 rm -f conftest.$ac_objext conftest.$ac_ext
14161 done
14162
14163 case $cf_cv_term_header in
14164 (no)
14165         # If curses is ncurses, some packagers still mess it up by trying to make
14166         # us use GNU termcap.  This handles the most common case.
14167         for cf_header in ncurses/term.h ncursesw/term.h
14168         do
14169                 cat >conftest.$ac_ext <<_ACEOF
14170 #line 14170 "configure"
14171 #include "confdefs.h"
14172
14173 #include <${cf_cv_ncurses_header:-curses.h}>
14174 #ifdef NCURSES_VERSION
14175 #include <${cf_header}>
14176 #else
14177 make an error
14178 #endif
14179 int
14180 main ()
14181 {
14182 WINDOW *x
14183   ;
14184   return 0;
14185 }
14186 _ACEOF
14187 rm -f conftest.$ac_objext
14188 if { (eval echo "$as_me:14188: \"$ac_compile\"") >&5
14189   (eval $ac_compile) 2>&5
14190   ac_status=$?
14191   echo "$as_me:14191: \$? = $ac_status" >&5
14192   (exit $ac_status); } &&
14193          { ac_try='test -s conftest.$ac_objext'
14194   { (eval echo "$as_me:14194: \"$ac_try\"") >&5
14195   (eval $ac_try) 2>&5
14196   ac_status=$?
14197   echo "$as_me:14197: \$? = $ac_status" >&5
14198   (exit $ac_status); }; }; then
14199   cf_cv_term_header=$cf_header
14200                          break
14201 else
14202   echo "$as_me: failed program was:" >&5
14203 cat conftest.$ac_ext >&5
14204 cf_cv_term_header=no
14205 fi
14206 rm -f conftest.$ac_objext conftest.$ac_ext
14207         done
14208         ;;
14209 esac
14210
14211 fi
14212 echo "$as_me:14212: result: $cf_cv_term_header" >&5
14213 echo "${ECHO_T}$cf_cv_term_header" >&6
14214
14215 case $cf_cv_term_header in
14216 (term.h)
14217
14218 cat >>confdefs.h <<\EOF
14219 #define HAVE_TERM_H 1
14220 EOF
14221
14222         ;;
14223 (ncurses/term.h)
14224
14225 cat >>confdefs.h <<\EOF
14226 #define HAVE_NCURSES_TERM_H 1
14227 EOF
14228
14229         ;;
14230 (ncursesw/term.h)
14231
14232 cat >>confdefs.h <<\EOF
14233 #define HAVE_NCURSESW_TERM_H 1
14234 EOF
14235
14236         ;;
14237 esac
14238
14239 echo "$as_me:14239: checking for unctrl.h" >&5
14240 echo $ECHO_N "checking for unctrl.h... $ECHO_C" >&6
14241 if test "${cf_cv_unctrl_header+set}" = set; then
14242   echo $ECHO_N "(cached) $ECHO_C" >&6
14243 else
14244
14245 # If we found <ncurses/curses.h>, look for <ncurses/unctrl.h>, but always look
14246 # for <unctrl.h> if we do not find the variant.
14247
14248 cf_header_list="unctrl.h ncurses/unctrl.h ncursesw/unctrl.h"
14249
14250 case ${cf_cv_ncurses_header:-curses.h} in
14251 (*/*)
14252         cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`unctrl.h
14253         cf_header_list="$cf_header_item $cf_header_list"
14254         ;;
14255 esac
14256
14257 for cf_header in $cf_header_list
14258 do
14259         cat >conftest.$ac_ext <<_ACEOF
14260 #line 14260 "configure"
14261 #include "confdefs.h"
14262
14263 #include <${cf_cv_ncurses_header:-curses.h}>
14264 #include <${cf_header}>
14265 int
14266 main ()
14267 {
14268 WINDOW *x
14269   ;
14270   return 0;
14271 }
14272 _ACEOF
14273 rm -f conftest.$ac_objext
14274 if { (eval echo "$as_me:14274: \"$ac_compile\"") >&5
14275   (eval $ac_compile) 2>&5
14276   ac_status=$?
14277   echo "$as_me:14277: \$? = $ac_status" >&5
14278   (exit $ac_status); } &&
14279          { ac_try='test -s conftest.$ac_objext'
14280   { (eval echo "$as_me:14280: \"$ac_try\"") >&5
14281   (eval $ac_try) 2>&5
14282   ac_status=$?
14283   echo "$as_me:14283: \$? = $ac_status" >&5
14284   (exit $ac_status); }; }; then
14285   cf_cv_unctrl_header=$cf_header
14286          break
14287 else
14288   echo "$as_me: failed program was:" >&5
14289 cat conftest.$ac_ext >&5
14290 cf_cv_unctrl_header=no
14291 fi
14292 rm -f conftest.$ac_objext conftest.$ac_ext
14293 done
14294
14295 fi
14296 echo "$as_me:14296: result: $cf_cv_unctrl_header" >&5
14297 echo "${ECHO_T}$cf_cv_unctrl_header" >&6
14298
14299 case $cf_cv_unctrl_header in
14300 (no)
14301         { echo "$as_me:14301: WARNING: unctrl.h header not found" >&5
14302 echo "$as_me: WARNING: unctrl.h header not found" >&2;}
14303         ;;
14304 esac
14305
14306 case $cf_cv_unctrl_header in
14307 (unctrl.h)
14308
14309 cat >>confdefs.h <<\EOF
14310 #define HAVE_UNCTRL_H 1
14311 EOF
14312
14313         ;;
14314 (ncurses/unctrl.h)
14315
14316 cat >>confdefs.h <<\EOF
14317 #define HAVE_NCURSES_UNCTRL_H 1
14318 EOF
14319
14320         ;;
14321 (ncursesw/unctrl.h)
14322
14323 cat >>confdefs.h <<\EOF
14324 #define HAVE_NCURSESW_UNCTRL_H 1
14325 EOF
14326
14327         ;;
14328 esac
14329
14330 for cf_func in \
14331 assume_default_colors \
14332 chgat \
14333 color_set \
14334 filter \
14335 getbegx \
14336 getcurx \
14337 getmaxx \
14338 getnstr \
14339 getparx \
14340 getwin \
14341 mvvline \
14342 mvwvline \
14343 napms \
14344 putwin \
14345 resize_term \
14346 resizeterm \
14347 ripoffline \
14348 scr_dump \
14349 setupterm \
14350 slk_color \
14351 slk_init \
14352 termattrs \
14353 tgetent \
14354 tigetnum \
14355 tigetstr \
14356 typeahead \
14357 use_default_colors \
14358 use_env \
14359 use_extended_names \
14360 use_screen \
14361 use_window \
14362 vid_puts \
14363 vidputs \
14364 vsscanf \
14365 vw_printw \
14366 wchgat \
14367 winsstr \
14368 wresize \
14369 wsyncdown \
14370
14371 do
14372
14373 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14374
14375         echo "$as_me:14375: checking for ${cf_func}" >&5
14376 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
14377
14378 echo "${as_me:-configure}:14378: testing ${cf_func} ..." 1>&5
14379
14380         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
14381   echo $ECHO_N "(cached) $ECHO_C" >&6
14382 else
14383
14384                 eval cf_result='$ac_cv_func_'$cf_func
14385                 if test ".$cf_result" != ".no"; then
14386                         cat >conftest.$ac_ext <<_ACEOF
14387 #line 14387 "configure"
14388 #include "confdefs.h"
14389
14390 #ifdef HAVE_XCURSES
14391 #include <xcurses.h>
14392 char * XCursesProgramName = "test";
14393 #else
14394 #include <${cf_cv_ncurses_header:-curses.h}>
14395 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
14396 #include <ncursesw/term.h>
14397 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
14398 #include <ncurses/term.h>
14399 #elif defined(HAVE_TERM_H)
14400 #include <term.h>
14401 #endif
14402 #endif
14403
14404 int
14405 main ()
14406 {
14407
14408 #ifndef ${cf_func}
14409 long foo = (long)(&${cf_func});
14410 fprintf(stderr, "testing linkage of $cf_func:%p\n", foo);
14411 if (foo + 1234 > 5678)
14412         ${cf_cv_main_return:-return}(foo);
14413 #endif
14414
14415   ;
14416   return 0;
14417 }
14418 _ACEOF
14419 rm -f conftest.$ac_objext conftest$ac_exeext
14420 if { (eval echo "$as_me:14420: \"$ac_link\"") >&5
14421   (eval $ac_link) 2>&5
14422   ac_status=$?
14423   echo "$as_me:14423: \$? = $ac_status" >&5
14424   (exit $ac_status); } &&
14425          { ac_try='test -s conftest$ac_exeext'
14426   { (eval echo "$as_me:14426: \"$ac_try\"") >&5
14427   (eval $ac_try) 2>&5
14428   ac_status=$?
14429   echo "$as_me:14429: \$? = $ac_status" >&5
14430   (exit $ac_status); }; }; then
14431   cf_result=yes
14432 else
14433   echo "$as_me: failed program was:" >&5
14434 cat conftest.$ac_ext >&5
14435 cf_result=no
14436 fi
14437 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14438                 fi
14439                 eval 'cf_cv_func_'$cf_func'=$cf_result'
14440
14441 fi
14442
14443         # use the computed/retrieved cache-value:
14444         eval 'cf_result=$cf_cv_func_'$cf_func
14445         echo "$as_me:14445: result: $cf_result" >&5
14446 echo "${ECHO_T}$cf_result" >&6
14447         if test $cf_result != no; then
14448                 cat >>confdefs.h <<EOF
14449 #define HAVE_${cf_tr_func} 1
14450 EOF
14451
14452         fi
14453 done
14454
14455 for cf_func in tputs
14456 do
14457
14458 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14459
14460         echo "$as_me:14460: checking for ${cf_func}" >&5
14461 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
14462
14463 echo "${as_me:-configure}:14463: testing ${cf_func} ..." 1>&5
14464
14465         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
14466   echo $ECHO_N "(cached) $ECHO_C" >&6
14467 else
14468
14469                 eval cf_result='$ac_cv_func_'$cf_func
14470                 if test ".$cf_result" != ".no"; then
14471                         cat >conftest.$ac_ext <<_ACEOF
14472 #line 14472 "configure"
14473 #include "confdefs.h"
14474
14475 #ifdef HAVE_XCURSES
14476 #include <xcurses.h>
14477 char * XCursesProgramName = "test";
14478 #else
14479 #include <${cf_cv_ncurses_header:-curses.h}>
14480 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
14481 #include <ncursesw/term.h>
14482 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
14483 #include <ncurses/term.h>
14484 #elif defined(HAVE_TERM_H)
14485 #include <term.h>
14486 #endif
14487 #endif
14488
14489 int
14490 main ()
14491 {
14492
14493 #ifndef ${cf_func}
14494 long foo = (long)(&${cf_func});
14495 fprintf(stderr, "testing linkage of $cf_func:%p\n", foo);
14496 if (foo + 1234 > 5678)
14497         ${cf_cv_main_return:-return}(foo);
14498 #endif
14499
14500   ;
14501   return 0;
14502 }
14503 _ACEOF
14504 rm -f conftest.$ac_objext conftest$ac_exeext
14505 if { (eval echo "$as_me:14505: \"$ac_link\"") >&5
14506   (eval $ac_link) 2>&5
14507   ac_status=$?
14508   echo "$as_me:14508: \$? = $ac_status" >&5
14509   (exit $ac_status); } &&
14510          { ac_try='test -s conftest$ac_exeext'
14511   { (eval echo "$as_me:14511: \"$ac_try\"") >&5
14512   (eval $ac_try) 2>&5
14513   ac_status=$?
14514   echo "$as_me:14514: \$? = $ac_status" >&5
14515   (exit $ac_status); }; }; then
14516   cf_result=yes
14517 else
14518   echo "$as_me: failed program was:" >&5
14519 cat conftest.$ac_ext >&5
14520 cf_result=no
14521 fi
14522 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14523                 fi
14524                 eval 'cf_cv_func_'$cf_func'=$cf_result'
14525
14526 fi
14527
14528         # use the computed/retrieved cache-value:
14529         eval 'cf_result=$cf_cv_func_'$cf_func
14530         echo "$as_me:14530: result: $cf_result" >&5
14531 echo "${ECHO_T}$cf_result" >&6
14532         if test $cf_result != no; then
14533                 cat >>confdefs.h <<EOF
14534 #define HAVE_${cf_tr_func} 1
14535 EOF
14536
14537         fi
14538 done
14539
14540 if test x$cf_cv_func_tputs = xyes
14541 then
14542         cf_done=no
14543         for cf_arg in int char
14544         do
14545                 for cf_ret in int void
14546                 do
14547                         if test $cf_ret = void
14548                         then
14549                                 cf_return="/* nothing */"
14550                         else
14551                                 cf_return="return value"
14552                         fi
14553                         cat >conftest.$ac_ext <<_ACEOF
14554 #line 14554 "configure"
14555 #include "confdefs.h"
14556
14557 #include <${cf_cv_ncurses_header:-curses.h}>
14558 #include <$cf_cv_term_header>
14559
14560 static $cf_ret outc($cf_arg value) { $cf_return; }
14561
14562 int
14563 main ()
14564 {
14565
14566         tputs("hello", 0, outc);
14567         ${cf_cv_main_return:-return}(0);
14568
14569   ;
14570   return 0;
14571 }
14572 _ACEOF
14573 rm -f conftest.$ac_objext
14574 if { (eval echo "$as_me:14574: \"$ac_compile\"") >&5
14575   (eval $ac_compile) 2>&5
14576   ac_status=$?
14577   echo "$as_me:14577: \$? = $ac_status" >&5
14578   (exit $ac_status); } &&
14579          { ac_try='test -s conftest.$ac_objext'
14580   { (eval echo "$as_me:14580: \"$ac_try\"") >&5
14581   (eval $ac_try) 2>&5
14582   ac_status=$?
14583   echo "$as_me:14583: \$? = $ac_status" >&5
14584   (exit $ac_status); }; }; then
14585
14586                 test -n "$verbose" && echo "    prototype $cf_ret func($cf_arg value)" 1>&6
14587
14588 echo "${as_me:-configure}:14588: testing prototype $cf_ret func($cf_arg value) ..." 1>&5
14589
14590                 cat >>confdefs.h <<EOF
14591 #define TPUTS_ARG               $cf_arg
14592 #define TPUTS_PROTO(func,value) $cf_ret func(TPUTS_ARG value)
14593 #define TPUTS_RETURN(value)     $cf_return
14594 EOF
14595                 cf_done=yes
14596                 break
14597
14598 else
14599   echo "$as_me: failed program was:" >&5
14600 cat conftest.$ac_ext >&5
14601 fi
14602 rm -f conftest.$ac_objext conftest.$ac_ext
14603                 done
14604                 test $cf_done = yes && break
14605         done
14606 fi
14607
14608 echo "$as_me:14608: checking for ncurses extended functions" >&5
14609 echo $ECHO_N "checking for ncurses extended functions... $ECHO_C" >&6
14610 if test "${cf_cv_ncurses_ext_funcs+set}" = set; then
14611   echo $ECHO_N "(cached) $ECHO_C" >&6
14612 else
14613
14614 cat >conftest.$ac_ext <<_ACEOF
14615 #line 14615 "configure"
14616 #include "confdefs.h"
14617
14618 #include <${cf_cv_ncurses_header:-curses.h}>
14619 int
14620 main ()
14621 {
14622
14623 int x = NCURSES_EXT_FUNCS
14624
14625   ;
14626   return 0;
14627 }
14628 _ACEOF
14629 rm -f conftest.$ac_objext
14630 if { (eval echo "$as_me:14630: \"$ac_compile\"") >&5
14631   (eval $ac_compile) 2>&5
14632   ac_status=$?
14633   echo "$as_me:14633: \$? = $ac_status" >&5
14634   (exit $ac_status); } &&
14635          { ac_try='test -s conftest.$ac_objext'
14636   { (eval echo "$as_me:14636: \"$ac_try\"") >&5
14637   (eval $ac_try) 2>&5
14638   ac_status=$?
14639   echo "$as_me:14639: \$? = $ac_status" >&5
14640   (exit $ac_status); }; }; then
14641   cf_cv_ncurses_ext_funcs=defined
14642 else
14643   echo "$as_me: failed program was:" >&5
14644 cat conftest.$ac_ext >&5
14645
14646 cat >conftest.$ac_ext <<_ACEOF
14647 #line 14647 "configure"
14648 #include "confdefs.h"
14649
14650 #include <${cf_cv_ncurses_header:-curses.h}>
14651 int
14652 main ()
14653 {
14654
14655         (void) assume_default_colors (0, 0);
14656         (void) curses_version ();
14657         (void) define_key (0, 0);
14658         (void) is_term_resized (0, 0);
14659         (void) key_defined (0);
14660         (void) keybound (0, 0);
14661         (void) keyok (0, 0);
14662         (void) resize_term (0, 0);
14663         (void) resizeterm (0, 0);
14664         (void) use_default_colors ();
14665         (void) use_extended_names (0);
14666         (void) wresize (0, 0, 0);
14667   ;
14668   return 0;
14669 }
14670 _ACEOF
14671 rm -f conftest.$ac_objext conftest$ac_exeext
14672 if { (eval echo "$as_me:14672: \"$ac_link\"") >&5
14673   (eval $ac_link) 2>&5
14674   ac_status=$?
14675   echo "$as_me:14675: \$? = $ac_status" >&5
14676   (exit $ac_status); } &&
14677          { ac_try='test -s conftest$ac_exeext'
14678   { (eval echo "$as_me:14678: \"$ac_try\"") >&5
14679   (eval $ac_try) 2>&5
14680   ac_status=$?
14681   echo "$as_me:14681: \$? = $ac_status" >&5
14682   (exit $ac_status); }; }; then
14683   cf_cv_ncurses_ext_funcs=yes
14684 else
14685   echo "$as_me: failed program was:" >&5
14686 cat conftest.$ac_ext >&5
14687 cf_cv_ncurses_ext_funcs=no
14688 fi
14689 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14690
14691 fi
14692 rm -f conftest.$ac_objext conftest.$ac_ext
14693
14694 fi
14695 echo "$as_me:14695: result: $cf_cv_ncurses_ext_funcs" >&5
14696 echo "${ECHO_T}$cf_cv_ncurses_ext_funcs" >&6
14697 test "$cf_cv_ncurses_ext_funcs" = yes &&
14698 cat >>confdefs.h <<\EOF
14699 #define NCURSES_EXT_FUNCS 1
14700 EOF
14701
14702 if test "$cf_enable_widec" = yes
14703 then
14704         # workaround for systems with ncurses before 20111029, due to change of
14705         # feature test macro from _XPG5 to _XOPEN_SOURCE
14706         if test -n "$cf_cv_ncurses_version" && test "x$cf_cv_ncurses_version" != xno
14707         then
14708                 cf_define_xpg5=no
14709                 echo "$as_me:14709: checking if _XPG5 should be defined to enable wide-characters" >&5
14710 echo $ECHO_N "checking if _XPG5 should be defined to enable wide-characters... $ECHO_C" >&6
14711
14712                 cat >conftest.$ac_ext <<_ACEOF
14713 #line 14713 "configure"
14714 #include "confdefs.h"
14715
14716 #include <${cf_cv_ncurses_header:-curses.h}>
14717 int
14718 main ()
14719 {
14720 int x = _XPG5
14721   ;
14722   return 0;
14723 }
14724 _ACEOF
14725 rm -f conftest.$ac_objext
14726 if { (eval echo "$as_me:14726: \"$ac_compile\"") >&5
14727   (eval $ac_compile) 2>&5
14728   ac_status=$?
14729   echo "$as_me:14729: \$? = $ac_status" >&5
14730   (exit $ac_status); } &&
14731          { ac_try='test -s conftest.$ac_objext'
14732   { (eval echo "$as_me:14732: \"$ac_try\"") >&5
14733   (eval $ac_try) 2>&5
14734   ac_status=$?
14735   echo "$as_me:14735: \$? = $ac_status" >&5
14736   (exit $ac_status); }; }; then
14737   :
14738 else
14739   echo "$as_me: failed program was:" >&5
14740 cat conftest.$ac_ext >&5
14741 cf_save_cppflags="$CPPFLAGS"
14742                          CPPFLAGS="$CPPFLAGS -D_XPG5"
14743                          cat >conftest.$ac_ext <<_ACEOF
14744 #line 14744 "configure"
14745 #include "confdefs.h"
14746
14747 #include <${cf_cv_ncurses_header:-curses.h}>
14748 int
14749 main ()
14750 {
14751 int x = _XPG5
14752   ;
14753   return 0;
14754 }
14755 _ACEOF
14756 rm -f conftest.$ac_objext
14757 if { (eval echo "$as_me:14757: \"$ac_compile\"") >&5
14758   (eval $ac_compile) 2>&5
14759   ac_status=$?
14760   echo "$as_me:14760: \$? = $ac_status" >&5
14761   (exit $ac_status); } &&
14762          { ac_try='test -s conftest.$ac_objext'
14763   { (eval echo "$as_me:14763: \"$ac_try\"") >&5
14764   (eval $ac_try) 2>&5
14765   ac_status=$?
14766   echo "$as_me:14766: \$? = $ac_status" >&5
14767   (exit $ac_status); }; }; then
14768   cf_define_xpg5=yes
14769 else
14770   echo "$as_me: failed program was:" >&5
14771 cat conftest.$ac_ext >&5
14772 fi
14773 rm -f conftest.$ac_objext conftest.$ac_ext
14774                          CPPFLAGS="$cf_save_cppflags"
14775 fi
14776 rm -f conftest.$ac_objext conftest.$ac_ext
14777                 echo "$as_me:14777: result: $cf_define_xpg5" >&5
14778 echo "${ECHO_T}$cf_define_xpg5" >&6
14779
14780                 if test "$cf_define_xpg5" = yes
14781                 then
14782                         CPPFLAGS="$CPPFLAGS -D_XPG5"
14783                 fi
14784         fi
14785
14786         echo "$as_me:14786: checking for wide-character functions" >&5
14787 echo $ECHO_N "checking for wide-character functions... $ECHO_C" >&6
14788 if test "${cf_cv_widechar_funcs+set}" = set; then
14789   echo $ECHO_N "(cached) $ECHO_C" >&6
14790 else
14791
14792         cat >conftest.$ac_ext <<_ACEOF
14793 #line 14793 "configure"
14794 #include "confdefs.h"
14795
14796 #include <${cf_cv_ncurses_header:-curses.h}>
14797 int
14798 main ()
14799 {
14800
14801                 static wchar_t src_wchar[2];
14802                 static cchar_t dst_cchar;
14803                 setcchar(&dst_cchar, src_wchar, A_NORMAL, 0, (void *) 0);
14804
14805   ;
14806   return 0;
14807 }
14808 _ACEOF
14809 rm -f conftest.$ac_objext conftest$ac_exeext
14810 if { (eval echo "$as_me:14810: \"$ac_link\"") >&5
14811   (eval $ac_link) 2>&5
14812   ac_status=$?
14813   echo "$as_me:14813: \$? = $ac_status" >&5
14814   (exit $ac_status); } &&
14815          { ac_try='test -s conftest$ac_exeext'
14816   { (eval echo "$as_me:14816: \"$ac_try\"") >&5
14817   (eval $ac_try) 2>&5
14818   ac_status=$?
14819   echo "$as_me:14819: \$? = $ac_status" >&5
14820   (exit $ac_status); }; }; then
14821   cf_cv_widechar_funcs=yes
14822 else
14823   echo "$as_me: failed program was:" >&5
14824 cat conftest.$ac_ext >&5
14825 cf_cv_widechar_funcs=no
14826 fi
14827 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14828
14829 fi
14830 echo "$as_me:14830: result: $cf_cv_widechar_funcs" >&5
14831 echo "${ECHO_T}$cf_cv_widechar_funcs" >&6
14832         if test "$cf_cv_widechar_funcs" != no ; then
14833
14834 cat >>confdefs.h <<\EOF
14835 #define USE_WIDEC_SUPPORT 1
14836 EOF
14837
14838         else
14839                 cat >>confdefs.h <<\EOF
14840 #define USE_WIDEC_SUPPORT 0
14841 EOF
14842
14843         fi
14844 else
14845         cat >>confdefs.h <<\EOF
14846 #define USE_WIDEC_SUPPORT 0
14847 EOF
14848
14849 fi
14850
14851 echo "$as_me:14851: checking if $cf_cv_screen library uses pthreads" >&5
14852 echo $ECHO_N "checking if $cf_cv_screen library uses pthreads... $ECHO_C" >&6
14853 if test "${cf_cv_use_pthreads+set}" = set; then
14854   echo $ECHO_N "(cached) $ECHO_C" >&6
14855 else
14856
14857 cat >conftest.$ac_ext <<_ACEOF
14858 #line 14858 "configure"
14859 #include "confdefs.h"
14860
14861 #include <${cf_cv_ncurses_header:-curses.h}>
14862 extern void _nc_init_pthreads(void);
14863
14864 int
14865 main ()
14866 {
14867
14868         initscr();
14869         _nc_init_pthreads();
14870
14871   ;
14872   return 0;
14873 }
14874 _ACEOF
14875 rm -f conftest.$ac_objext conftest$ac_exeext
14876 if { (eval echo "$as_me:14876: \"$ac_link\"") >&5
14877   (eval $ac_link) 2>&5
14878   ac_status=$?
14879   echo "$as_me:14879: \$? = $ac_status" >&5
14880   (exit $ac_status); } &&
14881          { ac_try='test -s conftest$ac_exeext'
14882   { (eval echo "$as_me:14882: \"$ac_try\"") >&5
14883   (eval $ac_try) 2>&5
14884   ac_status=$?
14885   echo "$as_me:14885: \$? = $ac_status" >&5
14886   (exit $ac_status); }; }; then
14887   cf_cv_use_pthreads=yes
14888 else
14889   echo "$as_me: failed program was:" >&5
14890 cat conftest.$ac_ext >&5
14891 cf_cv_use_pthreads=no
14892 fi
14893 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14894
14895 fi
14896 echo "$as_me:14896: result: $cf_cv_use_pthreads" >&5
14897 echo "${ECHO_T}$cf_cv_use_pthreads" >&6
14898 test $cf_cv_use_pthreads = yes && cat >>confdefs.h <<\EOF
14899 #define USE_PTHREADS 1
14900 EOF
14901
14902 echo "$as_me:14902: checking if sys/time.h works with sys/select.h" >&5
14903 echo $ECHO_N "checking if sys/time.h works with sys/select.h... $ECHO_C" >&6
14904 if test "${cf_cv_sys_time_select+set}" = set; then
14905   echo $ECHO_N "(cached) $ECHO_C" >&6
14906 else
14907
14908 cat >conftest.$ac_ext <<_ACEOF
14909 #line 14909 "configure"
14910 #include "confdefs.h"
14911
14912 #include <sys/types.h>
14913 #ifdef HAVE_SYS_TIME_H
14914 #include <sys/time.h>
14915 #endif
14916 #ifdef HAVE_SYS_SELECT_H
14917 #include <sys/select.h>
14918 #endif
14919
14920 int
14921 main ()
14922 {
14923
14924   ;
14925   return 0;
14926 }
14927 _ACEOF
14928 rm -f conftest.$ac_objext
14929 if { (eval echo "$as_me:14929: \"$ac_compile\"") >&5
14930   (eval $ac_compile) 2>&5
14931   ac_status=$?
14932   echo "$as_me:14932: \$? = $ac_status" >&5
14933   (exit $ac_status); } &&
14934          { ac_try='test -s conftest.$ac_objext'
14935   { (eval echo "$as_me:14935: \"$ac_try\"") >&5
14936   (eval $ac_try) 2>&5
14937   ac_status=$?
14938   echo "$as_me:14938: \$? = $ac_status" >&5
14939   (exit $ac_status); }; }; then
14940   cf_cv_sys_time_select=yes
14941 else
14942   echo "$as_me: failed program was:" >&5
14943 cat conftest.$ac_ext >&5
14944 cf_cv_sys_time_select=no
14945 fi
14946 rm -f conftest.$ac_objext conftest.$ac_ext
14947
14948 fi
14949
14950 echo "$as_me:14950: result: $cf_cv_sys_time_select" >&5
14951 echo "${ECHO_T}$cf_cv_sys_time_select" >&6
14952 test "$cf_cv_sys_time_select" = yes &&
14953 cat >>confdefs.h <<\EOF
14954 #define HAVE_SYS_TIME_SELECT 1
14955 EOF
14956
14957 # special check for test/ditto.c
14958
14959 echo "$as_me:14959: checking for openpty in -lutil" >&5
14960 echo $ECHO_N "checking for openpty in -lutil... $ECHO_C" >&6
14961 if test "${ac_cv_lib_util_openpty+set}" = set; then
14962   echo $ECHO_N "(cached) $ECHO_C" >&6
14963 else
14964   ac_check_lib_save_LIBS=$LIBS
14965 LIBS="-lutil  $LIBS"
14966 cat >conftest.$ac_ext <<_ACEOF
14967 #line 14967 "configure"
14968 #include "confdefs.h"
14969
14970 /* Override any gcc2 internal prototype to avoid an error.  */
14971 #ifdef __cplusplus
14972 extern "C"
14973 #endif
14974 /* We use char because int might match the return type of a gcc2
14975    builtin and then its argument prototype would still apply.  */
14976 char openpty ();
14977 int
14978 main ()
14979 {
14980 openpty ();
14981   ;
14982   return 0;
14983 }
14984 _ACEOF
14985 rm -f conftest.$ac_objext conftest$ac_exeext
14986 if { (eval echo "$as_me:14986: \"$ac_link\"") >&5
14987   (eval $ac_link) 2>&5
14988   ac_status=$?
14989   echo "$as_me:14989: \$? = $ac_status" >&5
14990   (exit $ac_status); } &&
14991          { ac_try='test -s conftest$ac_exeext'
14992   { (eval echo "$as_me:14992: \"$ac_try\"") >&5
14993   (eval $ac_try) 2>&5
14994   ac_status=$?
14995   echo "$as_me:14995: \$? = $ac_status" >&5
14996   (exit $ac_status); }; }; then
14997   ac_cv_lib_util_openpty=yes
14998 else
14999   echo "$as_me: failed program was:" >&5
15000 cat conftest.$ac_ext >&5
15001 ac_cv_lib_util_openpty=no
15002 fi
15003 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15004 LIBS=$ac_check_lib_save_LIBS
15005 fi
15006 echo "$as_me:15006: result: $ac_cv_lib_util_openpty" >&5
15007 echo "${ECHO_T}$ac_cv_lib_util_openpty" >&6
15008 if test $ac_cv_lib_util_openpty = yes; then
15009   cf_cv_lib_util=yes
15010 else
15011   cf_cv_lib_util=no
15012 fi
15013
15014 echo "$as_me:15014: checking for openpty header" >&5
15015 echo $ECHO_N "checking for openpty header... $ECHO_C" >&6
15016 if test "${cf_cv_func_openpty+set}" = set; then
15017   echo $ECHO_N "(cached) $ECHO_C" >&6
15018 else
15019
15020         cf_save_LIBS="$LIBS"
15021         test $cf_cv_lib_util = yes && {
15022 cf_add_libs="-lutil"
15023 # Filter out duplicates - this happens with badly-designed ".pc" files...
15024 for cf_add_1lib in $LIBS
15025 do
15026         for cf_add_2lib in $cf_add_libs
15027         do
15028                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
15029                 then
15030                         cf_add_1lib=
15031                         break
15032                 fi
15033         done
15034         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
15035 done
15036 LIBS="$cf_add_libs"
15037  }
15038         for cf_header in pty.h libutil.h util.h
15039         do
15040         cat >conftest.$ac_ext <<_ACEOF
15041 #line 15041 "configure"
15042 #include "confdefs.h"
15043
15044 #include <$cf_header>
15045
15046 int
15047 main ()
15048 {
15049
15050         int x = openpty((int *)0, (int *)0, (char *)0,
15051                                    (struct termios *)0, (struct winsize *)0);
15052
15053   ;
15054   return 0;
15055 }
15056 _ACEOF
15057 rm -f conftest.$ac_objext conftest$ac_exeext
15058 if { (eval echo "$as_me:15058: \"$ac_link\"") >&5
15059   (eval $ac_link) 2>&5
15060   ac_status=$?
15061   echo "$as_me:15061: \$? = $ac_status" >&5
15062   (exit $ac_status); } &&
15063          { ac_try='test -s conftest$ac_exeext'
15064   { (eval echo "$as_me:15064: \"$ac_try\"") >&5
15065   (eval $ac_try) 2>&5
15066   ac_status=$?
15067   echo "$as_me:15067: \$? = $ac_status" >&5
15068   (exit $ac_status); }; }; then
15069
15070                 cf_cv_func_openpty=$cf_header
15071                 break
15072
15073 else
15074   echo "$as_me: failed program was:" >&5
15075 cat conftest.$ac_ext >&5
15076
15077                 cf_cv_func_openpty=no
15078
15079 fi
15080 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15081         done
15082         LIBS="$cf_save_LIBS"
15083
15084 fi
15085 echo "$as_me:15085: result: $cf_cv_func_openpty" >&5
15086 echo "${ECHO_T}$cf_cv_func_openpty" >&6
15087
15088 if test "$cf_cv_func_openpty" != no ; then
15089
15090 cat >>confdefs.h <<EOF
15091 #define USE_OPENPTY_HEADER <$cf_cv_func_openpty>
15092 EOF
15093
15094 cat >>confdefs.h <<\EOF
15095 #define USE_XTERM_PTY 1
15096 EOF
15097
15098         if test "x$cf_cv_lib_util" = xyes ; then
15099
15100 cf_add_libs="-lutil"
15101 # Filter out duplicates - this happens with badly-designed ".pc" files...
15102 for cf_add_1lib in $TEST_LIBS
15103 do
15104         for cf_add_2lib in $cf_add_libs
15105         do
15106                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
15107                 then
15108                         cf_add_1lib=
15109                         break
15110                 fi
15111         done
15112         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
15113 done
15114 TEST_LIBS="$cf_add_libs"
15115
15116         fi
15117 fi
15118
15119 echo "$as_me:15119: checking for function curses_version" >&5
15120 echo $ECHO_N "checking for function curses_version... $ECHO_C" >&6
15121 if test "${cf_cv_func_curses_version+set}" = set; then
15122   echo $ECHO_N "(cached) $ECHO_C" >&6
15123 else
15124
15125 if test "$cross_compiling" = yes; then
15126   cf_cv_func_curses_version=unknown
15127 else
15128   cat >conftest.$ac_ext <<_ACEOF
15129 #line 15129 "configure"
15130 #include "confdefs.h"
15131
15132 #include <${cf_cv_ncurses_header:-curses.h}>
15133 int main()
15134 {
15135         char temp[1024];
15136         sprintf(temp, "%s\n", curses_version());
15137         ${cf_cv_main_return:-return}(0);
15138 }
15139
15140 _ACEOF
15141 rm -f conftest$ac_exeext
15142 if { (eval echo "$as_me:15142: \"$ac_link\"") >&5
15143   (eval $ac_link) 2>&5
15144   ac_status=$?
15145   echo "$as_me:15145: \$? = $ac_status" >&5
15146   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
15147   { (eval echo "$as_me:15147: \"$ac_try\"") >&5
15148   (eval $ac_try) 2>&5
15149   ac_status=$?
15150   echo "$as_me:15150: \$? = $ac_status" >&5
15151   (exit $ac_status); }; }; then
15152   cf_cv_func_curses_version=yes
15153
15154 else
15155   echo "$as_me: program exited with status $ac_status" >&5
15156 echo "$as_me: failed program was:" >&5
15157 cat conftest.$ac_ext >&5
15158 cf_cv_func_curses_version=no
15159
15160 fi
15161 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
15162 fi
15163 rm -f core
15164 fi
15165 echo "$as_me:15165: result: $cf_cv_func_curses_version" >&5
15166 echo "${ECHO_T}$cf_cv_func_curses_version" >&6
15167 test "$cf_cv_func_curses_version" = yes &&
15168 cat >>confdefs.h <<\EOF
15169 #define HAVE_CURSES_VERSION 1
15170 EOF
15171
15172 echo "$as_me:15172: checking for alternate character set array" >&5
15173 echo $ECHO_N "checking for alternate character set array... $ECHO_C" >&6
15174 if test "${cf_cv_curses_acs_map+set}" = set; then
15175   echo $ECHO_N "(cached) $ECHO_C" >&6
15176 else
15177
15178 cf_cv_curses_acs_map=unknown
15179 for name in acs_map _acs_map __acs_map ${NCURSES_WRAP_PREFIX}acs_map
15180 do
15181 cat >conftest.$ac_ext <<_ACEOF
15182 #line 15182 "configure"
15183 #include "confdefs.h"
15184
15185 #include <${cf_cv_ncurses_header:-curses.h}>
15186
15187 int
15188 main ()
15189 {
15190
15191 $name['k'] = ACS_PLUS
15192
15193   ;
15194   return 0;
15195 }
15196 _ACEOF
15197 rm -f conftest.$ac_objext conftest$ac_exeext
15198 if { (eval echo "$as_me:15198: \"$ac_link\"") >&5
15199   (eval $ac_link) 2>&5
15200   ac_status=$?
15201   echo "$as_me:15201: \$? = $ac_status" >&5
15202   (exit $ac_status); } &&
15203          { ac_try='test -s conftest$ac_exeext'
15204   { (eval echo "$as_me:15204: \"$ac_try\"") >&5
15205   (eval $ac_try) 2>&5
15206   ac_status=$?
15207   echo "$as_me:15207: \$? = $ac_status" >&5
15208   (exit $ac_status); }; }; then
15209   cf_cv_curses_acs_map=$name; break
15210 else
15211   echo "$as_me: failed program was:" >&5
15212 cat conftest.$ac_ext >&5
15213 fi
15214 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15215 done
15216
15217 fi
15218 echo "$as_me:15218: result: $cf_cv_curses_acs_map" >&5
15219 echo "${ECHO_T}$cf_cv_curses_acs_map" >&6
15220
15221 test "$cf_cv_curses_acs_map" != unknown &&
15222 cat >>confdefs.h <<EOF
15223 #define CURSES_ACS_ARRAY $cf_cv_curses_acs_map
15224 EOF
15225
15226 if test "$cf_enable_widec" = yes; then
15227
15228 echo "$as_me:15228: checking for wide alternate character set array" >&5
15229 echo $ECHO_N "checking for wide alternate character set array... $ECHO_C" >&6
15230 if test "${cf_cv_curses_wacs_map+set}" = set; then
15231   echo $ECHO_N "(cached) $ECHO_C" >&6
15232 else
15233
15234         cf_cv_curses_wacs_map=unknown
15235         for name in wacs_map _wacs_map __wacs_map _nc_wacs _wacs_char
15236         do
15237         cat >conftest.$ac_ext <<_ACEOF
15238 #line 15238 "configure"
15239 #include "confdefs.h"
15240
15241 #ifndef _XOPEN_SOURCE_EXTENDED
15242 #define _XOPEN_SOURCE_EXTENDED
15243 #endif
15244 #include <${cf_cv_ncurses_header:-curses.h}>
15245 int
15246 main ()
15247 {
15248 void *foo = &($name['k'])
15249   ;
15250   return 0;
15251 }
15252 _ACEOF
15253 rm -f conftest.$ac_objext conftest$ac_exeext
15254 if { (eval echo "$as_me:15254: \"$ac_link\"") >&5
15255   (eval $ac_link) 2>&5
15256   ac_status=$?
15257   echo "$as_me:15257: \$? = $ac_status" >&5
15258   (exit $ac_status); } &&
15259          { ac_try='test -s conftest$ac_exeext'
15260   { (eval echo "$as_me:15260: \"$ac_try\"") >&5
15261   (eval $ac_try) 2>&5
15262   ac_status=$?
15263   echo "$as_me:15263: \$? = $ac_status" >&5
15264   (exit $ac_status); }; }; then
15265   cf_cv_curses_wacs_map=$name
15266          break
15267 else
15268   echo "$as_me: failed program was:" >&5
15269 cat conftest.$ac_ext >&5
15270 fi
15271 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15272         done
15273 fi
15274 echo "$as_me:15274: result: $cf_cv_curses_wacs_map" >&5
15275 echo "${ECHO_T}$cf_cv_curses_wacs_map" >&6
15276
15277 test "$cf_cv_curses_wacs_map" != unknown &&
15278 cat >>confdefs.h <<EOF
15279 #define CURSES_WACS_ARRAY $cf_cv_curses_wacs_map
15280 EOF
15281
15282 echo "$as_me:15282: checking for wide alternate character constants" >&5
15283 echo $ECHO_N "checking for wide alternate character constants... $ECHO_C" >&6
15284 if test "${cf_cv_curses_wacs_symbols+set}" = set; then
15285   echo $ECHO_N "(cached) $ECHO_C" >&6
15286 else
15287
15288 cf_cv_curses_wacs_symbols=no
15289 if test "$cf_cv_curses_wacs_map" != unknown
15290 then
15291         cat >conftest.$ac_ext <<_ACEOF
15292 #line 15292 "configure"
15293 #include "confdefs.h"
15294
15295 #ifndef _XOPEN_SOURCE_EXTENDED
15296 #define _XOPEN_SOURCE_EXTENDED
15297 #endif
15298 #include <${cf_cv_ncurses_header:-curses.h}>
15299 int
15300 main ()
15301 {
15302 cchar_t *foo = WACS_PLUS;
15303          $cf_cv_curses_wacs_map['k'] = *WACS_PLUS
15304   ;
15305   return 0;
15306 }
15307 _ACEOF
15308 rm -f conftest.$ac_objext conftest$ac_exeext
15309 if { (eval echo "$as_me:15309: \"$ac_link\"") >&5
15310   (eval $ac_link) 2>&5
15311   ac_status=$?
15312   echo "$as_me:15312: \$? = $ac_status" >&5
15313   (exit $ac_status); } &&
15314          { ac_try='test -s conftest$ac_exeext'
15315   { (eval echo "$as_me:15315: \"$ac_try\"") >&5
15316   (eval $ac_try) 2>&5
15317   ac_status=$?
15318   echo "$as_me:15318: \$? = $ac_status" >&5
15319   (exit $ac_status); }; }; then
15320   cf_cv_curses_wacs_symbols=yes
15321 else
15322   echo "$as_me: failed program was:" >&5
15323 cat conftest.$ac_ext >&5
15324 fi
15325 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15326 else
15327         cat >conftest.$ac_ext <<_ACEOF
15328 #line 15328 "configure"
15329 #include "confdefs.h"
15330
15331 #ifndef _XOPEN_SOURCE_EXTENDED
15332 #define _XOPEN_SOURCE_EXTENDED
15333 #endif
15334 #include <${cf_cv_ncurses_header:-curses.h}>
15335 int
15336 main ()
15337 {
15338 cchar_t *foo = WACS_PLUS
15339   ;
15340   return 0;
15341 }
15342 _ACEOF
15343 rm -f conftest.$ac_objext conftest$ac_exeext
15344 if { (eval echo "$as_me:15344: \"$ac_link\"") >&5
15345   (eval $ac_link) 2>&5
15346   ac_status=$?
15347   echo "$as_me:15347: \$? = $ac_status" >&5
15348   (exit $ac_status); } &&
15349          { ac_try='test -s conftest$ac_exeext'
15350   { (eval echo "$as_me:15350: \"$ac_try\"") >&5
15351   (eval $ac_try) 2>&5
15352   ac_status=$?
15353   echo "$as_me:15353: \$? = $ac_status" >&5
15354   (exit $ac_status); }; }; then
15355   cf_cv_curses_wacs_symbols=yes
15356 else
15357   echo "$as_me: failed program was:" >&5
15358 cat conftest.$ac_ext >&5
15359 fi
15360 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15361 fi
15362
15363 fi
15364 echo "$as_me:15364: result: $cf_cv_curses_wacs_symbols" >&5
15365 echo "${ECHO_T}$cf_cv_curses_wacs_symbols" >&6
15366
15367 test "$cf_cv_curses_wacs_symbols" != no &&
15368 cat >>confdefs.h <<\EOF
15369 #define CURSES_WACS_SYMBOLS 1
15370 EOF
15371
15372 fi
15373
15374 echo "$as_me:15374: checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}" >&5
15375 echo $ECHO_N "checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
15376 cat >conftest.$ac_ext <<_ACEOF
15377 #line 15377 "configure"
15378 #include "confdefs.h"
15379
15380 #ifndef _XOPEN_SOURCE_EXTENDED
15381 #define _XOPEN_SOURCE_EXTENDED
15382 #endif
15383 #include <${cf_cv_ncurses_header:-curses.h}>
15384 int
15385 main ()
15386 {
15387
15388 attr_t foo
15389
15390   ;
15391   return 0;
15392 }
15393 _ACEOF
15394 rm -f conftest.$ac_objext
15395 if { (eval echo "$as_me:15395: \"$ac_compile\"") >&5
15396   (eval $ac_compile) 2>&5
15397   ac_status=$?
15398   echo "$as_me:15398: \$? = $ac_status" >&5
15399   (exit $ac_status); } &&
15400          { ac_try='test -s conftest.$ac_objext'
15401   { (eval echo "$as_me:15401: \"$ac_try\"") >&5
15402   (eval $ac_try) 2>&5
15403   ac_status=$?
15404   echo "$as_me:15404: \$? = $ac_status" >&5
15405   (exit $ac_status); }; }; then
15406   cf_result=yes
15407 else
15408   echo "$as_me: failed program was:" >&5
15409 cat conftest.$ac_ext >&5
15410 cf_result=no
15411 fi
15412 rm -f conftest.$ac_objext conftest.$ac_ext
15413 echo "$as_me:15413: result: $cf_result" >&5
15414 echo "${ECHO_T}$cf_result" >&6
15415 if test $cf_result = yes ; then
15416
15417 cf_result=`echo "have_type_attr_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15418
15419 cat >>confdefs.h <<EOF
15420 #define $cf_result 1
15421 EOF
15422
15423 else
15424
15425 cat >>confdefs.h <<EOF
15426 #define attr_t long
15427 EOF
15428
15429 fi
15430
15431 if test "$cf_enable_widec" = yes; then
15432
15433 # This is needed on Tru64 5.0 to declare mbstate_t
15434 echo "$as_me:15434: checking if we must include wchar.h to declare mbstate_t" >&5
15435 echo $ECHO_N "checking if we must include wchar.h to declare mbstate_t... $ECHO_C" >&6
15436 if test "${cf_cv_mbstate_t+set}" = set; then
15437   echo $ECHO_N "(cached) $ECHO_C" >&6
15438 else
15439
15440 cat >conftest.$ac_ext <<_ACEOF
15441 #line 15441 "configure"
15442 #include "confdefs.h"
15443
15444 #include <stdlib.h>
15445 #include <stdarg.h>
15446 #include <stdio.h>
15447 #ifdef HAVE_LIBUTF8_H
15448 #include <libutf8.h>
15449 #endif
15450 int
15451 main ()
15452 {
15453 mbstate_t state
15454   ;
15455   return 0;
15456 }
15457 _ACEOF
15458 rm -f conftest.$ac_objext
15459 if { (eval echo "$as_me:15459: \"$ac_compile\"") >&5
15460   (eval $ac_compile) 2>&5
15461   ac_status=$?
15462   echo "$as_me:15462: \$? = $ac_status" >&5
15463   (exit $ac_status); } &&
15464          { ac_try='test -s conftest.$ac_objext'
15465   { (eval echo "$as_me:15465: \"$ac_try\"") >&5
15466   (eval $ac_try) 2>&5
15467   ac_status=$?
15468   echo "$as_me:15468: \$? = $ac_status" >&5
15469   (exit $ac_status); }; }; then
15470   cf_cv_mbstate_t=no
15471 else
15472   echo "$as_me: failed program was:" >&5
15473 cat conftest.$ac_ext >&5
15474 cat >conftest.$ac_ext <<_ACEOF
15475 #line 15475 "configure"
15476 #include "confdefs.h"
15477
15478 #include <stdlib.h>
15479 #include <stdarg.h>
15480 #include <stdio.h>
15481 #include <wchar.h>
15482 #ifdef HAVE_LIBUTF8_H
15483 #include <libutf8.h>
15484 #endif
15485 int
15486 main ()
15487 {
15488 mbstate_t value
15489   ;
15490   return 0;
15491 }
15492 _ACEOF
15493 rm -f conftest.$ac_objext
15494 if { (eval echo "$as_me:15494: \"$ac_compile\"") >&5
15495   (eval $ac_compile) 2>&5
15496   ac_status=$?
15497   echo "$as_me:15497: \$? = $ac_status" >&5
15498   (exit $ac_status); } &&
15499          { ac_try='test -s conftest.$ac_objext'
15500   { (eval echo "$as_me:15500: \"$ac_try\"") >&5
15501   (eval $ac_try) 2>&5
15502   ac_status=$?
15503   echo "$as_me:15503: \$? = $ac_status" >&5
15504   (exit $ac_status); }; }; then
15505   cf_cv_mbstate_t=yes
15506 else
15507   echo "$as_me: failed program was:" >&5
15508 cat conftest.$ac_ext >&5
15509 cf_cv_mbstate_t=unknown
15510 fi
15511 rm -f conftest.$ac_objext conftest.$ac_ext
15512 fi
15513 rm -f conftest.$ac_objext conftest.$ac_ext
15514 fi
15515 echo "$as_me:15515: result: $cf_cv_mbstate_t" >&5
15516 echo "${ECHO_T}$cf_cv_mbstate_t" >&6
15517
15518 if test "$cf_cv_mbstate_t" = yes ; then
15519
15520 cat >>confdefs.h <<\EOF
15521 #define NEED_WCHAR_H 1
15522 EOF
15523
15524         NEED_WCHAR_H=1
15525 fi
15526
15527 # if we do not find mbstate_t in either place, use substitution to provide a fallback.
15528 if test "$cf_cv_mbstate_t" = unknown ; then
15529         NCURSES_MBSTATE_T=1
15530 fi
15531
15532 # if we find mbstate_t in either place, use substitution to provide a fallback.
15533 if test "$cf_cv_mbstate_t" != unknown ; then
15534         NCURSES_OK_MBSTATE_T=1
15535 fi
15536
15537 # This is needed on Tru64 5.0 to declare wchar_t
15538 echo "$as_me:15538: checking if we must include wchar.h to declare wchar_t" >&5
15539 echo $ECHO_N "checking if we must include wchar.h to declare wchar_t... $ECHO_C" >&6
15540 if test "${cf_cv_wchar_t+set}" = set; then
15541   echo $ECHO_N "(cached) $ECHO_C" >&6
15542 else
15543
15544 cat >conftest.$ac_ext <<_ACEOF
15545 #line 15545 "configure"
15546 #include "confdefs.h"
15547
15548 #include <stdlib.h>
15549 #include <stdarg.h>
15550 #include <stdio.h>
15551 #ifdef HAVE_LIBUTF8_H
15552 #include <libutf8.h>
15553 #endif
15554 int
15555 main ()
15556 {
15557 wchar_t state
15558   ;
15559   return 0;
15560 }
15561 _ACEOF
15562 rm -f conftest.$ac_objext
15563 if { (eval echo "$as_me:15563: \"$ac_compile\"") >&5
15564   (eval $ac_compile) 2>&5
15565   ac_status=$?
15566   echo "$as_me:15566: \$? = $ac_status" >&5
15567   (exit $ac_status); } &&
15568          { ac_try='test -s conftest.$ac_objext'
15569   { (eval echo "$as_me:15569: \"$ac_try\"") >&5
15570   (eval $ac_try) 2>&5
15571   ac_status=$?
15572   echo "$as_me:15572: \$? = $ac_status" >&5
15573   (exit $ac_status); }; }; then
15574   cf_cv_wchar_t=no
15575 else
15576   echo "$as_me: failed program was:" >&5
15577 cat conftest.$ac_ext >&5
15578 cat >conftest.$ac_ext <<_ACEOF
15579 #line 15579 "configure"
15580 #include "confdefs.h"
15581
15582 #include <stdlib.h>
15583 #include <stdarg.h>
15584 #include <stdio.h>
15585 #include <wchar.h>
15586 #ifdef HAVE_LIBUTF8_H
15587 #include <libutf8.h>
15588 #endif
15589 int
15590 main ()
15591 {
15592 wchar_t value
15593   ;
15594   return 0;
15595 }
15596 _ACEOF
15597 rm -f conftest.$ac_objext
15598 if { (eval echo "$as_me:15598: \"$ac_compile\"") >&5
15599   (eval $ac_compile) 2>&5
15600   ac_status=$?
15601   echo "$as_me:15601: \$? = $ac_status" >&5
15602   (exit $ac_status); } &&
15603          { ac_try='test -s conftest.$ac_objext'
15604   { (eval echo "$as_me:15604: \"$ac_try\"") >&5
15605   (eval $ac_try) 2>&5
15606   ac_status=$?
15607   echo "$as_me:15607: \$? = $ac_status" >&5
15608   (exit $ac_status); }; }; then
15609   cf_cv_wchar_t=yes
15610 else
15611   echo "$as_me: failed program was:" >&5
15612 cat conftest.$ac_ext >&5
15613 cf_cv_wchar_t=unknown
15614 fi
15615 rm -f conftest.$ac_objext conftest.$ac_ext
15616 fi
15617 rm -f conftest.$ac_objext conftest.$ac_ext
15618 fi
15619 echo "$as_me:15619: result: $cf_cv_wchar_t" >&5
15620 echo "${ECHO_T}$cf_cv_wchar_t" >&6
15621
15622 if test "$cf_cv_wchar_t" = yes ; then
15623
15624 cat >>confdefs.h <<\EOF
15625 #define NEED_WCHAR_H 1
15626 EOF
15627
15628         NEED_WCHAR_H=1
15629 fi
15630
15631 # if we do not find wchar_t in either place, use substitution to provide a fallback.
15632 if test "$cf_cv_wchar_t" = unknown ; then
15633         NCURSES_WCHAR_T=1
15634 fi
15635
15636 # if we find wchar_t in either place, use substitution to provide a fallback.
15637 if test "$cf_cv_wchar_t" != unknown ; then
15638         NCURSES_OK_WCHAR_T=1
15639 fi
15640
15641 # This is needed on Tru64 5.0 to declare wint_t
15642 echo "$as_me:15642: checking if we must include wchar.h to declare wint_t" >&5
15643 echo $ECHO_N "checking if we must include wchar.h to declare wint_t... $ECHO_C" >&6
15644 if test "${cf_cv_wint_t+set}" = set; then
15645   echo $ECHO_N "(cached) $ECHO_C" >&6
15646 else
15647
15648 cat >conftest.$ac_ext <<_ACEOF
15649 #line 15649 "configure"
15650 #include "confdefs.h"
15651
15652 #include <stdlib.h>
15653 #include <stdarg.h>
15654 #include <stdio.h>
15655 #ifdef HAVE_LIBUTF8_H
15656 #include <libutf8.h>
15657 #endif
15658 int
15659 main ()
15660 {
15661 wint_t state
15662   ;
15663   return 0;
15664 }
15665 _ACEOF
15666 rm -f conftest.$ac_objext
15667 if { (eval echo "$as_me:15667: \"$ac_compile\"") >&5
15668   (eval $ac_compile) 2>&5
15669   ac_status=$?
15670   echo "$as_me:15670: \$? = $ac_status" >&5
15671   (exit $ac_status); } &&
15672          { ac_try='test -s conftest.$ac_objext'
15673   { (eval echo "$as_me:15673: \"$ac_try\"") >&5
15674   (eval $ac_try) 2>&5
15675   ac_status=$?
15676   echo "$as_me:15676: \$? = $ac_status" >&5
15677   (exit $ac_status); }; }; then
15678   cf_cv_wint_t=no
15679 else
15680   echo "$as_me: failed program was:" >&5
15681 cat conftest.$ac_ext >&5
15682 cat >conftest.$ac_ext <<_ACEOF
15683 #line 15683 "configure"
15684 #include "confdefs.h"
15685
15686 #include <stdlib.h>
15687 #include <stdarg.h>
15688 #include <stdio.h>
15689 #include <wchar.h>
15690 #ifdef HAVE_LIBUTF8_H
15691 #include <libutf8.h>
15692 #endif
15693 int
15694 main ()
15695 {
15696 wint_t value
15697   ;
15698   return 0;
15699 }
15700 _ACEOF
15701 rm -f conftest.$ac_objext
15702 if { (eval echo "$as_me:15702: \"$ac_compile\"") >&5
15703   (eval $ac_compile) 2>&5
15704   ac_status=$?
15705   echo "$as_me:15705: \$? = $ac_status" >&5
15706   (exit $ac_status); } &&
15707          { ac_try='test -s conftest.$ac_objext'
15708   { (eval echo "$as_me:15708: \"$ac_try\"") >&5
15709   (eval $ac_try) 2>&5
15710   ac_status=$?
15711   echo "$as_me:15711: \$? = $ac_status" >&5
15712   (exit $ac_status); }; }; then
15713   cf_cv_wint_t=yes
15714 else
15715   echo "$as_me: failed program was:" >&5
15716 cat conftest.$ac_ext >&5
15717 cf_cv_wint_t=unknown
15718 fi
15719 rm -f conftest.$ac_objext conftest.$ac_ext
15720 fi
15721 rm -f conftest.$ac_objext conftest.$ac_ext
15722 fi
15723 echo "$as_me:15723: result: $cf_cv_wint_t" >&5
15724 echo "${ECHO_T}$cf_cv_wint_t" >&6
15725
15726 if test "$cf_cv_wint_t" = yes ; then
15727
15728 cat >>confdefs.h <<\EOF
15729 #define NEED_WCHAR_H 1
15730 EOF
15731
15732         NEED_WCHAR_H=1
15733 fi
15734
15735 # if we do not find wint_t in either place, use substitution to provide a fallback.
15736 if test "$cf_cv_wint_t" = unknown ; then
15737         NCURSES_WINT_T=1
15738 fi
15739
15740 # if we find wint_t in either place, use substitution to provide a fallback.
15741 if test "$cf_cv_wint_t" != unknown ; then
15742         NCURSES_OK_WINT_T=1
15743 fi
15744
15745         if test "$NCURSES_OK_MBSTATE_T" = 0 ; then
15746
15747 echo "$as_me:15747: checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}" >&5
15748 echo $ECHO_N "checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
15749 cat >conftest.$ac_ext <<_ACEOF
15750 #line 15750 "configure"
15751 #include "confdefs.h"
15752
15753 #ifndef _XOPEN_SOURCE_EXTENDED
15754 #define _XOPEN_SOURCE_EXTENDED
15755 #endif
15756 #include <${cf_cv_ncurses_header:-curses.h}>
15757 int
15758 main ()
15759 {
15760
15761 mbstate_t foo
15762
15763   ;
15764   return 0;
15765 }
15766 _ACEOF
15767 rm -f conftest.$ac_objext
15768 if { (eval echo "$as_me:15768: \"$ac_compile\"") >&5
15769   (eval $ac_compile) 2>&5
15770   ac_status=$?
15771   echo "$as_me:15771: \$? = $ac_status" >&5
15772   (exit $ac_status); } &&
15773          { ac_try='test -s conftest.$ac_objext'
15774   { (eval echo "$as_me:15774: \"$ac_try\"") >&5
15775   (eval $ac_try) 2>&5
15776   ac_status=$?
15777   echo "$as_me:15777: \$? = $ac_status" >&5
15778   (exit $ac_status); }; }; then
15779   cf_result=yes
15780 else
15781   echo "$as_me: failed program was:" >&5
15782 cat conftest.$ac_ext >&5
15783 cf_result=no
15784 fi
15785 rm -f conftest.$ac_objext conftest.$ac_ext
15786 echo "$as_me:15786: result: $cf_result" >&5
15787 echo "${ECHO_T}$cf_result" >&6
15788 if test $cf_result = yes ; then
15789
15790 cf_result=`echo "have_type_mbstate_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15791
15792 cat >>confdefs.h <<EOF
15793 #define $cf_result 1
15794 EOF
15795
15796 else
15797
15798 cat >>confdefs.h <<EOF
15799 #define mbstate_t long
15800 EOF
15801
15802 fi
15803
15804         fi
15805
15806         if test "$NCURSES_OK_WCHAR_T" = 0 ; then
15807
15808 echo "$as_me:15808: checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}" >&5
15809 echo $ECHO_N "checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
15810 cat >conftest.$ac_ext <<_ACEOF
15811 #line 15811 "configure"
15812 #include "confdefs.h"
15813
15814 #ifndef _XOPEN_SOURCE_EXTENDED
15815 #define _XOPEN_SOURCE_EXTENDED
15816 #endif
15817 #include <${cf_cv_ncurses_header:-curses.h}>
15818 int
15819 main ()
15820 {
15821
15822 wchar_t foo
15823
15824   ;
15825   return 0;
15826 }
15827 _ACEOF
15828 rm -f conftest.$ac_objext
15829 if { (eval echo "$as_me:15829: \"$ac_compile\"") >&5
15830   (eval $ac_compile) 2>&5
15831   ac_status=$?
15832   echo "$as_me:15832: \$? = $ac_status" >&5
15833   (exit $ac_status); } &&
15834          { ac_try='test -s conftest.$ac_objext'
15835   { (eval echo "$as_me:15835: \"$ac_try\"") >&5
15836   (eval $ac_try) 2>&5
15837   ac_status=$?
15838   echo "$as_me:15838: \$? = $ac_status" >&5
15839   (exit $ac_status); }; }; then
15840   cf_result=yes
15841 else
15842   echo "$as_me: failed program was:" >&5
15843 cat conftest.$ac_ext >&5
15844 cf_result=no
15845 fi
15846 rm -f conftest.$ac_objext conftest.$ac_ext
15847 echo "$as_me:15847: result: $cf_result" >&5
15848 echo "${ECHO_T}$cf_result" >&6
15849 if test $cf_result = yes ; then
15850
15851 cf_result=`echo "have_type_wchar_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15852
15853 cat >>confdefs.h <<EOF
15854 #define $cf_result 1
15855 EOF
15856
15857 else
15858
15859 cat >>confdefs.h <<EOF
15860 #define wchar_t long
15861 EOF
15862
15863 fi
15864
15865         fi
15866
15867         if test "$NCURSES_OK_WINT_T" = 0 ; then
15868
15869 echo "$as_me:15869: checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}" >&5
15870 echo $ECHO_N "checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
15871 cat >conftest.$ac_ext <<_ACEOF
15872 #line 15872 "configure"
15873 #include "confdefs.h"
15874
15875 #ifndef _XOPEN_SOURCE_EXTENDED
15876 #define _XOPEN_SOURCE_EXTENDED
15877 #endif
15878 #include <${cf_cv_ncurses_header:-curses.h}>
15879 int
15880 main ()
15881 {
15882
15883 wint_t foo
15884
15885   ;
15886   return 0;
15887 }
15888 _ACEOF
15889 rm -f conftest.$ac_objext
15890 if { (eval echo "$as_me:15890: \"$ac_compile\"") >&5
15891   (eval $ac_compile) 2>&5
15892   ac_status=$?
15893   echo "$as_me:15893: \$? = $ac_status" >&5
15894   (exit $ac_status); } &&
15895          { ac_try='test -s conftest.$ac_objext'
15896   { (eval echo "$as_me:15896: \"$ac_try\"") >&5
15897   (eval $ac_try) 2>&5
15898   ac_status=$?
15899   echo "$as_me:15899: \$? = $ac_status" >&5
15900   (exit $ac_status); }; }; then
15901   cf_result=yes
15902 else
15903   echo "$as_me: failed program was:" >&5
15904 cat conftest.$ac_ext >&5
15905 cf_result=no
15906 fi
15907 rm -f conftest.$ac_objext conftest.$ac_ext
15908 echo "$as_me:15908: result: $cf_result" >&5
15909 echo "${ECHO_T}$cf_result" >&6
15910 if test $cf_result = yes ; then
15911
15912 cf_result=`echo "have_type_wint_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15913
15914 cat >>confdefs.h <<EOF
15915 #define $cf_result 1
15916 EOF
15917
15918 else
15919
15920 cat >>confdefs.h <<EOF
15921 #define wint_t long
15922 EOF
15923
15924 fi
15925
15926         fi
15927 fi
15928
15929 echo "$as_me:15929: checking for data ospeed declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
15930 echo $ECHO_N "checking for data ospeed declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
15931
15932 cat >conftest.$ac_ext <<_ACEOF
15933 #line 15933 "configure"
15934 #include "confdefs.h"
15935
15936 #ifdef HAVE_XCURSES
15937 #include <xcurses.h>
15938 char * XCursesProgramName = "test";
15939 #else
15940 #include <${cf_cv_ncurses_header:-curses.h}>
15941 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
15942 #include <ncursesw/term.h>
15943 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
15944 #include <ncurses/term.h>
15945 #elif defined(HAVE_TERM_H)
15946 #include <term.h>
15947 #endif
15948 #endif
15949
15950 int
15951 main ()
15952 {
15953
15954 void *foo = &(ospeed)
15955
15956   ;
15957   return 0;
15958 }
15959 _ACEOF
15960 rm -f conftest.$ac_objext
15961 if { (eval echo "$as_me:15961: \"$ac_compile\"") >&5
15962   (eval $ac_compile) 2>&5
15963   ac_status=$?
15964   echo "$as_me:15964: \$? = $ac_status" >&5
15965   (exit $ac_status); } &&
15966          { ac_try='test -s conftest.$ac_objext'
15967   { (eval echo "$as_me:15967: \"$ac_try\"") >&5
15968   (eval $ac_try) 2>&5
15969   ac_status=$?
15970   echo "$as_me:15970: \$? = $ac_status" >&5
15971   (exit $ac_status); }; }; then
15972   cf_result=yes
15973 else
15974   echo "$as_me: failed program was:" >&5
15975 cat conftest.$ac_ext >&5
15976 cf_result=no
15977 fi
15978 rm -f conftest.$ac_objext conftest.$ac_ext
15979 echo "$as_me:15979: result: $cf_result" >&5
15980 echo "${ECHO_T}$cf_result" >&6
15981
15982 if test $cf_result = yes ; then
15983
15984 cf_result=`echo "have_curses_data_ospeed" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15985
15986         cat >>confdefs.h <<EOF
15987 #define $cf_result 1
15988 EOF
15989
15990 else
15991         echo "$as_me:15991: checking for data ospeed in library" >&5
15992 echo $ECHO_N "checking for data ospeed in library... $ECHO_C" >&6
15993         # BSD linkers insist on making weak linkage, but resolve at runtime.
15994         if test "$cross_compiling" = yes; then
15995
15996         # cross-compiling
15997         cat >conftest.$ac_ext <<_ACEOF
15998 #line 15998 "configure"
15999 #include "confdefs.h"
16000
16001 #ifdef HAVE_XCURSES
16002 #include <xcurses.h>
16003 char * XCursesProgramName = "test";
16004 #else
16005 #include <${cf_cv_ncurses_header:-curses.h}>
16006 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16007 #include <ncursesw/term.h>
16008 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16009 #include <ncurses/term.h>
16010 #elif defined(HAVE_TERM_H)
16011 #include <term.h>
16012 #endif
16013 #endif
16014
16015 extern char ospeed;
16016 int
16017 main ()
16018 {
16019
16020         do {
16021                 void *foo = &(ospeed);
16022                 fprintf(stderr, "testing linkage of ospeed:%p\n", foo);
16023                 ${cf_cv_main_return:-return}(foo == 0);
16024         } while (0)
16025
16026   ;
16027   return 0;
16028 }
16029 _ACEOF
16030 rm -f conftest.$ac_objext conftest$ac_exeext
16031 if { (eval echo "$as_me:16031: \"$ac_link\"") >&5
16032   (eval $ac_link) 2>&5
16033   ac_status=$?
16034   echo "$as_me:16034: \$? = $ac_status" >&5
16035   (exit $ac_status); } &&
16036          { ac_try='test -s conftest$ac_exeext'
16037   { (eval echo "$as_me:16037: \"$ac_try\"") >&5
16038   (eval $ac_try) 2>&5
16039   ac_status=$?
16040   echo "$as_me:16040: \$? = $ac_status" >&5
16041   (exit $ac_status); }; }; then
16042   cf_result=yes
16043 else
16044   echo "$as_me: failed program was:" >&5
16045 cat conftest.$ac_ext >&5
16046 cf_result=no
16047 fi
16048 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16049
16050 else
16051   cat >conftest.$ac_ext <<_ACEOF
16052 #line 16052 "configure"
16053 #include "confdefs.h"
16054
16055 #ifdef HAVE_XCURSES
16056 #include <xcurses.h>
16057 char * XCursesProgramName = "test";
16058 #else
16059 #include <${cf_cv_ncurses_header:-curses.h}>
16060 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16061 #include <ncursesw/term.h>
16062 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16063 #include <ncurses/term.h>
16064 #elif defined(HAVE_TERM_H)
16065 #include <term.h>
16066 #endif
16067 #endif
16068
16069 extern char ospeed;
16070 int main(void)
16071 {
16072         void *foo = &(ospeed);
16073         fprintf(stderr, "testing linkage of ospeed:%p\n", foo);
16074         ${cf_cv_main_return:-return}(foo == 0);
16075 }
16076 _ACEOF
16077 rm -f conftest$ac_exeext
16078 if { (eval echo "$as_me:16078: \"$ac_link\"") >&5
16079   (eval $ac_link) 2>&5
16080   ac_status=$?
16081   echo "$as_me:16081: \$? = $ac_status" >&5
16082   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
16083   { (eval echo "$as_me:16083: \"$ac_try\"") >&5
16084   (eval $ac_try) 2>&5
16085   ac_status=$?
16086   echo "$as_me:16086: \$? = $ac_status" >&5
16087   (exit $ac_status); }; }; then
16088   cf_result=yes
16089 else
16090   echo "$as_me: program exited with status $ac_status" >&5
16091 echo "$as_me: failed program was:" >&5
16092 cat conftest.$ac_ext >&5
16093 cf_result=no
16094 fi
16095 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
16096 fi
16097         echo "$as_me:16097: result: $cf_result" >&5
16098 echo "${ECHO_T}$cf_result" >&6
16099         if test $cf_result = yes ; then
16100
16101 cf_result=`echo "decl_curses_data_ospeed" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16102
16103                 cat >>confdefs.h <<EOF
16104 #define $cf_result 1
16105 EOF
16106
16107         fi
16108 fi
16109
16110 echo "$as_me:16110: checking for data boolnames declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
16111 echo $ECHO_N "checking for data boolnames declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
16112
16113 cat >conftest.$ac_ext <<_ACEOF
16114 #line 16114 "configure"
16115 #include "confdefs.h"
16116
16117 #ifdef HAVE_XCURSES
16118 #include <xcurses.h>
16119 char * XCursesProgramName = "test";
16120 #else
16121 #include <${cf_cv_ncurses_header:-curses.h}>
16122 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16123 #include <ncursesw/term.h>
16124 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16125 #include <ncurses/term.h>
16126 #elif defined(HAVE_TERM_H)
16127 #include <term.h>
16128 #endif
16129 #endif
16130
16131 int
16132 main ()
16133 {
16134
16135 void *foo = &(boolnames)
16136
16137   ;
16138   return 0;
16139 }
16140 _ACEOF
16141 rm -f conftest.$ac_objext
16142 if { (eval echo "$as_me:16142: \"$ac_compile\"") >&5
16143   (eval $ac_compile) 2>&5
16144   ac_status=$?
16145   echo "$as_me:16145: \$? = $ac_status" >&5
16146   (exit $ac_status); } &&
16147          { ac_try='test -s conftest.$ac_objext'
16148   { (eval echo "$as_me:16148: \"$ac_try\"") >&5
16149   (eval $ac_try) 2>&5
16150   ac_status=$?
16151   echo "$as_me:16151: \$? = $ac_status" >&5
16152   (exit $ac_status); }; }; then
16153   cf_result=yes
16154 else
16155   echo "$as_me: failed program was:" >&5
16156 cat conftest.$ac_ext >&5
16157 cf_result=no
16158 fi
16159 rm -f conftest.$ac_objext conftest.$ac_ext
16160 echo "$as_me:16160: result: $cf_result" >&5
16161 echo "${ECHO_T}$cf_result" >&6
16162
16163 if test $cf_result = yes ; then
16164
16165 cf_result=`echo "have_curses_data_boolnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16166
16167         cat >>confdefs.h <<EOF
16168 #define $cf_result 1
16169 EOF
16170
16171 else
16172         echo "$as_me:16172: checking for data boolnames in library" >&5
16173 echo $ECHO_N "checking for data boolnames in library... $ECHO_C" >&6
16174         # BSD linkers insist on making weak linkage, but resolve at runtime.
16175         if test "$cross_compiling" = yes; then
16176
16177         # cross-compiling
16178         cat >conftest.$ac_ext <<_ACEOF
16179 #line 16179 "configure"
16180 #include "confdefs.h"
16181
16182 #ifdef HAVE_XCURSES
16183 #include <xcurses.h>
16184 char * XCursesProgramName = "test";
16185 #else
16186 #include <${cf_cv_ncurses_header:-curses.h}>
16187 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16188 #include <ncursesw/term.h>
16189 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16190 #include <ncurses/term.h>
16191 #elif defined(HAVE_TERM_H)
16192 #include <term.h>
16193 #endif
16194 #endif
16195
16196 extern char boolnames;
16197 int
16198 main ()
16199 {
16200
16201         do {
16202                 void *foo = &(boolnames);
16203                 fprintf(stderr, "testing linkage of boolnames:%p\n", foo);
16204                 ${cf_cv_main_return:-return}(foo == 0);
16205         } while (0)
16206
16207   ;
16208   return 0;
16209 }
16210 _ACEOF
16211 rm -f conftest.$ac_objext conftest$ac_exeext
16212 if { (eval echo "$as_me:16212: \"$ac_link\"") >&5
16213   (eval $ac_link) 2>&5
16214   ac_status=$?
16215   echo "$as_me:16215: \$? = $ac_status" >&5
16216   (exit $ac_status); } &&
16217          { ac_try='test -s conftest$ac_exeext'
16218   { (eval echo "$as_me:16218: \"$ac_try\"") >&5
16219   (eval $ac_try) 2>&5
16220   ac_status=$?
16221   echo "$as_me:16221: \$? = $ac_status" >&5
16222   (exit $ac_status); }; }; then
16223   cf_result=yes
16224 else
16225   echo "$as_me: failed program was:" >&5
16226 cat conftest.$ac_ext >&5
16227 cf_result=no
16228 fi
16229 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16230
16231 else
16232   cat >conftest.$ac_ext <<_ACEOF
16233 #line 16233 "configure"
16234 #include "confdefs.h"
16235
16236 #ifdef HAVE_XCURSES
16237 #include <xcurses.h>
16238 char * XCursesProgramName = "test";
16239 #else
16240 #include <${cf_cv_ncurses_header:-curses.h}>
16241 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16242 #include <ncursesw/term.h>
16243 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16244 #include <ncurses/term.h>
16245 #elif defined(HAVE_TERM_H)
16246 #include <term.h>
16247 #endif
16248 #endif
16249
16250 extern char boolnames;
16251 int main(void)
16252 {
16253         void *foo = &(boolnames);
16254         fprintf(stderr, "testing linkage of boolnames:%p\n", foo);
16255         ${cf_cv_main_return:-return}(foo == 0);
16256 }
16257 _ACEOF
16258 rm -f conftest$ac_exeext
16259 if { (eval echo "$as_me:16259: \"$ac_link\"") >&5
16260   (eval $ac_link) 2>&5
16261   ac_status=$?
16262   echo "$as_me:16262: \$? = $ac_status" >&5
16263   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
16264   { (eval echo "$as_me:16264: \"$ac_try\"") >&5
16265   (eval $ac_try) 2>&5
16266   ac_status=$?
16267   echo "$as_me:16267: \$? = $ac_status" >&5
16268   (exit $ac_status); }; }; then
16269   cf_result=yes
16270 else
16271   echo "$as_me: program exited with status $ac_status" >&5
16272 echo "$as_me: failed program was:" >&5
16273 cat conftest.$ac_ext >&5
16274 cf_result=no
16275 fi
16276 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
16277 fi
16278         echo "$as_me:16278: result: $cf_result" >&5
16279 echo "${ECHO_T}$cf_result" >&6
16280         if test $cf_result = yes ; then
16281
16282 cf_result=`echo "decl_curses_data_boolnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16283
16284                 cat >>confdefs.h <<EOF
16285 #define $cf_result 1
16286 EOF
16287
16288         fi
16289 fi
16290
16291 echo "$as_me:16291: checking for data boolfnames declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
16292 echo $ECHO_N "checking for data boolfnames declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
16293
16294 cat >conftest.$ac_ext <<_ACEOF
16295 #line 16295 "configure"
16296 #include "confdefs.h"
16297
16298 #ifdef HAVE_XCURSES
16299 #include <xcurses.h>
16300 char * XCursesProgramName = "test";
16301 #else
16302 #include <${cf_cv_ncurses_header:-curses.h}>
16303 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16304 #include <ncursesw/term.h>
16305 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16306 #include <ncurses/term.h>
16307 #elif defined(HAVE_TERM_H)
16308 #include <term.h>
16309 #endif
16310 #endif
16311
16312 int
16313 main ()
16314 {
16315
16316 void *foo = &(boolfnames)
16317
16318   ;
16319   return 0;
16320 }
16321 _ACEOF
16322 rm -f conftest.$ac_objext
16323 if { (eval echo "$as_me:16323: \"$ac_compile\"") >&5
16324   (eval $ac_compile) 2>&5
16325   ac_status=$?
16326   echo "$as_me:16326: \$? = $ac_status" >&5
16327   (exit $ac_status); } &&
16328          { ac_try='test -s conftest.$ac_objext'
16329   { (eval echo "$as_me:16329: \"$ac_try\"") >&5
16330   (eval $ac_try) 2>&5
16331   ac_status=$?
16332   echo "$as_me:16332: \$? = $ac_status" >&5
16333   (exit $ac_status); }; }; then
16334   cf_result=yes
16335 else
16336   echo "$as_me: failed program was:" >&5
16337 cat conftest.$ac_ext >&5
16338 cf_result=no
16339 fi
16340 rm -f conftest.$ac_objext conftest.$ac_ext
16341 echo "$as_me:16341: result: $cf_result" >&5
16342 echo "${ECHO_T}$cf_result" >&6
16343
16344 if test $cf_result = yes ; then
16345
16346 cf_result=`echo "have_curses_data_boolfnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16347
16348         cat >>confdefs.h <<EOF
16349 #define $cf_result 1
16350 EOF
16351
16352 else
16353         echo "$as_me:16353: checking for data boolfnames in library" >&5
16354 echo $ECHO_N "checking for data boolfnames in library... $ECHO_C" >&6
16355         # BSD linkers insist on making weak linkage, but resolve at runtime.
16356         if test "$cross_compiling" = yes; then
16357
16358         # cross-compiling
16359         cat >conftest.$ac_ext <<_ACEOF
16360 #line 16360 "configure"
16361 #include "confdefs.h"
16362
16363 #ifdef HAVE_XCURSES
16364 #include <xcurses.h>
16365 char * XCursesProgramName = "test";
16366 #else
16367 #include <${cf_cv_ncurses_header:-curses.h}>
16368 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16369 #include <ncursesw/term.h>
16370 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16371 #include <ncurses/term.h>
16372 #elif defined(HAVE_TERM_H)
16373 #include <term.h>
16374 #endif
16375 #endif
16376
16377 extern char boolfnames;
16378 int
16379 main ()
16380 {
16381
16382         do {
16383                 void *foo = &(boolfnames);
16384                 fprintf(stderr, "testing linkage of boolfnames:%p\n", foo);
16385                 ${cf_cv_main_return:-return}(foo == 0);
16386         } while (0)
16387
16388   ;
16389   return 0;
16390 }
16391 _ACEOF
16392 rm -f conftest.$ac_objext conftest$ac_exeext
16393 if { (eval echo "$as_me:16393: \"$ac_link\"") >&5
16394   (eval $ac_link) 2>&5
16395   ac_status=$?
16396   echo "$as_me:16396: \$? = $ac_status" >&5
16397   (exit $ac_status); } &&
16398          { ac_try='test -s conftest$ac_exeext'
16399   { (eval echo "$as_me:16399: \"$ac_try\"") >&5
16400   (eval $ac_try) 2>&5
16401   ac_status=$?
16402   echo "$as_me:16402: \$? = $ac_status" >&5
16403   (exit $ac_status); }; }; then
16404   cf_result=yes
16405 else
16406   echo "$as_me: failed program was:" >&5
16407 cat conftest.$ac_ext >&5
16408 cf_result=no
16409 fi
16410 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16411
16412 else
16413   cat >conftest.$ac_ext <<_ACEOF
16414 #line 16414 "configure"
16415 #include "confdefs.h"
16416
16417 #ifdef HAVE_XCURSES
16418 #include <xcurses.h>
16419 char * XCursesProgramName = "test";
16420 #else
16421 #include <${cf_cv_ncurses_header:-curses.h}>
16422 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16423 #include <ncursesw/term.h>
16424 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16425 #include <ncurses/term.h>
16426 #elif defined(HAVE_TERM_H)
16427 #include <term.h>
16428 #endif
16429 #endif
16430
16431 extern char boolfnames;
16432 int main(void)
16433 {
16434         void *foo = &(boolfnames);
16435         fprintf(stderr, "testing linkage of boolfnames:%p\n", foo);
16436         ${cf_cv_main_return:-return}(foo == 0);
16437 }
16438 _ACEOF
16439 rm -f conftest$ac_exeext
16440 if { (eval echo "$as_me:16440: \"$ac_link\"") >&5
16441   (eval $ac_link) 2>&5
16442   ac_status=$?
16443   echo "$as_me:16443: \$? = $ac_status" >&5
16444   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
16445   { (eval echo "$as_me:16445: \"$ac_try\"") >&5
16446   (eval $ac_try) 2>&5
16447   ac_status=$?
16448   echo "$as_me:16448: \$? = $ac_status" >&5
16449   (exit $ac_status); }; }; then
16450   cf_result=yes
16451 else
16452   echo "$as_me: program exited with status $ac_status" >&5
16453 echo "$as_me: failed program was:" >&5
16454 cat conftest.$ac_ext >&5
16455 cf_result=no
16456 fi
16457 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
16458 fi
16459         echo "$as_me:16459: result: $cf_result" >&5
16460 echo "${ECHO_T}$cf_result" >&6
16461         if test $cf_result = yes ; then
16462
16463 cf_result=`echo "decl_curses_data_boolfnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16464
16465                 cat >>confdefs.h <<EOF
16466 #define $cf_result 1
16467 EOF
16468
16469         fi
16470 fi
16471
16472 if ( test "$GCC" = yes || test "$GXX" = yes )
16473 then
16474 echo "$as_me:16474: checking if you want to turn on gcc warnings" >&5
16475 echo $ECHO_N "checking if you want to turn on gcc warnings... $ECHO_C" >&6
16476
16477 # Check whether --enable-warnings or --disable-warnings was given.
16478 if test "${enable_warnings+set}" = set; then
16479   enableval="$enable_warnings"
16480   test "$enableval" != yes && enableval=no
16481         if test "$enableval" != "no" ; then
16482     with_warnings=yes
16483         else
16484                 with_warnings=no
16485         fi
16486 else
16487   enableval=no
16488         with_warnings=no
16489
16490 fi;
16491 echo "$as_me:16491: result: $with_warnings" >&5
16492 echo "${ECHO_T}$with_warnings" >&6
16493 if test "$with_warnings" = "yes"
16494 then
16495
16496 if test "$GCC" = yes
16497 then
16498 cat > conftest.i <<EOF
16499 #ifndef GCC_PRINTF
16500 #define GCC_PRINTF 0
16501 #endif
16502 #ifndef GCC_SCANF
16503 #define GCC_SCANF 0
16504 #endif
16505 #ifndef GCC_NORETURN
16506 #define GCC_NORETURN /* nothing */
16507 #endif
16508 #ifndef GCC_UNUSED
16509 #define GCC_UNUSED /* nothing */
16510 #endif
16511 EOF
16512 if test "$GCC" = yes
16513 then
16514         { echo "$as_me:16514: checking for $CC __attribute__ directives..." >&5
16515 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
16516 cat > conftest.$ac_ext <<EOF
16517 #line 16517 "${as_me:-configure}"
16518 #include "confdefs.h"
16519 #include "conftest.h"
16520 #include "conftest.i"
16521 #if     GCC_PRINTF
16522 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
16523 #else
16524 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
16525 #endif
16526 #if     GCC_SCANF
16527 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
16528 #else
16529 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
16530 #endif
16531 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
16532 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
16533 extern void foo(void) GCC_NORETURN;
16534 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
16535 EOF
16536         cf_printf_attribute=no
16537         cf_scanf_attribute=no
16538         for cf_attribute in scanf printf unused noreturn
16539         do
16540
16541 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16542
16543                 cf_directive="__attribute__(($cf_attribute))"
16544                 echo "checking for $CC $cf_directive" 1>&5
16545
16546                 case $cf_attribute in
16547                 (printf)
16548                         cf_printf_attribute=yes
16549                         cat >conftest.h <<EOF
16550 #define GCC_$cf_ATTRIBUTE 1
16551 EOF
16552                         ;;
16553                 (scanf)
16554                         cf_scanf_attribute=yes
16555                         cat >conftest.h <<EOF
16556 #define GCC_$cf_ATTRIBUTE 1
16557 EOF
16558                         ;;
16559                 (*)
16560                         cat >conftest.h <<EOF
16561 #define GCC_$cf_ATTRIBUTE $cf_directive
16562 EOF
16563                         ;;
16564                 esac
16565
16566                 if { (eval echo "$as_me:16566: \"$ac_compile\"") >&5
16567   (eval $ac_compile) 2>&5
16568   ac_status=$?
16569   echo "$as_me:16569: \$? = $ac_status" >&5
16570   (exit $ac_status); }; then
16571                         test -n "$verbose" && echo "$as_me:16571: result: ... $cf_attribute" >&5
16572 echo "${ECHO_T}... $cf_attribute" >&6
16573                         cat conftest.h >>confdefs.h
16574                         case $cf_attribute in
16575                         (noreturn)
16576
16577 cat >>confdefs.h <<EOF
16578 #define GCC_NORETURN $cf_directive
16579 EOF
16580
16581                                 ;;
16582                         (printf)
16583                                 cf_value='/* nothing */'
16584                                 if test "$cf_printf_attribute" != no ; then
16585                                         cf_value='__attribute__((format(printf,fmt,var)))'
16586
16587 cat >>confdefs.h <<\EOF
16588 #define GCC_PRINTF 1
16589 EOF
16590
16591                                 fi
16592
16593 cat >>confdefs.h <<EOF
16594 #define GCC_PRINTFLIKE(fmt,var) $cf_value
16595 EOF
16596
16597                                 ;;
16598                         (scanf)
16599                                 cf_value='/* nothing */'
16600                                 if test "$cf_scanf_attribute" != no ; then
16601                                         cf_value='__attribute__((format(scanf,fmt,var)))'
16602
16603 cat >>confdefs.h <<\EOF
16604 #define GCC_SCANF 1
16605 EOF
16606
16607                                 fi
16608
16609 cat >>confdefs.h <<EOF
16610 #define GCC_SCANFLIKE(fmt,var) $cf_value
16611 EOF
16612
16613                                 ;;
16614                         (unused)
16615
16616 cat >>confdefs.h <<EOF
16617 #define GCC_UNUSED $cf_directive
16618 EOF
16619
16620                                 ;;
16621                         esac
16622                 fi
16623         done
16624 else
16625         fgrep define conftest.i >>confdefs.h
16626 fi
16627 rm -rf conftest*
16628 fi
16629
16630 INTEL_COMPILER=no
16631
16632 if test "$GCC" = yes ; then
16633         case $host_os in
16634         (linux*|gnu*)
16635                 echo "$as_me:16635: checking if this is really Intel C compiler" >&5
16636 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
16637                 cf_save_CFLAGS="$CFLAGS"
16638                 CFLAGS="$CFLAGS -no-gcc"
16639                 cat >conftest.$ac_ext <<_ACEOF
16640 #line 16640 "configure"
16641 #include "confdefs.h"
16642
16643 int
16644 main ()
16645 {
16646
16647 #ifdef __INTEL_COMPILER
16648 #else
16649 make an error
16650 #endif
16651
16652   ;
16653   return 0;
16654 }
16655 _ACEOF
16656 rm -f conftest.$ac_objext
16657 if { (eval echo "$as_me:16657: \"$ac_compile\"") >&5
16658   (eval $ac_compile) 2>&5
16659   ac_status=$?
16660   echo "$as_me:16660: \$? = $ac_status" >&5
16661   (exit $ac_status); } &&
16662          { ac_try='test -s conftest.$ac_objext'
16663   { (eval echo "$as_me:16663: \"$ac_try\"") >&5
16664   (eval $ac_try) 2>&5
16665   ac_status=$?
16666   echo "$as_me:16666: \$? = $ac_status" >&5
16667   (exit $ac_status); }; }; then
16668   INTEL_COMPILER=yes
16669 cf_save_CFLAGS="$cf_save_CFLAGS -we147"
16670
16671 else
16672   echo "$as_me: failed program was:" >&5
16673 cat conftest.$ac_ext >&5
16674 fi
16675 rm -f conftest.$ac_objext conftest.$ac_ext
16676                 CFLAGS="$cf_save_CFLAGS"
16677                 echo "$as_me:16677: result: $INTEL_COMPILER" >&5
16678 echo "${ECHO_T}$INTEL_COMPILER" >&6
16679                 ;;
16680         esac
16681 fi
16682
16683 CLANG_COMPILER=no
16684
16685 if test "$GCC" = yes ; then
16686         echo "$as_me:16686: checking if this is really Clang C compiler" >&5
16687 echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6
16688         cf_save_CFLAGS="$CFLAGS"
16689         CFLAGS="$CFLAGS -Qunused-arguments"
16690         cat >conftest.$ac_ext <<_ACEOF
16691 #line 16691 "configure"
16692 #include "confdefs.h"
16693
16694 int
16695 main ()
16696 {
16697
16698 #ifdef __clang__
16699 #else
16700 make an error
16701 #endif
16702
16703   ;
16704   return 0;
16705 }
16706 _ACEOF
16707 rm -f conftest.$ac_objext
16708 if { (eval echo "$as_me:16708: \"$ac_compile\"") >&5
16709   (eval $ac_compile) 2>&5
16710   ac_status=$?
16711   echo "$as_me:16711: \$? = $ac_status" >&5
16712   (exit $ac_status); } &&
16713          { ac_try='test -s conftest.$ac_objext'
16714   { (eval echo "$as_me:16714: \"$ac_try\"") >&5
16715   (eval $ac_try) 2>&5
16716   ac_status=$?
16717   echo "$as_me:16717: \$? = $ac_status" >&5
16718   (exit $ac_status); }; }; then
16719   CLANG_COMPILER=yes
16720 cf_save_CFLAGS="$cf_save_CFLAGS -Qunused-arguments"
16721
16722 else
16723   echo "$as_me: failed program was:" >&5
16724 cat conftest.$ac_ext >&5
16725 fi
16726 rm -f conftest.$ac_objext conftest.$ac_ext
16727         CFLAGS="$cf_save_CFLAGS"
16728         echo "$as_me:16728: result: $CLANG_COMPILER" >&5
16729 echo "${ECHO_T}$CLANG_COMPILER" >&6
16730 fi
16731
16732 cat > conftest.$ac_ext <<EOF
16733 #line 16733 "${as_me:-configure}"
16734 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
16735 EOF
16736
16737 if test "$INTEL_COMPILER" = yes
16738 then
16739 # The "-wdXXX" options suppress warnings:
16740 # remark #1419: external declaration in primary source file
16741 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
16742 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
16743 # remark #193: zero used for undefined preprocessing identifier
16744 # remark #593: variable "curs_sb_left_arrow" was set but never used
16745 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
16746 # remark #869: parameter "tw" was never referenced
16747 # remark #981: operands are evaluated in unspecified order
16748 # warning #279: controlling expression is constant
16749
16750         { echo "$as_me:16750: checking for $CC warning options..." >&5
16751 echo "$as_me: checking for $CC warning options..." >&6;}
16752         cf_save_CFLAGS="$CFLAGS"
16753         EXTRA_CFLAGS="-Wall"
16754         for cf_opt in \
16755                 wd1419 \
16756                 wd1683 \
16757                 wd1684 \
16758                 wd193 \
16759                 wd593 \
16760                 wd279 \
16761                 wd810 \
16762                 wd869 \
16763                 wd981
16764         do
16765                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
16766                 if { (eval echo "$as_me:16766: \"$ac_compile\"") >&5
16767   (eval $ac_compile) 2>&5
16768   ac_status=$?
16769   echo "$as_me:16769: \$? = $ac_status" >&5
16770   (exit $ac_status); }; then
16771                         test -n "$verbose" && echo "$as_me:16771: result: ... -$cf_opt" >&5
16772 echo "${ECHO_T}... -$cf_opt" >&6
16773                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
16774                 fi
16775         done
16776         CFLAGS="$cf_save_CFLAGS"
16777
16778 elif test "$GCC" = yes
16779 then
16780         { echo "$as_me:16780: checking for $CC warning options..." >&5
16781 echo "$as_me: checking for $CC warning options..." >&6;}
16782         cf_save_CFLAGS="$CFLAGS"
16783         EXTRA_CFLAGS=
16784         cf_warn_CONST=""
16785         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
16786         cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
16787         test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
16788         for cf_opt in W Wall \
16789                 Wbad-function-cast \
16790                 Wcast-align \
16791                 Wcast-qual \
16792                 Wdeclaration-after-statement \
16793                 Wextra \
16794                 Winline \
16795                 Wmissing-declarations \
16796                 Wmissing-prototypes \
16797                 Wnested-externs \
16798                 Wpointer-arith \
16799                 Wshadow \
16800                 Wstrict-prototypes \
16801                 Wundef $cf_gcc_warnings $cf_warn_CONST
16802         do
16803                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
16804                 if { (eval echo "$as_me:16804: \"$ac_compile\"") >&5
16805   (eval $ac_compile) 2>&5
16806   ac_status=$?
16807   echo "$as_me:16807: \$? = $ac_status" >&5
16808   (exit $ac_status); }; then
16809                         test -n "$verbose" && echo "$as_me:16809: result: ... -$cf_opt" >&5
16810 echo "${ECHO_T}... -$cf_opt" >&6
16811                         case $cf_opt in
16812                         (Wcast-qual)
16813                                 CPPFLAGS="$CPPFLAGS -DXTSTRINGDEFINES"
16814                                 ;;
16815                         (Winline)
16816                                 case $GCC_VERSION in
16817                                 ([34].*)
16818                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
16819
16820 echo "${as_me:-configure}:16820: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
16821
16822                                         continue;;
16823                                 esac
16824                                 ;;
16825                         (Wpointer-arith)
16826                                 case $GCC_VERSION in
16827                                 ([12].*)
16828                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
16829
16830 echo "${as_me:-configure}:16830: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
16831
16832                                         continue;;
16833                                 esac
16834                                 ;;
16835                         esac
16836                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
16837                 fi
16838         done
16839         CFLAGS="$cf_save_CFLAGS"
16840 fi
16841 rm -rf conftest*
16842
16843 fi
16844 fi
16845
16846 echo "$as_me:16846: checking if you want to use dmalloc for testing" >&5
16847 echo $ECHO_N "checking if you want to use dmalloc for testing... $ECHO_C" >&6
16848
16849 # Check whether --with-dmalloc or --without-dmalloc was given.
16850 if test "${with_dmalloc+set}" = set; then
16851   withval="$with_dmalloc"
16852
16853 cat >>confdefs.h <<EOF
16854 #define USE_DMALLOC 1
16855 EOF
16856
16857         : ${with_cflags:=-g}
16858         : ${with_no_leaks:=yes}
16859          with_dmalloc=yes
16860 else
16861   with_dmalloc=
16862 fi;
16863 echo "$as_me:16863: result: ${with_dmalloc:-no}" >&5
16864 echo "${ECHO_T}${with_dmalloc:-no}" >&6
16865
16866 case .$with_cflags in
16867 (.*-g*)
16868         case .$CFLAGS in
16869         (.*-g*)
16870                 ;;
16871         (*)
16872
16873 cf_fix_cppflags=no
16874 cf_new_cflags=
16875 cf_new_cppflags=
16876 cf_new_extra_cppflags=
16877
16878 for cf_add_cflags in -g
16879 do
16880 case $cf_fix_cppflags in
16881 (no)
16882         case $cf_add_cflags in
16883         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
16884                 case $cf_add_cflags in
16885                 (-D*)
16886                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
16887
16888                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16889                                 && test -z "${cf_tst_cflags}" \
16890                                 && cf_fix_cppflags=yes
16891
16892                         if test $cf_fix_cppflags = yes ; then
16893                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
16894                                 continue
16895                         elif test "${cf_tst_cflags}" = "\"'" ; then
16896                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
16897                                 continue
16898                         fi
16899                         ;;
16900                 esac
16901                 case "$CPPFLAGS" in
16902                 (*$cf_add_cflags)
16903                         ;;
16904                 (*)
16905                         case $cf_add_cflags in
16906                         (-D*)
16907                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
16908
16909 CPPFLAGS=`echo "$CPPFLAGS" | \
16910         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
16911                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
16912
16913                                 ;;
16914                         esac
16915                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
16916                         ;;
16917                 esac
16918                 ;;
16919         (*)
16920                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
16921                 ;;
16922         esac
16923         ;;
16924 (yes)
16925         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
16926
16927         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
16928
16929         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16930                 && test -z "${cf_tst_cflags}" \
16931                 && cf_fix_cppflags=no
16932         ;;
16933 esac
16934 done
16935
16936 if test -n "$cf_new_cflags" ; then
16937
16938         CFLAGS="$CFLAGS $cf_new_cflags"
16939 fi
16940
16941 if test -n "$cf_new_cppflags" ; then
16942
16943         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
16944 fi
16945
16946 if test -n "$cf_new_extra_cppflags" ; then
16947
16948         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
16949 fi
16950
16951                 ;;
16952         esac
16953         ;;
16954 esac
16955
16956 if test "$with_dmalloc" = yes ; then
16957         echo "$as_me:16957: checking for dmalloc.h" >&5
16958 echo $ECHO_N "checking for dmalloc.h... $ECHO_C" >&6
16959 if test "${ac_cv_header_dmalloc_h+set}" = set; then
16960   echo $ECHO_N "(cached) $ECHO_C" >&6
16961 else
16962   cat >conftest.$ac_ext <<_ACEOF
16963 #line 16963 "configure"
16964 #include "confdefs.h"
16965 #include <dmalloc.h>
16966 _ACEOF
16967 if { (eval echo "$as_me:16967: \"$ac_cpp conftest.$ac_ext\"") >&5
16968   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
16969   ac_status=$?
16970   egrep -v '^ *\+' conftest.er1 >conftest.err
16971   rm -f conftest.er1
16972   cat conftest.err >&5
16973   echo "$as_me:16973: \$? = $ac_status" >&5
16974   (exit $ac_status); } >/dev/null; then
16975   if test -s conftest.err; then
16976     ac_cpp_err=$ac_c_preproc_warn_flag
16977   else
16978     ac_cpp_err=
16979   fi
16980 else
16981   ac_cpp_err=yes
16982 fi
16983 if test -z "$ac_cpp_err"; then
16984   ac_cv_header_dmalloc_h=yes
16985 else
16986   echo "$as_me: failed program was:" >&5
16987   cat conftest.$ac_ext >&5
16988   ac_cv_header_dmalloc_h=no
16989 fi
16990 rm -f conftest.err conftest.$ac_ext
16991 fi
16992 echo "$as_me:16992: result: $ac_cv_header_dmalloc_h" >&5
16993 echo "${ECHO_T}$ac_cv_header_dmalloc_h" >&6
16994 if test $ac_cv_header_dmalloc_h = yes; then
16995
16996 echo "$as_me:16996: checking for dmalloc_debug in -ldmalloc" >&5
16997 echo $ECHO_N "checking for dmalloc_debug in -ldmalloc... $ECHO_C" >&6
16998 if test "${ac_cv_lib_dmalloc_dmalloc_debug+set}" = set; then
16999   echo $ECHO_N "(cached) $ECHO_C" >&6
17000 else
17001   ac_check_lib_save_LIBS=$LIBS
17002 LIBS="-ldmalloc  $LIBS"
17003 cat >conftest.$ac_ext <<_ACEOF
17004 #line 17004 "configure"
17005 #include "confdefs.h"
17006
17007 /* Override any gcc2 internal prototype to avoid an error.  */
17008 #ifdef __cplusplus
17009 extern "C"
17010 #endif
17011 /* We use char because int might match the return type of a gcc2
17012    builtin and then its argument prototype would still apply.  */
17013 char dmalloc_debug ();
17014 int
17015 main ()
17016 {
17017 dmalloc_debug ();
17018   ;
17019   return 0;
17020 }
17021 _ACEOF
17022 rm -f conftest.$ac_objext conftest$ac_exeext
17023 if { (eval echo "$as_me:17023: \"$ac_link\"") >&5
17024   (eval $ac_link) 2>&5
17025   ac_status=$?
17026   echo "$as_me:17026: \$? = $ac_status" >&5
17027   (exit $ac_status); } &&
17028          { ac_try='test -s conftest$ac_exeext'
17029   { (eval echo "$as_me:17029: \"$ac_try\"") >&5
17030   (eval $ac_try) 2>&5
17031   ac_status=$?
17032   echo "$as_me:17032: \$? = $ac_status" >&5
17033   (exit $ac_status); }; }; then
17034   ac_cv_lib_dmalloc_dmalloc_debug=yes
17035 else
17036   echo "$as_me: failed program was:" >&5
17037 cat conftest.$ac_ext >&5
17038 ac_cv_lib_dmalloc_dmalloc_debug=no
17039 fi
17040 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17041 LIBS=$ac_check_lib_save_LIBS
17042 fi
17043 echo "$as_me:17043: result: $ac_cv_lib_dmalloc_dmalloc_debug" >&5
17044 echo "${ECHO_T}$ac_cv_lib_dmalloc_dmalloc_debug" >&6
17045 if test $ac_cv_lib_dmalloc_dmalloc_debug = yes; then
17046   cat >>confdefs.h <<EOF
17047 #define HAVE_LIBDMALLOC 1
17048 EOF
17049
17050   LIBS="-ldmalloc $LIBS"
17051
17052 fi
17053
17054 fi
17055
17056 fi
17057
17058 echo "$as_me:17058: checking if you want to use dbmalloc for testing" >&5
17059 echo $ECHO_N "checking if you want to use dbmalloc for testing... $ECHO_C" >&6
17060
17061 # Check whether --with-dbmalloc or --without-dbmalloc was given.
17062 if test "${with_dbmalloc+set}" = set; then
17063   withval="$with_dbmalloc"
17064
17065 cat >>confdefs.h <<EOF
17066 #define USE_DBMALLOC 1
17067 EOF
17068
17069         : ${with_cflags:=-g}
17070         : ${with_no_leaks:=yes}
17071          with_dbmalloc=yes
17072 else
17073   with_dbmalloc=
17074 fi;
17075 echo "$as_me:17075: result: ${with_dbmalloc:-no}" >&5
17076 echo "${ECHO_T}${with_dbmalloc:-no}" >&6
17077
17078 case .$with_cflags in
17079 (.*-g*)
17080         case .$CFLAGS in
17081         (.*-g*)
17082                 ;;
17083         (*)
17084
17085 cf_fix_cppflags=no
17086 cf_new_cflags=
17087 cf_new_cppflags=
17088 cf_new_extra_cppflags=
17089
17090 for cf_add_cflags in -g
17091 do
17092 case $cf_fix_cppflags in
17093 (no)
17094         case $cf_add_cflags in
17095         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
17096                 case $cf_add_cflags in
17097                 (-D*)
17098                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
17099
17100                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17101                                 && test -z "${cf_tst_cflags}" \
17102                                 && cf_fix_cppflags=yes
17103
17104                         if test $cf_fix_cppflags = yes ; then
17105                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
17106                                 continue
17107                         elif test "${cf_tst_cflags}" = "\"'" ; then
17108                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
17109                                 continue
17110                         fi
17111                         ;;
17112                 esac
17113                 case "$CPPFLAGS" in
17114                 (*$cf_add_cflags)
17115                         ;;
17116                 (*)
17117                         case $cf_add_cflags in
17118                         (-D*)
17119                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
17120
17121 CPPFLAGS=`echo "$CPPFLAGS" | \
17122         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
17123                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
17124
17125                                 ;;
17126                         esac
17127                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
17128                         ;;
17129                 esac
17130                 ;;
17131         (*)
17132                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
17133                 ;;
17134         esac
17135         ;;
17136 (yes)
17137         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
17138
17139         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
17140
17141         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17142                 && test -z "${cf_tst_cflags}" \
17143                 && cf_fix_cppflags=no
17144         ;;
17145 esac
17146 done
17147
17148 if test -n "$cf_new_cflags" ; then
17149
17150         CFLAGS="$CFLAGS $cf_new_cflags"
17151 fi
17152
17153 if test -n "$cf_new_cppflags" ; then
17154
17155         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
17156 fi
17157
17158 if test -n "$cf_new_extra_cppflags" ; then
17159
17160         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
17161 fi
17162
17163                 ;;
17164         esac
17165         ;;
17166 esac
17167
17168 if test "$with_dbmalloc" = yes ; then
17169         echo "$as_me:17169: checking for dbmalloc.h" >&5
17170 echo $ECHO_N "checking for dbmalloc.h... $ECHO_C" >&6
17171 if test "${ac_cv_header_dbmalloc_h+set}" = set; then
17172   echo $ECHO_N "(cached) $ECHO_C" >&6
17173 else
17174   cat >conftest.$ac_ext <<_ACEOF
17175 #line 17175 "configure"
17176 #include "confdefs.h"
17177 #include <dbmalloc.h>
17178 _ACEOF
17179 if { (eval echo "$as_me:17179: \"$ac_cpp conftest.$ac_ext\"") >&5
17180   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
17181   ac_status=$?
17182   egrep -v '^ *\+' conftest.er1 >conftest.err
17183   rm -f conftest.er1
17184   cat conftest.err >&5
17185   echo "$as_me:17185: \$? = $ac_status" >&5
17186   (exit $ac_status); } >/dev/null; then
17187   if test -s conftest.err; then
17188     ac_cpp_err=$ac_c_preproc_warn_flag
17189   else
17190     ac_cpp_err=
17191   fi
17192 else
17193   ac_cpp_err=yes
17194 fi
17195 if test -z "$ac_cpp_err"; then
17196   ac_cv_header_dbmalloc_h=yes
17197 else
17198   echo "$as_me: failed program was:" >&5
17199   cat conftest.$ac_ext >&5
17200   ac_cv_header_dbmalloc_h=no
17201 fi
17202 rm -f conftest.err conftest.$ac_ext
17203 fi
17204 echo "$as_me:17204: result: $ac_cv_header_dbmalloc_h" >&5
17205 echo "${ECHO_T}$ac_cv_header_dbmalloc_h" >&6
17206 if test $ac_cv_header_dbmalloc_h = yes; then
17207
17208 echo "$as_me:17208: checking for debug_malloc in -ldbmalloc" >&5
17209 echo $ECHO_N "checking for debug_malloc in -ldbmalloc... $ECHO_C" >&6
17210 if test "${ac_cv_lib_dbmalloc_debug_malloc+set}" = set; then
17211   echo $ECHO_N "(cached) $ECHO_C" >&6
17212 else
17213   ac_check_lib_save_LIBS=$LIBS
17214 LIBS="-ldbmalloc  $LIBS"
17215 cat >conftest.$ac_ext <<_ACEOF
17216 #line 17216 "configure"
17217 #include "confdefs.h"
17218
17219 /* Override any gcc2 internal prototype to avoid an error.  */
17220 #ifdef __cplusplus
17221 extern "C"
17222 #endif
17223 /* We use char because int might match the return type of a gcc2
17224    builtin and then its argument prototype would still apply.  */
17225 char debug_malloc ();
17226 int
17227 main ()
17228 {
17229 debug_malloc ();
17230   ;
17231   return 0;
17232 }
17233 _ACEOF
17234 rm -f conftest.$ac_objext conftest$ac_exeext
17235 if { (eval echo "$as_me:17235: \"$ac_link\"") >&5
17236   (eval $ac_link) 2>&5
17237   ac_status=$?
17238   echo "$as_me:17238: \$? = $ac_status" >&5
17239   (exit $ac_status); } &&
17240          { ac_try='test -s conftest$ac_exeext'
17241   { (eval echo "$as_me:17241: \"$ac_try\"") >&5
17242   (eval $ac_try) 2>&5
17243   ac_status=$?
17244   echo "$as_me:17244: \$? = $ac_status" >&5
17245   (exit $ac_status); }; }; then
17246   ac_cv_lib_dbmalloc_debug_malloc=yes
17247 else
17248   echo "$as_me: failed program was:" >&5
17249 cat conftest.$ac_ext >&5
17250 ac_cv_lib_dbmalloc_debug_malloc=no
17251 fi
17252 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17253 LIBS=$ac_check_lib_save_LIBS
17254 fi
17255 echo "$as_me:17255: result: $ac_cv_lib_dbmalloc_debug_malloc" >&5
17256 echo "${ECHO_T}$ac_cv_lib_dbmalloc_debug_malloc" >&6
17257 if test $ac_cv_lib_dbmalloc_debug_malloc = yes; then
17258   cat >>confdefs.h <<EOF
17259 #define HAVE_LIBDBMALLOC 1
17260 EOF
17261
17262   LIBS="-ldbmalloc $LIBS"
17263
17264 fi
17265
17266 fi
17267
17268 fi
17269
17270 echo "$as_me:17270: checking if you want to use valgrind for testing" >&5
17271 echo $ECHO_N "checking if you want to use valgrind for testing... $ECHO_C" >&6
17272
17273 # Check whether --with-valgrind or --without-valgrind was given.
17274 if test "${with_valgrind+set}" = set; then
17275   withval="$with_valgrind"
17276
17277 cat >>confdefs.h <<EOF
17278 #define USE_VALGRIND 1
17279 EOF
17280
17281         : ${with_cflags:=-g}
17282         : ${with_no_leaks:=yes}
17283          with_valgrind=yes
17284 else
17285   with_valgrind=
17286 fi;
17287 echo "$as_me:17287: result: ${with_valgrind:-no}" >&5
17288 echo "${ECHO_T}${with_valgrind:-no}" >&6
17289
17290 case .$with_cflags in
17291 (.*-g*)
17292         case .$CFLAGS in
17293         (.*-g*)
17294                 ;;
17295         (*)
17296
17297 cf_fix_cppflags=no
17298 cf_new_cflags=
17299 cf_new_cppflags=
17300 cf_new_extra_cppflags=
17301
17302 for cf_add_cflags in -g
17303 do
17304 case $cf_fix_cppflags in
17305 (no)
17306         case $cf_add_cflags in
17307         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
17308                 case $cf_add_cflags in
17309                 (-D*)
17310                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
17311
17312                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17313                                 && test -z "${cf_tst_cflags}" \
17314                                 && cf_fix_cppflags=yes
17315
17316                         if test $cf_fix_cppflags = yes ; then
17317                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
17318                                 continue
17319                         elif test "${cf_tst_cflags}" = "\"'" ; then
17320                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
17321                                 continue
17322                         fi
17323                         ;;
17324                 esac
17325                 case "$CPPFLAGS" in
17326                 (*$cf_add_cflags)
17327                         ;;
17328                 (*)
17329                         case $cf_add_cflags in
17330                         (-D*)
17331                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
17332
17333 CPPFLAGS=`echo "$CPPFLAGS" | \
17334         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
17335                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
17336
17337                                 ;;
17338                         esac
17339                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
17340                         ;;
17341                 esac
17342                 ;;
17343         (*)
17344                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
17345                 ;;
17346         esac
17347         ;;
17348 (yes)
17349         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
17350
17351         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
17352
17353         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17354                 && test -z "${cf_tst_cflags}" \
17355                 && cf_fix_cppflags=no
17356         ;;
17357 esac
17358 done
17359
17360 if test -n "$cf_new_cflags" ; then
17361
17362         CFLAGS="$CFLAGS $cf_new_cflags"
17363 fi
17364
17365 if test -n "$cf_new_cppflags" ; then
17366
17367         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
17368 fi
17369
17370 if test -n "$cf_new_extra_cppflags" ; then
17371
17372         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
17373 fi
17374
17375                 ;;
17376         esac
17377         ;;
17378 esac
17379
17380 echo "$as_me:17380: checking if you want to perform memory-leak testing" >&5
17381 echo $ECHO_N "checking if you want to perform memory-leak testing... $ECHO_C" >&6
17382
17383 # Check whether --enable-leaks or --disable-leaks was given.
17384 if test "${enable_leaks+set}" = set; then
17385   enableval="$enable_leaks"
17386   if test "x$enableval" = xno; then with_no_leaks=yes; else with_no_leaks=no; fi
17387 else
17388   : ${with_no_leaks:=no}
17389 fi;
17390 echo "$as_me:17390: result: $with_no_leaks" >&5
17391 echo "${ECHO_T}$with_no_leaks" >&6
17392
17393 if test "$with_no_leaks" = yes ; then
17394
17395 cat >>confdefs.h <<\EOF
17396 #define NO_LEAKS 1
17397 EOF
17398
17399 cat >>confdefs.h <<\EOF
17400 #define YY_NO_LEAKS 1
17401 EOF
17402
17403 fi
17404
17405 LD_RPATH_OPT=
17406 echo "$as_me:17406: checking for an rpath option" >&5
17407 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
17408 case $cf_cv_system_name in
17409 (irix*)
17410         if test "$GCC" = yes; then
17411                 LD_RPATH_OPT="-Wl,-rpath,"
17412         else
17413                 LD_RPATH_OPT="-rpath "
17414         fi
17415         ;;
17416 (linux*|gnu*|k*bsd*-gnu|freebsd*)
17417         LD_RPATH_OPT="-Wl,-rpath,"
17418         ;;
17419 (openbsd[2-9].*|mirbsd*)
17420         LD_RPATH_OPT="-Wl,-rpath,"
17421         ;;
17422 (dragonfly*)
17423         LD_RPATH_OPT="-rpath "
17424         ;;
17425 (netbsd*)
17426         LD_RPATH_OPT="-Wl,-rpath,"
17427         ;;
17428 (osf*|mls+*)
17429         LD_RPATH_OPT="-rpath "
17430         ;;
17431 (solaris2*)
17432         LD_RPATH_OPT="-R"
17433         ;;
17434 (*)
17435         ;;
17436 esac
17437 echo "$as_me:17437: result: $LD_RPATH_OPT" >&5
17438 echo "${ECHO_T}$LD_RPATH_OPT" >&6
17439
17440 case "x$LD_RPATH_OPT" in
17441 (x-R*)
17442         echo "$as_me:17442: checking if we need a space after rpath option" >&5
17443 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
17444         cf_save_LIBS="$LIBS"
17445
17446 cf_add_libs="${LD_RPATH_OPT}$libdir"
17447 # Filter out duplicates - this happens with badly-designed ".pc" files...
17448 for cf_add_1lib in $LIBS
17449 do
17450         for cf_add_2lib in $cf_add_libs
17451         do
17452                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
17453                 then
17454                         cf_add_1lib=
17455                         break
17456                 fi
17457         done
17458         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
17459 done
17460 LIBS="$cf_add_libs"
17461
17462         cat >conftest.$ac_ext <<_ACEOF
17463 #line 17463 "configure"
17464 #include "confdefs.h"
17465
17466 int
17467 main ()
17468 {
17469
17470   ;
17471   return 0;
17472 }
17473 _ACEOF
17474 rm -f conftest.$ac_objext conftest$ac_exeext
17475 if { (eval echo "$as_me:17475: \"$ac_link\"") >&5
17476   (eval $ac_link) 2>&5
17477   ac_status=$?
17478   echo "$as_me:17478: \$? = $ac_status" >&5
17479   (exit $ac_status); } &&
17480          { ac_try='test -s conftest$ac_exeext'
17481   { (eval echo "$as_me:17481: \"$ac_try\"") >&5
17482   (eval $ac_try) 2>&5
17483   ac_status=$?
17484   echo "$as_me:17484: \$? = $ac_status" >&5
17485   (exit $ac_status); }; }; then
17486   cf_rpath_space=no
17487 else
17488   echo "$as_me: failed program was:" >&5
17489 cat conftest.$ac_ext >&5
17490 cf_rpath_space=yes
17491 fi
17492 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17493         LIBS="$cf_save_LIBS"
17494         echo "$as_me:17494: result: $cf_rpath_space" >&5
17495 echo "${ECHO_T}$cf_rpath_space" >&6
17496         test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
17497         ;;
17498 esac
17499
17500 echo "$as_me:17500: checking if rpath-hack should be disabled" >&5
17501 echo $ECHO_N "checking if rpath-hack should be disabled... $ECHO_C" >&6
17502
17503 # Check whether --enable-rpath-hack or --disable-rpath-hack was given.
17504 if test "${enable_rpath_hack+set}" = set; then
17505   enableval="$enable_rpath_hack"
17506   test "$enableval" != no && enableval=yes
17507         if test "$enableval" != "yes" ; then
17508     cf_disable_rpath_hack=yes
17509         else
17510                 cf_disable_rpath_hack=no
17511         fi
17512 else
17513   enableval=yes
17514         cf_disable_rpath_hack=no
17515
17516 fi;
17517 echo "$as_me:17517: result: $cf_disable_rpath_hack" >&5
17518 echo "${ECHO_T}$cf_disable_rpath_hack" >&6
17519 if test "$cf_disable_rpath_hack" = no ; then
17520
17521 echo "$as_me:17521: checking for updated LDFLAGS" >&5
17522 echo $ECHO_N "checking for updated LDFLAGS... $ECHO_C" >&6
17523 if test -n "$LD_RPATH_OPT" ; then
17524         echo "$as_me:17524: result: maybe" >&5
17525 echo "${ECHO_T}maybe" >&6
17526
17527         for ac_prog in ldd
17528 do
17529   # Extract the first word of "$ac_prog", so it can be a program name with args.
17530 set dummy $ac_prog; ac_word=$2
17531 echo "$as_me:17531: checking for $ac_word" >&5
17532 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
17533 if test "${ac_cv_prog_cf_ldd_prog+set}" = set; then
17534   echo $ECHO_N "(cached) $ECHO_C" >&6
17535 else
17536   if test -n "$cf_ldd_prog"; then
17537   ac_cv_prog_cf_ldd_prog="$cf_ldd_prog" # Let the user override the test.
17538 else
17539   ac_save_IFS=$IFS; IFS=$ac_path_separator
17540 ac_dummy="$PATH"
17541 for ac_dir in $ac_dummy; do
17542   IFS=$ac_save_IFS
17543   test -z "$ac_dir" && ac_dir=.
17544   $as_executable_p "$ac_dir/$ac_word" || continue
17545 ac_cv_prog_cf_ldd_prog="$ac_prog"
17546 echo "$as_me:17546: found $ac_dir/$ac_word" >&5
17547 break
17548 done
17549
17550 fi
17551 fi
17552 cf_ldd_prog=$ac_cv_prog_cf_ldd_prog
17553 if test -n "$cf_ldd_prog"; then
17554   echo "$as_me:17554: result: $cf_ldd_prog" >&5
17555 echo "${ECHO_T}$cf_ldd_prog" >&6
17556 else
17557   echo "$as_me:17557: result: no" >&5
17558 echo "${ECHO_T}no" >&6
17559 fi
17560
17561   test -n "$cf_ldd_prog" && break
17562 done
17563 test -n "$cf_ldd_prog" || cf_ldd_prog="no"
17564
17565         cf_rpath_list="/usr/lib /lib"
17566         if test "$cf_ldd_prog" != no
17567         then
17568                 cf_rpath_oops=
17569
17570 cat >conftest.$ac_ext <<_ACEOF
17571 #line 17571 "configure"
17572 #include "confdefs.h"
17573 #include <stdio.h>
17574 int
17575 main ()
17576 {
17577 printf("Hello");
17578   ;
17579   return 0;
17580 }
17581 _ACEOF
17582 rm -f conftest.$ac_objext conftest$ac_exeext
17583 if { (eval echo "$as_me:17583: \"$ac_link\"") >&5
17584   (eval $ac_link) 2>&5
17585   ac_status=$?
17586   echo "$as_me:17586: \$? = $ac_status" >&5
17587   (exit $ac_status); } &&
17588          { ac_try='test -s conftest$ac_exeext'
17589   { (eval echo "$as_me:17589: \"$ac_try\"") >&5
17590   (eval $ac_try) 2>&5
17591   ac_status=$?
17592   echo "$as_me:17592: \$? = $ac_status" >&5
17593   (exit $ac_status); }; }; then
17594   cf_rpath_oops=`$cf_ldd_prog conftest$ac_exeext | fgrep ' not found' | sed -e 's% =>.*$%%' |sort | uniq`
17595                  cf_rpath_list=`$cf_ldd_prog conftest$ac_exeext | fgrep / | sed -e 's%^.*[      ]/%/%' -e 's%/[^/][^/]*$%%' |sort | uniq`
17596 else
17597   echo "$as_me: failed program was:" >&5
17598 cat conftest.$ac_ext >&5
17599 fi
17600 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17601
17602                 # If we passed the link-test, but get a "not found" on a given library,
17603                 # this could be due to inept reconfiguration of gcc to make it only
17604                 # partly honor /usr/local/lib (or whatever).  Sometimes this behavior
17605                 # is intentional, e.g., installing gcc in /usr/bin and suppressing the
17606                 # /usr/local libraries.
17607                 if test -n "$cf_rpath_oops"
17608                 then
17609                         for cf_rpath_src in $cf_rpath_oops
17610                         do
17611                                 for cf_rpath_dir in \
17612                                         /usr/local \
17613                                         /usr/pkg \
17614                                         /opt/sfw
17615                                 do
17616                                         if test -f $cf_rpath_dir/lib/$cf_rpath_src
17617                                         then
17618                                                 test -n "$verbose" && echo "    ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src" 1>&6
17619
17620 echo "${as_me:-configure}:17620: testing ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src ..." 1>&5
17621
17622                                                 LDFLAGS="$LDFLAGS -L$cf_rpath_dir/lib"
17623                                                 break
17624                                         fi
17625                                 done
17626                         done
17627                 fi
17628         fi
17629
17630         test -n "$verbose" && echo "    ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
17631
17632 echo "${as_me:-configure}:17632: testing ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
17633
17634 test -n "$verbose" && echo "    ...checking LDFLAGS $LDFLAGS" 1>&6
17635
17636 echo "${as_me:-configure}:17636: testing ...checking LDFLAGS $LDFLAGS ..." 1>&5
17637
17638 cf_rpath_dst=
17639 for cf_rpath_src in $LDFLAGS
17640 do
17641         case $cf_rpath_src in
17642         (-L*)
17643
17644                 # check if this refers to a directory which we will ignore
17645                 cf_rpath_skip=no
17646                 if test -n "$cf_rpath_list"
17647                 then
17648                         for cf_rpath_item in $cf_rpath_list
17649                         do
17650                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
17651                                 then
17652                                         cf_rpath_skip=yes
17653                                         break
17654                                 fi
17655                         done
17656                 fi
17657
17658                 if test "$cf_rpath_skip" = no
17659                 then
17660                         # transform the option
17661                         if test "$LD_RPATH_OPT" = "-R " ; then
17662                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
17663                         else
17664                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
17665                         fi
17666
17667                         # if we have not already added this, add it now
17668                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
17669                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
17670                         then
17671                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
17672
17673 echo "${as_me:-configure}:17673: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
17674
17675                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
17676                         fi
17677                 fi
17678                 ;;
17679         esac
17680         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
17681 done
17682 LDFLAGS=$cf_rpath_dst
17683
17684 test -n "$verbose" && echo "    ...checked LDFLAGS $LDFLAGS" 1>&6
17685
17686 echo "${as_me:-configure}:17686: testing ...checked LDFLAGS $LDFLAGS ..." 1>&5
17687
17688 test -n "$verbose" && echo "    ...checking LIBS $LIBS" 1>&6
17689
17690 echo "${as_me:-configure}:17690: testing ...checking LIBS $LIBS ..." 1>&5
17691
17692 cf_rpath_dst=
17693 for cf_rpath_src in $LIBS
17694 do
17695         case $cf_rpath_src in
17696         (-L*)
17697
17698                 # check if this refers to a directory which we will ignore
17699                 cf_rpath_skip=no
17700                 if test -n "$cf_rpath_list"
17701                 then
17702                         for cf_rpath_item in $cf_rpath_list
17703                         do
17704                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
17705                                 then
17706                                         cf_rpath_skip=yes
17707                                         break
17708                                 fi
17709                         done
17710                 fi
17711
17712                 if test "$cf_rpath_skip" = no
17713                 then
17714                         # transform the option
17715                         if test "$LD_RPATH_OPT" = "-R " ; then
17716                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
17717                         else
17718                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
17719                         fi
17720
17721                         # if we have not already added this, add it now
17722                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
17723                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
17724                         then
17725                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
17726
17727 echo "${as_me:-configure}:17727: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
17728
17729                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
17730                         fi
17731                 fi
17732                 ;;
17733         esac
17734         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
17735 done
17736 LIBS=$cf_rpath_dst
17737
17738 test -n "$verbose" && echo "    ...checked LIBS $LIBS" 1>&6
17739
17740 echo "${as_me:-configure}:17740: testing ...checked LIBS $LIBS ..." 1>&5
17741
17742         test -n "$verbose" && echo "    ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
17743
17744 echo "${as_me:-configure}:17744: testing ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
17745
17746 else
17747         echo "$as_me:17747: result: no" >&5
17748 echo "${ECHO_T}no" >&6
17749 fi
17750
17751 fi
17752
17753 TEST_ARGS="$LIBS"
17754 LIBS=
17755
17756 ac_config_files="$ac_config_files Makefile"
17757 ac_config_commands="$ac_config_commands default"
17758 cat >confcache <<\_ACEOF
17759 # This file is a shell script that caches the results of configure
17760 # tests run on this system so they can be shared between configure
17761 # scripts and configure runs, see configure's option --config-cache.
17762 # It is not useful on other systems.  If it contains results you don't
17763 # want to keep, you may remove or edit it.
17764 #
17765 # config.status only pays attention to the cache file if you give it
17766 # the --recheck option to rerun configure.
17767 #
17768 # `ac_cv_env_foo' variables (set or unset) will be overriden when
17769 # loading this file, other *unset* `ac_cv_foo' will be assigned the
17770 # following values.
17771
17772 _ACEOF
17773
17774 # The following way of writing the cache mishandles newlines in values,
17775 # but we know of no workaround that is simple, portable, and efficient.
17776 # So, don't put newlines in cache variables' values.
17777 # Ultrix sh set writes to stderr and can't be redirected directly,
17778 # and sets the high bit in the cache file unless we assign to the vars.
17779 {
17780   (set) 2>&1 |
17781     case `(ac_space=' '; set | grep ac_space) 2>&1` in
17782     *ac_space=\ *)
17783       # `set' does not quote correctly, so add quotes (double-quote
17784       # substitution turns \\\\ into \\, and sed turns \\ into \).
17785       sed -n \
17786         "s/'/'\\\\''/g;
17787           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
17788       ;;
17789     *)
17790       # `set' quotes correctly as required by POSIX, so do not add quotes.
17791       sed -n \
17792         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
17793       ;;
17794     esac;
17795 } |
17796   sed '
17797      t clear
17798      : clear
17799      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
17800      t end
17801      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
17802      : end' >>confcache
17803 if cmp -s $cache_file confcache; then :; else
17804   if test -w $cache_file; then
17805     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
17806     cat confcache >$cache_file
17807   else
17808     echo "not updating unwritable cache $cache_file"
17809   fi
17810 fi
17811 rm -f confcache
17812
17813 test "x$prefix" = xNONE && prefix=$ac_default_prefix
17814 # Let make expand exec_prefix.
17815 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
17816
17817 # VPATH may cause trouble with some makes, so we remove $(srcdir),
17818 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
17819 # trailing colons and then remove the whole line if VPATH becomes empty
17820 # (actually we leave an empty line to preserve line numbers).
17821 if test "x$srcdir" = x.; then
17822   ac_vpsub='/^[         ]*VPATH[        ]*=/{
17823 s/:*\$(srcdir):*/:/;
17824 s/:*\${srcdir}:*/:/;
17825 s/:*@srcdir@:*/:/;
17826 s/^\([^=]*=[    ]*\):*/\1/;
17827 s/:*$//;
17828 s/^[^=]*=[      ]*$//;
17829 }'
17830 fi
17831
17832 DEFS=-DHAVE_CONFIG_H
17833
17834 : ${CONFIG_STATUS=./config.status}
17835 ac_clean_files_save=$ac_clean_files
17836 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
17837 { echo "$as_me:17837: creating $CONFIG_STATUS" >&5
17838 echo "$as_me: creating $CONFIG_STATUS" >&6;}
17839 cat >$CONFIG_STATUS <<_ACEOF
17840 #! $SHELL
17841 # Generated automatically by configure.
17842 # Run this file to recreate the current configuration.
17843 # Compiler output produced by configure, useful for debugging
17844 # configure, is in config.log if it exists.
17845
17846 debug=false
17847 SHELL=\${CONFIG_SHELL-$SHELL}
17848 ac_cs_invocation="\$0 \$@"
17849
17850 _ACEOF
17851
17852 cat >>$CONFIG_STATUS <<\_ACEOF
17853 # Be Bourne compatible
17854 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
17855   emulate sh
17856   NULLCMD=:
17857 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
17858   set -o posix
17859 fi
17860
17861 # Name of the executable.
17862 as_me=`echo "$0" |sed 's,.*[\\/],,'`
17863
17864 if expr a : '\(a\)' >/dev/null 2>&1; then
17865   as_expr=expr
17866 else
17867   as_expr=false
17868 fi
17869
17870 rm -f conf$$ conf$$.exe conf$$.file
17871 echo >conf$$.file
17872 if ln -s conf$$.file conf$$ 2>/dev/null; then
17873   # We could just check for DJGPP; but this test a) works b) is more generic
17874   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
17875   if test -f conf$$.exe; then
17876     # Don't use ln at all; we don't have any links
17877     as_ln_s='cp -p'
17878   else
17879     as_ln_s='ln -s'
17880   fi
17881 elif ln conf$$.file conf$$ 2>/dev/null; then
17882   as_ln_s=ln
17883 else
17884   as_ln_s='cp -p'
17885 fi
17886 rm -f conf$$ conf$$.exe conf$$.file
17887
17888 as_executable_p="test -f"
17889
17890 # Support unset when possible.
17891 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
17892   as_unset=unset
17893 else
17894   as_unset=false
17895 fi
17896
17897 # NLS nuisances.
17898 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
17899 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
17900 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
17901 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
17902 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
17903 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
17904 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
17905 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
17906
17907 # IFS
17908 # We need space, tab and new line, in precisely that order.
17909 as_nl='
17910 '
17911 IFS="   $as_nl"
17912
17913 # CDPATH.
17914 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
17915
17916 exec 6>&1
17917
17918 _ACEOF
17919
17920 # Files that config.status was made for.
17921 if test -n "$ac_config_files"; then
17922   echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
17923 fi
17924
17925 if test -n "$ac_config_headers"; then
17926   echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
17927 fi
17928
17929 if test -n "$ac_config_links"; then
17930   echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
17931 fi
17932
17933 if test -n "$ac_config_commands"; then
17934   echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
17935 fi
17936
17937 cat >>$CONFIG_STATUS <<\EOF
17938
17939 ac_cs_usage="\
17940 \`$as_me' instantiates files from templates according to the
17941 current configuration.
17942
17943 Usage: $0 [OPTIONS] [FILE]...
17944
17945   -h, --help       print this help, then exit
17946   -V, --version    print version number, then exit
17947   -d, --debug      don't remove temporary files
17948       --recheck    update $as_me by reconfiguring in the same conditions
17949   --file=FILE[:TEMPLATE]
17950                    instantiate the configuration file FILE
17951   --header=FILE[:TEMPLATE]
17952                    instantiate the configuration header FILE
17953
17954 Configuration files:
17955 $config_files
17956
17957 Configuration headers:
17958 $config_headers
17959
17960 Configuration commands:
17961 $config_commands
17962
17963 Report bugs to <dickey@invisible-island.net>."
17964 EOF
17965
17966 cat >>$CONFIG_STATUS <<EOF
17967 ac_cs_version="\\
17968 config.status
17969 configured by $0, generated by GNU Autoconf 2.52.20150926,
17970   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
17971
17972 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
17973 Free Software Foundation, Inc.
17974 This config.status script is free software; the Free Software Foundation
17975 gives unlimited permission to copy, distribute and modify it."
17976 srcdir=$srcdir
17977 INSTALL="$INSTALL"
17978 EOF
17979
17980 cat >>$CONFIG_STATUS <<\EOF
17981 # If no file are specified by the user, then we need to provide default
17982 # value.  By we need to know if files were specified by the user.
17983 ac_need_defaults=:
17984 while test $# != 0
17985 do
17986   case $1 in
17987   --*=*)
17988     ac_option=`expr "x$1" : 'x\([^=]*\)='`
17989     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
17990     shift
17991     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
17992     shift
17993     ;;
17994   -*);;
17995   *) # This is not an option, so the user has probably given explicit
17996      # arguments.
17997      ac_need_defaults=false;;
17998   esac
17999
18000   case $1 in
18001   # Handling of the options.
18002 EOF
18003 cat >>$CONFIG_STATUS <<EOF
18004   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
18005     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
18006     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
18007 EOF
18008 cat >>$CONFIG_STATUS <<\EOF
18009   --version | --vers* | -V )
18010     echo "$ac_cs_version"; exit 0 ;;
18011   --he | --h)
18012     # Conflict between --help and --header
18013     { { echo "$as_me:18013: error: ambiguous option: $1
18014 Try \`$0 --help' for more information." >&5
18015 echo "$as_me: error: ambiguous option: $1
18016 Try \`$0 --help' for more information." >&2;}
18017    { (exit 1); exit 1; }; };;
18018   --help | --hel | -h )
18019     echo "$ac_cs_usage"; exit 0 ;;
18020   --debug | --d* | -d )
18021     debug=: ;;
18022   --file | --fil | --fi | --f )
18023     shift
18024     CONFIG_FILES="$CONFIG_FILES $1"
18025     ac_need_defaults=false;;
18026   --header | --heade | --head | --hea )
18027     shift
18028     CONFIG_HEADERS="$CONFIG_HEADERS $1"
18029     ac_need_defaults=false;;
18030
18031   # This is an error.
18032   -*) { { echo "$as_me:18032: error: unrecognized option: $1
18033 Try \`$0 --help' for more information." >&5
18034 echo "$as_me: error: unrecognized option: $1
18035 Try \`$0 --help' for more information." >&2;}
18036    { (exit 1); exit 1; }; } ;;
18037
18038   *) ac_config_targets="$ac_config_targets $1" ;;
18039
18040   esac
18041   shift
18042 done
18043
18044 exec 5>>config.log
18045 cat >&5 << _ACEOF
18046
18047 ## ----------------------- ##
18048 ## Running config.status.  ##
18049 ## ----------------------- ##
18050
18051 This file was extended by $as_me 2.52.20150926, executed with
18052   CONFIG_FILES    = $CONFIG_FILES
18053   CONFIG_HEADERS  = $CONFIG_HEADERS
18054   CONFIG_LINKS    = $CONFIG_LINKS
18055   CONFIG_COMMANDS = $CONFIG_COMMANDS
18056   > $ac_cs_invocation
18057 on `(hostname || uname -n) 2>/dev/null | sed 1q`
18058
18059 _ACEOF
18060 EOF
18061
18062 cat >>$CONFIG_STATUS <<EOF
18063 #
18064 # INIT-COMMANDS section.
18065 #
18066
18067 AWK="$AWK"
18068 ECHO_CC="$ECHO_CC"
18069 ECHO_LD="$ECHO_LD"
18070 SHOW_CC="$SHOW_LD"
18071
18072 EOF
18073
18074 cat >>$CONFIG_STATUS <<\EOF
18075 for ac_config_target in $ac_config_targets
18076 do
18077   case "$ac_config_target" in
18078   # Handling of arguments.
18079   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
18080   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
18081   "ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS ncurses_cfg.h:ncurses_tst.hin" ;;
18082   *) { { echo "$as_me:18082: error: invalid argument: $ac_config_target" >&5
18083 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
18084    { (exit 1); exit 1; }; };;
18085   esac
18086 done
18087
18088 # If the user did not use the arguments to specify the items to instantiate,
18089 # then the envvar interface is used.  Set only those that are not.
18090 # We use the long form for the default assignment because of an extremely
18091 # bizarre bug on SunOS 4.1.3.
18092 if $ac_need_defaults; then
18093   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
18094   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
18095   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
18096 fi
18097
18098 # Create a temporary directory, and hook for its removal unless debugging.
18099 $debug ||
18100 {
18101   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
18102   trap '{ (exit 1); exit 1; }' 1 2 13 15
18103 }
18104
18105 # Create a (secure) tmp directory for tmp files.
18106 : ${TMPDIR=/tmp}
18107 {
18108   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
18109   test -n "$tmp" && test -d "$tmp"
18110 }  ||
18111 {
18112   tmp=$TMPDIR/cs$$-$RANDOM
18113   (umask 077 && mkdir $tmp)
18114 } ||
18115 {
18116    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
18117    { (exit 1); exit 1; }
18118 }
18119
18120 EOF
18121
18122 cat >>$CONFIG_STATUS <<EOF
18123
18124 #
18125 # CONFIG_FILES section.
18126 #
18127
18128 # No need to generate the scripts if there are no CONFIG_FILES.
18129 # This happens for instance when ./config.status config.h
18130 if test -n "\$CONFIG_FILES"; then
18131   # Protect against being on the right side of a sed subst in config.status.
18132   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
18133    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
18134 s,@SHELL@,$SHELL,;t t
18135 s,@exec_prefix@,$exec_prefix,;t t
18136 s,@prefix@,$prefix,;t t
18137 s,@program_transform_name@,$program_transform_name,;t t
18138 s,@bindir@,$bindir,;t t
18139 s,@sbindir@,$sbindir,;t t
18140 s,@libexecdir@,$libexecdir,;t t
18141 s,@datarootdir@,$datarootdir,;t t
18142 s,@datadir@,$datadir,;t t
18143 s,@sysconfdir@,$sysconfdir,;t t
18144 s,@sharedstatedir@,$sharedstatedir,;t t
18145 s,@localstatedir@,$localstatedir,;t t
18146 s,@libdir@,$libdir,;t t
18147 s,@includedir@,$includedir,;t t
18148 s,@oldincludedir@,$oldincludedir,;t t
18149 s,@infodir@,$infodir,;t t
18150 s,@mandir@,$mandir,;t t
18151 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
18152 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
18153 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
18154 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
18155 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
18156 s,@build_alias@,$build_alias,;t t
18157 s,@host_alias@,$host_alias,;t t
18158 s,@target_alias@,$target_alias,;t t
18159 s,@ECHO_C@,$ECHO_C,;t t
18160 s,@ECHO_N@,$ECHO_N,;t t
18161 s,@ECHO_T@,$ECHO_T,;t t
18162 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
18163 s,@DEFS@,$DEFS,;t t
18164 s,@LIBS@,$LIBS,;t t
18165 s,@build@,$build,;t t
18166 s,@build_cpu@,$build_cpu,;t t
18167 s,@build_vendor@,$build_vendor,;t t
18168 s,@build_os@,$build_os,;t t
18169 s,@host@,$host,;t t
18170 s,@host_cpu@,$host_cpu,;t t
18171 s,@host_vendor@,$host_vendor,;t t
18172 s,@host_os@,$host_os,;t t
18173 s,@SET_MAKE@,$SET_MAKE,;t t
18174 s,@CC@,$CC,;t t
18175 s,@CFLAGS@,$CFLAGS,;t t
18176 s,@LDFLAGS@,$LDFLAGS,;t t
18177 s,@CPPFLAGS@,$CPPFLAGS,;t t
18178 s,@ac_ct_CC@,$ac_ct_CC,;t t
18179 s,@EXEEXT@,$EXEEXT,;t t
18180 s,@OBJEXT@,$OBJEXT,;t t
18181 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
18182 s,@CPP@,$CPP,;t t
18183 s,@AWK@,$AWK,;t t
18184 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
18185 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
18186 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
18187 s,@LINT@,$LINT,;t t
18188 s,@LINT_OPTS@,$LINT_OPTS,;t t
18189 s,@CTAGS@,$CTAGS,;t t
18190 s,@ETAGS@,$ETAGS,;t t
18191 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
18192 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
18193 s,@MATH_LIB@,$MATH_LIB,;t t
18194 s,@top_builddir@,$top_builddir,;t t
18195 s,@CC_G_OPT@,$CC_G_OPT,;t t
18196 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
18197 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
18198 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
18199 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
18200 s,@LD@,$LD,;t t
18201 s,@LDFLAGS_SHARED@,$LDFLAGS_SHARED,;t t
18202 s,@LDFLAGS_STATIC@,$LDFLAGS_STATIC,;t t
18203 s,@LD_MODEL@,$LD_MODEL,;t t
18204 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
18205 s,@LIBTOOL@,$LIBTOOL,;t t
18206 s,@LIBTOOL_OPTS@,$LIBTOOL_OPTS,;t t
18207 s,@LIB_CLEAN@,$LIB_CLEAN,;t t
18208 s,@LIB_COMPILE@,$LIB_COMPILE,;t t
18209 s,@LIB_LINK@,$LIB_LINK,;t t
18210 s,@LINK_TESTS@,$LINK_TESTS,;t t
18211 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
18212 s,@PACKAGE@,$PACKAGE,;t t
18213 s,@PTHREAD@,$PTHREAD,;t t
18214 s,@TEST_ARGS@,$TEST_ARGS,;t t
18215 s,@TEST_DEPS@,$TEST_DEPS,;t t
18216 s,@TEST_LIBS@,$TEST_LIBS,;t t
18217 s,@TINFO_LDFLAGS@,$TINFO_LDFLAGS,;t t
18218 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
18219 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
18220 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
18221 s,@includesubdir@,$includesubdir,;t t
18222 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
18223 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
18224 s,@ECHO_LT@,$ECHO_LT,;t t
18225 s,@ECHO_LD@,$ECHO_LD,;t t
18226 s,@RULE_CC@,$RULE_CC,;t t
18227 s,@SHOW_CC@,$SHOW_CC,;t t
18228 s,@ECHO_CC@,$ECHO_CC,;t t
18229 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
18230 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
18231 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
18232 s,@X_CFLAGS@,$X_CFLAGS,;t t
18233 s,@X_PRE_LIBS@,$X_PRE_LIBS,;t t
18234 s,@X_LIBS@,$X_LIBS,;t t
18235 s,@X_EXTRA_LIBS@,$X_EXTRA_LIBS,;t t
18236 s,@XCURSES_CONFIG@,$XCURSES_CONFIG,;t t
18237 s,@ac_ct_XCURSES_CONFIG@,$ac_ct_XCURSES_CONFIG,;t t
18238 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
18239 s,@cf_ldd_prog@,$cf_ldd_prog,;t t
18240 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
18241 CEOF
18242
18243 EOF
18244
18245   cat >>$CONFIG_STATUS <<\EOF
18246   # Split the substitutions into bite-sized pieces for seds with
18247   # small command number limits, like on Digital OSF/1 and HP-UX.
18248   ac_max_sed_lines=48
18249   ac_sed_frag=1 # Number of current file.
18250   ac_beg=1 # First line for current file.
18251   ac_end=$ac_max_sed_lines # Line after last line for current file.
18252   ac_more_lines=:
18253   ac_sed_cmds=
18254   while $ac_more_lines; do
18255     if test $ac_beg -gt 1; then
18256       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
18257     else
18258       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
18259     fi
18260     if test ! -s $tmp/subs.frag; then
18261       ac_more_lines=false
18262     else
18263       # The purpose of the label and of the branching condition is to
18264       # speed up the sed processing (if there are no `@' at all, there
18265       # is no need to browse any of the substitutions).
18266       # These are the two extra sed commands mentioned above.
18267       (echo ':t
18268   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
18269       # It is possible to make a multiline substitution using escaped newlines.
18270       # Ensure that we do not split the substitution between script fragments.
18271       ac_BEG=$ac_end
18272       ac_END=`expr $ac_end + $ac_max_sed_lines`
18273       sed "1,${ac_BEG}d; ${ac_END}p; q" $tmp/subs.sed >$tmp/subs.next
18274       if test -s $tmp/subs.next; then
18275         grep '^s,@[^@,][^@,]*@,.*\\$' $tmp/subs.next >$tmp/subs.edit
18276         if test ! -s $tmp/subs.edit; then
18277           grep "^s,@[^@,][^@,]*@,.*,;t t$" $tmp/subs.next >$tmp/subs.edit
18278           if test ! -s $tmp/subs.edit; then
18279             if test $ac_beg -gt 1; then
18280               ac_end=`expr $ac_end - 1`
18281               continue
18282             fi
18283           fi
18284         fi
18285       fi
18286
18287       if test -z "$ac_sed_cmds"; then
18288         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
18289       else
18290         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
18291       fi
18292       ac_sed_frag=`expr $ac_sed_frag + 1`
18293       ac_beg=$ac_end
18294       ac_end=`expr $ac_end + $ac_max_sed_lines`
18295     fi
18296   done
18297   if test -z "$ac_sed_cmds"; then
18298     ac_sed_cmds=cat
18299   fi
18300 fi # test -n "$CONFIG_FILES"
18301
18302 EOF
18303 cat >>$CONFIG_STATUS <<\EOF
18304 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
18305   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
18306   case $ac_file in
18307   - | *:- | *:-:* ) # input from stdin
18308         cat >$tmp/stdin
18309         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
18310         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
18311   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
18312         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
18313   * )   ac_file_in=$ac_file.in ;;
18314   esac
18315
18316   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
18317   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
18318          X"$ac_file" : 'X\(//\)[^/]' \| \
18319          X"$ac_file" : 'X\(//\)$' \| \
18320          X"$ac_file" : 'X\(/\)' \| \
18321          .     : '\(.\)' 2>/dev/null ||
18322 echo X"$ac_file" |
18323     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
18324           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
18325           /^X\(\/\/\)$/{ s//\1/; q; }
18326           /^X\(\/\).*/{ s//\1/; q; }
18327           s/.*/./; q'`
18328   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
18329     { case "$ac_dir" in
18330   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
18331   *)                      as_incr_dir=.;;
18332 esac
18333 as_dummy="$ac_dir"
18334 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
18335   case $as_mkdir_dir in
18336     # Skip DOS drivespec
18337     ?:) as_incr_dir=$as_mkdir_dir ;;
18338     *)
18339       as_incr_dir=$as_incr_dir/$as_mkdir_dir
18340       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
18341     ;;
18342   esac
18343 done; }
18344
18345     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
18346     # A "../" for each directory in $ac_dir_suffix.
18347     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
18348   else
18349     ac_dir_suffix= ac_dots=
18350   fi
18351
18352   case $srcdir in
18353   .)  ac_srcdir=.
18354       if test -z "$ac_dots"; then
18355          ac_top_srcdir=.
18356       else
18357          ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'`
18358       fi ;;
18359   [\\/]* | ?:[\\/]* )
18360       ac_srcdir=$srcdir$ac_dir_suffix;
18361       ac_top_srcdir=$srcdir ;;
18362   *) # Relative path.
18363     ac_srcdir=$ac_dots$srcdir$ac_dir_suffix
18364     ac_top_srcdir=$ac_dots$srcdir ;;
18365   esac
18366
18367   case $INSTALL in
18368   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
18369   *) ac_INSTALL=$ac_dots$INSTALL ;;
18370   esac
18371
18372   if test x"$ac_file" != x-; then
18373     { echo "$as_me:18373: creating $ac_file" >&5
18374 echo "$as_me: creating $ac_file" >&6;}
18375     rm -f "$ac_file"
18376   fi
18377   # Let's still pretend it is `configure' which instantiates (i.e., don't
18378   # use $as_me), people would be surprised to read:
18379   #    /* config.h.  Generated automatically by config.status.  */
18380   configure_input="Generated automatically from `echo $ac_file_in |
18381                                                  sed 's,.*/,,'` by configure."
18382
18383   # First look for the input files in the build tree, otherwise in the
18384   # src tree.
18385   ac_file_inputs=`IFS=:
18386     for f in $ac_file_in; do
18387       case $f in
18388       -) echo $tmp/stdin ;;
18389       [\\/$]*)
18390          # Absolute (can't be DOS-style, as IFS=:)
18391          test -f "$f" || { { echo "$as_me:18391: error: cannot find input file: $f" >&5
18392 echo "$as_me: error: cannot find input file: $f" >&2;}
18393    { (exit 1); exit 1; }; }
18394          echo $f;;
18395       *) # Relative
18396          if test -f "$f"; then
18397            # Build tree
18398            echo $f
18399          elif test -f "$srcdir/$f"; then
18400            # Source tree
18401            echo $srcdir/$f
18402          else
18403            # /dev/null tree
18404            { { echo "$as_me:18404: error: cannot find input file: $f" >&5
18405 echo "$as_me: error: cannot find input file: $f" >&2;}
18406    { (exit 1); exit 1; }; }
18407          fi;;
18408       esac
18409     done` || { (exit 1); exit 1; }
18410 EOF
18411 cat >>$CONFIG_STATUS <<\EOF
18412   ac_warn_datarootdir=no
18413   if test x"$ac_file" != x-; then
18414     for ac_item in $ac_file_inputs
18415     do
18416       ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' $ac_item`
18417       if test -n "$ac_seen"; then
18418         ac_used=`grep '@datarootdir@' $ac_item`
18419         if test -z "$ac_used"; then
18420           { echo "$as_me:18420: WARNING: datarootdir was used implicitly but not set:
18421 $ac_seen" >&5
18422 echo "$as_me: WARNING: datarootdir was used implicitly but not set:
18423 $ac_seen" >&2;}
18424           ac_warn_datarootdir=yes
18425         fi
18426       fi
18427       ac_seen=`grep '${datarootdir}' $ac_item`
18428       if test -n "$ac_seen"; then
18429         { echo "$as_me:18429: WARNING: datarootdir was used explicitly but not set:
18430 $ac_seen" >&5
18431 echo "$as_me: WARNING: datarootdir was used explicitly but not set:
18432 $ac_seen" >&2;}
18433         ac_warn_datarootdir=yes
18434       fi
18435     done
18436   fi
18437
18438 if test "x$ac_warn_datarootdir" = xyes; then
18439   ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
18440 fi
18441
18442 EOF
18443 cat >>$CONFIG_STATUS <<EOF
18444   sed "$ac_vpsub
18445 $extrasub
18446 EOF
18447 cat >>$CONFIG_STATUS <<\EOF
18448 :t
18449 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
18450 s,@configure_input@,$configure_input,;t t
18451 s,@srcdir@,$ac_srcdir,;t t
18452 s,@top_srcdir@,$ac_top_srcdir,;t t
18453 s,@INSTALL@,$ac_INSTALL,;t t
18454 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
18455   rm -f $tmp/stdin
18456   if test x"$ac_file" != x-; then
18457     cp $tmp/out $ac_file
18458
18459     for ac_name in prefix exec_prefix datarootdir
18460     do
18461         ac_seen=`fgrep -n '${'$ac_name'[:=].*}' $ac_file`
18462         if test -n "$ac_seen"; then
18463             ac_init=`egrep '[   ]*'$ac_name'[   ]*=' $ac_file`
18464             if test -z "$ac_init"; then
18465               ac_seen=`echo "$ac_seen" |sed -e 's,^,'$ac_file':,'`
18466               { echo "$as_me:18466: WARNING: Variable $ac_name is used but was not set:
18467 $ac_seen" >&5
18468 echo "$as_me: WARNING: Variable $ac_name is used but was not set:
18469 $ac_seen" >&2;}
18470             fi
18471         fi
18472     done
18473     egrep -n '@[a-z_][a-z_0-9]+@' $ac_file >$tmp/out
18474     egrep -n '@[A-Z_][A-Z_0-9]+@' $ac_file >>$tmp/out
18475     if test -s $tmp/out; then
18476       ac_seen=`sed -e 's,^,'$ac_file':,' < $tmp/out`
18477       { echo "$as_me:18477: WARNING: Some variables may not be substituted:
18478 $ac_seen" >&5
18479 echo "$as_me: WARNING: Some variables may not be substituted:
18480 $ac_seen" >&2;}
18481     fi
18482   else
18483     cat $tmp/out
18484   fi
18485   rm -f $tmp/out
18486
18487 done
18488 EOF
18489 cat >>$CONFIG_STATUS <<\EOF
18490
18491 #
18492 # CONFIG_HEADER section.
18493 #
18494
18495 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
18496 # NAME is the cpp macro being defined and VALUE is the value it is being given.
18497 #
18498 # ac_d sets the value in "#define NAME VALUE" lines.
18499 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
18500 ac_dB='[        ].*$,\1#\2'
18501 ac_dC=' '
18502 ac_dD=',;t'
18503 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
18504 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
18505 ac_iB='\([      ]\),\1#\2define\3'
18506 ac_iC=' '
18507 ac_iD='\4,;t'
18508 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
18509 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
18510 ac_uB='$,\1#\2define\3'
18511 ac_uC=' '
18512 ac_uD=',;t'
18513
18514 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
18515   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
18516   case $ac_file in
18517   - | *:- | *:-:* ) # input from stdin
18518         cat >$tmp/stdin
18519         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
18520         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
18521   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
18522         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
18523   * )   ac_file_in=$ac_file.in ;;
18524   esac
18525
18526   test x"$ac_file" != x- && { echo "$as_me:18526: creating $ac_file" >&5
18527 echo "$as_me: creating $ac_file" >&6;}
18528
18529   # First look for the input files in the build tree, otherwise in the
18530   # src tree.
18531   ac_file_inputs=`IFS=:
18532     for f in $ac_file_in; do
18533       case $f in
18534       -) echo $tmp/stdin ;;
18535       [\\/$]*)
18536          # Absolute (can't be DOS-style, as IFS=:)
18537          test -f "$f" || { { echo "$as_me:18537: error: cannot find input file: $f" >&5
18538 echo "$as_me: error: cannot find input file: $f" >&2;}
18539    { (exit 1); exit 1; }; }
18540          echo $f;;
18541       *) # Relative
18542          if test -f "$f"; then
18543            # Build tree
18544            echo $f
18545          elif test -f "$srcdir/$f"; then
18546            # Source tree
18547            echo $srcdir/$f
18548          else
18549            # /dev/null tree
18550            { { echo "$as_me:18550: error: cannot find input file: $f" >&5
18551 echo "$as_me: error: cannot find input file: $f" >&2;}
18552    { (exit 1); exit 1; }; }
18553          fi;;
18554       esac
18555     done` || { (exit 1); exit 1; }
18556   # Remove the trailing spaces.
18557   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
18558
18559 EOF
18560
18561 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
18562 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
18563 # be either 'cat' or 'sort'.
18564 cat confdefs.h | uniq >conftest.vals
18565
18566 # Break up conftest.vals because some shells have a limit on
18567 # the size of here documents, and old seds have small limits too.
18568
18569 rm -f conftest.tail
18570 echo '  rm -f conftest.frag' >> $CONFIG_STATUS
18571 while grep . conftest.vals >/dev/null
18572 do
18573   # Write chunks of a limited-size here document to conftest.frag.
18574   echo '  cat >> conftest.frag <<CEOF' >> $CONFIG_STATUS
18575   sed ${ac_max_here_lines}q conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> $CONFIG_STATUS
18576   echo 'CEOF' >> $CONFIG_STATUS
18577   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
18578   rm -f conftest.vals
18579   mv conftest.tail conftest.vals
18580 done
18581 rm -f conftest.vals
18582
18583 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
18584 # marker @DEFS@.
18585 echo '  cat >> conftest.edit <<CEOF
18586 /@DEFS@/r conftest.frag
18587 /@DEFS@/d
18588 CEOF
18589 sed -f conftest.edit $tmp/in > $tmp/out
18590 rm -f $tmp/in
18591 mv $tmp/out $tmp/in
18592 rm -f conftest.edit conftest.frag
18593 ' >> $CONFIG_STATUS
18594
18595 cat >>$CONFIG_STATUS <<\EOF
18596   # Let's still pretend it is `configure' which instantiates (i.e., don't
18597   # use $as_me), people would be surprised to read:
18598   #    /* config.h.  Generated automatically by config.status.  */
18599   if test x"$ac_file" = x-; then
18600     echo "/* Generated automatically by configure.  */" >$tmp/config.h
18601   else
18602     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
18603   fi
18604   cat $tmp/in >>$tmp/config.h
18605   rm -f $tmp/in
18606   if test x"$ac_file" != x-; then
18607     if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
18608       { echo "$as_me:18608: $ac_file is unchanged" >&5
18609 echo "$as_me: $ac_file is unchanged" >&6;}
18610     else
18611       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
18612          X"$ac_file" : 'X\(//\)[^/]' \| \
18613          X"$ac_file" : 'X\(//\)$' \| \
18614          X"$ac_file" : 'X\(/\)' \| \
18615          .     : '\(.\)' 2>/dev/null ||
18616 echo X"$ac_file" |
18617     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
18618           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
18619           /^X\(\/\/\)$/{ s//\1/; q; }
18620           /^X\(\/\).*/{ s//\1/; q; }
18621           s/.*/./; q'`
18622       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
18623         { case "$ac_dir" in
18624   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
18625   *)                      as_incr_dir=.;;
18626 esac
18627 as_dummy="$ac_dir"
18628 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
18629   case $as_mkdir_dir in
18630     # Skip DOS drivespec
18631     ?:) as_incr_dir=$as_mkdir_dir ;;
18632     *)
18633       as_incr_dir=$as_incr_dir/$as_mkdir_dir
18634       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
18635     ;;
18636   esac
18637 done; }
18638
18639       fi
18640       rm -f $ac_file
18641       mv $tmp/config.h $ac_file
18642     fi
18643   else
18644     cat $tmp/config.h
18645     rm -f $tmp/config.h
18646   fi
18647 done
18648 EOF
18649 cat >>$CONFIG_STATUS <<\EOF
18650 #
18651 # CONFIG_COMMANDS section.
18652 #
18653 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
18654   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
18655   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
18656
18657   case $ac_dest in
18658     default )
18659
18660 for cf_dir in .
18661 do
18662         if test ! -d $srcdir/$cf_dir; then
18663                 continue
18664         elif test -f $srcdir/$cf_dir/programs; then
18665                 $AWK -f $srcdir/mk-test.awk INSTALL=yes ECHO_LINK="$ECHO_LD" $srcdir/$cf_dir/programs >>$cf_dir/Makefile
18666         fi
18667 done
18668
18669         cat >>Makefile <<TEST_EOF
18670
18671 # These rules are generated so we do not rely on suffix rules, which do not
18672 # work consistently for different make-programs (the '\$(MODEL)/' confuses
18673 # some, and the '\$x' confuses others).
18674 TEST_EOF
18675
18676 LIST=`sed -e 's/[       ].*//' -e '/^[#@]/d' $srcdir/modules`
18677 for N in $LIST
18678 do
18679         cat >>Makefile <<TEST_EOF
18680
18681 \$(MODEL)/$N.o : \$(srcdir)/$N.c \\
18682         \$(srcdir)/test.priv.h \\
18683         ncurses_cfg.h
18684         $SHOW_CC
18685         $ECHO_CC\$(CC) -c \$(CFLAGS_DEFAULT) \$(srcdir)/$N.c
18686 TEST_EOF
18687 done
18688
18689 if test -f ../config.guess && test -f ../config.sub
18690 then
18691         cat >>Makefile <<TEST_EOF
18692
18693 # if we used CF_INHERIT for getting these files, we can remove them
18694 distclean::
18695         rm -f config.guess config.sub
18696 TEST_EOF
18697 fi
18698  ;;
18699   esac
18700 done
18701 EOF
18702
18703 cat >>$CONFIG_STATUS <<\EOF
18704
18705 { (exit 0); exit 0; }
18706 EOF
18707 chmod +x $CONFIG_STATUS
18708 ac_clean_files=$ac_clean_files_save
18709
18710 # configure is writing to config.log, and then calls config.status.
18711 # config.status does its own redirection, appending to config.log.
18712 # Unfortunately, on DOS this fails, as config.log is still kept open
18713 # by configure, so config.status won't be able to write to it; its
18714 # output is simply discarded.  So we exec the FD to /dev/null,
18715 # effectively closing config.log, so it can be properly (re)opened and
18716 # appended to by config.status.  When coming back to configure, we
18717 # need to make the FD available again.
18718 if test "$no_create" != yes; then
18719   ac_cs_success=:
18720   exec 5>/dev/null
18721   $SHELL $CONFIG_STATUS || ac_cs_success=false
18722   exec 5>>config.log
18723   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
18724   # would make configure fail if this is the last instruction.
18725   $ac_cs_success || { (exit 1); exit 1; }
18726 fi
18727