]> ncurses.scripts.mit.edu Git - ncurses.git/blob - test/configure
ncurses 6.0 - patch 20160521
[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 (*[\ \  ]-*)
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         test -n "$verbose" && echo "    resulting CC: '$CC'" 1>&6
2027
2028 echo "${as_me:-configure}:2028: testing resulting CC: '$CC' ..." 1>&5
2029
2030         test -n "$verbose" && echo "    resulting CFLAGS: '$CFLAGS'" 1>&6
2031
2032 echo "${as_me:-configure}:2032: testing resulting CFLAGS: '$CFLAGS' ..." 1>&5
2033
2034         test -n "$verbose" && echo "    resulting CPPFLAGS: '$CPPFLAGS'" 1>&6
2035
2036 echo "${as_me:-configure}:2036: testing resulting CPPFLAGS: '$CPPFLAGS' ..." 1>&5
2037
2038         ;;
2039 (*)
2040         echo "$as_me:2040: result: ok" >&5
2041 echo "${ECHO_T}ok" >&6
2042         ;;
2043 esac
2044
2045 ac_ext=c
2046 ac_cpp='$CPP $CPPFLAGS'
2047 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2048 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2049 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2050 ac_main_return=return
2051 echo "$as_me:2051: checking how to run the C preprocessor" >&5
2052 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
2053 # On Suns, sometimes $CPP names a directory.
2054 if test -n "$CPP" && test -d "$CPP"; then
2055   CPP=
2056 fi
2057 if test -z "$CPP"; then
2058   if test "${ac_cv_prog_CPP+set}" = set; then
2059   echo $ECHO_N "(cached) $ECHO_C" >&6
2060 else
2061       # Double quotes because CPP needs to be expanded
2062     for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
2063     do
2064       ac_preproc_ok=false
2065 for ac_c_preproc_warn_flag in '' yes
2066 do
2067   # Use a header file that comes with gcc, so configuring glibc
2068   # with a fresh cross-compiler works.
2069   # On the NeXT, cc -E runs the code through the compiler's parser,
2070   # not just through cpp. "Syntax error" is here to catch this case.
2071   cat >conftest.$ac_ext <<_ACEOF
2072 #line 2072 "configure"
2073 #include "confdefs.h"
2074 #include <assert.h>
2075                      Syntax error
2076 _ACEOF
2077 if { (eval echo "$as_me:2077: \"$ac_cpp conftest.$ac_ext\"") >&5
2078   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2079   ac_status=$?
2080   egrep -v '^ *\+' conftest.er1 >conftest.err
2081   rm -f conftest.er1
2082   cat conftest.err >&5
2083   echo "$as_me:2083: \$? = $ac_status" >&5
2084   (exit $ac_status); } >/dev/null; then
2085   if test -s conftest.err; then
2086     ac_cpp_err=$ac_c_preproc_warn_flag
2087   else
2088     ac_cpp_err=
2089   fi
2090 else
2091   ac_cpp_err=yes
2092 fi
2093 if test -z "$ac_cpp_err"; then
2094   :
2095 else
2096   echo "$as_me: failed program was:" >&5
2097   cat conftest.$ac_ext >&5
2098   # Broken: fails on valid input.
2099 continue
2100 fi
2101 rm -f conftest.err conftest.$ac_ext
2102
2103   # OK, works on sane cases.  Now check whether non-existent headers
2104   # can be detected and how.
2105   cat >conftest.$ac_ext <<_ACEOF
2106 #line 2106 "configure"
2107 #include "confdefs.h"
2108 #include <ac_nonexistent.h>
2109 _ACEOF
2110 if { (eval echo "$as_me:2110: \"$ac_cpp conftest.$ac_ext\"") >&5
2111   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2112   ac_status=$?
2113   egrep -v '^ *\+' conftest.er1 >conftest.err
2114   rm -f conftest.er1
2115   cat conftest.err >&5
2116   echo "$as_me:2116: \$? = $ac_status" >&5
2117   (exit $ac_status); } >/dev/null; then
2118   if test -s conftest.err; then
2119     ac_cpp_err=$ac_c_preproc_warn_flag
2120   else
2121     ac_cpp_err=
2122   fi
2123 else
2124   ac_cpp_err=yes
2125 fi
2126 if test -z "$ac_cpp_err"; then
2127   # Broken: success on invalid input.
2128 continue
2129 else
2130   echo "$as_me: failed program was:" >&5
2131   cat conftest.$ac_ext >&5
2132   # Passes both tests.
2133 ac_preproc_ok=:
2134 break
2135 fi
2136 rm -f conftest.err conftest.$ac_ext
2137
2138 done
2139 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2140 rm -f conftest.err conftest.$ac_ext
2141 if $ac_preproc_ok; then
2142   break
2143 fi
2144
2145     done
2146     ac_cv_prog_CPP=$CPP
2147
2148 fi
2149   CPP=$ac_cv_prog_CPP
2150 else
2151   ac_cv_prog_CPP=$CPP
2152 fi
2153 echo "$as_me:2153: result: $CPP" >&5
2154 echo "${ECHO_T}$CPP" >&6
2155 ac_preproc_ok=false
2156 for ac_c_preproc_warn_flag in '' yes
2157 do
2158   # Use a header file that comes with gcc, so configuring glibc
2159   # with a fresh cross-compiler works.
2160   # On the NeXT, cc -E runs the code through the compiler's parser,
2161   # not just through cpp. "Syntax error" is here to catch this case.
2162   cat >conftest.$ac_ext <<_ACEOF
2163 #line 2163 "configure"
2164 #include "confdefs.h"
2165 #include <assert.h>
2166                      Syntax error
2167 _ACEOF
2168 if { (eval echo "$as_me:2168: \"$ac_cpp conftest.$ac_ext\"") >&5
2169   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2170   ac_status=$?
2171   egrep -v '^ *\+' conftest.er1 >conftest.err
2172   rm -f conftest.er1
2173   cat conftest.err >&5
2174   echo "$as_me:2174: \$? = $ac_status" >&5
2175   (exit $ac_status); } >/dev/null; then
2176   if test -s conftest.err; then
2177     ac_cpp_err=$ac_c_preproc_warn_flag
2178   else
2179     ac_cpp_err=
2180   fi
2181 else
2182   ac_cpp_err=yes
2183 fi
2184 if test -z "$ac_cpp_err"; then
2185   :
2186 else
2187   echo "$as_me: failed program was:" >&5
2188   cat conftest.$ac_ext >&5
2189   # Broken: fails on valid input.
2190 continue
2191 fi
2192 rm -f conftest.err conftest.$ac_ext
2193
2194   # OK, works on sane cases.  Now check whether non-existent headers
2195   # can be detected and how.
2196   cat >conftest.$ac_ext <<_ACEOF
2197 #line 2197 "configure"
2198 #include "confdefs.h"
2199 #include <ac_nonexistent.h>
2200 _ACEOF
2201 if { (eval echo "$as_me:2201: \"$ac_cpp conftest.$ac_ext\"") >&5
2202   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2203   ac_status=$?
2204   egrep -v '^ *\+' conftest.er1 >conftest.err
2205   rm -f conftest.er1
2206   cat conftest.err >&5
2207   echo "$as_me:2207: \$? = $ac_status" >&5
2208   (exit $ac_status); } >/dev/null; then
2209   if test -s conftest.err; then
2210     ac_cpp_err=$ac_c_preproc_warn_flag
2211   else
2212     ac_cpp_err=
2213   fi
2214 else
2215   ac_cpp_err=yes
2216 fi
2217 if test -z "$ac_cpp_err"; then
2218   # Broken: success on invalid input.
2219 continue
2220 else
2221   echo "$as_me: failed program was:" >&5
2222   cat conftest.$ac_ext >&5
2223   # Passes both tests.
2224 ac_preproc_ok=:
2225 break
2226 fi
2227 rm -f conftest.err conftest.$ac_ext
2228
2229 done
2230 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2231 rm -f conftest.err conftest.$ac_ext
2232 if $ac_preproc_ok; then
2233   :
2234 else
2235   { { echo "$as_me:2235: error: C preprocessor \"$CPP\" fails sanity check" >&5
2236 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;}
2237    { (exit 1); exit 1; }; }
2238 fi
2239
2240 ac_ext=c
2241 ac_cpp='$CPP $CPPFLAGS'
2242 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2243 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2244 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2245 ac_main_return=return
2246
2247 for ac_prog in mawk gawk nawk awk
2248 do
2249   # Extract the first word of "$ac_prog", so it can be a program name with args.
2250 set dummy $ac_prog; ac_word=$2
2251 echo "$as_me:2251: checking for $ac_word" >&5
2252 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2253 if test "${ac_cv_prog_AWK+set}" = set; then
2254   echo $ECHO_N "(cached) $ECHO_C" >&6
2255 else
2256   if test -n "$AWK"; then
2257   ac_cv_prog_AWK="$AWK" # Let the user override the test.
2258 else
2259   ac_save_IFS=$IFS; IFS=$ac_path_separator
2260 ac_dummy="$PATH"
2261 for ac_dir in $ac_dummy; do
2262   IFS=$ac_save_IFS
2263   test -z "$ac_dir" && ac_dir=.
2264   $as_executable_p "$ac_dir/$ac_word" || continue
2265 ac_cv_prog_AWK="$ac_prog"
2266 echo "$as_me:2266: found $ac_dir/$ac_word" >&5
2267 break
2268 done
2269
2270 fi
2271 fi
2272 AWK=$ac_cv_prog_AWK
2273 if test -n "$AWK"; then
2274   echo "$as_me:2274: result: $AWK" >&5
2275 echo "${ECHO_T}$AWK" >&6
2276 else
2277   echo "$as_me:2277: result: no" >&5
2278 echo "${ECHO_T}no" >&6
2279 fi
2280
2281   test -n "$AWK" && break
2282 done
2283
2284 # Find a good install program.  We prefer a C program (faster),
2285 # so one script is as good as another.  But avoid the broken or
2286 # incompatible versions:
2287 # SysV /etc/install, /usr/sbin/install
2288 # SunOS /usr/etc/install
2289 # IRIX /sbin/install
2290 # AIX /bin/install
2291 # AmigaOS /C/install, which installs bootblocks on floppy discs
2292 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2293 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2294 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2295 # ./install, which can be erroneously created by make from ./install.sh.
2296 echo "$as_me:2296: checking for a BSD compatible install" >&5
2297 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
2298 if test -z "$INSTALL"; then
2299 if test "${ac_cv_path_install+set}" = set; then
2300   echo $ECHO_N "(cached) $ECHO_C" >&6
2301 else
2302     ac_save_IFS=$IFS; IFS=$ac_path_separator
2303   for ac_dir in $PATH; do
2304     IFS=$ac_save_IFS
2305     # Account for people who put trailing slashes in PATH elements.
2306     case $ac_dir/ in
2307     / | ./ | .// | /cC/* \
2308     | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
2309     | /usr/ucb/* ) ;;
2310     *)
2311       # OSF1 and SCO ODT 3.0 have their own names for install.
2312       # Don't use installbsd from OSF since it installs stuff as root
2313       # by default.
2314       for ac_prog in ginstall scoinst install; do
2315         if $as_executable_p "$ac_dir/$ac_prog"; then
2316           if test $ac_prog = install &&
2317             grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2318             # AIX install.  It has an incompatible calling convention.
2319             :
2320           elif test $ac_prog = install &&
2321             grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2322             # program-specific install script used by HP pwplus--don't use.
2323             :
2324           else
2325             ac_cv_path_install="$ac_dir/$ac_prog -c"
2326             break 2
2327           fi
2328         fi
2329       done
2330       ;;
2331     esac
2332   done
2333
2334 fi
2335   if test "${ac_cv_path_install+set}" = set; then
2336     INSTALL=$ac_cv_path_install
2337   else
2338     # As a last resort, use the slow shell script.  We don't cache a
2339     # path for INSTALL within a source directory, because that will
2340     # break other packages using the cache if that directory is
2341     # removed, or if the path is relative.
2342     INSTALL=$ac_install_sh
2343   fi
2344 fi
2345 echo "$as_me:2345: result: $INSTALL" >&5
2346 echo "${ECHO_T}$INSTALL" >&6
2347
2348 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2349 # It thinks the first close brace ends the variable substitution.
2350 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2351
2352 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2353
2354 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2355
2356 case $INSTALL in
2357 (/*)
2358         ;;
2359 (*)
2360         cf_dir=`echo $INSTALL | sed -e 's%/[^/]*$%%'`
2361         test -z "$cf_dir" && cf_dir=.
2362         INSTALL=`cd $cf_dir && pwd`/`echo $INSTALL | sed -e 's%^.*/%%'`
2363         ;;
2364 esac
2365
2366 for ac_prog in tdlint lint alint splint lclint
2367 do
2368   # Extract the first word of "$ac_prog", so it can be a program name with args.
2369 set dummy $ac_prog; ac_word=$2
2370 echo "$as_me:2370: checking for $ac_word" >&5
2371 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2372 if test "${ac_cv_prog_LINT+set}" = set; then
2373   echo $ECHO_N "(cached) $ECHO_C" >&6
2374 else
2375   if test -n "$LINT"; then
2376   ac_cv_prog_LINT="$LINT" # Let the user override the test.
2377 else
2378   ac_save_IFS=$IFS; IFS=$ac_path_separator
2379 ac_dummy="$PATH"
2380 for ac_dir in $ac_dummy; do
2381   IFS=$ac_save_IFS
2382   test -z "$ac_dir" && ac_dir=.
2383   $as_executable_p "$ac_dir/$ac_word" || continue
2384 ac_cv_prog_LINT="$ac_prog"
2385 echo "$as_me:2385: found $ac_dir/$ac_word" >&5
2386 break
2387 done
2388
2389 fi
2390 fi
2391 LINT=$ac_cv_prog_LINT
2392 if test -n "$LINT"; then
2393   echo "$as_me:2393: result: $LINT" >&5
2394 echo "${ECHO_T}$LINT" >&6
2395 else
2396   echo "$as_me:2396: result: no" >&5
2397 echo "${ECHO_T}no" >&6
2398 fi
2399
2400   test -n "$LINT" && break
2401 done
2402
2403 echo "$as_me:2403: checking if filesystem supports mixed-case filenames" >&5
2404 echo $ECHO_N "checking if filesystem supports mixed-case filenames... $ECHO_C" >&6
2405 if test "${cf_cv_mixedcase+set}" = set; then
2406   echo $ECHO_N "(cached) $ECHO_C" >&6
2407 else
2408
2409 if test "$cross_compiling" = yes ; then
2410         case $target_alias in
2411         (*-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw*|*-uwin*)
2412                 cf_cv_mixedcase=no
2413                 ;;
2414         (*)
2415                 cf_cv_mixedcase=yes
2416                 ;;
2417         esac
2418 else
2419         rm -f conftest CONFTEST
2420         echo test >conftest
2421         if test -f CONFTEST ; then
2422                 cf_cv_mixedcase=no
2423         else
2424                 cf_cv_mixedcase=yes
2425         fi
2426         rm -f conftest CONFTEST
2427 fi
2428
2429 fi
2430 echo "$as_me:2430: result: $cf_cv_mixedcase" >&5
2431 echo "${ECHO_T}$cf_cv_mixedcase" >&6
2432 test "$cf_cv_mixedcase" = yes &&
2433 cat >>confdefs.h <<\EOF
2434 #define MIXEDCASE_FILENAMES 1
2435 EOF
2436
2437 for ac_prog in exctags ctags
2438 do
2439   # Extract the first word of "$ac_prog", so it can be a program name with args.
2440 set dummy $ac_prog; ac_word=$2
2441 echo "$as_me:2441: checking for $ac_word" >&5
2442 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2443 if test "${ac_cv_prog_CTAGS+set}" = set; then
2444   echo $ECHO_N "(cached) $ECHO_C" >&6
2445 else
2446   if test -n "$CTAGS"; then
2447   ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test.
2448 else
2449   ac_save_IFS=$IFS; IFS=$ac_path_separator
2450 ac_dummy="$PATH"
2451 for ac_dir in $ac_dummy; do
2452   IFS=$ac_save_IFS
2453   test -z "$ac_dir" && ac_dir=.
2454   $as_executable_p "$ac_dir/$ac_word" || continue
2455 ac_cv_prog_CTAGS="$ac_prog"
2456 echo "$as_me:2456: found $ac_dir/$ac_word" >&5
2457 break
2458 done
2459
2460 fi
2461 fi
2462 CTAGS=$ac_cv_prog_CTAGS
2463 if test -n "$CTAGS"; then
2464   echo "$as_me:2464: result: $CTAGS" >&5
2465 echo "${ECHO_T}$CTAGS" >&6
2466 else
2467   echo "$as_me:2467: result: no" >&5
2468 echo "${ECHO_T}no" >&6
2469 fi
2470
2471   test -n "$CTAGS" && break
2472 done
2473
2474 for ac_prog in exetags etags
2475 do
2476   # Extract the first word of "$ac_prog", so it can be a program name with args.
2477 set dummy $ac_prog; ac_word=$2
2478 echo "$as_me:2478: checking for $ac_word" >&5
2479 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2480 if test "${ac_cv_prog_ETAGS+set}" = set; then
2481   echo $ECHO_N "(cached) $ECHO_C" >&6
2482 else
2483   if test -n "$ETAGS"; then
2484   ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test.
2485 else
2486   ac_save_IFS=$IFS; IFS=$ac_path_separator
2487 ac_dummy="$PATH"
2488 for ac_dir in $ac_dummy; do
2489   IFS=$ac_save_IFS
2490   test -z "$ac_dir" && ac_dir=.
2491   $as_executable_p "$ac_dir/$ac_word" || continue
2492 ac_cv_prog_ETAGS="$ac_prog"
2493 echo "$as_me:2493: found $ac_dir/$ac_word" >&5
2494 break
2495 done
2496
2497 fi
2498 fi
2499 ETAGS=$ac_cv_prog_ETAGS
2500 if test -n "$ETAGS"; then
2501   echo "$as_me:2501: result: $ETAGS" >&5
2502 echo "${ECHO_T}$ETAGS" >&6
2503 else
2504   echo "$as_me:2504: result: no" >&5
2505 echo "${ECHO_T}no" >&6
2506 fi
2507
2508   test -n "$ETAGS" && break
2509 done
2510
2511 # Extract the first word of "${CTAGS:-ctags}", so it can be a program name with args.
2512 set dummy ${CTAGS:-ctags}; ac_word=$2
2513 echo "$as_me:2513: checking for $ac_word" >&5
2514 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2515 if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" = set; then
2516   echo $ECHO_N "(cached) $ECHO_C" >&6
2517 else
2518   if test -n "$MAKE_LOWER_TAGS"; then
2519   ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test.
2520 else
2521   ac_save_IFS=$IFS; IFS=$ac_path_separator
2522 ac_dummy="$PATH"
2523 for ac_dir in $ac_dummy; do
2524   IFS=$ac_save_IFS
2525   test -z "$ac_dir" && ac_dir=.
2526   $as_executable_p "$ac_dir/$ac_word" || continue
2527 ac_cv_prog_MAKE_LOWER_TAGS="yes"
2528 echo "$as_me:2528: found $ac_dir/$ac_word" >&5
2529 break
2530 done
2531
2532   test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no"
2533 fi
2534 fi
2535 MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS
2536 if test -n "$MAKE_LOWER_TAGS"; then
2537   echo "$as_me:2537: result: $MAKE_LOWER_TAGS" >&5
2538 echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6
2539 else
2540   echo "$as_me:2540: result: no" >&5
2541 echo "${ECHO_T}no" >&6
2542 fi
2543
2544 if test "$cf_cv_mixedcase" = yes ; then
2545         # Extract the first word of "${ETAGS:-etags}", so it can be a program name with args.
2546 set dummy ${ETAGS:-etags}; ac_word=$2
2547 echo "$as_me:2547: checking for $ac_word" >&5
2548 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2549 if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" = set; then
2550   echo $ECHO_N "(cached) $ECHO_C" >&6
2551 else
2552   if test -n "$MAKE_UPPER_TAGS"; then
2553   ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test.
2554 else
2555   ac_save_IFS=$IFS; IFS=$ac_path_separator
2556 ac_dummy="$PATH"
2557 for ac_dir in $ac_dummy; do
2558   IFS=$ac_save_IFS
2559   test -z "$ac_dir" && ac_dir=.
2560   $as_executable_p "$ac_dir/$ac_word" || continue
2561 ac_cv_prog_MAKE_UPPER_TAGS="yes"
2562 echo "$as_me:2562: found $ac_dir/$ac_word" >&5
2563 break
2564 done
2565
2566   test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no"
2567 fi
2568 fi
2569 MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS
2570 if test -n "$MAKE_UPPER_TAGS"; then
2571   echo "$as_me:2571: result: $MAKE_UPPER_TAGS" >&5
2572 echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6
2573 else
2574   echo "$as_me:2574: result: no" >&5
2575 echo "${ECHO_T}no" >&6
2576 fi
2577
2578 else
2579         MAKE_UPPER_TAGS=no
2580 fi
2581
2582 if test "$MAKE_UPPER_TAGS" = yes ; then
2583         MAKE_UPPER_TAGS=
2584 else
2585         MAKE_UPPER_TAGS="#"
2586 fi
2587
2588 if test "$MAKE_LOWER_TAGS" = yes ; then
2589         MAKE_LOWER_TAGS=
2590 else
2591         MAKE_LOWER_TAGS="#"
2592 fi
2593
2594 echo "$as_me:2594: checking if -lm needed for math functions" >&5
2595 echo $ECHO_N "checking if -lm needed for math functions... $ECHO_C" >&6
2596 if test "${cf_cv_need_libm+set}" = set; then
2597   echo $ECHO_N "(cached) $ECHO_C" >&6
2598 else
2599
2600         cat >conftest.$ac_ext <<_ACEOF
2601 #line 2601 "configure"
2602 #include "confdefs.h"
2603
2604         #include <stdio.h>
2605         #include <math.h>
2606
2607 int
2608 main ()
2609 {
2610 double x = rand(); printf("result = %g\n", pow(sin(x),x))
2611   ;
2612   return 0;
2613 }
2614 _ACEOF
2615 rm -f conftest.$ac_objext conftest$ac_exeext
2616 if { (eval echo "$as_me:2616: \"$ac_link\"") >&5
2617   (eval $ac_link) 2>&5
2618   ac_status=$?
2619   echo "$as_me:2619: \$? = $ac_status" >&5
2620   (exit $ac_status); } &&
2621          { ac_try='test -s conftest$ac_exeext'
2622   { (eval echo "$as_me:2622: \"$ac_try\"") >&5
2623   (eval $ac_try) 2>&5
2624   ac_status=$?
2625   echo "$as_me:2625: \$? = $ac_status" >&5
2626   (exit $ac_status); }; }; then
2627   cf_cv_need_libm=no
2628 else
2629   echo "$as_me: failed program was:" >&5
2630 cat conftest.$ac_ext >&5
2631 cf_cv_need_libm=yes
2632 fi
2633 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
2634 fi
2635 echo "$as_me:2635: result: $cf_cv_need_libm" >&5
2636 echo "${ECHO_T}$cf_cv_need_libm" >&6
2637 if test "$cf_cv_need_libm" = yes
2638 then
2639 MATH_LIB=-lm
2640 fi
2641
2642 top_builddir=`pwd`
2643
2644 CC_G_OPT="-g"
2645 CC_SHARED_OPTS=unknown
2646 CPPFLAGS="$CPPFLAGS"
2647 DFT_DEP_SUFFIX=""
2648 DFT_OBJ_SUBDIR=`pwd|sed -e's:.*/::'`
2649 DFT_UPR_MODEL="NORMAL"
2650 LD="ld"
2651 LDFLAGS_SHARED=""
2652 LDFLAGS_STATIC=""
2653 LD_MODEL=""
2654 LD_SHARED_OPTS=""
2655 LIBTOOL=""
2656 LIBTOOL_OPTS=""
2657 LIB_CLEAN=""
2658 LIB_COMPILE=""
2659 LIB_LINK='${CC}'
2660 LINK_TESTS=""
2661 LOCAL_LDFLAGS=""
2662 PACKAGE="ncurses-examples"
2663 PTHREAD="-lm"
2664 TEST_ARGS=""
2665 TEST_DEPS=""
2666 TEST_LIBS=""
2667 TINFO_LDFLAGS=''
2668 TINFO_LIBS='$(LIBS_CURSES)'
2669 cf_cv_abi_version=""
2670 cf_cv_rel_version=""
2671 includesubdir=""
2672
2673 cf_cv_screen=curses
2674 cf_cv_libtype=
2675
2676 if test "$GCC" = yes
2677 then
2678 cat > conftest.i <<EOF
2679 #ifndef GCC_PRINTF
2680 #define GCC_PRINTF 0
2681 #endif
2682 #ifndef GCC_SCANF
2683 #define GCC_SCANF 0
2684 #endif
2685 #ifndef GCC_NORETURN
2686 #define GCC_NORETURN /* nothing */
2687 #endif
2688 #ifndef GCC_UNUSED
2689 #define GCC_UNUSED /* nothing */
2690 #endif
2691 EOF
2692 if test "$GCC" = yes
2693 then
2694         { echo "$as_me:2694: checking for $CC __attribute__ directives..." >&5
2695 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
2696 cat > conftest.$ac_ext <<EOF
2697 #line 2697 "${as_me:-configure}"
2698 #include "confdefs.h"
2699 #include "conftest.h"
2700 #include "conftest.i"
2701 #if     GCC_PRINTF
2702 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
2703 #else
2704 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
2705 #endif
2706 #if     GCC_SCANF
2707 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
2708 #else
2709 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
2710 #endif
2711 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
2712 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
2713 extern void foo(void) GCC_NORETURN;
2714 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
2715 EOF
2716         cf_printf_attribute=no
2717         cf_scanf_attribute=no
2718         for cf_attribute in scanf printf unused noreturn
2719         do
2720
2721 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
2722
2723                 cf_directive="__attribute__(($cf_attribute))"
2724                 echo "checking for $CC $cf_directive" 1>&5
2725
2726                 case $cf_attribute in
2727                 (printf)
2728                         cf_printf_attribute=yes
2729                         cat >conftest.h <<EOF
2730 #define GCC_$cf_ATTRIBUTE 1
2731 EOF
2732                         ;;
2733                 (scanf)
2734                         cf_scanf_attribute=yes
2735                         cat >conftest.h <<EOF
2736 #define GCC_$cf_ATTRIBUTE 1
2737 EOF
2738                         ;;
2739                 (*)
2740                         cat >conftest.h <<EOF
2741 #define GCC_$cf_ATTRIBUTE $cf_directive
2742 EOF
2743                         ;;
2744                 esac
2745
2746                 if { (eval echo "$as_me:2746: \"$ac_compile\"") >&5
2747   (eval $ac_compile) 2>&5
2748   ac_status=$?
2749   echo "$as_me:2749: \$? = $ac_status" >&5
2750   (exit $ac_status); }; then
2751                         test -n "$verbose" && echo "$as_me:2751: result: ... $cf_attribute" >&5
2752 echo "${ECHO_T}... $cf_attribute" >&6
2753                         cat conftest.h >>confdefs.h
2754                         case $cf_attribute in
2755                         (noreturn)
2756
2757 cat >>confdefs.h <<EOF
2758 #define GCC_NORETURN $cf_directive
2759 EOF
2760
2761                                 ;;
2762                         (printf)
2763                                 cf_value='/* nothing */'
2764                                 if test "$cf_printf_attribute" != no ; then
2765                                         cf_value='__attribute__((format(printf,fmt,var)))'
2766
2767 cat >>confdefs.h <<\EOF
2768 #define GCC_PRINTF 1
2769 EOF
2770
2771                                 fi
2772
2773 cat >>confdefs.h <<EOF
2774 #define GCC_PRINTFLIKE(fmt,var) $cf_value
2775 EOF
2776
2777                                 ;;
2778                         (scanf)
2779                                 cf_value='/* nothing */'
2780                                 if test "$cf_scanf_attribute" != no ; then
2781                                         cf_value='__attribute__((format(scanf,fmt,var)))'
2782
2783 cat >>confdefs.h <<\EOF
2784 #define GCC_SCANF 1
2785 EOF
2786
2787                                 fi
2788
2789 cat >>confdefs.h <<EOF
2790 #define GCC_SCANFLIKE(fmt,var) $cf_value
2791 EOF
2792
2793                                 ;;
2794                         (unused)
2795
2796 cat >>confdefs.h <<EOF
2797 #define GCC_UNUSED $cf_directive
2798 EOF
2799
2800                                 ;;
2801                         esac
2802                 fi
2803         done
2804 else
2805         fgrep define conftest.i >>confdefs.h
2806 fi
2807 rm -rf conftest*
2808 fi
2809
2810 cf_XOPEN_SOURCE=500
2811 cf_POSIX_C_SOURCE=199506L
2812 cf_xopen_source=
2813
2814 case $host_os in
2815 (aix[4-7]*)
2816         cf_xopen_source="-D_ALL_SOURCE"
2817         ;;
2818 (cygwin|msys)
2819         cf_XOPEN_SOURCE=600
2820         ;;
2821 (darwin[0-8].*)
2822         cf_xopen_source="-D_APPLE_C_SOURCE"
2823         ;;
2824 (darwin*)
2825         cf_xopen_source="-D_DARWIN_C_SOURCE"
2826         cf_XOPEN_SOURCE=
2827         ;;
2828 (freebsd*|dragonfly*)
2829         # 5.x headers associate
2830         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
2831         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
2832         cf_POSIX_C_SOURCE=200112L
2833         cf_XOPEN_SOURCE=600
2834         cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
2835         ;;
2836 (hpux11*)
2837         cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
2838         ;;
2839 (hpux*)
2840         cf_xopen_source="-D_HPUX_SOURCE"
2841         ;;
2842 (irix[56].*)
2843         cf_xopen_source="-D_SGI_SOURCE"
2844         cf_XOPEN_SOURCE=
2845         ;;
2846 (linux*|gnu*|mint*|k*bsd*-gnu)
2847
2848 echo "$as_me:2848: checking if we must define _GNU_SOURCE" >&5
2849 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
2850 if test "${cf_cv_gnu_source+set}" = set; then
2851   echo $ECHO_N "(cached) $ECHO_C" >&6
2852 else
2853
2854 cat >conftest.$ac_ext <<_ACEOF
2855 #line 2855 "configure"
2856 #include "confdefs.h"
2857 #include <sys/types.h>
2858 int
2859 main ()
2860 {
2861
2862 #ifndef _XOPEN_SOURCE
2863 make an error
2864 #endif
2865   ;
2866   return 0;
2867 }
2868 _ACEOF
2869 rm -f conftest.$ac_objext
2870 if { (eval echo "$as_me:2870: \"$ac_compile\"") >&5
2871   (eval $ac_compile) 2>&5
2872   ac_status=$?
2873   echo "$as_me:2873: \$? = $ac_status" >&5
2874   (exit $ac_status); } &&
2875          { ac_try='test -s conftest.$ac_objext'
2876   { (eval echo "$as_me:2876: \"$ac_try\"") >&5
2877   (eval $ac_try) 2>&5
2878   ac_status=$?
2879   echo "$as_me:2879: \$? = $ac_status" >&5
2880   (exit $ac_status); }; }; then
2881   cf_cv_gnu_source=no
2882 else
2883   echo "$as_me: failed program was:" >&5
2884 cat conftest.$ac_ext >&5
2885 cf_save="$CPPFLAGS"
2886          CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
2887          cat >conftest.$ac_ext <<_ACEOF
2888 #line 2888 "configure"
2889 #include "confdefs.h"
2890 #include <sys/types.h>
2891 int
2892 main ()
2893 {
2894
2895 #ifdef _XOPEN_SOURCE
2896 make an error
2897 #endif
2898   ;
2899   return 0;
2900 }
2901 _ACEOF
2902 rm -f conftest.$ac_objext
2903 if { (eval echo "$as_me:2903: \"$ac_compile\"") >&5
2904   (eval $ac_compile) 2>&5
2905   ac_status=$?
2906   echo "$as_me:2906: \$? = $ac_status" >&5
2907   (exit $ac_status); } &&
2908          { ac_try='test -s conftest.$ac_objext'
2909   { (eval echo "$as_me:2909: \"$ac_try\"") >&5
2910   (eval $ac_try) 2>&5
2911   ac_status=$?
2912   echo "$as_me:2912: \$? = $ac_status" >&5
2913   (exit $ac_status); }; }; then
2914   cf_cv_gnu_source=no
2915 else
2916   echo "$as_me: failed program was:" >&5
2917 cat conftest.$ac_ext >&5
2918 cf_cv_gnu_source=yes
2919 fi
2920 rm -f conftest.$ac_objext conftest.$ac_ext
2921         CPPFLAGS="$cf_save"
2922
2923 fi
2924 rm -f conftest.$ac_objext conftest.$ac_ext
2925
2926 fi
2927 echo "$as_me:2927: result: $cf_cv_gnu_source" >&5
2928 echo "${ECHO_T}$cf_cv_gnu_source" >&6
2929 test "$cf_cv_gnu_source" = yes && CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
2930
2931         ;;
2932 (minix*)
2933         cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this...
2934         ;;
2935 (mirbsd*)
2936         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
2937         cf_XOPEN_SOURCE=
2938
2939 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
2940
2941 cf_save_CFLAGS="$CFLAGS"
2942 cf_save_CPPFLAGS="$CPPFLAGS"
2943
2944 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
2945         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
2946                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
2947
2948 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
2949         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
2950                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
2951
2952 echo "$as_me:2952: checking if we should define _POSIX_C_SOURCE" >&5
2953 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
2954 if test "${cf_cv_posix_c_source+set}" = set; then
2955   echo $ECHO_N "(cached) $ECHO_C" >&6
2956 else
2957
2958 echo "${as_me:-configure}:2958: testing if the symbol is already defined go no further ..." 1>&5
2959
2960         cat >conftest.$ac_ext <<_ACEOF
2961 #line 2961 "configure"
2962 #include "confdefs.h"
2963 #include <sys/types.h>
2964 int
2965 main ()
2966 {
2967
2968 #ifndef _POSIX_C_SOURCE
2969 make an error
2970 #endif
2971   ;
2972   return 0;
2973 }
2974 _ACEOF
2975 rm -f conftest.$ac_objext
2976 if { (eval echo "$as_me:2976: \"$ac_compile\"") >&5
2977   (eval $ac_compile) 2>&5
2978   ac_status=$?
2979   echo "$as_me:2979: \$? = $ac_status" >&5
2980   (exit $ac_status); } &&
2981          { ac_try='test -s conftest.$ac_objext'
2982   { (eval echo "$as_me:2982: \"$ac_try\"") >&5
2983   (eval $ac_try) 2>&5
2984   ac_status=$?
2985   echo "$as_me:2985: \$? = $ac_status" >&5
2986   (exit $ac_status); }; }; then
2987   cf_cv_posix_c_source=no
2988 else
2989   echo "$as_me: failed program was:" >&5
2990 cat conftest.$ac_ext >&5
2991 cf_want_posix_source=no
2992          case .$cf_POSIX_C_SOURCE in
2993          (.[12]??*)
2994                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
2995                 ;;
2996          (.2)
2997                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
2998                 cf_want_posix_source=yes
2999                 ;;
3000          (.*)
3001                 cf_want_posix_source=yes
3002                 ;;
3003          esac
3004          if test "$cf_want_posix_source" = yes ; then
3005                 cat >conftest.$ac_ext <<_ACEOF
3006 #line 3006 "configure"
3007 #include "confdefs.h"
3008 #include <sys/types.h>
3009 int
3010 main ()
3011 {
3012
3013 #ifdef _POSIX_SOURCE
3014 make an error
3015 #endif
3016   ;
3017   return 0;
3018 }
3019 _ACEOF
3020 rm -f conftest.$ac_objext
3021 if { (eval echo "$as_me:3021: \"$ac_compile\"") >&5
3022   (eval $ac_compile) 2>&5
3023   ac_status=$?
3024   echo "$as_me:3024: \$? = $ac_status" >&5
3025   (exit $ac_status); } &&
3026          { ac_try='test -s conftest.$ac_objext'
3027   { (eval echo "$as_me:3027: \"$ac_try\"") >&5
3028   (eval $ac_try) 2>&5
3029   ac_status=$?
3030   echo "$as_me:3030: \$? = $ac_status" >&5
3031   (exit $ac_status); }; }; then
3032   :
3033 else
3034   echo "$as_me: failed program was:" >&5
3035 cat conftest.$ac_ext >&5
3036 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
3037 fi
3038 rm -f conftest.$ac_objext conftest.$ac_ext
3039          fi
3040
3041 echo "${as_me:-configure}:3041: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
3042
3043          CFLAGS="$cf_trim_CFLAGS"
3044          CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
3045
3046 echo "${as_me:-configure}:3046: testing if the second compile does not leave our definition intact error ..." 1>&5
3047
3048          cat >conftest.$ac_ext <<_ACEOF
3049 #line 3049 "configure"
3050 #include "confdefs.h"
3051 #include <sys/types.h>
3052 int
3053 main ()
3054 {
3055
3056 #ifndef _POSIX_C_SOURCE
3057 make an error
3058 #endif
3059   ;
3060   return 0;
3061 }
3062 _ACEOF
3063 rm -f conftest.$ac_objext
3064 if { (eval echo "$as_me:3064: \"$ac_compile\"") >&5
3065   (eval $ac_compile) 2>&5
3066   ac_status=$?
3067   echo "$as_me:3067: \$? = $ac_status" >&5
3068   (exit $ac_status); } &&
3069          { ac_try='test -s conftest.$ac_objext'
3070   { (eval echo "$as_me:3070: \"$ac_try\"") >&5
3071   (eval $ac_try) 2>&5
3072   ac_status=$?
3073   echo "$as_me:3073: \$? = $ac_status" >&5
3074   (exit $ac_status); }; }; then
3075   :
3076 else
3077   echo "$as_me: failed program was:" >&5
3078 cat conftest.$ac_ext >&5
3079 cf_cv_posix_c_source=no
3080 fi
3081 rm -f conftest.$ac_objext conftest.$ac_ext
3082          CFLAGS="$cf_save_CFLAGS"
3083          CPPFLAGS="$cf_save_CPPFLAGS"
3084
3085 fi
3086 rm -f conftest.$ac_objext conftest.$ac_ext
3087
3088 fi
3089 echo "$as_me:3089: result: $cf_cv_posix_c_source" >&5
3090 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
3091
3092 if test "$cf_cv_posix_c_source" != no ; then
3093         CFLAGS="$cf_trim_CFLAGS"
3094         CPPFLAGS="$cf_trim_CPPFLAGS"
3095
3096 cf_fix_cppflags=no
3097 cf_new_cflags=
3098 cf_new_cppflags=
3099 cf_new_extra_cppflags=
3100
3101 for cf_add_cflags in $cf_cv_posix_c_source
3102 do
3103 case $cf_fix_cppflags in
3104 (no)
3105         case $cf_add_cflags in
3106         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
3107                 case $cf_add_cflags in
3108                 (-D*)
3109                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3110
3111                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3112                                 && test -z "${cf_tst_cflags}" \
3113                                 && cf_fix_cppflags=yes
3114
3115                         if test $cf_fix_cppflags = yes ; then
3116                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3117                                 continue
3118                         elif test "${cf_tst_cflags}" = "\"'" ; then
3119                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3120                                 continue
3121                         fi
3122                         ;;
3123                 esac
3124                 case "$CPPFLAGS" in
3125                 (*$cf_add_cflags)
3126                         ;;
3127                 (*)
3128                         case $cf_add_cflags in
3129                         (-D*)
3130                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3131
3132 CPPFLAGS=`echo "$CPPFLAGS" | \
3133         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3134                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3135
3136                                 ;;
3137                         esac
3138                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3139                         ;;
3140                 esac
3141                 ;;
3142         (*)
3143                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
3144                 ;;
3145         esac
3146         ;;
3147 (yes)
3148         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3149
3150         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3151
3152         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3153                 && test -z "${cf_tst_cflags}" \
3154                 && cf_fix_cppflags=no
3155         ;;
3156 esac
3157 done
3158
3159 if test -n "$cf_new_cflags" ; then
3160
3161         CFLAGS="$CFLAGS $cf_new_cflags"
3162 fi
3163
3164 if test -n "$cf_new_cppflags" ; then
3165
3166         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
3167 fi
3168
3169 if test -n "$cf_new_extra_cppflags" ; then
3170
3171         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
3172 fi
3173
3174 fi
3175
3176         ;;
3177 (netbsd*)
3178         cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
3179         ;;
3180 (openbsd[4-9]*)
3181         # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
3182         cf_xopen_source="-D_BSD_SOURCE"
3183         cf_XOPEN_SOURCE=600
3184         ;;
3185 (openbsd*)
3186         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
3187         ;;
3188 (os2*)
3189         cf_XOPEN_SOURCE=
3190         ;;
3191 (osf[45]*)
3192         cf_xopen_source="-D_OSF_SOURCE"
3193         ;;
3194 (nto-qnx*)
3195         cf_xopen_source="-D_QNX_SOURCE"
3196         ;;
3197 (sco*)
3198         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
3199         ;;
3200 (solaris2.*)
3201         cf_xopen_source="-D__EXTENSIONS__"
3202         cf_cv_xopen_source=broken
3203         ;;
3204 (sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
3205         cf_XOPEN_SOURCE=
3206         cf_POSIX_C_SOURCE=
3207         ;;
3208 (*)
3209
3210 echo "$as_me:3210: checking if we should define _XOPEN_SOURCE" >&5
3211 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
3212 if test "${cf_cv_xopen_source+set}" = set; then
3213   echo $ECHO_N "(cached) $ECHO_C" >&6
3214 else
3215
3216         cat >conftest.$ac_ext <<_ACEOF
3217 #line 3217 "configure"
3218 #include "confdefs.h"
3219
3220 #include <stdlib.h>
3221 #include <string.h>
3222 #include <sys/types.h>
3223
3224 int
3225 main ()
3226 {
3227
3228 #ifndef _XOPEN_SOURCE
3229 make an error
3230 #endif
3231   ;
3232   return 0;
3233 }
3234 _ACEOF
3235 rm -f conftest.$ac_objext
3236 if { (eval echo "$as_me:3236: \"$ac_compile\"") >&5
3237   (eval $ac_compile) 2>&5
3238   ac_status=$?
3239   echo "$as_me:3239: \$? = $ac_status" >&5
3240   (exit $ac_status); } &&
3241          { ac_try='test -s conftest.$ac_objext'
3242   { (eval echo "$as_me:3242: \"$ac_try\"") >&5
3243   (eval $ac_try) 2>&5
3244   ac_status=$?
3245   echo "$as_me:3245: \$? = $ac_status" >&5
3246   (exit $ac_status); }; }; then
3247   cf_cv_xopen_source=no
3248 else
3249   echo "$as_me: failed program was:" >&5
3250 cat conftest.$ac_ext >&5
3251 cf_save="$CPPFLAGS"
3252          CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
3253          cat >conftest.$ac_ext <<_ACEOF
3254 #line 3254 "configure"
3255 #include "confdefs.h"
3256
3257 #include <stdlib.h>
3258 #include <string.h>
3259 #include <sys/types.h>
3260
3261 int
3262 main ()
3263 {
3264
3265 #ifdef _XOPEN_SOURCE
3266 make an error
3267 #endif
3268   ;
3269   return 0;
3270 }
3271 _ACEOF
3272 rm -f conftest.$ac_objext
3273 if { (eval echo "$as_me:3273: \"$ac_compile\"") >&5
3274   (eval $ac_compile) 2>&5
3275   ac_status=$?
3276   echo "$as_me:3276: \$? = $ac_status" >&5
3277   (exit $ac_status); } &&
3278          { ac_try='test -s conftest.$ac_objext'
3279   { (eval echo "$as_me:3279: \"$ac_try\"") >&5
3280   (eval $ac_try) 2>&5
3281   ac_status=$?
3282   echo "$as_me:3282: \$? = $ac_status" >&5
3283   (exit $ac_status); }; }; then
3284   cf_cv_xopen_source=no
3285 else
3286   echo "$as_me: failed program was:" >&5
3287 cat conftest.$ac_ext >&5
3288 cf_cv_xopen_source=$cf_XOPEN_SOURCE
3289 fi
3290 rm -f conftest.$ac_objext conftest.$ac_ext
3291         CPPFLAGS="$cf_save"
3292
3293 fi
3294 rm -f conftest.$ac_objext conftest.$ac_ext
3295
3296 fi
3297 echo "$as_me:3297: result: $cf_cv_xopen_source" >&5
3298 echo "${ECHO_T}$cf_cv_xopen_source" >&6
3299
3300 if test "$cf_cv_xopen_source" != no ; then
3301
3302 CFLAGS=`echo "$CFLAGS" | \
3303         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
3304                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
3305
3306 CPPFLAGS=`echo "$CPPFLAGS" | \
3307         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
3308                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
3309
3310         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
3311
3312 cf_fix_cppflags=no
3313 cf_new_cflags=
3314 cf_new_cppflags=
3315 cf_new_extra_cppflags=
3316
3317 for cf_add_cflags in $cf_temp_xopen_source
3318 do
3319 case $cf_fix_cppflags in
3320 (no)
3321         case $cf_add_cflags in
3322         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
3323                 case $cf_add_cflags in
3324                 (-D*)
3325                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3326
3327                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3328                                 && test -z "${cf_tst_cflags}" \
3329                                 && cf_fix_cppflags=yes
3330
3331                         if test $cf_fix_cppflags = yes ; then
3332                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3333                                 continue
3334                         elif test "${cf_tst_cflags}" = "\"'" ; then
3335                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3336                                 continue
3337                         fi
3338                         ;;
3339                 esac
3340                 case "$CPPFLAGS" in
3341                 (*$cf_add_cflags)
3342                         ;;
3343                 (*)
3344                         case $cf_add_cflags in
3345                         (-D*)
3346                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3347
3348 CPPFLAGS=`echo "$CPPFLAGS" | \
3349         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3350                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3351
3352                                 ;;
3353                         esac
3354                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3355                         ;;
3356                 esac
3357                 ;;
3358         (*)
3359                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
3360                 ;;
3361         esac
3362         ;;
3363 (yes)
3364         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3365
3366         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3367
3368         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3369                 && test -z "${cf_tst_cflags}" \
3370                 && cf_fix_cppflags=no
3371         ;;
3372 esac
3373 done
3374
3375 if test -n "$cf_new_cflags" ; then
3376
3377         CFLAGS="$CFLAGS $cf_new_cflags"
3378 fi
3379
3380 if test -n "$cf_new_cppflags" ; then
3381
3382         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
3383 fi
3384
3385 if test -n "$cf_new_extra_cppflags" ; then
3386
3387         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
3388 fi
3389
3390 fi
3391
3392 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
3393
3394 cf_save_CFLAGS="$CFLAGS"
3395 cf_save_CPPFLAGS="$CPPFLAGS"
3396
3397 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
3398         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
3399                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
3400
3401 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
3402         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
3403                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
3404
3405 echo "$as_me:3405: checking if we should define _POSIX_C_SOURCE" >&5
3406 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
3407 if test "${cf_cv_posix_c_source+set}" = set; then
3408   echo $ECHO_N "(cached) $ECHO_C" >&6
3409 else
3410
3411 echo "${as_me:-configure}:3411: testing if the symbol is already defined go no further ..." 1>&5
3412
3413         cat >conftest.$ac_ext <<_ACEOF
3414 #line 3414 "configure"
3415 #include "confdefs.h"
3416 #include <sys/types.h>
3417 int
3418 main ()
3419 {
3420
3421 #ifndef _POSIX_C_SOURCE
3422 make an error
3423 #endif
3424   ;
3425   return 0;
3426 }
3427 _ACEOF
3428 rm -f conftest.$ac_objext
3429 if { (eval echo "$as_me:3429: \"$ac_compile\"") >&5
3430   (eval $ac_compile) 2>&5
3431   ac_status=$?
3432   echo "$as_me:3432: \$? = $ac_status" >&5
3433   (exit $ac_status); } &&
3434          { ac_try='test -s conftest.$ac_objext'
3435   { (eval echo "$as_me:3435: \"$ac_try\"") >&5
3436   (eval $ac_try) 2>&5
3437   ac_status=$?
3438   echo "$as_me:3438: \$? = $ac_status" >&5
3439   (exit $ac_status); }; }; then
3440   cf_cv_posix_c_source=no
3441 else
3442   echo "$as_me: failed program was:" >&5
3443 cat conftest.$ac_ext >&5
3444 cf_want_posix_source=no
3445          case .$cf_POSIX_C_SOURCE in
3446          (.[12]??*)
3447                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
3448                 ;;
3449          (.2)
3450                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
3451                 cf_want_posix_source=yes
3452                 ;;
3453          (.*)
3454                 cf_want_posix_source=yes
3455                 ;;
3456          esac
3457          if test "$cf_want_posix_source" = yes ; then
3458                 cat >conftest.$ac_ext <<_ACEOF
3459 #line 3459 "configure"
3460 #include "confdefs.h"
3461 #include <sys/types.h>
3462 int
3463 main ()
3464 {
3465
3466 #ifdef _POSIX_SOURCE
3467 make an error
3468 #endif
3469   ;
3470   return 0;
3471 }
3472 _ACEOF
3473 rm -f conftest.$ac_objext
3474 if { (eval echo "$as_me:3474: \"$ac_compile\"") >&5
3475   (eval $ac_compile) 2>&5
3476   ac_status=$?
3477   echo "$as_me:3477: \$? = $ac_status" >&5
3478   (exit $ac_status); } &&
3479          { ac_try='test -s conftest.$ac_objext'
3480   { (eval echo "$as_me:3480: \"$ac_try\"") >&5
3481   (eval $ac_try) 2>&5
3482   ac_status=$?
3483   echo "$as_me:3483: \$? = $ac_status" >&5
3484   (exit $ac_status); }; }; then
3485   :
3486 else
3487   echo "$as_me: failed program was:" >&5
3488 cat conftest.$ac_ext >&5
3489 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
3490 fi
3491 rm -f conftest.$ac_objext conftest.$ac_ext
3492          fi
3493
3494 echo "${as_me:-configure}:3494: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
3495
3496          CFLAGS="$cf_trim_CFLAGS"
3497          CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
3498
3499 echo "${as_me:-configure}:3499: testing if the second compile does not leave our definition intact error ..." 1>&5
3500
3501          cat >conftest.$ac_ext <<_ACEOF
3502 #line 3502 "configure"
3503 #include "confdefs.h"
3504 #include <sys/types.h>
3505 int
3506 main ()
3507 {
3508
3509 #ifndef _POSIX_C_SOURCE
3510 make an error
3511 #endif
3512   ;
3513   return 0;
3514 }
3515 _ACEOF
3516 rm -f conftest.$ac_objext
3517 if { (eval echo "$as_me:3517: \"$ac_compile\"") >&5
3518   (eval $ac_compile) 2>&5
3519   ac_status=$?
3520   echo "$as_me:3520: \$? = $ac_status" >&5
3521   (exit $ac_status); } &&
3522          { ac_try='test -s conftest.$ac_objext'
3523   { (eval echo "$as_me:3523: \"$ac_try\"") >&5
3524   (eval $ac_try) 2>&5
3525   ac_status=$?
3526   echo "$as_me:3526: \$? = $ac_status" >&5
3527   (exit $ac_status); }; }; then
3528   :
3529 else
3530   echo "$as_me: failed program was:" >&5
3531 cat conftest.$ac_ext >&5
3532 cf_cv_posix_c_source=no
3533 fi
3534 rm -f conftest.$ac_objext conftest.$ac_ext
3535          CFLAGS="$cf_save_CFLAGS"
3536          CPPFLAGS="$cf_save_CPPFLAGS"
3537
3538 fi
3539 rm -f conftest.$ac_objext conftest.$ac_ext
3540
3541 fi
3542 echo "$as_me:3542: result: $cf_cv_posix_c_source" >&5
3543 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
3544
3545 if test "$cf_cv_posix_c_source" != no ; then
3546         CFLAGS="$cf_trim_CFLAGS"
3547         CPPFLAGS="$cf_trim_CPPFLAGS"
3548
3549 cf_fix_cppflags=no
3550 cf_new_cflags=
3551 cf_new_cppflags=
3552 cf_new_extra_cppflags=
3553
3554 for cf_add_cflags in $cf_cv_posix_c_source
3555 do
3556 case $cf_fix_cppflags in
3557 (no)
3558         case $cf_add_cflags in
3559         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
3560                 case $cf_add_cflags in
3561                 (-D*)
3562                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3563
3564                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3565                                 && test -z "${cf_tst_cflags}" \
3566                                 && cf_fix_cppflags=yes
3567
3568                         if test $cf_fix_cppflags = yes ; then
3569                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3570                                 continue
3571                         elif test "${cf_tst_cflags}" = "\"'" ; then
3572                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3573                                 continue
3574                         fi
3575                         ;;
3576                 esac
3577                 case "$CPPFLAGS" in
3578                 (*$cf_add_cflags)
3579                         ;;
3580                 (*)
3581                         case $cf_add_cflags in
3582                         (-D*)
3583                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3584
3585 CPPFLAGS=`echo "$CPPFLAGS" | \
3586         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3587                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3588
3589                                 ;;
3590                         esac
3591                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3592                         ;;
3593                 esac
3594                 ;;
3595         (*)
3596                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
3597                 ;;
3598         esac
3599         ;;
3600 (yes)
3601         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3602
3603         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3604
3605         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3606                 && test -z "${cf_tst_cflags}" \
3607                 && cf_fix_cppflags=no
3608         ;;
3609 esac
3610 done
3611
3612 if test -n "$cf_new_cflags" ; then
3613
3614         CFLAGS="$CFLAGS $cf_new_cflags"
3615 fi
3616
3617 if test -n "$cf_new_cppflags" ; then
3618
3619         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
3620 fi
3621
3622 if test -n "$cf_new_extra_cppflags" ; then
3623
3624         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
3625 fi
3626
3627 fi
3628
3629         ;;
3630 esac
3631
3632 if test -n "$cf_xopen_source" ; then
3633
3634 cf_fix_cppflags=no
3635 cf_new_cflags=
3636 cf_new_cppflags=
3637 cf_new_extra_cppflags=
3638
3639 for cf_add_cflags in $cf_xopen_source
3640 do
3641 case $cf_fix_cppflags in
3642 (no)
3643         case $cf_add_cflags in
3644         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
3645                 case $cf_add_cflags in
3646                 (-D*)
3647                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3648
3649                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3650                                 && test -z "${cf_tst_cflags}" \
3651                                 && cf_fix_cppflags=yes
3652
3653                         if test $cf_fix_cppflags = yes ; then
3654                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3655                                 continue
3656                         elif test "${cf_tst_cflags}" = "\"'" ; then
3657                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3658                                 continue
3659                         fi
3660                         ;;
3661                 esac
3662                 case "$CPPFLAGS" in
3663                 (*$cf_add_cflags)
3664                         ;;
3665                 (*)
3666                         case $cf_add_cflags in
3667                         (-D*)
3668                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3669
3670 CPPFLAGS=`echo "$CPPFLAGS" | \
3671         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3672                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3673
3674                                 ;;
3675                         esac
3676                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3677                         ;;
3678                 esac
3679                 ;;
3680         (*)
3681                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
3682                 ;;
3683         esac
3684         ;;
3685 (yes)
3686         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3687
3688         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3689
3690         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3691                 && test -z "${cf_tst_cflags}" \
3692                 && cf_fix_cppflags=no
3693         ;;
3694 esac
3695 done
3696
3697 if test -n "$cf_new_cflags" ; then
3698         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
3699
3700 echo "${as_me:-configure}:3700: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
3701
3702         CFLAGS="$CFLAGS $cf_new_cflags"
3703 fi
3704
3705 if test -n "$cf_new_cppflags" ; then
3706         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
3707
3708 echo "${as_me:-configure}:3708: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
3709
3710         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
3711 fi
3712
3713 if test -n "$cf_new_extra_cppflags" ; then
3714         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
3715
3716 echo "${as_me:-configure}:3716: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
3717
3718         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
3719 fi
3720
3721 fi
3722
3723 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
3724         echo "$as_me:3724: checking if _XOPEN_SOURCE really is set" >&5
3725 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
3726         cat >conftest.$ac_ext <<_ACEOF
3727 #line 3727 "configure"
3728 #include "confdefs.h"
3729 #include <stdlib.h>
3730 int
3731 main ()
3732 {
3733
3734 #ifndef _XOPEN_SOURCE
3735 make an error
3736 #endif
3737   ;
3738   return 0;
3739 }
3740 _ACEOF
3741 rm -f conftest.$ac_objext
3742 if { (eval echo "$as_me:3742: \"$ac_compile\"") >&5
3743   (eval $ac_compile) 2>&5
3744   ac_status=$?
3745   echo "$as_me:3745: \$? = $ac_status" >&5
3746   (exit $ac_status); } &&
3747          { ac_try='test -s conftest.$ac_objext'
3748   { (eval echo "$as_me:3748: \"$ac_try\"") >&5
3749   (eval $ac_try) 2>&5
3750   ac_status=$?
3751   echo "$as_me:3751: \$? = $ac_status" >&5
3752   (exit $ac_status); }; }; then
3753   cf_XOPEN_SOURCE_set=yes
3754 else
3755   echo "$as_me: failed program was:" >&5
3756 cat conftest.$ac_ext >&5
3757 cf_XOPEN_SOURCE_set=no
3758 fi
3759 rm -f conftest.$ac_objext conftest.$ac_ext
3760         echo "$as_me:3760: result: $cf_XOPEN_SOURCE_set" >&5
3761 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
3762         if test $cf_XOPEN_SOURCE_set = yes
3763         then
3764                 cat >conftest.$ac_ext <<_ACEOF
3765 #line 3765 "configure"
3766 #include "confdefs.h"
3767 #include <stdlib.h>
3768 int
3769 main ()
3770 {
3771
3772 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
3773 make an error
3774 #endif
3775   ;
3776   return 0;
3777 }
3778 _ACEOF
3779 rm -f conftest.$ac_objext
3780 if { (eval echo "$as_me:3780: \"$ac_compile\"") >&5
3781   (eval $ac_compile) 2>&5
3782   ac_status=$?
3783   echo "$as_me:3783: \$? = $ac_status" >&5
3784   (exit $ac_status); } &&
3785          { ac_try='test -s conftest.$ac_objext'
3786   { (eval echo "$as_me:3786: \"$ac_try\"") >&5
3787   (eval $ac_try) 2>&5
3788   ac_status=$?
3789   echo "$as_me:3789: \$? = $ac_status" >&5
3790   (exit $ac_status); }; }; then
3791   cf_XOPEN_SOURCE_set_ok=yes
3792 else
3793   echo "$as_me: failed program was:" >&5
3794 cat conftest.$ac_ext >&5
3795 cf_XOPEN_SOURCE_set_ok=no
3796 fi
3797 rm -f conftest.$ac_objext conftest.$ac_ext
3798                 if test $cf_XOPEN_SOURCE_set_ok = no
3799                 then
3800                         { echo "$as_me:3800: WARNING: _XOPEN_SOURCE is lower than requested" >&5
3801 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
3802                 fi
3803         else
3804
3805 echo "$as_me:3805: checking if we should define _XOPEN_SOURCE" >&5
3806 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
3807 if test "${cf_cv_xopen_source+set}" = set; then
3808   echo $ECHO_N "(cached) $ECHO_C" >&6
3809 else
3810
3811         cat >conftest.$ac_ext <<_ACEOF
3812 #line 3812 "configure"
3813 #include "confdefs.h"
3814
3815 #include <stdlib.h>
3816 #include <string.h>
3817 #include <sys/types.h>
3818
3819 int
3820 main ()
3821 {
3822
3823 #ifndef _XOPEN_SOURCE
3824 make an error
3825 #endif
3826   ;
3827   return 0;
3828 }
3829 _ACEOF
3830 rm -f conftest.$ac_objext
3831 if { (eval echo "$as_me:3831: \"$ac_compile\"") >&5
3832   (eval $ac_compile) 2>&5
3833   ac_status=$?
3834   echo "$as_me:3834: \$? = $ac_status" >&5
3835   (exit $ac_status); } &&
3836          { ac_try='test -s conftest.$ac_objext'
3837   { (eval echo "$as_me:3837: \"$ac_try\"") >&5
3838   (eval $ac_try) 2>&5
3839   ac_status=$?
3840   echo "$as_me:3840: \$? = $ac_status" >&5
3841   (exit $ac_status); }; }; then
3842   cf_cv_xopen_source=no
3843 else
3844   echo "$as_me: failed program was:" >&5
3845 cat conftest.$ac_ext >&5
3846 cf_save="$CPPFLAGS"
3847          CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
3848          cat >conftest.$ac_ext <<_ACEOF
3849 #line 3849 "configure"
3850 #include "confdefs.h"
3851
3852 #include <stdlib.h>
3853 #include <string.h>
3854 #include <sys/types.h>
3855
3856 int
3857 main ()
3858 {
3859
3860 #ifdef _XOPEN_SOURCE
3861 make an error
3862 #endif
3863   ;
3864   return 0;
3865 }
3866 _ACEOF
3867 rm -f conftest.$ac_objext
3868 if { (eval echo "$as_me:3868: \"$ac_compile\"") >&5
3869   (eval $ac_compile) 2>&5
3870   ac_status=$?
3871   echo "$as_me:3871: \$? = $ac_status" >&5
3872   (exit $ac_status); } &&
3873          { ac_try='test -s conftest.$ac_objext'
3874   { (eval echo "$as_me:3874: \"$ac_try\"") >&5
3875   (eval $ac_try) 2>&5
3876   ac_status=$?
3877   echo "$as_me:3877: \$? = $ac_status" >&5
3878   (exit $ac_status); }; }; then
3879   cf_cv_xopen_source=no
3880 else
3881   echo "$as_me: failed program was:" >&5
3882 cat conftest.$ac_ext >&5
3883 cf_cv_xopen_source=$cf_XOPEN_SOURCE
3884 fi
3885 rm -f conftest.$ac_objext conftest.$ac_ext
3886         CPPFLAGS="$cf_save"
3887
3888 fi
3889 rm -f conftest.$ac_objext conftest.$ac_ext
3890
3891 fi
3892 echo "$as_me:3892: result: $cf_cv_xopen_source" >&5
3893 echo "${ECHO_T}$cf_cv_xopen_source" >&6
3894
3895 if test "$cf_cv_xopen_source" != no ; then
3896
3897 CFLAGS=`echo "$CFLAGS" | \
3898         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
3899                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
3900
3901 CPPFLAGS=`echo "$CPPFLAGS" | \
3902         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
3903                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
3904
3905         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
3906
3907 cf_fix_cppflags=no
3908 cf_new_cflags=
3909 cf_new_cppflags=
3910 cf_new_extra_cppflags=
3911
3912 for cf_add_cflags in $cf_temp_xopen_source
3913 do
3914 case $cf_fix_cppflags in
3915 (no)
3916         case $cf_add_cflags in
3917         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
3918                 case $cf_add_cflags in
3919                 (-D*)
3920                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3921
3922                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3923                                 && test -z "${cf_tst_cflags}" \
3924                                 && cf_fix_cppflags=yes
3925
3926                         if test $cf_fix_cppflags = yes ; then
3927                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3928                                 continue
3929                         elif test "${cf_tst_cflags}" = "\"'" ; then
3930                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3931                                 continue
3932                         fi
3933                         ;;
3934                 esac
3935                 case "$CPPFLAGS" in
3936                 (*$cf_add_cflags)
3937                         ;;
3938                 (*)
3939                         case $cf_add_cflags in
3940                         (-D*)
3941                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3942
3943 CPPFLAGS=`echo "$CPPFLAGS" | \
3944         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3945                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3946
3947                                 ;;
3948                         esac
3949                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3950                         ;;
3951                 esac
3952                 ;;
3953         (*)
3954                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
3955                 ;;
3956         esac
3957         ;;
3958 (yes)
3959         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3960
3961         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3962
3963         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3964                 && test -z "${cf_tst_cflags}" \
3965                 && cf_fix_cppflags=no
3966         ;;
3967 esac
3968 done
3969
3970 if test -n "$cf_new_cflags" ; then
3971
3972         CFLAGS="$CFLAGS $cf_new_cflags"
3973 fi
3974
3975 if test -n "$cf_new_cppflags" ; then
3976
3977         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
3978 fi
3979
3980 if test -n "$cf_new_extra_cppflags" ; then
3981
3982         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
3983 fi
3984
3985 fi
3986
3987         fi
3988 fi
3989
3990 echo "$as_me:3990: checking for signal global datatype" >&5
3991 echo $ECHO_N "checking for signal global datatype... $ECHO_C" >&6
3992 if test "${cf_cv_sig_atomic_t+set}" = set; then
3993   echo $ECHO_N "(cached) $ECHO_C" >&6
3994 else
3995
3996         for cf_type in \
3997                 "volatile sig_atomic_t" \
3998                 "sig_atomic_t" \
3999                 "int"
4000         do
4001         cat >conftest.$ac_ext <<_ACEOF
4002 #line 4002 "configure"
4003 #include "confdefs.h"
4004
4005 #include <sys/types.h>
4006 #include <signal.h>
4007 #include <stdio.h>
4008
4009 extern $cf_type x;
4010 $cf_type x;
4011 static void handler(int sig)
4012 {
4013         x = 5;
4014 }
4015 int
4016 main ()
4017 {
4018 signal(SIGINT, handler);
4019                  x = 1
4020   ;
4021   return 0;
4022 }
4023 _ACEOF
4024 rm -f conftest.$ac_objext
4025 if { (eval echo "$as_me:4025: \"$ac_compile\"") >&5
4026   (eval $ac_compile) 2>&5
4027   ac_status=$?
4028   echo "$as_me:4028: \$? = $ac_status" >&5
4029   (exit $ac_status); } &&
4030          { ac_try='test -s conftest.$ac_objext'
4031   { (eval echo "$as_me:4031: \"$ac_try\"") >&5
4032   (eval $ac_try) 2>&5
4033   ac_status=$?
4034   echo "$as_me:4034: \$? = $ac_status" >&5
4035   (exit $ac_status); }; }; then
4036   cf_cv_sig_atomic_t=$cf_type
4037 else
4038   echo "$as_me: failed program was:" >&5
4039 cat conftest.$ac_ext >&5
4040 cf_cv_sig_atomic_t=no
4041 fi
4042 rm -f conftest.$ac_objext conftest.$ac_ext
4043                 test "$cf_cv_sig_atomic_t" != no && break
4044         done
4045
4046 fi
4047
4048 echo "$as_me:4048: result: $cf_cv_sig_atomic_t" >&5
4049 echo "${ECHO_T}$cf_cv_sig_atomic_t" >&6
4050 test "$cf_cv_sig_atomic_t" != no &&
4051 cat >>confdefs.h <<EOF
4052 #define SIG_ATOMIC_T $cf_cv_sig_atomic_t
4053 EOF
4054
4055 # Work around breakage on OS X
4056
4057 echo "$as_me:4057: checking if SIGWINCH is defined" >&5
4058 echo $ECHO_N "checking if SIGWINCH is defined... $ECHO_C" >&6
4059 if test "${cf_cv_define_sigwinch+set}" = set; then
4060   echo $ECHO_N "(cached) $ECHO_C" >&6
4061 else
4062
4063         cat >conftest.$ac_ext <<_ACEOF
4064 #line 4064 "configure"
4065 #include "confdefs.h"
4066
4067 #include <sys/types.h>
4068 #include <sys/signal.h>
4069
4070 int
4071 main ()
4072 {
4073 int x = SIGWINCH
4074   ;
4075   return 0;
4076 }
4077 _ACEOF
4078 rm -f conftest.$ac_objext
4079 if { (eval echo "$as_me:4079: \"$ac_compile\"") >&5
4080   (eval $ac_compile) 2>&5
4081   ac_status=$?
4082   echo "$as_me:4082: \$? = $ac_status" >&5
4083   (exit $ac_status); } &&
4084          { ac_try='test -s conftest.$ac_objext'
4085   { (eval echo "$as_me:4085: \"$ac_try\"") >&5
4086   (eval $ac_try) 2>&5
4087   ac_status=$?
4088   echo "$as_me:4088: \$? = $ac_status" >&5
4089   (exit $ac_status); }; }; then
4090   cf_cv_define_sigwinch=yes
4091 else
4092   echo "$as_me: failed program was:" >&5
4093 cat conftest.$ac_ext >&5
4094 cat >conftest.$ac_ext <<_ACEOF
4095 #line 4095 "configure"
4096 #include "confdefs.h"
4097
4098 #undef _XOPEN_SOURCE
4099 #undef _POSIX_SOURCE
4100 #undef _POSIX_C_SOURCE
4101 #include <sys/types.h>
4102 #include <sys/signal.h>
4103
4104 int
4105 main ()
4106 {
4107 int x = SIGWINCH
4108   ;
4109   return 0;
4110 }
4111 _ACEOF
4112 rm -f conftest.$ac_objext
4113 if { (eval echo "$as_me:4113: \"$ac_compile\"") >&5
4114   (eval $ac_compile) 2>&5
4115   ac_status=$?
4116   echo "$as_me:4116: \$? = $ac_status" >&5
4117   (exit $ac_status); } &&
4118          { ac_try='test -s conftest.$ac_objext'
4119   { (eval echo "$as_me:4119: \"$ac_try\"") >&5
4120   (eval $ac_try) 2>&5
4121   ac_status=$?
4122   echo "$as_me:4122: \$? = $ac_status" >&5
4123   (exit $ac_status); }; }; then
4124   cf_cv_define_sigwinch=maybe
4125 else
4126   echo "$as_me: failed program was:" >&5
4127 cat conftest.$ac_ext >&5
4128 cf_cv_define_sigwinch=no
4129 fi
4130 rm -f conftest.$ac_objext conftest.$ac_ext
4131
4132 fi
4133 rm -f conftest.$ac_objext conftest.$ac_ext
4134
4135 fi
4136 echo "$as_me:4136: result: $cf_cv_define_sigwinch" >&5
4137 echo "${ECHO_T}$cf_cv_define_sigwinch" >&6
4138
4139 if test "$cf_cv_define_sigwinch" = maybe ; then
4140 echo "$as_me:4140: checking for actual SIGWINCH definition" >&5
4141 echo $ECHO_N "checking for actual SIGWINCH definition... $ECHO_C" >&6
4142 if test "${cf_cv_fixup_sigwinch+set}" = set; then
4143   echo $ECHO_N "(cached) $ECHO_C" >&6
4144 else
4145
4146 cf_cv_fixup_sigwinch=unknown
4147 cf_sigwinch=32
4148 while test $cf_sigwinch != 1
4149 do
4150         cat >conftest.$ac_ext <<_ACEOF
4151 #line 4151 "configure"
4152 #include "confdefs.h"
4153
4154 #undef _XOPEN_SOURCE
4155 #undef _POSIX_SOURCE
4156 #undef _POSIX_C_SOURCE
4157 #include <sys/types.h>
4158 #include <sys/signal.h>
4159
4160 int
4161 main ()
4162 {
4163
4164 #if SIGWINCH != $cf_sigwinch
4165 make an error
4166 #endif
4167 int x = SIGWINCH
4168   ;
4169   return 0;
4170 }
4171 _ACEOF
4172 rm -f conftest.$ac_objext
4173 if { (eval echo "$as_me:4173: \"$ac_compile\"") >&5
4174   (eval $ac_compile) 2>&5
4175   ac_status=$?
4176   echo "$as_me:4176: \$? = $ac_status" >&5
4177   (exit $ac_status); } &&
4178          { ac_try='test -s conftest.$ac_objext'
4179   { (eval echo "$as_me:4179: \"$ac_try\"") >&5
4180   (eval $ac_try) 2>&5
4181   ac_status=$?
4182   echo "$as_me:4182: \$? = $ac_status" >&5
4183   (exit $ac_status); }; }; then
4184   cf_cv_fixup_sigwinch=$cf_sigwinch
4185          break
4186 else
4187   echo "$as_me: failed program was:" >&5
4188 cat conftest.$ac_ext >&5
4189 fi
4190 rm -f conftest.$ac_objext conftest.$ac_ext
4191
4192 cf_sigwinch=`expr $cf_sigwinch - 1`
4193 done
4194
4195 fi
4196 echo "$as_me:4196: result: $cf_cv_fixup_sigwinch" >&5
4197 echo "${ECHO_T}$cf_cv_fixup_sigwinch" >&6
4198
4199         if test "$cf_cv_fixup_sigwinch" != unknown ; then
4200                 CPPFLAGS="$CPPFLAGS -DSIGWINCH=$cf_cv_fixup_sigwinch"
4201         fi
4202 fi
4203
4204 # Checks for CODESET support.
4205
4206 echo "$as_me:4206: checking for nl_langinfo and CODESET" >&5
4207 echo $ECHO_N "checking for nl_langinfo and CODESET... $ECHO_C" >&6
4208 if test "${am_cv_langinfo_codeset+set}" = set; then
4209   echo $ECHO_N "(cached) $ECHO_C" >&6
4210 else
4211   cat >conftest.$ac_ext <<_ACEOF
4212 #line 4212 "configure"
4213 #include "confdefs.h"
4214 #include <langinfo.h>
4215 int
4216 main ()
4217 {
4218 char* cs = nl_langinfo(CODESET);
4219   ;
4220   return 0;
4221 }
4222 _ACEOF
4223 rm -f conftest.$ac_objext conftest$ac_exeext
4224 if { (eval echo "$as_me:4224: \"$ac_link\"") >&5
4225   (eval $ac_link) 2>&5
4226   ac_status=$?
4227   echo "$as_me:4227: \$? = $ac_status" >&5
4228   (exit $ac_status); } &&
4229          { ac_try='test -s conftest$ac_exeext'
4230   { (eval echo "$as_me:4230: \"$ac_try\"") >&5
4231   (eval $ac_try) 2>&5
4232   ac_status=$?
4233   echo "$as_me:4233: \$? = $ac_status" >&5
4234   (exit $ac_status); }; }; then
4235   am_cv_langinfo_codeset=yes
4236 else
4237   echo "$as_me: failed program was:" >&5
4238 cat conftest.$ac_ext >&5
4239 am_cv_langinfo_codeset=no
4240 fi
4241 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4242
4243 fi
4244 echo "$as_me:4244: result: $am_cv_langinfo_codeset" >&5
4245 echo "${ECHO_T}$am_cv_langinfo_codeset" >&6
4246         if test $am_cv_langinfo_codeset = yes; then
4247
4248 cat >>confdefs.h <<\EOF
4249 #define HAVE_LANGINFO_CODESET 1
4250 EOF
4251
4252         fi
4253
4254 echo "$as_me:4254: checking if you want to use pkg-config" >&5
4255 echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6
4256
4257 # Check whether --with-pkg-config or --without-pkg-config was given.
4258 if test "${with_pkg_config+set}" = set; then
4259   withval="$with_pkg_config"
4260   cf_pkg_config=$withval
4261 else
4262   cf_pkg_config=yes
4263 fi;
4264 echo "$as_me:4264: result: $cf_pkg_config" >&5
4265 echo "${ECHO_T}$cf_pkg_config" >&6
4266
4267 case $cf_pkg_config in
4268 (no)
4269         PKG_CONFIG=none
4270         ;;
4271 (yes)
4272
4273 if test -n "$ac_tool_prefix"; then
4274   # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
4275 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
4276 echo "$as_me:4276: checking for $ac_word" >&5
4277 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4278 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
4279   echo $ECHO_N "(cached) $ECHO_C" >&6
4280 else
4281   case $PKG_CONFIG in
4282   [\\/]* | ?:[\\/]*)
4283   ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
4284   ;;
4285   *)
4286   ac_save_IFS=$IFS; IFS=$ac_path_separator
4287 ac_dummy="$PATH"
4288 for ac_dir in $ac_dummy; do
4289   IFS=$ac_save_IFS
4290   test -z "$ac_dir" && ac_dir=.
4291   if $as_executable_p "$ac_dir/$ac_word"; then
4292    ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
4293    echo "$as_me:4293: found $ac_dir/$ac_word" >&5
4294    break
4295 fi
4296 done
4297
4298   ;;
4299 esac
4300 fi
4301 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
4302
4303 if test -n "$PKG_CONFIG"; then
4304   echo "$as_me:4304: result: $PKG_CONFIG" >&5
4305 echo "${ECHO_T}$PKG_CONFIG" >&6
4306 else
4307   echo "$as_me:4307: result: no" >&5
4308 echo "${ECHO_T}no" >&6
4309 fi
4310
4311 fi
4312 if test -z "$ac_cv_path_PKG_CONFIG"; then
4313   ac_pt_PKG_CONFIG=$PKG_CONFIG
4314   # Extract the first word of "pkg-config", so it can be a program name with args.
4315 set dummy pkg-config; ac_word=$2
4316 echo "$as_me:4316: checking for $ac_word" >&5
4317 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4318 if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
4319   echo $ECHO_N "(cached) $ECHO_C" >&6
4320 else
4321   case $ac_pt_PKG_CONFIG in
4322   [\\/]* | ?:[\\/]*)
4323   ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
4324   ;;
4325   *)
4326   ac_save_IFS=$IFS; IFS=$ac_path_separator
4327 ac_dummy="$PATH"
4328 for ac_dir in $ac_dummy; do
4329   IFS=$ac_save_IFS
4330   test -z "$ac_dir" && ac_dir=.
4331   if $as_executable_p "$ac_dir/$ac_word"; then
4332    ac_cv_path_ac_pt_PKG_CONFIG="$ac_dir/$ac_word"
4333    echo "$as_me:4333: found $ac_dir/$ac_word" >&5
4334    break
4335 fi
4336 done
4337
4338   test -z "$ac_cv_path_ac_pt_PKG_CONFIG" && ac_cv_path_ac_pt_PKG_CONFIG="none"
4339   ;;
4340 esac
4341 fi
4342 ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
4343
4344 if test -n "$ac_pt_PKG_CONFIG"; then
4345   echo "$as_me:4345: result: $ac_pt_PKG_CONFIG" >&5
4346 echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
4347 else
4348   echo "$as_me:4348: result: no" >&5
4349 echo "${ECHO_T}no" >&6
4350 fi
4351
4352   PKG_CONFIG=$ac_pt_PKG_CONFIG
4353 else
4354   PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
4355 fi
4356
4357         ;;
4358 (*)
4359         PKG_CONFIG=$withval
4360         ;;
4361 esac
4362
4363 test -z "$PKG_CONFIG" && PKG_CONFIG=none
4364 if test "$PKG_CONFIG" != none ; then
4365
4366 if test "x$prefix" != xNONE; then
4367         cf_path_syntax="$prefix"
4368 else
4369         cf_path_syntax="$ac_default_prefix"
4370 fi
4371
4372 case ".$PKG_CONFIG" in
4373 (.\$\(*\)*|.\'*\'*)
4374         ;;
4375 (..|./*|.\\*)
4376         ;;
4377 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
4378         ;;
4379 (.\${*prefix}*|.\${*dir}*)
4380         eval PKG_CONFIG="$PKG_CONFIG"
4381         case ".$PKG_CONFIG" in
4382         (.NONE/*)
4383                 PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
4384                 ;;
4385         esac
4386         ;;
4387 (.no|.NONE/*)
4388         PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
4389         ;;
4390 (*)
4391         { { echo "$as_me:4391: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
4392 echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
4393    { (exit 1); exit 1; }; }
4394         ;;
4395 esac
4396
4397 elif test "x$cf_pkg_config" != xno ; then
4398         { echo "$as_me:4398: WARNING: pkg-config is not installed" >&5
4399 echo "$as_me: WARNING: pkg-config is not installed" >&2;}
4400 fi
4401
4402 echo "$as_me:4402: checking if you want to see long compiling messages" >&5
4403 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
4404
4405 # Check whether --enable-echo or --disable-echo was given.
4406 if test "${enable_echo+set}" = set; then
4407   enableval="$enable_echo"
4408   test "$enableval" != no && enableval=yes
4409         if test "$enableval" != "yes" ; then
4410
4411         ECHO_LT='--silent'
4412         ECHO_LD='@echo linking $@;'
4413         RULE_CC='@echo compiling $<'
4414         SHOW_CC='@echo compiling $@'
4415         ECHO_CC='@'
4416
4417         else
4418
4419         ECHO_LT=''
4420         ECHO_LD=''
4421         RULE_CC=''
4422         SHOW_CC=''
4423         ECHO_CC=''
4424
4425         fi
4426 else
4427   enableval=yes
4428
4429         ECHO_LT=''
4430         ECHO_LD=''
4431         RULE_CC=''
4432         SHOW_CC=''
4433         ECHO_CC=''
4434
4435 fi;
4436 echo "$as_me:4436: result: $enableval" >&5
4437 echo "${ECHO_T}$enableval" >&6
4438
4439 echo "$as_me:4439: checking for ncurses wrap-prefix" >&5
4440 echo $ECHO_N "checking for ncurses wrap-prefix... $ECHO_C" >&6
4441
4442 # Check whether --with-ncurses-wrap-prefix or --without-ncurses-wrap-prefix was given.
4443 if test "${with_ncurses_wrap_prefix+set}" = set; then
4444   withval="$with_ncurses_wrap_prefix"
4445   NCURSES_WRAP_PREFIX=$withval
4446 else
4447   NCURSES_WRAP_PREFIX=_nc_
4448 fi;
4449 echo "$as_me:4449: result: $NCURSES_WRAP_PREFIX" >&5
4450 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
4451
4452 echo "$as_me:4452: checking if you want to check for wide-character functions" >&5
4453 echo $ECHO_N "checking if you want to check for wide-character functions... $ECHO_C" >&6
4454
4455 # Check whether --enable-widec or --disable-widec was given.
4456 if test "${enable_widec+set}" = set; then
4457   enableval="$enable_widec"
4458   test "$enableval" != no && enableval=yes
4459         if test "$enableval" != "yes" ; then
4460     cf_enable_widec=no
4461         else
4462                 cf_enable_widec=yes
4463         fi
4464 else
4465   enableval=yes
4466         cf_enable_widec=yes
4467
4468 fi;
4469 echo "$as_me:4469: result: $cf_enable_widec" >&5
4470 echo "${ECHO_T}$cf_enable_widec" >&6
4471
4472 echo "$as_me:4472: checking for specific curses-directory" >&5
4473 echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
4474
4475 # Check whether --with-curses-dir or --without-curses-dir was given.
4476 if test "${with_curses_dir+set}" = set; then
4477   withval="$with_curses_dir"
4478   cf_cv_curses_dir=$withval
4479 else
4480   cf_cv_curses_dir=no
4481 fi;
4482 echo "$as_me:4482: result: $cf_cv_curses_dir" >&5
4483 echo "${ECHO_T}$cf_cv_curses_dir" >&6
4484
4485 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
4486 then
4487
4488 if test "x$prefix" != xNONE; then
4489         cf_path_syntax="$prefix"
4490 else
4491         cf_path_syntax="$ac_default_prefix"
4492 fi
4493
4494 case ".$withval" in
4495 (.\$\(*\)*|.\'*\'*)
4496         ;;
4497 (..|./*|.\\*)
4498         ;;
4499 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
4500         ;;
4501 (.\${*prefix}*|.\${*dir}*)
4502         eval withval="$withval"
4503         case ".$withval" in
4504         (.NONE/*)
4505                 withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
4506                 ;;
4507         esac
4508         ;;
4509 (.no|.NONE/*)
4510         withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
4511         ;;
4512 (*)
4513         { { echo "$as_me:4513: error: expected a pathname, not \"$withval\"" >&5
4514 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
4515    { (exit 1); exit 1; }; }
4516         ;;
4517 esac
4518
4519         if test -d "$cf_cv_curses_dir"
4520         then
4521
4522 if test -n "$cf_cv_curses_dir/include" ; then
4523   for cf_add_incdir in $cf_cv_curses_dir/include
4524   do
4525         while test $cf_add_incdir != /usr/include
4526         do
4527           if test -d $cf_add_incdir
4528           then
4529                 cf_have_incdir=no
4530                 if test -n "$CFLAGS$CPPFLAGS" ; then
4531                   # a loop is needed to ensure we can add subdirs of existing dirs
4532                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4533                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4534                           cf_have_incdir=yes; break
4535                         fi
4536                   done
4537                 fi
4538
4539                 if test "$cf_have_incdir" = no ; then
4540                   if test "$cf_add_incdir" = /usr/local/include ; then
4541                         if test "$GCC" = yes
4542                         then
4543                           cf_save_CPPFLAGS=$CPPFLAGS
4544                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4545                           cat >conftest.$ac_ext <<_ACEOF
4546 #line 4546 "configure"
4547 #include "confdefs.h"
4548 #include <stdio.h>
4549 int
4550 main ()
4551 {
4552 printf("Hello")
4553   ;
4554   return 0;
4555 }
4556 _ACEOF
4557 rm -f conftest.$ac_objext
4558 if { (eval echo "$as_me:4558: \"$ac_compile\"") >&5
4559   (eval $ac_compile) 2>&5
4560   ac_status=$?
4561   echo "$as_me:4561: \$? = $ac_status" >&5
4562   (exit $ac_status); } &&
4563          { ac_try='test -s conftest.$ac_objext'
4564   { (eval echo "$as_me:4564: \"$ac_try\"") >&5
4565   (eval $ac_try) 2>&5
4566   ac_status=$?
4567   echo "$as_me:4567: \$? = $ac_status" >&5
4568   (exit $ac_status); }; }; then
4569   :
4570 else
4571   echo "$as_me: failed program was:" >&5
4572 cat conftest.$ac_ext >&5
4573 cf_have_incdir=yes
4574 fi
4575 rm -f conftest.$ac_objext conftest.$ac_ext
4576                           CPPFLAGS=$cf_save_CPPFLAGS
4577                         fi
4578                   fi
4579                 fi
4580
4581                 if test "$cf_have_incdir" = no ; then
4582                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4583
4584 echo "${as_me:-configure}:4584: testing adding $cf_add_incdir to include-path ..." 1>&5
4585
4586                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4587
4588                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
4589                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4590                   cf_add_incdir="$cf_top_incdir"
4591                 else
4592                   break
4593                 fi
4594           else
4595                 break
4596           fi
4597         done
4598   done
4599 fi
4600
4601 if test -n "$cf_cv_curses_dir/lib" ; then
4602         for cf_add_libdir in $cf_cv_curses_dir/lib
4603         do
4604                 if test $cf_add_libdir = /usr/lib ; then
4605                         :
4606                 elif test -d $cf_add_libdir
4607                 then
4608                         cf_have_libdir=no
4609                         if test -n "$LDFLAGS$LIBS" ; then
4610                                 # a loop is needed to ensure we can add subdirs of existing dirs
4611                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
4612                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
4613                                                 cf_have_libdir=yes; break
4614                                         fi
4615                                 done
4616                         fi
4617                         if test "$cf_have_libdir" = no ; then
4618                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
4619
4620 echo "${as_me:-configure}:4620: testing adding $cf_add_libdir to library-path ..." 1>&5
4621
4622                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
4623                         fi
4624                 fi
4625         done
4626 fi
4627
4628         fi
4629 fi
4630
4631 cf_cv_screen=curses
4632
4633 echo "$as_me:4633: checking for specified curses library type" >&5
4634 echo $ECHO_N "checking for specified curses library type... $ECHO_C" >&6
4635
4636 # Check whether --with-screen or --without-screen was given.
4637 if test "${with_screen+set}" = set; then
4638   withval="$with_screen"
4639   cf_cv_screen=$withval
4640 else
4641
4642 # Check whether --with-ncursesw or --without-ncursesw was given.
4643 if test "${with_ncursesw+set}" = set; then
4644   withval="$with_ncursesw"
4645   cf_cv_screen=ncursesw
4646 else
4647
4648 # Check whether --with-ncurses or --without-ncurses was given.
4649 if test "${with_ncurses+set}" = set; then
4650   withval="$with_ncurses"
4651   cf_cv_screen=ncurses
4652 else
4653
4654 # Check whether --with-pdcurses or --without-pdcurses was given.
4655 if test "${with_pdcurses+set}" = set; then
4656   withval="$with_pdcurses"
4657   cf_cv_screen=pdcurses
4658 else
4659
4660 # Check whether --with-curses-colr or --without-curses-colr was given.
4661 if test "${with_curses_colr+set}" = set; then
4662   withval="$with_curses_colr"
4663   cf_cv_screen=curses_colr
4664 else
4665
4666 # Check whether --with-curses-5lib or --without-curses-5lib was given.
4667 if test "${with_curses_5lib+set}" = set; then
4668   withval="$with_curses_5lib"
4669   cf_cv_screen=curses_5lib
4670 fi;
4671 fi;
4672 fi;
4673 fi;
4674 fi;
4675 fi;
4676
4677 echo "$as_me:4677: result: $cf_cv_screen" >&5
4678 echo "${ECHO_T}$cf_cv_screen" >&6
4679
4680 case $cf_cv_screen in
4681 (curses|curses_*)
4682
4683 echo "$as_me:4683: checking for extra include directories" >&5
4684 echo $ECHO_N "checking for extra include directories... $ECHO_C" >&6
4685 if test "${cf_cv_curses_incdir+set}" = set; then
4686   echo $ECHO_N "(cached) $ECHO_C" >&6
4687 else
4688
4689 cf_cv_curses_incdir=no
4690 case $host_os in
4691 (hpux10.*)
4692         if test "x$cf_cv_screen" = "xcurses_colr"
4693         then
4694                 test -d /usr/include/curses_colr && \
4695                 cf_cv_curses_incdir="-I/usr/include/curses_colr"
4696         fi
4697         ;;
4698 (sunos3*|sunos4*)
4699         if test "x$cf_cv_screen" = "xcurses_5lib"
4700         then
4701                 test -d /usr/5lib && \
4702                 test -d /usr/5include && \
4703                 cf_cv_curses_incdir="-I/usr/5include"
4704         fi
4705         ;;
4706 esac
4707
4708 fi
4709 echo "$as_me:4709: result: $cf_cv_curses_incdir" >&5
4710 echo "${ECHO_T}$cf_cv_curses_incdir" >&6
4711 test "$cf_cv_curses_incdir" != no && CPPFLAGS="$CPPFLAGS $cf_cv_curses_incdir"
4712
4713 echo "$as_me:4713: checking if we have identified curses headers" >&5
4714 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
4715 if test "${cf_cv_ncurses_header+set}" = set; then
4716   echo $ECHO_N "(cached) $ECHO_C" >&6
4717 else
4718
4719 cf_cv_ncurses_header=none
4720 for cf_header in \
4721         ncurses.h  \
4722         curses.h  ncurses/ncurses.h ncurses/curses.h
4723 do
4724 cat >conftest.$ac_ext <<_ACEOF
4725 #line 4725 "configure"
4726 #include "confdefs.h"
4727 #include <${cf_header}>
4728 int
4729 main ()
4730 {
4731 initscr(); tgoto("?", 0,0)
4732   ;
4733   return 0;
4734 }
4735 _ACEOF
4736 rm -f conftest.$ac_objext
4737 if { (eval echo "$as_me:4737: \"$ac_compile\"") >&5
4738   (eval $ac_compile) 2>&5
4739   ac_status=$?
4740   echo "$as_me:4740: \$? = $ac_status" >&5
4741   (exit $ac_status); } &&
4742          { ac_try='test -s conftest.$ac_objext'
4743   { (eval echo "$as_me:4743: \"$ac_try\"") >&5
4744   (eval $ac_try) 2>&5
4745   ac_status=$?
4746   echo "$as_me:4746: \$? = $ac_status" >&5
4747   (exit $ac_status); }; }; then
4748   cf_cv_ncurses_header=$cf_header; break
4749 else
4750   echo "$as_me: failed program was:" >&5
4751 cat conftest.$ac_ext >&5
4752 fi
4753 rm -f conftest.$ac_objext conftest.$ac_ext
4754 done
4755
4756 fi
4757 echo "$as_me:4757: result: $cf_cv_ncurses_header" >&5
4758 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
4759
4760 if test "$cf_cv_ncurses_header" = none ; then
4761         { { echo "$as_me:4761: error: No curses header-files found" >&5
4762 echo "$as_me: error: No curses header-files found" >&2;}
4763    { (exit 1); exit 1; }; }
4764 fi
4765
4766 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
4767
4768 for ac_header in $cf_cv_ncurses_header
4769 do
4770 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
4771 echo "$as_me:4771: checking for $ac_header" >&5
4772 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
4773 if eval "test \"\${$as_ac_Header+set}\" = set"; then
4774   echo $ECHO_N "(cached) $ECHO_C" >&6
4775 else
4776   cat >conftest.$ac_ext <<_ACEOF
4777 #line 4777 "configure"
4778 #include "confdefs.h"
4779 #include <$ac_header>
4780 _ACEOF
4781 if { (eval echo "$as_me:4781: \"$ac_cpp conftest.$ac_ext\"") >&5
4782   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
4783   ac_status=$?
4784   egrep -v '^ *\+' conftest.er1 >conftest.err
4785   rm -f conftest.er1
4786   cat conftest.err >&5
4787   echo "$as_me:4787: \$? = $ac_status" >&5
4788   (exit $ac_status); } >/dev/null; then
4789   if test -s conftest.err; then
4790     ac_cpp_err=$ac_c_preproc_warn_flag
4791   else
4792     ac_cpp_err=
4793   fi
4794 else
4795   ac_cpp_err=yes
4796 fi
4797 if test -z "$ac_cpp_err"; then
4798   eval "$as_ac_Header=yes"
4799 else
4800   echo "$as_me: failed program was:" >&5
4801   cat conftest.$ac_ext >&5
4802   eval "$as_ac_Header=no"
4803 fi
4804 rm -f conftest.err conftest.$ac_ext
4805 fi
4806 echo "$as_me:4806: result: `eval echo '${'$as_ac_Header'}'`" >&5
4807 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
4808 if test `eval echo '${'$as_ac_Header'}'` = yes; then
4809   cat >>confdefs.h <<EOF
4810 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
4811 EOF
4812
4813 fi
4814 done
4815
4816 echo "$as_me:4816: checking for terminfo header" >&5
4817 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
4818 if test "${cf_cv_term_header+set}" = set; then
4819   echo $ECHO_N "(cached) $ECHO_C" >&6
4820 else
4821
4822 case ${cf_cv_ncurses_header} in
4823 (*/ncurses.h|*/ncursesw.h)
4824         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
4825         ;;
4826 (*)
4827         cf_term_header=term.h
4828         ;;
4829 esac
4830
4831 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
4832 do
4833 cat >conftest.$ac_ext <<_ACEOF
4834 #line 4834 "configure"
4835 #include "confdefs.h"
4836 #include <stdio.h>
4837 #include <${cf_cv_ncurses_header:-curses.h}>
4838 #include <$cf_test>
4839
4840 int
4841 main ()
4842 {
4843 int x = auto_left_margin
4844   ;
4845   return 0;
4846 }
4847 _ACEOF
4848 rm -f conftest.$ac_objext
4849 if { (eval echo "$as_me:4849: \"$ac_compile\"") >&5
4850   (eval $ac_compile) 2>&5
4851   ac_status=$?
4852   echo "$as_me:4852: \$? = $ac_status" >&5
4853   (exit $ac_status); } &&
4854          { ac_try='test -s conftest.$ac_objext'
4855   { (eval echo "$as_me:4855: \"$ac_try\"") >&5
4856   (eval $ac_try) 2>&5
4857   ac_status=$?
4858   echo "$as_me:4858: \$? = $ac_status" >&5
4859   (exit $ac_status); }; }; then
4860
4861         cf_cv_term_header="$cf_test"
4862 else
4863   echo "$as_me: failed program was:" >&5
4864 cat conftest.$ac_ext >&5
4865
4866         cf_cv_term_header=unknown
4867
4868 fi
4869 rm -f conftest.$ac_objext conftest.$ac_ext
4870         test "$cf_cv_term_header" != unknown && break
4871 done
4872
4873 fi
4874 echo "$as_me:4874: result: $cf_cv_term_header" >&5
4875 echo "${ECHO_T}$cf_cv_term_header" >&6
4876
4877 # Set definitions to allow ifdef'ing to accommodate subdirectories
4878
4879 case $cf_cv_term_header in
4880 (*term.h)
4881
4882 cat >>confdefs.h <<\EOF
4883 #define HAVE_TERM_H 1
4884 EOF
4885
4886         ;;
4887 esac
4888
4889 case $cf_cv_term_header in
4890 (ncurses/term.h)
4891
4892 cat >>confdefs.h <<\EOF
4893 #define HAVE_NCURSES_TERM_H 1
4894 EOF
4895
4896         ;;
4897 (ncursesw/term.h)
4898
4899 cat >>confdefs.h <<\EOF
4900 #define HAVE_NCURSESW_TERM_H 1
4901 EOF
4902
4903         ;;
4904 esac
4905
4906 echo "$as_me:4906: checking for ncurses version" >&5
4907 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
4908 if test "${cf_cv_ncurses_version+set}" = set; then
4909   echo $ECHO_N "(cached) $ECHO_C" >&6
4910 else
4911
4912         cf_cv_ncurses_version=no
4913         cf_tempfile=out$$
4914         rm -f $cf_tempfile
4915         if test "$cross_compiling" = yes; then
4916
4917         # This will not work if the preprocessor splits the line after the
4918         # Autoconf token.  The 'unproto' program does that.
4919         cat > conftest.$ac_ext <<EOF
4920 #include <${cf_cv_ncurses_header:-curses.h}>
4921 #undef Autoconf
4922 #ifdef NCURSES_VERSION
4923 Autoconf NCURSES_VERSION
4924 #else
4925 #ifdef __NCURSES_H
4926 Autoconf "old"
4927 #endif
4928 ;
4929 #endif
4930 EOF
4931         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
4932         { (eval echo "$as_me:4932: \"$cf_try\"") >&5
4933   (eval $cf_try) 2>&5
4934   ac_status=$?
4935   echo "$as_me:4935: \$? = $ac_status" >&5
4936   (exit $ac_status); }
4937         if test -f conftest.out ; then
4938                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
4939                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
4940                 rm -f conftest.out
4941         fi
4942
4943 else
4944   cat >conftest.$ac_ext <<_ACEOF
4945 #line 4945 "configure"
4946 #include "confdefs.h"
4947
4948 #include <${cf_cv_ncurses_header:-curses.h}>
4949 #include <stdio.h>
4950 int main()
4951 {
4952         FILE *fp = fopen("$cf_tempfile", "w");
4953 #ifdef NCURSES_VERSION
4954 # ifdef NCURSES_VERSION_PATCH
4955         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
4956 # else
4957         fprintf(fp, "%s\n", NCURSES_VERSION);
4958 # endif
4959 #else
4960 # ifdef __NCURSES_H
4961         fprintf(fp, "old\n");
4962 # else
4963         make an error
4964 # endif
4965 #endif
4966         ${cf_cv_main_return:-return}(0);
4967 }
4968 _ACEOF
4969 rm -f conftest$ac_exeext
4970 if { (eval echo "$as_me:4970: \"$ac_link\"") >&5
4971   (eval $ac_link) 2>&5
4972   ac_status=$?
4973   echo "$as_me:4973: \$? = $ac_status" >&5
4974   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
4975   { (eval echo "$as_me:4975: \"$ac_try\"") >&5
4976   (eval $ac_try) 2>&5
4977   ac_status=$?
4978   echo "$as_me:4978: \$? = $ac_status" >&5
4979   (exit $ac_status); }; }; then
4980
4981         cf_cv_ncurses_version=`cat $cf_tempfile`
4982 else
4983   echo "$as_me: program exited with status $ac_status" >&5
4984 echo "$as_me: failed program was:" >&5
4985 cat conftest.$ac_ext >&5
4986 fi
4987 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
4988 fi
4989         rm -f $cf_tempfile
4990
4991 fi
4992 echo "$as_me:4992: result: $cf_cv_ncurses_version" >&5
4993 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
4994 test "$cf_cv_ncurses_version" = no ||
4995 cat >>confdefs.h <<\EOF
4996 #define NCURSES 1
4997 EOF
4998
4999 echo "$as_me:4999: checking if we have identified curses libraries" >&5
5000 echo $ECHO_N "checking if we have identified curses libraries... $ECHO_C" >&6
5001 cat >conftest.$ac_ext <<_ACEOF
5002 #line 5002 "configure"
5003 #include "confdefs.h"
5004 #include <${cf_cv_ncurses_header:-curses.h}>
5005 int
5006 main ()
5007 {
5008 initscr(); tgoto("?", 0,0)
5009   ;
5010   return 0;
5011 }
5012 _ACEOF
5013 rm -f conftest.$ac_objext conftest$ac_exeext
5014 if { (eval echo "$as_me:5014: \"$ac_link\"") >&5
5015   (eval $ac_link) 2>&5
5016   ac_status=$?
5017   echo "$as_me:5017: \$? = $ac_status" >&5
5018   (exit $ac_status); } &&
5019          { ac_try='test -s conftest$ac_exeext'
5020   { (eval echo "$as_me:5020: \"$ac_try\"") >&5
5021   (eval $ac_try) 2>&5
5022   ac_status=$?
5023   echo "$as_me:5023: \$? = $ac_status" >&5
5024   (exit $ac_status); }; }; then
5025   cf_result=yes
5026 else
5027   echo "$as_me: failed program was:" >&5
5028 cat conftest.$ac_ext >&5
5029 cf_result=no
5030 fi
5031 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5032 echo "$as_me:5032: result: $cf_result" >&5
5033 echo "${ECHO_T}$cf_result" >&6
5034
5035 if test "$cf_result" = no ; then
5036 case $host_os in
5037 (freebsd*)
5038         echo "$as_me:5038: checking for tgoto in -lmytinfo" >&5
5039 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
5040 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
5041   echo $ECHO_N "(cached) $ECHO_C" >&6
5042 else
5043   ac_check_lib_save_LIBS=$LIBS
5044 LIBS="-lmytinfo  $LIBS"
5045 cat >conftest.$ac_ext <<_ACEOF
5046 #line 5046 "configure"
5047 #include "confdefs.h"
5048
5049 /* Override any gcc2 internal prototype to avoid an error.  */
5050 #ifdef __cplusplus
5051 extern "C"
5052 #endif
5053 /* We use char because int might match the return type of a gcc2
5054    builtin and then its argument prototype would still apply.  */
5055 char tgoto ();
5056 int
5057 main ()
5058 {
5059 tgoto ();
5060   ;
5061   return 0;
5062 }
5063 _ACEOF
5064 rm -f conftest.$ac_objext conftest$ac_exeext
5065 if { (eval echo "$as_me:5065: \"$ac_link\"") >&5
5066   (eval $ac_link) 2>&5
5067   ac_status=$?
5068   echo "$as_me:5068: \$? = $ac_status" >&5
5069   (exit $ac_status); } &&
5070          { ac_try='test -s conftest$ac_exeext'
5071   { (eval echo "$as_me:5071: \"$ac_try\"") >&5
5072   (eval $ac_try) 2>&5
5073   ac_status=$?
5074   echo "$as_me:5074: \$? = $ac_status" >&5
5075   (exit $ac_status); }; }; then
5076   ac_cv_lib_mytinfo_tgoto=yes
5077 else
5078   echo "$as_me: failed program was:" >&5
5079 cat conftest.$ac_ext >&5
5080 ac_cv_lib_mytinfo_tgoto=no
5081 fi
5082 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5083 LIBS=$ac_check_lib_save_LIBS
5084 fi
5085 echo "$as_me:5085: result: $ac_cv_lib_mytinfo_tgoto" >&5
5086 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
5087 if test $ac_cv_lib_mytinfo_tgoto = yes; then
5088
5089 cf_add_libs="-lmytinfo"
5090 # Filter out duplicates - this happens with badly-designed ".pc" files...
5091 for cf_add_1lib in $LIBS
5092 do
5093         for cf_add_2lib in $cf_add_libs
5094         do
5095                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5096                 then
5097                         cf_add_1lib=
5098                         break
5099                 fi
5100         done
5101         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5102 done
5103 LIBS="$cf_add_libs"
5104
5105 fi
5106
5107         ;;
5108 (hpux10.*)
5109         # Looking at HPUX 10.20, the Hcurses library is the oldest (1997), cur_colr
5110         # next (1998), and xcurses "newer" (2000).  There is no header file for
5111         # Hcurses; the subdirectory curses_colr has the headers (curses.h and
5112         # term.h) for cur_colr
5113         if test "x$cf_cv_screen" = "xcurses_colr"
5114         then
5115                 echo "$as_me:5115: checking for initscr in -lcur_colr" >&5
5116 echo $ECHO_N "checking for initscr in -lcur_colr... $ECHO_C" >&6
5117 if test "${ac_cv_lib_cur_colr_initscr+set}" = set; then
5118   echo $ECHO_N "(cached) $ECHO_C" >&6
5119 else
5120   ac_check_lib_save_LIBS=$LIBS
5121 LIBS="-lcur_colr  $LIBS"
5122 cat >conftest.$ac_ext <<_ACEOF
5123 #line 5123 "configure"
5124 #include "confdefs.h"
5125
5126 /* Override any gcc2 internal prototype to avoid an error.  */
5127 #ifdef __cplusplus
5128 extern "C"
5129 #endif
5130 /* We use char because int might match the return type of a gcc2
5131    builtin and then its argument prototype would still apply.  */
5132 char initscr ();
5133 int
5134 main ()
5135 {
5136 initscr ();
5137   ;
5138   return 0;
5139 }
5140 _ACEOF
5141 rm -f conftest.$ac_objext conftest$ac_exeext
5142 if { (eval echo "$as_me:5142: \"$ac_link\"") >&5
5143   (eval $ac_link) 2>&5
5144   ac_status=$?
5145   echo "$as_me:5145: \$? = $ac_status" >&5
5146   (exit $ac_status); } &&
5147          { ac_try='test -s conftest$ac_exeext'
5148   { (eval echo "$as_me:5148: \"$ac_try\"") >&5
5149   (eval $ac_try) 2>&5
5150   ac_status=$?
5151   echo "$as_me:5151: \$? = $ac_status" >&5
5152   (exit $ac_status); }; }; then
5153   ac_cv_lib_cur_colr_initscr=yes
5154 else
5155   echo "$as_me: failed program was:" >&5
5156 cat conftest.$ac_ext >&5
5157 ac_cv_lib_cur_colr_initscr=no
5158 fi
5159 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5160 LIBS=$ac_check_lib_save_LIBS
5161 fi
5162 echo "$as_me:5162: result: $ac_cv_lib_cur_colr_initscr" >&5
5163 echo "${ECHO_T}$ac_cv_lib_cur_colr_initscr" >&6
5164 if test $ac_cv_lib_cur_colr_initscr = yes; then
5165
5166 cf_add_libs="-lcur_colr"
5167 # Filter out duplicates - this happens with badly-designed ".pc" files...
5168 for cf_add_1lib in $LIBS
5169 do
5170         for cf_add_2lib in $cf_add_libs
5171         do
5172                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5173                 then
5174                         cf_add_1lib=
5175                         break
5176                 fi
5177         done
5178         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5179 done
5180 LIBS="$cf_add_libs"
5181
5182                         ac_cv_func_initscr=yes
5183
5184 else
5185
5186                 echo "$as_me:5186: checking for initscr in -lHcurses" >&5
5187 echo $ECHO_N "checking for initscr in -lHcurses... $ECHO_C" >&6
5188 if test "${ac_cv_lib_Hcurses_initscr+set}" = set; then
5189   echo $ECHO_N "(cached) $ECHO_C" >&6
5190 else
5191   ac_check_lib_save_LIBS=$LIBS
5192 LIBS="-lHcurses  $LIBS"
5193 cat >conftest.$ac_ext <<_ACEOF
5194 #line 5194 "configure"
5195 #include "confdefs.h"
5196
5197 /* Override any gcc2 internal prototype to avoid an error.  */
5198 #ifdef __cplusplus
5199 extern "C"
5200 #endif
5201 /* We use char because int might match the return type of a gcc2
5202    builtin and then its argument prototype would still apply.  */
5203 char initscr ();
5204 int
5205 main ()
5206 {
5207 initscr ();
5208   ;
5209   return 0;
5210 }
5211 _ACEOF
5212 rm -f conftest.$ac_objext conftest$ac_exeext
5213 if { (eval echo "$as_me:5213: \"$ac_link\"") >&5
5214   (eval $ac_link) 2>&5
5215   ac_status=$?
5216   echo "$as_me:5216: \$? = $ac_status" >&5
5217   (exit $ac_status); } &&
5218          { ac_try='test -s conftest$ac_exeext'
5219   { (eval echo "$as_me:5219: \"$ac_try\"") >&5
5220   (eval $ac_try) 2>&5
5221   ac_status=$?
5222   echo "$as_me:5222: \$? = $ac_status" >&5
5223   (exit $ac_status); }; }; then
5224   ac_cv_lib_Hcurses_initscr=yes
5225 else
5226   echo "$as_me: failed program was:" >&5
5227 cat conftest.$ac_ext >&5
5228 ac_cv_lib_Hcurses_initscr=no
5229 fi
5230 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5231 LIBS=$ac_check_lib_save_LIBS
5232 fi
5233 echo "$as_me:5233: result: $ac_cv_lib_Hcurses_initscr" >&5
5234 echo "${ECHO_T}$ac_cv_lib_Hcurses_initscr" >&6
5235 if test $ac_cv_lib_Hcurses_initscr = yes; then
5236
5237                         # HP's header uses __HP_CURSES, but user claims _HP_CURSES.
5238
5239 cf_add_libs="-lHcurses"
5240 # Filter out duplicates - this happens with badly-designed ".pc" files...
5241 for cf_add_1lib in $LIBS
5242 do
5243         for cf_add_2lib in $cf_add_libs
5244         do
5245                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5246                 then
5247                         cf_add_1lib=
5248                         break
5249                 fi
5250         done
5251         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5252 done
5253 LIBS="$cf_add_libs"
5254
5255                         CPPFLAGS="$CPPFLAGS -D__HP_CURSES -D_HP_CURSES"
5256                         ac_cv_func_initscr=yes
5257
5258 fi
5259
5260 fi
5261
5262         fi
5263         ;;
5264 (linux*)
5265         case `arch 2>/dev/null` in
5266         (x86_64)
5267                 if test -d /lib64
5268                 then
5269
5270 if test -n "/lib64" ; then
5271         for cf_add_libdir in /lib64
5272         do
5273                 if test $cf_add_libdir = /usr/lib ; then
5274                         :
5275                 elif test -d $cf_add_libdir
5276                 then
5277                         cf_have_libdir=no
5278                         if test -n "$LDFLAGS$LIBS" ; then
5279                                 # a loop is needed to ensure we can add subdirs of existing dirs
5280                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
5281                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5282                                                 cf_have_libdir=yes; break
5283                                         fi
5284                                 done
5285                         fi
5286                         if test "$cf_have_libdir" = no ; then
5287                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5288
5289 echo "${as_me:-configure}:5289: testing adding $cf_add_libdir to library-path ..." 1>&5
5290
5291                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5292                         fi
5293                 fi
5294         done
5295 fi
5296
5297                 else
5298
5299 if test -n "/lib" ; then
5300         for cf_add_libdir in /lib
5301         do
5302                 if test $cf_add_libdir = /usr/lib ; then
5303                         :
5304                 elif test -d $cf_add_libdir
5305                 then
5306                         cf_have_libdir=no
5307                         if test -n "$LDFLAGS$LIBS" ; then
5308                                 # a loop is needed to ensure we can add subdirs of existing dirs
5309                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
5310                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5311                                                 cf_have_libdir=yes; break
5312                                         fi
5313                                 done
5314                         fi
5315                         if test "$cf_have_libdir" = no ; then
5316                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5317
5318 echo "${as_me:-configure}:5318: testing adding $cf_add_libdir to library-path ..." 1>&5
5319
5320                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5321                         fi
5322                 fi
5323         done
5324 fi
5325
5326                 fi
5327                 ;;
5328         (*)
5329
5330 if test -n "/lib" ; then
5331         for cf_add_libdir in /lib
5332         do
5333                 if test $cf_add_libdir = /usr/lib ; then
5334                         :
5335                 elif test -d $cf_add_libdir
5336                 then
5337                         cf_have_libdir=no
5338                         if test -n "$LDFLAGS$LIBS" ; then
5339                                 # a loop is needed to ensure we can add subdirs of existing dirs
5340                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
5341                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5342                                                 cf_have_libdir=yes; break
5343                                         fi
5344                                 done
5345                         fi
5346                         if test "$cf_have_libdir" = no ; then
5347                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5348
5349 echo "${as_me:-configure}:5349: testing adding $cf_add_libdir to library-path ..." 1>&5
5350
5351                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5352                         fi
5353                 fi
5354         done
5355 fi
5356
5357                 ;;
5358         esac
5359         ;;
5360 (sunos3*|sunos4*)
5361         if test "x$cf_cv_screen" = "xcurses_5lib"
5362         then
5363                 if test -d /usr/5lib ; then
5364
5365 if test -n "/usr/5lib" ; then
5366         for cf_add_libdir in /usr/5lib
5367         do
5368                 if test $cf_add_libdir = /usr/lib ; then
5369                         :
5370                 elif test -d $cf_add_libdir
5371                 then
5372                         cf_have_libdir=no
5373                         if test -n "$LDFLAGS$LIBS" ; then
5374                                 # a loop is needed to ensure we can add subdirs of existing dirs
5375                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
5376                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5377                                                 cf_have_libdir=yes; break
5378                                         fi
5379                                 done
5380                         fi
5381                         if test "$cf_have_libdir" = no ; then
5382                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5383
5384 echo "${as_me:-configure}:5384: testing adding $cf_add_libdir to library-path ..." 1>&5
5385
5386                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5387                         fi
5388                 fi
5389         done
5390 fi
5391
5392 cf_add_libs="-lcurses -ltermcap"
5393 # Filter out duplicates - this happens with badly-designed ".pc" files...
5394 for cf_add_1lib in $LIBS
5395 do
5396         for cf_add_2lib in $cf_add_libs
5397         do
5398                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5399                 then
5400                         cf_add_1lib=
5401                         break
5402                 fi
5403         done
5404         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5405 done
5406 LIBS="$cf_add_libs"
5407
5408                 fi
5409         fi
5410         ac_cv_func_initscr=yes
5411         ;;
5412 esac
5413
5414 if test ".$ac_cv_func_initscr" != .yes ; then
5415         cf_save_LIBS="$LIBS"
5416
5417         if test ".${cf_cv_ncurses_version:-no}" != .no
5418         then
5419                 cf_check_list="ncurses curses cursesX"
5420         else
5421                 cf_check_list="cursesX curses ncurses"
5422         fi
5423
5424         # Check for library containing tgoto.  Do this before curses library
5425         # because it may be needed to link the test-case for initscr.
5426         if test "x$cf_term_lib" = x
5427         then
5428                 echo "$as_me:5428: checking for tgoto" >&5
5429 echo $ECHO_N "checking for tgoto... $ECHO_C" >&6
5430 if test "${ac_cv_func_tgoto+set}" = set; then
5431   echo $ECHO_N "(cached) $ECHO_C" >&6
5432 else
5433   cat >conftest.$ac_ext <<_ACEOF
5434 #line 5434 "configure"
5435 #include "confdefs.h"
5436 /* System header to define __stub macros and hopefully few prototypes,
5437     which can conflict with char tgoto (); below.  */
5438 #include <assert.h>
5439 /* Override any gcc2 internal prototype to avoid an error.  */
5440 #ifdef __cplusplus
5441 extern "C"
5442 #endif
5443 /* We use char because int might match the return type of a gcc2
5444    builtin and then its argument prototype would still apply.  */
5445 char tgoto ();
5446 char (*f) ();
5447
5448 int
5449 main ()
5450 {
5451 /* The GNU C library defines this for functions which it implements
5452     to always fail with ENOSYS.  Some functions are actually named
5453     something starting with __ and the normal name is an alias.  */
5454 #if defined (__stub_tgoto) || defined (__stub___tgoto)
5455 choke me
5456 #else
5457 f = tgoto; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
5458 #endif
5459
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   ac_cv_func_tgoto=yes
5477 else
5478   echo "$as_me: failed program was:" >&5
5479 cat conftest.$ac_ext >&5
5480 ac_cv_func_tgoto=no
5481 fi
5482 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5483 fi
5484 echo "$as_me:5484: result: $ac_cv_func_tgoto" >&5
5485 echo "${ECHO_T}$ac_cv_func_tgoto" >&6
5486 if test $ac_cv_func_tgoto = yes; then
5487   cf_term_lib=predefined
5488 else
5489
5490                         for cf_term_lib in $cf_check_list otermcap termcap tinfo termlib unknown
5491                         do
5492                                 as_ac_Lib=`echo "ac_cv_lib_$cf_term_lib''_tgoto" | $as_tr_sh`
5493 echo "$as_me:5493: checking for tgoto in -l$cf_term_lib" >&5
5494 echo $ECHO_N "checking for tgoto in -l$cf_term_lib... $ECHO_C" >&6
5495 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
5496   echo $ECHO_N "(cached) $ECHO_C" >&6
5497 else
5498   ac_check_lib_save_LIBS=$LIBS
5499 LIBS="-l$cf_term_lib  $LIBS"
5500 cat >conftest.$ac_ext <<_ACEOF
5501 #line 5501 "configure"
5502 #include "confdefs.h"
5503
5504 /* Override any gcc2 internal prototype to avoid an error.  */
5505 #ifdef __cplusplus
5506 extern "C"
5507 #endif
5508 /* We use char because int might match the return type of a gcc2
5509    builtin and then its argument prototype would still apply.  */
5510 char tgoto ();
5511 int
5512 main ()
5513 {
5514 tgoto ();
5515   ;
5516   return 0;
5517 }
5518 _ACEOF
5519 rm -f conftest.$ac_objext conftest$ac_exeext
5520 if { (eval echo "$as_me:5520: \"$ac_link\"") >&5
5521   (eval $ac_link) 2>&5
5522   ac_status=$?
5523   echo "$as_me:5523: \$? = $ac_status" >&5
5524   (exit $ac_status); } &&
5525          { ac_try='test -s conftest$ac_exeext'
5526   { (eval echo "$as_me:5526: \"$ac_try\"") >&5
5527   (eval $ac_try) 2>&5
5528   ac_status=$?
5529   echo "$as_me:5529: \$? = $ac_status" >&5
5530   (exit $ac_status); }; }; then
5531   eval "$as_ac_Lib=yes"
5532 else
5533   echo "$as_me: failed program was:" >&5
5534 cat conftest.$ac_ext >&5
5535 eval "$as_ac_Lib=no"
5536 fi
5537 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5538 LIBS=$ac_check_lib_save_LIBS
5539 fi
5540 echo "$as_me:5540: result: `eval echo '${'$as_ac_Lib'}'`" >&5
5541 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
5542 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
5543   break
5544 fi
5545
5546                         done
5547
5548 fi
5549
5550         fi
5551
5552         # Check for library containing initscr
5553         test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS"
5554         if test "x$cf_curs_lib" = x
5555         then
5556                 for cf_curs_lib in $cf_check_list xcurses jcurses pdcurses unknown
5557                 do
5558                         as_ac_Lib=`echo "ac_cv_lib_$cf_curs_lib''_initscr" | $as_tr_sh`
5559 echo "$as_me:5559: checking for initscr in -l$cf_curs_lib" >&5
5560 echo $ECHO_N "checking for initscr in -l$cf_curs_lib... $ECHO_C" >&6
5561 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
5562   echo $ECHO_N "(cached) $ECHO_C" >&6
5563 else
5564   ac_check_lib_save_LIBS=$LIBS
5565 LIBS="-l$cf_curs_lib  $LIBS"
5566 cat >conftest.$ac_ext <<_ACEOF
5567 #line 5567 "configure"
5568 #include "confdefs.h"
5569
5570 /* Override any gcc2 internal prototype to avoid an error.  */
5571 #ifdef __cplusplus
5572 extern "C"
5573 #endif
5574 /* We use char because int might match the return type of a gcc2
5575    builtin and then its argument prototype would still apply.  */
5576 char initscr ();
5577 int
5578 main ()
5579 {
5580 initscr ();
5581   ;
5582   return 0;
5583 }
5584 _ACEOF
5585 rm -f conftest.$ac_objext conftest$ac_exeext
5586 if { (eval echo "$as_me:5586: \"$ac_link\"") >&5
5587   (eval $ac_link) 2>&5
5588   ac_status=$?
5589   echo "$as_me:5589: \$? = $ac_status" >&5
5590   (exit $ac_status); } &&
5591          { ac_try='test -s conftest$ac_exeext'
5592   { (eval echo "$as_me:5592: \"$ac_try\"") >&5
5593   (eval $ac_try) 2>&5
5594   ac_status=$?
5595   echo "$as_me:5595: \$? = $ac_status" >&5
5596   (exit $ac_status); }; }; then
5597   eval "$as_ac_Lib=yes"
5598 else
5599   echo "$as_me: failed program was:" >&5
5600 cat conftest.$ac_ext >&5
5601 eval "$as_ac_Lib=no"
5602 fi
5603 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5604 LIBS=$ac_check_lib_save_LIBS
5605 fi
5606 echo "$as_me:5606: result: `eval echo '${'$as_ac_Lib'}'`" >&5
5607 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
5608 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
5609   break
5610 fi
5611
5612                 done
5613         fi
5614         test $cf_curs_lib = unknown && { { echo "$as_me:5614: error: no curses library found" >&5
5615 echo "$as_me: error: no curses library found" >&2;}
5616    { (exit 1); exit 1; }; }
5617
5618         LIBS="-l$cf_curs_lib $cf_save_LIBS"
5619         if test "$cf_term_lib" = unknown ; then
5620                 echo "$as_me:5620: checking if we can link with $cf_curs_lib library" >&5
5621 echo $ECHO_N "checking if we can link with $cf_curs_lib library... $ECHO_C" >&6
5622                 cat >conftest.$ac_ext <<_ACEOF
5623 #line 5623 "configure"
5624 #include "confdefs.h"
5625 #include <${cf_cv_ncurses_header:-curses.h}>
5626 int
5627 main ()
5628 {
5629 initscr()
5630   ;
5631   return 0;
5632 }
5633 _ACEOF
5634 rm -f conftest.$ac_objext conftest$ac_exeext
5635 if { (eval echo "$as_me:5635: \"$ac_link\"") >&5
5636   (eval $ac_link) 2>&5
5637   ac_status=$?
5638   echo "$as_me:5638: \$? = $ac_status" >&5
5639   (exit $ac_status); } &&
5640          { ac_try='test -s conftest$ac_exeext'
5641   { (eval echo "$as_me:5641: \"$ac_try\"") >&5
5642   (eval $ac_try) 2>&5
5643   ac_status=$?
5644   echo "$as_me:5644: \$? = $ac_status" >&5
5645   (exit $ac_status); }; }; then
5646   cf_result=yes
5647 else
5648   echo "$as_me: failed program was:" >&5
5649 cat conftest.$ac_ext >&5
5650 cf_result=no
5651 fi
5652 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5653                 echo "$as_me:5653: result: $cf_result" >&5
5654 echo "${ECHO_T}$cf_result" >&6
5655                 test $cf_result = no && { { echo "$as_me:5655: error: Cannot link curses library" >&5
5656 echo "$as_me: error: Cannot link curses library" >&2;}
5657    { (exit 1); exit 1; }; }
5658         elif test "$cf_curs_lib" = "$cf_term_lib" ; then
5659                 :
5660         elif test "$cf_term_lib" != predefined ; then
5661                 echo "$as_me:5661: checking if we need both $cf_curs_lib and $cf_term_lib libraries" >&5
5662 echo $ECHO_N "checking if we need both $cf_curs_lib and $cf_term_lib libraries... $ECHO_C" >&6
5663                 cat >conftest.$ac_ext <<_ACEOF
5664 #line 5664 "configure"
5665 #include "confdefs.h"
5666 #include <${cf_cv_ncurses_header:-curses.h}>
5667 int
5668 main ()
5669 {
5670 initscr(); tgoto((char *)0, 0, 0);
5671   ;
5672   return 0;
5673 }
5674 _ACEOF
5675 rm -f conftest.$ac_objext conftest$ac_exeext
5676 if { (eval echo "$as_me:5676: \"$ac_link\"") >&5
5677   (eval $ac_link) 2>&5
5678   ac_status=$?
5679   echo "$as_me:5679: \$? = $ac_status" >&5
5680   (exit $ac_status); } &&
5681          { ac_try='test -s conftest$ac_exeext'
5682   { (eval echo "$as_me:5682: \"$ac_try\"") >&5
5683   (eval $ac_try) 2>&5
5684   ac_status=$?
5685   echo "$as_me:5685: \$? = $ac_status" >&5
5686   (exit $ac_status); }; }; then
5687   cf_result=no
5688 else
5689   echo "$as_me: failed program was:" >&5
5690 cat conftest.$ac_ext >&5
5691
5692                         LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
5693                         cat >conftest.$ac_ext <<_ACEOF
5694 #line 5694 "configure"
5695 #include "confdefs.h"
5696 #include <${cf_cv_ncurses_header:-curses.h}>
5697 int
5698 main ()
5699 {
5700 initscr()
5701   ;
5702   return 0;
5703 }
5704 _ACEOF
5705 rm -f conftest.$ac_objext conftest$ac_exeext
5706 if { (eval echo "$as_me:5706: \"$ac_link\"") >&5
5707   (eval $ac_link) 2>&5
5708   ac_status=$?
5709   echo "$as_me:5709: \$? = $ac_status" >&5
5710   (exit $ac_status); } &&
5711          { ac_try='test -s conftest$ac_exeext'
5712   { (eval echo "$as_me:5712: \"$ac_try\"") >&5
5713   (eval $ac_try) 2>&5
5714   ac_status=$?
5715   echo "$as_me:5715: \$? = $ac_status" >&5
5716   (exit $ac_status); }; }; then
5717   cf_result=yes
5718 else
5719   echo "$as_me: failed program was:" >&5
5720 cat conftest.$ac_ext >&5
5721 cf_result=error
5722 fi
5723 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5724
5725 fi
5726 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5727                 echo "$as_me:5727: result: $cf_result" >&5
5728 echo "${ECHO_T}$cf_result" >&6
5729         fi
5730 fi
5731 fi
5732
5733         ;;
5734 (ncursesw*)
5735
5736 echo "$as_me:5736: checking for multibyte character support" >&5
5737 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
5738 if test "${cf_cv_utf8_lib+set}" = set; then
5739   echo $ECHO_N "(cached) $ECHO_C" >&6
5740 else
5741
5742         cf_save_LIBS="$LIBS"
5743         cat >conftest.$ac_ext <<_ACEOF
5744 #line 5744 "configure"
5745 #include "confdefs.h"
5746
5747 #include <stdlib.h>
5748 int
5749 main ()
5750 {
5751 putwc(0,0);
5752   ;
5753   return 0;
5754 }
5755 _ACEOF
5756 rm -f conftest.$ac_objext conftest$ac_exeext
5757 if { (eval echo "$as_me:5757: \"$ac_link\"") >&5
5758   (eval $ac_link) 2>&5
5759   ac_status=$?
5760   echo "$as_me:5760: \$? = $ac_status" >&5
5761   (exit $ac_status); } &&
5762          { ac_try='test -s conftest$ac_exeext'
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   cf_cv_utf8_lib=yes
5769 else
5770   echo "$as_me: failed program was:" >&5
5771 cat conftest.$ac_ext >&5
5772
5773 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
5774 # will be set on completion of the AC_TRY_LINK below.
5775 cf_cv_header_path_utf8=
5776 cf_cv_library_path_utf8=
5777
5778 echo "${as_me:-configure}:5778: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
5779
5780 cf_save_LIBS="$LIBS"
5781
5782 cat >conftest.$ac_ext <<_ACEOF
5783 #line 5783 "configure"
5784 #include "confdefs.h"
5785
5786 #include <libutf8.h>
5787 int
5788 main ()
5789 {
5790 putwc(0,0);
5791   ;
5792   return 0;
5793 }
5794 _ACEOF
5795 rm -f conftest.$ac_objext conftest$ac_exeext
5796 if { (eval echo "$as_me:5796: \"$ac_link\"") >&5
5797   (eval $ac_link) 2>&5
5798   ac_status=$?
5799   echo "$as_me:5799: \$? = $ac_status" >&5
5800   (exit $ac_status); } &&
5801          { ac_try='test -s conftest$ac_exeext'
5802   { (eval echo "$as_me:5802: \"$ac_try\"") >&5
5803   (eval $ac_try) 2>&5
5804   ac_status=$?
5805   echo "$as_me:5805: \$? = $ac_status" >&5
5806   (exit $ac_status); }; }; then
5807
5808         cf_cv_find_linkage_utf8=yes
5809         cf_cv_header_path_utf8=/usr/include
5810         cf_cv_library_path_utf8=/usr/lib
5811
5812 else
5813   echo "$as_me: failed program was:" >&5
5814 cat conftest.$ac_ext >&5
5815
5816 LIBS="-lutf8  $cf_save_LIBS"
5817
5818 cat >conftest.$ac_ext <<_ACEOF
5819 #line 5819 "configure"
5820 #include "confdefs.h"
5821
5822 #include <libutf8.h>
5823 int
5824 main ()
5825 {
5826 putwc(0,0);
5827   ;
5828   return 0;
5829 }
5830 _ACEOF
5831 rm -f conftest.$ac_objext conftest$ac_exeext
5832 if { (eval echo "$as_me:5832: \"$ac_link\"") >&5
5833   (eval $ac_link) 2>&5
5834   ac_status=$?
5835   echo "$as_me:5835: \$? = $ac_status" >&5
5836   (exit $ac_status); } &&
5837          { ac_try='test -s conftest$ac_exeext'
5838   { (eval echo "$as_me:5838: \"$ac_try\"") >&5
5839   (eval $ac_try) 2>&5
5840   ac_status=$?
5841   echo "$as_me:5841: \$? = $ac_status" >&5
5842   (exit $ac_status); }; }; then
5843
5844         cf_cv_find_linkage_utf8=yes
5845         cf_cv_header_path_utf8=/usr/include
5846         cf_cv_library_path_utf8=/usr/lib
5847         cf_cv_library_file_utf8="-lutf8"
5848
5849 else
5850   echo "$as_me: failed program was:" >&5
5851 cat conftest.$ac_ext >&5
5852
5853         cf_cv_find_linkage_utf8=no
5854         LIBS="$cf_save_LIBS"
5855
5856         test -n "$verbose" && echo "    find linkage for utf8 library" 1>&6
5857
5858 echo "${as_me:-configure}:5858: testing find linkage for utf8 library ..." 1>&5
5859
5860 echo "${as_me:-configure}:5860: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
5861
5862         cf_save_CPPFLAGS="$CPPFLAGS"
5863         cf_test_CPPFLAGS="$CPPFLAGS"
5864
5865 cf_search=
5866
5867 # collect the current set of include-directories from compiler flags
5868 cf_header_path_list=""
5869 if test -n "${CFLAGS}${CPPFLAGS}" ; then
5870         for cf_header_path in $CPPFLAGS $CFLAGS
5871         do
5872                 case $cf_header_path in
5873                 (-I*)
5874                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
5875
5876 test "x$cf_header_path" != "xNONE" && \
5877 test -d "$cf_header_path" && \
5878  {
5879         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
5880         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
5881         test -d $cf_header_path/include/utf8 &&       cf_search="$cf_search $cf_header_path/include/utf8"
5882         test -d $cf_header_path/include/utf8/include &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
5883         test -d $cf_header_path/utf8/include &&       cf_search="$cf_search $cf_header_path/utf8/include"
5884         test -d $cf_header_path/utf8/include/utf8 &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
5885 }
5886
5887                         cf_header_path_list="$cf_header_path_list $cf_search"
5888                         ;;
5889                 esac
5890         done
5891 fi
5892
5893 # add the variations for the package we are looking for
5894
5895 cf_search=
5896
5897 test "x$prefix" != "xNONE" && \
5898 test -d "$prefix" && \
5899  {
5900         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
5901         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
5902         test -d $prefix/include/utf8 &&       cf_search="$cf_search $prefix/include/utf8"
5903         test -d $prefix/include/utf8/include &&    cf_search="$cf_search $prefix/include/utf8/include"
5904         test -d $prefix/utf8/include &&       cf_search="$cf_search $prefix/utf8/include"
5905         test -d $prefix/utf8/include/utf8 &&    cf_search="$cf_search $prefix/utf8/include/utf8"
5906 }
5907
5908 for cf_subdir_prefix in \
5909         /usr \
5910         /usr/local \
5911         /usr/pkg \
5912         /opt \
5913         /opt/local \
5914         $HOME
5915 do
5916
5917 test "x$cf_subdir_prefix" != "x$prefix" && \
5918 test -d "$cf_subdir_prefix" && \
5919 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
5920         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
5921         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
5922         test -d $cf_subdir_prefix/include/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/include/utf8"
5923         test -d $cf_subdir_prefix/include/utf8/include &&    cf_search="$cf_search $cf_subdir_prefix/include/utf8/include"
5924         test -d $cf_subdir_prefix/utf8/include &&       cf_search="$cf_search $cf_subdir_prefix/utf8/include"
5925         test -d $cf_subdir_prefix/utf8/include/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/include/utf8"
5926 }
5927
5928 done
5929
5930 test "$includedir" != NONE && \
5931 test "$includedir" != "/usr/include" && \
5932 test -d "$includedir" && {
5933         test -d $includedir &&    cf_search="$cf_search $includedir"
5934         test -d $includedir/utf8 && cf_search="$cf_search $includedir/utf8"
5935 }
5936
5937 test "$oldincludedir" != NONE && \
5938 test "$oldincludedir" != "/usr/include" && \
5939 test -d "$oldincludedir" && {
5940         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
5941         test -d $oldincludedir/utf8 && cf_search="$cf_search $oldincludedir/utf8"
5942 }
5943
5944 cf_search="$cf_search $cf_header_path_list"
5945
5946         for cf_cv_header_path_utf8 in $cf_search
5947         do
5948                 if test -d $cf_cv_header_path_utf8 ; then
5949                         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
5950
5951 echo "${as_me:-configure}:5951: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
5952
5953                         CPPFLAGS="$cf_save_CPPFLAGS -I$cf_cv_header_path_utf8"
5954                         cat >conftest.$ac_ext <<_ACEOF
5955 #line 5955 "configure"
5956 #include "confdefs.h"
5957
5958 #include <libutf8.h>
5959 int
5960 main ()
5961 {
5962 putwc(0,0);
5963   ;
5964   return 0;
5965 }
5966 _ACEOF
5967 rm -f conftest.$ac_objext
5968 if { (eval echo "$as_me:5968: \"$ac_compile\"") >&5
5969   (eval $ac_compile) 2>&5
5970   ac_status=$?
5971   echo "$as_me:5971: \$? = $ac_status" >&5
5972   (exit $ac_status); } &&
5973          { ac_try='test -s conftest.$ac_objext'
5974   { (eval echo "$as_me:5974: \"$ac_try\"") >&5
5975   (eval $ac_try) 2>&5
5976   ac_status=$?
5977   echo "$as_me:5977: \$? = $ac_status" >&5
5978   (exit $ac_status); }; }; then
5979
5980                                 test -n "$verbose" && echo "    ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
5981
5982 echo "${as_me:-configure}:5982: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
5983
5984                                 cf_cv_find_linkage_utf8=maybe
5985                                 cf_test_CPPFLAGS="$CPPFLAGS"
5986                                 break
5987 else
5988   echo "$as_me: failed program was:" >&5
5989 cat conftest.$ac_ext >&5
5990
5991                                 CPPFLAGS="$cf_save_CPPFLAGS"
5992
5993 fi
5994 rm -f conftest.$ac_objext conftest.$ac_ext
5995                 fi
5996         done
5997
5998         if test "$cf_cv_find_linkage_utf8" = maybe ; then
5999
6000 echo "${as_me:-configure}:6000: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
6001
6002                 cf_save_LIBS="$LIBS"
6003                 cf_save_LDFLAGS="$LDFLAGS"
6004
6005                 if test "$cf_cv_find_linkage_utf8" != yes ; then
6006
6007 cf_search=
6008 cf_library_path_list=""
6009 if test -n "${LDFLAGS}${LIBS}" ; then
6010         for cf_library_path in $LDFLAGS $LIBS
6011         do
6012                 case $cf_library_path in
6013                 (-L*)
6014                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
6015
6016 test "x$cf_library_path" != "xNONE" && \
6017 test -d "$cf_library_path" && \
6018  {
6019         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
6020         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
6021         test -d $cf_library_path/lib/utf8 &&       cf_search="$cf_search $cf_library_path/lib/utf8"
6022         test -d $cf_library_path/lib/utf8/lib &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
6023         test -d $cf_library_path/utf8/lib &&       cf_search="$cf_search $cf_library_path/utf8/lib"
6024         test -d $cf_library_path/utf8/lib/utf8 &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
6025 }
6026
6027                         cf_library_path_list="$cf_library_path_list $cf_search"
6028                         ;;
6029                 esac
6030         done
6031 fi
6032
6033 cf_search=
6034
6035 test "x$prefix" != "xNONE" && \
6036 test -d "$prefix" && \
6037  {
6038         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
6039         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
6040         test -d $prefix/lib/utf8 &&       cf_search="$cf_search $prefix/lib/utf8"
6041         test -d $prefix/lib/utf8/lib &&    cf_search="$cf_search $prefix/lib/utf8/lib"
6042         test -d $prefix/utf8/lib &&       cf_search="$cf_search $prefix/utf8/lib"
6043         test -d $prefix/utf8/lib/utf8 &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
6044 }
6045
6046 for cf_subdir_prefix in \
6047         /usr \
6048         /usr/local \
6049         /usr/pkg \
6050         /opt \
6051         /opt/local \
6052         $HOME
6053 do
6054
6055 test "x$cf_subdir_prefix" != "x$prefix" && \
6056 test -d "$cf_subdir_prefix" && \
6057 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
6058         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
6059         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
6060         test -d $cf_subdir_prefix/lib/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/lib/utf8"
6061         test -d $cf_subdir_prefix/lib/utf8/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/utf8/lib"
6062         test -d $cf_subdir_prefix/utf8/lib &&       cf_search="$cf_search $cf_subdir_prefix/utf8/lib"
6063         test -d $cf_subdir_prefix/utf8/lib/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/lib/utf8"
6064 }
6065
6066 done
6067
6068 cf_search="$cf_library_path_list $cf_search"
6069
6070                         for cf_cv_library_path_utf8 in $cf_search
6071                         do
6072                                 if test -d $cf_cv_library_path_utf8 ; then
6073                                         test -n "$verbose" && echo "    ... testing $cf_cv_library_path_utf8" 1>&6
6074
6075 echo "${as_me:-configure}:6075: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
6076
6077                                         CPPFLAGS="$cf_test_CPPFLAGS"
6078                                         LIBS="-lutf8  $cf_save_LIBS"
6079                                         LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
6080                                         cat >conftest.$ac_ext <<_ACEOF
6081 #line 6081 "configure"
6082 #include "confdefs.h"
6083
6084 #include <libutf8.h>
6085 int
6086 main ()
6087 {
6088 putwc(0,0);
6089   ;
6090   return 0;
6091 }
6092 _ACEOF
6093 rm -f conftest.$ac_objext conftest$ac_exeext
6094 if { (eval echo "$as_me:6094: \"$ac_link\"") >&5
6095   (eval $ac_link) 2>&5
6096   ac_status=$?
6097   echo "$as_me:6097: \$? = $ac_status" >&5
6098   (exit $ac_status); } &&
6099          { ac_try='test -s conftest$ac_exeext'
6100   { (eval echo "$as_me:6100: \"$ac_try\"") >&5
6101   (eval $ac_try) 2>&5
6102   ac_status=$?
6103   echo "$as_me:6103: \$? = $ac_status" >&5
6104   (exit $ac_status); }; }; then
6105
6106                                         test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
6107
6108 echo "${as_me:-configure}:6108: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
6109
6110                                         cf_cv_find_linkage_utf8=yes
6111                                         cf_cv_library_file_utf8="-lutf8"
6112                                         break
6113 else
6114   echo "$as_me: failed program was:" >&5
6115 cat conftest.$ac_ext >&5
6116
6117                                         CPPFLAGS="$cf_save_CPPFLAGS"
6118                                         LIBS="$cf_save_LIBS"
6119                                         LDFLAGS="$cf_save_LDFLAGS"
6120
6121 fi
6122 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6123                                 fi
6124                         done
6125                         CPPFLAGS="$cf_save_CPPFLAGS"
6126                         LDFLAGS="$cf_save_LDFLAGS"
6127                 fi
6128
6129         else
6130                 cf_cv_find_linkage_utf8=no
6131         fi
6132
6133 fi
6134 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6135
6136 fi
6137 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6138
6139 LIBS="$cf_save_LIBS"
6140
6141 if test "$cf_cv_find_linkage_utf8" = yes ; then
6142 cf_cv_utf8_lib=add-on
6143 else
6144 cf_cv_utf8_lib=no
6145 fi
6146
6147 fi
6148 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6149 fi
6150 echo "$as_me:6150: result: $cf_cv_utf8_lib" >&5
6151 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
6152
6153 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
6154 # ncurses/ncursesw:
6155 if test "$cf_cv_utf8_lib" = "add-on" ; then
6156
6157 cat >>confdefs.h <<\EOF
6158 #define HAVE_LIBUTF8_H 1
6159 EOF
6160
6161 if test -n "$cf_cv_header_path_utf8" ; then
6162   for cf_add_incdir in $cf_cv_header_path_utf8
6163   do
6164         while test $cf_add_incdir != /usr/include
6165         do
6166           if test -d $cf_add_incdir
6167           then
6168                 cf_have_incdir=no
6169                 if test -n "$CFLAGS$CPPFLAGS" ; then
6170                   # a loop is needed to ensure we can add subdirs of existing dirs
6171                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6172                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6173                           cf_have_incdir=yes; break
6174                         fi
6175                   done
6176                 fi
6177
6178                 if test "$cf_have_incdir" = no ; then
6179                   if test "$cf_add_incdir" = /usr/local/include ; then
6180                         if test "$GCC" = yes
6181                         then
6182                           cf_save_CPPFLAGS=$CPPFLAGS
6183                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6184                           cat >conftest.$ac_ext <<_ACEOF
6185 #line 6185 "configure"
6186 #include "confdefs.h"
6187 #include <stdio.h>
6188 int
6189 main ()
6190 {
6191 printf("Hello")
6192   ;
6193   return 0;
6194 }
6195 _ACEOF
6196 rm -f conftest.$ac_objext
6197 if { (eval echo "$as_me:6197: \"$ac_compile\"") >&5
6198   (eval $ac_compile) 2>&5
6199   ac_status=$?
6200   echo "$as_me:6200: \$? = $ac_status" >&5
6201   (exit $ac_status); } &&
6202          { ac_try='test -s conftest.$ac_objext'
6203   { (eval echo "$as_me:6203: \"$ac_try\"") >&5
6204   (eval $ac_try) 2>&5
6205   ac_status=$?
6206   echo "$as_me:6206: \$? = $ac_status" >&5
6207   (exit $ac_status); }; }; then
6208   :
6209 else
6210   echo "$as_me: failed program was:" >&5
6211 cat conftest.$ac_ext >&5
6212 cf_have_incdir=yes
6213 fi
6214 rm -f conftest.$ac_objext conftest.$ac_ext
6215                           CPPFLAGS=$cf_save_CPPFLAGS
6216                         fi
6217                   fi
6218                 fi
6219
6220                 if test "$cf_have_incdir" = no ; then
6221                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6222
6223 echo "${as_me:-configure}:6223: testing adding $cf_add_incdir to include-path ..." 1>&5
6224
6225                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6226
6227                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6228                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6229                   cf_add_incdir="$cf_top_incdir"
6230                 else
6231                   break
6232                 fi
6233           else
6234                 break
6235           fi
6236         done
6237   done
6238 fi
6239
6240 if test -n "$cf_cv_library_path_utf8" ; then
6241         for cf_add_libdir in $cf_cv_library_path_utf8
6242         do
6243                 if test $cf_add_libdir = /usr/lib ; then
6244                         :
6245                 elif test -d $cf_add_libdir
6246                 then
6247                         cf_have_libdir=no
6248                         if test -n "$LDFLAGS$LIBS" ; then
6249                                 # a loop is needed to ensure we can add subdirs of existing dirs
6250                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6251                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6252                                                 cf_have_libdir=yes; break
6253                                         fi
6254                                 done
6255                         fi
6256                         if test "$cf_have_libdir" = no ; then
6257                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6258
6259 echo "${as_me:-configure}:6259: testing adding $cf_add_libdir to library-path ..." 1>&5
6260
6261                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6262                         fi
6263                 fi
6264         done
6265 fi
6266
6267 cf_add_libs="$cf_cv_library_file_utf8"
6268 # Filter out duplicates - this happens with badly-designed ".pc" files...
6269 for cf_add_1lib in $LIBS
6270 do
6271         for cf_add_2lib in $cf_add_libs
6272         do
6273                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6274                 then
6275                         cf_add_1lib=
6276                         break
6277                 fi
6278         done
6279         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6280 done
6281 LIBS="$cf_add_libs"
6282
6283 fi
6284
6285 cf_ncuconfig_root=$cf_cv_screen
6286 cf_have_ncuconfig=no
6287
6288 if test "x${PKG_CONFIG:=none}" != xnone; then
6289         echo "$as_me:6289: checking pkg-config for $cf_ncuconfig_root" >&5
6290 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
6291         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
6292                 echo "$as_me:6292: result: yes" >&5
6293 echo "${ECHO_T}yes" >&6
6294
6295                 echo "$as_me:6295: checking if the $cf_ncuconfig_root package files work" >&5
6296 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
6297                 cf_have_ncuconfig=unknown
6298
6299                 cf_save_CPPFLAGS="$CPPFLAGS"
6300                 cf_save_LIBS="$LIBS"
6301
6302                 CPPFLAGS="$CPPFLAGS `$PKG_CONFIG --cflags $cf_ncuconfig_root`"
6303
6304 cf_add_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
6305 # Filter out duplicates - this happens with badly-designed ".pc" files...
6306 for cf_add_1lib in $LIBS
6307 do
6308         for cf_add_2lib in $cf_add_libs
6309         do
6310                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6311                 then
6312                         cf_add_1lib=
6313                         break
6314                 fi
6315         done
6316         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6317 done
6318 LIBS="$cf_add_libs"
6319
6320                 cat >conftest.$ac_ext <<_ACEOF
6321 #line 6321 "configure"
6322 #include "confdefs.h"
6323 #include <${cf_cv_ncurses_header:-curses.h}>
6324 int
6325 main ()
6326 {
6327 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
6328   ;
6329   return 0;
6330 }
6331 _ACEOF
6332 rm -f conftest.$ac_objext conftest$ac_exeext
6333 if { (eval echo "$as_me:6333: \"$ac_link\"") >&5
6334   (eval $ac_link) 2>&5
6335   ac_status=$?
6336   echo "$as_me:6336: \$? = $ac_status" >&5
6337   (exit $ac_status); } &&
6338          { ac_try='test -s conftest$ac_exeext'
6339   { (eval echo "$as_me:6339: \"$ac_try\"") >&5
6340   (eval $ac_try) 2>&5
6341   ac_status=$?
6342   echo "$as_me:6342: \$? = $ac_status" >&5
6343   (exit $ac_status); }; }; then
6344   if test "$cross_compiling" = yes; then
6345   cf_have_ncuconfig=maybe
6346 else
6347   cat >conftest.$ac_ext <<_ACEOF
6348 #line 6348 "configure"
6349 #include "confdefs.h"
6350 #include <${cf_cv_ncurses_header:-curses.h}>
6351                                 int main(void)
6352                                 { char *xx = curses_version(); return (xx == 0); }
6353 _ACEOF
6354 rm -f conftest$ac_exeext
6355 if { (eval echo "$as_me:6355: \"$ac_link\"") >&5
6356   (eval $ac_link) 2>&5
6357   ac_status=$?
6358   echo "$as_me:6358: \$? = $ac_status" >&5
6359   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
6360   { (eval echo "$as_me:6360: \"$ac_try\"") >&5
6361   (eval $ac_try) 2>&5
6362   ac_status=$?
6363   echo "$as_me:6363: \$? = $ac_status" >&5
6364   (exit $ac_status); }; }; then
6365   cf_have_ncuconfig=yes
6366 else
6367   echo "$as_me: program exited with status $ac_status" >&5
6368 echo "$as_me: failed program was:" >&5
6369 cat conftest.$ac_ext >&5
6370 cf_have_ncuconfig=no
6371 fi
6372 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
6373 fi
6374 else
6375   echo "$as_me: failed program was:" >&5
6376 cat conftest.$ac_ext >&5
6377 cf_have_ncuconfig=no
6378 fi
6379 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6380                 echo "$as_me:6380: result: $cf_have_ncuconfig" >&5
6381 echo "${ECHO_T}$cf_have_ncuconfig" >&6
6382                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
6383                 if test "$cf_have_ncuconfig" != "yes"
6384                 then
6385                         CPPFLAGS="$cf_save_CPPFLAGS"
6386                         LIBS="$cf_save_LIBS"
6387                         NCURSES_CONFIG_PKG=none
6388                 else
6389
6390 cat >>confdefs.h <<\EOF
6391 #define NCURSES 1
6392 EOF
6393
6394                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
6395                 fi
6396
6397         else
6398                 echo "$as_me:6398: result: no" >&5
6399 echo "${ECHO_T}no" >&6
6400                 NCURSES_CONFIG_PKG=none
6401         fi
6402 else
6403         NCURSES_CONFIG_PKG=none
6404 fi
6405
6406 if test "x$cf_have_ncuconfig" = "xno"; then
6407         echo "Looking for ${cf_ncuconfig_root}-config"
6408
6409 if test -n "$ac_tool_prefix"; then
6410   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
6411   do
6412     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
6413 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
6414 echo "$as_me:6414: checking for $ac_word" >&5
6415 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
6416 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
6417   echo $ECHO_N "(cached) $ECHO_C" >&6
6418 else
6419   if test -n "$NCURSES_CONFIG"; then
6420   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
6421 else
6422   ac_save_IFS=$IFS; IFS=$ac_path_separator
6423 ac_dummy="$PATH"
6424 for ac_dir in $ac_dummy; do
6425   IFS=$ac_save_IFS
6426   test -z "$ac_dir" && ac_dir=.
6427   $as_executable_p "$ac_dir/$ac_word" || continue
6428 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
6429 echo "$as_me:6429: found $ac_dir/$ac_word" >&5
6430 break
6431 done
6432
6433 fi
6434 fi
6435 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
6436 if test -n "$NCURSES_CONFIG"; then
6437   echo "$as_me:6437: result: $NCURSES_CONFIG" >&5
6438 echo "${ECHO_T}$NCURSES_CONFIG" >&6
6439 else
6440   echo "$as_me:6440: result: no" >&5
6441 echo "${ECHO_T}no" >&6
6442 fi
6443
6444     test -n "$NCURSES_CONFIG" && break
6445   done
6446 fi
6447 if test -z "$NCURSES_CONFIG"; then
6448   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
6449   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
6450 do
6451   # Extract the first word of "$ac_prog", so it can be a program name with args.
6452 set dummy $ac_prog; ac_word=$2
6453 echo "$as_me:6453: checking for $ac_word" >&5
6454 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
6455 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
6456   echo $ECHO_N "(cached) $ECHO_C" >&6
6457 else
6458   if test -n "$ac_ct_NCURSES_CONFIG"; then
6459   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
6460 else
6461   ac_save_IFS=$IFS; IFS=$ac_path_separator
6462 ac_dummy="$PATH"
6463 for ac_dir in $ac_dummy; do
6464   IFS=$ac_save_IFS
6465   test -z "$ac_dir" && ac_dir=.
6466   $as_executable_p "$ac_dir/$ac_word" || continue
6467 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
6468 echo "$as_me:6468: found $ac_dir/$ac_word" >&5
6469 break
6470 done
6471
6472 fi
6473 fi
6474 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
6475 if test -n "$ac_ct_NCURSES_CONFIG"; then
6476   echo "$as_me:6476: result: $ac_ct_NCURSES_CONFIG" >&5
6477 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
6478 else
6479   echo "$as_me:6479: result: no" >&5
6480 echo "${ECHO_T}no" >&6
6481 fi
6482
6483   test -n "$ac_ct_NCURSES_CONFIG" && break
6484 done
6485 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
6486
6487   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
6488 fi
6489
6490         if test "$NCURSES_CONFIG" != none ; then
6491
6492                 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
6493
6494 cf_add_libs="`$NCURSES_CONFIG --libs`"
6495 # Filter out duplicates - this happens with badly-designed ".pc" files...
6496 for cf_add_1lib in $LIBS
6497 do
6498         for cf_add_2lib in $cf_add_libs
6499         do
6500                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6501                 then
6502                         cf_add_1lib=
6503                         break
6504                 fi
6505         done
6506         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6507 done
6508 LIBS="$cf_add_libs"
6509
6510                 # even with config script, some packages use no-override for curses.h
6511
6512 echo "$as_me:6512: checking if we have identified curses headers" >&5
6513 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
6514 if test "${cf_cv_ncurses_header+set}" = set; then
6515   echo $ECHO_N "(cached) $ECHO_C" >&6
6516 else
6517
6518 cf_cv_ncurses_header=none
6519 for cf_header in \
6520         ncurses.h $cf_cv_screen/ncurses.h \
6521         curses.h $cf_cv_screen/curses.h
6522 do
6523 cat >conftest.$ac_ext <<_ACEOF
6524 #line 6524 "configure"
6525 #include "confdefs.h"
6526 #include <${cf_header}>
6527 int
6528 main ()
6529 {
6530 initscr(); tgoto("?", 0,0)
6531   ;
6532   return 0;
6533 }
6534 _ACEOF
6535 rm -f conftest.$ac_objext
6536 if { (eval echo "$as_me:6536: \"$ac_compile\"") >&5
6537   (eval $ac_compile) 2>&5
6538   ac_status=$?
6539   echo "$as_me:6539: \$? = $ac_status" >&5
6540   (exit $ac_status); } &&
6541          { ac_try='test -s conftest.$ac_objext'
6542   { (eval echo "$as_me:6542: \"$ac_try\"") >&5
6543   (eval $ac_try) 2>&5
6544   ac_status=$?
6545   echo "$as_me:6545: \$? = $ac_status" >&5
6546   (exit $ac_status); }; }; then
6547   cf_cv_ncurses_header=$cf_header; break
6548 else
6549   echo "$as_me: failed program was:" >&5
6550 cat conftest.$ac_ext >&5
6551 fi
6552 rm -f conftest.$ac_objext conftest.$ac_ext
6553 done
6554
6555 fi
6556 echo "$as_me:6556: result: $cf_cv_ncurses_header" >&5
6557 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
6558
6559 if test "$cf_cv_ncurses_header" = none ; then
6560         { { echo "$as_me:6560: error: No curses header-files found" >&5
6561 echo "$as_me: error: No curses header-files found" >&2;}
6562    { (exit 1); exit 1; }; }
6563 fi
6564
6565 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
6566
6567 for ac_header in $cf_cv_ncurses_header
6568 do
6569 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
6570 echo "$as_me:6570: checking for $ac_header" >&5
6571 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
6572 if eval "test \"\${$as_ac_Header+set}\" = set"; then
6573   echo $ECHO_N "(cached) $ECHO_C" >&6
6574 else
6575   cat >conftest.$ac_ext <<_ACEOF
6576 #line 6576 "configure"
6577 #include "confdefs.h"
6578 #include <$ac_header>
6579 _ACEOF
6580 if { (eval echo "$as_me:6580: \"$ac_cpp conftest.$ac_ext\"") >&5
6581   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
6582   ac_status=$?
6583   egrep -v '^ *\+' conftest.er1 >conftest.err
6584   rm -f conftest.er1
6585   cat conftest.err >&5
6586   echo "$as_me:6586: \$? = $ac_status" >&5
6587   (exit $ac_status); } >/dev/null; then
6588   if test -s conftest.err; then
6589     ac_cpp_err=$ac_c_preproc_warn_flag
6590   else
6591     ac_cpp_err=
6592   fi
6593 else
6594   ac_cpp_err=yes
6595 fi
6596 if test -z "$ac_cpp_err"; then
6597   eval "$as_ac_Header=yes"
6598 else
6599   echo "$as_me: failed program was:" >&5
6600   cat conftest.$ac_ext >&5
6601   eval "$as_ac_Header=no"
6602 fi
6603 rm -f conftest.err conftest.$ac_ext
6604 fi
6605 echo "$as_me:6605: result: `eval echo '${'$as_ac_Header'}'`" >&5
6606 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
6607 if test `eval echo '${'$as_ac_Header'}'` = yes; then
6608   cat >>confdefs.h <<EOF
6609 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
6610 EOF
6611
6612 fi
6613 done
6614
6615 cat >>confdefs.h <<\EOF
6616 #define NCURSES 1
6617 EOF
6618
6619 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
6620
6621                 cat >>confdefs.h <<EOF
6622 #define $cf_nculib_ROOT 1
6623 EOF
6624
6625                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
6626
6627         else
6628
6629 cf_ncuhdr_root=$cf_cv_screen
6630
6631 test -n "$cf_cv_curses_dir" && \
6632 test "$cf_cv_curses_dir" != "no" && { \
6633
6634 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
6635   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
6636   do
6637         while test $cf_add_incdir != /usr/include
6638         do
6639           if test -d $cf_add_incdir
6640           then
6641                 cf_have_incdir=no
6642                 if test -n "$CFLAGS$CPPFLAGS" ; then
6643                   # a loop is needed to ensure we can add subdirs of existing dirs
6644                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6645                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6646                           cf_have_incdir=yes; break
6647                         fi
6648                   done
6649                 fi
6650
6651                 if test "$cf_have_incdir" = no ; then
6652                   if test "$cf_add_incdir" = /usr/local/include ; then
6653                         if test "$GCC" = yes
6654                         then
6655                           cf_save_CPPFLAGS=$CPPFLAGS
6656                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6657                           cat >conftest.$ac_ext <<_ACEOF
6658 #line 6658 "configure"
6659 #include "confdefs.h"
6660 #include <stdio.h>
6661 int
6662 main ()
6663 {
6664 printf("Hello")
6665   ;
6666   return 0;
6667 }
6668 _ACEOF
6669 rm -f conftest.$ac_objext
6670 if { (eval echo "$as_me:6670: \"$ac_compile\"") >&5
6671   (eval $ac_compile) 2>&5
6672   ac_status=$?
6673   echo "$as_me:6673: \$? = $ac_status" >&5
6674   (exit $ac_status); } &&
6675          { ac_try='test -s conftest.$ac_objext'
6676   { (eval echo "$as_me:6676: \"$ac_try\"") >&5
6677   (eval $ac_try) 2>&5
6678   ac_status=$?
6679   echo "$as_me:6679: \$? = $ac_status" >&5
6680   (exit $ac_status); }; }; then
6681   :
6682 else
6683   echo "$as_me: failed program was:" >&5
6684 cat conftest.$ac_ext >&5
6685 cf_have_incdir=yes
6686 fi
6687 rm -f conftest.$ac_objext conftest.$ac_ext
6688                           CPPFLAGS=$cf_save_CPPFLAGS
6689                         fi
6690                   fi
6691                 fi
6692
6693                 if test "$cf_have_incdir" = no ; then
6694                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6695
6696 echo "${as_me:-configure}:6696: testing adding $cf_add_incdir to include-path ..." 1>&5
6697
6698                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6699
6700                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6701                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6702                   cf_add_incdir="$cf_top_incdir"
6703                 else
6704                   break
6705                 fi
6706           else
6707                 break
6708           fi
6709         done
6710   done
6711 fi
6712
6713 }
6714
6715 echo "$as_me:6715: checking for $cf_ncuhdr_root header in include-path" >&5
6716 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
6717 if test "${cf_cv_ncurses_h+set}" = set; then
6718   echo $ECHO_N "(cached) $ECHO_C" >&6
6719 else
6720
6721         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
6722         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
6723         for cf_header in $cf_header_list
6724         do
6725
6726         cat >conftest.$ac_ext <<_ACEOF
6727 #line 6727 "configure"
6728 #include "confdefs.h"
6729
6730 #include <$cf_header>
6731 int
6732 main ()
6733 {
6734
6735 #ifdef NCURSES_VERSION
6736
6737 printf("%s\n", NCURSES_VERSION);
6738 #else
6739 #ifdef __NCURSES_H
6740 printf("old\n");
6741 #else
6742         make an error
6743 #endif
6744 #endif
6745
6746   ;
6747   return 0;
6748 }
6749 _ACEOF
6750 rm -f conftest.$ac_objext
6751 if { (eval echo "$as_me:6751: \"$ac_compile\"") >&5
6752   (eval $ac_compile) 2>&5
6753   ac_status=$?
6754   echo "$as_me:6754: \$? = $ac_status" >&5
6755   (exit $ac_status); } &&
6756          { ac_try='test -s conftest.$ac_objext'
6757   { (eval echo "$as_me:6757: \"$ac_try\"") >&5
6758   (eval $ac_try) 2>&5
6759   ac_status=$?
6760   echo "$as_me:6760: \$? = $ac_status" >&5
6761   (exit $ac_status); }; }; then
6762   cf_cv_ncurses_h=$cf_header
6763
6764 else
6765   echo "$as_me: failed program was:" >&5
6766 cat conftest.$ac_ext >&5
6767 cf_cv_ncurses_h=no
6768 fi
6769 rm -f conftest.$ac_objext conftest.$ac_ext
6770
6771                 test "$cf_cv_ncurses_h" != no && break
6772         done
6773
6774 fi
6775 echo "$as_me:6775: result: $cf_cv_ncurses_h" >&5
6776 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
6777
6778 if test "$cf_cv_ncurses_h" != no ; then
6779         cf_cv_ncurses_header=$cf_cv_ncurses_h
6780 else
6781
6782 echo "$as_me:6782: checking for $cf_ncuhdr_root include-path" >&5
6783 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
6784 if test "${cf_cv_ncurses_h2+set}" = set; then
6785   echo $ECHO_N "(cached) $ECHO_C" >&6
6786 else
6787
6788         test -n "$verbose" && echo
6789
6790 cf_search=
6791
6792 # collect the current set of include-directories from compiler flags
6793 cf_header_path_list=""
6794 if test -n "${CFLAGS}${CPPFLAGS}" ; then
6795         for cf_header_path in $CPPFLAGS $CFLAGS
6796         do
6797                 case $cf_header_path in
6798                 (-I*)
6799                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
6800
6801 test "x$cf_header_path" != "xNONE" && \
6802 test -d "$cf_header_path" && \
6803  {
6804         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
6805         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
6806         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
6807         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
6808         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
6809         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"
6810 }
6811
6812                         cf_header_path_list="$cf_header_path_list $cf_search"
6813                         ;;
6814                 esac
6815         done
6816 fi
6817
6818 # add the variations for the package we are looking for
6819
6820 cf_search=
6821
6822 test "x$prefix" != "xNONE" && \
6823 test -d "$prefix" && \
6824  {
6825         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
6826         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
6827         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
6828         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
6829         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
6830         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
6831 }
6832
6833 for cf_subdir_prefix in \
6834         /usr \
6835         /usr/local \
6836         /usr/pkg \
6837         /opt \
6838         /opt/local \
6839         $HOME
6840 do
6841
6842 test "x$cf_subdir_prefix" != "x$prefix" && \
6843 test -d "$cf_subdir_prefix" && \
6844 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
6845         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
6846         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
6847         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
6848         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
6849         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
6850         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"
6851 }
6852
6853 done
6854
6855 test "$includedir" != NONE && \
6856 test "$includedir" != "/usr/include" && \
6857 test -d "$includedir" && {
6858         test -d $includedir &&    cf_search="$cf_search $includedir"
6859         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
6860 }
6861
6862 test "$oldincludedir" != NONE && \
6863 test "$oldincludedir" != "/usr/include" && \
6864 test -d "$oldincludedir" && {
6865         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
6866         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
6867 }
6868
6869 cf_search="$cf_search $cf_header_path_list"
6870
6871         test -n "$verbose" && echo search path $cf_search
6872         cf_save2_CPPFLAGS="$CPPFLAGS"
6873         for cf_incdir in $cf_search
6874         do
6875
6876 if test -n "$cf_incdir" ; then
6877   for cf_add_incdir in $cf_incdir
6878   do
6879         while test $cf_add_incdir != /usr/include
6880         do
6881           if test -d $cf_add_incdir
6882           then
6883                 cf_have_incdir=no
6884                 if test -n "$CFLAGS$CPPFLAGS" ; then
6885                   # a loop is needed to ensure we can add subdirs of existing dirs
6886                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6887                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6888                           cf_have_incdir=yes; break
6889                         fi
6890                   done
6891                 fi
6892
6893                 if test "$cf_have_incdir" = no ; then
6894                   if test "$cf_add_incdir" = /usr/local/include ; then
6895                         if test "$GCC" = yes
6896                         then
6897                           cf_save_CPPFLAGS=$CPPFLAGS
6898                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6899                           cat >conftest.$ac_ext <<_ACEOF
6900 #line 6900 "configure"
6901 #include "confdefs.h"
6902 #include <stdio.h>
6903 int
6904 main ()
6905 {
6906 printf("Hello")
6907   ;
6908   return 0;
6909 }
6910 _ACEOF
6911 rm -f conftest.$ac_objext
6912 if { (eval echo "$as_me:6912: \"$ac_compile\"") >&5
6913   (eval $ac_compile) 2>&5
6914   ac_status=$?
6915   echo "$as_me:6915: \$? = $ac_status" >&5
6916   (exit $ac_status); } &&
6917          { ac_try='test -s conftest.$ac_objext'
6918   { (eval echo "$as_me:6918: \"$ac_try\"") >&5
6919   (eval $ac_try) 2>&5
6920   ac_status=$?
6921   echo "$as_me:6921: \$? = $ac_status" >&5
6922   (exit $ac_status); }; }; then
6923   :
6924 else
6925   echo "$as_me: failed program was:" >&5
6926 cat conftest.$ac_ext >&5
6927 cf_have_incdir=yes
6928 fi
6929 rm -f conftest.$ac_objext conftest.$ac_ext
6930                           CPPFLAGS=$cf_save_CPPFLAGS
6931                         fi
6932                   fi
6933                 fi
6934
6935                 if test "$cf_have_incdir" = no ; then
6936                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6937
6938 echo "${as_me:-configure}:6938: testing adding $cf_add_incdir to include-path ..." 1>&5
6939
6940                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6941
6942                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6943                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6944                   cf_add_incdir="$cf_top_incdir"
6945                 else
6946                   break
6947                 fi
6948           else
6949                 break
6950           fi
6951         done
6952   done
6953 fi
6954
6955                 for cf_header in \
6956                         ncurses.h \
6957                         curses.h
6958                 do
6959
6960         cat >conftest.$ac_ext <<_ACEOF
6961 #line 6961 "configure"
6962 #include "confdefs.h"
6963
6964 #include <$cf_header>
6965 int
6966 main ()
6967 {
6968
6969 #ifdef NCURSES_VERSION
6970
6971 printf("%s\n", NCURSES_VERSION);
6972 #else
6973 #ifdef __NCURSES_H
6974 printf("old\n");
6975 #else
6976         make an error
6977 #endif
6978 #endif
6979
6980   ;
6981   return 0;
6982 }
6983 _ACEOF
6984 rm -f conftest.$ac_objext
6985 if { (eval echo "$as_me:6985: \"$ac_compile\"") >&5
6986   (eval $ac_compile) 2>&5
6987   ac_status=$?
6988   echo "$as_me:6988: \$? = $ac_status" >&5
6989   (exit $ac_status); } &&
6990          { ac_try='test -s conftest.$ac_objext'
6991   { (eval echo "$as_me:6991: \"$ac_try\"") >&5
6992   (eval $ac_try) 2>&5
6993   ac_status=$?
6994   echo "$as_me:6994: \$? = $ac_status" >&5
6995   (exit $ac_status); }; }; then
6996   cf_cv_ncurses_h2=$cf_header
6997
6998 else
6999   echo "$as_me: failed program was:" >&5
7000 cat conftest.$ac_ext >&5
7001 cf_cv_ncurses_h2=no
7002 fi
7003 rm -f conftest.$ac_objext conftest.$ac_ext
7004
7005                         if test "$cf_cv_ncurses_h2" != no ; then
7006                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
7007                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
7008                                 break
7009                         fi
7010                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
7011                 done
7012                 CPPFLAGS="$cf_save2_CPPFLAGS"
7013                 test "$cf_cv_ncurses_h2" != no && break
7014         done
7015         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:7015: error: not found" >&5
7016 echo "$as_me: error: not found" >&2;}
7017    { (exit 1); exit 1; }; }
7018
7019 fi
7020 echo "$as_me:7020: result: $cf_cv_ncurses_h2" >&5
7021 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
7022
7023         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
7024         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
7025         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
7026                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
7027         fi
7028
7029 if test -n "$cf_1st_incdir" ; then
7030   for cf_add_incdir in $cf_1st_incdir
7031   do
7032         while test $cf_add_incdir != /usr/include
7033         do
7034           if test -d $cf_add_incdir
7035           then
7036                 cf_have_incdir=no
7037                 if test -n "$CFLAGS$CPPFLAGS" ; then
7038                   # a loop is needed to ensure we can add subdirs of existing dirs
7039                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7040                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7041                           cf_have_incdir=yes; break
7042                         fi
7043                   done
7044                 fi
7045
7046                 if test "$cf_have_incdir" = no ; then
7047                   if test "$cf_add_incdir" = /usr/local/include ; then
7048                         if test "$GCC" = yes
7049                         then
7050                           cf_save_CPPFLAGS=$CPPFLAGS
7051                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7052                           cat >conftest.$ac_ext <<_ACEOF
7053 #line 7053 "configure"
7054 #include "confdefs.h"
7055 #include <stdio.h>
7056 int
7057 main ()
7058 {
7059 printf("Hello")
7060   ;
7061   return 0;
7062 }
7063 _ACEOF
7064 rm -f conftest.$ac_objext
7065 if { (eval echo "$as_me:7065: \"$ac_compile\"") >&5
7066   (eval $ac_compile) 2>&5
7067   ac_status=$?
7068   echo "$as_me:7068: \$? = $ac_status" >&5
7069   (exit $ac_status); } &&
7070          { ac_try='test -s conftest.$ac_objext'
7071   { (eval echo "$as_me:7071: \"$ac_try\"") >&5
7072   (eval $ac_try) 2>&5
7073   ac_status=$?
7074   echo "$as_me:7074: \$? = $ac_status" >&5
7075   (exit $ac_status); }; }; then
7076   :
7077 else
7078   echo "$as_me: failed program was:" >&5
7079 cat conftest.$ac_ext >&5
7080 cf_have_incdir=yes
7081 fi
7082 rm -f conftest.$ac_objext conftest.$ac_ext
7083                           CPPFLAGS=$cf_save_CPPFLAGS
7084                         fi
7085                   fi
7086                 fi
7087
7088                 if test "$cf_have_incdir" = no ; then
7089                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7090
7091 echo "${as_me:-configure}:7091: testing adding $cf_add_incdir to include-path ..." 1>&5
7092
7093                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7094
7095                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7096                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7097                   cf_add_incdir="$cf_top_incdir"
7098                 else
7099                   break
7100                 fi
7101           else
7102                 break
7103           fi
7104         done
7105   done
7106 fi
7107
7108 fi
7109
7110 # Set definitions to allow ifdef'ing for ncurses.h
7111
7112 case $cf_cv_ncurses_header in
7113 (*ncurses.h)
7114
7115 cat >>confdefs.h <<\EOF
7116 #define HAVE_NCURSES_H 1
7117 EOF
7118
7119         ;;
7120 esac
7121
7122 case $cf_cv_ncurses_header in
7123 (ncurses/curses.h|ncurses/ncurses.h)
7124
7125 cat >>confdefs.h <<\EOF
7126 #define HAVE_NCURSES_NCURSES_H 1
7127 EOF
7128
7129         ;;
7130 (ncursesw/curses.h|ncursesw/ncurses.h)
7131
7132 cat >>confdefs.h <<\EOF
7133 #define HAVE_NCURSESW_NCURSES_H 1
7134 EOF
7135
7136         ;;
7137 esac
7138
7139 echo "$as_me:7139: checking for terminfo header" >&5
7140 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
7141 if test "${cf_cv_term_header+set}" = set; then
7142   echo $ECHO_N "(cached) $ECHO_C" >&6
7143 else
7144
7145 case ${cf_cv_ncurses_header} in
7146 (*/ncurses.h|*/ncursesw.h)
7147         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
7148         ;;
7149 (*)
7150         cf_term_header=term.h
7151         ;;
7152 esac
7153
7154 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
7155 do
7156 cat >conftest.$ac_ext <<_ACEOF
7157 #line 7157 "configure"
7158 #include "confdefs.h"
7159 #include <stdio.h>
7160 #include <${cf_cv_ncurses_header:-curses.h}>
7161 #include <$cf_test>
7162
7163 int
7164 main ()
7165 {
7166 int x = auto_left_margin
7167   ;
7168   return 0;
7169 }
7170 _ACEOF
7171 rm -f conftest.$ac_objext
7172 if { (eval echo "$as_me:7172: \"$ac_compile\"") >&5
7173   (eval $ac_compile) 2>&5
7174   ac_status=$?
7175   echo "$as_me:7175: \$? = $ac_status" >&5
7176   (exit $ac_status); } &&
7177          { ac_try='test -s conftest.$ac_objext'
7178   { (eval echo "$as_me:7178: \"$ac_try\"") >&5
7179   (eval $ac_try) 2>&5
7180   ac_status=$?
7181   echo "$as_me:7181: \$? = $ac_status" >&5
7182   (exit $ac_status); }; }; then
7183
7184         cf_cv_term_header="$cf_test"
7185 else
7186   echo "$as_me: failed program was:" >&5
7187 cat conftest.$ac_ext >&5
7188
7189         cf_cv_term_header=unknown
7190
7191 fi
7192 rm -f conftest.$ac_objext conftest.$ac_ext
7193         test "$cf_cv_term_header" != unknown && break
7194 done
7195
7196 fi
7197 echo "$as_me:7197: result: $cf_cv_term_header" >&5
7198 echo "${ECHO_T}$cf_cv_term_header" >&6
7199
7200 # Set definitions to allow ifdef'ing to accommodate subdirectories
7201
7202 case $cf_cv_term_header in
7203 (*term.h)
7204
7205 cat >>confdefs.h <<\EOF
7206 #define HAVE_TERM_H 1
7207 EOF
7208
7209         ;;
7210 esac
7211
7212 case $cf_cv_term_header in
7213 (ncurses/term.h)
7214
7215 cat >>confdefs.h <<\EOF
7216 #define HAVE_NCURSES_TERM_H 1
7217 EOF
7218
7219         ;;
7220 (ncursesw/term.h)
7221
7222 cat >>confdefs.h <<\EOF
7223 #define HAVE_NCURSESW_TERM_H 1
7224 EOF
7225
7226         ;;
7227 esac
7228
7229 # some applications need this, but should check for NCURSES_VERSION
7230
7231 cat >>confdefs.h <<\EOF
7232 #define NCURSES 1
7233 EOF
7234
7235 echo "$as_me:7235: checking for ncurses version" >&5
7236 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
7237 if test "${cf_cv_ncurses_version+set}" = set; then
7238   echo $ECHO_N "(cached) $ECHO_C" >&6
7239 else
7240
7241         cf_cv_ncurses_version=no
7242         cf_tempfile=out$$
7243         rm -f $cf_tempfile
7244         if test "$cross_compiling" = yes; then
7245
7246         # This will not work if the preprocessor splits the line after the
7247         # Autoconf token.  The 'unproto' program does that.
7248         cat > conftest.$ac_ext <<EOF
7249 #include <${cf_cv_ncurses_header:-curses.h}>
7250 #undef Autoconf
7251 #ifdef NCURSES_VERSION
7252 Autoconf NCURSES_VERSION
7253 #else
7254 #ifdef __NCURSES_H
7255 Autoconf "old"
7256 #endif
7257 ;
7258 #endif
7259 EOF
7260         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
7261         { (eval echo "$as_me:7261: \"$cf_try\"") >&5
7262   (eval $cf_try) 2>&5
7263   ac_status=$?
7264   echo "$as_me:7264: \$? = $ac_status" >&5
7265   (exit $ac_status); }
7266         if test -f conftest.out ; then
7267                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
7268                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
7269                 rm -f conftest.out
7270         fi
7271
7272 else
7273   cat >conftest.$ac_ext <<_ACEOF
7274 #line 7274 "configure"
7275 #include "confdefs.h"
7276
7277 #include <${cf_cv_ncurses_header:-curses.h}>
7278 #include <stdio.h>
7279 int main()
7280 {
7281         FILE *fp = fopen("$cf_tempfile", "w");
7282 #ifdef NCURSES_VERSION
7283 # ifdef NCURSES_VERSION_PATCH
7284         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
7285 # else
7286         fprintf(fp, "%s\n", NCURSES_VERSION);
7287 # endif
7288 #else
7289 # ifdef __NCURSES_H
7290         fprintf(fp, "old\n");
7291 # else
7292         make an error
7293 # endif
7294 #endif
7295         ${cf_cv_main_return:-return}(0);
7296 }
7297 _ACEOF
7298 rm -f conftest$ac_exeext
7299 if { (eval echo "$as_me:7299: \"$ac_link\"") >&5
7300   (eval $ac_link) 2>&5
7301   ac_status=$?
7302   echo "$as_me:7302: \$? = $ac_status" >&5
7303   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
7304   { (eval echo "$as_me:7304: \"$ac_try\"") >&5
7305   (eval $ac_try) 2>&5
7306   ac_status=$?
7307   echo "$as_me:7307: \$? = $ac_status" >&5
7308   (exit $ac_status); }; }; then
7309
7310         cf_cv_ncurses_version=`cat $cf_tempfile`
7311 else
7312   echo "$as_me: program exited with status $ac_status" >&5
7313 echo "$as_me: failed program was:" >&5
7314 cat conftest.$ac_ext >&5
7315 fi
7316 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
7317 fi
7318         rm -f $cf_tempfile
7319
7320 fi
7321 echo "$as_me:7321: result: $cf_cv_ncurses_version" >&5
7322 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
7323 test "$cf_cv_ncurses_version" = no ||
7324 cat >>confdefs.h <<\EOF
7325 #define NCURSES 1
7326 EOF
7327
7328 cf_nculib_root=$cf_cv_screen
7329         # This works, except for the special case where we find gpm, but
7330         # ncurses is in a nonstandard location via $LIBS, and we really want
7331         # to link gpm.
7332 cf_ncurses_LIBS=""
7333 cf_ncurses_SAVE="$LIBS"
7334 echo "$as_me:7334: checking for Gpm_Open in -lgpm" >&5
7335 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
7336 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
7337   echo $ECHO_N "(cached) $ECHO_C" >&6
7338 else
7339   ac_check_lib_save_LIBS=$LIBS
7340 LIBS="-lgpm  $LIBS"
7341 cat >conftest.$ac_ext <<_ACEOF
7342 #line 7342 "configure"
7343 #include "confdefs.h"
7344
7345 /* Override any gcc2 internal prototype to avoid an error.  */
7346 #ifdef __cplusplus
7347 extern "C"
7348 #endif
7349 /* We use char because int might match the return type of a gcc2
7350    builtin and then its argument prototype would still apply.  */
7351 char Gpm_Open ();
7352 int
7353 main ()
7354 {
7355 Gpm_Open ();
7356   ;
7357   return 0;
7358 }
7359 _ACEOF
7360 rm -f conftest.$ac_objext conftest$ac_exeext
7361 if { (eval echo "$as_me:7361: \"$ac_link\"") >&5
7362   (eval $ac_link) 2>&5
7363   ac_status=$?
7364   echo "$as_me:7364: \$? = $ac_status" >&5
7365   (exit $ac_status); } &&
7366          { ac_try='test -s conftest$ac_exeext'
7367   { (eval echo "$as_me:7367: \"$ac_try\"") >&5
7368   (eval $ac_try) 2>&5
7369   ac_status=$?
7370   echo "$as_me:7370: \$? = $ac_status" >&5
7371   (exit $ac_status); }; }; then
7372   ac_cv_lib_gpm_Gpm_Open=yes
7373 else
7374   echo "$as_me: failed program was:" >&5
7375 cat conftest.$ac_ext >&5
7376 ac_cv_lib_gpm_Gpm_Open=no
7377 fi
7378 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7379 LIBS=$ac_check_lib_save_LIBS
7380 fi
7381 echo "$as_me:7381: result: $ac_cv_lib_gpm_Gpm_Open" >&5
7382 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
7383 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
7384   echo "$as_me:7384: checking for initscr in -lgpm" >&5
7385 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
7386 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
7387   echo $ECHO_N "(cached) $ECHO_C" >&6
7388 else
7389   ac_check_lib_save_LIBS=$LIBS
7390 LIBS="-lgpm  $LIBS"
7391 cat >conftest.$ac_ext <<_ACEOF
7392 #line 7392 "configure"
7393 #include "confdefs.h"
7394
7395 /* Override any gcc2 internal prototype to avoid an error.  */
7396 #ifdef __cplusplus
7397 extern "C"
7398 #endif
7399 /* We use char because int might match the return type of a gcc2
7400    builtin and then its argument prototype would still apply.  */
7401 char initscr ();
7402 int
7403 main ()
7404 {
7405 initscr ();
7406   ;
7407   return 0;
7408 }
7409 _ACEOF
7410 rm -f conftest.$ac_objext conftest$ac_exeext
7411 if { (eval echo "$as_me:7411: \"$ac_link\"") >&5
7412   (eval $ac_link) 2>&5
7413   ac_status=$?
7414   echo "$as_me:7414: \$? = $ac_status" >&5
7415   (exit $ac_status); } &&
7416          { ac_try='test -s conftest$ac_exeext'
7417   { (eval echo "$as_me:7417: \"$ac_try\"") >&5
7418   (eval $ac_try) 2>&5
7419   ac_status=$?
7420   echo "$as_me:7420: \$? = $ac_status" >&5
7421   (exit $ac_status); }; }; then
7422   ac_cv_lib_gpm_initscr=yes
7423 else
7424   echo "$as_me: failed program was:" >&5
7425 cat conftest.$ac_ext >&5
7426 ac_cv_lib_gpm_initscr=no
7427 fi
7428 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7429 LIBS=$ac_check_lib_save_LIBS
7430 fi
7431 echo "$as_me:7431: result: $ac_cv_lib_gpm_initscr" >&5
7432 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
7433 if test $ac_cv_lib_gpm_initscr = yes; then
7434   LIBS="$cf_ncurses_SAVE"
7435 else
7436   cf_ncurses_LIBS="-lgpm"
7437 fi
7438
7439 fi
7440
7441 case $host_os in
7442 (freebsd*)
7443         # This is only necessary if you are linking against an obsolete
7444         # version of ncurses (but it should do no harm, since it's static).
7445         if test "$cf_nculib_root" = ncurses ; then
7446                 echo "$as_me:7446: checking for tgoto in -lmytinfo" >&5
7447 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
7448 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
7449   echo $ECHO_N "(cached) $ECHO_C" >&6
7450 else
7451   ac_check_lib_save_LIBS=$LIBS
7452 LIBS="-lmytinfo  $LIBS"
7453 cat >conftest.$ac_ext <<_ACEOF
7454 #line 7454 "configure"
7455 #include "confdefs.h"
7456
7457 /* Override any gcc2 internal prototype to avoid an error.  */
7458 #ifdef __cplusplus
7459 extern "C"
7460 #endif
7461 /* We use char because int might match the return type of a gcc2
7462    builtin and then its argument prototype would still apply.  */
7463 char tgoto ();
7464 int
7465 main ()
7466 {
7467 tgoto ();
7468   ;
7469   return 0;
7470 }
7471 _ACEOF
7472 rm -f conftest.$ac_objext conftest$ac_exeext
7473 if { (eval echo "$as_me:7473: \"$ac_link\"") >&5
7474   (eval $ac_link) 2>&5
7475   ac_status=$?
7476   echo "$as_me:7476: \$? = $ac_status" >&5
7477   (exit $ac_status); } &&
7478          { ac_try='test -s conftest$ac_exeext'
7479   { (eval echo "$as_me:7479: \"$ac_try\"") >&5
7480   (eval $ac_try) 2>&5
7481   ac_status=$?
7482   echo "$as_me:7482: \$? = $ac_status" >&5
7483   (exit $ac_status); }; }; then
7484   ac_cv_lib_mytinfo_tgoto=yes
7485 else
7486   echo "$as_me: failed program was:" >&5
7487 cat conftest.$ac_ext >&5
7488 ac_cv_lib_mytinfo_tgoto=no
7489 fi
7490 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7491 LIBS=$ac_check_lib_save_LIBS
7492 fi
7493 echo "$as_me:7493: result: $ac_cv_lib_mytinfo_tgoto" >&5
7494 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
7495 if test $ac_cv_lib_mytinfo_tgoto = yes; then
7496   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
7497 fi
7498
7499         fi
7500         ;;
7501 esac
7502
7503 cf_add_libs="$cf_ncurses_LIBS"
7504 # Filter out duplicates - this happens with badly-designed ".pc" files...
7505 for cf_add_1lib in $LIBS
7506 do
7507         for cf_add_2lib in $cf_add_libs
7508         do
7509                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7510                 then
7511                         cf_add_1lib=
7512                         break
7513                 fi
7514         done
7515         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7516 done
7517 LIBS="$cf_add_libs"
7518
7519 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
7520 then
7521
7522 cf_add_libs="-l$cf_nculib_root"
7523 # Filter out duplicates - this happens with badly-designed ".pc" files...
7524 for cf_add_1lib in $LIBS
7525 do
7526         for cf_add_2lib in $cf_add_libs
7527         do
7528                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7529                 then
7530                         cf_add_1lib=
7531                         break
7532                 fi
7533         done
7534         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7535 done
7536 LIBS="$cf_add_libs"
7537
7538 else
7539
7540         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
7541         cf_libdir=""
7542         echo "$as_me:7542: checking for initscr" >&5
7543 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
7544 if test "${ac_cv_func_initscr+set}" = set; then
7545   echo $ECHO_N "(cached) $ECHO_C" >&6
7546 else
7547   cat >conftest.$ac_ext <<_ACEOF
7548 #line 7548 "configure"
7549 #include "confdefs.h"
7550 /* System header to define __stub macros and hopefully few prototypes,
7551     which can conflict with char initscr (); below.  */
7552 #include <assert.h>
7553 /* Override any gcc2 internal prototype to avoid an error.  */
7554 #ifdef __cplusplus
7555 extern "C"
7556 #endif
7557 /* We use char because int might match the return type of a gcc2
7558    builtin and then its argument prototype would still apply.  */
7559 char initscr ();
7560 char (*f) ();
7561
7562 int
7563 main ()
7564 {
7565 /* The GNU C library defines this for functions which it implements
7566     to always fail with ENOSYS.  Some functions are actually named
7567     something starting with __ and the normal name is an alias.  */
7568 #if defined (__stub_initscr) || defined (__stub___initscr)
7569 choke me
7570 #else
7571 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
7572 #endif
7573
7574   ;
7575   return 0;
7576 }
7577 _ACEOF
7578 rm -f conftest.$ac_objext conftest$ac_exeext
7579 if { (eval echo "$as_me:7579: \"$ac_link\"") >&5
7580   (eval $ac_link) 2>&5
7581   ac_status=$?
7582   echo "$as_me:7582: \$? = $ac_status" >&5
7583   (exit $ac_status); } &&
7584          { ac_try='test -s conftest$ac_exeext'
7585   { (eval echo "$as_me:7585: \"$ac_try\"") >&5
7586   (eval $ac_try) 2>&5
7587   ac_status=$?
7588   echo "$as_me:7588: \$? = $ac_status" >&5
7589   (exit $ac_status); }; }; then
7590   ac_cv_func_initscr=yes
7591 else
7592   echo "$as_me: failed program was:" >&5
7593 cat conftest.$ac_ext >&5
7594 ac_cv_func_initscr=no
7595 fi
7596 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7597 fi
7598 echo "$as_me:7598: result: $ac_cv_func_initscr" >&5
7599 echo "${ECHO_T}$ac_cv_func_initscr" >&6
7600 if test $ac_cv_func_initscr = yes; then
7601   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
7602 else
7603
7604                 cf_save_LIBS="$LIBS"
7605                 echo "$as_me:7605: checking for initscr in -l$cf_nculib_root" >&5
7606 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
7607                 LIBS="-l$cf_nculib_root $LIBS"
7608                 cat >conftest.$ac_ext <<_ACEOF
7609 #line 7609 "configure"
7610 #include "confdefs.h"
7611 #include <${cf_cv_ncurses_header:-curses.h}>
7612 int
7613 main ()
7614 {
7615 initscr()
7616   ;
7617   return 0;
7618 }
7619 _ACEOF
7620 rm -f conftest.$ac_objext conftest$ac_exeext
7621 if { (eval echo "$as_me:7621: \"$ac_link\"") >&5
7622   (eval $ac_link) 2>&5
7623   ac_status=$?
7624   echo "$as_me:7624: \$? = $ac_status" >&5
7625   (exit $ac_status); } &&
7626          { ac_try='test -s conftest$ac_exeext'
7627   { (eval echo "$as_me:7627: \"$ac_try\"") >&5
7628   (eval $ac_try) 2>&5
7629   ac_status=$?
7630   echo "$as_me:7630: \$? = $ac_status" >&5
7631   (exit $ac_status); }; }; then
7632   echo "$as_me:7632: result: yes" >&5
7633 echo "${ECHO_T}yes" >&6
7634                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
7635
7636 else
7637   echo "$as_me: failed program was:" >&5
7638 cat conftest.$ac_ext >&5
7639 echo "$as_me:7639: result: no" >&5
7640 echo "${ECHO_T}no" >&6
7641
7642 cf_search=
7643 cf_library_path_list=""
7644 if test -n "${LDFLAGS}${LIBS}" ; then
7645         for cf_library_path in $LDFLAGS $LIBS
7646         do
7647                 case $cf_library_path in
7648                 (-L*)
7649                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
7650
7651 test "x$cf_library_path" != "xNONE" && \
7652 test -d "$cf_library_path" && \
7653  {
7654         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
7655         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
7656         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
7657         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
7658         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
7659         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"
7660 }
7661
7662                         cf_library_path_list="$cf_library_path_list $cf_search"
7663                         ;;
7664                 esac
7665         done
7666 fi
7667
7668 cf_search=
7669
7670 test "x$prefix" != "xNONE" && \
7671 test -d "$prefix" && \
7672  {
7673         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
7674         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
7675         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
7676         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
7677         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
7678         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
7679 }
7680
7681 for cf_subdir_prefix in \
7682         /usr \
7683         /usr/local \
7684         /usr/pkg \
7685         /opt \
7686         /opt/local \
7687         $HOME
7688 do
7689
7690 test "x$cf_subdir_prefix" != "x$prefix" && \
7691 test -d "$cf_subdir_prefix" && \
7692 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
7693         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
7694         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
7695         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
7696         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
7697         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
7698         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"
7699 }
7700
7701 done
7702
7703 cf_search="$cf_library_path_list $cf_search"
7704
7705                         for cf_libdir in $cf_search
7706                         do
7707                                 echo "$as_me:7707: checking for -l$cf_nculib_root in $cf_libdir" >&5
7708 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
7709                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
7710                                 cat >conftest.$ac_ext <<_ACEOF
7711 #line 7711 "configure"
7712 #include "confdefs.h"
7713 #include <${cf_cv_ncurses_header:-curses.h}>
7714 int
7715 main ()
7716 {
7717 initscr()
7718   ;
7719   return 0;
7720 }
7721 _ACEOF
7722 rm -f conftest.$ac_objext conftest$ac_exeext
7723 if { (eval echo "$as_me:7723: \"$ac_link\"") >&5
7724   (eval $ac_link) 2>&5
7725   ac_status=$?
7726   echo "$as_me:7726: \$? = $ac_status" >&5
7727   (exit $ac_status); } &&
7728          { ac_try='test -s conftest$ac_exeext'
7729   { (eval echo "$as_me:7729: \"$ac_try\"") >&5
7730   (eval $ac_try) 2>&5
7731   ac_status=$?
7732   echo "$as_me:7732: \$? = $ac_status" >&5
7733   (exit $ac_status); }; }; then
7734   echo "$as_me:7734: result: yes" >&5
7735 echo "${ECHO_T}yes" >&6
7736                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
7737                                          break
7738 else
7739   echo "$as_me: failed program was:" >&5
7740 cat conftest.$ac_ext >&5
7741 echo "$as_me:7741: result: no" >&5
7742 echo "${ECHO_T}no" >&6
7743                                          LIBS="$cf_save_LIBS"
7744 fi
7745 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7746                         done
7747
7748 fi
7749 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7750
7751 fi
7752
7753 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
7754
7755 if test $cf_found_library = no ; then
7756         { { echo "$as_me:7756: error: Cannot link $cf_nculib_root library" >&5
7757 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
7758    { (exit 1); exit 1; }; }
7759 fi
7760
7761 fi
7762
7763 if test -n "$cf_ncurses_LIBS" ; then
7764         echo "$as_me:7764: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
7765 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
7766         cf_ncurses_SAVE="$LIBS"
7767         for p in $cf_ncurses_LIBS ; do
7768                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
7769                 if test "$q" != "$LIBS" ; then
7770                         LIBS="$q"
7771                 fi
7772         done
7773         cat >conftest.$ac_ext <<_ACEOF
7774 #line 7774 "configure"
7775 #include "confdefs.h"
7776 #include <${cf_cv_ncurses_header:-curses.h}>
7777 int
7778 main ()
7779 {
7780 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
7781   ;
7782   return 0;
7783 }
7784 _ACEOF
7785 rm -f conftest.$ac_objext conftest$ac_exeext
7786 if { (eval echo "$as_me:7786: \"$ac_link\"") >&5
7787   (eval $ac_link) 2>&5
7788   ac_status=$?
7789   echo "$as_me:7789: \$? = $ac_status" >&5
7790   (exit $ac_status); } &&
7791          { ac_try='test -s conftest$ac_exeext'
7792   { (eval echo "$as_me:7792: \"$ac_try\"") >&5
7793   (eval $ac_try) 2>&5
7794   ac_status=$?
7795   echo "$as_me:7795: \$? = $ac_status" >&5
7796   (exit $ac_status); }; }; then
7797   echo "$as_me:7797: result: yes" >&5
7798 echo "${ECHO_T}yes" >&6
7799 else
7800   echo "$as_me: failed program was:" >&5
7801 cat conftest.$ac_ext >&5
7802 echo "$as_me:7802: result: no" >&5
7803 echo "${ECHO_T}no" >&6
7804                  LIBS="$cf_ncurses_SAVE"
7805 fi
7806 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7807 fi
7808
7809 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
7810
7811 cat >>confdefs.h <<EOF
7812 #define $cf_nculib_ROOT 1
7813 EOF
7814
7815         fi
7816 else
7817         NCURSES_CONFIG=none
7818 fi
7819
7820         ;;
7821 (ncurses*)
7822
7823 cf_ncuconfig_root=$cf_cv_screen
7824 cf_have_ncuconfig=no
7825
7826 if test "x${PKG_CONFIG:=none}" != xnone; then
7827         echo "$as_me:7827: checking pkg-config for $cf_ncuconfig_root" >&5
7828 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
7829         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
7830                 echo "$as_me:7830: result: yes" >&5
7831 echo "${ECHO_T}yes" >&6
7832
7833                 echo "$as_me:7833: checking if the $cf_ncuconfig_root package files work" >&5
7834 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
7835                 cf_have_ncuconfig=unknown
7836
7837                 cf_save_CPPFLAGS="$CPPFLAGS"
7838                 cf_save_LIBS="$LIBS"
7839
7840                 CPPFLAGS="$CPPFLAGS `$PKG_CONFIG --cflags $cf_ncuconfig_root`"
7841
7842 cf_add_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
7843 # Filter out duplicates - this happens with badly-designed ".pc" files...
7844 for cf_add_1lib in $LIBS
7845 do
7846         for cf_add_2lib in $cf_add_libs
7847         do
7848                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7849                 then
7850                         cf_add_1lib=
7851                         break
7852                 fi
7853         done
7854         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7855 done
7856 LIBS="$cf_add_libs"
7857
7858                 cat >conftest.$ac_ext <<_ACEOF
7859 #line 7859 "configure"
7860 #include "confdefs.h"
7861 #include <${cf_cv_ncurses_header:-curses.h}>
7862 int
7863 main ()
7864 {
7865 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
7866   ;
7867   return 0;
7868 }
7869 _ACEOF
7870 rm -f conftest.$ac_objext conftest$ac_exeext
7871 if { (eval echo "$as_me:7871: \"$ac_link\"") >&5
7872   (eval $ac_link) 2>&5
7873   ac_status=$?
7874   echo "$as_me:7874: \$? = $ac_status" >&5
7875   (exit $ac_status); } &&
7876          { ac_try='test -s conftest$ac_exeext'
7877   { (eval echo "$as_me:7877: \"$ac_try\"") >&5
7878   (eval $ac_try) 2>&5
7879   ac_status=$?
7880   echo "$as_me:7880: \$? = $ac_status" >&5
7881   (exit $ac_status); }; }; then
7882   if test "$cross_compiling" = yes; then
7883   cf_have_ncuconfig=maybe
7884 else
7885   cat >conftest.$ac_ext <<_ACEOF
7886 #line 7886 "configure"
7887 #include "confdefs.h"
7888 #include <${cf_cv_ncurses_header:-curses.h}>
7889                                 int main(void)
7890                                 { char *xx = curses_version(); return (xx == 0); }
7891 _ACEOF
7892 rm -f conftest$ac_exeext
7893 if { (eval echo "$as_me:7893: \"$ac_link\"") >&5
7894   (eval $ac_link) 2>&5
7895   ac_status=$?
7896   echo "$as_me:7896: \$? = $ac_status" >&5
7897   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
7898   { (eval echo "$as_me:7898: \"$ac_try\"") >&5
7899   (eval $ac_try) 2>&5
7900   ac_status=$?
7901   echo "$as_me:7901: \$? = $ac_status" >&5
7902   (exit $ac_status); }; }; then
7903   cf_have_ncuconfig=yes
7904 else
7905   echo "$as_me: program exited with status $ac_status" >&5
7906 echo "$as_me: failed program was:" >&5
7907 cat conftest.$ac_ext >&5
7908 cf_have_ncuconfig=no
7909 fi
7910 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
7911 fi
7912 else
7913   echo "$as_me: failed program was:" >&5
7914 cat conftest.$ac_ext >&5
7915 cf_have_ncuconfig=no
7916 fi
7917 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7918                 echo "$as_me:7918: result: $cf_have_ncuconfig" >&5
7919 echo "${ECHO_T}$cf_have_ncuconfig" >&6
7920                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
7921                 if test "$cf_have_ncuconfig" != "yes"
7922                 then
7923                         CPPFLAGS="$cf_save_CPPFLAGS"
7924                         LIBS="$cf_save_LIBS"
7925                         NCURSES_CONFIG_PKG=none
7926                 else
7927
7928 cat >>confdefs.h <<\EOF
7929 #define NCURSES 1
7930 EOF
7931
7932                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
7933                 fi
7934
7935         else
7936                 echo "$as_me:7936: result: no" >&5
7937 echo "${ECHO_T}no" >&6
7938                 NCURSES_CONFIG_PKG=none
7939         fi
7940 else
7941         NCURSES_CONFIG_PKG=none
7942 fi
7943
7944 if test "x$cf_have_ncuconfig" = "xno"; then
7945         echo "Looking for ${cf_ncuconfig_root}-config"
7946
7947 if test -n "$ac_tool_prefix"; then
7948   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7949   do
7950     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
7951 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
7952 echo "$as_me:7952: checking for $ac_word" >&5
7953 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7954 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
7955   echo $ECHO_N "(cached) $ECHO_C" >&6
7956 else
7957   if test -n "$NCURSES_CONFIG"; then
7958   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
7959 else
7960   ac_save_IFS=$IFS; IFS=$ac_path_separator
7961 ac_dummy="$PATH"
7962 for ac_dir in $ac_dummy; do
7963   IFS=$ac_save_IFS
7964   test -z "$ac_dir" && ac_dir=.
7965   $as_executable_p "$ac_dir/$ac_word" || continue
7966 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
7967 echo "$as_me:7967: found $ac_dir/$ac_word" >&5
7968 break
7969 done
7970
7971 fi
7972 fi
7973 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
7974 if test -n "$NCURSES_CONFIG"; then
7975   echo "$as_me:7975: result: $NCURSES_CONFIG" >&5
7976 echo "${ECHO_T}$NCURSES_CONFIG" >&6
7977 else
7978   echo "$as_me:7978: result: no" >&5
7979 echo "${ECHO_T}no" >&6
7980 fi
7981
7982     test -n "$NCURSES_CONFIG" && break
7983   done
7984 fi
7985 if test -z "$NCURSES_CONFIG"; then
7986   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
7987   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7988 do
7989   # Extract the first word of "$ac_prog", so it can be a program name with args.
7990 set dummy $ac_prog; ac_word=$2
7991 echo "$as_me:7991: checking for $ac_word" >&5
7992 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7993 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
7994   echo $ECHO_N "(cached) $ECHO_C" >&6
7995 else
7996   if test -n "$ac_ct_NCURSES_CONFIG"; then
7997   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
7998 else
7999   ac_save_IFS=$IFS; IFS=$ac_path_separator
8000 ac_dummy="$PATH"
8001 for ac_dir in $ac_dummy; do
8002   IFS=$ac_save_IFS
8003   test -z "$ac_dir" && ac_dir=.
8004   $as_executable_p "$ac_dir/$ac_word" || continue
8005 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
8006 echo "$as_me:8006: found $ac_dir/$ac_word" >&5
8007 break
8008 done
8009
8010 fi
8011 fi
8012 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
8013 if test -n "$ac_ct_NCURSES_CONFIG"; then
8014   echo "$as_me:8014: result: $ac_ct_NCURSES_CONFIG" >&5
8015 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
8016 else
8017   echo "$as_me:8017: result: no" >&5
8018 echo "${ECHO_T}no" >&6
8019 fi
8020
8021   test -n "$ac_ct_NCURSES_CONFIG" && break
8022 done
8023 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
8024
8025   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
8026 fi
8027
8028         if test "$NCURSES_CONFIG" != none ; then
8029
8030                 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
8031
8032 cf_add_libs="`$NCURSES_CONFIG --libs`"
8033 # Filter out duplicates - this happens with badly-designed ".pc" files...
8034 for cf_add_1lib in $LIBS
8035 do
8036         for cf_add_2lib in $cf_add_libs
8037         do
8038                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
8039                 then
8040                         cf_add_1lib=
8041                         break
8042                 fi
8043         done
8044         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
8045 done
8046 LIBS="$cf_add_libs"
8047
8048                 # even with config script, some packages use no-override for curses.h
8049
8050 echo "$as_me:8050: checking if we have identified curses headers" >&5
8051 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
8052 if test "${cf_cv_ncurses_header+set}" = set; then
8053   echo $ECHO_N "(cached) $ECHO_C" >&6
8054 else
8055
8056 cf_cv_ncurses_header=none
8057 for cf_header in \
8058         ncurses.h $cf_cv_screen/ncurses.h \
8059         curses.h $cf_cv_screen/curses.h
8060 do
8061 cat >conftest.$ac_ext <<_ACEOF
8062 #line 8062 "configure"
8063 #include "confdefs.h"
8064 #include <${cf_header}>
8065 int
8066 main ()
8067 {
8068 initscr(); tgoto("?", 0,0)
8069   ;
8070   return 0;
8071 }
8072 _ACEOF
8073 rm -f conftest.$ac_objext
8074 if { (eval echo "$as_me:8074: \"$ac_compile\"") >&5
8075   (eval $ac_compile) 2>&5
8076   ac_status=$?
8077   echo "$as_me:8077: \$? = $ac_status" >&5
8078   (exit $ac_status); } &&
8079          { ac_try='test -s conftest.$ac_objext'
8080   { (eval echo "$as_me:8080: \"$ac_try\"") >&5
8081   (eval $ac_try) 2>&5
8082   ac_status=$?
8083   echo "$as_me:8083: \$? = $ac_status" >&5
8084   (exit $ac_status); }; }; then
8085   cf_cv_ncurses_header=$cf_header; break
8086 else
8087   echo "$as_me: failed program was:" >&5
8088 cat conftest.$ac_ext >&5
8089 fi
8090 rm -f conftest.$ac_objext conftest.$ac_ext
8091 done
8092
8093 fi
8094 echo "$as_me:8094: result: $cf_cv_ncurses_header" >&5
8095 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
8096
8097 if test "$cf_cv_ncurses_header" = none ; then
8098         { { echo "$as_me:8098: error: No curses header-files found" >&5
8099 echo "$as_me: error: No curses header-files found" >&2;}
8100    { (exit 1); exit 1; }; }
8101 fi
8102
8103 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
8104
8105 for ac_header in $cf_cv_ncurses_header
8106 do
8107 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
8108 echo "$as_me:8108: checking for $ac_header" >&5
8109 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
8110 if eval "test \"\${$as_ac_Header+set}\" = set"; then
8111   echo $ECHO_N "(cached) $ECHO_C" >&6
8112 else
8113   cat >conftest.$ac_ext <<_ACEOF
8114 #line 8114 "configure"
8115 #include "confdefs.h"
8116 #include <$ac_header>
8117 _ACEOF
8118 if { (eval echo "$as_me:8118: \"$ac_cpp conftest.$ac_ext\"") >&5
8119   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
8120   ac_status=$?
8121   egrep -v '^ *\+' conftest.er1 >conftest.err
8122   rm -f conftest.er1
8123   cat conftest.err >&5
8124   echo "$as_me:8124: \$? = $ac_status" >&5
8125   (exit $ac_status); } >/dev/null; then
8126   if test -s conftest.err; then
8127     ac_cpp_err=$ac_c_preproc_warn_flag
8128   else
8129     ac_cpp_err=
8130   fi
8131 else
8132   ac_cpp_err=yes
8133 fi
8134 if test -z "$ac_cpp_err"; then
8135   eval "$as_ac_Header=yes"
8136 else
8137   echo "$as_me: failed program was:" >&5
8138   cat conftest.$ac_ext >&5
8139   eval "$as_ac_Header=no"
8140 fi
8141 rm -f conftest.err conftest.$ac_ext
8142 fi
8143 echo "$as_me:8143: result: `eval echo '${'$as_ac_Header'}'`" >&5
8144 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
8145 if test `eval echo '${'$as_ac_Header'}'` = yes; then
8146   cat >>confdefs.h <<EOF
8147 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
8148 EOF
8149
8150 fi
8151 done
8152
8153 cat >>confdefs.h <<\EOF
8154 #define NCURSES 1
8155 EOF
8156
8157 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
8158
8159                 cat >>confdefs.h <<EOF
8160 #define $cf_nculib_ROOT 1
8161 EOF
8162
8163                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
8164
8165         else
8166
8167 cf_ncuhdr_root=$cf_cv_screen
8168
8169 test -n "$cf_cv_curses_dir" && \
8170 test "$cf_cv_curses_dir" != "no" && { \
8171
8172 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
8173   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
8174   do
8175         while test $cf_add_incdir != /usr/include
8176         do
8177           if test -d $cf_add_incdir
8178           then
8179                 cf_have_incdir=no
8180                 if test -n "$CFLAGS$CPPFLAGS" ; then
8181                   # a loop is needed to ensure we can add subdirs of existing dirs
8182                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8183                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8184                           cf_have_incdir=yes; break
8185                         fi
8186                   done
8187                 fi
8188
8189                 if test "$cf_have_incdir" = no ; then
8190                   if test "$cf_add_incdir" = /usr/local/include ; then
8191                         if test "$GCC" = yes
8192                         then
8193                           cf_save_CPPFLAGS=$CPPFLAGS
8194                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8195                           cat >conftest.$ac_ext <<_ACEOF
8196 #line 8196 "configure"
8197 #include "confdefs.h"
8198 #include <stdio.h>
8199 int
8200 main ()
8201 {
8202 printf("Hello")
8203   ;
8204   return 0;
8205 }
8206 _ACEOF
8207 rm -f conftest.$ac_objext
8208 if { (eval echo "$as_me:8208: \"$ac_compile\"") >&5
8209   (eval $ac_compile) 2>&5
8210   ac_status=$?
8211   echo "$as_me:8211: \$? = $ac_status" >&5
8212   (exit $ac_status); } &&
8213          { ac_try='test -s conftest.$ac_objext'
8214   { (eval echo "$as_me:8214: \"$ac_try\"") >&5
8215   (eval $ac_try) 2>&5
8216   ac_status=$?
8217   echo "$as_me:8217: \$? = $ac_status" >&5
8218   (exit $ac_status); }; }; then
8219   :
8220 else
8221   echo "$as_me: failed program was:" >&5
8222 cat conftest.$ac_ext >&5
8223 cf_have_incdir=yes
8224 fi
8225 rm -f conftest.$ac_objext conftest.$ac_ext
8226                           CPPFLAGS=$cf_save_CPPFLAGS
8227                         fi
8228                   fi
8229                 fi
8230
8231                 if test "$cf_have_incdir" = no ; then
8232                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8233
8234 echo "${as_me:-configure}:8234: testing adding $cf_add_incdir to include-path ..." 1>&5
8235
8236                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8237
8238                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8239                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8240                   cf_add_incdir="$cf_top_incdir"
8241                 else
8242                   break
8243                 fi
8244           else
8245                 break
8246           fi
8247         done
8248   done
8249 fi
8250
8251 }
8252
8253 echo "$as_me:8253: checking for $cf_ncuhdr_root header in include-path" >&5
8254 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
8255 if test "${cf_cv_ncurses_h+set}" = set; then
8256   echo $ECHO_N "(cached) $ECHO_C" >&6
8257 else
8258
8259         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
8260         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
8261         for cf_header in $cf_header_list
8262         do
8263
8264         cat >conftest.$ac_ext <<_ACEOF
8265 #line 8265 "configure"
8266 #include "confdefs.h"
8267
8268 #include <$cf_header>
8269 int
8270 main ()
8271 {
8272
8273 #ifdef NCURSES_VERSION
8274
8275 printf("%s\n", NCURSES_VERSION);
8276 #else
8277 #ifdef __NCURSES_H
8278 printf("old\n");
8279 #else
8280         make an error
8281 #endif
8282 #endif
8283
8284   ;
8285   return 0;
8286 }
8287 _ACEOF
8288 rm -f conftest.$ac_objext
8289 if { (eval echo "$as_me:8289: \"$ac_compile\"") >&5
8290   (eval $ac_compile) 2>&5
8291   ac_status=$?
8292   echo "$as_me:8292: \$? = $ac_status" >&5
8293   (exit $ac_status); } &&
8294          { ac_try='test -s conftest.$ac_objext'
8295   { (eval echo "$as_me:8295: \"$ac_try\"") >&5
8296   (eval $ac_try) 2>&5
8297   ac_status=$?
8298   echo "$as_me:8298: \$? = $ac_status" >&5
8299   (exit $ac_status); }; }; then
8300   cf_cv_ncurses_h=$cf_header
8301
8302 else
8303   echo "$as_me: failed program was:" >&5
8304 cat conftest.$ac_ext >&5
8305 cf_cv_ncurses_h=no
8306 fi
8307 rm -f conftest.$ac_objext conftest.$ac_ext
8308
8309                 test "$cf_cv_ncurses_h" != no && break
8310         done
8311
8312 fi
8313 echo "$as_me:8313: result: $cf_cv_ncurses_h" >&5
8314 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
8315
8316 if test "$cf_cv_ncurses_h" != no ; then
8317         cf_cv_ncurses_header=$cf_cv_ncurses_h
8318 else
8319
8320 echo "$as_me:8320: checking for $cf_ncuhdr_root include-path" >&5
8321 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
8322 if test "${cf_cv_ncurses_h2+set}" = set; then
8323   echo $ECHO_N "(cached) $ECHO_C" >&6
8324 else
8325
8326         test -n "$verbose" && echo
8327
8328 cf_search=
8329
8330 # collect the current set of include-directories from compiler flags
8331 cf_header_path_list=""
8332 if test -n "${CFLAGS}${CPPFLAGS}" ; then
8333         for cf_header_path in $CPPFLAGS $CFLAGS
8334         do
8335                 case $cf_header_path in
8336                 (-I*)
8337                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
8338
8339 test "x$cf_header_path" != "xNONE" && \
8340 test -d "$cf_header_path" && \
8341  {
8342         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
8343         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
8344         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
8345         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
8346         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
8347         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"
8348 }
8349
8350                         cf_header_path_list="$cf_header_path_list $cf_search"
8351                         ;;
8352                 esac
8353         done
8354 fi
8355
8356 # add the variations for the package we are looking for
8357
8358 cf_search=
8359
8360 test "x$prefix" != "xNONE" && \
8361 test -d "$prefix" && \
8362  {
8363         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
8364         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
8365         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
8366         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
8367         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
8368         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8369 }
8370
8371 for cf_subdir_prefix in \
8372         /usr \
8373         /usr/local \
8374         /usr/pkg \
8375         /opt \
8376         /opt/local \
8377         $HOME
8378 do
8379
8380 test "x$cf_subdir_prefix" != "x$prefix" && \
8381 test -d "$cf_subdir_prefix" && \
8382 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
8383         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
8384         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
8385         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
8386         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
8387         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
8388         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"
8389 }
8390
8391 done
8392
8393 test "$includedir" != NONE && \
8394 test "$includedir" != "/usr/include" && \
8395 test -d "$includedir" && {
8396         test -d $includedir &&    cf_search="$cf_search $includedir"
8397         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
8398 }
8399
8400 test "$oldincludedir" != NONE && \
8401 test "$oldincludedir" != "/usr/include" && \
8402 test -d "$oldincludedir" && {
8403         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
8404         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
8405 }
8406
8407 cf_search="$cf_search $cf_header_path_list"
8408
8409         test -n "$verbose" && echo search path $cf_search
8410         cf_save2_CPPFLAGS="$CPPFLAGS"
8411         for cf_incdir in $cf_search
8412         do
8413
8414 if test -n "$cf_incdir" ; then
8415   for cf_add_incdir in $cf_incdir
8416   do
8417         while test $cf_add_incdir != /usr/include
8418         do
8419           if test -d $cf_add_incdir
8420           then
8421                 cf_have_incdir=no
8422                 if test -n "$CFLAGS$CPPFLAGS" ; then
8423                   # a loop is needed to ensure we can add subdirs of existing dirs
8424                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8425                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8426                           cf_have_incdir=yes; break
8427                         fi
8428                   done
8429                 fi
8430
8431                 if test "$cf_have_incdir" = no ; then
8432                   if test "$cf_add_incdir" = /usr/local/include ; then
8433                         if test "$GCC" = yes
8434                         then
8435                           cf_save_CPPFLAGS=$CPPFLAGS
8436                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8437                           cat >conftest.$ac_ext <<_ACEOF
8438 #line 8438 "configure"
8439 #include "confdefs.h"
8440 #include <stdio.h>
8441 int
8442 main ()
8443 {
8444 printf("Hello")
8445   ;
8446   return 0;
8447 }
8448 _ACEOF
8449 rm -f conftest.$ac_objext
8450 if { (eval echo "$as_me:8450: \"$ac_compile\"") >&5
8451   (eval $ac_compile) 2>&5
8452   ac_status=$?
8453   echo "$as_me:8453: \$? = $ac_status" >&5
8454   (exit $ac_status); } &&
8455          { ac_try='test -s conftest.$ac_objext'
8456   { (eval echo "$as_me:8456: \"$ac_try\"") >&5
8457   (eval $ac_try) 2>&5
8458   ac_status=$?
8459   echo "$as_me:8459: \$? = $ac_status" >&5
8460   (exit $ac_status); }; }; then
8461   :
8462 else
8463   echo "$as_me: failed program was:" >&5
8464 cat conftest.$ac_ext >&5
8465 cf_have_incdir=yes
8466 fi
8467 rm -f conftest.$ac_objext conftest.$ac_ext
8468                           CPPFLAGS=$cf_save_CPPFLAGS
8469                         fi
8470                   fi
8471                 fi
8472
8473                 if test "$cf_have_incdir" = no ; then
8474                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8475
8476 echo "${as_me:-configure}:8476: testing adding $cf_add_incdir to include-path ..." 1>&5
8477
8478                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8479
8480                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8481                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8482                   cf_add_incdir="$cf_top_incdir"
8483                 else
8484                   break
8485                 fi
8486           else
8487                 break
8488           fi
8489         done
8490   done
8491 fi
8492
8493                 for cf_header in \
8494                         ncurses.h \
8495                         curses.h
8496                 do
8497
8498         cat >conftest.$ac_ext <<_ACEOF
8499 #line 8499 "configure"
8500 #include "confdefs.h"
8501
8502 #include <$cf_header>
8503 int
8504 main ()
8505 {
8506
8507 #ifdef NCURSES_VERSION
8508
8509 printf("%s\n", NCURSES_VERSION);
8510 #else
8511 #ifdef __NCURSES_H
8512 printf("old\n");
8513 #else
8514         make an error
8515 #endif
8516 #endif
8517
8518   ;
8519   return 0;
8520 }
8521 _ACEOF
8522 rm -f conftest.$ac_objext
8523 if { (eval echo "$as_me:8523: \"$ac_compile\"") >&5
8524   (eval $ac_compile) 2>&5
8525   ac_status=$?
8526   echo "$as_me:8526: \$? = $ac_status" >&5
8527   (exit $ac_status); } &&
8528          { ac_try='test -s conftest.$ac_objext'
8529   { (eval echo "$as_me:8529: \"$ac_try\"") >&5
8530   (eval $ac_try) 2>&5
8531   ac_status=$?
8532   echo "$as_me:8532: \$? = $ac_status" >&5
8533   (exit $ac_status); }; }; then
8534   cf_cv_ncurses_h2=$cf_header
8535
8536 else
8537   echo "$as_me: failed program was:" >&5
8538 cat conftest.$ac_ext >&5
8539 cf_cv_ncurses_h2=no
8540 fi
8541 rm -f conftest.$ac_objext conftest.$ac_ext
8542
8543                         if test "$cf_cv_ncurses_h2" != no ; then
8544                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
8545                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
8546                                 break
8547                         fi
8548                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
8549                 done
8550                 CPPFLAGS="$cf_save2_CPPFLAGS"
8551                 test "$cf_cv_ncurses_h2" != no && break
8552         done
8553         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:8553: error: not found" >&5
8554 echo "$as_me: error: not found" >&2;}
8555    { (exit 1); exit 1; }; }
8556
8557 fi
8558 echo "$as_me:8558: result: $cf_cv_ncurses_h2" >&5
8559 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
8560
8561         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
8562         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
8563         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
8564                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
8565         fi
8566
8567 if test -n "$cf_1st_incdir" ; then
8568   for cf_add_incdir in $cf_1st_incdir
8569   do
8570         while test $cf_add_incdir != /usr/include
8571         do
8572           if test -d $cf_add_incdir
8573           then
8574                 cf_have_incdir=no
8575                 if test -n "$CFLAGS$CPPFLAGS" ; then
8576                   # a loop is needed to ensure we can add subdirs of existing dirs
8577                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8578                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8579                           cf_have_incdir=yes; break
8580                         fi
8581                   done
8582                 fi
8583
8584                 if test "$cf_have_incdir" = no ; then
8585                   if test "$cf_add_incdir" = /usr/local/include ; then
8586                         if test "$GCC" = yes
8587                         then
8588                           cf_save_CPPFLAGS=$CPPFLAGS
8589                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8590                           cat >conftest.$ac_ext <<_ACEOF
8591 #line 8591 "configure"
8592 #include "confdefs.h"
8593 #include <stdio.h>
8594 int
8595 main ()
8596 {
8597 printf("Hello")
8598   ;
8599   return 0;
8600 }
8601 _ACEOF
8602 rm -f conftest.$ac_objext
8603 if { (eval echo "$as_me:8603: \"$ac_compile\"") >&5
8604   (eval $ac_compile) 2>&5
8605   ac_status=$?
8606   echo "$as_me:8606: \$? = $ac_status" >&5
8607   (exit $ac_status); } &&
8608          { ac_try='test -s conftest.$ac_objext'
8609   { (eval echo "$as_me:8609: \"$ac_try\"") >&5
8610   (eval $ac_try) 2>&5
8611   ac_status=$?
8612   echo "$as_me:8612: \$? = $ac_status" >&5
8613   (exit $ac_status); }; }; then
8614   :
8615 else
8616   echo "$as_me: failed program was:" >&5
8617 cat conftest.$ac_ext >&5
8618 cf_have_incdir=yes
8619 fi
8620 rm -f conftest.$ac_objext conftest.$ac_ext
8621                           CPPFLAGS=$cf_save_CPPFLAGS
8622                         fi
8623                   fi
8624                 fi
8625
8626                 if test "$cf_have_incdir" = no ; then
8627                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8628
8629 echo "${as_me:-configure}:8629: testing adding $cf_add_incdir to include-path ..." 1>&5
8630
8631                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8632
8633                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8634                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8635                   cf_add_incdir="$cf_top_incdir"
8636                 else
8637                   break
8638                 fi
8639           else
8640                 break
8641           fi
8642         done
8643   done
8644 fi
8645
8646 fi
8647
8648 # Set definitions to allow ifdef'ing for ncurses.h
8649
8650 case $cf_cv_ncurses_header in
8651 (*ncurses.h)
8652
8653 cat >>confdefs.h <<\EOF
8654 #define HAVE_NCURSES_H 1
8655 EOF
8656
8657         ;;
8658 esac
8659
8660 case $cf_cv_ncurses_header in
8661 (ncurses/curses.h|ncurses/ncurses.h)
8662
8663 cat >>confdefs.h <<\EOF
8664 #define HAVE_NCURSES_NCURSES_H 1
8665 EOF
8666
8667         ;;
8668 (ncursesw/curses.h|ncursesw/ncurses.h)
8669
8670 cat >>confdefs.h <<\EOF
8671 #define HAVE_NCURSESW_NCURSES_H 1
8672 EOF
8673
8674         ;;
8675 esac
8676
8677 echo "$as_me:8677: checking for terminfo header" >&5
8678 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
8679 if test "${cf_cv_term_header+set}" = set; then
8680   echo $ECHO_N "(cached) $ECHO_C" >&6
8681 else
8682
8683 case ${cf_cv_ncurses_header} in
8684 (*/ncurses.h|*/ncursesw.h)
8685         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
8686         ;;
8687 (*)
8688         cf_term_header=term.h
8689         ;;
8690 esac
8691
8692 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
8693 do
8694 cat >conftest.$ac_ext <<_ACEOF
8695 #line 8695 "configure"
8696 #include "confdefs.h"
8697 #include <stdio.h>
8698 #include <${cf_cv_ncurses_header:-curses.h}>
8699 #include <$cf_test>
8700
8701 int
8702 main ()
8703 {
8704 int x = auto_left_margin
8705   ;
8706   return 0;
8707 }
8708 _ACEOF
8709 rm -f conftest.$ac_objext
8710 if { (eval echo "$as_me:8710: \"$ac_compile\"") >&5
8711   (eval $ac_compile) 2>&5
8712   ac_status=$?
8713   echo "$as_me:8713: \$? = $ac_status" >&5
8714   (exit $ac_status); } &&
8715          { ac_try='test -s conftest.$ac_objext'
8716   { (eval echo "$as_me:8716: \"$ac_try\"") >&5
8717   (eval $ac_try) 2>&5
8718   ac_status=$?
8719   echo "$as_me:8719: \$? = $ac_status" >&5
8720   (exit $ac_status); }; }; then
8721
8722         cf_cv_term_header="$cf_test"
8723 else
8724   echo "$as_me: failed program was:" >&5
8725 cat conftest.$ac_ext >&5
8726
8727         cf_cv_term_header=unknown
8728
8729 fi
8730 rm -f conftest.$ac_objext conftest.$ac_ext
8731         test "$cf_cv_term_header" != unknown && break
8732 done
8733
8734 fi
8735 echo "$as_me:8735: result: $cf_cv_term_header" >&5
8736 echo "${ECHO_T}$cf_cv_term_header" >&6
8737
8738 # Set definitions to allow ifdef'ing to accommodate subdirectories
8739
8740 case $cf_cv_term_header in
8741 (*term.h)
8742
8743 cat >>confdefs.h <<\EOF
8744 #define HAVE_TERM_H 1
8745 EOF
8746
8747         ;;
8748 esac
8749
8750 case $cf_cv_term_header in
8751 (ncurses/term.h)
8752
8753 cat >>confdefs.h <<\EOF
8754 #define HAVE_NCURSES_TERM_H 1
8755 EOF
8756
8757         ;;
8758 (ncursesw/term.h)
8759
8760 cat >>confdefs.h <<\EOF
8761 #define HAVE_NCURSESW_TERM_H 1
8762 EOF
8763
8764         ;;
8765 esac
8766
8767 # some applications need this, but should check for NCURSES_VERSION
8768
8769 cat >>confdefs.h <<\EOF
8770 #define NCURSES 1
8771 EOF
8772
8773 echo "$as_me:8773: checking for ncurses version" >&5
8774 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
8775 if test "${cf_cv_ncurses_version+set}" = set; then
8776   echo $ECHO_N "(cached) $ECHO_C" >&6
8777 else
8778
8779         cf_cv_ncurses_version=no
8780         cf_tempfile=out$$
8781         rm -f $cf_tempfile
8782         if test "$cross_compiling" = yes; then
8783
8784         # This will not work if the preprocessor splits the line after the
8785         # Autoconf token.  The 'unproto' program does that.
8786         cat > conftest.$ac_ext <<EOF
8787 #include <${cf_cv_ncurses_header:-curses.h}>
8788 #undef Autoconf
8789 #ifdef NCURSES_VERSION
8790 Autoconf NCURSES_VERSION
8791 #else
8792 #ifdef __NCURSES_H
8793 Autoconf "old"
8794 #endif
8795 ;
8796 #endif
8797 EOF
8798         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
8799         { (eval echo "$as_me:8799: \"$cf_try\"") >&5
8800   (eval $cf_try) 2>&5
8801   ac_status=$?
8802   echo "$as_me:8802: \$? = $ac_status" >&5
8803   (exit $ac_status); }
8804         if test -f conftest.out ; then
8805                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
8806                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
8807                 rm -f conftest.out
8808         fi
8809
8810 else
8811   cat >conftest.$ac_ext <<_ACEOF
8812 #line 8812 "configure"
8813 #include "confdefs.h"
8814
8815 #include <${cf_cv_ncurses_header:-curses.h}>
8816 #include <stdio.h>
8817 int main()
8818 {
8819         FILE *fp = fopen("$cf_tempfile", "w");
8820 #ifdef NCURSES_VERSION
8821 # ifdef NCURSES_VERSION_PATCH
8822         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
8823 # else
8824         fprintf(fp, "%s\n", NCURSES_VERSION);
8825 # endif
8826 #else
8827 # ifdef __NCURSES_H
8828         fprintf(fp, "old\n");
8829 # else
8830         make an error
8831 # endif
8832 #endif
8833         ${cf_cv_main_return:-return}(0);
8834 }
8835 _ACEOF
8836 rm -f conftest$ac_exeext
8837 if { (eval echo "$as_me:8837: \"$ac_link\"") >&5
8838   (eval $ac_link) 2>&5
8839   ac_status=$?
8840   echo "$as_me:8840: \$? = $ac_status" >&5
8841   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
8842   { (eval echo "$as_me:8842: \"$ac_try\"") >&5
8843   (eval $ac_try) 2>&5
8844   ac_status=$?
8845   echo "$as_me:8845: \$? = $ac_status" >&5
8846   (exit $ac_status); }; }; then
8847
8848         cf_cv_ncurses_version=`cat $cf_tempfile`
8849 else
8850   echo "$as_me: program exited with status $ac_status" >&5
8851 echo "$as_me: failed program was:" >&5
8852 cat conftest.$ac_ext >&5
8853 fi
8854 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
8855 fi
8856         rm -f $cf_tempfile
8857
8858 fi
8859 echo "$as_me:8859: result: $cf_cv_ncurses_version" >&5
8860 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
8861 test "$cf_cv_ncurses_version" = no ||
8862 cat >>confdefs.h <<\EOF
8863 #define NCURSES 1
8864 EOF
8865
8866 cf_nculib_root=$cf_cv_screen
8867         # This works, except for the special case where we find gpm, but
8868         # ncurses is in a nonstandard location via $LIBS, and we really want
8869         # to link gpm.
8870 cf_ncurses_LIBS=""
8871 cf_ncurses_SAVE="$LIBS"
8872 echo "$as_me:8872: checking for Gpm_Open in -lgpm" >&5
8873 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
8874 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
8875   echo $ECHO_N "(cached) $ECHO_C" >&6
8876 else
8877   ac_check_lib_save_LIBS=$LIBS
8878 LIBS="-lgpm  $LIBS"
8879 cat >conftest.$ac_ext <<_ACEOF
8880 #line 8880 "configure"
8881 #include "confdefs.h"
8882
8883 /* Override any gcc2 internal prototype to avoid an error.  */
8884 #ifdef __cplusplus
8885 extern "C"
8886 #endif
8887 /* We use char because int might match the return type of a gcc2
8888    builtin and then its argument prototype would still apply.  */
8889 char Gpm_Open ();
8890 int
8891 main ()
8892 {
8893 Gpm_Open ();
8894   ;
8895   return 0;
8896 }
8897 _ACEOF
8898 rm -f conftest.$ac_objext conftest$ac_exeext
8899 if { (eval echo "$as_me:8899: \"$ac_link\"") >&5
8900   (eval $ac_link) 2>&5
8901   ac_status=$?
8902   echo "$as_me:8902: \$? = $ac_status" >&5
8903   (exit $ac_status); } &&
8904          { ac_try='test -s conftest$ac_exeext'
8905   { (eval echo "$as_me:8905: \"$ac_try\"") >&5
8906   (eval $ac_try) 2>&5
8907   ac_status=$?
8908   echo "$as_me:8908: \$? = $ac_status" >&5
8909   (exit $ac_status); }; }; then
8910   ac_cv_lib_gpm_Gpm_Open=yes
8911 else
8912   echo "$as_me: failed program was:" >&5
8913 cat conftest.$ac_ext >&5
8914 ac_cv_lib_gpm_Gpm_Open=no
8915 fi
8916 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8917 LIBS=$ac_check_lib_save_LIBS
8918 fi
8919 echo "$as_me:8919: result: $ac_cv_lib_gpm_Gpm_Open" >&5
8920 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
8921 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
8922   echo "$as_me:8922: checking for initscr in -lgpm" >&5
8923 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
8924 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
8925   echo $ECHO_N "(cached) $ECHO_C" >&6
8926 else
8927   ac_check_lib_save_LIBS=$LIBS
8928 LIBS="-lgpm  $LIBS"
8929 cat >conftest.$ac_ext <<_ACEOF
8930 #line 8930 "configure"
8931 #include "confdefs.h"
8932
8933 /* Override any gcc2 internal prototype to avoid an error.  */
8934 #ifdef __cplusplus
8935 extern "C"
8936 #endif
8937 /* We use char because int might match the return type of a gcc2
8938    builtin and then its argument prototype would still apply.  */
8939 char initscr ();
8940 int
8941 main ()
8942 {
8943 initscr ();
8944   ;
8945   return 0;
8946 }
8947 _ACEOF
8948 rm -f conftest.$ac_objext conftest$ac_exeext
8949 if { (eval echo "$as_me:8949: \"$ac_link\"") >&5
8950   (eval $ac_link) 2>&5
8951   ac_status=$?
8952   echo "$as_me:8952: \$? = $ac_status" >&5
8953   (exit $ac_status); } &&
8954          { ac_try='test -s conftest$ac_exeext'
8955   { (eval echo "$as_me:8955: \"$ac_try\"") >&5
8956   (eval $ac_try) 2>&5
8957   ac_status=$?
8958   echo "$as_me:8958: \$? = $ac_status" >&5
8959   (exit $ac_status); }; }; then
8960   ac_cv_lib_gpm_initscr=yes
8961 else
8962   echo "$as_me: failed program was:" >&5
8963 cat conftest.$ac_ext >&5
8964 ac_cv_lib_gpm_initscr=no
8965 fi
8966 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8967 LIBS=$ac_check_lib_save_LIBS
8968 fi
8969 echo "$as_me:8969: result: $ac_cv_lib_gpm_initscr" >&5
8970 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
8971 if test $ac_cv_lib_gpm_initscr = yes; then
8972   LIBS="$cf_ncurses_SAVE"
8973 else
8974   cf_ncurses_LIBS="-lgpm"
8975 fi
8976
8977 fi
8978
8979 case $host_os in
8980 (freebsd*)
8981         # This is only necessary if you are linking against an obsolete
8982         # version of ncurses (but it should do no harm, since it's static).
8983         if test "$cf_nculib_root" = ncurses ; then
8984                 echo "$as_me:8984: checking for tgoto in -lmytinfo" >&5
8985 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
8986 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
8987   echo $ECHO_N "(cached) $ECHO_C" >&6
8988 else
8989   ac_check_lib_save_LIBS=$LIBS
8990 LIBS="-lmytinfo  $LIBS"
8991 cat >conftest.$ac_ext <<_ACEOF
8992 #line 8992 "configure"
8993 #include "confdefs.h"
8994
8995 /* Override any gcc2 internal prototype to avoid an error.  */
8996 #ifdef __cplusplus
8997 extern "C"
8998 #endif
8999 /* We use char because int might match the return type of a gcc2
9000    builtin and then its argument prototype would still apply.  */
9001 char tgoto ();
9002 int
9003 main ()
9004 {
9005 tgoto ();
9006   ;
9007   return 0;
9008 }
9009 _ACEOF
9010 rm -f conftest.$ac_objext conftest$ac_exeext
9011 if { (eval echo "$as_me:9011: \"$ac_link\"") >&5
9012   (eval $ac_link) 2>&5
9013   ac_status=$?
9014   echo "$as_me:9014: \$? = $ac_status" >&5
9015   (exit $ac_status); } &&
9016          { ac_try='test -s conftest$ac_exeext'
9017   { (eval echo "$as_me:9017: \"$ac_try\"") >&5
9018   (eval $ac_try) 2>&5
9019   ac_status=$?
9020   echo "$as_me:9020: \$? = $ac_status" >&5
9021   (exit $ac_status); }; }; then
9022   ac_cv_lib_mytinfo_tgoto=yes
9023 else
9024   echo "$as_me: failed program was:" >&5
9025 cat conftest.$ac_ext >&5
9026 ac_cv_lib_mytinfo_tgoto=no
9027 fi
9028 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9029 LIBS=$ac_check_lib_save_LIBS
9030 fi
9031 echo "$as_me:9031: result: $ac_cv_lib_mytinfo_tgoto" >&5
9032 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
9033 if test $ac_cv_lib_mytinfo_tgoto = yes; then
9034   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
9035 fi
9036
9037         fi
9038         ;;
9039 esac
9040
9041 cf_add_libs="$cf_ncurses_LIBS"
9042 # Filter out duplicates - this happens with badly-designed ".pc" files...
9043 for cf_add_1lib in $LIBS
9044 do
9045         for cf_add_2lib in $cf_add_libs
9046         do
9047                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
9048                 then
9049                         cf_add_1lib=
9050                         break
9051                 fi
9052         done
9053         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
9054 done
9055 LIBS="$cf_add_libs"
9056
9057 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
9058 then
9059
9060 cf_add_libs="-l$cf_nculib_root"
9061 # Filter out duplicates - this happens with badly-designed ".pc" files...
9062 for cf_add_1lib in $LIBS
9063 do
9064         for cf_add_2lib in $cf_add_libs
9065         do
9066                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
9067                 then
9068                         cf_add_1lib=
9069                         break
9070                 fi
9071         done
9072         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
9073 done
9074 LIBS="$cf_add_libs"
9075
9076 else
9077
9078         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
9079         cf_libdir=""
9080         echo "$as_me:9080: checking for initscr" >&5
9081 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
9082 if test "${ac_cv_func_initscr+set}" = set; then
9083   echo $ECHO_N "(cached) $ECHO_C" >&6
9084 else
9085   cat >conftest.$ac_ext <<_ACEOF
9086 #line 9086 "configure"
9087 #include "confdefs.h"
9088 /* System header to define __stub macros and hopefully few prototypes,
9089     which can conflict with char initscr (); below.  */
9090 #include <assert.h>
9091 /* Override any gcc2 internal prototype to avoid an error.  */
9092 #ifdef __cplusplus
9093 extern "C"
9094 #endif
9095 /* We use char because int might match the return type of a gcc2
9096    builtin and then its argument prototype would still apply.  */
9097 char initscr ();
9098 char (*f) ();
9099
9100 int
9101 main ()
9102 {
9103 /* The GNU C library defines this for functions which it implements
9104     to always fail with ENOSYS.  Some functions are actually named
9105     something starting with __ and the normal name is an alias.  */
9106 #if defined (__stub_initscr) || defined (__stub___initscr)
9107 choke me
9108 #else
9109 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
9110 #endif
9111
9112   ;
9113   return 0;
9114 }
9115 _ACEOF
9116 rm -f conftest.$ac_objext conftest$ac_exeext
9117 if { (eval echo "$as_me:9117: \"$ac_link\"") >&5
9118   (eval $ac_link) 2>&5
9119   ac_status=$?
9120   echo "$as_me:9120: \$? = $ac_status" >&5
9121   (exit $ac_status); } &&
9122          { ac_try='test -s conftest$ac_exeext'
9123   { (eval echo "$as_me:9123: \"$ac_try\"") >&5
9124   (eval $ac_try) 2>&5
9125   ac_status=$?
9126   echo "$as_me:9126: \$? = $ac_status" >&5
9127   (exit $ac_status); }; }; then
9128   ac_cv_func_initscr=yes
9129 else
9130   echo "$as_me: failed program was:" >&5
9131 cat conftest.$ac_ext >&5
9132 ac_cv_func_initscr=no
9133 fi
9134 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9135 fi
9136 echo "$as_me:9136: result: $ac_cv_func_initscr" >&5
9137 echo "${ECHO_T}$ac_cv_func_initscr" >&6
9138 if test $ac_cv_func_initscr = yes; then
9139   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9140 else
9141
9142                 cf_save_LIBS="$LIBS"
9143                 echo "$as_me:9143: checking for initscr in -l$cf_nculib_root" >&5
9144 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
9145                 LIBS="-l$cf_nculib_root $LIBS"
9146                 cat >conftest.$ac_ext <<_ACEOF
9147 #line 9147 "configure"
9148 #include "confdefs.h"
9149 #include <${cf_cv_ncurses_header:-curses.h}>
9150 int
9151 main ()
9152 {
9153 initscr()
9154   ;
9155   return 0;
9156 }
9157 _ACEOF
9158 rm -f conftest.$ac_objext conftest$ac_exeext
9159 if { (eval echo "$as_me:9159: \"$ac_link\"") >&5
9160   (eval $ac_link) 2>&5
9161   ac_status=$?
9162   echo "$as_me:9162: \$? = $ac_status" >&5
9163   (exit $ac_status); } &&
9164          { ac_try='test -s conftest$ac_exeext'
9165   { (eval echo "$as_me:9165: \"$ac_try\"") >&5
9166   (eval $ac_try) 2>&5
9167   ac_status=$?
9168   echo "$as_me:9168: \$? = $ac_status" >&5
9169   (exit $ac_status); }; }; then
9170   echo "$as_me:9170: result: yes" >&5
9171 echo "${ECHO_T}yes" >&6
9172                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9173
9174 else
9175   echo "$as_me: failed program was:" >&5
9176 cat conftest.$ac_ext >&5
9177 echo "$as_me:9177: result: no" >&5
9178 echo "${ECHO_T}no" >&6
9179
9180 cf_search=
9181 cf_library_path_list=""
9182 if test -n "${LDFLAGS}${LIBS}" ; then
9183         for cf_library_path in $LDFLAGS $LIBS
9184         do
9185                 case $cf_library_path in
9186                 (-L*)
9187                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
9188
9189 test "x$cf_library_path" != "xNONE" && \
9190 test -d "$cf_library_path" && \
9191  {
9192         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
9193         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
9194         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
9195         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
9196         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
9197         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"
9198 }
9199
9200                         cf_library_path_list="$cf_library_path_list $cf_search"
9201                         ;;
9202                 esac
9203         done
9204 fi
9205
9206 cf_search=
9207
9208 test "x$prefix" != "xNONE" && \
9209 test -d "$prefix" && \
9210  {
9211         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
9212         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
9213         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
9214         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
9215         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
9216         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
9217 }
9218
9219 for cf_subdir_prefix in \
9220         /usr \
9221         /usr/local \
9222         /usr/pkg \
9223         /opt \
9224         /opt/local \
9225         $HOME
9226 do
9227
9228 test "x$cf_subdir_prefix" != "x$prefix" && \
9229 test -d "$cf_subdir_prefix" && \
9230 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
9231         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
9232         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
9233         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
9234         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
9235         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
9236         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"
9237 }
9238
9239 done
9240
9241 cf_search="$cf_library_path_list $cf_search"
9242
9243                         for cf_libdir in $cf_search
9244                         do
9245                                 echo "$as_me:9245: checking for -l$cf_nculib_root in $cf_libdir" >&5
9246 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
9247                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
9248                                 cat >conftest.$ac_ext <<_ACEOF
9249 #line 9249 "configure"
9250 #include "confdefs.h"
9251 #include <${cf_cv_ncurses_header:-curses.h}>
9252 int
9253 main ()
9254 {
9255 initscr()
9256   ;
9257   return 0;
9258 }
9259 _ACEOF
9260 rm -f conftest.$ac_objext conftest$ac_exeext
9261 if { (eval echo "$as_me:9261: \"$ac_link\"") >&5
9262   (eval $ac_link) 2>&5
9263   ac_status=$?
9264   echo "$as_me:9264: \$? = $ac_status" >&5
9265   (exit $ac_status); } &&
9266          { ac_try='test -s conftest$ac_exeext'
9267   { (eval echo "$as_me:9267: \"$ac_try\"") >&5
9268   (eval $ac_try) 2>&5
9269   ac_status=$?
9270   echo "$as_me:9270: \$? = $ac_status" >&5
9271   (exit $ac_status); }; }; then
9272   echo "$as_me:9272: result: yes" >&5
9273 echo "${ECHO_T}yes" >&6
9274                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9275                                          break
9276 else
9277   echo "$as_me: failed program was:" >&5
9278 cat conftest.$ac_ext >&5
9279 echo "$as_me:9279: result: no" >&5
9280 echo "${ECHO_T}no" >&6
9281                                          LIBS="$cf_save_LIBS"
9282 fi
9283 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9284                         done
9285
9286 fi
9287 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9288
9289 fi
9290
9291 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
9292
9293 if test $cf_found_library = no ; then
9294         { { echo "$as_me:9294: error: Cannot link $cf_nculib_root library" >&5
9295 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
9296    { (exit 1); exit 1; }; }
9297 fi
9298
9299 fi
9300
9301 if test -n "$cf_ncurses_LIBS" ; then
9302         echo "$as_me:9302: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
9303 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
9304         cf_ncurses_SAVE="$LIBS"
9305         for p in $cf_ncurses_LIBS ; do
9306                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
9307                 if test "$q" != "$LIBS" ; then
9308                         LIBS="$q"
9309                 fi
9310         done
9311         cat >conftest.$ac_ext <<_ACEOF
9312 #line 9312 "configure"
9313 #include "confdefs.h"
9314 #include <${cf_cv_ncurses_header:-curses.h}>
9315 int
9316 main ()
9317 {
9318 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
9319   ;
9320   return 0;
9321 }
9322 _ACEOF
9323 rm -f conftest.$ac_objext conftest$ac_exeext
9324 if { (eval echo "$as_me:9324: \"$ac_link\"") >&5
9325   (eval $ac_link) 2>&5
9326   ac_status=$?
9327   echo "$as_me:9327: \$? = $ac_status" >&5
9328   (exit $ac_status); } &&
9329          { ac_try='test -s conftest$ac_exeext'
9330   { (eval echo "$as_me:9330: \"$ac_try\"") >&5
9331   (eval $ac_try) 2>&5
9332   ac_status=$?
9333   echo "$as_me:9333: \$? = $ac_status" >&5
9334   (exit $ac_status); }; }; then
9335   echo "$as_me:9335: result: yes" >&5
9336 echo "${ECHO_T}yes" >&6
9337 else
9338   echo "$as_me: failed program was:" >&5
9339 cat conftest.$ac_ext >&5
9340 echo "$as_me:9340: result: no" >&5
9341 echo "${ECHO_T}no" >&6
9342                  LIBS="$cf_ncurses_SAVE"
9343 fi
9344 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9345 fi
9346
9347 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9348
9349 cat >>confdefs.h <<EOF
9350 #define $cf_nculib_ROOT 1
9351 EOF
9352
9353         fi
9354 else
9355         NCURSES_CONFIG=none
9356 fi
9357
9358         ;;
9359 (pdcurses)
9360         echo "$as_me:9360: checking for X" >&5
9361 echo $ECHO_N "checking for X... $ECHO_C" >&6
9362
9363 # Check whether --with-x or --without-x was given.
9364 if test "${with_x+set}" = set; then
9365   withval="$with_x"
9366
9367 fi;
9368 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
9369 if test "x$with_x" = xno; then
9370   # The user explicitly disabled X.
9371   have_x=disabled
9372 else
9373   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
9374     # Both variables are already set.
9375     have_x=yes
9376   else
9377     if test "${ac_cv_have_x+set}" = set; then
9378   echo $ECHO_N "(cached) $ECHO_C" >&6
9379 else
9380   # One or both of the vars are not set, and there is no cached value.
9381 ac_x_includes=no ac_x_libraries=no
9382 rm -fr conftest.dir
9383 if mkdir conftest.dir; then
9384   cd conftest.dir
9385   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
9386   cat >Imakefile <<'EOF'
9387 acfindx:
9388         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
9389 EOF
9390   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
9391     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
9392     eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
9393     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
9394     for ac_extension in a so sl dylib dll; do
9395       if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
9396          test -f $ac_im_libdir/libX11.$ac_extension; then
9397         ac_im_usrlibdir=$ac_im_libdir; break
9398       fi
9399     done
9400     # Screen out bogus values from the imake configuration.  They are
9401     # bogus both because they are the default anyway, and because
9402     # using them would break gcc on systems where it needs fixed includes.
9403     case $ac_im_incroot in
9404         /usr/include) ;;
9405         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
9406     esac
9407     case $ac_im_usrlibdir in
9408         /usr/lib | /lib) ;;
9409         *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
9410     esac
9411   fi
9412   cd ..
9413   rm -fr conftest.dir
9414 fi
9415
9416 # Standard set of common directories for X headers.
9417 # Check X11 before X11Rn because it is often a symlink to the current release.
9418 ac_x_header_dirs='
9419 /usr/X11/include
9420 /usr/X11R6/include
9421 /usr/X11R5/include
9422 /usr/X11R4/include
9423
9424 /usr/include/X11
9425 /usr/include/X11R6
9426 /usr/include/X11R5
9427 /usr/include/X11R4
9428
9429 /usr/local/X11/include
9430 /usr/local/X11R6/include
9431 /usr/local/X11R5/include
9432 /usr/local/X11R4/include
9433
9434 /usr/local/include/X11
9435 /usr/local/include/X11R6
9436 /usr/local/include/X11R5
9437 /usr/local/include/X11R4
9438
9439 /usr/X386/include
9440 /usr/x386/include
9441 /usr/XFree86/include/X11
9442
9443 /usr/include
9444 /usr/local/include
9445 /usr/unsupported/include
9446 /usr/athena/include
9447 /usr/local/x11r5/include
9448 /usr/lpp/Xamples/include
9449
9450 /usr/openwin/include
9451 /usr/openwin/share/include'
9452
9453 if test "$ac_x_includes" = no; then
9454   # Guess where to find include files, by looking for Intrinsic.h.
9455   # First, try using that file with no special directory specified.
9456   cat >conftest.$ac_ext <<_ACEOF
9457 #line 9457 "configure"
9458 #include "confdefs.h"
9459 #include <X11/Intrinsic.h>
9460 _ACEOF
9461 if { (eval echo "$as_me:9461: \"$ac_cpp conftest.$ac_ext\"") >&5
9462   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
9463   ac_status=$?
9464   egrep -v '^ *\+' conftest.er1 >conftest.err
9465   rm -f conftest.er1
9466   cat conftest.err >&5
9467   echo "$as_me:9467: \$? = $ac_status" >&5
9468   (exit $ac_status); } >/dev/null; then
9469   if test -s conftest.err; then
9470     ac_cpp_err=$ac_c_preproc_warn_flag
9471   else
9472     ac_cpp_err=
9473   fi
9474 else
9475   ac_cpp_err=yes
9476 fi
9477 if test -z "$ac_cpp_err"; then
9478   # We can compile using X headers with no special include directory.
9479 ac_x_includes=
9480 else
9481   echo "$as_me: failed program was:" >&5
9482   cat conftest.$ac_ext >&5
9483   for ac_dir in $ac_x_header_dirs; do
9484   if test -r "$ac_dir/X11/Intrinsic.h"; then
9485     ac_x_includes=$ac_dir
9486     break
9487   fi
9488 done
9489 fi
9490 rm -f conftest.err conftest.$ac_ext
9491 fi # $ac_x_includes = no
9492
9493 if test "$ac_x_libraries" = no; then
9494   # Check for the libraries.
9495   # See if we find them without any special options.
9496   # Don't add to $LIBS permanently.
9497   ac_save_LIBS=$LIBS
9498   LIBS="-lXt $LIBS"
9499   cat >conftest.$ac_ext <<_ACEOF
9500 #line 9500 "configure"
9501 #include "confdefs.h"
9502 #include <X11/Intrinsic.h>
9503 int
9504 main ()
9505 {
9506 XtMalloc (0)
9507   ;
9508   return 0;
9509 }
9510 _ACEOF
9511 rm -f conftest.$ac_objext conftest$ac_exeext
9512 if { (eval echo "$as_me:9512: \"$ac_link\"") >&5
9513   (eval $ac_link) 2>&5
9514   ac_status=$?
9515   echo "$as_me:9515: \$? = $ac_status" >&5
9516   (exit $ac_status); } &&
9517          { ac_try='test -s conftest$ac_exeext'
9518   { (eval echo "$as_me:9518: \"$ac_try\"") >&5
9519   (eval $ac_try) 2>&5
9520   ac_status=$?
9521   echo "$as_me:9521: \$? = $ac_status" >&5
9522   (exit $ac_status); }; }; then
9523   LIBS=$ac_save_LIBS
9524 # We can link X programs with no special library path.
9525 ac_x_libraries=
9526 else
9527   echo "$as_me: failed program was:" >&5
9528 cat conftest.$ac_ext >&5
9529 LIBS=$ac_save_LIBS
9530 for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
9531 do
9532   # Don't even attempt the hair of trying to link an X program!
9533   for ac_extension in a so sl dylib dll; do
9534     if test -r $ac_dir/libXt.$ac_extension; then
9535       ac_x_libraries=$ac_dir
9536       break 2
9537     fi
9538   done
9539 done
9540 fi
9541 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9542 fi # $ac_x_libraries = no
9543
9544 if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then
9545   # Didn't find X anywhere.  Cache the known absence of X.
9546   ac_cv_have_x="have_x=no"
9547 else
9548   # Record where we found X for the cache.
9549   ac_cv_have_x="have_x=yes \
9550                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
9551 fi
9552 fi
9553
9554   fi
9555   eval "$ac_cv_have_x"
9556 fi # $with_x != no
9557
9558 if test "$have_x" != yes; then
9559   echo "$as_me:9559: result: $have_x" >&5
9560 echo "${ECHO_T}$have_x" >&6
9561   no_x=yes
9562 else
9563   # If each of the values was on the command line, it overrides each guess.
9564   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
9565   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
9566   # Update the cache value to reflect the command line values.
9567   ac_cv_have_x="have_x=yes \
9568                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
9569   echo "$as_me:9569: result: libraries $x_libraries, headers $x_includes" >&5
9570 echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6
9571 fi
9572
9573 if test "$no_x" = yes; then
9574   # Not all programs may use this symbol, but it does not hurt to define it.
9575
9576 cat >>confdefs.h <<\EOF
9577 #define X_DISPLAY_MISSING 1
9578 EOF
9579
9580   X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
9581 else
9582   if test -n "$x_includes"; then
9583     X_CFLAGS="$X_CFLAGS -I$x_includes"
9584   fi
9585
9586   # It would also be nice to do this for all -L options, not just this one.
9587   if test -n "$x_libraries"; then
9588     X_LIBS="$X_LIBS -L$x_libraries"
9589     # For Solaris; some versions of Sun CC require a space after -R and
9590     # others require no space.  Words are not sufficient . . . .
9591     case `(uname -sr) 2>/dev/null` in
9592     "SunOS 5"*)
9593       echo "$as_me:9593: checking whether -R must be followed by a space" >&5
9594 echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6
9595       ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
9596       cat >conftest.$ac_ext <<_ACEOF
9597 #line 9597 "configure"
9598 #include "confdefs.h"
9599
9600 int
9601 main ()
9602 {
9603
9604   ;
9605   return 0;
9606 }
9607 _ACEOF
9608 rm -f conftest.$ac_objext conftest$ac_exeext
9609 if { (eval echo "$as_me:9609: \"$ac_link\"") >&5
9610   (eval $ac_link) 2>&5
9611   ac_status=$?
9612   echo "$as_me:9612: \$? = $ac_status" >&5
9613   (exit $ac_status); } &&
9614          { ac_try='test -s conftest$ac_exeext'
9615   { (eval echo "$as_me:9615: \"$ac_try\"") >&5
9616   (eval $ac_try) 2>&5
9617   ac_status=$?
9618   echo "$as_me:9618: \$? = $ac_status" >&5
9619   (exit $ac_status); }; }; then
9620   ac_R_nospace=yes
9621 else
9622   echo "$as_me: failed program was:" >&5
9623 cat conftest.$ac_ext >&5
9624 ac_R_nospace=no
9625 fi
9626 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9627       if test $ac_R_nospace = yes; then
9628         echo "$as_me:9628: result: no" >&5
9629 echo "${ECHO_T}no" >&6
9630         X_LIBS="$X_LIBS -R$x_libraries"
9631       else
9632         LIBS="$ac_xsave_LIBS -R $x_libraries"
9633         cat >conftest.$ac_ext <<_ACEOF
9634 #line 9634 "configure"
9635 #include "confdefs.h"
9636
9637 int
9638 main ()
9639 {
9640
9641   ;
9642   return 0;
9643 }
9644 _ACEOF
9645 rm -f conftest.$ac_objext conftest$ac_exeext
9646 if { (eval echo "$as_me:9646: \"$ac_link\"") >&5
9647   (eval $ac_link) 2>&5
9648   ac_status=$?
9649   echo "$as_me:9649: \$? = $ac_status" >&5
9650   (exit $ac_status); } &&
9651          { ac_try='test -s conftest$ac_exeext'
9652   { (eval echo "$as_me:9652: \"$ac_try\"") >&5
9653   (eval $ac_try) 2>&5
9654   ac_status=$?
9655   echo "$as_me:9655: \$? = $ac_status" >&5
9656   (exit $ac_status); }; }; then
9657   ac_R_space=yes
9658 else
9659   echo "$as_me: failed program was:" >&5
9660 cat conftest.$ac_ext >&5
9661 ac_R_space=no
9662 fi
9663 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9664         if test $ac_R_space = yes; then
9665           echo "$as_me:9665: result: yes" >&5
9666 echo "${ECHO_T}yes" >&6
9667           X_LIBS="$X_LIBS -R $x_libraries"
9668         else
9669           echo "$as_me:9669: result: neither works" >&5
9670 echo "${ECHO_T}neither works" >&6
9671         fi
9672       fi
9673       LIBS=$ac_xsave_LIBS
9674     esac
9675   fi
9676
9677   # Check for system-dependent libraries X programs must link with.
9678   # Do this before checking for the system-independent R6 libraries
9679   # (-lICE), since we may need -lsocket or whatever for X linking.
9680
9681   if test "$ISC" = yes; then
9682     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
9683   else
9684     # Martyn Johnson says this is needed for Ultrix, if the X
9685     # libraries were built with DECnet support.  And Karl Berry says
9686     # the Alpha needs dnet_stub (dnet does not exist).
9687     ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
9688     cat >conftest.$ac_ext <<_ACEOF
9689 #line 9689 "configure"
9690 #include "confdefs.h"
9691
9692 /* Override any gcc2 internal prototype to avoid an error.  */
9693 #ifdef __cplusplus
9694 extern "C"
9695 #endif
9696 /* We use char because int might match the return type of a gcc2
9697    builtin and then its argument prototype would still apply.  */
9698 char XOpenDisplay ();
9699 int
9700 main ()
9701 {
9702 XOpenDisplay ();
9703   ;
9704   return 0;
9705 }
9706 _ACEOF
9707 rm -f conftest.$ac_objext conftest$ac_exeext
9708 if { (eval echo "$as_me:9708: \"$ac_link\"") >&5
9709   (eval $ac_link) 2>&5
9710   ac_status=$?
9711   echo "$as_me:9711: \$? = $ac_status" >&5
9712   (exit $ac_status); } &&
9713          { ac_try='test -s conftest$ac_exeext'
9714   { (eval echo "$as_me:9714: \"$ac_try\"") >&5
9715   (eval $ac_try) 2>&5
9716   ac_status=$?
9717   echo "$as_me:9717: \$? = $ac_status" >&5
9718   (exit $ac_status); }; }; then
9719   :
9720 else
9721   echo "$as_me: failed program was:" >&5
9722 cat conftest.$ac_ext >&5
9723 echo "$as_me:9723: checking for dnet_ntoa in -ldnet" >&5
9724 echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6
9725 if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then
9726   echo $ECHO_N "(cached) $ECHO_C" >&6
9727 else
9728   ac_check_lib_save_LIBS=$LIBS
9729 LIBS="-ldnet  $LIBS"
9730 cat >conftest.$ac_ext <<_ACEOF
9731 #line 9731 "configure"
9732 #include "confdefs.h"
9733
9734 /* Override any gcc2 internal prototype to avoid an error.  */
9735 #ifdef __cplusplus
9736 extern "C"
9737 #endif
9738 /* We use char because int might match the return type of a gcc2
9739    builtin and then its argument prototype would still apply.  */
9740 char dnet_ntoa ();
9741 int
9742 main ()
9743 {
9744 dnet_ntoa ();
9745   ;
9746   return 0;
9747 }
9748 _ACEOF
9749 rm -f conftest.$ac_objext conftest$ac_exeext
9750 if { (eval echo "$as_me:9750: \"$ac_link\"") >&5
9751   (eval $ac_link) 2>&5
9752   ac_status=$?
9753   echo "$as_me:9753: \$? = $ac_status" >&5
9754   (exit $ac_status); } &&
9755          { ac_try='test -s conftest$ac_exeext'
9756   { (eval echo "$as_me:9756: \"$ac_try\"") >&5
9757   (eval $ac_try) 2>&5
9758   ac_status=$?
9759   echo "$as_me:9759: \$? = $ac_status" >&5
9760   (exit $ac_status); }; }; then
9761   ac_cv_lib_dnet_dnet_ntoa=yes
9762 else
9763   echo "$as_me: failed program was:" >&5
9764 cat conftest.$ac_ext >&5
9765 ac_cv_lib_dnet_dnet_ntoa=no
9766 fi
9767 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9768 LIBS=$ac_check_lib_save_LIBS
9769 fi
9770 echo "$as_me:9770: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
9771 echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6
9772 if test $ac_cv_lib_dnet_dnet_ntoa = yes; then
9773   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
9774 fi
9775
9776     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
9777       echo "$as_me:9777: checking for dnet_ntoa in -ldnet_stub" >&5
9778 echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6
9779 if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then
9780   echo $ECHO_N "(cached) $ECHO_C" >&6
9781 else
9782   ac_check_lib_save_LIBS=$LIBS
9783 LIBS="-ldnet_stub  $LIBS"
9784 cat >conftest.$ac_ext <<_ACEOF
9785 #line 9785 "configure"
9786 #include "confdefs.h"
9787
9788 /* Override any gcc2 internal prototype to avoid an error.  */
9789 #ifdef __cplusplus
9790 extern "C"
9791 #endif
9792 /* We use char because int might match the return type of a gcc2
9793    builtin and then its argument prototype would still apply.  */
9794 char dnet_ntoa ();
9795 int
9796 main ()
9797 {
9798 dnet_ntoa ();
9799   ;
9800   return 0;
9801 }
9802 _ACEOF
9803 rm -f conftest.$ac_objext conftest$ac_exeext
9804 if { (eval echo "$as_me:9804: \"$ac_link\"") >&5
9805   (eval $ac_link) 2>&5
9806   ac_status=$?
9807   echo "$as_me:9807: \$? = $ac_status" >&5
9808   (exit $ac_status); } &&
9809          { ac_try='test -s conftest$ac_exeext'
9810   { (eval echo "$as_me:9810: \"$ac_try\"") >&5
9811   (eval $ac_try) 2>&5
9812   ac_status=$?
9813   echo "$as_me:9813: \$? = $ac_status" >&5
9814   (exit $ac_status); }; }; then
9815   ac_cv_lib_dnet_stub_dnet_ntoa=yes
9816 else
9817   echo "$as_me: failed program was:" >&5
9818 cat conftest.$ac_ext >&5
9819 ac_cv_lib_dnet_stub_dnet_ntoa=no
9820 fi
9821 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9822 LIBS=$ac_check_lib_save_LIBS
9823 fi
9824 echo "$as_me:9824: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
9825 echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6
9826 if test $ac_cv_lib_dnet_stub_dnet_ntoa = yes; then
9827   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
9828 fi
9829
9830     fi
9831 fi
9832 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9833     LIBS="$ac_xsave_LIBS"
9834
9835     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
9836     # to get the SysV transport functions.
9837     # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4)
9838     # needs -lnsl.
9839     # The nsl library prevents programs from opening the X display
9840     # on Irix 5.2, according to T.E. Dickey.
9841     # The functions gethostbyname, getservbyname, and inet_addr are
9842     # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
9843     echo "$as_me:9843: checking for gethostbyname" >&5
9844 echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6
9845 if test "${ac_cv_func_gethostbyname+set}" = set; then
9846   echo $ECHO_N "(cached) $ECHO_C" >&6
9847 else
9848   cat >conftest.$ac_ext <<_ACEOF
9849 #line 9849 "configure"
9850 #include "confdefs.h"
9851 /* System header to define __stub macros and hopefully few prototypes,
9852     which can conflict with char gethostbyname (); below.  */
9853 #include <assert.h>
9854 /* Override any gcc2 internal prototype to avoid an error.  */
9855 #ifdef __cplusplus
9856 extern "C"
9857 #endif
9858 /* We use char because int might match the return type of a gcc2
9859    builtin and then its argument prototype would still apply.  */
9860 char gethostbyname ();
9861 char (*f) ();
9862
9863 int
9864 main ()
9865 {
9866 /* The GNU C library defines this for functions which it implements
9867     to always fail with ENOSYS.  Some functions are actually named
9868     something starting with __ and the normal name is an alias.  */
9869 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
9870 choke me
9871 #else
9872 f = gethostbyname; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
9873 #endif
9874
9875   ;
9876   return 0;
9877 }
9878 _ACEOF
9879 rm -f conftest.$ac_objext conftest$ac_exeext
9880 if { (eval echo "$as_me:9880: \"$ac_link\"") >&5
9881   (eval $ac_link) 2>&5
9882   ac_status=$?
9883   echo "$as_me:9883: \$? = $ac_status" >&5
9884   (exit $ac_status); } &&
9885          { ac_try='test -s conftest$ac_exeext'
9886   { (eval echo "$as_me:9886: \"$ac_try\"") >&5
9887   (eval $ac_try) 2>&5
9888   ac_status=$?
9889   echo "$as_me:9889: \$? = $ac_status" >&5
9890   (exit $ac_status); }; }; then
9891   ac_cv_func_gethostbyname=yes
9892 else
9893   echo "$as_me: failed program was:" >&5
9894 cat conftest.$ac_ext >&5
9895 ac_cv_func_gethostbyname=no
9896 fi
9897 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9898 fi
9899 echo "$as_me:9899: result: $ac_cv_func_gethostbyname" >&5
9900 echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6
9901
9902     if test $ac_cv_func_gethostbyname = no; then
9903       echo "$as_me:9903: checking for gethostbyname in -lnsl" >&5
9904 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6
9905 if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
9906   echo $ECHO_N "(cached) $ECHO_C" >&6
9907 else
9908   ac_check_lib_save_LIBS=$LIBS
9909 LIBS="-lnsl  $LIBS"
9910 cat >conftest.$ac_ext <<_ACEOF
9911 #line 9911 "configure"
9912 #include "confdefs.h"
9913
9914 /* Override any gcc2 internal prototype to avoid an error.  */
9915 #ifdef __cplusplus
9916 extern "C"
9917 #endif
9918 /* We use char because int might match the return type of a gcc2
9919    builtin and then its argument prototype would still apply.  */
9920 char gethostbyname ();
9921 int
9922 main ()
9923 {
9924 gethostbyname ();
9925   ;
9926   return 0;
9927 }
9928 _ACEOF
9929 rm -f conftest.$ac_objext conftest$ac_exeext
9930 if { (eval echo "$as_me:9930: \"$ac_link\"") >&5
9931   (eval $ac_link) 2>&5
9932   ac_status=$?
9933   echo "$as_me:9933: \$? = $ac_status" >&5
9934   (exit $ac_status); } &&
9935          { ac_try='test -s conftest$ac_exeext'
9936   { (eval echo "$as_me:9936: \"$ac_try\"") >&5
9937   (eval $ac_try) 2>&5
9938   ac_status=$?
9939   echo "$as_me:9939: \$? = $ac_status" >&5
9940   (exit $ac_status); }; }; then
9941   ac_cv_lib_nsl_gethostbyname=yes
9942 else
9943   echo "$as_me: failed program was:" >&5
9944 cat conftest.$ac_ext >&5
9945 ac_cv_lib_nsl_gethostbyname=no
9946 fi
9947 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9948 LIBS=$ac_check_lib_save_LIBS
9949 fi
9950 echo "$as_me:9950: result: $ac_cv_lib_nsl_gethostbyname" >&5
9951 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6
9952 if test $ac_cv_lib_nsl_gethostbyname = yes; then
9953   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
9954 fi
9955
9956       if test $ac_cv_lib_nsl_gethostbyname = no; then
9957         echo "$as_me:9957: checking for gethostbyname in -lbsd" >&5
9958 echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6
9959 if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then
9960   echo $ECHO_N "(cached) $ECHO_C" >&6
9961 else
9962   ac_check_lib_save_LIBS=$LIBS
9963 LIBS="-lbsd  $LIBS"
9964 cat >conftest.$ac_ext <<_ACEOF
9965 #line 9965 "configure"
9966 #include "confdefs.h"
9967
9968 /* Override any gcc2 internal prototype to avoid an error.  */
9969 #ifdef __cplusplus
9970 extern "C"
9971 #endif
9972 /* We use char because int might match the return type of a gcc2
9973    builtin and then its argument prototype would still apply.  */
9974 char gethostbyname ();
9975 int
9976 main ()
9977 {
9978 gethostbyname ();
9979   ;
9980   return 0;
9981 }
9982 _ACEOF
9983 rm -f conftest.$ac_objext conftest$ac_exeext
9984 if { (eval echo "$as_me:9984: \"$ac_link\"") >&5
9985   (eval $ac_link) 2>&5
9986   ac_status=$?
9987   echo "$as_me:9987: \$? = $ac_status" >&5
9988   (exit $ac_status); } &&
9989          { ac_try='test -s conftest$ac_exeext'
9990   { (eval echo "$as_me:9990: \"$ac_try\"") >&5
9991   (eval $ac_try) 2>&5
9992   ac_status=$?
9993   echo "$as_me:9993: \$? = $ac_status" >&5
9994   (exit $ac_status); }; }; then
9995   ac_cv_lib_bsd_gethostbyname=yes
9996 else
9997   echo "$as_me: failed program was:" >&5
9998 cat conftest.$ac_ext >&5
9999 ac_cv_lib_bsd_gethostbyname=no
10000 fi
10001 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10002 LIBS=$ac_check_lib_save_LIBS
10003 fi
10004 echo "$as_me:10004: result: $ac_cv_lib_bsd_gethostbyname" >&5
10005 echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6
10006 if test $ac_cv_lib_bsd_gethostbyname = yes; then
10007   X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
10008 fi
10009
10010       fi
10011     fi
10012
10013     # lieder@skyler.mavd.honeywell.com says without -lsocket,
10014     # socket/setsockopt and other routines are undefined under SCO ODT
10015     # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
10016     # on later versions), says Simon Leinen: it contains gethostby*
10017     # variants that don't use the nameserver (or something).  -lsocket
10018     # must be given before -lnsl if both are needed.  We assume that
10019     # if connect needs -lnsl, so does gethostbyname.
10020     echo "$as_me:10020: checking for connect" >&5
10021 echo $ECHO_N "checking for connect... $ECHO_C" >&6
10022 if test "${ac_cv_func_connect+set}" = set; then
10023   echo $ECHO_N "(cached) $ECHO_C" >&6
10024 else
10025   cat >conftest.$ac_ext <<_ACEOF
10026 #line 10026 "configure"
10027 #include "confdefs.h"
10028 /* System header to define __stub macros and hopefully few prototypes,
10029     which can conflict with char connect (); below.  */
10030 #include <assert.h>
10031 /* Override any gcc2 internal prototype to avoid an error.  */
10032 #ifdef __cplusplus
10033 extern "C"
10034 #endif
10035 /* We use char because int might match the return type of a gcc2
10036    builtin and then its argument prototype would still apply.  */
10037 char connect ();
10038 char (*f) ();
10039
10040 int
10041 main ()
10042 {
10043 /* The GNU C library defines this for functions which it implements
10044     to always fail with ENOSYS.  Some functions are actually named
10045     something starting with __ and the normal name is an alias.  */
10046 #if defined (__stub_connect) || defined (__stub___connect)
10047 choke me
10048 #else
10049 f = connect; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
10050 #endif
10051
10052   ;
10053   return 0;
10054 }
10055 _ACEOF
10056 rm -f conftest.$ac_objext conftest$ac_exeext
10057 if { (eval echo "$as_me:10057: \"$ac_link\"") >&5
10058   (eval $ac_link) 2>&5
10059   ac_status=$?
10060   echo "$as_me:10060: \$? = $ac_status" >&5
10061   (exit $ac_status); } &&
10062          { ac_try='test -s conftest$ac_exeext'
10063   { (eval echo "$as_me:10063: \"$ac_try\"") >&5
10064   (eval $ac_try) 2>&5
10065   ac_status=$?
10066   echo "$as_me:10066: \$? = $ac_status" >&5
10067   (exit $ac_status); }; }; then
10068   ac_cv_func_connect=yes
10069 else
10070   echo "$as_me: failed program was:" >&5
10071 cat conftest.$ac_ext >&5
10072 ac_cv_func_connect=no
10073 fi
10074 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10075 fi
10076 echo "$as_me:10076: result: $ac_cv_func_connect" >&5
10077 echo "${ECHO_T}$ac_cv_func_connect" >&6
10078
10079     if test $ac_cv_func_connect = no; then
10080       echo "$as_me:10080: checking for connect in -lsocket" >&5
10081 echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6
10082 if test "${ac_cv_lib_socket_connect+set}" = set; then
10083   echo $ECHO_N "(cached) $ECHO_C" >&6
10084 else
10085   ac_check_lib_save_LIBS=$LIBS
10086 LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
10087 cat >conftest.$ac_ext <<_ACEOF
10088 #line 10088 "configure"
10089 #include "confdefs.h"
10090
10091 /* Override any gcc2 internal prototype to avoid an error.  */
10092 #ifdef __cplusplus
10093 extern "C"
10094 #endif
10095 /* We use char because int might match the return type of a gcc2
10096    builtin and then its argument prototype would still apply.  */
10097 char connect ();
10098 int
10099 main ()
10100 {
10101 connect ();
10102   ;
10103   return 0;
10104 }
10105 _ACEOF
10106 rm -f conftest.$ac_objext conftest$ac_exeext
10107 if { (eval echo "$as_me:10107: \"$ac_link\"") >&5
10108   (eval $ac_link) 2>&5
10109   ac_status=$?
10110   echo "$as_me:10110: \$? = $ac_status" >&5
10111   (exit $ac_status); } &&
10112          { ac_try='test -s conftest$ac_exeext'
10113   { (eval echo "$as_me:10113: \"$ac_try\"") >&5
10114   (eval $ac_try) 2>&5
10115   ac_status=$?
10116   echo "$as_me:10116: \$? = $ac_status" >&5
10117   (exit $ac_status); }; }; then
10118   ac_cv_lib_socket_connect=yes
10119 else
10120   echo "$as_me: failed program was:" >&5
10121 cat conftest.$ac_ext >&5
10122 ac_cv_lib_socket_connect=no
10123 fi
10124 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10125 LIBS=$ac_check_lib_save_LIBS
10126 fi
10127 echo "$as_me:10127: result: $ac_cv_lib_socket_connect" >&5
10128 echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6
10129 if test $ac_cv_lib_socket_connect = yes; then
10130   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
10131 fi
10132
10133     fi
10134
10135     # Guillermo Gomez says -lposix is necessary on A/UX.
10136     echo "$as_me:10136: checking for remove" >&5
10137 echo $ECHO_N "checking for remove... $ECHO_C" >&6
10138 if test "${ac_cv_func_remove+set}" = set; then
10139   echo $ECHO_N "(cached) $ECHO_C" >&6
10140 else
10141   cat >conftest.$ac_ext <<_ACEOF
10142 #line 10142 "configure"
10143 #include "confdefs.h"
10144 /* System header to define __stub macros and hopefully few prototypes,
10145     which can conflict with char remove (); below.  */
10146 #include <assert.h>
10147 /* Override any gcc2 internal prototype to avoid an error.  */
10148 #ifdef __cplusplus
10149 extern "C"
10150 #endif
10151 /* We use char because int might match the return type of a gcc2
10152    builtin and then its argument prototype would still apply.  */
10153 char remove ();
10154 char (*f) ();
10155
10156 int
10157 main ()
10158 {
10159 /* The GNU C library defines this for functions which it implements
10160     to always fail with ENOSYS.  Some functions are actually named
10161     something starting with __ and the normal name is an alias.  */
10162 #if defined (__stub_remove) || defined (__stub___remove)
10163 choke me
10164 #else
10165 f = remove; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
10166 #endif
10167
10168   ;
10169   return 0;
10170 }
10171 _ACEOF
10172 rm -f conftest.$ac_objext conftest$ac_exeext
10173 if { (eval echo "$as_me:10173: \"$ac_link\"") >&5
10174   (eval $ac_link) 2>&5
10175   ac_status=$?
10176   echo "$as_me:10176: \$? = $ac_status" >&5
10177   (exit $ac_status); } &&
10178          { ac_try='test -s conftest$ac_exeext'
10179   { (eval echo "$as_me:10179: \"$ac_try\"") >&5
10180   (eval $ac_try) 2>&5
10181   ac_status=$?
10182   echo "$as_me:10182: \$? = $ac_status" >&5
10183   (exit $ac_status); }; }; then
10184   ac_cv_func_remove=yes
10185 else
10186   echo "$as_me: failed program was:" >&5
10187 cat conftest.$ac_ext >&5
10188 ac_cv_func_remove=no
10189 fi
10190 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10191 fi
10192 echo "$as_me:10192: result: $ac_cv_func_remove" >&5
10193 echo "${ECHO_T}$ac_cv_func_remove" >&6
10194
10195     if test $ac_cv_func_remove = no; then
10196       echo "$as_me:10196: checking for remove in -lposix" >&5
10197 echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6
10198 if test "${ac_cv_lib_posix_remove+set}" = set; then
10199   echo $ECHO_N "(cached) $ECHO_C" >&6
10200 else
10201   ac_check_lib_save_LIBS=$LIBS
10202 LIBS="-lposix  $LIBS"
10203 cat >conftest.$ac_ext <<_ACEOF
10204 #line 10204 "configure"
10205 #include "confdefs.h"
10206
10207 /* Override any gcc2 internal prototype to avoid an error.  */
10208 #ifdef __cplusplus
10209 extern "C"
10210 #endif
10211 /* We use char because int might match the return type of a gcc2
10212    builtin and then its argument prototype would still apply.  */
10213 char remove ();
10214 int
10215 main ()
10216 {
10217 remove ();
10218   ;
10219   return 0;
10220 }
10221 _ACEOF
10222 rm -f conftest.$ac_objext conftest$ac_exeext
10223 if { (eval echo "$as_me:10223: \"$ac_link\"") >&5
10224   (eval $ac_link) 2>&5
10225   ac_status=$?
10226   echo "$as_me:10226: \$? = $ac_status" >&5
10227   (exit $ac_status); } &&
10228          { ac_try='test -s conftest$ac_exeext'
10229   { (eval echo "$as_me:10229: \"$ac_try\"") >&5
10230   (eval $ac_try) 2>&5
10231   ac_status=$?
10232   echo "$as_me:10232: \$? = $ac_status" >&5
10233   (exit $ac_status); }; }; then
10234   ac_cv_lib_posix_remove=yes
10235 else
10236   echo "$as_me: failed program was:" >&5
10237 cat conftest.$ac_ext >&5
10238 ac_cv_lib_posix_remove=no
10239 fi
10240 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10241 LIBS=$ac_check_lib_save_LIBS
10242 fi
10243 echo "$as_me:10243: result: $ac_cv_lib_posix_remove" >&5
10244 echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6
10245 if test $ac_cv_lib_posix_remove = yes; then
10246   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
10247 fi
10248
10249     fi
10250
10251     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
10252     echo "$as_me:10252: checking for shmat" >&5
10253 echo $ECHO_N "checking for shmat... $ECHO_C" >&6
10254 if test "${ac_cv_func_shmat+set}" = set; then
10255   echo $ECHO_N "(cached) $ECHO_C" >&6
10256 else
10257   cat >conftest.$ac_ext <<_ACEOF
10258 #line 10258 "configure"
10259 #include "confdefs.h"
10260 /* System header to define __stub macros and hopefully few prototypes,
10261     which can conflict with char shmat (); below.  */
10262 #include <assert.h>
10263 /* Override any gcc2 internal prototype to avoid an error.  */
10264 #ifdef __cplusplus
10265 extern "C"
10266 #endif
10267 /* We use char because int might match the return type of a gcc2
10268    builtin and then its argument prototype would still apply.  */
10269 char shmat ();
10270 char (*f) ();
10271
10272 int
10273 main ()
10274 {
10275 /* The GNU C library defines this for functions which it implements
10276     to always fail with ENOSYS.  Some functions are actually named
10277     something starting with __ and the normal name is an alias.  */
10278 #if defined (__stub_shmat) || defined (__stub___shmat)
10279 choke me
10280 #else
10281 f = shmat; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
10282 #endif
10283
10284   ;
10285   return 0;
10286 }
10287 _ACEOF
10288 rm -f conftest.$ac_objext conftest$ac_exeext
10289 if { (eval echo "$as_me:10289: \"$ac_link\"") >&5
10290   (eval $ac_link) 2>&5
10291   ac_status=$?
10292   echo "$as_me:10292: \$? = $ac_status" >&5
10293   (exit $ac_status); } &&
10294          { ac_try='test -s conftest$ac_exeext'
10295   { (eval echo "$as_me:10295: \"$ac_try\"") >&5
10296   (eval $ac_try) 2>&5
10297   ac_status=$?
10298   echo "$as_me:10298: \$? = $ac_status" >&5
10299   (exit $ac_status); }; }; then
10300   ac_cv_func_shmat=yes
10301 else
10302   echo "$as_me: failed program was:" >&5
10303 cat conftest.$ac_ext >&5
10304 ac_cv_func_shmat=no
10305 fi
10306 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10307 fi
10308 echo "$as_me:10308: result: $ac_cv_func_shmat" >&5
10309 echo "${ECHO_T}$ac_cv_func_shmat" >&6
10310
10311     if test $ac_cv_func_shmat = no; then
10312       echo "$as_me:10312: checking for shmat in -lipc" >&5
10313 echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6
10314 if test "${ac_cv_lib_ipc_shmat+set}" = set; then
10315   echo $ECHO_N "(cached) $ECHO_C" >&6
10316 else
10317   ac_check_lib_save_LIBS=$LIBS
10318 LIBS="-lipc  $LIBS"
10319 cat >conftest.$ac_ext <<_ACEOF
10320 #line 10320 "configure"
10321 #include "confdefs.h"
10322
10323 /* Override any gcc2 internal prototype to avoid an error.  */
10324 #ifdef __cplusplus
10325 extern "C"
10326 #endif
10327 /* We use char because int might match the return type of a gcc2
10328    builtin and then its argument prototype would still apply.  */
10329 char shmat ();
10330 int
10331 main ()
10332 {
10333 shmat ();
10334   ;
10335   return 0;
10336 }
10337 _ACEOF
10338 rm -f conftest.$ac_objext conftest$ac_exeext
10339 if { (eval echo "$as_me:10339: \"$ac_link\"") >&5
10340   (eval $ac_link) 2>&5
10341   ac_status=$?
10342   echo "$as_me:10342: \$? = $ac_status" >&5
10343   (exit $ac_status); } &&
10344          { ac_try='test -s conftest$ac_exeext'
10345   { (eval echo "$as_me:10345: \"$ac_try\"") >&5
10346   (eval $ac_try) 2>&5
10347   ac_status=$?
10348   echo "$as_me:10348: \$? = $ac_status" >&5
10349   (exit $ac_status); }; }; then
10350   ac_cv_lib_ipc_shmat=yes
10351 else
10352   echo "$as_me: failed program was:" >&5
10353 cat conftest.$ac_ext >&5
10354 ac_cv_lib_ipc_shmat=no
10355 fi
10356 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10357 LIBS=$ac_check_lib_save_LIBS
10358 fi
10359 echo "$as_me:10359: result: $ac_cv_lib_ipc_shmat" >&5
10360 echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6
10361 if test $ac_cv_lib_ipc_shmat = yes; then
10362   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
10363 fi
10364
10365     fi
10366   fi
10367
10368   # Check for libraries that X11R6 Xt/Xaw programs need.
10369   ac_save_LDFLAGS=$LDFLAGS
10370   test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
10371   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
10372   # check for ICE first), but we must link in the order -lSM -lICE or
10373   # we get undefined symbols.  So assume we have SM if we have ICE.
10374   # These have to be linked with before -lX11, unlike the other
10375   # libraries we check for below, so use a different variable.
10376   # John Interrante, Karl Berry
10377   echo "$as_me:10377: checking for IceConnectionNumber in -lICE" >&5
10378 echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6
10379 if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then
10380   echo $ECHO_N "(cached) $ECHO_C" >&6
10381 else
10382   ac_check_lib_save_LIBS=$LIBS
10383 LIBS="-lICE $X_EXTRA_LIBS $LIBS"
10384 cat >conftest.$ac_ext <<_ACEOF
10385 #line 10385 "configure"
10386 #include "confdefs.h"
10387
10388 /* Override any gcc2 internal prototype to avoid an error.  */
10389 #ifdef __cplusplus
10390 extern "C"
10391 #endif
10392 /* We use char because int might match the return type of a gcc2
10393    builtin and then its argument prototype would still apply.  */
10394 char IceConnectionNumber ();
10395 int
10396 main ()
10397 {
10398 IceConnectionNumber ();
10399   ;
10400   return 0;
10401 }
10402 _ACEOF
10403 rm -f conftest.$ac_objext conftest$ac_exeext
10404 if { (eval echo "$as_me:10404: \"$ac_link\"") >&5
10405   (eval $ac_link) 2>&5
10406   ac_status=$?
10407   echo "$as_me:10407: \$? = $ac_status" >&5
10408   (exit $ac_status); } &&
10409          { ac_try='test -s conftest$ac_exeext'
10410   { (eval echo "$as_me:10410: \"$ac_try\"") >&5
10411   (eval $ac_try) 2>&5
10412   ac_status=$?
10413   echo "$as_me:10413: \$? = $ac_status" >&5
10414   (exit $ac_status); }; }; then
10415   ac_cv_lib_ICE_IceConnectionNumber=yes
10416 else
10417   echo "$as_me: failed program was:" >&5
10418 cat conftest.$ac_ext >&5
10419 ac_cv_lib_ICE_IceConnectionNumber=no
10420 fi
10421 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10422 LIBS=$ac_check_lib_save_LIBS
10423 fi
10424 echo "$as_me:10424: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
10425 echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6
10426 if test $ac_cv_lib_ICE_IceConnectionNumber = yes; then
10427   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
10428 fi
10429
10430   LDFLAGS=$ac_save_LDFLAGS
10431
10432 fi
10433
10434 cf_x_athena=${cf_x_athena:-Xaw}
10435
10436 echo "$as_me:10436: checking if you want to link with Xaw 3d library" >&5
10437 echo $ECHO_N "checking if you want to link with Xaw 3d library... $ECHO_C" >&6
10438 withval=
10439
10440 # Check whether --with-Xaw3d or --without-Xaw3d was given.
10441 if test "${with_Xaw3d+set}" = set; then
10442   withval="$with_Xaw3d"
10443
10444 fi;
10445 if test "$withval" = yes ; then
10446         cf_x_athena=Xaw3d
10447         echo "$as_me:10447: result: yes" >&5
10448 echo "${ECHO_T}yes" >&6
10449 else
10450         echo "$as_me:10450: result: no" >&5
10451 echo "${ECHO_T}no" >&6
10452 fi
10453
10454 echo "$as_me:10454: checking if you want to link with Xaw 3d xft library" >&5
10455 echo $ECHO_N "checking if you want to link with Xaw 3d xft library... $ECHO_C" >&6
10456 withval=
10457
10458 # Check whether --with-Xaw3dxft or --without-Xaw3dxft was given.
10459 if test "${with_Xaw3dxft+set}" = set; then
10460   withval="$with_Xaw3dxft"
10461
10462 fi;
10463 if test "$withval" = yes ; then
10464         cf_x_athena=Xaw3dxft
10465         echo "$as_me:10465: result: yes" >&5
10466 echo "${ECHO_T}yes" >&6
10467 else
10468         echo "$as_me:10468: result: no" >&5
10469 echo "${ECHO_T}no" >&6
10470 fi
10471
10472 echo "$as_me:10472: checking if you want to link with neXT Athena library" >&5
10473 echo $ECHO_N "checking if you want to link with neXT Athena library... $ECHO_C" >&6
10474 withval=
10475
10476 # Check whether --with-neXtaw or --without-neXtaw was given.
10477 if test "${with_neXtaw+set}" = set; then
10478   withval="$with_neXtaw"
10479
10480 fi;
10481 if test "$withval" = yes ; then
10482         cf_x_athena=neXtaw
10483         echo "$as_me:10483: result: yes" >&5
10484 echo "${ECHO_T}yes" >&6
10485 else
10486         echo "$as_me:10486: result: no" >&5
10487 echo "${ECHO_T}no" >&6
10488 fi
10489
10490 echo "$as_me:10490: checking if you want to link with Athena-Plus library" >&5
10491 echo $ECHO_N "checking if you want to link with Athena-Plus library... $ECHO_C" >&6
10492 withval=
10493
10494 # Check whether --with-XawPlus or --without-XawPlus was given.
10495 if test "${with_XawPlus+set}" = set; then
10496   withval="$with_XawPlus"
10497
10498 fi;
10499 if test "$withval" = yes ; then
10500         cf_x_athena=XawPlus
10501         echo "$as_me:10501: result: yes" >&5
10502 echo "${ECHO_T}yes" >&6
10503 else
10504         echo "$as_me:10504: result: no" >&5
10505 echo "${ECHO_T}no" >&6
10506 fi
10507
10508 cf_x_athena_lib=""
10509
10510 if test "$PKG_CONFIG" != none ; then
10511         cf_athena_list=
10512         test "$cf_x_athena" = Xaw && cf_athena_list="xaw8 xaw7 xaw6"
10513         for cf_athena_pkg in \
10514                 $cf_athena_list \
10515                 ${cf_x_athena} \
10516                 ${cf_x_athena}-devel \
10517                 lib${cf_x_athena} \
10518                 lib${cf_x_athena}-devel
10519         do
10520
10521 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists $cf_athena_pkg; then
10522         test -n "$verbose" && echo "    found package $cf_athena_pkg" 1>&6
10523
10524 echo "${as_me:-configure}:10524: testing found package $cf_athena_pkg ..." 1>&5
10525
10526         cf_pkgconfig_incs="`$PKG_CONFIG --cflags $cf_athena_pkg 2>/dev/null`"
10527         cf_pkgconfig_libs="`$PKG_CONFIG --libs   $cf_athena_pkg 2>/dev/null`"
10528         test -n "$verbose" && echo "    package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs" 1>&6
10529
10530 echo "${as_me:-configure}:10530: testing package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs ..." 1>&5
10531
10532         test -n "$verbose" && echo "    package $cf_athena_pkg LIBS: $cf_pkgconfig_libs" 1>&6
10533
10534 echo "${as_me:-configure}:10534: testing package $cf_athena_pkg LIBS: $cf_pkgconfig_libs ..." 1>&5
10535
10536 cf_fix_cppflags=no
10537 cf_new_cflags=
10538 cf_new_cppflags=
10539 cf_new_extra_cppflags=
10540
10541 for cf_add_cflags in $cf_pkgconfig_incs
10542 do
10543 case $cf_fix_cppflags in
10544 (no)
10545         case $cf_add_cflags in
10546         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10547                 case $cf_add_cflags in
10548                 (-D*)
10549                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10550
10551                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10552                                 && test -z "${cf_tst_cflags}" \
10553                                 && cf_fix_cppflags=yes
10554
10555                         if test $cf_fix_cppflags = yes ; then
10556                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10557                                 continue
10558                         elif test "${cf_tst_cflags}" = "\"'" ; then
10559                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10560                                 continue
10561                         fi
10562                         ;;
10563                 esac
10564                 case "$CPPFLAGS" in
10565                 (*$cf_add_cflags)
10566                         ;;
10567                 (*)
10568                         case $cf_add_cflags in
10569                         (-D*)
10570                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10571
10572 CPPFLAGS=`echo "$CPPFLAGS" | \
10573         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10574                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10575
10576                                 ;;
10577                         esac
10578                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10579                         ;;
10580                 esac
10581                 ;;
10582         (*)
10583                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10584                 ;;
10585         esac
10586         ;;
10587 (yes)
10588         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10589
10590         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10591
10592         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10593                 && test -z "${cf_tst_cflags}" \
10594                 && cf_fix_cppflags=no
10595         ;;
10596 esac
10597 done
10598
10599 if test -n "$cf_new_cflags" ; then
10600
10601         CFLAGS="$CFLAGS $cf_new_cflags"
10602 fi
10603
10604 if test -n "$cf_new_cppflags" ; then
10605
10606         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10607 fi
10608
10609 if test -n "$cf_new_extra_cppflags" ; then
10610
10611         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10612 fi
10613
10614 cf_add_libs="$cf_pkgconfig_libs"
10615 # Filter out duplicates - this happens with badly-designed ".pc" files...
10616 for cf_add_1lib in $LIBS
10617 do
10618         for cf_add_2lib in $cf_add_libs
10619         do
10620                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
10621                 then
10622                         cf_add_1lib=
10623                         break
10624                 fi
10625         done
10626         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
10627 done
10628 LIBS="$cf_add_libs"
10629
10630                         cf_x_athena_lib="$cf_pkgconfig_libs"
10631
10632 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
10633
10634                         cat >>confdefs.h <<EOF
10635 #define $cf_x_athena_LIBS 1
10636 EOF
10637
10638         for cf_trim_lib in Xmu Xt X11
10639         do
10640                 case "$LIBS" in
10641                 (*-l$cf_trim_lib\ *-l$cf_trim_lib*)
10642                         LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
10643                         test -n "$verbose" && echo "    ..trimmed $LIBS" 1>&6
10644
10645 echo "${as_me:-configure}:10645: testing ..trimmed $LIBS ..." 1>&5
10646
10647                         ;;
10648                 esac
10649         done
10650
10651 echo "$as_me:10651: checking for usable $cf_x_athena/Xmu package" >&5
10652 echo $ECHO_N "checking for usable $cf_x_athena/Xmu package... $ECHO_C" >&6
10653 if test "${cf_cv_xaw_compat+set}" = set; then
10654   echo $ECHO_N "(cached) $ECHO_C" >&6
10655 else
10656
10657 cat >conftest.$ac_ext <<_ACEOF
10658 #line 10658 "configure"
10659 #include "confdefs.h"
10660
10661 #include <X11/Xmu/CharSet.h>
10662
10663 int
10664 main ()
10665 {
10666
10667 int check = XmuCompareISOLatin1("big", "small")
10668
10669   ;
10670   return 0;
10671 }
10672 _ACEOF
10673 rm -f conftest.$ac_objext conftest$ac_exeext
10674 if { (eval echo "$as_me:10674: \"$ac_link\"") >&5
10675   (eval $ac_link) 2>&5
10676   ac_status=$?
10677   echo "$as_me:10677: \$? = $ac_status" >&5
10678   (exit $ac_status); } &&
10679          { ac_try='test -s conftest$ac_exeext'
10680   { (eval echo "$as_me:10680: \"$ac_try\"") >&5
10681   (eval $ac_try) 2>&5
10682   ac_status=$?
10683   echo "$as_me:10683: \$? = $ac_status" >&5
10684   (exit $ac_status); }; }; then
10685   cf_cv_xaw_compat=yes
10686 else
10687   echo "$as_me: failed program was:" >&5
10688 cat conftest.$ac_ext >&5
10689 cf_cv_xaw_compat=no
10690 fi
10691 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10692 fi
10693 echo "$as_me:10693: result: $cf_cv_xaw_compat" >&5
10694 echo "${ECHO_T}$cf_cv_xaw_compat" >&6
10695
10696                         if test "$cf_cv_xaw_compat" = no
10697                         then
10698                                 # workaround for broken ".pc" files...
10699                                 case "$cf_x_athena_lib" in
10700                                 (*-lXmu*)
10701                                         ;;
10702                                 (*)
10703                                         test -n "$verbose" && echo "    work around broken package" 1>&6
10704
10705 echo "${as_me:-configure}:10705: testing work around broken package ..." 1>&5
10706
10707                                         cf_save_xmu="$LIBS"
10708                                         cf_first_lib=`echo "$cf_save_xmu" | sed -e 's/^  *//' -e 's/ .*//'`
10709
10710 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xmu; then
10711         test -n "$verbose" && echo "    found package xmu" 1>&6
10712
10713 echo "${as_me:-configure}:10713: testing found package xmu ..." 1>&5
10714
10715         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xmu 2>/dev/null`"
10716         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xmu 2>/dev/null`"
10717         test -n "$verbose" && echo "    package xmu CFLAGS: $cf_pkgconfig_incs" 1>&6
10718
10719 echo "${as_me:-configure}:10719: testing package xmu CFLAGS: $cf_pkgconfig_incs ..." 1>&5
10720
10721         test -n "$verbose" && echo "    package xmu LIBS: $cf_pkgconfig_libs" 1>&6
10722
10723 echo "${as_me:-configure}:10723: testing package xmu LIBS: $cf_pkgconfig_libs ..." 1>&5
10724
10725 cf_fix_cppflags=no
10726 cf_new_cflags=
10727 cf_new_cppflags=
10728 cf_new_extra_cppflags=
10729
10730 for cf_add_cflags in $cf_pkgconfig_incs
10731 do
10732 case $cf_fix_cppflags in
10733 (no)
10734         case $cf_add_cflags in
10735         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10736                 case $cf_add_cflags in
10737                 (-D*)
10738                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10739
10740                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10741                                 && test -z "${cf_tst_cflags}" \
10742                                 && cf_fix_cppflags=yes
10743
10744                         if test $cf_fix_cppflags = yes ; then
10745                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10746                                 continue
10747                         elif test "${cf_tst_cflags}" = "\"'" ; then
10748                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10749                                 continue
10750                         fi
10751                         ;;
10752                 esac
10753                 case "$CPPFLAGS" in
10754                 (*$cf_add_cflags)
10755                         ;;
10756                 (*)
10757                         case $cf_add_cflags in
10758                         (-D*)
10759                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10760
10761 CPPFLAGS=`echo "$CPPFLAGS" | \
10762         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10763                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10764
10765                                 ;;
10766                         esac
10767                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10768                         ;;
10769                 esac
10770                 ;;
10771         (*)
10772                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10773                 ;;
10774         esac
10775         ;;
10776 (yes)
10777         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10778
10779         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10780
10781         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10782                 && test -z "${cf_tst_cflags}" \
10783                 && cf_fix_cppflags=no
10784         ;;
10785 esac
10786 done
10787
10788 if test -n "$cf_new_cflags" ; then
10789
10790         CFLAGS="$CFLAGS $cf_new_cflags"
10791 fi
10792
10793 if test -n "$cf_new_cppflags" ; then
10794
10795         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10796 fi
10797
10798 if test -n "$cf_new_extra_cppflags" ; then
10799
10800         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10801 fi
10802
10803 cf_add_libs="$cf_pkgconfig_libs"
10804 # Filter out duplicates - this happens with badly-designed ".pc" files...
10805 for cf_add_1lib in $LIBS
10806 do
10807         for cf_add_2lib in $cf_add_libs
10808         do
10809                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
10810                 then
10811                         cf_add_1lib=
10812                         break
10813                 fi
10814         done
10815         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
10816 done
10817 LIBS="$cf_add_libs"
10818
10819                                                         LIBS="$cf_save_xmu"
10820
10821 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
10822
10823 echo "${as_me:-configure}:10823: testing ...before $LIBS ..." 1>&5
10824
10825 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib $cf_pkgconfig_libs %" -e 's%  % %g'`
10826 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
10827
10828 echo "${as_me:-configure}:10828: testing ...after  $LIBS ..." 1>&5
10829
10830 else
10831         cf_pkgconfig_incs=
10832         cf_pkgconfig_libs=
10833
10834 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
10835
10836 echo "${as_me:-configure}:10836: testing ...before $LIBS ..." 1>&5
10837
10838 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib -lXmu %" -e 's%  % %g'`
10839 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
10840
10841 echo "${as_me:-configure}:10841: testing ...after  $LIBS ..." 1>&5
10842
10843 fi
10844
10845         for cf_trim_lib in Xmu Xt X11
10846         do
10847                 case "$LIBS" in
10848                 (*-l$cf_trim_lib\ *-l$cf_trim_lib*)
10849                         LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
10850                         test -n "$verbose" && echo "    ..trimmed $LIBS" 1>&6
10851
10852 echo "${as_me:-configure}:10852: testing ..trimmed $LIBS ..." 1>&5
10853
10854                         ;;
10855                 esac
10856         done
10857
10858                                         ;;
10859                                 esac
10860                         fi
10861
10862                         break
10863 else
10864         cf_pkgconfig_incs=
10865         cf_pkgconfig_libs=
10866         :
10867 fi
10868
10869         done
10870 fi
10871
10872 if test -z "$cf_x_athena_lib" ; then
10873
10874 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists Xext; then
10875         test -n "$verbose" && echo "    found package Xext" 1>&6
10876
10877 echo "${as_me:-configure}:10877: testing found package Xext ..." 1>&5
10878
10879         cf_pkgconfig_incs="`$PKG_CONFIG --cflags Xext 2>/dev/null`"
10880         cf_pkgconfig_libs="`$PKG_CONFIG --libs   Xext 2>/dev/null`"
10881         test -n "$verbose" && echo "    package Xext CFLAGS: $cf_pkgconfig_incs" 1>&6
10882
10883 echo "${as_me:-configure}:10883: testing package Xext CFLAGS: $cf_pkgconfig_incs ..." 1>&5
10884
10885         test -n "$verbose" && echo "    package Xext LIBS: $cf_pkgconfig_libs" 1>&6
10886
10887 echo "${as_me:-configure}:10887: testing package Xext LIBS: $cf_pkgconfig_libs ..." 1>&5
10888
10889 cf_fix_cppflags=no
10890 cf_new_cflags=
10891 cf_new_cppflags=
10892 cf_new_extra_cppflags=
10893
10894 for cf_add_cflags in $cf_pkgconfig_incs
10895 do
10896 case $cf_fix_cppflags in
10897 (no)
10898         case $cf_add_cflags in
10899         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10900                 case $cf_add_cflags in
10901                 (-D*)
10902                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10903
10904                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10905                                 && test -z "${cf_tst_cflags}" \
10906                                 && cf_fix_cppflags=yes
10907
10908                         if test $cf_fix_cppflags = yes ; then
10909                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10910                                 continue
10911                         elif test "${cf_tst_cflags}" = "\"'" ; then
10912                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10913                                 continue
10914                         fi
10915                         ;;
10916                 esac
10917                 case "$CPPFLAGS" in
10918                 (*$cf_add_cflags)
10919                         ;;
10920                 (*)
10921                         case $cf_add_cflags in
10922                         (-D*)
10923                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10924
10925 CPPFLAGS=`echo "$CPPFLAGS" | \
10926         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10927                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10928
10929                                 ;;
10930                         esac
10931                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10932                         ;;
10933                 esac
10934                 ;;
10935         (*)
10936                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10937                 ;;
10938         esac
10939         ;;
10940 (yes)
10941         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10942
10943         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10944
10945         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10946                 && test -z "${cf_tst_cflags}" \
10947                 && cf_fix_cppflags=no
10948         ;;
10949 esac
10950 done
10951
10952 if test -n "$cf_new_cflags" ; then
10953
10954         CFLAGS="$CFLAGS $cf_new_cflags"
10955 fi
10956
10957 if test -n "$cf_new_cppflags" ; then
10958
10959         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10960 fi
10961
10962 if test -n "$cf_new_extra_cppflags" ; then
10963
10964         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10965 fi
10966
10967 cf_add_libs="$cf_pkgconfig_libs"
10968 # Filter out duplicates - this happens with badly-designed ".pc" files...
10969 for cf_add_1lib in $LIBS
10970 do
10971         for cf_add_2lib in $cf_add_libs
10972         do
10973                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
10974                 then
10975                         cf_add_1lib=
10976                         break
10977                 fi
10978         done
10979         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
10980 done
10981 LIBS="$cf_add_libs"
10982
10983         :
10984 else
10985         cf_pkgconfig_incs=
10986         cf_pkgconfig_libs=
10987
10988         echo "$as_me:10988: checking for XextCreateExtension in -lXext" >&5
10989 echo $ECHO_N "checking for XextCreateExtension in -lXext... $ECHO_C" >&6
10990 if test "${ac_cv_lib_Xext_XextCreateExtension+set}" = set; then
10991   echo $ECHO_N "(cached) $ECHO_C" >&6
10992 else
10993   ac_check_lib_save_LIBS=$LIBS
10994 LIBS="-lXext  $LIBS"
10995 cat >conftest.$ac_ext <<_ACEOF
10996 #line 10996 "configure"
10997 #include "confdefs.h"
10998
10999 /* Override any gcc2 internal prototype to avoid an error.  */
11000 #ifdef __cplusplus
11001 extern "C"
11002 #endif
11003 /* We use char because int might match the return type of a gcc2
11004    builtin and then its argument prototype would still apply.  */
11005 char XextCreateExtension ();
11006 int
11007 main ()
11008 {
11009 XextCreateExtension ();
11010   ;
11011   return 0;
11012 }
11013 _ACEOF
11014 rm -f conftest.$ac_objext conftest$ac_exeext
11015 if { (eval echo "$as_me:11015: \"$ac_link\"") >&5
11016   (eval $ac_link) 2>&5
11017   ac_status=$?
11018   echo "$as_me:11018: \$? = $ac_status" >&5
11019   (exit $ac_status); } &&
11020          { ac_try='test -s conftest$ac_exeext'
11021   { (eval echo "$as_me:11021: \"$ac_try\"") >&5
11022   (eval $ac_try) 2>&5
11023   ac_status=$?
11024   echo "$as_me:11024: \$? = $ac_status" >&5
11025   (exit $ac_status); }; }; then
11026   ac_cv_lib_Xext_XextCreateExtension=yes
11027 else
11028   echo "$as_me: failed program was:" >&5
11029 cat conftest.$ac_ext >&5
11030 ac_cv_lib_Xext_XextCreateExtension=no
11031 fi
11032 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11033 LIBS=$ac_check_lib_save_LIBS
11034 fi
11035 echo "$as_me:11035: result: $ac_cv_lib_Xext_XextCreateExtension" >&5
11036 echo "${ECHO_T}$ac_cv_lib_Xext_XextCreateExtension" >&6
11037 if test $ac_cv_lib_Xext_XextCreateExtension = yes; then
11038
11039 cf_add_libs="-lXext"
11040 # Filter out duplicates - this happens with badly-designed ".pc" files...
11041 for cf_add_1lib in $LIBS
11042 do
11043         for cf_add_2lib in $cf_add_libs
11044         do
11045                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11046                 then
11047                         cf_add_1lib=
11048                         break
11049                 fi
11050         done
11051         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11052 done
11053 LIBS="$cf_add_libs"
11054
11055 fi
11056
11057 fi
11058
11059 # OSX is schizoid about who owns /usr/X11 (old) versus /opt/X11 (new), and (and
11060 # in some cases has installed dummy files in the former, other cases replaced
11061 # it with a link to the new location).  This complicates the configure script.
11062 # Check for that pitfall, and recover using pkg-config
11063 #
11064 # If none of these are set, the configuration is almost certainly broken.
11065 if test -z "${X_CFLAGS}${X_PRE_LIBS}${X_LIBS}${X_EXTRA_LIBS}"
11066 then
11067
11068 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists x11; then
11069         test -n "$verbose" && echo "    found package x11" 1>&6
11070
11071 echo "${as_me:-configure}:11071: testing found package x11 ..." 1>&5
11072
11073         cf_pkgconfig_incs="`$PKG_CONFIG --cflags x11 2>/dev/null`"
11074         cf_pkgconfig_libs="`$PKG_CONFIG --libs   x11 2>/dev/null`"
11075         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
11076
11077 echo "${as_me:-configure}:11077: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11078
11079         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
11080
11081 echo "${as_me:-configure}:11081: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
11082
11083 cf_fix_cppflags=no
11084 cf_new_cflags=
11085 cf_new_cppflags=
11086 cf_new_extra_cppflags=
11087
11088 for cf_add_cflags in $cf_pkgconfig_incs
11089 do
11090 case $cf_fix_cppflags in
11091 (no)
11092         case $cf_add_cflags in
11093         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11094                 case $cf_add_cflags in
11095                 (-D*)
11096                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11097
11098                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11099                                 && test -z "${cf_tst_cflags}" \
11100                                 && cf_fix_cppflags=yes
11101
11102                         if test $cf_fix_cppflags = yes ; then
11103                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11104                                 continue
11105                         elif test "${cf_tst_cflags}" = "\"'" ; then
11106                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11107                                 continue
11108                         fi
11109                         ;;
11110                 esac
11111                 case "$CPPFLAGS" in
11112                 (*$cf_add_cflags)
11113                         ;;
11114                 (*)
11115                         case $cf_add_cflags in
11116                         (-D*)
11117                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11118
11119 CPPFLAGS=`echo "$CPPFLAGS" | \
11120         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11121                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11122
11123                                 ;;
11124                         esac
11125                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11126                         ;;
11127                 esac
11128                 ;;
11129         (*)
11130                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11131                 ;;
11132         esac
11133         ;;
11134 (yes)
11135         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11136
11137         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11138
11139         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11140                 && test -z "${cf_tst_cflags}" \
11141                 && cf_fix_cppflags=no
11142         ;;
11143 esac
11144 done
11145
11146 if test -n "$cf_new_cflags" ; then
11147
11148         CFLAGS="$CFLAGS $cf_new_cflags"
11149 fi
11150
11151 if test -n "$cf_new_cppflags" ; then
11152
11153         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11154 fi
11155
11156 if test -n "$cf_new_extra_cppflags" ; then
11157
11158         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11159 fi
11160
11161 cf_add_libs="$cf_pkgconfig_libs"
11162 # Filter out duplicates - this happens with badly-designed ".pc" files...
11163 for cf_add_1lib in $LIBS
11164 do
11165         for cf_add_2lib in $cf_add_libs
11166         do
11167                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11168                 then
11169                         cf_add_1lib=
11170                         break
11171                 fi
11172         done
11173         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11174 done
11175 LIBS="$cf_add_libs"
11176
11177         :
11178 else
11179         cf_pkgconfig_incs=
11180         cf_pkgconfig_libs=
11181         { echo "$as_me:11181: WARNING: unable to find X11 library" >&5
11182 echo "$as_me: WARNING: unable to find X11 library" >&2;}
11183 fi
11184
11185 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists ice; then
11186         test -n "$verbose" && echo "    found package ice" 1>&6
11187
11188 echo "${as_me:-configure}:11188: testing found package ice ..." 1>&5
11189
11190         cf_pkgconfig_incs="`$PKG_CONFIG --cflags ice 2>/dev/null`"
11191         cf_pkgconfig_libs="`$PKG_CONFIG --libs   ice 2>/dev/null`"
11192         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
11193
11194 echo "${as_me:-configure}:11194: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11195
11196         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
11197
11198 echo "${as_me:-configure}:11198: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
11199
11200 cf_fix_cppflags=no
11201 cf_new_cflags=
11202 cf_new_cppflags=
11203 cf_new_extra_cppflags=
11204
11205 for cf_add_cflags in $cf_pkgconfig_incs
11206 do
11207 case $cf_fix_cppflags in
11208 (no)
11209         case $cf_add_cflags in
11210         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11211                 case $cf_add_cflags in
11212                 (-D*)
11213                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11214
11215                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11216                                 && test -z "${cf_tst_cflags}" \
11217                                 && cf_fix_cppflags=yes
11218
11219                         if test $cf_fix_cppflags = yes ; then
11220                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11221                                 continue
11222                         elif test "${cf_tst_cflags}" = "\"'" ; then
11223                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11224                                 continue
11225                         fi
11226                         ;;
11227                 esac
11228                 case "$CPPFLAGS" in
11229                 (*$cf_add_cflags)
11230                         ;;
11231                 (*)
11232                         case $cf_add_cflags in
11233                         (-D*)
11234                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11235
11236 CPPFLAGS=`echo "$CPPFLAGS" | \
11237         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11238                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11239
11240                                 ;;
11241                         esac
11242                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11243                         ;;
11244                 esac
11245                 ;;
11246         (*)
11247                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11248                 ;;
11249         esac
11250         ;;
11251 (yes)
11252         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11253
11254         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11255
11256         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11257                 && test -z "${cf_tst_cflags}" \
11258                 && cf_fix_cppflags=no
11259         ;;
11260 esac
11261 done
11262
11263 if test -n "$cf_new_cflags" ; then
11264
11265         CFLAGS="$CFLAGS $cf_new_cflags"
11266 fi
11267
11268 if test -n "$cf_new_cppflags" ; then
11269
11270         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11271 fi
11272
11273 if test -n "$cf_new_extra_cppflags" ; then
11274
11275         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11276 fi
11277
11278 cf_add_libs="$cf_pkgconfig_libs"
11279 # Filter out duplicates - this happens with badly-designed ".pc" files...
11280 for cf_add_1lib in $LIBS
11281 do
11282         for cf_add_2lib in $cf_add_libs
11283         do
11284                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11285                 then
11286                         cf_add_1lib=
11287                         break
11288                 fi
11289         done
11290         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11291 done
11292 LIBS="$cf_add_libs"
11293
11294         :
11295 else
11296         cf_pkgconfig_incs=
11297         cf_pkgconfig_libs=
11298         { echo "$as_me:11298: WARNING: unable to find ICE library" >&5
11299 echo "$as_me: WARNING: unable to find ICE library" >&2;}
11300 fi
11301
11302 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists sm; then
11303         test -n "$verbose" && echo "    found package sm" 1>&6
11304
11305 echo "${as_me:-configure}:11305: testing found package sm ..." 1>&5
11306
11307         cf_pkgconfig_incs="`$PKG_CONFIG --cflags sm 2>/dev/null`"
11308         cf_pkgconfig_libs="`$PKG_CONFIG --libs   sm 2>/dev/null`"
11309         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
11310
11311 echo "${as_me:-configure}:11311: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11312
11313         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
11314
11315 echo "${as_me:-configure}:11315: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
11316
11317 cf_fix_cppflags=no
11318 cf_new_cflags=
11319 cf_new_cppflags=
11320 cf_new_extra_cppflags=
11321
11322 for cf_add_cflags in $cf_pkgconfig_incs
11323 do
11324 case $cf_fix_cppflags in
11325 (no)
11326         case $cf_add_cflags in
11327         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11328                 case $cf_add_cflags in
11329                 (-D*)
11330                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11331
11332                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11333                                 && test -z "${cf_tst_cflags}" \
11334                                 && cf_fix_cppflags=yes
11335
11336                         if test $cf_fix_cppflags = yes ; then
11337                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11338                                 continue
11339                         elif test "${cf_tst_cflags}" = "\"'" ; then
11340                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11341                                 continue
11342                         fi
11343                         ;;
11344                 esac
11345                 case "$CPPFLAGS" in
11346                 (*$cf_add_cflags)
11347                         ;;
11348                 (*)
11349                         case $cf_add_cflags in
11350                         (-D*)
11351                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11352
11353 CPPFLAGS=`echo "$CPPFLAGS" | \
11354         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11355                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11356
11357                                 ;;
11358                         esac
11359                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11360                         ;;
11361                 esac
11362                 ;;
11363         (*)
11364                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11365                 ;;
11366         esac
11367         ;;
11368 (yes)
11369         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11370
11371         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11372
11373         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11374                 && test -z "${cf_tst_cflags}" \
11375                 && cf_fix_cppflags=no
11376         ;;
11377 esac
11378 done
11379
11380 if test -n "$cf_new_cflags" ; then
11381
11382         CFLAGS="$CFLAGS $cf_new_cflags"
11383 fi
11384
11385 if test -n "$cf_new_cppflags" ; then
11386
11387         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11388 fi
11389
11390 if test -n "$cf_new_extra_cppflags" ; then
11391
11392         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11393 fi
11394
11395 cf_add_libs="$cf_pkgconfig_libs"
11396 # Filter out duplicates - this happens with badly-designed ".pc" files...
11397 for cf_add_1lib in $LIBS
11398 do
11399         for cf_add_2lib in $cf_add_libs
11400         do
11401                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11402                 then
11403                         cf_add_1lib=
11404                         break
11405                 fi
11406         done
11407         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11408 done
11409 LIBS="$cf_add_libs"
11410
11411         :
11412 else
11413         cf_pkgconfig_incs=
11414         cf_pkgconfig_libs=
11415         { echo "$as_me:11415: WARNING: unable to find SM library" >&5
11416 echo "$as_me: WARNING: unable to find SM library" >&2;}
11417 fi
11418
11419 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xt; then
11420         test -n "$verbose" && echo "    found package xt" 1>&6
11421
11422 echo "${as_me:-configure}:11422: testing found package xt ..." 1>&5
11423
11424         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xt 2>/dev/null`"
11425         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xt 2>/dev/null`"
11426         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
11427
11428 echo "${as_me:-configure}:11428: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11429
11430         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
11431
11432 echo "${as_me:-configure}:11432: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
11433
11434 cf_fix_cppflags=no
11435 cf_new_cflags=
11436 cf_new_cppflags=
11437 cf_new_extra_cppflags=
11438
11439 for cf_add_cflags in $cf_pkgconfig_incs
11440 do
11441 case $cf_fix_cppflags in
11442 (no)
11443         case $cf_add_cflags in
11444         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11445                 case $cf_add_cflags in
11446                 (-D*)
11447                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11448
11449                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11450                                 && test -z "${cf_tst_cflags}" \
11451                                 && cf_fix_cppflags=yes
11452
11453                         if test $cf_fix_cppflags = yes ; then
11454                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11455                                 continue
11456                         elif test "${cf_tst_cflags}" = "\"'" ; then
11457                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11458                                 continue
11459                         fi
11460                         ;;
11461                 esac
11462                 case "$CPPFLAGS" in
11463                 (*$cf_add_cflags)
11464                         ;;
11465                 (*)
11466                         case $cf_add_cflags in
11467                         (-D*)
11468                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11469
11470 CPPFLAGS=`echo "$CPPFLAGS" | \
11471         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11472                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11473
11474                                 ;;
11475                         esac
11476                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11477                         ;;
11478                 esac
11479                 ;;
11480         (*)
11481                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11482                 ;;
11483         esac
11484         ;;
11485 (yes)
11486         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11487
11488         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11489
11490         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11491                 && test -z "${cf_tst_cflags}" \
11492                 && cf_fix_cppflags=no
11493         ;;
11494 esac
11495 done
11496
11497 if test -n "$cf_new_cflags" ; then
11498
11499         CFLAGS="$CFLAGS $cf_new_cflags"
11500 fi
11501
11502 if test -n "$cf_new_cppflags" ; then
11503
11504         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11505 fi
11506
11507 if test -n "$cf_new_extra_cppflags" ; then
11508
11509         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11510 fi
11511
11512 cf_add_libs="$cf_pkgconfig_libs"
11513 # Filter out duplicates - this happens with badly-designed ".pc" files...
11514 for cf_add_1lib in $LIBS
11515 do
11516         for cf_add_2lib in $cf_add_libs
11517         do
11518                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11519                 then
11520                         cf_add_1lib=
11521                         break
11522                 fi
11523         done
11524         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11525 done
11526 LIBS="$cf_add_libs"
11527
11528         :
11529 else
11530         cf_pkgconfig_incs=
11531         cf_pkgconfig_libs=
11532         { echo "$as_me:11532: WARNING: unable to find Xt library" >&5
11533 echo "$as_me: WARNING: unable to find Xt library" >&2;}
11534 fi
11535
11536 fi
11537
11538 cf_have_X_LIBS=no
11539
11540 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xt; then
11541         test -n "$verbose" && echo "    found package xt" 1>&6
11542
11543 echo "${as_me:-configure}:11543: testing found package xt ..." 1>&5
11544
11545         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xt 2>/dev/null`"
11546         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xt 2>/dev/null`"
11547         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
11548
11549 echo "${as_me:-configure}:11549: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11550
11551         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
11552
11553 echo "${as_me:-configure}:11553: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
11554
11555 cf_fix_cppflags=no
11556 cf_new_cflags=
11557 cf_new_cppflags=
11558 cf_new_extra_cppflags=
11559
11560 for cf_add_cflags in $cf_pkgconfig_incs
11561 do
11562 case $cf_fix_cppflags in
11563 (no)
11564         case $cf_add_cflags in
11565         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11566                 case $cf_add_cflags in
11567                 (-D*)
11568                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11569
11570                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11571                                 && test -z "${cf_tst_cflags}" \
11572                                 && cf_fix_cppflags=yes
11573
11574                         if test $cf_fix_cppflags = yes ; then
11575                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11576                                 continue
11577                         elif test "${cf_tst_cflags}" = "\"'" ; then
11578                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11579                                 continue
11580                         fi
11581                         ;;
11582                 esac
11583                 case "$CPPFLAGS" in
11584                 (*$cf_add_cflags)
11585                         ;;
11586                 (*)
11587                         case $cf_add_cflags in
11588                         (-D*)
11589                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11590
11591 CPPFLAGS=`echo "$CPPFLAGS" | \
11592         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11593                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11594
11595                                 ;;
11596                         esac
11597                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11598                         ;;
11599                 esac
11600                 ;;
11601         (*)
11602                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11603                 ;;
11604         esac
11605         ;;
11606 (yes)
11607         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11608
11609         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11610
11611         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11612                 && test -z "${cf_tst_cflags}" \
11613                 && cf_fix_cppflags=no
11614         ;;
11615 esac
11616 done
11617
11618 if test -n "$cf_new_cflags" ; then
11619
11620         CFLAGS="$CFLAGS $cf_new_cflags"
11621 fi
11622
11623 if test -n "$cf_new_cppflags" ; then
11624
11625         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11626 fi
11627
11628 if test -n "$cf_new_extra_cppflags" ; then
11629
11630         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11631 fi
11632
11633 cf_add_libs="$cf_pkgconfig_libs"
11634 # Filter out duplicates - this happens with badly-designed ".pc" files...
11635 for cf_add_1lib in $LIBS
11636 do
11637         for cf_add_2lib in $cf_add_libs
11638         do
11639                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11640                 then
11641                         cf_add_1lib=
11642                         break
11643                 fi
11644         done
11645         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11646 done
11647 LIBS="$cf_add_libs"
11648
11649         case "x$LIBS" in
11650         (*-lX11*)
11651                 ;;
11652         (*)
11653 # we have an "xt" package, but it may omit Xt's dependency on X11
11654 echo "$as_me:11654: checking for usable X dependency" >&5
11655 echo $ECHO_N "checking for usable X dependency... $ECHO_C" >&6
11656 if test "${cf_cv_xt_x11_compat+set}" = set; then
11657   echo $ECHO_N "(cached) $ECHO_C" >&6
11658 else
11659
11660 cat >conftest.$ac_ext <<_ACEOF
11661 #line 11661 "configure"
11662 #include "confdefs.h"
11663
11664 #include <X11/Xlib.h>
11665
11666 int
11667 main ()
11668 {
11669
11670         int rc1 = XDrawLine((Display*) 0, (Drawable) 0, (GC) 0, 0, 0, 0, 0);
11671         int rc2 = XClearWindow((Display*) 0, (Window) 0);
11672         int rc3 = XMoveWindow((Display*) 0, (Window) 0, 0, 0);
11673         int rc4 = XMoveResizeWindow((Display*)0, (Window)0, 0, 0, 0, 0);
11674
11675   ;
11676   return 0;
11677 }
11678 _ACEOF
11679 rm -f conftest.$ac_objext conftest$ac_exeext
11680 if { (eval echo "$as_me:11680: \"$ac_link\"") >&5
11681   (eval $ac_link) 2>&5
11682   ac_status=$?
11683   echo "$as_me:11683: \$? = $ac_status" >&5
11684   (exit $ac_status); } &&
11685          { ac_try='test -s conftest$ac_exeext'
11686   { (eval echo "$as_me:11686: \"$ac_try\"") >&5
11687   (eval $ac_try) 2>&5
11688   ac_status=$?
11689   echo "$as_me:11689: \$? = $ac_status" >&5
11690   (exit $ac_status); }; }; then
11691   cf_cv_xt_x11_compat=yes
11692 else
11693   echo "$as_me: failed program was:" >&5
11694 cat conftest.$ac_ext >&5
11695 cf_cv_xt_x11_compat=no
11696 fi
11697 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11698 fi
11699 echo "$as_me:11699: result: $cf_cv_xt_x11_compat" >&5
11700 echo "${ECHO_T}$cf_cv_xt_x11_compat" >&6
11701                 if test "$cf_cv_xt_x11_compat" = no
11702                 then
11703                         test -n "$verbose" && echo "    work around broken X11 dependency" 1>&6
11704
11705 echo "${as_me:-configure}:11705: testing work around broken X11 dependency ..." 1>&5
11706
11707                         # 2010/11/19 - good enough until a working Xt on Xcb is delivered.
11708
11709 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists x11; then
11710         test -n "$verbose" && echo "    found package x11" 1>&6
11711
11712 echo "${as_me:-configure}:11712: testing found package x11 ..." 1>&5
11713
11714         cf_pkgconfig_incs="`$PKG_CONFIG --cflags x11 2>/dev/null`"
11715         cf_pkgconfig_libs="`$PKG_CONFIG --libs   x11 2>/dev/null`"
11716         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
11717
11718 echo "${as_me:-configure}:11718: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11719
11720         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
11721
11722 echo "${as_me:-configure}:11722: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
11723
11724 cf_fix_cppflags=no
11725 cf_new_cflags=
11726 cf_new_cppflags=
11727 cf_new_extra_cppflags=
11728
11729 for cf_add_cflags in $cf_pkgconfig_incs
11730 do
11731 case $cf_fix_cppflags in
11732 (no)
11733         case $cf_add_cflags in
11734         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11735                 case $cf_add_cflags in
11736                 (-D*)
11737                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11738
11739                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11740                                 && test -z "${cf_tst_cflags}" \
11741                                 && cf_fix_cppflags=yes
11742
11743                         if test $cf_fix_cppflags = yes ; then
11744                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11745                                 continue
11746                         elif test "${cf_tst_cflags}" = "\"'" ; then
11747                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11748                                 continue
11749                         fi
11750                         ;;
11751                 esac
11752                 case "$CPPFLAGS" in
11753                 (*$cf_add_cflags)
11754                         ;;
11755                 (*)
11756                         case $cf_add_cflags in
11757                         (-D*)
11758                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11759
11760 CPPFLAGS=`echo "$CPPFLAGS" | \
11761         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11762                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11763
11764                                 ;;
11765                         esac
11766                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11767                         ;;
11768                 esac
11769                 ;;
11770         (*)
11771                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11772                 ;;
11773         esac
11774         ;;
11775 (yes)
11776         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11777
11778         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11779
11780         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11781                 && test -z "${cf_tst_cflags}" \
11782                 && cf_fix_cppflags=no
11783         ;;
11784 esac
11785 done
11786
11787 if test -n "$cf_new_cflags" ; then
11788
11789         CFLAGS="$CFLAGS $cf_new_cflags"
11790 fi
11791
11792 if test -n "$cf_new_cppflags" ; then
11793
11794         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11795 fi
11796
11797 if test -n "$cf_new_extra_cppflags" ; then
11798
11799         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11800 fi
11801
11802 cf_add_libs="$cf_pkgconfig_libs"
11803 # Filter out duplicates - this happens with badly-designed ".pc" files...
11804 for cf_add_1lib in $LIBS
11805 do
11806         for cf_add_2lib in $cf_add_libs
11807         do
11808                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11809                 then
11810                         cf_add_1lib=
11811                         break
11812                 fi
11813         done
11814         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11815 done
11816 LIBS="$cf_add_libs"
11817
11818         :
11819 else
11820         cf_pkgconfig_incs=
11821         cf_pkgconfig_libs=
11822
11823 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
11824
11825 echo "${as_me:-configure}:11825: testing ...before $LIBS ..." 1>&5
11826
11827 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%-lXt %-lXt -lX11 %" -e 's%  % %g'`
11828 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
11829
11830 echo "${as_me:-configure}:11830: testing ...after  $LIBS ..." 1>&5
11831
11832 fi
11833
11834                 fi
11835                 ;;
11836         esac
11837
11838 echo "$as_me:11838: checking for usable X Toolkit package" >&5
11839 echo $ECHO_N "checking for usable X Toolkit package... $ECHO_C" >&6
11840 if test "${cf_cv_xt_ice_compat+set}" = set; then
11841   echo $ECHO_N "(cached) $ECHO_C" >&6
11842 else
11843
11844 cat >conftest.$ac_ext <<_ACEOF
11845 #line 11845 "configure"
11846 #include "confdefs.h"
11847
11848 #include <X11/Shell.h>
11849
11850 int
11851 main ()
11852 {
11853 int num = IceConnectionNumber(0)
11854
11855   ;
11856   return 0;
11857 }
11858 _ACEOF
11859 rm -f conftest.$ac_objext conftest$ac_exeext
11860 if { (eval echo "$as_me:11860: \"$ac_link\"") >&5
11861   (eval $ac_link) 2>&5
11862   ac_status=$?
11863   echo "$as_me:11863: \$? = $ac_status" >&5
11864   (exit $ac_status); } &&
11865          { ac_try='test -s conftest$ac_exeext'
11866   { (eval echo "$as_me:11866: \"$ac_try\"") >&5
11867   (eval $ac_try) 2>&5
11868   ac_status=$?
11869   echo "$as_me:11869: \$? = $ac_status" >&5
11870   (exit $ac_status); }; }; then
11871   cf_cv_xt_ice_compat=yes
11872 else
11873   echo "$as_me: failed program was:" >&5
11874 cat conftest.$ac_ext >&5
11875 cf_cv_xt_ice_compat=no
11876 fi
11877 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11878 fi
11879 echo "$as_me:11879: result: $cf_cv_xt_ice_compat" >&5
11880 echo "${ECHO_T}$cf_cv_xt_ice_compat" >&6
11881
11882         if test "$cf_cv_xt_ice_compat" = no
11883         then
11884                 # workaround for broken ".pc" files used for X Toolkit.
11885                 case "x$X_PRE_LIBS" in
11886                 (*-lICE*)
11887                         case "x$LIBS" in
11888                         (*-lICE*)
11889                                 ;;
11890                         (*)
11891                                 test -n "$verbose" && echo "    work around broken ICE dependency" 1>&6
11892
11893 echo "${as_me:-configure}:11893: testing work around broken ICE dependency ..." 1>&5
11894
11895 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists ice; then
11896         test -n "$verbose" && echo "    found package ice" 1>&6
11897
11898 echo "${as_me:-configure}:11898: testing found package ice ..." 1>&5
11899
11900         cf_pkgconfig_incs="`$PKG_CONFIG --cflags ice 2>/dev/null`"
11901         cf_pkgconfig_libs="`$PKG_CONFIG --libs   ice 2>/dev/null`"
11902         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
11903
11904 echo "${as_me:-configure}:11904: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11905
11906         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
11907
11908 echo "${as_me:-configure}:11908: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
11909
11910 cf_fix_cppflags=no
11911 cf_new_cflags=
11912 cf_new_cppflags=
11913 cf_new_extra_cppflags=
11914
11915 for cf_add_cflags in $cf_pkgconfig_incs
11916 do
11917 case $cf_fix_cppflags in
11918 (no)
11919         case $cf_add_cflags in
11920         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11921                 case $cf_add_cflags in
11922                 (-D*)
11923                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11924
11925                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11926                                 && test -z "${cf_tst_cflags}" \
11927                                 && cf_fix_cppflags=yes
11928
11929                         if test $cf_fix_cppflags = yes ; then
11930                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11931                                 continue
11932                         elif test "${cf_tst_cflags}" = "\"'" ; then
11933                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11934                                 continue
11935                         fi
11936                         ;;
11937                 esac
11938                 case "$CPPFLAGS" in
11939                 (*$cf_add_cflags)
11940                         ;;
11941                 (*)
11942                         case $cf_add_cflags in
11943                         (-D*)
11944                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11945
11946 CPPFLAGS=`echo "$CPPFLAGS" | \
11947         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11948                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11949
11950                                 ;;
11951                         esac
11952                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11953                         ;;
11954                 esac
11955                 ;;
11956         (*)
11957                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11958                 ;;
11959         esac
11960         ;;
11961 (yes)
11962         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11963
11964         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11965
11966         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11967                 && test -z "${cf_tst_cflags}" \
11968                 && cf_fix_cppflags=no
11969         ;;
11970 esac
11971 done
11972
11973 if test -n "$cf_new_cflags" ; then
11974
11975         CFLAGS="$CFLAGS $cf_new_cflags"
11976 fi
11977
11978 if test -n "$cf_new_cppflags" ; then
11979
11980         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11981 fi
11982
11983 if test -n "$cf_new_extra_cppflags" ; then
11984
11985         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11986 fi
11987
11988 cf_add_libs="$cf_pkgconfig_libs"
11989 # Filter out duplicates - this happens with badly-designed ".pc" files...
11990 for cf_add_1lib in $LIBS
11991 do
11992         for cf_add_2lib in $cf_add_libs
11993         do
11994                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11995                 then
11996                         cf_add_1lib=
11997                         break
11998                 fi
11999         done
12000         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12001 done
12002 LIBS="$cf_add_libs"
12003
12004 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists sm; then
12005         test -n "$verbose" && echo "    found package sm" 1>&6
12006
12007 echo "${as_me:-configure}:12007: testing found package sm ..." 1>&5
12008
12009         cf_pkgconfig_incs="`$PKG_CONFIG --cflags sm 2>/dev/null`"
12010         cf_pkgconfig_libs="`$PKG_CONFIG --libs   sm 2>/dev/null`"
12011         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
12012
12013 echo "${as_me:-configure}:12013: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12014
12015         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
12016
12017 echo "${as_me:-configure}:12017: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
12018
12019 cf_fix_cppflags=no
12020 cf_new_cflags=
12021 cf_new_cppflags=
12022 cf_new_extra_cppflags=
12023
12024 for cf_add_cflags in $cf_pkgconfig_incs
12025 do
12026 case $cf_fix_cppflags in
12027 (no)
12028         case $cf_add_cflags in
12029         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12030                 case $cf_add_cflags in
12031                 (-D*)
12032                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12033
12034                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12035                                 && test -z "${cf_tst_cflags}" \
12036                                 && cf_fix_cppflags=yes
12037
12038                         if test $cf_fix_cppflags = yes ; then
12039                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12040                                 continue
12041                         elif test "${cf_tst_cflags}" = "\"'" ; then
12042                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12043                                 continue
12044                         fi
12045                         ;;
12046                 esac
12047                 case "$CPPFLAGS" in
12048                 (*$cf_add_cflags)
12049                         ;;
12050                 (*)
12051                         case $cf_add_cflags in
12052                         (-D*)
12053                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12054
12055 CPPFLAGS=`echo "$CPPFLAGS" | \
12056         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12057                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12058
12059                                 ;;
12060                         esac
12061                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
12062                         ;;
12063                 esac
12064                 ;;
12065         (*)
12066                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
12067                 ;;
12068         esac
12069         ;;
12070 (yes)
12071         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12072
12073         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12074
12075         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12076                 && test -z "${cf_tst_cflags}" \
12077                 && cf_fix_cppflags=no
12078         ;;
12079 esac
12080 done
12081
12082 if test -n "$cf_new_cflags" ; then
12083
12084         CFLAGS="$CFLAGS $cf_new_cflags"
12085 fi
12086
12087 if test -n "$cf_new_cppflags" ; then
12088
12089         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
12090 fi
12091
12092 if test -n "$cf_new_extra_cppflags" ; then
12093
12094         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
12095 fi
12096
12097 cf_add_libs="$cf_pkgconfig_libs"
12098 # Filter out duplicates - this happens with badly-designed ".pc" files...
12099 for cf_add_1lib in $LIBS
12100 do
12101         for cf_add_2lib in $cf_add_libs
12102         do
12103                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12104                 then
12105                         cf_add_1lib=
12106                         break
12107                 fi
12108         done
12109         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12110 done
12111 LIBS="$cf_add_libs"
12112
12113         :
12114 else
12115         cf_pkgconfig_incs=
12116         cf_pkgconfig_libs=
12117         :
12118 fi
12119
12120 else
12121         cf_pkgconfig_incs=
12122         cf_pkgconfig_libs=
12123
12124 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
12125
12126 echo "${as_me:-configure}:12126: testing ...before $LIBS ..." 1>&5
12127
12128 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%-lXt %-lXt $X_PRE_LIBS %" -e 's%  % %g'`
12129 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
12130
12131 echo "${as_me:-configure}:12131: testing ...after  $LIBS ..." 1>&5
12132
12133 fi
12134
12135                                 ;;
12136                         esac
12137                         ;;
12138                 esac
12139         fi
12140
12141         cf_have_X_LIBS=yes
12142
12143 else
12144         cf_pkgconfig_incs=
12145         cf_pkgconfig_libs=
12146
12147         LDFLAGS="$X_LIBS $LDFLAGS"
12148
12149 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
12150
12151 echo "${as_me:-configure}:12151: testing checking additions to CFLAGS ..." 1>&5
12152
12153 cf_check_cflags="$CFLAGS"
12154 cf_check_cppflags="$CPPFLAGS"
12155
12156 cf_fix_cppflags=no
12157 cf_new_cflags=
12158 cf_new_cppflags=
12159 cf_new_extra_cppflags=
12160
12161 for cf_add_cflags in $X_CFLAGS
12162 do
12163 case $cf_fix_cppflags in
12164 (no)
12165         case $cf_add_cflags in
12166         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12167                 case $cf_add_cflags in
12168                 (-D*)
12169                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12170
12171                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12172                                 && test -z "${cf_tst_cflags}" \
12173                                 && cf_fix_cppflags=yes
12174
12175                         if test $cf_fix_cppflags = yes ; then
12176                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12177                                 continue
12178                         elif test "${cf_tst_cflags}" = "\"'" ; then
12179                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12180                                 continue
12181                         fi
12182                         ;;
12183                 esac
12184                 case "$CPPFLAGS" in
12185                 (*$cf_add_cflags)
12186                         ;;
12187                 (*)
12188                         case $cf_add_cflags in
12189                         (-D*)
12190                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12191
12192 CPPFLAGS=`echo "$CPPFLAGS" | \
12193         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12194                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12195
12196                                 ;;
12197                         esac
12198                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
12199                         ;;
12200                 esac
12201                 ;;
12202         (*)
12203                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
12204                 ;;
12205         esac
12206         ;;
12207 (yes)
12208         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12209
12210         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12211
12212         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12213                 && test -z "${cf_tst_cflags}" \
12214                 && cf_fix_cppflags=no
12215         ;;
12216 esac
12217 done
12218
12219 if test -n "$cf_new_cflags" ; then
12220         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
12221
12222 echo "${as_me:-configure}:12222: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
12223
12224         CFLAGS="$CFLAGS $cf_new_cflags"
12225 fi
12226
12227 if test -n "$cf_new_cppflags" ; then
12228         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
12229
12230 echo "${as_me:-configure}:12230: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
12231
12232         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
12233 fi
12234
12235 if test -n "$cf_new_extra_cppflags" ; then
12236         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
12237
12238 echo "${as_me:-configure}:12238: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
12239
12240         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
12241 fi
12242
12243 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
12244 cat >conftest.$ac_ext <<_ACEOF
12245 #line 12245 "configure"
12246 #include "confdefs.h"
12247 #include <stdio.h>
12248 int
12249 main ()
12250 {
12251 printf("Hello world");
12252   ;
12253   return 0;
12254 }
12255 _ACEOF
12256 rm -f conftest.$ac_objext conftest$ac_exeext
12257 if { (eval echo "$as_me:12257: \"$ac_link\"") >&5
12258   (eval $ac_link) 2>&5
12259   ac_status=$?
12260   echo "$as_me:12260: \$? = $ac_status" >&5
12261   (exit $ac_status); } &&
12262          { ac_try='test -s conftest$ac_exeext'
12263   { (eval echo "$as_me:12263: \"$ac_try\"") >&5
12264   (eval $ac_try) 2>&5
12265   ac_status=$?
12266   echo "$as_me:12266: \$? = $ac_status" >&5
12267   (exit $ac_status); }; }; then
12268   :
12269 else
12270   echo "$as_me: failed program was:" >&5
12271 cat conftest.$ac_ext >&5
12272 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
12273
12274 echo "${as_me:-configure}:12274: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
12275
12276          if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
12277                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
12278
12279 echo "${as_me:-configure}:12279: testing but keeping change to \$CPPFLAGS ..." 1>&5
12280
12281          fi
12282          CFLAGS="$cf_check_flags"
12283 fi
12284 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12285 fi
12286
12287         echo "$as_me:12287: checking for XOpenDisplay" >&5
12288 echo $ECHO_N "checking for XOpenDisplay... $ECHO_C" >&6
12289 if test "${ac_cv_func_XOpenDisplay+set}" = set; then
12290   echo $ECHO_N "(cached) $ECHO_C" >&6
12291 else
12292   cat >conftest.$ac_ext <<_ACEOF
12293 #line 12293 "configure"
12294 #include "confdefs.h"
12295 /* System header to define __stub macros and hopefully few prototypes,
12296     which can conflict with char XOpenDisplay (); below.  */
12297 #include <assert.h>
12298 /* Override any gcc2 internal prototype to avoid an error.  */
12299 #ifdef __cplusplus
12300 extern "C"
12301 #endif
12302 /* We use char because int might match the return type of a gcc2
12303    builtin and then its argument prototype would still apply.  */
12304 char XOpenDisplay ();
12305 char (*f) ();
12306
12307 int
12308 main ()
12309 {
12310 /* The GNU C library defines this for functions which it implements
12311     to always fail with ENOSYS.  Some functions are actually named
12312     something starting with __ and the normal name is an alias.  */
12313 #if defined (__stub_XOpenDisplay) || defined (__stub___XOpenDisplay)
12314 choke me
12315 #else
12316 f = XOpenDisplay; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
12317 #endif
12318
12319   ;
12320   return 0;
12321 }
12322 _ACEOF
12323 rm -f conftest.$ac_objext conftest$ac_exeext
12324 if { (eval echo "$as_me:12324: \"$ac_link\"") >&5
12325   (eval $ac_link) 2>&5
12326   ac_status=$?
12327   echo "$as_me:12327: \$? = $ac_status" >&5
12328   (exit $ac_status); } &&
12329          { ac_try='test -s conftest$ac_exeext'
12330   { (eval echo "$as_me:12330: \"$ac_try\"") >&5
12331   (eval $ac_try) 2>&5
12332   ac_status=$?
12333   echo "$as_me:12333: \$? = $ac_status" >&5
12334   (exit $ac_status); }; }; then
12335   ac_cv_func_XOpenDisplay=yes
12336 else
12337   echo "$as_me: failed program was:" >&5
12338 cat conftest.$ac_ext >&5
12339 ac_cv_func_XOpenDisplay=no
12340 fi
12341 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12342 fi
12343 echo "$as_me:12343: result: $ac_cv_func_XOpenDisplay" >&5
12344 echo "${ECHO_T}$ac_cv_func_XOpenDisplay" >&6
12345 if test $ac_cv_func_XOpenDisplay = yes; then
12346   :
12347 else
12348
12349         echo "$as_me:12349: checking for XOpenDisplay in -lX11" >&5
12350 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
12351 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
12352   echo $ECHO_N "(cached) $ECHO_C" >&6
12353 else
12354   ac_check_lib_save_LIBS=$LIBS
12355 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
12356 cat >conftest.$ac_ext <<_ACEOF
12357 #line 12357 "configure"
12358 #include "confdefs.h"
12359
12360 /* Override any gcc2 internal prototype to avoid an error.  */
12361 #ifdef __cplusplus
12362 extern "C"
12363 #endif
12364 /* We use char because int might match the return type of a gcc2
12365    builtin and then its argument prototype would still apply.  */
12366 char XOpenDisplay ();
12367 int
12368 main ()
12369 {
12370 XOpenDisplay ();
12371   ;
12372   return 0;
12373 }
12374 _ACEOF
12375 rm -f conftest.$ac_objext conftest$ac_exeext
12376 if { (eval echo "$as_me:12376: \"$ac_link\"") >&5
12377   (eval $ac_link) 2>&5
12378   ac_status=$?
12379   echo "$as_me:12379: \$? = $ac_status" >&5
12380   (exit $ac_status); } &&
12381          { ac_try='test -s conftest$ac_exeext'
12382   { (eval echo "$as_me:12382: \"$ac_try\"") >&5
12383   (eval $ac_try) 2>&5
12384   ac_status=$?
12385   echo "$as_me:12385: \$? = $ac_status" >&5
12386   (exit $ac_status); }; }; then
12387   ac_cv_lib_X11_XOpenDisplay=yes
12388 else
12389   echo "$as_me: failed program was:" >&5
12390 cat conftest.$ac_ext >&5
12391 ac_cv_lib_X11_XOpenDisplay=no
12392 fi
12393 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12394 LIBS=$ac_check_lib_save_LIBS
12395 fi
12396 echo "$as_me:12396: result: $ac_cv_lib_X11_XOpenDisplay" >&5
12397 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
12398 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
12399
12400 cf_add_libs="-lX11"
12401 # Filter out duplicates - this happens with badly-designed ".pc" files...
12402 for cf_add_1lib in $LIBS
12403 do
12404         for cf_add_2lib in $cf_add_libs
12405         do
12406                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12407                 then
12408                         cf_add_1lib=
12409                         break
12410                 fi
12411         done
12412         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12413 done
12414 LIBS="$cf_add_libs"
12415
12416 fi
12417
12418 fi
12419
12420         echo "$as_me:12420: checking for XtAppInitialize" >&5
12421 echo $ECHO_N "checking for XtAppInitialize... $ECHO_C" >&6
12422 if test "${ac_cv_func_XtAppInitialize+set}" = set; then
12423   echo $ECHO_N "(cached) $ECHO_C" >&6
12424 else
12425   cat >conftest.$ac_ext <<_ACEOF
12426 #line 12426 "configure"
12427 #include "confdefs.h"
12428 /* System header to define __stub macros and hopefully few prototypes,
12429     which can conflict with char XtAppInitialize (); below.  */
12430 #include <assert.h>
12431 /* Override any gcc2 internal prototype to avoid an error.  */
12432 #ifdef __cplusplus
12433 extern "C"
12434 #endif
12435 /* We use char because int might match the return type of a gcc2
12436    builtin and then its argument prototype would still apply.  */
12437 char XtAppInitialize ();
12438 char (*f) ();
12439
12440 int
12441 main ()
12442 {
12443 /* The GNU C library defines this for functions which it implements
12444     to always fail with ENOSYS.  Some functions are actually named
12445     something starting with __ and the normal name is an alias.  */
12446 #if defined (__stub_XtAppInitialize) || defined (__stub___XtAppInitialize)
12447 choke me
12448 #else
12449 f = XtAppInitialize; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
12450 #endif
12451
12452   ;
12453   return 0;
12454 }
12455 _ACEOF
12456 rm -f conftest.$ac_objext conftest$ac_exeext
12457 if { (eval echo "$as_me:12457: \"$ac_link\"") >&5
12458   (eval $ac_link) 2>&5
12459   ac_status=$?
12460   echo "$as_me:12460: \$? = $ac_status" >&5
12461   (exit $ac_status); } &&
12462          { ac_try='test -s conftest$ac_exeext'
12463   { (eval echo "$as_me:12463: \"$ac_try\"") >&5
12464   (eval $ac_try) 2>&5
12465   ac_status=$?
12466   echo "$as_me:12466: \$? = $ac_status" >&5
12467   (exit $ac_status); }; }; then
12468   ac_cv_func_XtAppInitialize=yes
12469 else
12470   echo "$as_me: failed program was:" >&5
12471 cat conftest.$ac_ext >&5
12472 ac_cv_func_XtAppInitialize=no
12473 fi
12474 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12475 fi
12476 echo "$as_me:12476: result: $ac_cv_func_XtAppInitialize" >&5
12477 echo "${ECHO_T}$ac_cv_func_XtAppInitialize" >&6
12478 if test $ac_cv_func_XtAppInitialize = yes; then
12479   :
12480 else
12481
12482         echo "$as_me:12482: checking for XtAppInitialize in -lXt" >&5
12483 echo $ECHO_N "checking for XtAppInitialize in -lXt... $ECHO_C" >&6
12484 if test "${ac_cv_lib_Xt_XtAppInitialize+set}" = set; then
12485   echo $ECHO_N "(cached) $ECHO_C" >&6
12486 else
12487   ac_check_lib_save_LIBS=$LIBS
12488 LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
12489 cat >conftest.$ac_ext <<_ACEOF
12490 #line 12490 "configure"
12491 #include "confdefs.h"
12492
12493 /* Override any gcc2 internal prototype to avoid an error.  */
12494 #ifdef __cplusplus
12495 extern "C"
12496 #endif
12497 /* We use char because int might match the return type of a gcc2
12498    builtin and then its argument prototype would still apply.  */
12499 char XtAppInitialize ();
12500 int
12501 main ()
12502 {
12503 XtAppInitialize ();
12504   ;
12505   return 0;
12506 }
12507 _ACEOF
12508 rm -f conftest.$ac_objext conftest$ac_exeext
12509 if { (eval echo "$as_me:12509: \"$ac_link\"") >&5
12510   (eval $ac_link) 2>&5
12511   ac_status=$?
12512   echo "$as_me:12512: \$? = $ac_status" >&5
12513   (exit $ac_status); } &&
12514          { ac_try='test -s conftest$ac_exeext'
12515   { (eval echo "$as_me:12515: \"$ac_try\"") >&5
12516   (eval $ac_try) 2>&5
12517   ac_status=$?
12518   echo "$as_me:12518: \$? = $ac_status" >&5
12519   (exit $ac_status); }; }; then
12520   ac_cv_lib_Xt_XtAppInitialize=yes
12521 else
12522   echo "$as_me: failed program was:" >&5
12523 cat conftest.$ac_ext >&5
12524 ac_cv_lib_Xt_XtAppInitialize=no
12525 fi
12526 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12527 LIBS=$ac_check_lib_save_LIBS
12528 fi
12529 echo "$as_me:12529: result: $ac_cv_lib_Xt_XtAppInitialize" >&5
12530 echo "${ECHO_T}$ac_cv_lib_Xt_XtAppInitialize" >&6
12531 if test $ac_cv_lib_Xt_XtAppInitialize = yes; then
12532
12533 cat >>confdefs.h <<\EOF
12534 #define HAVE_LIBXT 1
12535 EOF
12536
12537                  cf_have_X_LIBS=Xt
12538                  LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS"
12539 fi
12540
12541 fi
12542
12543 fi
12544
12545 if test $cf_have_X_LIBS = no ; then
12546         { echo "$as_me:12546: WARNING: Unable to successfully link X Toolkit library (-lXt) with
12547 test program.  You will have to check and add the proper libraries by hand
12548 to makefile." >&5
12549 echo "$as_me: WARNING: Unable to successfully link X Toolkit library (-lXt) with
12550 test program.  You will have to check and add the proper libraries by hand
12551 to makefile." >&2;}
12552 fi
12553
12554 cf_x_athena_root=$cf_x_athena
12555 cf_x_athena_inc=""
12556
12557 for cf_path in default \
12558         /usr/contrib/X11R6 \
12559         /usr/contrib/X11R5 \
12560         /usr/lib/X11R5 \
12561         /usr/local
12562 do
12563         if test -z "$cf_x_athena_inc" ; then
12564                 cf_save="$CPPFLAGS"
12565                 cf_test=X11/$cf_x_athena_root/SimpleMenu.h
12566                 if test $cf_path != default ; then
12567                         CPPFLAGS="$cf_save -I$cf_path/include"
12568                         echo "$as_me:12568: checking for $cf_test in $cf_path" >&5
12569 echo $ECHO_N "checking for $cf_test in $cf_path... $ECHO_C" >&6
12570                 else
12571                         echo "$as_me:12571: checking for $cf_test" >&5
12572 echo $ECHO_N "checking for $cf_test... $ECHO_C" >&6
12573                 fi
12574                 cat >conftest.$ac_ext <<_ACEOF
12575 #line 12575 "configure"
12576 #include "confdefs.h"
12577
12578 #include <X11/Intrinsic.h>
12579 #include <$cf_test>
12580 int
12581 main ()
12582 {
12583
12584   ;
12585   return 0;
12586 }
12587 _ACEOF
12588 rm -f conftest.$ac_objext
12589 if { (eval echo "$as_me:12589: \"$ac_compile\"") >&5
12590   (eval $ac_compile) 2>&5
12591   ac_status=$?
12592   echo "$as_me:12592: \$? = $ac_status" >&5
12593   (exit $ac_status); } &&
12594          { ac_try='test -s conftest.$ac_objext'
12595   { (eval echo "$as_me:12595: \"$ac_try\"") >&5
12596   (eval $ac_try) 2>&5
12597   ac_status=$?
12598   echo "$as_me:12598: \$? = $ac_status" >&5
12599   (exit $ac_status); }; }; then
12600   cf_result=yes
12601 else
12602   echo "$as_me: failed program was:" >&5
12603 cat conftest.$ac_ext >&5
12604 cf_result=no
12605 fi
12606 rm -f conftest.$ac_objext conftest.$ac_ext
12607                 echo "$as_me:12607: result: $cf_result" >&5
12608 echo "${ECHO_T}$cf_result" >&6
12609                 if test "$cf_result" = yes ; then
12610                         cf_x_athena_inc=$cf_path
12611                         break
12612                 else
12613                         CPPFLAGS="$cf_save"
12614                 fi
12615         fi
12616 done
12617
12618 if test -z "$cf_x_athena_inc" ; then
12619         { echo "$as_me:12619: WARNING: Unable to successfully find Athena header files with test program" >&5
12620 echo "$as_me: WARNING: Unable to successfully find Athena header files with test program" >&2;}
12621 elif test "$cf_x_athena_inc" != default ; then
12622         CPPFLAGS="$CPPFLAGS -I$cf_x_athena_inc"
12623 fi
12624
12625 cf_x_athena_root=$cf_x_athena
12626 cf_x_athena_lib=""
12627
12628 for cf_path in default \
12629         /usr/contrib/X11R6 \
12630         /usr/contrib/X11R5 \
12631         /usr/lib/X11R5 \
12632         /usr/local
12633 do
12634         for cf_lib in \
12635                 ${cf_x_athena_root} \
12636                 ${cf_x_athena_root}7 \
12637                 ${cf_x_athena_root}6
12638         do
12639         for cf_libs in \
12640                 "-l$cf_lib -lXmu" \
12641                 "-l$cf_lib -lXpm -lXmu" \
12642                 "-l${cf_lib}_s -lXmu_s"
12643         do
12644                 if test -z "$cf_x_athena_lib" ; then
12645                         cf_save="$LIBS"
12646                         cf_test=XawSimpleMenuAddGlobalActions
12647                         if test $cf_path != default ; then
12648
12649 cf_add_libs="-L$cf_path/lib $cf_libs"
12650 # Filter out duplicates - this happens with badly-designed ".pc" files...
12651 for cf_add_1lib in $LIBS
12652 do
12653         for cf_add_2lib in $cf_add_libs
12654         do
12655                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12656                 then
12657                         cf_add_1lib=
12658                         break
12659                 fi
12660         done
12661         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12662 done
12663 LIBS="$cf_add_libs"
12664
12665                                 echo "$as_me:12665: checking for $cf_libs in $cf_path" >&5
12666 echo $ECHO_N "checking for $cf_libs in $cf_path... $ECHO_C" >&6
12667                         else
12668
12669 cf_add_libs="$cf_libs"
12670 # Filter out duplicates - this happens with badly-designed ".pc" files...
12671 for cf_add_1lib in $LIBS
12672 do
12673         for cf_add_2lib in $cf_add_libs
12674         do
12675                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12676                 then
12677                         cf_add_1lib=
12678                         break
12679                 fi
12680         done
12681         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12682 done
12683 LIBS="$cf_add_libs"
12684
12685                                 echo "$as_me:12685: checking for $cf_test in $cf_libs" >&5
12686 echo $ECHO_N "checking for $cf_test in $cf_libs... $ECHO_C" >&6
12687                         fi
12688                         cat >conftest.$ac_ext <<_ACEOF
12689 #line 12689 "configure"
12690 #include "confdefs.h"
12691
12692 #include <X11/Intrinsic.h>
12693 #include <X11/$cf_x_athena_root/SimpleMenu.h>
12694
12695 int
12696 main ()
12697 {
12698
12699 $cf_test((XtAppContext) 0)
12700   ;
12701   return 0;
12702 }
12703 _ACEOF
12704 rm -f conftest.$ac_objext conftest$ac_exeext
12705 if { (eval echo "$as_me:12705: \"$ac_link\"") >&5
12706   (eval $ac_link) 2>&5
12707   ac_status=$?
12708   echo "$as_me:12708: \$? = $ac_status" >&5
12709   (exit $ac_status); } &&
12710          { ac_try='test -s conftest$ac_exeext'
12711   { (eval echo "$as_me:12711: \"$ac_try\"") >&5
12712   (eval $ac_try) 2>&5
12713   ac_status=$?
12714   echo "$as_me:12714: \$? = $ac_status" >&5
12715   (exit $ac_status); }; }; then
12716   cf_result=yes
12717 else
12718   echo "$as_me: failed program was:" >&5
12719 cat conftest.$ac_ext >&5
12720 cf_result=no
12721 fi
12722 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12723                         echo "$as_me:12723: result: $cf_result" >&5
12724 echo "${ECHO_T}$cf_result" >&6
12725                         if test "$cf_result" = yes ; then
12726                                 cf_x_athena_lib="$cf_libs"
12727                                 break
12728                         fi
12729                         LIBS="$cf_save"
12730                 fi
12731         done # cf_libs
12732                 test -n "$cf_x_athena_lib" && break
12733         done # cf_lib
12734 done
12735
12736 if test -z "$cf_x_athena_lib" ; then
12737         { { echo "$as_me:12737: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&5
12738 echo "$as_me: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&2;}
12739    { (exit 1); exit 1; }; }
12740 fi
12741
12742 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
12743
12744 cat >>confdefs.h <<EOF
12745 #define $cf_x_athena_LIBS 1
12746 EOF
12747
12748 fi
12749
12750 if test -n "$ac_tool_prefix"; then
12751   for ac_prog in xcurses-config
12752   do
12753     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
12754 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
12755 echo "$as_me:12755: checking for $ac_word" >&5
12756 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
12757 if test "${ac_cv_prog_XCURSES_CONFIG+set}" = set; then
12758   echo $ECHO_N "(cached) $ECHO_C" >&6
12759 else
12760   if test -n "$XCURSES_CONFIG"; then
12761   ac_cv_prog_XCURSES_CONFIG="$XCURSES_CONFIG" # Let the user override the test.
12762 else
12763   ac_save_IFS=$IFS; IFS=$ac_path_separator
12764 ac_dummy="$PATH"
12765 for ac_dir in $ac_dummy; do
12766   IFS=$ac_save_IFS
12767   test -z "$ac_dir" && ac_dir=.
12768   $as_executable_p "$ac_dir/$ac_word" || continue
12769 ac_cv_prog_XCURSES_CONFIG="$ac_tool_prefix$ac_prog"
12770 echo "$as_me:12770: found $ac_dir/$ac_word" >&5
12771 break
12772 done
12773
12774 fi
12775 fi
12776 XCURSES_CONFIG=$ac_cv_prog_XCURSES_CONFIG
12777 if test -n "$XCURSES_CONFIG"; then
12778   echo "$as_me:12778: result: $XCURSES_CONFIG" >&5
12779 echo "${ECHO_T}$XCURSES_CONFIG" >&6
12780 else
12781   echo "$as_me:12781: result: no" >&5
12782 echo "${ECHO_T}no" >&6
12783 fi
12784
12785     test -n "$XCURSES_CONFIG" && break
12786   done
12787 fi
12788 if test -z "$XCURSES_CONFIG"; then
12789   ac_ct_XCURSES_CONFIG=$XCURSES_CONFIG
12790   for ac_prog in xcurses-config
12791 do
12792   # Extract the first word of "$ac_prog", so it can be a program name with args.
12793 set dummy $ac_prog; ac_word=$2
12794 echo "$as_me:12794: checking for $ac_word" >&5
12795 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
12796 if test "${ac_cv_prog_ac_ct_XCURSES_CONFIG+set}" = set; then
12797   echo $ECHO_N "(cached) $ECHO_C" >&6
12798 else
12799   if test -n "$ac_ct_XCURSES_CONFIG"; then
12800   ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_ct_XCURSES_CONFIG" # Let the user override the test.
12801 else
12802   ac_save_IFS=$IFS; IFS=$ac_path_separator
12803 ac_dummy="$PATH"
12804 for ac_dir in $ac_dummy; do
12805   IFS=$ac_save_IFS
12806   test -z "$ac_dir" && ac_dir=.
12807   $as_executable_p "$ac_dir/$ac_word" || continue
12808 ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_prog"
12809 echo "$as_me:12809: found $ac_dir/$ac_word" >&5
12810 break
12811 done
12812
12813 fi
12814 fi
12815 ac_ct_XCURSES_CONFIG=$ac_cv_prog_ac_ct_XCURSES_CONFIG
12816 if test -n "$ac_ct_XCURSES_CONFIG"; then
12817   echo "$as_me:12817: result: $ac_ct_XCURSES_CONFIG" >&5
12818 echo "${ECHO_T}$ac_ct_XCURSES_CONFIG" >&6
12819 else
12820   echo "$as_me:12820: result: no" >&5
12821 echo "${ECHO_T}no" >&6
12822 fi
12823
12824   test -n "$ac_ct_XCURSES_CONFIG" && break
12825 done
12826 test -n "$ac_ct_XCURSES_CONFIG" || ac_ct_XCURSES_CONFIG="none"
12827
12828   XCURSES_CONFIG=$ac_ct_XCURSES_CONFIG
12829 fi
12830
12831 if test "$XCURSES_CONFIG" != none ; then
12832
12833 CPPFLAGS="$CPPFLAGS `$XCURSES_CONFIG --cflags`"
12834
12835 cf_add_libs="`$XCURSES_CONFIG --libs`"
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 cf_cv_lib_XCurses=yes
12852
12853 else
12854
12855 LDFLAGS="$LDFLAGS $X_LIBS"
12856
12857 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
12858
12859 echo "${as_me:-configure}:12859: testing checking additions to CFLAGS ..." 1>&5
12860
12861 cf_check_cflags="$CFLAGS"
12862 cf_check_cppflags="$CPPFLAGS"
12863
12864 cf_fix_cppflags=no
12865 cf_new_cflags=
12866 cf_new_cppflags=
12867 cf_new_extra_cppflags=
12868
12869 for cf_add_cflags in $X_CFLAGS
12870 do
12871 case $cf_fix_cppflags in
12872 (no)
12873         case $cf_add_cflags in
12874         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12875                 case $cf_add_cflags in
12876                 (-D*)
12877                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12878
12879                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12880                                 && test -z "${cf_tst_cflags}" \
12881                                 && cf_fix_cppflags=yes
12882
12883                         if test $cf_fix_cppflags = yes ; then
12884                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12885                                 continue
12886                         elif test "${cf_tst_cflags}" = "\"'" ; then
12887                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12888                                 continue
12889                         fi
12890                         ;;
12891                 esac
12892                 case "$CPPFLAGS" in
12893                 (*$cf_add_cflags)
12894                         ;;
12895                 (*)
12896                         case $cf_add_cflags in
12897                         (-D*)
12898                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12899
12900 CPPFLAGS=`echo "$CPPFLAGS" | \
12901         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12902                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12903
12904                                 ;;
12905                         esac
12906                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
12907                         ;;
12908                 esac
12909                 ;;
12910         (*)
12911                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
12912                 ;;
12913         esac
12914         ;;
12915 (yes)
12916         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12917
12918         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12919
12920         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12921                 && test -z "${cf_tst_cflags}" \
12922                 && cf_fix_cppflags=no
12923         ;;
12924 esac
12925 done
12926
12927 if test -n "$cf_new_cflags" ; then
12928         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
12929
12930 echo "${as_me:-configure}:12930: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
12931
12932         CFLAGS="$CFLAGS $cf_new_cflags"
12933 fi
12934
12935 if test -n "$cf_new_cppflags" ; then
12936         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
12937
12938 echo "${as_me:-configure}:12938: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
12939
12940         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
12941 fi
12942
12943 if test -n "$cf_new_extra_cppflags" ; then
12944         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
12945
12946 echo "${as_me:-configure}:12946: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
12947
12948         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
12949 fi
12950
12951 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
12952 cat >conftest.$ac_ext <<_ACEOF
12953 #line 12953 "configure"
12954 #include "confdefs.h"
12955 #include <stdio.h>
12956 int
12957 main ()
12958 {
12959 printf("Hello world");
12960   ;
12961   return 0;
12962 }
12963 _ACEOF
12964 rm -f conftest.$ac_objext conftest$ac_exeext
12965 if { (eval echo "$as_me:12965: \"$ac_link\"") >&5
12966   (eval $ac_link) 2>&5
12967   ac_status=$?
12968   echo "$as_me:12968: \$? = $ac_status" >&5
12969   (exit $ac_status); } &&
12970          { ac_try='test -s conftest$ac_exeext'
12971   { (eval echo "$as_me:12971: \"$ac_try\"") >&5
12972   (eval $ac_try) 2>&5
12973   ac_status=$?
12974   echo "$as_me:12974: \$? = $ac_status" >&5
12975   (exit $ac_status); }; }; then
12976   :
12977 else
12978   echo "$as_me: failed program was:" >&5
12979 cat conftest.$ac_ext >&5
12980 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
12981
12982 echo "${as_me:-configure}:12982: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
12983
12984          if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
12985                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
12986
12987 echo "${as_me:-configure}:12987: testing but keeping change to \$CPPFLAGS ..." 1>&5
12988
12989          fi
12990          CFLAGS="$cf_check_flags"
12991 fi
12992 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12993 fi
12994
12995 echo "$as_me:12995: checking for XOpenDisplay in -lX11" >&5
12996 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
12997 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
12998   echo $ECHO_N "(cached) $ECHO_C" >&6
12999 else
13000   ac_check_lib_save_LIBS=$LIBS
13001 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
13002 cat >conftest.$ac_ext <<_ACEOF
13003 #line 13003 "configure"
13004 #include "confdefs.h"
13005
13006 /* Override any gcc2 internal prototype to avoid an error.  */
13007 #ifdef __cplusplus
13008 extern "C"
13009 #endif
13010 /* We use char because int might match the return type of a gcc2
13011    builtin and then its argument prototype would still apply.  */
13012 char XOpenDisplay ();
13013 int
13014 main ()
13015 {
13016 XOpenDisplay ();
13017   ;
13018   return 0;
13019 }
13020 _ACEOF
13021 rm -f conftest.$ac_objext conftest$ac_exeext
13022 if { (eval echo "$as_me:13022: \"$ac_link\"") >&5
13023   (eval $ac_link) 2>&5
13024   ac_status=$?
13025   echo "$as_me:13025: \$? = $ac_status" >&5
13026   (exit $ac_status); } &&
13027          { ac_try='test -s conftest$ac_exeext'
13028   { (eval echo "$as_me:13028: \"$ac_try\"") >&5
13029   (eval $ac_try) 2>&5
13030   ac_status=$?
13031   echo "$as_me:13031: \$? = $ac_status" >&5
13032   (exit $ac_status); }; }; then
13033   ac_cv_lib_X11_XOpenDisplay=yes
13034 else
13035   echo "$as_me: failed program was:" >&5
13036 cat conftest.$ac_ext >&5
13037 ac_cv_lib_X11_XOpenDisplay=no
13038 fi
13039 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13040 LIBS=$ac_check_lib_save_LIBS
13041 fi
13042 echo "$as_me:13042: result: $ac_cv_lib_X11_XOpenDisplay" >&5
13043 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
13044 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
13045
13046 cf_add_libs="-lX11"
13047 # Filter out duplicates - this happens with badly-designed ".pc" files...
13048 for cf_add_1lib in $LIBS
13049 do
13050         for cf_add_2lib in $cf_add_libs
13051         do
13052                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13053                 then
13054                         cf_add_1lib=
13055                         break
13056                 fi
13057         done
13058         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13059 done
13060 LIBS="$cf_add_libs"
13061
13062 fi
13063
13064 echo "$as_me:13064: checking for XCurses library" >&5
13065 echo $ECHO_N "checking for XCurses library... $ECHO_C" >&6
13066 if test "${cf_cv_lib_XCurses+set}" = set; then
13067   echo $ECHO_N "(cached) $ECHO_C" >&6
13068 else
13069
13070 cf_add_libs="-lXCurses"
13071 # Filter out duplicates - this happens with badly-designed ".pc" files...
13072 for cf_add_1lib in $LIBS
13073 do
13074         for cf_add_2lib in $cf_add_libs
13075         do
13076                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13077                 then
13078                         cf_add_1lib=
13079                         break
13080                 fi
13081         done
13082         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13083 done
13084 LIBS="$cf_add_libs"
13085
13086 cat >conftest.$ac_ext <<_ACEOF
13087 #line 13087 "configure"
13088 #include "confdefs.h"
13089
13090 #include <xcurses.h>
13091 char *XCursesProgramName = "test";
13092
13093 int
13094 main ()
13095 {
13096 XCursesExit();
13097   ;
13098   return 0;
13099 }
13100 _ACEOF
13101 rm -f conftest.$ac_objext conftest$ac_exeext
13102 if { (eval echo "$as_me:13102: \"$ac_link\"") >&5
13103   (eval $ac_link) 2>&5
13104   ac_status=$?
13105   echo "$as_me:13105: \$? = $ac_status" >&5
13106   (exit $ac_status); } &&
13107          { ac_try='test -s conftest$ac_exeext'
13108   { (eval echo "$as_me:13108: \"$ac_try\"") >&5
13109   (eval $ac_try) 2>&5
13110   ac_status=$?
13111   echo "$as_me:13111: \$? = $ac_status" >&5
13112   (exit $ac_status); }; }; then
13113   cf_cv_lib_XCurses=yes
13114 else
13115   echo "$as_me: failed program was:" >&5
13116 cat conftest.$ac_ext >&5
13117 cf_cv_lib_XCurses=no
13118 fi
13119 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13120
13121 fi
13122 echo "$as_me:13122: result: $cf_cv_lib_XCurses" >&5
13123 echo "${ECHO_T}$cf_cv_lib_XCurses" >&6
13124
13125 fi
13126
13127 if test $cf_cv_lib_XCurses = yes ; then
13128
13129 cat >>confdefs.h <<\EOF
13130 #define UNIX 1
13131 EOF
13132
13133 cat >>confdefs.h <<\EOF
13134 #define XCURSES 1
13135 EOF
13136
13137         echo "$as_me:13137: checking for xcurses.h" >&5
13138 echo $ECHO_N "checking for xcurses.h... $ECHO_C" >&6
13139 if test "${ac_cv_header_xcurses_h+set}" = set; then
13140   echo $ECHO_N "(cached) $ECHO_C" >&6
13141 else
13142   cat >conftest.$ac_ext <<_ACEOF
13143 #line 13143 "configure"
13144 #include "confdefs.h"
13145 #include <xcurses.h>
13146 _ACEOF
13147 if { (eval echo "$as_me:13147: \"$ac_cpp conftest.$ac_ext\"") >&5
13148   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13149   ac_status=$?
13150   egrep -v '^ *\+' conftest.er1 >conftest.err
13151   rm -f conftest.er1
13152   cat conftest.err >&5
13153   echo "$as_me:13153: \$? = $ac_status" >&5
13154   (exit $ac_status); } >/dev/null; then
13155   if test -s conftest.err; then
13156     ac_cpp_err=$ac_c_preproc_warn_flag
13157   else
13158     ac_cpp_err=
13159   fi
13160 else
13161   ac_cpp_err=yes
13162 fi
13163 if test -z "$ac_cpp_err"; then
13164   ac_cv_header_xcurses_h=yes
13165 else
13166   echo "$as_me: failed program was:" >&5
13167   cat conftest.$ac_ext >&5
13168   ac_cv_header_xcurses_h=no
13169 fi
13170 rm -f conftest.err conftest.$ac_ext
13171 fi
13172 echo "$as_me:13172: result: $ac_cv_header_xcurses_h" >&5
13173 echo "${ECHO_T}$ac_cv_header_xcurses_h" >&6
13174 if test $ac_cv_header_xcurses_h = yes; then
13175
13176 cat >>confdefs.h <<\EOF
13177 #define HAVE_XCURSES 1
13178 EOF
13179
13180 fi
13181
13182 else
13183         { { echo "$as_me:13183: error: Cannot link with XCurses" >&5
13184 echo "$as_me: error: Cannot link with XCurses" >&2;}
13185    { (exit 1); exit 1; }; }
13186 fi
13187
13188         ;;
13189 (*)
13190         { { echo "$as_me:13190: error: unexpected screen-value: $cf_cv_screen" >&5
13191 echo "$as_me: error: unexpected screen-value: $cf_cv_screen" >&2;}
13192    { (exit 1); exit 1; }; }
13193         ;;
13194 esac
13195
13196 : ${cf_nculib_root:=$cf_cv_screen}
13197 as_ac_Lib=`echo "ac_cv_lib_$cf_nculib_root''__nc_init_pthreads" | $as_tr_sh`
13198 echo "$as_me:13198: checking for _nc_init_pthreads in -l$cf_nculib_root" >&5
13199 echo $ECHO_N "checking for _nc_init_pthreads in -l$cf_nculib_root... $ECHO_C" >&6
13200 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
13201   echo $ECHO_N "(cached) $ECHO_C" >&6
13202 else
13203   ac_check_lib_save_LIBS=$LIBS
13204 LIBS="-l$cf_nculib_root  $LIBS"
13205 cat >conftest.$ac_ext <<_ACEOF
13206 #line 13206 "configure"
13207 #include "confdefs.h"
13208
13209 /* Override any gcc2 internal prototype to avoid an error.  */
13210 #ifdef __cplusplus
13211 extern "C"
13212 #endif
13213 /* We use char because int might match the return type of a gcc2
13214    builtin and then its argument prototype would still apply.  */
13215 char _nc_init_pthreads ();
13216 int
13217 main ()
13218 {
13219 _nc_init_pthreads ();
13220   ;
13221   return 0;
13222 }
13223 _ACEOF
13224 rm -f conftest.$ac_objext conftest$ac_exeext
13225 if { (eval echo "$as_me:13225: \"$ac_link\"") >&5
13226   (eval $ac_link) 2>&5
13227   ac_status=$?
13228   echo "$as_me:13228: \$? = $ac_status" >&5
13229   (exit $ac_status); } &&
13230          { ac_try='test -s conftest$ac_exeext'
13231   { (eval echo "$as_me:13231: \"$ac_try\"") >&5
13232   (eval $ac_try) 2>&5
13233   ac_status=$?
13234   echo "$as_me:13234: \$? = $ac_status" >&5
13235   (exit $ac_status); }; }; then
13236   eval "$as_ac_Lib=yes"
13237 else
13238   echo "$as_me: failed program was:" >&5
13239 cat conftest.$ac_ext >&5
13240 eval "$as_ac_Lib=no"
13241 fi
13242 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13243 LIBS=$ac_check_lib_save_LIBS
13244 fi
13245 echo "$as_me:13245: result: `eval echo '${'$as_ac_Lib'}'`" >&5
13246 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
13247 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
13248   cf_cv_ncurses_pthreads=yes
13249 else
13250   cf_cv_ncurses_pthreads=no
13251 fi
13252
13253 if test "$cf_cv_ncurses_pthreads" = yes
13254 then
13255
13256 cf_add_libs="-lpthread"
13257 # Filter out duplicates - this happens with badly-designed ".pc" files...
13258 for cf_add_1lib in $LIBS
13259 do
13260         for cf_add_2lib in $cf_add_libs
13261         do
13262                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13263                 then
13264                         cf_add_1lib=
13265                         break
13266                 fi
13267         done
13268         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13269 done
13270 LIBS="$cf_add_libs"
13271
13272 fi
13273
13274 case $cf_cv_screen in
13275 (ncurses*)
13276         cf_cv_libtype=`echo "$cf_cv_screen" | sed -e 's/^ncurses//'`
13277         ;;
13278 (curses|curses_*)
13279
13280 echo "$as_me:13280: checking for NetBSD form.h" >&5
13281 echo $ECHO_N "checking for NetBSD form.h... $ECHO_C" >&6
13282 if test "${cf_cv_netbsd_form_h+set}" = set; then
13283   echo $ECHO_N "(cached) $ECHO_C" >&6
13284 else
13285
13286 cat >conftest.$ac_ext <<_ACEOF
13287 #line 13287 "configure"
13288 #include "confdefs.h"
13289
13290 #include <${cf_cv_ncurses_header:-curses.h}>
13291 #include <form.h>
13292
13293 int
13294 main ()
13295 {
13296
13297         FORM *form;
13298         int y = current_field(form)->cursor_ypos;
13299         int x = current_field(form)->cursor_xpos;
13300
13301   ;
13302   return 0;
13303 }
13304 _ACEOF
13305 rm -f conftest.$ac_objext
13306 if { (eval echo "$as_me:13306: \"$ac_compile\"") >&5
13307   (eval $ac_compile) 2>&5
13308   ac_status=$?
13309   echo "$as_me:13309: \$? = $ac_status" >&5
13310   (exit $ac_status); } &&
13311          { ac_try='test -s conftest.$ac_objext'
13312   { (eval echo "$as_me:13312: \"$ac_try\"") >&5
13313   (eval $ac_try) 2>&5
13314   ac_status=$?
13315   echo "$as_me:13315: \$? = $ac_status" >&5
13316   (exit $ac_status); }; }; then
13317   cf_cv_netbsd_form_h=yes
13318
13319 else
13320   echo "$as_me: failed program was:" >&5
13321 cat conftest.$ac_ext >&5
13322 cf_cv_netbsd_form_h=no
13323 fi
13324 rm -f conftest.$ac_objext conftest.$ac_ext
13325
13326 fi
13327 echo "$as_me:13327: result: $cf_cv_netbsd_form_h" >&5
13328 echo "${ECHO_T}$cf_cv_netbsd_form_h" >&6
13329
13330 test "$cf_cv_netbsd_form_h" = yes &&
13331 cat >>confdefs.h <<\EOF
13332 #define HAVE_NETBSD_FORM_H 1
13333 EOF
13334
13335 echo "$as_me:13335: checking for NetBSD menu.h" >&5
13336 echo $ECHO_N "checking for NetBSD menu.h... $ECHO_C" >&6
13337 if test "${cf_cv_netbsd_menu_h+set}" = set; then
13338   echo $ECHO_N "(cached) $ECHO_C" >&6
13339 else
13340
13341 cat >conftest.$ac_ext <<_ACEOF
13342 #line 13342 "configure"
13343 #include "confdefs.h"
13344
13345 #include <${cf_cv_ncurses_header:-curses.h}>
13346 #include <menu.h>
13347
13348 int
13349 main ()
13350 {
13351
13352         MENU *menu;
13353         int y = menu->max_item_width;
13354
13355   ;
13356   return 0;
13357 }
13358 _ACEOF
13359 rm -f conftest.$ac_objext
13360 if { (eval echo "$as_me:13360: \"$ac_compile\"") >&5
13361   (eval $ac_compile) 2>&5
13362   ac_status=$?
13363   echo "$as_me:13363: \$? = $ac_status" >&5
13364   (exit $ac_status); } &&
13365          { ac_try='test -s conftest.$ac_objext'
13366   { (eval echo "$as_me:13366: \"$ac_try\"") >&5
13367   (eval $ac_try) 2>&5
13368   ac_status=$?
13369   echo "$as_me:13369: \$? = $ac_status" >&5
13370   (exit $ac_status); }; }; then
13371   cf_cv_netbsd_menu_h=yes
13372
13373 else
13374   echo "$as_me: failed program was:" >&5
13375 cat conftest.$ac_ext >&5
13376 cf_cv_netbsd_menu_h=no
13377 fi
13378 rm -f conftest.$ac_objext conftest.$ac_ext
13379
13380 fi
13381 echo "$as_me:13381: result: $cf_cv_netbsd_menu_h" >&5
13382 echo "${ECHO_T}$cf_cv_netbsd_menu_h" >&6
13383
13384 test "$cf_cv_netbsd_menu_h" = yes &&
13385 cat >>confdefs.h <<\EOF
13386 #define HAVE_NETBSD_MENU_H 1
13387 EOF
13388
13389         ;;
13390 esac
13391
13392 case $cf_cv_screen in
13393 (pdcurses)
13394         ;;
13395 (*)
13396         # look for curses-related libraries
13397
13398 as_ac_Lib=`echo "ac_cv_lib_panel$cf_cv_libtype''_new_panel" | $as_tr_sh`
13399 echo "$as_me:13399: checking for new_panel in -lpanel$cf_cv_libtype" >&5
13400 echo $ECHO_N "checking for new_panel in -lpanel$cf_cv_libtype... $ECHO_C" >&6
13401 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
13402   echo $ECHO_N "(cached) $ECHO_C" >&6
13403 else
13404   ac_check_lib_save_LIBS=$LIBS
13405 LIBS="-lpanel$cf_cv_libtype  $LIBS"
13406 cat >conftest.$ac_ext <<_ACEOF
13407 #line 13407 "configure"
13408 #include "confdefs.h"
13409
13410 /* Override any gcc2 internal prototype to avoid an error.  */
13411 #ifdef __cplusplus
13412 extern "C"
13413 #endif
13414 /* We use char because int might match the return type of a gcc2
13415    builtin and then its argument prototype would still apply.  */
13416 char new_panel ();
13417 int
13418 main ()
13419 {
13420 new_panel ();
13421   ;
13422   return 0;
13423 }
13424 _ACEOF
13425 rm -f conftest.$ac_objext conftest$ac_exeext
13426 if { (eval echo "$as_me:13426: \"$ac_link\"") >&5
13427   (eval $ac_link) 2>&5
13428   ac_status=$?
13429   echo "$as_me:13429: \$? = $ac_status" >&5
13430   (exit $ac_status); } &&
13431          { ac_try='test -s conftest$ac_exeext'
13432   { (eval echo "$as_me:13432: \"$ac_try\"") >&5
13433   (eval $ac_try) 2>&5
13434   ac_status=$?
13435   echo "$as_me:13435: \$? = $ac_status" >&5
13436   (exit $ac_status); }; }; then
13437   eval "$as_ac_Lib=yes"
13438 else
13439   echo "$as_me: failed program was:" >&5
13440 cat conftest.$ac_ext >&5
13441 eval "$as_ac_Lib=no"
13442 fi
13443 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13444 LIBS=$ac_check_lib_save_LIBS
13445 fi
13446 echo "$as_me:13446: result: `eval echo '${'$as_ac_Lib'}'`" >&5
13447 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
13448 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
13449
13450 cf_upper=`echo "have_libpanel" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
13451
13452 cf_add_libs="-lpanel$cf_cv_libtype"
13453 # Filter out duplicates - this happens with badly-designed ".pc" files...
13454 for cf_add_1lib in $LIBS
13455 do
13456         for cf_add_2lib in $cf_add_libs
13457         do
13458                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13459                 then
13460                         cf_add_1lib=
13461                         break
13462                 fi
13463         done
13464         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13465 done
13466 LIBS="$cf_add_libs"
13467
13468 cat >>confdefs.h <<EOF
13469 #define $cf_upper 1
13470 EOF
13471
13472 fi
13473
13474 as_ac_Lib=`echo "ac_cv_lib_menu$cf_cv_libtype''_menu_driver" | $as_tr_sh`
13475 echo "$as_me:13475: checking for menu_driver in -lmenu$cf_cv_libtype" >&5
13476 echo $ECHO_N "checking for menu_driver in -lmenu$cf_cv_libtype... $ECHO_C" >&6
13477 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
13478   echo $ECHO_N "(cached) $ECHO_C" >&6
13479 else
13480   ac_check_lib_save_LIBS=$LIBS
13481 LIBS="-lmenu$cf_cv_libtype  $LIBS"
13482 cat >conftest.$ac_ext <<_ACEOF
13483 #line 13483 "configure"
13484 #include "confdefs.h"
13485
13486 /* Override any gcc2 internal prototype to avoid an error.  */
13487 #ifdef __cplusplus
13488 extern "C"
13489 #endif
13490 /* We use char because int might match the return type of a gcc2
13491    builtin and then its argument prototype would still apply.  */
13492 char menu_driver ();
13493 int
13494 main ()
13495 {
13496 menu_driver ();
13497   ;
13498   return 0;
13499 }
13500 _ACEOF
13501 rm -f conftest.$ac_objext conftest$ac_exeext
13502 if { (eval echo "$as_me:13502: \"$ac_link\"") >&5
13503   (eval $ac_link) 2>&5
13504   ac_status=$?
13505   echo "$as_me:13505: \$? = $ac_status" >&5
13506   (exit $ac_status); } &&
13507          { ac_try='test -s conftest$ac_exeext'
13508   { (eval echo "$as_me:13508: \"$ac_try\"") >&5
13509   (eval $ac_try) 2>&5
13510   ac_status=$?
13511   echo "$as_me:13511: \$? = $ac_status" >&5
13512   (exit $ac_status); }; }; then
13513   eval "$as_ac_Lib=yes"
13514 else
13515   echo "$as_me: failed program was:" >&5
13516 cat conftest.$ac_ext >&5
13517 eval "$as_ac_Lib=no"
13518 fi
13519 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13520 LIBS=$ac_check_lib_save_LIBS
13521 fi
13522 echo "$as_me:13522: result: `eval echo '${'$as_ac_Lib'}'`" >&5
13523 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
13524 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
13525
13526 cf_upper=`echo "have_libmenu" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
13527
13528 cf_add_libs="-lmenu$cf_cv_libtype"
13529 # Filter out duplicates - this happens with badly-designed ".pc" files...
13530 for cf_add_1lib in $LIBS
13531 do
13532         for cf_add_2lib in $cf_add_libs
13533         do
13534                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13535                 then
13536                         cf_add_1lib=
13537                         break
13538                 fi
13539         done
13540         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13541 done
13542 LIBS="$cf_add_libs"
13543
13544 cat >>confdefs.h <<EOF
13545 #define $cf_upper 1
13546 EOF
13547
13548 fi
13549
13550 as_ac_Lib=`echo "ac_cv_lib_form$cf_cv_libtype''_form_driver" | $as_tr_sh`
13551 echo "$as_me:13551: checking for form_driver in -lform$cf_cv_libtype" >&5
13552 echo $ECHO_N "checking for form_driver in -lform$cf_cv_libtype... $ECHO_C" >&6
13553 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
13554   echo $ECHO_N "(cached) $ECHO_C" >&6
13555 else
13556   ac_check_lib_save_LIBS=$LIBS
13557 LIBS="-lform$cf_cv_libtype  $LIBS"
13558 cat >conftest.$ac_ext <<_ACEOF
13559 #line 13559 "configure"
13560 #include "confdefs.h"
13561
13562 /* Override any gcc2 internal prototype to avoid an error.  */
13563 #ifdef __cplusplus
13564 extern "C"
13565 #endif
13566 /* We use char because int might match the return type of a gcc2
13567    builtin and then its argument prototype would still apply.  */
13568 char form_driver ();
13569 int
13570 main ()
13571 {
13572 form_driver ();
13573   ;
13574   return 0;
13575 }
13576 _ACEOF
13577 rm -f conftest.$ac_objext conftest$ac_exeext
13578 if { (eval echo "$as_me:13578: \"$ac_link\"") >&5
13579   (eval $ac_link) 2>&5
13580   ac_status=$?
13581   echo "$as_me:13581: \$? = $ac_status" >&5
13582   (exit $ac_status); } &&
13583          { ac_try='test -s conftest$ac_exeext'
13584   { (eval echo "$as_me:13584: \"$ac_try\"") >&5
13585   (eval $ac_try) 2>&5
13586   ac_status=$?
13587   echo "$as_me:13587: \$? = $ac_status" >&5
13588   (exit $ac_status); }; }; then
13589   eval "$as_ac_Lib=yes"
13590 else
13591   echo "$as_me: failed program was:" >&5
13592 cat conftest.$ac_ext >&5
13593 eval "$as_ac_Lib=no"
13594 fi
13595 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13596 LIBS=$ac_check_lib_save_LIBS
13597 fi
13598 echo "$as_me:13598: result: `eval echo '${'$as_ac_Lib'}'`" >&5
13599 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
13600 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
13601
13602 cf_upper=`echo "have_libform" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
13603
13604 cf_add_libs="-lform$cf_cv_libtype"
13605 # Filter out duplicates - this happens with badly-designed ".pc" files...
13606 for cf_add_1lib in $LIBS
13607 do
13608         for cf_add_2lib in $cf_add_libs
13609         do
13610                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13611                 then
13612                         cf_add_1lib=
13613                         break
13614                 fi
13615         done
13616         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13617 done
13618 LIBS="$cf_add_libs"
13619
13620 cat >>confdefs.h <<EOF
13621 #define $cf_upper 1
13622 EOF
13623
13624 fi
13625
13626         # look for curses-related headers
13627
13628 for ac_header in \
13629                 nc_alloc.h \
13630                 nomacros.h \
13631                 form.h \
13632                 menu.h \
13633                 panel.h \
13634                 term_entry.h \
13635
13636 do
13637 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
13638 echo "$as_me:13638: checking for $ac_header" >&5
13639 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
13640 if eval "test \"\${$as_ac_Header+set}\" = set"; then
13641   echo $ECHO_N "(cached) $ECHO_C" >&6
13642 else
13643   cat >conftest.$ac_ext <<_ACEOF
13644 #line 13644 "configure"
13645 #include "confdefs.h"
13646 #include <$ac_header>
13647 _ACEOF
13648 if { (eval echo "$as_me:13648: \"$ac_cpp conftest.$ac_ext\"") >&5
13649   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13650   ac_status=$?
13651   egrep -v '^ *\+' conftest.er1 >conftest.err
13652   rm -f conftest.er1
13653   cat conftest.err >&5
13654   echo "$as_me:13654: \$? = $ac_status" >&5
13655   (exit $ac_status); } >/dev/null; then
13656   if test -s conftest.err; then
13657     ac_cpp_err=$ac_c_preproc_warn_flag
13658   else
13659     ac_cpp_err=
13660   fi
13661 else
13662   ac_cpp_err=yes
13663 fi
13664 if test -z "$ac_cpp_err"; then
13665   eval "$as_ac_Header=yes"
13666 else
13667   echo "$as_me: failed program was:" >&5
13668   cat conftest.$ac_ext >&5
13669   eval "$as_ac_Header=no"
13670 fi
13671 rm -f conftest.err conftest.$ac_ext
13672 fi
13673 echo "$as_me:13673: result: `eval echo '${'$as_ac_Header'}'`" >&5
13674 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
13675 if test `eval echo '${'$as_ac_Header'}'` = yes; then
13676   cat >>confdefs.h <<EOF
13677 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
13678 EOF
13679
13680 fi
13681 done
13682
13683         ;;
13684 esac
13685
13686 echo "$as_me:13686: checking for ANSI C header files" >&5
13687 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
13688 if test "${ac_cv_header_stdc+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 <stdlib.h>
13695 #include <stdarg.h>
13696 #include <string.h>
13697 #include <float.h>
13698
13699 _ACEOF
13700 if { (eval echo "$as_me:13700: \"$ac_cpp conftest.$ac_ext\"") >&5
13701   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13702   ac_status=$?
13703   egrep -v '^ *\+' conftest.er1 >conftest.err
13704   rm -f conftest.er1
13705   cat conftest.err >&5
13706   echo "$as_me:13706: \$? = $ac_status" >&5
13707   (exit $ac_status); } >/dev/null; then
13708   if test -s conftest.err; then
13709     ac_cpp_err=$ac_c_preproc_warn_flag
13710   else
13711     ac_cpp_err=
13712   fi
13713 else
13714   ac_cpp_err=yes
13715 fi
13716 if test -z "$ac_cpp_err"; then
13717   ac_cv_header_stdc=yes
13718 else
13719   echo "$as_me: failed program was:" >&5
13720   cat conftest.$ac_ext >&5
13721   ac_cv_header_stdc=no
13722 fi
13723 rm -f conftest.err conftest.$ac_ext
13724
13725 if test $ac_cv_header_stdc = yes; then
13726   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
13727   cat >conftest.$ac_ext <<_ACEOF
13728 #line 13728 "configure"
13729 #include "confdefs.h"
13730 #include <string.h>
13731
13732 _ACEOF
13733 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13734   egrep "memchr" >/dev/null 2>&1; then
13735   :
13736 else
13737   ac_cv_header_stdc=no
13738 fi
13739 rm -rf conftest*
13740
13741 fi
13742
13743 if test $ac_cv_header_stdc = yes; then
13744   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
13745   cat >conftest.$ac_ext <<_ACEOF
13746 #line 13746 "configure"
13747 #include "confdefs.h"
13748 #include <stdlib.h>
13749
13750 _ACEOF
13751 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13752   egrep "free" >/dev/null 2>&1; then
13753   :
13754 else
13755   ac_cv_header_stdc=no
13756 fi
13757 rm -rf conftest*
13758
13759 fi
13760
13761 if test $ac_cv_header_stdc = yes; then
13762   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
13763   if test "$cross_compiling" = yes; then
13764   :
13765 else
13766   cat >conftest.$ac_ext <<_ACEOF
13767 #line 13767 "configure"
13768 #include "confdefs.h"
13769 #include <ctype.h>
13770 #if ((' ' & 0x0FF) == 0x020)
13771 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
13772 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
13773 #else
13774 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
13775                      || ('j' <= (c) && (c) <= 'r') \
13776                      || ('s' <= (c) && (c) <= 'z'))
13777 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
13778 #endif
13779
13780 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
13781 int
13782 main ()
13783 {
13784   int i;
13785   for (i = 0; i < 256; i++)
13786     if (XOR (islower (i), ISLOWER (i))
13787         || toupper (i) != TOUPPER (i))
13788       $ac_main_return(2);
13789   $ac_main_return (0);
13790 }
13791 _ACEOF
13792 rm -f conftest$ac_exeext
13793 if { (eval echo "$as_me:13793: \"$ac_link\"") >&5
13794   (eval $ac_link) 2>&5
13795   ac_status=$?
13796   echo "$as_me:13796: \$? = $ac_status" >&5
13797   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
13798   { (eval echo "$as_me:13798: \"$ac_try\"") >&5
13799   (eval $ac_try) 2>&5
13800   ac_status=$?
13801   echo "$as_me:13801: \$? = $ac_status" >&5
13802   (exit $ac_status); }; }; then
13803   :
13804 else
13805   echo "$as_me: program exited with status $ac_status" >&5
13806 echo "$as_me: failed program was:" >&5
13807 cat conftest.$ac_ext >&5
13808 ac_cv_header_stdc=no
13809 fi
13810 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
13811 fi
13812 fi
13813 fi
13814 echo "$as_me:13814: result: $ac_cv_header_stdc" >&5
13815 echo "${ECHO_T}$ac_cv_header_stdc" >&6
13816 if test $ac_cv_header_stdc = yes; then
13817
13818 cat >>confdefs.h <<\EOF
13819 #define STDC_HEADERS 1
13820 EOF
13821
13822 fi
13823
13824 echo "$as_me:13824: checking whether time.h and sys/time.h may both be included" >&5
13825 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
13826 if test "${ac_cv_header_time+set}" = set; then
13827   echo $ECHO_N "(cached) $ECHO_C" >&6
13828 else
13829   cat >conftest.$ac_ext <<_ACEOF
13830 #line 13830 "configure"
13831 #include "confdefs.h"
13832 #include <sys/types.h>
13833 #include <sys/time.h>
13834 #include <time.h>
13835
13836 int
13837 main ()
13838 {
13839 if ((struct tm *) 0)
13840 return 0;
13841   ;
13842   return 0;
13843 }
13844 _ACEOF
13845 rm -f conftest.$ac_objext
13846 if { (eval echo "$as_me:13846: \"$ac_compile\"") >&5
13847   (eval $ac_compile) 2>&5
13848   ac_status=$?
13849   echo "$as_me:13849: \$? = $ac_status" >&5
13850   (exit $ac_status); } &&
13851          { ac_try='test -s conftest.$ac_objext'
13852   { (eval echo "$as_me:13852: \"$ac_try\"") >&5
13853   (eval $ac_try) 2>&5
13854   ac_status=$?
13855   echo "$as_me:13855: \$? = $ac_status" >&5
13856   (exit $ac_status); }; }; then
13857   ac_cv_header_time=yes
13858 else
13859   echo "$as_me: failed program was:" >&5
13860 cat conftest.$ac_ext >&5
13861 ac_cv_header_time=no
13862 fi
13863 rm -f conftest.$ac_objext conftest.$ac_ext
13864 fi
13865 echo "$as_me:13865: result: $ac_cv_header_time" >&5
13866 echo "${ECHO_T}$ac_cv_header_time" >&6
13867 if test $ac_cv_header_time = yes; then
13868
13869 cat >>confdefs.h <<\EOF
13870 #define TIME_WITH_SYS_TIME 1
13871 EOF
13872
13873 fi
13874
13875 for ac_header in \
13876 getopt.h \
13877 locale.h \
13878 math.h \
13879 stdarg.h \
13880 sys/ioctl.h \
13881 sys/select.h \
13882 sys/time.h \
13883 termios.h \
13884 unistd.h \
13885
13886 do
13887 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
13888 echo "$as_me:13888: checking for $ac_header" >&5
13889 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
13890 if eval "test \"\${$as_ac_Header+set}\" = set"; then
13891   echo $ECHO_N "(cached) $ECHO_C" >&6
13892 else
13893   cat >conftest.$ac_ext <<_ACEOF
13894 #line 13894 "configure"
13895 #include "confdefs.h"
13896 #include <$ac_header>
13897 _ACEOF
13898 if { (eval echo "$as_me:13898: \"$ac_cpp conftest.$ac_ext\"") >&5
13899   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13900   ac_status=$?
13901   egrep -v '^ *\+' conftest.er1 >conftest.err
13902   rm -f conftest.er1
13903   cat conftest.err >&5
13904   echo "$as_me:13904: \$? = $ac_status" >&5
13905   (exit $ac_status); } >/dev/null; then
13906   if test -s conftest.err; then
13907     ac_cpp_err=$ac_c_preproc_warn_flag
13908   else
13909     ac_cpp_err=
13910   fi
13911 else
13912   ac_cpp_err=yes
13913 fi
13914 if test -z "$ac_cpp_err"; then
13915   eval "$as_ac_Header=yes"
13916 else
13917   echo "$as_me: failed program was:" >&5
13918   cat conftest.$ac_ext >&5
13919   eval "$as_ac_Header=no"
13920 fi
13921 rm -f conftest.err conftest.$ac_ext
13922 fi
13923 echo "$as_me:13923: result: `eval echo '${'$as_ac_Header'}'`" >&5
13924 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
13925 if test `eval echo '${'$as_ac_Header'}'` = yes; then
13926   cat >>confdefs.h <<EOF
13927 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
13928 EOF
13929
13930 fi
13931 done
13932
13933 for ac_header in unistd.h getopt.h
13934 do
13935 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
13936 echo "$as_me:13936: checking for $ac_header" >&5
13937 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
13938 if eval "test \"\${$as_ac_Header+set}\" = set"; then
13939   echo $ECHO_N "(cached) $ECHO_C" >&6
13940 else
13941   cat >conftest.$ac_ext <<_ACEOF
13942 #line 13942 "configure"
13943 #include "confdefs.h"
13944 #include <$ac_header>
13945 _ACEOF
13946 if { (eval echo "$as_me:13946: \"$ac_cpp conftest.$ac_ext\"") >&5
13947   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13948   ac_status=$?
13949   egrep -v '^ *\+' conftest.er1 >conftest.err
13950   rm -f conftest.er1
13951   cat conftest.err >&5
13952   echo "$as_me:13952: \$? = $ac_status" >&5
13953   (exit $ac_status); } >/dev/null; then
13954   if test -s conftest.err; then
13955     ac_cpp_err=$ac_c_preproc_warn_flag
13956   else
13957     ac_cpp_err=
13958   fi
13959 else
13960   ac_cpp_err=yes
13961 fi
13962 if test -z "$ac_cpp_err"; then
13963   eval "$as_ac_Header=yes"
13964 else
13965   echo "$as_me: failed program was:" >&5
13966   cat conftest.$ac_ext >&5
13967   eval "$as_ac_Header=no"
13968 fi
13969 rm -f conftest.err conftest.$ac_ext
13970 fi
13971 echo "$as_me:13971: result: `eval echo '${'$as_ac_Header'}'`" >&5
13972 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
13973 if test `eval echo '${'$as_ac_Header'}'` = yes; then
13974   cat >>confdefs.h <<EOF
13975 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
13976 EOF
13977
13978 fi
13979 done
13980
13981 echo "$as_me:13981: checking for header declaring getopt variables" >&5
13982 echo $ECHO_N "checking for header declaring getopt variables... $ECHO_C" >&6
13983 if test "${cf_cv_getopt_header+set}" = set; then
13984   echo $ECHO_N "(cached) $ECHO_C" >&6
13985 else
13986
13987 cf_cv_getopt_header=none
13988 for cf_header in stdio.h stdlib.h unistd.h getopt.h
13989 do
13990 cat >conftest.$ac_ext <<_ACEOF
13991 #line 13991 "configure"
13992 #include "confdefs.h"
13993
13994 #include <$cf_header>
13995 int
13996 main ()
13997 {
13998 int x = optind; char *y = optarg
13999   ;
14000   return 0;
14001 }
14002 _ACEOF
14003 rm -f conftest.$ac_objext
14004 if { (eval echo "$as_me:14004: \"$ac_compile\"") >&5
14005   (eval $ac_compile) 2>&5
14006   ac_status=$?
14007   echo "$as_me:14007: \$? = $ac_status" >&5
14008   (exit $ac_status); } &&
14009          { ac_try='test -s conftest.$ac_objext'
14010   { (eval echo "$as_me:14010: \"$ac_try\"") >&5
14011   (eval $ac_try) 2>&5
14012   ac_status=$?
14013   echo "$as_me:14013: \$? = $ac_status" >&5
14014   (exit $ac_status); }; }; then
14015   cf_cv_getopt_header=$cf_header
14016  break
14017 else
14018   echo "$as_me: failed program was:" >&5
14019 cat conftest.$ac_ext >&5
14020 fi
14021 rm -f conftest.$ac_objext conftest.$ac_ext
14022 done
14023
14024 fi
14025 echo "$as_me:14025: result: $cf_cv_getopt_header" >&5
14026 echo "${ECHO_T}$cf_cv_getopt_header" >&6
14027 if test $cf_cv_getopt_header != none ; then
14028
14029 cat >>confdefs.h <<\EOF
14030 #define HAVE_GETOPT_HEADER 1
14031 EOF
14032
14033 fi
14034 if test $cf_cv_getopt_header = getopt.h ; then
14035
14036 cat >>confdefs.h <<\EOF
14037 #define NEED_GETOPT_H 1
14038 EOF
14039
14040 fi
14041
14042 for ac_func in \
14043 getopt \
14044 gettimeofday \
14045
14046 do
14047 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
14048 echo "$as_me:14048: checking for $ac_func" >&5
14049 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
14050 if eval "test \"\${$as_ac_var+set}\" = set"; then
14051   echo $ECHO_N "(cached) $ECHO_C" >&6
14052 else
14053   cat >conftest.$ac_ext <<_ACEOF
14054 #line 14054 "configure"
14055 #include "confdefs.h"
14056 /* System header to define __stub macros and hopefully few prototypes,
14057     which can conflict with char $ac_func (); below.  */
14058 #include <assert.h>
14059 /* Override any gcc2 internal prototype to avoid an error.  */
14060 #ifdef __cplusplus
14061 extern "C"
14062 #endif
14063 /* We use char because int might match the return type of a gcc2
14064    builtin and then its argument prototype would still apply.  */
14065 char $ac_func ();
14066 char (*f) ();
14067
14068 int
14069 main ()
14070 {
14071 /* The GNU C library defines this for functions which it implements
14072     to always fail with ENOSYS.  Some functions are actually named
14073     something starting with __ and the normal name is an alias.  */
14074 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
14075 choke me
14076 #else
14077 f = $ac_func; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
14078 #endif
14079
14080   ;
14081   return 0;
14082 }
14083 _ACEOF
14084 rm -f conftest.$ac_objext conftest$ac_exeext
14085 if { (eval echo "$as_me:14085: \"$ac_link\"") >&5
14086   (eval $ac_link) 2>&5
14087   ac_status=$?
14088   echo "$as_me:14088: \$? = $ac_status" >&5
14089   (exit $ac_status); } &&
14090          { ac_try='test -s conftest$ac_exeext'
14091   { (eval echo "$as_me:14091: \"$ac_try\"") >&5
14092   (eval $ac_try) 2>&5
14093   ac_status=$?
14094   echo "$as_me:14094: \$? = $ac_status" >&5
14095   (exit $ac_status); }; }; then
14096   eval "$as_ac_var=yes"
14097 else
14098   echo "$as_me: failed program was:" >&5
14099 cat conftest.$ac_ext >&5
14100 eval "$as_ac_var=no"
14101 fi
14102 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14103 fi
14104 echo "$as_me:14104: result: `eval echo '${'$as_ac_var'}'`" >&5
14105 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
14106 if test `eval echo '${'$as_ac_var'}'` = yes; then
14107   cat >>confdefs.h <<EOF
14108 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
14109 EOF
14110
14111 fi
14112 done
14113
14114 if test "x$ac_cv_func_getopt" = xno; then
14115         { { echo "$as_me:14115: error: getopt is required for building programs" >&5
14116 echo "$as_me: error: getopt is required for building programs" >&2;}
14117    { (exit 1); exit 1; }; }
14118 fi
14119
14120 if test "$cf_enable_widec" = yes; then
14121
14122 for ac_func in \
14123 mblen \
14124 mbrlen \
14125 mbrtowc \
14126 mbsrtowcs \
14127 mbstowcs \
14128 mbtowc \
14129 wcsrtombs \
14130 wcstombs \
14131
14132 do
14133 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
14134 echo "$as_me:14134: checking for $ac_func" >&5
14135 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
14136 if eval "test \"\${$as_ac_var+set}\" = set"; then
14137   echo $ECHO_N "(cached) $ECHO_C" >&6
14138 else
14139   cat >conftest.$ac_ext <<_ACEOF
14140 #line 14140 "configure"
14141 #include "confdefs.h"
14142 /* System header to define __stub macros and hopefully few prototypes,
14143     which can conflict with char $ac_func (); below.  */
14144 #include <assert.h>
14145 /* Override any gcc2 internal prototype to avoid an error.  */
14146 #ifdef __cplusplus
14147 extern "C"
14148 #endif
14149 /* We use char because int might match the return type of a gcc2
14150    builtin and then its argument prototype would still apply.  */
14151 char $ac_func ();
14152 char (*f) ();
14153
14154 int
14155 main ()
14156 {
14157 /* The GNU C library defines this for functions which it implements
14158     to always fail with ENOSYS.  Some functions are actually named
14159     something starting with __ and the normal name is an alias.  */
14160 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
14161 choke me
14162 #else
14163 f = $ac_func; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
14164 #endif
14165
14166   ;
14167   return 0;
14168 }
14169 _ACEOF
14170 rm -f conftest.$ac_objext conftest$ac_exeext
14171 if { (eval echo "$as_me:14171: \"$ac_link\"") >&5
14172   (eval $ac_link) 2>&5
14173   ac_status=$?
14174   echo "$as_me:14174: \$? = $ac_status" >&5
14175   (exit $ac_status); } &&
14176          { ac_try='test -s conftest$ac_exeext'
14177   { (eval echo "$as_me:14177: \"$ac_try\"") >&5
14178   (eval $ac_try) 2>&5
14179   ac_status=$?
14180   echo "$as_me:14180: \$? = $ac_status" >&5
14181   (exit $ac_status); }; }; then
14182   eval "$as_ac_var=yes"
14183 else
14184   echo "$as_me: failed program was:" >&5
14185 cat conftest.$ac_ext >&5
14186 eval "$as_ac_var=no"
14187 fi
14188 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14189 fi
14190 echo "$as_me:14190: result: `eval echo '${'$as_ac_var'}'`" >&5
14191 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
14192 if test `eval echo '${'$as_ac_var'}'` = yes; then
14193   cat >>confdefs.h <<EOF
14194 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
14195 EOF
14196
14197 fi
14198 done
14199
14200 fi
14201
14202 echo "$as_me:14202: checking definition to turn on extended curses functions" >&5
14203 echo $ECHO_N "checking definition to turn on extended curses functions... $ECHO_C" >&6
14204 if test "${cf_cv_need_xopen_extension+set}" = set; then
14205   echo $ECHO_N "(cached) $ECHO_C" >&6
14206 else
14207
14208 cf_cv_need_xopen_extension=unknown
14209 cat >conftest.$ac_ext <<_ACEOF
14210 #line 14210 "configure"
14211 #include "confdefs.h"
14212
14213 #include <stdlib.h>
14214 #include <${cf_cv_ncurses_header:-curses.h}>
14215 int
14216 main ()
14217 {
14218
14219 #if defined(NCURSES_VERSION_PATCH)
14220 #if (NCURSES_VERSION_PATCH < 20100501) && (NCURSES_VERSION_PATCH >= 20100403)
14221         make an error
14222 #endif
14223 #endif
14224 #ifdef NCURSES_VERSION
14225         cchar_t check;
14226         int check2 = curs_set((int)sizeof(check));
14227 #endif
14228         long x = winnstr(stdscr, "", 0);
14229         int x1, y1;
14230         getbegyx(stdscr, y1, x1)
14231   ;
14232   return 0;
14233 }
14234 _ACEOF
14235 rm -f conftest.$ac_objext conftest$ac_exeext
14236 if { (eval echo "$as_me:14236: \"$ac_link\"") >&5
14237   (eval $ac_link) 2>&5
14238   ac_status=$?
14239   echo "$as_me:14239: \$? = $ac_status" >&5
14240   (exit $ac_status); } &&
14241          { ac_try='test -s conftest$ac_exeext'
14242   { (eval echo "$as_me:14242: \"$ac_try\"") >&5
14243   (eval $ac_try) 2>&5
14244   ac_status=$?
14245   echo "$as_me:14245: \$? = $ac_status" >&5
14246   (exit $ac_status); }; }; then
14247   cf_cv_need_xopen_extension=none
14248 else
14249   echo "$as_me: failed program was:" >&5
14250 cat conftest.$ac_ext >&5
14251
14252         for cf_try_xopen_extension in _XOPEN_SOURCE_EXTENDED NCURSES_WIDECHAR
14253         do
14254                 cat >conftest.$ac_ext <<_ACEOF
14255 #line 14255 "configure"
14256 #include "confdefs.h"
14257
14258 #define $cf_try_xopen_extension 1
14259 #include <stdlib.h>
14260 #include <${cf_cv_ncurses_header:-curses.h}>
14261 int
14262 main ()
14263 {
14264
14265 #ifdef NCURSES_VERSION
14266                 cchar_t check;
14267                 int check2 = curs_set((int)sizeof(check));
14268 #endif
14269                 long x = winnstr(stdscr, "", 0);
14270                 int x1, y1;
14271                 getbegyx(stdscr, y1, x1)
14272   ;
14273   return 0;
14274 }
14275 _ACEOF
14276 rm -f conftest.$ac_objext conftest$ac_exeext
14277 if { (eval echo "$as_me:14277: \"$ac_link\"") >&5
14278   (eval $ac_link) 2>&5
14279   ac_status=$?
14280   echo "$as_me:14280: \$? = $ac_status" >&5
14281   (exit $ac_status); } &&
14282          { ac_try='test -s conftest$ac_exeext'
14283   { (eval echo "$as_me:14283: \"$ac_try\"") >&5
14284   (eval $ac_try) 2>&5
14285   ac_status=$?
14286   echo "$as_me:14286: \$? = $ac_status" >&5
14287   (exit $ac_status); }; }; then
14288   cf_cv_need_xopen_extension=$cf_try_xopen_extension; break
14289 else
14290   echo "$as_me: failed program was:" >&5
14291 cat conftest.$ac_ext >&5
14292 fi
14293 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14294         done
14295
14296 fi
14297 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14298
14299 fi
14300 echo "$as_me:14300: result: $cf_cv_need_xopen_extension" >&5
14301 echo "${ECHO_T}$cf_cv_need_xopen_extension" >&6
14302
14303 case $cf_cv_need_xopen_extension in
14304 (*_*)
14305         CPPFLAGS="$CPPFLAGS -D$cf_cv_need_xopen_extension"
14306         ;;
14307 esac
14308
14309 echo "$as_me:14309: checking for term.h" >&5
14310 echo $ECHO_N "checking for term.h... $ECHO_C" >&6
14311 if test "${cf_cv_term_header+set}" = set; then
14312   echo $ECHO_N "(cached) $ECHO_C" >&6
14313 else
14314
14315 # If we found <ncurses/curses.h>, look for <ncurses/term.h>, but always look
14316 # for <term.h> if we do not find the variant.
14317
14318 cf_header_list="term.h ncurses/term.h ncursesw/term.h"
14319
14320 case ${cf_cv_ncurses_header:-curses.h} in
14321 (*/*)
14322         cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`term.h
14323         cf_header_list="$cf_header_item $cf_header_list"
14324         ;;
14325 esac
14326
14327 for cf_header in $cf_header_list
14328 do
14329         cat >conftest.$ac_ext <<_ACEOF
14330 #line 14330 "configure"
14331 #include "confdefs.h"
14332
14333 #include <${cf_cv_ncurses_header:-curses.h}>
14334 #include <${cf_header}>
14335 int
14336 main ()
14337 {
14338 WINDOW *x
14339   ;
14340   return 0;
14341 }
14342 _ACEOF
14343 rm -f conftest.$ac_objext
14344 if { (eval echo "$as_me:14344: \"$ac_compile\"") >&5
14345   (eval $ac_compile) 2>&5
14346   ac_status=$?
14347   echo "$as_me:14347: \$? = $ac_status" >&5
14348   (exit $ac_status); } &&
14349          { ac_try='test -s conftest.$ac_objext'
14350   { (eval echo "$as_me:14350: \"$ac_try\"") >&5
14351   (eval $ac_try) 2>&5
14352   ac_status=$?
14353   echo "$as_me:14353: \$? = $ac_status" >&5
14354   (exit $ac_status); }; }; then
14355   cf_cv_term_header=$cf_header
14356          break
14357 else
14358   echo "$as_me: failed program was:" >&5
14359 cat conftest.$ac_ext >&5
14360 cf_cv_term_header=no
14361 fi
14362 rm -f conftest.$ac_objext conftest.$ac_ext
14363 done
14364
14365 case $cf_cv_term_header in
14366 (no)
14367         # If curses is ncurses, some packagers still mess it up by trying to make
14368         # us use GNU termcap.  This handles the most common case.
14369         for cf_header in ncurses/term.h ncursesw/term.h
14370         do
14371                 cat >conftest.$ac_ext <<_ACEOF
14372 #line 14372 "configure"
14373 #include "confdefs.h"
14374
14375 #include <${cf_cv_ncurses_header:-curses.h}>
14376 #ifdef NCURSES_VERSION
14377 #include <${cf_header}>
14378 #else
14379 make an error
14380 #endif
14381 int
14382 main ()
14383 {
14384 WINDOW *x
14385   ;
14386   return 0;
14387 }
14388 _ACEOF
14389 rm -f conftest.$ac_objext
14390 if { (eval echo "$as_me:14390: \"$ac_compile\"") >&5
14391   (eval $ac_compile) 2>&5
14392   ac_status=$?
14393   echo "$as_me:14393: \$? = $ac_status" >&5
14394   (exit $ac_status); } &&
14395          { ac_try='test -s conftest.$ac_objext'
14396   { (eval echo "$as_me:14396: \"$ac_try\"") >&5
14397   (eval $ac_try) 2>&5
14398   ac_status=$?
14399   echo "$as_me:14399: \$? = $ac_status" >&5
14400   (exit $ac_status); }; }; then
14401   cf_cv_term_header=$cf_header
14402                          break
14403 else
14404   echo "$as_me: failed program was:" >&5
14405 cat conftest.$ac_ext >&5
14406 cf_cv_term_header=no
14407 fi
14408 rm -f conftest.$ac_objext conftest.$ac_ext
14409         done
14410         ;;
14411 esac
14412
14413 fi
14414 echo "$as_me:14414: result: $cf_cv_term_header" >&5
14415 echo "${ECHO_T}$cf_cv_term_header" >&6
14416
14417 case $cf_cv_term_header in
14418 (term.h)
14419
14420 cat >>confdefs.h <<\EOF
14421 #define HAVE_TERM_H 1
14422 EOF
14423
14424         ;;
14425 (ncurses/term.h)
14426
14427 cat >>confdefs.h <<\EOF
14428 #define HAVE_NCURSES_TERM_H 1
14429 EOF
14430
14431         ;;
14432 (ncursesw/term.h)
14433
14434 cat >>confdefs.h <<\EOF
14435 #define HAVE_NCURSESW_TERM_H 1
14436 EOF
14437
14438         ;;
14439 esac
14440
14441 echo "$as_me:14441: checking for unctrl.h" >&5
14442 echo $ECHO_N "checking for unctrl.h... $ECHO_C" >&6
14443 if test "${cf_cv_unctrl_header+set}" = set; then
14444   echo $ECHO_N "(cached) $ECHO_C" >&6
14445 else
14446
14447 # If we found <ncurses/curses.h>, look for <ncurses/unctrl.h>, but always look
14448 # for <unctrl.h> if we do not find the variant.
14449
14450 cf_header_list="unctrl.h ncurses/unctrl.h ncursesw/unctrl.h"
14451
14452 case ${cf_cv_ncurses_header:-curses.h} in
14453 (*/*)
14454         cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`unctrl.h
14455         cf_header_list="$cf_header_item $cf_header_list"
14456         ;;
14457 esac
14458
14459 for cf_header in $cf_header_list
14460 do
14461         cat >conftest.$ac_ext <<_ACEOF
14462 #line 14462 "configure"
14463 #include "confdefs.h"
14464
14465 #include <${cf_cv_ncurses_header:-curses.h}>
14466 #include <${cf_header}>
14467 int
14468 main ()
14469 {
14470 WINDOW *x
14471   ;
14472   return 0;
14473 }
14474 _ACEOF
14475 rm -f conftest.$ac_objext
14476 if { (eval echo "$as_me:14476: \"$ac_compile\"") >&5
14477   (eval $ac_compile) 2>&5
14478   ac_status=$?
14479   echo "$as_me:14479: \$? = $ac_status" >&5
14480   (exit $ac_status); } &&
14481          { ac_try='test -s conftest.$ac_objext'
14482   { (eval echo "$as_me:14482: \"$ac_try\"") >&5
14483   (eval $ac_try) 2>&5
14484   ac_status=$?
14485   echo "$as_me:14485: \$? = $ac_status" >&5
14486   (exit $ac_status); }; }; then
14487   cf_cv_unctrl_header=$cf_header
14488          break
14489 else
14490   echo "$as_me: failed program was:" >&5
14491 cat conftest.$ac_ext >&5
14492 cf_cv_unctrl_header=no
14493 fi
14494 rm -f conftest.$ac_objext conftest.$ac_ext
14495 done
14496
14497 fi
14498 echo "$as_me:14498: result: $cf_cv_unctrl_header" >&5
14499 echo "${ECHO_T}$cf_cv_unctrl_header" >&6
14500
14501 case $cf_cv_unctrl_header in
14502 (no)
14503         { echo "$as_me:14503: WARNING: unctrl.h header not found" >&5
14504 echo "$as_me: WARNING: unctrl.h header not found" >&2;}
14505         ;;
14506 esac
14507
14508 case $cf_cv_unctrl_header in
14509 (unctrl.h)
14510
14511 cat >>confdefs.h <<\EOF
14512 #define HAVE_UNCTRL_H 1
14513 EOF
14514
14515         ;;
14516 (ncurses/unctrl.h)
14517
14518 cat >>confdefs.h <<\EOF
14519 #define HAVE_NCURSES_UNCTRL_H 1
14520 EOF
14521
14522         ;;
14523 (ncursesw/unctrl.h)
14524
14525 cat >>confdefs.h <<\EOF
14526 #define HAVE_NCURSESW_UNCTRL_H 1
14527 EOF
14528
14529         ;;
14530 esac
14531
14532 for cf_func in \
14533 assume_default_colors \
14534 chgat \
14535 color_set \
14536 filter \
14537 getbegx \
14538 getcurx \
14539 getmaxx \
14540 getnstr \
14541 getparx \
14542 getwin \
14543 mvvline \
14544 mvwvline \
14545 napms \
14546 putwin \
14547 resize_term \
14548 resizeterm \
14549 ripoffline \
14550 scr_dump \
14551 setupterm \
14552 slk_color \
14553 slk_init \
14554 termattrs \
14555 tgetent \
14556 tigetnum \
14557 tigetstr \
14558 typeahead \
14559 use_default_colors \
14560 use_env \
14561 use_extended_names \
14562 use_screen \
14563 use_window \
14564 vid_puts \
14565 vidputs \
14566 vsscanf \
14567 vw_printw \
14568 wchgat \
14569 winsstr \
14570 wresize \
14571 wsyncdown \
14572
14573 do
14574
14575 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14576
14577         echo "$as_me:14577: checking for ${cf_func}" >&5
14578 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
14579
14580 echo "${as_me:-configure}:14580: testing ${cf_func} ..." 1>&5
14581
14582         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
14583   echo $ECHO_N "(cached) $ECHO_C" >&6
14584 else
14585
14586                 eval cf_result='$ac_cv_func_'$cf_func
14587                 if test ".$cf_result" != ".no"; then
14588                         cat >conftest.$ac_ext <<_ACEOF
14589 #line 14589 "configure"
14590 #include "confdefs.h"
14591
14592 #ifdef HAVE_XCURSES
14593 #include <xcurses.h>
14594 char * XCursesProgramName = "test";
14595 #else
14596 #include <${cf_cv_ncurses_header:-curses.h}>
14597 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
14598 #include <ncursesw/term.h>
14599 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
14600 #include <ncurses/term.h>
14601 #elif defined(HAVE_TERM_H)
14602 #include <term.h>
14603 #endif
14604 #endif
14605
14606 int
14607 main ()
14608 {
14609
14610 #ifndef ${cf_func}
14611 long foo = (long)(&${cf_func});
14612 fprintf(stderr, "testing linkage of $cf_func:%p\n", foo);
14613 if (foo + 1234 > 5678)
14614         ${cf_cv_main_return:-return}(foo);
14615 #endif
14616
14617   ;
14618   return 0;
14619 }
14620 _ACEOF
14621 rm -f conftest.$ac_objext conftest$ac_exeext
14622 if { (eval echo "$as_me:14622: \"$ac_link\"") >&5
14623   (eval $ac_link) 2>&5
14624   ac_status=$?
14625   echo "$as_me:14625: \$? = $ac_status" >&5
14626   (exit $ac_status); } &&
14627          { ac_try='test -s conftest$ac_exeext'
14628   { (eval echo "$as_me:14628: \"$ac_try\"") >&5
14629   (eval $ac_try) 2>&5
14630   ac_status=$?
14631   echo "$as_me:14631: \$? = $ac_status" >&5
14632   (exit $ac_status); }; }; then
14633   cf_result=yes
14634 else
14635   echo "$as_me: failed program was:" >&5
14636 cat conftest.$ac_ext >&5
14637 cf_result=no
14638 fi
14639 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14640                 fi
14641                 eval 'cf_cv_func_'$cf_func'=$cf_result'
14642
14643 fi
14644
14645         # use the computed/retrieved cache-value:
14646         eval 'cf_result=$cf_cv_func_'$cf_func
14647         echo "$as_me:14647: result: $cf_result" >&5
14648 echo "${ECHO_T}$cf_result" >&6
14649         if test $cf_result != no; then
14650                 cat >>confdefs.h <<EOF
14651 #define HAVE_${cf_tr_func} 1
14652 EOF
14653
14654         fi
14655 done
14656
14657 for cf_func in tputs
14658 do
14659
14660 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14661
14662         echo "$as_me:14662: checking for ${cf_func}" >&5
14663 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
14664
14665 echo "${as_me:-configure}:14665: testing ${cf_func} ..." 1>&5
14666
14667         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
14668   echo $ECHO_N "(cached) $ECHO_C" >&6
14669 else
14670
14671                 eval cf_result='$ac_cv_func_'$cf_func
14672                 if test ".$cf_result" != ".no"; then
14673                         cat >conftest.$ac_ext <<_ACEOF
14674 #line 14674 "configure"
14675 #include "confdefs.h"
14676
14677 #ifdef HAVE_XCURSES
14678 #include <xcurses.h>
14679 char * XCursesProgramName = "test";
14680 #else
14681 #include <${cf_cv_ncurses_header:-curses.h}>
14682 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
14683 #include <ncursesw/term.h>
14684 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
14685 #include <ncurses/term.h>
14686 #elif defined(HAVE_TERM_H)
14687 #include <term.h>
14688 #endif
14689 #endif
14690
14691 int
14692 main ()
14693 {
14694
14695 #ifndef ${cf_func}
14696 long foo = (long)(&${cf_func});
14697 fprintf(stderr, "testing linkage of $cf_func:%p\n", foo);
14698 if (foo + 1234 > 5678)
14699         ${cf_cv_main_return:-return}(foo);
14700 #endif
14701
14702   ;
14703   return 0;
14704 }
14705 _ACEOF
14706 rm -f conftest.$ac_objext conftest$ac_exeext
14707 if { (eval echo "$as_me:14707: \"$ac_link\"") >&5
14708   (eval $ac_link) 2>&5
14709   ac_status=$?
14710   echo "$as_me:14710: \$? = $ac_status" >&5
14711   (exit $ac_status); } &&
14712          { ac_try='test -s conftest$ac_exeext'
14713   { (eval echo "$as_me:14713: \"$ac_try\"") >&5
14714   (eval $ac_try) 2>&5
14715   ac_status=$?
14716   echo "$as_me:14716: \$? = $ac_status" >&5
14717   (exit $ac_status); }; }; then
14718   cf_result=yes
14719 else
14720   echo "$as_me: failed program was:" >&5
14721 cat conftest.$ac_ext >&5
14722 cf_result=no
14723 fi
14724 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14725                 fi
14726                 eval 'cf_cv_func_'$cf_func'=$cf_result'
14727
14728 fi
14729
14730         # use the computed/retrieved cache-value:
14731         eval 'cf_result=$cf_cv_func_'$cf_func
14732         echo "$as_me:14732: result: $cf_result" >&5
14733 echo "${ECHO_T}$cf_result" >&6
14734         if test $cf_result != no; then
14735                 cat >>confdefs.h <<EOF
14736 #define HAVE_${cf_tr_func} 1
14737 EOF
14738
14739         fi
14740 done
14741
14742 if test x$cf_cv_func_tputs = xyes
14743 then
14744         cf_done=no
14745         for cf_arg in int char
14746         do
14747                 for cf_ret in int void
14748                 do
14749                         if test $cf_ret = void
14750                         then
14751                                 cf_return="/* nothing */"
14752                         else
14753                                 cf_return="return value"
14754                         fi
14755                         cat >conftest.$ac_ext <<_ACEOF
14756 #line 14756 "configure"
14757 #include "confdefs.h"
14758
14759 #include <${cf_cv_ncurses_header:-curses.h}>
14760 #include <$cf_cv_term_header>
14761
14762 static $cf_ret outc($cf_arg value) { $cf_return; }
14763
14764 int
14765 main ()
14766 {
14767
14768         tputs("hello", 0, outc);
14769         ${cf_cv_main_return:-return}(0);
14770
14771   ;
14772   return 0;
14773 }
14774 _ACEOF
14775 rm -f conftest.$ac_objext
14776 if { (eval echo "$as_me:14776: \"$ac_compile\"") >&5
14777   (eval $ac_compile) 2>&5
14778   ac_status=$?
14779   echo "$as_me:14779: \$? = $ac_status" >&5
14780   (exit $ac_status); } &&
14781          { ac_try='test -s conftest.$ac_objext'
14782   { (eval echo "$as_me:14782: \"$ac_try\"") >&5
14783   (eval $ac_try) 2>&5
14784   ac_status=$?
14785   echo "$as_me:14785: \$? = $ac_status" >&5
14786   (exit $ac_status); }; }; then
14787
14788                 test -n "$verbose" && echo "    prototype $cf_ret func($cf_arg value)" 1>&6
14789
14790 echo "${as_me:-configure}:14790: testing prototype $cf_ret func($cf_arg value) ..." 1>&5
14791
14792                 cat >>confdefs.h <<EOF
14793 #define TPUTS_ARG               $cf_arg
14794 #define TPUTS_PROTO(func,value) $cf_ret func(TPUTS_ARG value)
14795 #define TPUTS_RETURN(value)     $cf_return
14796 EOF
14797                 cf_done=yes
14798                 break
14799
14800 else
14801   echo "$as_me: failed program was:" >&5
14802 cat conftest.$ac_ext >&5
14803 fi
14804 rm -f conftest.$ac_objext conftest.$ac_ext
14805                 done
14806                 test $cf_done = yes && break
14807         done
14808 fi
14809
14810 echo "$as_me:14810: checking for ncurses extended functions" >&5
14811 echo $ECHO_N "checking for ncurses extended functions... $ECHO_C" >&6
14812 if test "${cf_cv_ncurses_ext_funcs+set}" = set; then
14813   echo $ECHO_N "(cached) $ECHO_C" >&6
14814 else
14815
14816 cat >conftest.$ac_ext <<_ACEOF
14817 #line 14817 "configure"
14818 #include "confdefs.h"
14819
14820 #include <${cf_cv_ncurses_header:-curses.h}>
14821 int
14822 main ()
14823 {
14824
14825 int x = NCURSES_EXT_FUNCS
14826
14827   ;
14828   return 0;
14829 }
14830 _ACEOF
14831 rm -f conftest.$ac_objext
14832 if { (eval echo "$as_me:14832: \"$ac_compile\"") >&5
14833   (eval $ac_compile) 2>&5
14834   ac_status=$?
14835   echo "$as_me:14835: \$? = $ac_status" >&5
14836   (exit $ac_status); } &&
14837          { ac_try='test -s conftest.$ac_objext'
14838   { (eval echo "$as_me:14838: \"$ac_try\"") >&5
14839   (eval $ac_try) 2>&5
14840   ac_status=$?
14841   echo "$as_me:14841: \$? = $ac_status" >&5
14842   (exit $ac_status); }; }; then
14843   cf_cv_ncurses_ext_funcs=defined
14844 else
14845   echo "$as_me: failed program was:" >&5
14846 cat conftest.$ac_ext >&5
14847
14848 cat >conftest.$ac_ext <<_ACEOF
14849 #line 14849 "configure"
14850 #include "confdefs.h"
14851
14852 #include <${cf_cv_ncurses_header:-curses.h}>
14853 int
14854 main ()
14855 {
14856
14857         (void) assume_default_colors (0, 0);
14858         (void) curses_version ();
14859         (void) define_key (0, 0);
14860         (void) is_term_resized (0, 0);
14861         (void) key_defined (0);
14862         (void) keybound (0, 0);
14863         (void) keyok (0, 0);
14864         (void) resize_term (0, 0);
14865         (void) resizeterm (0, 0);
14866         (void) use_default_colors ();
14867         (void) use_extended_names (0);
14868         (void) wresize (0, 0, 0);
14869   ;
14870   return 0;
14871 }
14872 _ACEOF
14873 rm -f conftest.$ac_objext conftest$ac_exeext
14874 if { (eval echo "$as_me:14874: \"$ac_link\"") >&5
14875   (eval $ac_link) 2>&5
14876   ac_status=$?
14877   echo "$as_me:14877: \$? = $ac_status" >&5
14878   (exit $ac_status); } &&
14879          { ac_try='test -s conftest$ac_exeext'
14880   { (eval echo "$as_me:14880: \"$ac_try\"") >&5
14881   (eval $ac_try) 2>&5
14882   ac_status=$?
14883   echo "$as_me:14883: \$? = $ac_status" >&5
14884   (exit $ac_status); }; }; then
14885   cf_cv_ncurses_ext_funcs=yes
14886 else
14887   echo "$as_me: failed program was:" >&5
14888 cat conftest.$ac_ext >&5
14889 cf_cv_ncurses_ext_funcs=no
14890 fi
14891 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14892
14893 fi
14894 rm -f conftest.$ac_objext conftest.$ac_ext
14895
14896 fi
14897 echo "$as_me:14897: result: $cf_cv_ncurses_ext_funcs" >&5
14898 echo "${ECHO_T}$cf_cv_ncurses_ext_funcs" >&6
14899 test "$cf_cv_ncurses_ext_funcs" = yes &&
14900 cat >>confdefs.h <<\EOF
14901 #define NCURSES_EXT_FUNCS 1
14902 EOF
14903
14904 if test "$cf_enable_widec" = yes
14905 then
14906         # workaround for systems with ncurses before 20111029, due to change of
14907         # feature test macro from _XPG5 to _XOPEN_SOURCE
14908         if test -n "$cf_cv_ncurses_version" && test "x$cf_cv_ncurses_version" != xno
14909         then
14910                 cf_define_xpg5=no
14911                 echo "$as_me:14911: checking if _XPG5 should be defined to enable wide-characters" >&5
14912 echo $ECHO_N "checking if _XPG5 should be defined to enable wide-characters... $ECHO_C" >&6
14913
14914                 cat >conftest.$ac_ext <<_ACEOF
14915 #line 14915 "configure"
14916 #include "confdefs.h"
14917
14918 #include <${cf_cv_ncurses_header:-curses.h}>
14919 int
14920 main ()
14921 {
14922 int x = _XPG5
14923   ;
14924   return 0;
14925 }
14926 _ACEOF
14927 rm -f conftest.$ac_objext
14928 if { (eval echo "$as_me:14928: \"$ac_compile\"") >&5
14929   (eval $ac_compile) 2>&5
14930   ac_status=$?
14931   echo "$as_me:14931: \$? = $ac_status" >&5
14932   (exit $ac_status); } &&
14933          { ac_try='test -s conftest.$ac_objext'
14934   { (eval echo "$as_me:14934: \"$ac_try\"") >&5
14935   (eval $ac_try) 2>&5
14936   ac_status=$?
14937   echo "$as_me:14937: \$? = $ac_status" >&5
14938   (exit $ac_status); }; }; then
14939   :
14940 else
14941   echo "$as_me: failed program was:" >&5
14942 cat conftest.$ac_ext >&5
14943 cf_save_cppflags="$CPPFLAGS"
14944                          CPPFLAGS="$CPPFLAGS -D_XPG5"
14945                          cat >conftest.$ac_ext <<_ACEOF
14946 #line 14946 "configure"
14947 #include "confdefs.h"
14948
14949 #include <${cf_cv_ncurses_header:-curses.h}>
14950 int
14951 main ()
14952 {
14953 int x = _XPG5
14954   ;
14955   return 0;
14956 }
14957 _ACEOF
14958 rm -f conftest.$ac_objext
14959 if { (eval echo "$as_me:14959: \"$ac_compile\"") >&5
14960   (eval $ac_compile) 2>&5
14961   ac_status=$?
14962   echo "$as_me:14962: \$? = $ac_status" >&5
14963   (exit $ac_status); } &&
14964          { ac_try='test -s conftest.$ac_objext'
14965   { (eval echo "$as_me:14965: \"$ac_try\"") >&5
14966   (eval $ac_try) 2>&5
14967   ac_status=$?
14968   echo "$as_me:14968: \$? = $ac_status" >&5
14969   (exit $ac_status); }; }; then
14970   cf_define_xpg5=yes
14971 else
14972   echo "$as_me: failed program was:" >&5
14973 cat conftest.$ac_ext >&5
14974 fi
14975 rm -f conftest.$ac_objext conftest.$ac_ext
14976                          CPPFLAGS="$cf_save_cppflags"
14977 fi
14978 rm -f conftest.$ac_objext conftest.$ac_ext
14979                 echo "$as_me:14979: result: $cf_define_xpg5" >&5
14980 echo "${ECHO_T}$cf_define_xpg5" >&6
14981
14982                 if test "$cf_define_xpg5" = yes
14983                 then
14984                         CPPFLAGS="$CPPFLAGS -D_XPG5"
14985                 fi
14986         fi
14987
14988         echo "$as_me:14988: checking for wide-character functions" >&5
14989 echo $ECHO_N "checking for wide-character functions... $ECHO_C" >&6
14990 if test "${cf_cv_widechar_funcs+set}" = set; then
14991   echo $ECHO_N "(cached) $ECHO_C" >&6
14992 else
14993
14994         cat >conftest.$ac_ext <<_ACEOF
14995 #line 14995 "configure"
14996 #include "confdefs.h"
14997
14998 #include <${cf_cv_ncurses_header:-curses.h}>
14999 int
15000 main ()
15001 {
15002
15003                 static wchar_t src_wchar[2];
15004                 static cchar_t dst_cchar;
15005                 setcchar(&dst_cchar, src_wchar, A_NORMAL, 0, (void *) 0);
15006
15007   ;
15008   return 0;
15009 }
15010 _ACEOF
15011 rm -f conftest.$ac_objext conftest$ac_exeext
15012 if { (eval echo "$as_me:15012: \"$ac_link\"") >&5
15013   (eval $ac_link) 2>&5
15014   ac_status=$?
15015   echo "$as_me:15015: \$? = $ac_status" >&5
15016   (exit $ac_status); } &&
15017          { ac_try='test -s conftest$ac_exeext'
15018   { (eval echo "$as_me:15018: \"$ac_try\"") >&5
15019   (eval $ac_try) 2>&5
15020   ac_status=$?
15021   echo "$as_me:15021: \$? = $ac_status" >&5
15022   (exit $ac_status); }; }; then
15023   cf_cv_widechar_funcs=yes
15024 else
15025   echo "$as_me: failed program was:" >&5
15026 cat conftest.$ac_ext >&5
15027 cf_cv_widechar_funcs=no
15028 fi
15029 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15030
15031 fi
15032 echo "$as_me:15032: result: $cf_cv_widechar_funcs" >&5
15033 echo "${ECHO_T}$cf_cv_widechar_funcs" >&6
15034         if test "$cf_cv_widechar_funcs" != no ; then
15035
15036 cat >>confdefs.h <<\EOF
15037 #define USE_WIDEC_SUPPORT 1
15038 EOF
15039
15040         else
15041                 cat >>confdefs.h <<\EOF
15042 #define USE_WIDEC_SUPPORT 0
15043 EOF
15044
15045         fi
15046 else
15047         cat >>confdefs.h <<\EOF
15048 #define USE_WIDEC_SUPPORT 0
15049 EOF
15050
15051 fi
15052
15053 echo "$as_me:15053: checking if $cf_cv_screen library uses pthreads" >&5
15054 echo $ECHO_N "checking if $cf_cv_screen library uses pthreads... $ECHO_C" >&6
15055 if test "${cf_cv_use_pthreads+set}" = set; then
15056   echo $ECHO_N "(cached) $ECHO_C" >&6
15057 else
15058
15059 cat >conftest.$ac_ext <<_ACEOF
15060 #line 15060 "configure"
15061 #include "confdefs.h"
15062
15063 #include <${cf_cv_ncurses_header:-curses.h}>
15064 extern void _nc_init_pthreads(void);
15065
15066 int
15067 main ()
15068 {
15069
15070         initscr();
15071         _nc_init_pthreads();
15072
15073   ;
15074   return 0;
15075 }
15076 _ACEOF
15077 rm -f conftest.$ac_objext conftest$ac_exeext
15078 if { (eval echo "$as_me:15078: \"$ac_link\"") >&5
15079   (eval $ac_link) 2>&5
15080   ac_status=$?
15081   echo "$as_me:15081: \$? = $ac_status" >&5
15082   (exit $ac_status); } &&
15083          { ac_try='test -s conftest$ac_exeext'
15084   { (eval echo "$as_me:15084: \"$ac_try\"") >&5
15085   (eval $ac_try) 2>&5
15086   ac_status=$?
15087   echo "$as_me:15087: \$? = $ac_status" >&5
15088   (exit $ac_status); }; }; then
15089   cf_cv_use_pthreads=yes
15090 else
15091   echo "$as_me: failed program was:" >&5
15092 cat conftest.$ac_ext >&5
15093 cf_cv_use_pthreads=no
15094 fi
15095 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15096
15097 fi
15098 echo "$as_me:15098: result: $cf_cv_use_pthreads" >&5
15099 echo "${ECHO_T}$cf_cv_use_pthreads" >&6
15100 test $cf_cv_use_pthreads = yes && cat >>confdefs.h <<\EOF
15101 #define USE_PTHREADS 1
15102 EOF
15103
15104 echo "$as_me:15104: checking if sys/time.h works with sys/select.h" >&5
15105 echo $ECHO_N "checking if sys/time.h works with sys/select.h... $ECHO_C" >&6
15106 if test "${cf_cv_sys_time_select+set}" = set; then
15107   echo $ECHO_N "(cached) $ECHO_C" >&6
15108 else
15109
15110 cat >conftest.$ac_ext <<_ACEOF
15111 #line 15111 "configure"
15112 #include "confdefs.h"
15113
15114 #include <sys/types.h>
15115 #ifdef HAVE_SYS_TIME_H
15116 #include <sys/time.h>
15117 #endif
15118 #ifdef HAVE_SYS_SELECT_H
15119 #include <sys/select.h>
15120 #endif
15121
15122 int
15123 main ()
15124 {
15125
15126   ;
15127   return 0;
15128 }
15129 _ACEOF
15130 rm -f conftest.$ac_objext
15131 if { (eval echo "$as_me:15131: \"$ac_compile\"") >&5
15132   (eval $ac_compile) 2>&5
15133   ac_status=$?
15134   echo "$as_me:15134: \$? = $ac_status" >&5
15135   (exit $ac_status); } &&
15136          { ac_try='test -s conftest.$ac_objext'
15137   { (eval echo "$as_me:15137: \"$ac_try\"") >&5
15138   (eval $ac_try) 2>&5
15139   ac_status=$?
15140   echo "$as_me:15140: \$? = $ac_status" >&5
15141   (exit $ac_status); }; }; then
15142   cf_cv_sys_time_select=yes
15143 else
15144   echo "$as_me: failed program was:" >&5
15145 cat conftest.$ac_ext >&5
15146 cf_cv_sys_time_select=no
15147 fi
15148 rm -f conftest.$ac_objext conftest.$ac_ext
15149
15150 fi
15151
15152 echo "$as_me:15152: result: $cf_cv_sys_time_select" >&5
15153 echo "${ECHO_T}$cf_cv_sys_time_select" >&6
15154 test "$cf_cv_sys_time_select" = yes &&
15155 cat >>confdefs.h <<\EOF
15156 #define HAVE_SYS_TIME_SELECT 1
15157 EOF
15158
15159 # special check for test/ditto.c
15160
15161 echo "$as_me:15161: checking for openpty in -lutil" >&5
15162 echo $ECHO_N "checking for openpty in -lutil... $ECHO_C" >&6
15163 if test "${ac_cv_lib_util_openpty+set}" = set; then
15164   echo $ECHO_N "(cached) $ECHO_C" >&6
15165 else
15166   ac_check_lib_save_LIBS=$LIBS
15167 LIBS="-lutil  $LIBS"
15168 cat >conftest.$ac_ext <<_ACEOF
15169 #line 15169 "configure"
15170 #include "confdefs.h"
15171
15172 /* Override any gcc2 internal prototype to avoid an error.  */
15173 #ifdef __cplusplus
15174 extern "C"
15175 #endif
15176 /* We use char because int might match the return type of a gcc2
15177    builtin and then its argument prototype would still apply.  */
15178 char openpty ();
15179 int
15180 main ()
15181 {
15182 openpty ();
15183   ;
15184   return 0;
15185 }
15186 _ACEOF
15187 rm -f conftest.$ac_objext conftest$ac_exeext
15188 if { (eval echo "$as_me:15188: \"$ac_link\"") >&5
15189   (eval $ac_link) 2>&5
15190   ac_status=$?
15191   echo "$as_me:15191: \$? = $ac_status" >&5
15192   (exit $ac_status); } &&
15193          { ac_try='test -s conftest$ac_exeext'
15194   { (eval echo "$as_me:15194: \"$ac_try\"") >&5
15195   (eval $ac_try) 2>&5
15196   ac_status=$?
15197   echo "$as_me:15197: \$? = $ac_status" >&5
15198   (exit $ac_status); }; }; then
15199   ac_cv_lib_util_openpty=yes
15200 else
15201   echo "$as_me: failed program was:" >&5
15202 cat conftest.$ac_ext >&5
15203 ac_cv_lib_util_openpty=no
15204 fi
15205 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15206 LIBS=$ac_check_lib_save_LIBS
15207 fi
15208 echo "$as_me:15208: result: $ac_cv_lib_util_openpty" >&5
15209 echo "${ECHO_T}$ac_cv_lib_util_openpty" >&6
15210 if test $ac_cv_lib_util_openpty = yes; then
15211   cf_cv_lib_util=yes
15212 else
15213   cf_cv_lib_util=no
15214 fi
15215
15216 echo "$as_me:15216: checking for openpty header" >&5
15217 echo $ECHO_N "checking for openpty header... $ECHO_C" >&6
15218 if test "${cf_cv_func_openpty+set}" = set; then
15219   echo $ECHO_N "(cached) $ECHO_C" >&6
15220 else
15221
15222         cf_save_LIBS="$LIBS"
15223         test $cf_cv_lib_util = yes && {
15224 cf_add_libs="-lutil"
15225 # Filter out duplicates - this happens with badly-designed ".pc" files...
15226 for cf_add_1lib in $LIBS
15227 do
15228         for cf_add_2lib in $cf_add_libs
15229         do
15230                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
15231                 then
15232                         cf_add_1lib=
15233                         break
15234                 fi
15235         done
15236         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
15237 done
15238 LIBS="$cf_add_libs"
15239  }
15240         for cf_header in pty.h libutil.h util.h
15241         do
15242         cat >conftest.$ac_ext <<_ACEOF
15243 #line 15243 "configure"
15244 #include "confdefs.h"
15245
15246 #include <$cf_header>
15247
15248 int
15249 main ()
15250 {
15251
15252         int x = openpty((int *)0, (int *)0, (char *)0,
15253                                    (struct termios *)0, (struct winsize *)0);
15254
15255   ;
15256   return 0;
15257 }
15258 _ACEOF
15259 rm -f conftest.$ac_objext conftest$ac_exeext
15260 if { (eval echo "$as_me:15260: \"$ac_link\"") >&5
15261   (eval $ac_link) 2>&5
15262   ac_status=$?
15263   echo "$as_me:15263: \$? = $ac_status" >&5
15264   (exit $ac_status); } &&
15265          { ac_try='test -s conftest$ac_exeext'
15266   { (eval echo "$as_me:15266: \"$ac_try\"") >&5
15267   (eval $ac_try) 2>&5
15268   ac_status=$?
15269   echo "$as_me:15269: \$? = $ac_status" >&5
15270   (exit $ac_status); }; }; then
15271
15272                 cf_cv_func_openpty=$cf_header
15273                 break
15274
15275 else
15276   echo "$as_me: failed program was:" >&5
15277 cat conftest.$ac_ext >&5
15278
15279                 cf_cv_func_openpty=no
15280
15281 fi
15282 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15283         done
15284         LIBS="$cf_save_LIBS"
15285
15286 fi
15287 echo "$as_me:15287: result: $cf_cv_func_openpty" >&5
15288 echo "${ECHO_T}$cf_cv_func_openpty" >&6
15289
15290 if test "$cf_cv_func_openpty" != no ; then
15291
15292 cat >>confdefs.h <<EOF
15293 #define USE_OPENPTY_HEADER <$cf_cv_func_openpty>
15294 EOF
15295
15296 cat >>confdefs.h <<\EOF
15297 #define USE_XTERM_PTY 1
15298 EOF
15299
15300         if test "x$cf_cv_lib_util" = xyes ; then
15301
15302 cf_add_libs="-lutil"
15303 # Filter out duplicates - this happens with badly-designed ".pc" files...
15304 for cf_add_1lib in $TEST_LIBS
15305 do
15306         for cf_add_2lib in $cf_add_libs
15307         do
15308                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
15309                 then
15310                         cf_add_1lib=
15311                         break
15312                 fi
15313         done
15314         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
15315 done
15316 TEST_LIBS="$cf_add_libs"
15317
15318         fi
15319 fi
15320
15321 echo "$as_me:15321: checking for function curses_version" >&5
15322 echo $ECHO_N "checking for function curses_version... $ECHO_C" >&6
15323 if test "${cf_cv_func_curses_version+set}" = set; then
15324   echo $ECHO_N "(cached) $ECHO_C" >&6
15325 else
15326
15327 if test "$cross_compiling" = yes; then
15328   cf_cv_func_curses_version=unknown
15329 else
15330   cat >conftest.$ac_ext <<_ACEOF
15331 #line 15331 "configure"
15332 #include "confdefs.h"
15333
15334 #include <${cf_cv_ncurses_header:-curses.h}>
15335 int main()
15336 {
15337         char temp[1024];
15338         sprintf(temp, "%s\n", curses_version());
15339         ${cf_cv_main_return:-return}(0);
15340 }
15341
15342 _ACEOF
15343 rm -f 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); } && { ac_try='./conftest$ac_exeext'
15349   { (eval echo "$as_me:15349: \"$ac_try\"") >&5
15350   (eval $ac_try) 2>&5
15351   ac_status=$?
15352   echo "$as_me:15352: \$? = $ac_status" >&5
15353   (exit $ac_status); }; }; then
15354   cf_cv_func_curses_version=yes
15355
15356 else
15357   echo "$as_me: program exited with status $ac_status" >&5
15358 echo "$as_me: failed program was:" >&5
15359 cat conftest.$ac_ext >&5
15360 cf_cv_func_curses_version=no
15361
15362 fi
15363 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
15364 fi
15365 rm -f core
15366 fi
15367 echo "$as_me:15367: result: $cf_cv_func_curses_version" >&5
15368 echo "${ECHO_T}$cf_cv_func_curses_version" >&6
15369 test "$cf_cv_func_curses_version" = yes &&
15370 cat >>confdefs.h <<\EOF
15371 #define HAVE_CURSES_VERSION 1
15372 EOF
15373
15374 echo "$as_me:15374: checking for alternate character set array" >&5
15375 echo $ECHO_N "checking for alternate character set array... $ECHO_C" >&6
15376 if test "${cf_cv_curses_acs_map+set}" = set; then
15377   echo $ECHO_N "(cached) $ECHO_C" >&6
15378 else
15379
15380 cf_cv_curses_acs_map=unknown
15381 for name in acs_map _acs_map __acs_map ${NCURSES_WRAP_PREFIX}acs_map
15382 do
15383 cat >conftest.$ac_ext <<_ACEOF
15384 #line 15384 "configure"
15385 #include "confdefs.h"
15386
15387 #include <${cf_cv_ncurses_header:-curses.h}>
15388
15389 int
15390 main ()
15391 {
15392
15393 $name['k'] = ACS_PLUS
15394
15395   ;
15396   return 0;
15397 }
15398 _ACEOF
15399 rm -f conftest.$ac_objext conftest$ac_exeext
15400 if { (eval echo "$as_me:15400: \"$ac_link\"") >&5
15401   (eval $ac_link) 2>&5
15402   ac_status=$?
15403   echo "$as_me:15403: \$? = $ac_status" >&5
15404   (exit $ac_status); } &&
15405          { ac_try='test -s conftest$ac_exeext'
15406   { (eval echo "$as_me:15406: \"$ac_try\"") >&5
15407   (eval $ac_try) 2>&5
15408   ac_status=$?
15409   echo "$as_me:15409: \$? = $ac_status" >&5
15410   (exit $ac_status); }; }; then
15411   cf_cv_curses_acs_map=$name; break
15412 else
15413   echo "$as_me: failed program was:" >&5
15414 cat conftest.$ac_ext >&5
15415 fi
15416 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15417 done
15418
15419 fi
15420 echo "$as_me:15420: result: $cf_cv_curses_acs_map" >&5
15421 echo "${ECHO_T}$cf_cv_curses_acs_map" >&6
15422
15423 test "$cf_cv_curses_acs_map" != unknown &&
15424 cat >>confdefs.h <<EOF
15425 #define CURSES_ACS_ARRAY $cf_cv_curses_acs_map
15426 EOF
15427
15428 if test "$cf_enable_widec" = yes; then
15429
15430 echo "$as_me:15430: checking for wide alternate character set array" >&5
15431 echo $ECHO_N "checking for wide alternate character set array... $ECHO_C" >&6
15432 if test "${cf_cv_curses_wacs_map+set}" = set; then
15433   echo $ECHO_N "(cached) $ECHO_C" >&6
15434 else
15435
15436         cf_cv_curses_wacs_map=unknown
15437         for name in wacs_map _wacs_map __wacs_map _nc_wacs _wacs_char
15438         do
15439         cat >conftest.$ac_ext <<_ACEOF
15440 #line 15440 "configure"
15441 #include "confdefs.h"
15442
15443 #ifndef _XOPEN_SOURCE_EXTENDED
15444 #define _XOPEN_SOURCE_EXTENDED
15445 #endif
15446 #include <${cf_cv_ncurses_header:-curses.h}>
15447 int
15448 main ()
15449 {
15450 void *foo = &($name['k'])
15451   ;
15452   return 0;
15453 }
15454 _ACEOF
15455 rm -f conftest.$ac_objext conftest$ac_exeext
15456 if { (eval echo "$as_me:15456: \"$ac_link\"") >&5
15457   (eval $ac_link) 2>&5
15458   ac_status=$?
15459   echo "$as_me:15459: \$? = $ac_status" >&5
15460   (exit $ac_status); } &&
15461          { ac_try='test -s conftest$ac_exeext'
15462   { (eval echo "$as_me:15462: \"$ac_try\"") >&5
15463   (eval $ac_try) 2>&5
15464   ac_status=$?
15465   echo "$as_me:15465: \$? = $ac_status" >&5
15466   (exit $ac_status); }; }; then
15467   cf_cv_curses_wacs_map=$name
15468          break
15469 else
15470   echo "$as_me: failed program was:" >&5
15471 cat conftest.$ac_ext >&5
15472 fi
15473 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15474         done
15475 fi
15476 echo "$as_me:15476: result: $cf_cv_curses_wacs_map" >&5
15477 echo "${ECHO_T}$cf_cv_curses_wacs_map" >&6
15478
15479 test "$cf_cv_curses_wacs_map" != unknown &&
15480 cat >>confdefs.h <<EOF
15481 #define CURSES_WACS_ARRAY $cf_cv_curses_wacs_map
15482 EOF
15483
15484 echo "$as_me:15484: checking for wide alternate character constants" >&5
15485 echo $ECHO_N "checking for wide alternate character constants... $ECHO_C" >&6
15486 if test "${cf_cv_curses_wacs_symbols+set}" = set; then
15487   echo $ECHO_N "(cached) $ECHO_C" >&6
15488 else
15489
15490 cf_cv_curses_wacs_symbols=no
15491 if test "$cf_cv_curses_wacs_map" != unknown
15492 then
15493         cat >conftest.$ac_ext <<_ACEOF
15494 #line 15494 "configure"
15495 #include "confdefs.h"
15496
15497 #ifndef _XOPEN_SOURCE_EXTENDED
15498 #define _XOPEN_SOURCE_EXTENDED
15499 #endif
15500 #include <${cf_cv_ncurses_header:-curses.h}>
15501 int
15502 main ()
15503 {
15504 cchar_t *foo = WACS_PLUS;
15505          $cf_cv_curses_wacs_map['k'] = *WACS_PLUS
15506   ;
15507   return 0;
15508 }
15509 _ACEOF
15510 rm -f conftest.$ac_objext conftest$ac_exeext
15511 if { (eval echo "$as_me:15511: \"$ac_link\"") >&5
15512   (eval $ac_link) 2>&5
15513   ac_status=$?
15514   echo "$as_me:15514: \$? = $ac_status" >&5
15515   (exit $ac_status); } &&
15516          { ac_try='test -s conftest$ac_exeext'
15517   { (eval echo "$as_me:15517: \"$ac_try\"") >&5
15518   (eval $ac_try) 2>&5
15519   ac_status=$?
15520   echo "$as_me:15520: \$? = $ac_status" >&5
15521   (exit $ac_status); }; }; then
15522   cf_cv_curses_wacs_symbols=yes
15523 else
15524   echo "$as_me: failed program was:" >&5
15525 cat conftest.$ac_ext >&5
15526 fi
15527 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15528 else
15529         cat >conftest.$ac_ext <<_ACEOF
15530 #line 15530 "configure"
15531 #include "confdefs.h"
15532
15533 #ifndef _XOPEN_SOURCE_EXTENDED
15534 #define _XOPEN_SOURCE_EXTENDED
15535 #endif
15536 #include <${cf_cv_ncurses_header:-curses.h}>
15537 int
15538 main ()
15539 {
15540 cchar_t *foo = WACS_PLUS
15541   ;
15542   return 0;
15543 }
15544 _ACEOF
15545 rm -f conftest.$ac_objext conftest$ac_exeext
15546 if { (eval echo "$as_me:15546: \"$ac_link\"") >&5
15547   (eval $ac_link) 2>&5
15548   ac_status=$?
15549   echo "$as_me:15549: \$? = $ac_status" >&5
15550   (exit $ac_status); } &&
15551          { ac_try='test -s conftest$ac_exeext'
15552   { (eval echo "$as_me:15552: \"$ac_try\"") >&5
15553   (eval $ac_try) 2>&5
15554   ac_status=$?
15555   echo "$as_me:15555: \$? = $ac_status" >&5
15556   (exit $ac_status); }; }; then
15557   cf_cv_curses_wacs_symbols=yes
15558 else
15559   echo "$as_me: failed program was:" >&5
15560 cat conftest.$ac_ext >&5
15561 fi
15562 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15563 fi
15564
15565 fi
15566 echo "$as_me:15566: result: $cf_cv_curses_wacs_symbols" >&5
15567 echo "${ECHO_T}$cf_cv_curses_wacs_symbols" >&6
15568
15569 test "$cf_cv_curses_wacs_symbols" != no &&
15570 cat >>confdefs.h <<\EOF
15571 #define CURSES_WACS_SYMBOLS 1
15572 EOF
15573
15574 fi
15575
15576 echo "$as_me:15576: checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}" >&5
15577 echo $ECHO_N "checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
15578 cat >conftest.$ac_ext <<_ACEOF
15579 #line 15579 "configure"
15580 #include "confdefs.h"
15581
15582 #ifndef _XOPEN_SOURCE_EXTENDED
15583 #define _XOPEN_SOURCE_EXTENDED
15584 #endif
15585 #include <${cf_cv_ncurses_header:-curses.h}>
15586 int
15587 main ()
15588 {
15589
15590 attr_t foo
15591
15592   ;
15593   return 0;
15594 }
15595 _ACEOF
15596 rm -f conftest.$ac_objext
15597 if { (eval echo "$as_me:15597: \"$ac_compile\"") >&5
15598   (eval $ac_compile) 2>&5
15599   ac_status=$?
15600   echo "$as_me:15600: \$? = $ac_status" >&5
15601   (exit $ac_status); } &&
15602          { ac_try='test -s conftest.$ac_objext'
15603   { (eval echo "$as_me:15603: \"$ac_try\"") >&5
15604   (eval $ac_try) 2>&5
15605   ac_status=$?
15606   echo "$as_me:15606: \$? = $ac_status" >&5
15607   (exit $ac_status); }; }; then
15608   cf_result=yes
15609 else
15610   echo "$as_me: failed program was:" >&5
15611 cat conftest.$ac_ext >&5
15612 cf_result=no
15613 fi
15614 rm -f conftest.$ac_objext conftest.$ac_ext
15615 echo "$as_me:15615: result: $cf_result" >&5
15616 echo "${ECHO_T}$cf_result" >&6
15617 if test $cf_result = yes ; then
15618
15619 cf_result=`echo "have_type_attr_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15620
15621 cat >>confdefs.h <<EOF
15622 #define $cf_result 1
15623 EOF
15624
15625 else
15626
15627 cat >>confdefs.h <<EOF
15628 #define attr_t long
15629 EOF
15630
15631 fi
15632
15633 if test "$cf_enable_widec" = yes; then
15634
15635 # This is needed on Tru64 5.0 to declare mbstate_t
15636 echo "$as_me:15636: checking if we must include wchar.h to declare mbstate_t" >&5
15637 echo $ECHO_N "checking if we must include wchar.h to declare mbstate_t... $ECHO_C" >&6
15638 if test "${cf_cv_mbstate_t+set}" = set; then
15639   echo $ECHO_N "(cached) $ECHO_C" >&6
15640 else
15641
15642 cat >conftest.$ac_ext <<_ACEOF
15643 #line 15643 "configure"
15644 #include "confdefs.h"
15645
15646 #include <stdlib.h>
15647 #include <stdarg.h>
15648 #include <stdio.h>
15649 #ifdef HAVE_LIBUTF8_H
15650 #include <libutf8.h>
15651 #endif
15652 int
15653 main ()
15654 {
15655 mbstate_t state
15656   ;
15657   return 0;
15658 }
15659 _ACEOF
15660 rm -f conftest.$ac_objext
15661 if { (eval echo "$as_me:15661: \"$ac_compile\"") >&5
15662   (eval $ac_compile) 2>&5
15663   ac_status=$?
15664   echo "$as_me:15664: \$? = $ac_status" >&5
15665   (exit $ac_status); } &&
15666          { ac_try='test -s conftest.$ac_objext'
15667   { (eval echo "$as_me:15667: \"$ac_try\"") >&5
15668   (eval $ac_try) 2>&5
15669   ac_status=$?
15670   echo "$as_me:15670: \$? = $ac_status" >&5
15671   (exit $ac_status); }; }; then
15672   cf_cv_mbstate_t=no
15673 else
15674   echo "$as_me: failed program was:" >&5
15675 cat conftest.$ac_ext >&5
15676 cat >conftest.$ac_ext <<_ACEOF
15677 #line 15677 "configure"
15678 #include "confdefs.h"
15679
15680 #include <stdlib.h>
15681 #include <stdarg.h>
15682 #include <stdio.h>
15683 #include <wchar.h>
15684 #ifdef HAVE_LIBUTF8_H
15685 #include <libutf8.h>
15686 #endif
15687 int
15688 main ()
15689 {
15690 mbstate_t value
15691   ;
15692   return 0;
15693 }
15694 _ACEOF
15695 rm -f conftest.$ac_objext
15696 if { (eval echo "$as_me:15696: \"$ac_compile\"") >&5
15697   (eval $ac_compile) 2>&5
15698   ac_status=$?
15699   echo "$as_me:15699: \$? = $ac_status" >&5
15700   (exit $ac_status); } &&
15701          { ac_try='test -s conftest.$ac_objext'
15702   { (eval echo "$as_me:15702: \"$ac_try\"") >&5
15703   (eval $ac_try) 2>&5
15704   ac_status=$?
15705   echo "$as_me:15705: \$? = $ac_status" >&5
15706   (exit $ac_status); }; }; then
15707   cf_cv_mbstate_t=yes
15708 else
15709   echo "$as_me: failed program was:" >&5
15710 cat conftest.$ac_ext >&5
15711 cf_cv_mbstate_t=unknown
15712 fi
15713 rm -f conftest.$ac_objext conftest.$ac_ext
15714 fi
15715 rm -f conftest.$ac_objext conftest.$ac_ext
15716 fi
15717 echo "$as_me:15717: result: $cf_cv_mbstate_t" >&5
15718 echo "${ECHO_T}$cf_cv_mbstate_t" >&6
15719
15720 if test "$cf_cv_mbstate_t" = yes ; then
15721
15722 cat >>confdefs.h <<\EOF
15723 #define NEED_WCHAR_H 1
15724 EOF
15725
15726         NEED_WCHAR_H=1
15727 fi
15728
15729 # if we do not find mbstate_t in either place, use substitution to provide a fallback.
15730 if test "$cf_cv_mbstate_t" = unknown ; then
15731         NCURSES_MBSTATE_T=1
15732 fi
15733
15734 # if we find mbstate_t in either place, use substitution to provide a fallback.
15735 if test "$cf_cv_mbstate_t" != unknown ; then
15736         NCURSES_OK_MBSTATE_T=1
15737 fi
15738
15739 # This is needed on Tru64 5.0 to declare wchar_t
15740 echo "$as_me:15740: checking if we must include wchar.h to declare wchar_t" >&5
15741 echo $ECHO_N "checking if we must include wchar.h to declare wchar_t... $ECHO_C" >&6
15742 if test "${cf_cv_wchar_t+set}" = set; then
15743   echo $ECHO_N "(cached) $ECHO_C" >&6
15744 else
15745
15746 cat >conftest.$ac_ext <<_ACEOF
15747 #line 15747 "configure"
15748 #include "confdefs.h"
15749
15750 #include <stdlib.h>
15751 #include <stdarg.h>
15752 #include <stdio.h>
15753 #ifdef HAVE_LIBUTF8_H
15754 #include <libutf8.h>
15755 #endif
15756 int
15757 main ()
15758 {
15759 wchar_t state
15760   ;
15761   return 0;
15762 }
15763 _ACEOF
15764 rm -f conftest.$ac_objext
15765 if { (eval echo "$as_me:15765: \"$ac_compile\"") >&5
15766   (eval $ac_compile) 2>&5
15767   ac_status=$?
15768   echo "$as_me:15768: \$? = $ac_status" >&5
15769   (exit $ac_status); } &&
15770          { ac_try='test -s conftest.$ac_objext'
15771   { (eval echo "$as_me:15771: \"$ac_try\"") >&5
15772   (eval $ac_try) 2>&5
15773   ac_status=$?
15774   echo "$as_me:15774: \$? = $ac_status" >&5
15775   (exit $ac_status); }; }; then
15776   cf_cv_wchar_t=no
15777 else
15778   echo "$as_me: failed program was:" >&5
15779 cat conftest.$ac_ext >&5
15780 cat >conftest.$ac_ext <<_ACEOF
15781 #line 15781 "configure"
15782 #include "confdefs.h"
15783
15784 #include <stdlib.h>
15785 #include <stdarg.h>
15786 #include <stdio.h>
15787 #include <wchar.h>
15788 #ifdef HAVE_LIBUTF8_H
15789 #include <libutf8.h>
15790 #endif
15791 int
15792 main ()
15793 {
15794 wchar_t value
15795   ;
15796   return 0;
15797 }
15798 _ACEOF
15799 rm -f conftest.$ac_objext
15800 if { (eval echo "$as_me:15800: \"$ac_compile\"") >&5
15801   (eval $ac_compile) 2>&5
15802   ac_status=$?
15803   echo "$as_me:15803: \$? = $ac_status" >&5
15804   (exit $ac_status); } &&
15805          { ac_try='test -s conftest.$ac_objext'
15806   { (eval echo "$as_me:15806: \"$ac_try\"") >&5
15807   (eval $ac_try) 2>&5
15808   ac_status=$?
15809   echo "$as_me:15809: \$? = $ac_status" >&5
15810   (exit $ac_status); }; }; then
15811   cf_cv_wchar_t=yes
15812 else
15813   echo "$as_me: failed program was:" >&5
15814 cat conftest.$ac_ext >&5
15815 cf_cv_wchar_t=unknown
15816 fi
15817 rm -f conftest.$ac_objext conftest.$ac_ext
15818 fi
15819 rm -f conftest.$ac_objext conftest.$ac_ext
15820 fi
15821 echo "$as_me:15821: result: $cf_cv_wchar_t" >&5
15822 echo "${ECHO_T}$cf_cv_wchar_t" >&6
15823
15824 if test "$cf_cv_wchar_t" = yes ; then
15825
15826 cat >>confdefs.h <<\EOF
15827 #define NEED_WCHAR_H 1
15828 EOF
15829
15830         NEED_WCHAR_H=1
15831 fi
15832
15833 # if we do not find wchar_t in either place, use substitution to provide a fallback.
15834 if test "$cf_cv_wchar_t" = unknown ; then
15835         NCURSES_WCHAR_T=1
15836 fi
15837
15838 # if we find wchar_t in either place, use substitution to provide a fallback.
15839 if test "$cf_cv_wchar_t" != unknown ; then
15840         NCURSES_OK_WCHAR_T=1
15841 fi
15842
15843 # This is needed on Tru64 5.0 to declare wint_t
15844 echo "$as_me:15844: checking if we must include wchar.h to declare wint_t" >&5
15845 echo $ECHO_N "checking if we must include wchar.h to declare wint_t... $ECHO_C" >&6
15846 if test "${cf_cv_wint_t+set}" = set; then
15847   echo $ECHO_N "(cached) $ECHO_C" >&6
15848 else
15849
15850 cat >conftest.$ac_ext <<_ACEOF
15851 #line 15851 "configure"
15852 #include "confdefs.h"
15853
15854 #include <stdlib.h>
15855 #include <stdarg.h>
15856 #include <stdio.h>
15857 #ifdef HAVE_LIBUTF8_H
15858 #include <libutf8.h>
15859 #endif
15860 int
15861 main ()
15862 {
15863 wint_t state
15864   ;
15865   return 0;
15866 }
15867 _ACEOF
15868 rm -f conftest.$ac_objext
15869 if { (eval echo "$as_me:15869: \"$ac_compile\"") >&5
15870   (eval $ac_compile) 2>&5
15871   ac_status=$?
15872   echo "$as_me:15872: \$? = $ac_status" >&5
15873   (exit $ac_status); } &&
15874          { ac_try='test -s conftest.$ac_objext'
15875   { (eval echo "$as_me:15875: \"$ac_try\"") >&5
15876   (eval $ac_try) 2>&5
15877   ac_status=$?
15878   echo "$as_me:15878: \$? = $ac_status" >&5
15879   (exit $ac_status); }; }; then
15880   cf_cv_wint_t=no
15881 else
15882   echo "$as_me: failed program was:" >&5
15883 cat conftest.$ac_ext >&5
15884 cat >conftest.$ac_ext <<_ACEOF
15885 #line 15885 "configure"
15886 #include "confdefs.h"
15887
15888 #include <stdlib.h>
15889 #include <stdarg.h>
15890 #include <stdio.h>
15891 #include <wchar.h>
15892 #ifdef HAVE_LIBUTF8_H
15893 #include <libutf8.h>
15894 #endif
15895 int
15896 main ()
15897 {
15898 wint_t value
15899   ;
15900   return 0;
15901 }
15902 _ACEOF
15903 rm -f conftest.$ac_objext
15904 if { (eval echo "$as_me:15904: \"$ac_compile\"") >&5
15905   (eval $ac_compile) 2>&5
15906   ac_status=$?
15907   echo "$as_me:15907: \$? = $ac_status" >&5
15908   (exit $ac_status); } &&
15909          { ac_try='test -s conftest.$ac_objext'
15910   { (eval echo "$as_me:15910: \"$ac_try\"") >&5
15911   (eval $ac_try) 2>&5
15912   ac_status=$?
15913   echo "$as_me:15913: \$? = $ac_status" >&5
15914   (exit $ac_status); }; }; then
15915   cf_cv_wint_t=yes
15916 else
15917   echo "$as_me: failed program was:" >&5
15918 cat conftest.$ac_ext >&5
15919 cf_cv_wint_t=unknown
15920 fi
15921 rm -f conftest.$ac_objext conftest.$ac_ext
15922 fi
15923 rm -f conftest.$ac_objext conftest.$ac_ext
15924 fi
15925 echo "$as_me:15925: result: $cf_cv_wint_t" >&5
15926 echo "${ECHO_T}$cf_cv_wint_t" >&6
15927
15928 if test "$cf_cv_wint_t" = yes ; then
15929
15930 cat >>confdefs.h <<\EOF
15931 #define NEED_WCHAR_H 1
15932 EOF
15933
15934         NEED_WCHAR_H=1
15935 fi
15936
15937 # if we do not find wint_t in either place, use substitution to provide a fallback.
15938 if test "$cf_cv_wint_t" = unknown ; then
15939         NCURSES_WINT_T=1
15940 fi
15941
15942 # if we find wint_t in either place, use substitution to provide a fallback.
15943 if test "$cf_cv_wint_t" != unknown ; then
15944         NCURSES_OK_WINT_T=1
15945 fi
15946
15947         if test "$NCURSES_OK_MBSTATE_T" = 0 ; then
15948
15949 echo "$as_me:15949: checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}" >&5
15950 echo $ECHO_N "checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
15951 cat >conftest.$ac_ext <<_ACEOF
15952 #line 15952 "configure"
15953 #include "confdefs.h"
15954
15955 #ifndef _XOPEN_SOURCE_EXTENDED
15956 #define _XOPEN_SOURCE_EXTENDED
15957 #endif
15958 #include <${cf_cv_ncurses_header:-curses.h}>
15959 int
15960 main ()
15961 {
15962
15963 mbstate_t foo
15964
15965   ;
15966   return 0;
15967 }
15968 _ACEOF
15969 rm -f conftest.$ac_objext
15970 if { (eval echo "$as_me:15970: \"$ac_compile\"") >&5
15971   (eval $ac_compile) 2>&5
15972   ac_status=$?
15973   echo "$as_me:15973: \$? = $ac_status" >&5
15974   (exit $ac_status); } &&
15975          { ac_try='test -s conftest.$ac_objext'
15976   { (eval echo "$as_me:15976: \"$ac_try\"") >&5
15977   (eval $ac_try) 2>&5
15978   ac_status=$?
15979   echo "$as_me:15979: \$? = $ac_status" >&5
15980   (exit $ac_status); }; }; then
15981   cf_result=yes
15982 else
15983   echo "$as_me: failed program was:" >&5
15984 cat conftest.$ac_ext >&5
15985 cf_result=no
15986 fi
15987 rm -f conftest.$ac_objext conftest.$ac_ext
15988 echo "$as_me:15988: result: $cf_result" >&5
15989 echo "${ECHO_T}$cf_result" >&6
15990 if test $cf_result = yes ; then
15991
15992 cf_result=`echo "have_type_mbstate_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15993
15994 cat >>confdefs.h <<EOF
15995 #define $cf_result 1
15996 EOF
15997
15998 else
15999
16000 cat >>confdefs.h <<EOF
16001 #define mbstate_t long
16002 EOF
16003
16004 fi
16005
16006         fi
16007
16008         if test "$NCURSES_OK_WCHAR_T" = 0 ; then
16009
16010 echo "$as_me:16010: checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}" >&5
16011 echo $ECHO_N "checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
16012 cat >conftest.$ac_ext <<_ACEOF
16013 #line 16013 "configure"
16014 #include "confdefs.h"
16015
16016 #ifndef _XOPEN_SOURCE_EXTENDED
16017 #define _XOPEN_SOURCE_EXTENDED
16018 #endif
16019 #include <${cf_cv_ncurses_header:-curses.h}>
16020 int
16021 main ()
16022 {
16023
16024 wchar_t foo
16025
16026   ;
16027   return 0;
16028 }
16029 _ACEOF
16030 rm -f conftest.$ac_objext
16031 if { (eval echo "$as_me:16031: \"$ac_compile\"") >&5
16032   (eval $ac_compile) 2>&5
16033   ac_status=$?
16034   echo "$as_me:16034: \$? = $ac_status" >&5
16035   (exit $ac_status); } &&
16036          { ac_try='test -s conftest.$ac_objext'
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_ext
16049 echo "$as_me:16049: result: $cf_result" >&5
16050 echo "${ECHO_T}$cf_result" >&6
16051 if test $cf_result = yes ; then
16052
16053 cf_result=`echo "have_type_wchar_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16054
16055 cat >>confdefs.h <<EOF
16056 #define $cf_result 1
16057 EOF
16058
16059 else
16060
16061 cat >>confdefs.h <<EOF
16062 #define wchar_t long
16063 EOF
16064
16065 fi
16066
16067         fi
16068
16069         if test "$NCURSES_OK_WINT_T" = 0 ; then
16070
16071 echo "$as_me:16071: checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}" >&5
16072 echo $ECHO_N "checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
16073 cat >conftest.$ac_ext <<_ACEOF
16074 #line 16074 "configure"
16075 #include "confdefs.h"
16076
16077 #ifndef _XOPEN_SOURCE_EXTENDED
16078 #define _XOPEN_SOURCE_EXTENDED
16079 #endif
16080 #include <${cf_cv_ncurses_header:-curses.h}>
16081 int
16082 main ()
16083 {
16084
16085 wint_t foo
16086
16087   ;
16088   return 0;
16089 }
16090 _ACEOF
16091 rm -f conftest.$ac_objext
16092 if { (eval echo "$as_me:16092: \"$ac_compile\"") >&5
16093   (eval $ac_compile) 2>&5
16094   ac_status=$?
16095   echo "$as_me:16095: \$? = $ac_status" >&5
16096   (exit $ac_status); } &&
16097          { ac_try='test -s conftest.$ac_objext'
16098   { (eval echo "$as_me:16098: \"$ac_try\"") >&5
16099   (eval $ac_try) 2>&5
16100   ac_status=$?
16101   echo "$as_me:16101: \$? = $ac_status" >&5
16102   (exit $ac_status); }; }; then
16103   cf_result=yes
16104 else
16105   echo "$as_me: failed program was:" >&5
16106 cat conftest.$ac_ext >&5
16107 cf_result=no
16108 fi
16109 rm -f conftest.$ac_objext conftest.$ac_ext
16110 echo "$as_me:16110: result: $cf_result" >&5
16111 echo "${ECHO_T}$cf_result" >&6
16112 if test $cf_result = yes ; then
16113
16114 cf_result=`echo "have_type_wint_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16115
16116 cat >>confdefs.h <<EOF
16117 #define $cf_result 1
16118 EOF
16119
16120 else
16121
16122 cat >>confdefs.h <<EOF
16123 #define wint_t long
16124 EOF
16125
16126 fi
16127
16128         fi
16129 fi
16130
16131 echo "$as_me:16131: checking for data ospeed declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
16132 echo $ECHO_N "checking for data ospeed declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
16133
16134 cat >conftest.$ac_ext <<_ACEOF
16135 #line 16135 "configure"
16136 #include "confdefs.h"
16137
16138 #ifdef HAVE_XCURSES
16139 #include <xcurses.h>
16140 char * XCursesProgramName = "test";
16141 #else
16142 #include <${cf_cv_ncurses_header:-curses.h}>
16143 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16144 #include <ncursesw/term.h>
16145 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16146 #include <ncurses/term.h>
16147 #elif defined(HAVE_TERM_H)
16148 #include <term.h>
16149 #endif
16150 #endif
16151
16152 int
16153 main ()
16154 {
16155
16156 void *foo = &(ospeed)
16157
16158   ;
16159   return 0;
16160 }
16161 _ACEOF
16162 rm -f conftest.$ac_objext
16163 if { (eval echo "$as_me:16163: \"$ac_compile\"") >&5
16164   (eval $ac_compile) 2>&5
16165   ac_status=$?
16166   echo "$as_me:16166: \$? = $ac_status" >&5
16167   (exit $ac_status); } &&
16168          { ac_try='test -s conftest.$ac_objext'
16169   { (eval echo "$as_me:16169: \"$ac_try\"") >&5
16170   (eval $ac_try) 2>&5
16171   ac_status=$?
16172   echo "$as_me:16172: \$? = $ac_status" >&5
16173   (exit $ac_status); }; }; then
16174   cf_result=yes
16175 else
16176   echo "$as_me: failed program was:" >&5
16177 cat conftest.$ac_ext >&5
16178 cf_result=no
16179 fi
16180 rm -f conftest.$ac_objext conftest.$ac_ext
16181 echo "$as_me:16181: result: $cf_result" >&5
16182 echo "${ECHO_T}$cf_result" >&6
16183
16184 if test $cf_result = yes ; then
16185
16186 cf_result=`echo "have_curses_data_ospeed" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16187
16188         cat >>confdefs.h <<EOF
16189 #define $cf_result 1
16190 EOF
16191
16192 else
16193         echo "$as_me:16193: checking for data ospeed in library" >&5
16194 echo $ECHO_N "checking for data ospeed in library... $ECHO_C" >&6
16195         # BSD linkers insist on making weak linkage, but resolve at runtime.
16196         if test "$cross_compiling" = yes; then
16197
16198         # cross-compiling
16199         cat >conftest.$ac_ext <<_ACEOF
16200 #line 16200 "configure"
16201 #include "confdefs.h"
16202
16203 #ifdef HAVE_XCURSES
16204 #include <xcurses.h>
16205 char * XCursesProgramName = "test";
16206 #else
16207 #include <${cf_cv_ncurses_header:-curses.h}>
16208 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16209 #include <ncursesw/term.h>
16210 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16211 #include <ncurses/term.h>
16212 #elif defined(HAVE_TERM_H)
16213 #include <term.h>
16214 #endif
16215 #endif
16216
16217 extern char ospeed;
16218 int
16219 main ()
16220 {
16221
16222         do {
16223                 void *foo = &(ospeed);
16224                 fprintf(stderr, "testing linkage of ospeed:%p\n", foo);
16225                 ${cf_cv_main_return:-return}(foo == 0);
16226         } while (0)
16227
16228   ;
16229   return 0;
16230 }
16231 _ACEOF
16232 rm -f conftest.$ac_objext conftest$ac_exeext
16233 if { (eval echo "$as_me:16233: \"$ac_link\"") >&5
16234   (eval $ac_link) 2>&5
16235   ac_status=$?
16236   echo "$as_me:16236: \$? = $ac_status" >&5
16237   (exit $ac_status); } &&
16238          { ac_try='test -s conftest$ac_exeext'
16239   { (eval echo "$as_me:16239: \"$ac_try\"") >&5
16240   (eval $ac_try) 2>&5
16241   ac_status=$?
16242   echo "$as_me:16242: \$? = $ac_status" >&5
16243   (exit $ac_status); }; }; then
16244   cf_result=yes
16245 else
16246   echo "$as_me: failed program was:" >&5
16247 cat conftest.$ac_ext >&5
16248 cf_result=no
16249 fi
16250 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16251
16252 else
16253   cat >conftest.$ac_ext <<_ACEOF
16254 #line 16254 "configure"
16255 #include "confdefs.h"
16256
16257 #ifdef HAVE_XCURSES
16258 #include <xcurses.h>
16259 char * XCursesProgramName = "test";
16260 #else
16261 #include <${cf_cv_ncurses_header:-curses.h}>
16262 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16263 #include <ncursesw/term.h>
16264 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16265 #include <ncurses/term.h>
16266 #elif defined(HAVE_TERM_H)
16267 #include <term.h>
16268 #endif
16269 #endif
16270
16271 extern char ospeed;
16272 int main(void)
16273 {
16274         void *foo = &(ospeed);
16275         fprintf(stderr, "testing linkage of ospeed:%p\n", foo);
16276         ${cf_cv_main_return:-return}(foo == 0);
16277 }
16278 _ACEOF
16279 rm -f conftest$ac_exeext
16280 if { (eval echo "$as_me:16280: \"$ac_link\"") >&5
16281   (eval $ac_link) 2>&5
16282   ac_status=$?
16283   echo "$as_me:16283: \$? = $ac_status" >&5
16284   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
16285   { (eval echo "$as_me:16285: \"$ac_try\"") >&5
16286   (eval $ac_try) 2>&5
16287   ac_status=$?
16288   echo "$as_me:16288: \$? = $ac_status" >&5
16289   (exit $ac_status); }; }; then
16290   cf_result=yes
16291 else
16292   echo "$as_me: program exited with status $ac_status" >&5
16293 echo "$as_me: failed program was:" >&5
16294 cat conftest.$ac_ext >&5
16295 cf_result=no
16296 fi
16297 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
16298 fi
16299         echo "$as_me:16299: result: $cf_result" >&5
16300 echo "${ECHO_T}$cf_result" >&6
16301         if test $cf_result = yes ; then
16302
16303 cf_result=`echo "decl_curses_data_ospeed" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16304
16305                 cat >>confdefs.h <<EOF
16306 #define $cf_result 1
16307 EOF
16308
16309         fi
16310 fi
16311
16312 echo "$as_me:16312: checking for data boolnames declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
16313 echo $ECHO_N "checking for data boolnames declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
16314
16315 cat >conftest.$ac_ext <<_ACEOF
16316 #line 16316 "configure"
16317 #include "confdefs.h"
16318
16319 #ifdef HAVE_XCURSES
16320 #include <xcurses.h>
16321 char * XCursesProgramName = "test";
16322 #else
16323 #include <${cf_cv_ncurses_header:-curses.h}>
16324 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16325 #include <ncursesw/term.h>
16326 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16327 #include <ncurses/term.h>
16328 #elif defined(HAVE_TERM_H)
16329 #include <term.h>
16330 #endif
16331 #endif
16332
16333 int
16334 main ()
16335 {
16336
16337 void *foo = &(boolnames)
16338
16339   ;
16340   return 0;
16341 }
16342 _ACEOF
16343 rm -f conftest.$ac_objext
16344 if { (eval echo "$as_me:16344: \"$ac_compile\"") >&5
16345   (eval $ac_compile) 2>&5
16346   ac_status=$?
16347   echo "$as_me:16347: \$? = $ac_status" >&5
16348   (exit $ac_status); } &&
16349          { ac_try='test -s conftest.$ac_objext'
16350   { (eval echo "$as_me:16350: \"$ac_try\"") >&5
16351   (eval $ac_try) 2>&5
16352   ac_status=$?
16353   echo "$as_me:16353: \$? = $ac_status" >&5
16354   (exit $ac_status); }; }; then
16355   cf_result=yes
16356 else
16357   echo "$as_me: failed program was:" >&5
16358 cat conftest.$ac_ext >&5
16359 cf_result=no
16360 fi
16361 rm -f conftest.$ac_objext conftest.$ac_ext
16362 echo "$as_me:16362: result: $cf_result" >&5
16363 echo "${ECHO_T}$cf_result" >&6
16364
16365 if test $cf_result = yes ; then
16366
16367 cf_result=`echo "have_curses_data_boolnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16368
16369         cat >>confdefs.h <<EOF
16370 #define $cf_result 1
16371 EOF
16372
16373 else
16374         echo "$as_me:16374: checking for data boolnames in library" >&5
16375 echo $ECHO_N "checking for data boolnames in library... $ECHO_C" >&6
16376         # BSD linkers insist on making weak linkage, but resolve at runtime.
16377         if test "$cross_compiling" = yes; then
16378
16379         # cross-compiling
16380         cat >conftest.$ac_ext <<_ACEOF
16381 #line 16381 "configure"
16382 #include "confdefs.h"
16383
16384 #ifdef HAVE_XCURSES
16385 #include <xcurses.h>
16386 char * XCursesProgramName = "test";
16387 #else
16388 #include <${cf_cv_ncurses_header:-curses.h}>
16389 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16390 #include <ncursesw/term.h>
16391 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16392 #include <ncurses/term.h>
16393 #elif defined(HAVE_TERM_H)
16394 #include <term.h>
16395 #endif
16396 #endif
16397
16398 extern char boolnames;
16399 int
16400 main ()
16401 {
16402
16403         do {
16404                 void *foo = &(boolnames);
16405                 fprintf(stderr, "testing linkage of boolnames:%p\n", foo);
16406                 ${cf_cv_main_return:-return}(foo == 0);
16407         } while (0)
16408
16409   ;
16410   return 0;
16411 }
16412 _ACEOF
16413 rm -f conftest.$ac_objext conftest$ac_exeext
16414 if { (eval echo "$as_me:16414: \"$ac_link\"") >&5
16415   (eval $ac_link) 2>&5
16416   ac_status=$?
16417   echo "$as_me:16417: \$? = $ac_status" >&5
16418   (exit $ac_status); } &&
16419          { ac_try='test -s conftest$ac_exeext'
16420   { (eval echo "$as_me:16420: \"$ac_try\"") >&5
16421   (eval $ac_try) 2>&5
16422   ac_status=$?
16423   echo "$as_me:16423: \$? = $ac_status" >&5
16424   (exit $ac_status); }; }; then
16425   cf_result=yes
16426 else
16427   echo "$as_me: failed program was:" >&5
16428 cat conftest.$ac_ext >&5
16429 cf_result=no
16430 fi
16431 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16432
16433 else
16434   cat >conftest.$ac_ext <<_ACEOF
16435 #line 16435 "configure"
16436 #include "confdefs.h"
16437
16438 #ifdef HAVE_XCURSES
16439 #include <xcurses.h>
16440 char * XCursesProgramName = "test";
16441 #else
16442 #include <${cf_cv_ncurses_header:-curses.h}>
16443 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16444 #include <ncursesw/term.h>
16445 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16446 #include <ncurses/term.h>
16447 #elif defined(HAVE_TERM_H)
16448 #include <term.h>
16449 #endif
16450 #endif
16451
16452 extern char boolnames;
16453 int main(void)
16454 {
16455         void *foo = &(boolnames);
16456         fprintf(stderr, "testing linkage of boolnames:%p\n", foo);
16457         ${cf_cv_main_return:-return}(foo == 0);
16458 }
16459 _ACEOF
16460 rm -f conftest$ac_exeext
16461 if { (eval echo "$as_me:16461: \"$ac_link\"") >&5
16462   (eval $ac_link) 2>&5
16463   ac_status=$?
16464   echo "$as_me:16464: \$? = $ac_status" >&5
16465   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
16466   { (eval echo "$as_me:16466: \"$ac_try\"") >&5
16467   (eval $ac_try) 2>&5
16468   ac_status=$?
16469   echo "$as_me:16469: \$? = $ac_status" >&5
16470   (exit $ac_status); }; }; then
16471   cf_result=yes
16472 else
16473   echo "$as_me: program exited with status $ac_status" >&5
16474 echo "$as_me: failed program was:" >&5
16475 cat conftest.$ac_ext >&5
16476 cf_result=no
16477 fi
16478 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
16479 fi
16480         echo "$as_me:16480: result: $cf_result" >&5
16481 echo "${ECHO_T}$cf_result" >&6
16482         if test $cf_result = yes ; then
16483
16484 cf_result=`echo "decl_curses_data_boolnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16485
16486                 cat >>confdefs.h <<EOF
16487 #define $cf_result 1
16488 EOF
16489
16490         fi
16491 fi
16492
16493 echo "$as_me:16493: checking for data boolfnames declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
16494 echo $ECHO_N "checking for data boolfnames declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
16495
16496 cat >conftest.$ac_ext <<_ACEOF
16497 #line 16497 "configure"
16498 #include "confdefs.h"
16499
16500 #ifdef HAVE_XCURSES
16501 #include <xcurses.h>
16502 char * XCursesProgramName = "test";
16503 #else
16504 #include <${cf_cv_ncurses_header:-curses.h}>
16505 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16506 #include <ncursesw/term.h>
16507 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16508 #include <ncurses/term.h>
16509 #elif defined(HAVE_TERM_H)
16510 #include <term.h>
16511 #endif
16512 #endif
16513
16514 int
16515 main ()
16516 {
16517
16518 void *foo = &(boolfnames)
16519
16520   ;
16521   return 0;
16522 }
16523 _ACEOF
16524 rm -f conftest.$ac_objext
16525 if { (eval echo "$as_me:16525: \"$ac_compile\"") >&5
16526   (eval $ac_compile) 2>&5
16527   ac_status=$?
16528   echo "$as_me:16528: \$? = $ac_status" >&5
16529   (exit $ac_status); } &&
16530          { ac_try='test -s conftest.$ac_objext'
16531   { (eval echo "$as_me:16531: \"$ac_try\"") >&5
16532   (eval $ac_try) 2>&5
16533   ac_status=$?
16534   echo "$as_me:16534: \$? = $ac_status" >&5
16535   (exit $ac_status); }; }; then
16536   cf_result=yes
16537 else
16538   echo "$as_me: failed program was:" >&5
16539 cat conftest.$ac_ext >&5
16540 cf_result=no
16541 fi
16542 rm -f conftest.$ac_objext conftest.$ac_ext
16543 echo "$as_me:16543: result: $cf_result" >&5
16544 echo "${ECHO_T}$cf_result" >&6
16545
16546 if test $cf_result = yes ; then
16547
16548 cf_result=`echo "have_curses_data_boolfnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16549
16550         cat >>confdefs.h <<EOF
16551 #define $cf_result 1
16552 EOF
16553
16554 else
16555         echo "$as_me:16555: checking for data boolfnames in library" >&5
16556 echo $ECHO_N "checking for data boolfnames in library... $ECHO_C" >&6
16557         # BSD linkers insist on making weak linkage, but resolve at runtime.
16558         if test "$cross_compiling" = yes; then
16559
16560         # cross-compiling
16561         cat >conftest.$ac_ext <<_ACEOF
16562 #line 16562 "configure"
16563 #include "confdefs.h"
16564
16565 #ifdef HAVE_XCURSES
16566 #include <xcurses.h>
16567 char * XCursesProgramName = "test";
16568 #else
16569 #include <${cf_cv_ncurses_header:-curses.h}>
16570 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16571 #include <ncursesw/term.h>
16572 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16573 #include <ncurses/term.h>
16574 #elif defined(HAVE_TERM_H)
16575 #include <term.h>
16576 #endif
16577 #endif
16578
16579 extern char boolfnames;
16580 int
16581 main ()
16582 {
16583
16584         do {
16585                 void *foo = &(boolfnames);
16586                 fprintf(stderr, "testing linkage of boolfnames:%p\n", foo);
16587                 ${cf_cv_main_return:-return}(foo == 0);
16588         } while (0)
16589
16590   ;
16591   return 0;
16592 }
16593 _ACEOF
16594 rm -f conftest.$ac_objext conftest$ac_exeext
16595 if { (eval echo "$as_me:16595: \"$ac_link\"") >&5
16596   (eval $ac_link) 2>&5
16597   ac_status=$?
16598   echo "$as_me:16598: \$? = $ac_status" >&5
16599   (exit $ac_status); } &&
16600          { ac_try='test -s conftest$ac_exeext'
16601   { (eval echo "$as_me:16601: \"$ac_try\"") >&5
16602   (eval $ac_try) 2>&5
16603   ac_status=$?
16604   echo "$as_me:16604: \$? = $ac_status" >&5
16605   (exit $ac_status); }; }; then
16606   cf_result=yes
16607 else
16608   echo "$as_me: failed program was:" >&5
16609 cat conftest.$ac_ext >&5
16610 cf_result=no
16611 fi
16612 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16613
16614 else
16615   cat >conftest.$ac_ext <<_ACEOF
16616 #line 16616 "configure"
16617 #include "confdefs.h"
16618
16619 #ifdef HAVE_XCURSES
16620 #include <xcurses.h>
16621 char * XCursesProgramName = "test";
16622 #else
16623 #include <${cf_cv_ncurses_header:-curses.h}>
16624 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16625 #include <ncursesw/term.h>
16626 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16627 #include <ncurses/term.h>
16628 #elif defined(HAVE_TERM_H)
16629 #include <term.h>
16630 #endif
16631 #endif
16632
16633 extern char boolfnames;
16634 int main(void)
16635 {
16636         void *foo = &(boolfnames);
16637         fprintf(stderr, "testing linkage of boolfnames:%p\n", foo);
16638         ${cf_cv_main_return:-return}(foo == 0);
16639 }
16640 _ACEOF
16641 rm -f conftest$ac_exeext
16642 if { (eval echo "$as_me:16642: \"$ac_link\"") >&5
16643   (eval $ac_link) 2>&5
16644   ac_status=$?
16645   echo "$as_me:16645: \$? = $ac_status" >&5
16646   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
16647   { (eval echo "$as_me:16647: \"$ac_try\"") >&5
16648   (eval $ac_try) 2>&5
16649   ac_status=$?
16650   echo "$as_me:16650: \$? = $ac_status" >&5
16651   (exit $ac_status); }; }; then
16652   cf_result=yes
16653 else
16654   echo "$as_me: program exited with status $ac_status" >&5
16655 echo "$as_me: failed program was:" >&5
16656 cat conftest.$ac_ext >&5
16657 cf_result=no
16658 fi
16659 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
16660 fi
16661         echo "$as_me:16661: result: $cf_result" >&5
16662 echo "${ECHO_T}$cf_result" >&6
16663         if test $cf_result = yes ; then
16664
16665 cf_result=`echo "decl_curses_data_boolfnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16666
16667                 cat >>confdefs.h <<EOF
16668 #define $cf_result 1
16669 EOF
16670
16671         fi
16672 fi
16673
16674 if ( test "$GCC" = yes || test "$GXX" = yes )
16675 then
16676 echo "$as_me:16676: checking if you want to turn on gcc warnings" >&5
16677 echo $ECHO_N "checking if you want to turn on gcc warnings... $ECHO_C" >&6
16678
16679 # Check whether --enable-warnings or --disable-warnings was given.
16680 if test "${enable_warnings+set}" = set; then
16681   enableval="$enable_warnings"
16682   test "$enableval" != yes && enableval=no
16683         if test "$enableval" != "no" ; then
16684     with_warnings=yes
16685         else
16686                 with_warnings=no
16687         fi
16688 else
16689   enableval=no
16690         with_warnings=no
16691
16692 fi;
16693 echo "$as_me:16693: result: $with_warnings" >&5
16694 echo "${ECHO_T}$with_warnings" >&6
16695 if test "$with_warnings" = "yes"
16696 then
16697
16698 if test "$GCC" = yes
16699 then
16700 cat > conftest.i <<EOF
16701 #ifndef GCC_PRINTF
16702 #define GCC_PRINTF 0
16703 #endif
16704 #ifndef GCC_SCANF
16705 #define GCC_SCANF 0
16706 #endif
16707 #ifndef GCC_NORETURN
16708 #define GCC_NORETURN /* nothing */
16709 #endif
16710 #ifndef GCC_UNUSED
16711 #define GCC_UNUSED /* nothing */
16712 #endif
16713 EOF
16714 if test "$GCC" = yes
16715 then
16716         { echo "$as_me:16716: checking for $CC __attribute__ directives..." >&5
16717 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
16718 cat > conftest.$ac_ext <<EOF
16719 #line 16719 "${as_me:-configure}"
16720 #include "confdefs.h"
16721 #include "conftest.h"
16722 #include "conftest.i"
16723 #if     GCC_PRINTF
16724 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
16725 #else
16726 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
16727 #endif
16728 #if     GCC_SCANF
16729 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
16730 #else
16731 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
16732 #endif
16733 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
16734 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
16735 extern void foo(void) GCC_NORETURN;
16736 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
16737 EOF
16738         cf_printf_attribute=no
16739         cf_scanf_attribute=no
16740         for cf_attribute in scanf printf unused noreturn
16741         do
16742
16743 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16744
16745                 cf_directive="__attribute__(($cf_attribute))"
16746                 echo "checking for $CC $cf_directive" 1>&5
16747
16748                 case $cf_attribute in
16749                 (printf)
16750                         cf_printf_attribute=yes
16751                         cat >conftest.h <<EOF
16752 #define GCC_$cf_ATTRIBUTE 1
16753 EOF
16754                         ;;
16755                 (scanf)
16756                         cf_scanf_attribute=yes
16757                         cat >conftest.h <<EOF
16758 #define GCC_$cf_ATTRIBUTE 1
16759 EOF
16760                         ;;
16761                 (*)
16762                         cat >conftest.h <<EOF
16763 #define GCC_$cf_ATTRIBUTE $cf_directive
16764 EOF
16765                         ;;
16766                 esac
16767
16768                 if { (eval echo "$as_me:16768: \"$ac_compile\"") >&5
16769   (eval $ac_compile) 2>&5
16770   ac_status=$?
16771   echo "$as_me:16771: \$? = $ac_status" >&5
16772   (exit $ac_status); }; then
16773                         test -n "$verbose" && echo "$as_me:16773: result: ... $cf_attribute" >&5
16774 echo "${ECHO_T}... $cf_attribute" >&6
16775                         cat conftest.h >>confdefs.h
16776                         case $cf_attribute in
16777                         (noreturn)
16778
16779 cat >>confdefs.h <<EOF
16780 #define GCC_NORETURN $cf_directive
16781 EOF
16782
16783                                 ;;
16784                         (printf)
16785                                 cf_value='/* nothing */'
16786                                 if test "$cf_printf_attribute" != no ; then
16787                                         cf_value='__attribute__((format(printf,fmt,var)))'
16788
16789 cat >>confdefs.h <<\EOF
16790 #define GCC_PRINTF 1
16791 EOF
16792
16793                                 fi
16794
16795 cat >>confdefs.h <<EOF
16796 #define GCC_PRINTFLIKE(fmt,var) $cf_value
16797 EOF
16798
16799                                 ;;
16800                         (scanf)
16801                                 cf_value='/* nothing */'
16802                                 if test "$cf_scanf_attribute" != no ; then
16803                                         cf_value='__attribute__((format(scanf,fmt,var)))'
16804
16805 cat >>confdefs.h <<\EOF
16806 #define GCC_SCANF 1
16807 EOF
16808
16809                                 fi
16810
16811 cat >>confdefs.h <<EOF
16812 #define GCC_SCANFLIKE(fmt,var) $cf_value
16813 EOF
16814
16815                                 ;;
16816                         (unused)
16817
16818 cat >>confdefs.h <<EOF
16819 #define GCC_UNUSED $cf_directive
16820 EOF
16821
16822                                 ;;
16823                         esac
16824                 fi
16825         done
16826 else
16827         fgrep define conftest.i >>confdefs.h
16828 fi
16829 rm -rf conftest*
16830 fi
16831
16832 INTEL_COMPILER=no
16833
16834 if test "$GCC" = yes ; then
16835         case $host_os in
16836         (linux*|gnu*)
16837                 echo "$as_me:16837: checking if this is really Intel C compiler" >&5
16838 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
16839                 cf_save_CFLAGS="$CFLAGS"
16840                 CFLAGS="$CFLAGS -no-gcc"
16841                 cat >conftest.$ac_ext <<_ACEOF
16842 #line 16842 "configure"
16843 #include "confdefs.h"
16844
16845 int
16846 main ()
16847 {
16848
16849 #ifdef __INTEL_COMPILER
16850 #else
16851 make an error
16852 #endif
16853
16854   ;
16855   return 0;
16856 }
16857 _ACEOF
16858 rm -f conftest.$ac_objext
16859 if { (eval echo "$as_me:16859: \"$ac_compile\"") >&5
16860   (eval $ac_compile) 2>&5
16861   ac_status=$?
16862   echo "$as_me:16862: \$? = $ac_status" >&5
16863   (exit $ac_status); } &&
16864          { ac_try='test -s conftest.$ac_objext'
16865   { (eval echo "$as_me:16865: \"$ac_try\"") >&5
16866   (eval $ac_try) 2>&5
16867   ac_status=$?
16868   echo "$as_me:16868: \$? = $ac_status" >&5
16869   (exit $ac_status); }; }; then
16870   INTEL_COMPILER=yes
16871 cf_save_CFLAGS="$cf_save_CFLAGS -we147"
16872
16873 else
16874   echo "$as_me: failed program was:" >&5
16875 cat conftest.$ac_ext >&5
16876 fi
16877 rm -f conftest.$ac_objext conftest.$ac_ext
16878                 CFLAGS="$cf_save_CFLAGS"
16879                 echo "$as_me:16879: result: $INTEL_COMPILER" >&5
16880 echo "${ECHO_T}$INTEL_COMPILER" >&6
16881                 ;;
16882         esac
16883 fi
16884
16885 CLANG_COMPILER=no
16886
16887 if test "$GCC" = yes ; then
16888         echo "$as_me:16888: checking if this is really Clang C compiler" >&5
16889 echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6
16890         cf_save_CFLAGS="$CFLAGS"
16891         CFLAGS="$CFLAGS -Qunused-arguments"
16892         cat >conftest.$ac_ext <<_ACEOF
16893 #line 16893 "configure"
16894 #include "confdefs.h"
16895
16896 int
16897 main ()
16898 {
16899
16900 #ifdef __clang__
16901 #else
16902 make an error
16903 #endif
16904
16905   ;
16906   return 0;
16907 }
16908 _ACEOF
16909 rm -f conftest.$ac_objext
16910 if { (eval echo "$as_me:16910: \"$ac_compile\"") >&5
16911   (eval $ac_compile) 2>&5
16912   ac_status=$?
16913   echo "$as_me:16913: \$? = $ac_status" >&5
16914   (exit $ac_status); } &&
16915          { ac_try='test -s conftest.$ac_objext'
16916   { (eval echo "$as_me:16916: \"$ac_try\"") >&5
16917   (eval $ac_try) 2>&5
16918   ac_status=$?
16919   echo "$as_me:16919: \$? = $ac_status" >&5
16920   (exit $ac_status); }; }; then
16921   CLANG_COMPILER=yes
16922 cf_save_CFLAGS="$cf_save_CFLAGS -Qunused-arguments"
16923
16924 else
16925   echo "$as_me: failed program was:" >&5
16926 cat conftest.$ac_ext >&5
16927 fi
16928 rm -f conftest.$ac_objext conftest.$ac_ext
16929         CFLAGS="$cf_save_CFLAGS"
16930         echo "$as_me:16930: result: $CLANG_COMPILER" >&5
16931 echo "${ECHO_T}$CLANG_COMPILER" >&6
16932 fi
16933
16934 cat > conftest.$ac_ext <<EOF
16935 #line 16935 "${as_me:-configure}"
16936 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
16937 EOF
16938
16939 if test "$INTEL_COMPILER" = yes
16940 then
16941 # The "-wdXXX" options suppress warnings:
16942 # remark #1419: external declaration in primary source file
16943 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
16944 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
16945 # remark #193: zero used for undefined preprocessing identifier
16946 # remark #593: variable "curs_sb_left_arrow" was set but never used
16947 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
16948 # remark #869: parameter "tw" was never referenced
16949 # remark #981: operands are evaluated in unspecified order
16950 # warning #279: controlling expression is constant
16951
16952         { echo "$as_me:16952: checking for $CC warning options..." >&5
16953 echo "$as_me: checking for $CC warning options..." >&6;}
16954         cf_save_CFLAGS="$CFLAGS"
16955         EXTRA_CFLAGS="-Wall"
16956         for cf_opt in \
16957                 wd1419 \
16958                 wd1683 \
16959                 wd1684 \
16960                 wd193 \
16961                 wd593 \
16962                 wd279 \
16963                 wd810 \
16964                 wd869 \
16965                 wd981
16966         do
16967                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
16968                 if { (eval echo "$as_me:16968: \"$ac_compile\"") >&5
16969   (eval $ac_compile) 2>&5
16970   ac_status=$?
16971   echo "$as_me:16971: \$? = $ac_status" >&5
16972   (exit $ac_status); }; then
16973                         test -n "$verbose" && echo "$as_me:16973: result: ... -$cf_opt" >&5
16974 echo "${ECHO_T}... -$cf_opt" >&6
16975                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
16976                 fi
16977         done
16978         CFLAGS="$cf_save_CFLAGS"
16979
16980 elif test "$GCC" = yes
16981 then
16982         { echo "$as_me:16982: checking for $CC warning options..." >&5
16983 echo "$as_me: checking for $CC warning options..." >&6;}
16984         cf_save_CFLAGS="$CFLAGS"
16985         EXTRA_CFLAGS=
16986         cf_warn_CONST=""
16987         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
16988         cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
16989         test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
16990         for cf_opt in W Wall \
16991                 Wbad-function-cast \
16992                 Wcast-align \
16993                 Wcast-qual \
16994                 Wdeclaration-after-statement \
16995                 Wextra \
16996                 Winline \
16997                 Wmissing-declarations \
16998                 Wmissing-prototypes \
16999                 Wnested-externs \
17000                 Wpointer-arith \
17001                 Wshadow \
17002                 Wstrict-prototypes \
17003                 Wundef $cf_gcc_warnings $cf_warn_CONST
17004         do
17005                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
17006                 if { (eval echo "$as_me:17006: \"$ac_compile\"") >&5
17007   (eval $ac_compile) 2>&5
17008   ac_status=$?
17009   echo "$as_me:17009: \$? = $ac_status" >&5
17010   (exit $ac_status); }; then
17011                         test -n "$verbose" && echo "$as_me:17011: result: ... -$cf_opt" >&5
17012 echo "${ECHO_T}... -$cf_opt" >&6
17013                         case $cf_opt in
17014                         (Wcast-qual)
17015                                 CPPFLAGS="$CPPFLAGS -DXTSTRINGDEFINES"
17016                                 ;;
17017                         (Winline)
17018                                 case $GCC_VERSION in
17019                                 ([34].*)
17020                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
17021
17022 echo "${as_me:-configure}:17022: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
17023
17024                                         continue;;
17025                                 esac
17026                                 ;;
17027                         (Wpointer-arith)
17028                                 case $GCC_VERSION in
17029                                 ([12].*)
17030                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
17031
17032 echo "${as_me:-configure}:17032: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
17033
17034                                         continue;;
17035                                 esac
17036                                 ;;
17037                         esac
17038                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
17039                 fi
17040         done
17041         CFLAGS="$cf_save_CFLAGS"
17042 fi
17043 rm -rf conftest*
17044
17045 fi
17046 fi
17047
17048 echo "$as_me:17048: checking if you want to use dmalloc for testing" >&5
17049 echo $ECHO_N "checking if you want to use dmalloc for testing... $ECHO_C" >&6
17050
17051 # Check whether --with-dmalloc or --without-dmalloc was given.
17052 if test "${with_dmalloc+set}" = set; then
17053   withval="$with_dmalloc"
17054
17055 cat >>confdefs.h <<EOF
17056 #define USE_DMALLOC 1
17057 EOF
17058
17059         : ${with_cflags:=-g}
17060         : ${with_no_leaks:=yes}
17061          with_dmalloc=yes
17062 else
17063   with_dmalloc=
17064 fi;
17065 echo "$as_me:17065: result: ${with_dmalloc:-no}" >&5
17066 echo "${ECHO_T}${with_dmalloc:-no}" >&6
17067
17068 case .$with_cflags in
17069 (.*-g*)
17070         case .$CFLAGS in
17071         (.*-g*)
17072                 ;;
17073         (*)
17074
17075 cf_fix_cppflags=no
17076 cf_new_cflags=
17077 cf_new_cppflags=
17078 cf_new_extra_cppflags=
17079
17080 for cf_add_cflags in -g
17081 do
17082 case $cf_fix_cppflags in
17083 (no)
17084         case $cf_add_cflags in
17085         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
17086                 case $cf_add_cflags in
17087                 (-D*)
17088                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
17089
17090                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17091                                 && test -z "${cf_tst_cflags}" \
17092                                 && cf_fix_cppflags=yes
17093
17094                         if test $cf_fix_cppflags = yes ; then
17095                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
17096                                 continue
17097                         elif test "${cf_tst_cflags}" = "\"'" ; then
17098                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
17099                                 continue
17100                         fi
17101                         ;;
17102                 esac
17103                 case "$CPPFLAGS" in
17104                 (*$cf_add_cflags)
17105                         ;;
17106                 (*)
17107                         case $cf_add_cflags in
17108                         (-D*)
17109                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
17110
17111 CPPFLAGS=`echo "$CPPFLAGS" | \
17112         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
17113                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
17114
17115                                 ;;
17116                         esac
17117                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
17118                         ;;
17119                 esac
17120                 ;;
17121         (*)
17122                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
17123                 ;;
17124         esac
17125         ;;
17126 (yes)
17127         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
17128
17129         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
17130
17131         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17132                 && test -z "${cf_tst_cflags}" \
17133                 && cf_fix_cppflags=no
17134         ;;
17135 esac
17136 done
17137
17138 if test -n "$cf_new_cflags" ; then
17139
17140         CFLAGS="$CFLAGS $cf_new_cflags"
17141 fi
17142
17143 if test -n "$cf_new_cppflags" ; then
17144
17145         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
17146 fi
17147
17148 if test -n "$cf_new_extra_cppflags" ; then
17149
17150         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
17151 fi
17152
17153                 ;;
17154         esac
17155         ;;
17156 esac
17157
17158 if test "$with_dmalloc" = yes ; then
17159         echo "$as_me:17159: checking for dmalloc.h" >&5
17160 echo $ECHO_N "checking for dmalloc.h... $ECHO_C" >&6
17161 if test "${ac_cv_header_dmalloc_h+set}" = set; then
17162   echo $ECHO_N "(cached) $ECHO_C" >&6
17163 else
17164   cat >conftest.$ac_ext <<_ACEOF
17165 #line 17165 "configure"
17166 #include "confdefs.h"
17167 #include <dmalloc.h>
17168 _ACEOF
17169 if { (eval echo "$as_me:17169: \"$ac_cpp conftest.$ac_ext\"") >&5
17170   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
17171   ac_status=$?
17172   egrep -v '^ *\+' conftest.er1 >conftest.err
17173   rm -f conftest.er1
17174   cat conftest.err >&5
17175   echo "$as_me:17175: \$? = $ac_status" >&5
17176   (exit $ac_status); } >/dev/null; then
17177   if test -s conftest.err; then
17178     ac_cpp_err=$ac_c_preproc_warn_flag
17179   else
17180     ac_cpp_err=
17181   fi
17182 else
17183   ac_cpp_err=yes
17184 fi
17185 if test -z "$ac_cpp_err"; then
17186   ac_cv_header_dmalloc_h=yes
17187 else
17188   echo "$as_me: failed program was:" >&5
17189   cat conftest.$ac_ext >&5
17190   ac_cv_header_dmalloc_h=no
17191 fi
17192 rm -f conftest.err conftest.$ac_ext
17193 fi
17194 echo "$as_me:17194: result: $ac_cv_header_dmalloc_h" >&5
17195 echo "${ECHO_T}$ac_cv_header_dmalloc_h" >&6
17196 if test $ac_cv_header_dmalloc_h = yes; then
17197
17198 echo "$as_me:17198: checking for dmalloc_debug in -ldmalloc" >&5
17199 echo $ECHO_N "checking for dmalloc_debug in -ldmalloc... $ECHO_C" >&6
17200 if test "${ac_cv_lib_dmalloc_dmalloc_debug+set}" = set; then
17201   echo $ECHO_N "(cached) $ECHO_C" >&6
17202 else
17203   ac_check_lib_save_LIBS=$LIBS
17204 LIBS="-ldmalloc  $LIBS"
17205 cat >conftest.$ac_ext <<_ACEOF
17206 #line 17206 "configure"
17207 #include "confdefs.h"
17208
17209 /* Override any gcc2 internal prototype to avoid an error.  */
17210 #ifdef __cplusplus
17211 extern "C"
17212 #endif
17213 /* We use char because int might match the return type of a gcc2
17214    builtin and then its argument prototype would still apply.  */
17215 char dmalloc_debug ();
17216 int
17217 main ()
17218 {
17219 dmalloc_debug ();
17220   ;
17221   return 0;
17222 }
17223 _ACEOF
17224 rm -f conftest.$ac_objext conftest$ac_exeext
17225 if { (eval echo "$as_me:17225: \"$ac_link\"") >&5
17226   (eval $ac_link) 2>&5
17227   ac_status=$?
17228   echo "$as_me:17228: \$? = $ac_status" >&5
17229   (exit $ac_status); } &&
17230          { ac_try='test -s conftest$ac_exeext'
17231   { (eval echo "$as_me:17231: \"$ac_try\"") >&5
17232   (eval $ac_try) 2>&5
17233   ac_status=$?
17234   echo "$as_me:17234: \$? = $ac_status" >&5
17235   (exit $ac_status); }; }; then
17236   ac_cv_lib_dmalloc_dmalloc_debug=yes
17237 else
17238   echo "$as_me: failed program was:" >&5
17239 cat conftest.$ac_ext >&5
17240 ac_cv_lib_dmalloc_dmalloc_debug=no
17241 fi
17242 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17243 LIBS=$ac_check_lib_save_LIBS
17244 fi
17245 echo "$as_me:17245: result: $ac_cv_lib_dmalloc_dmalloc_debug" >&5
17246 echo "${ECHO_T}$ac_cv_lib_dmalloc_dmalloc_debug" >&6
17247 if test $ac_cv_lib_dmalloc_dmalloc_debug = yes; then
17248   cat >>confdefs.h <<EOF
17249 #define HAVE_LIBDMALLOC 1
17250 EOF
17251
17252   LIBS="-ldmalloc $LIBS"
17253
17254 fi
17255
17256 fi
17257
17258 fi
17259
17260 echo "$as_me:17260: checking if you want to use dbmalloc for testing" >&5
17261 echo $ECHO_N "checking if you want to use dbmalloc for testing... $ECHO_C" >&6
17262
17263 # Check whether --with-dbmalloc or --without-dbmalloc was given.
17264 if test "${with_dbmalloc+set}" = set; then
17265   withval="$with_dbmalloc"
17266
17267 cat >>confdefs.h <<EOF
17268 #define USE_DBMALLOC 1
17269 EOF
17270
17271         : ${with_cflags:=-g}
17272         : ${with_no_leaks:=yes}
17273          with_dbmalloc=yes
17274 else
17275   with_dbmalloc=
17276 fi;
17277 echo "$as_me:17277: result: ${with_dbmalloc:-no}" >&5
17278 echo "${ECHO_T}${with_dbmalloc:-no}" >&6
17279
17280 case .$with_cflags in
17281 (.*-g*)
17282         case .$CFLAGS in
17283         (.*-g*)
17284                 ;;
17285         (*)
17286
17287 cf_fix_cppflags=no
17288 cf_new_cflags=
17289 cf_new_cppflags=
17290 cf_new_extra_cppflags=
17291
17292 for cf_add_cflags in -g
17293 do
17294 case $cf_fix_cppflags in
17295 (no)
17296         case $cf_add_cflags in
17297         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
17298                 case $cf_add_cflags in
17299                 (-D*)
17300                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
17301
17302                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17303                                 && test -z "${cf_tst_cflags}" \
17304                                 && cf_fix_cppflags=yes
17305
17306                         if test $cf_fix_cppflags = yes ; then
17307                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
17308                                 continue
17309                         elif test "${cf_tst_cflags}" = "\"'" ; then
17310                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
17311                                 continue
17312                         fi
17313                         ;;
17314                 esac
17315                 case "$CPPFLAGS" in
17316                 (*$cf_add_cflags)
17317                         ;;
17318                 (*)
17319                         case $cf_add_cflags in
17320                         (-D*)
17321                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
17322
17323 CPPFLAGS=`echo "$CPPFLAGS" | \
17324         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
17325                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
17326
17327                                 ;;
17328                         esac
17329                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
17330                         ;;
17331                 esac
17332                 ;;
17333         (*)
17334                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
17335                 ;;
17336         esac
17337         ;;
17338 (yes)
17339         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
17340
17341         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
17342
17343         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17344                 && test -z "${cf_tst_cflags}" \
17345                 && cf_fix_cppflags=no
17346         ;;
17347 esac
17348 done
17349
17350 if test -n "$cf_new_cflags" ; then
17351
17352         CFLAGS="$CFLAGS $cf_new_cflags"
17353 fi
17354
17355 if test -n "$cf_new_cppflags" ; then
17356
17357         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
17358 fi
17359
17360 if test -n "$cf_new_extra_cppflags" ; then
17361
17362         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
17363 fi
17364
17365                 ;;
17366         esac
17367         ;;
17368 esac
17369
17370 if test "$with_dbmalloc" = yes ; then
17371         echo "$as_me:17371: checking for dbmalloc.h" >&5
17372 echo $ECHO_N "checking for dbmalloc.h... $ECHO_C" >&6
17373 if test "${ac_cv_header_dbmalloc_h+set}" = set; then
17374   echo $ECHO_N "(cached) $ECHO_C" >&6
17375 else
17376   cat >conftest.$ac_ext <<_ACEOF
17377 #line 17377 "configure"
17378 #include "confdefs.h"
17379 #include <dbmalloc.h>
17380 _ACEOF
17381 if { (eval echo "$as_me:17381: \"$ac_cpp conftest.$ac_ext\"") >&5
17382   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
17383   ac_status=$?
17384   egrep -v '^ *\+' conftest.er1 >conftest.err
17385   rm -f conftest.er1
17386   cat conftest.err >&5
17387   echo "$as_me:17387: \$? = $ac_status" >&5
17388   (exit $ac_status); } >/dev/null; then
17389   if test -s conftest.err; then
17390     ac_cpp_err=$ac_c_preproc_warn_flag
17391   else
17392     ac_cpp_err=
17393   fi
17394 else
17395   ac_cpp_err=yes
17396 fi
17397 if test -z "$ac_cpp_err"; then
17398   ac_cv_header_dbmalloc_h=yes
17399 else
17400   echo "$as_me: failed program was:" >&5
17401   cat conftest.$ac_ext >&5
17402   ac_cv_header_dbmalloc_h=no
17403 fi
17404 rm -f conftest.err conftest.$ac_ext
17405 fi
17406 echo "$as_me:17406: result: $ac_cv_header_dbmalloc_h" >&5
17407 echo "${ECHO_T}$ac_cv_header_dbmalloc_h" >&6
17408 if test $ac_cv_header_dbmalloc_h = yes; then
17409
17410 echo "$as_me:17410: checking for debug_malloc in -ldbmalloc" >&5
17411 echo $ECHO_N "checking for debug_malloc in -ldbmalloc... $ECHO_C" >&6
17412 if test "${ac_cv_lib_dbmalloc_debug_malloc+set}" = set; then
17413   echo $ECHO_N "(cached) $ECHO_C" >&6
17414 else
17415   ac_check_lib_save_LIBS=$LIBS
17416 LIBS="-ldbmalloc  $LIBS"
17417 cat >conftest.$ac_ext <<_ACEOF
17418 #line 17418 "configure"
17419 #include "confdefs.h"
17420
17421 /* Override any gcc2 internal prototype to avoid an error.  */
17422 #ifdef __cplusplus
17423 extern "C"
17424 #endif
17425 /* We use char because int might match the return type of a gcc2
17426    builtin and then its argument prototype would still apply.  */
17427 char debug_malloc ();
17428 int
17429 main ()
17430 {
17431 debug_malloc ();
17432   ;
17433   return 0;
17434 }
17435 _ACEOF
17436 rm -f conftest.$ac_objext conftest$ac_exeext
17437 if { (eval echo "$as_me:17437: \"$ac_link\"") >&5
17438   (eval $ac_link) 2>&5
17439   ac_status=$?
17440   echo "$as_me:17440: \$? = $ac_status" >&5
17441   (exit $ac_status); } &&
17442          { ac_try='test -s conftest$ac_exeext'
17443   { (eval echo "$as_me:17443: \"$ac_try\"") >&5
17444   (eval $ac_try) 2>&5
17445   ac_status=$?
17446   echo "$as_me:17446: \$? = $ac_status" >&5
17447   (exit $ac_status); }; }; then
17448   ac_cv_lib_dbmalloc_debug_malloc=yes
17449 else
17450   echo "$as_me: failed program was:" >&5
17451 cat conftest.$ac_ext >&5
17452 ac_cv_lib_dbmalloc_debug_malloc=no
17453 fi
17454 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17455 LIBS=$ac_check_lib_save_LIBS
17456 fi
17457 echo "$as_me:17457: result: $ac_cv_lib_dbmalloc_debug_malloc" >&5
17458 echo "${ECHO_T}$ac_cv_lib_dbmalloc_debug_malloc" >&6
17459 if test $ac_cv_lib_dbmalloc_debug_malloc = yes; then
17460   cat >>confdefs.h <<EOF
17461 #define HAVE_LIBDBMALLOC 1
17462 EOF
17463
17464   LIBS="-ldbmalloc $LIBS"
17465
17466 fi
17467
17468 fi
17469
17470 fi
17471
17472 echo "$as_me:17472: checking if you want to use valgrind for testing" >&5
17473 echo $ECHO_N "checking if you want to use valgrind for testing... $ECHO_C" >&6
17474
17475 # Check whether --with-valgrind or --without-valgrind was given.
17476 if test "${with_valgrind+set}" = set; then
17477   withval="$with_valgrind"
17478
17479 cat >>confdefs.h <<EOF
17480 #define USE_VALGRIND 1
17481 EOF
17482
17483         : ${with_cflags:=-g}
17484         : ${with_no_leaks:=yes}
17485          with_valgrind=yes
17486 else
17487   with_valgrind=
17488 fi;
17489 echo "$as_me:17489: result: ${with_valgrind:-no}" >&5
17490 echo "${ECHO_T}${with_valgrind:-no}" >&6
17491
17492 case .$with_cflags in
17493 (.*-g*)
17494         case .$CFLAGS in
17495         (.*-g*)
17496                 ;;
17497         (*)
17498
17499 cf_fix_cppflags=no
17500 cf_new_cflags=
17501 cf_new_cppflags=
17502 cf_new_extra_cppflags=
17503
17504 for cf_add_cflags in -g
17505 do
17506 case $cf_fix_cppflags in
17507 (no)
17508         case $cf_add_cflags in
17509         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
17510                 case $cf_add_cflags in
17511                 (-D*)
17512                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
17513
17514                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17515                                 && test -z "${cf_tst_cflags}" \
17516                                 && cf_fix_cppflags=yes
17517
17518                         if test $cf_fix_cppflags = yes ; then
17519                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
17520                                 continue
17521                         elif test "${cf_tst_cflags}" = "\"'" ; then
17522                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
17523                                 continue
17524                         fi
17525                         ;;
17526                 esac
17527                 case "$CPPFLAGS" in
17528                 (*$cf_add_cflags)
17529                         ;;
17530                 (*)
17531                         case $cf_add_cflags in
17532                         (-D*)
17533                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
17534
17535 CPPFLAGS=`echo "$CPPFLAGS" | \
17536         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
17537                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
17538
17539                                 ;;
17540                         esac
17541                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
17542                         ;;
17543                 esac
17544                 ;;
17545         (*)
17546                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
17547                 ;;
17548         esac
17549         ;;
17550 (yes)
17551         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
17552
17553         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
17554
17555         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17556                 && test -z "${cf_tst_cflags}" \
17557                 && cf_fix_cppflags=no
17558         ;;
17559 esac
17560 done
17561
17562 if test -n "$cf_new_cflags" ; then
17563
17564         CFLAGS="$CFLAGS $cf_new_cflags"
17565 fi
17566
17567 if test -n "$cf_new_cppflags" ; then
17568
17569         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
17570 fi
17571
17572 if test -n "$cf_new_extra_cppflags" ; then
17573
17574         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
17575 fi
17576
17577                 ;;
17578         esac
17579         ;;
17580 esac
17581
17582 echo "$as_me:17582: checking if you want to perform memory-leak testing" >&5
17583 echo $ECHO_N "checking if you want to perform memory-leak testing... $ECHO_C" >&6
17584
17585 # Check whether --enable-leaks or --disable-leaks was given.
17586 if test "${enable_leaks+set}" = set; then
17587   enableval="$enable_leaks"
17588   if test "x$enableval" = xno; then with_no_leaks=yes; else with_no_leaks=no; fi
17589 else
17590   : ${with_no_leaks:=no}
17591 fi;
17592 echo "$as_me:17592: result: $with_no_leaks" >&5
17593 echo "${ECHO_T}$with_no_leaks" >&6
17594
17595 if test "$with_no_leaks" = yes ; then
17596
17597 cat >>confdefs.h <<\EOF
17598 #define NO_LEAKS 1
17599 EOF
17600
17601 cat >>confdefs.h <<\EOF
17602 #define YY_NO_LEAKS 1
17603 EOF
17604
17605 fi
17606
17607 LD_RPATH_OPT=
17608 echo "$as_me:17608: checking for an rpath option" >&5
17609 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
17610 case $cf_cv_system_name in
17611 (irix*)
17612         if test "$GCC" = yes; then
17613                 LD_RPATH_OPT="-Wl,-rpath,"
17614         else
17615                 LD_RPATH_OPT="-rpath "
17616         fi
17617         ;;
17618 (linux*|gnu*|k*bsd*-gnu|freebsd*)
17619         LD_RPATH_OPT="-Wl,-rpath,"
17620         ;;
17621 (openbsd[2-9].*|mirbsd*)
17622         LD_RPATH_OPT="-Wl,-rpath,"
17623         ;;
17624 (dragonfly*)
17625         LD_RPATH_OPT="-rpath "
17626         ;;
17627 (netbsd*)
17628         LD_RPATH_OPT="-Wl,-rpath,"
17629         ;;
17630 (osf*|mls+*)
17631         LD_RPATH_OPT="-rpath "
17632         ;;
17633 (solaris2*)
17634         LD_RPATH_OPT="-R"
17635         ;;
17636 (*)
17637         ;;
17638 esac
17639 echo "$as_me:17639: result: $LD_RPATH_OPT" >&5
17640 echo "${ECHO_T}$LD_RPATH_OPT" >&6
17641
17642 case "x$LD_RPATH_OPT" in
17643 (x-R*)
17644         echo "$as_me:17644: checking if we need a space after rpath option" >&5
17645 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
17646         cf_save_LIBS="$LIBS"
17647
17648 cf_add_libs="${LD_RPATH_OPT}$libdir"
17649 # Filter out duplicates - this happens with badly-designed ".pc" files...
17650 for cf_add_1lib in $LIBS
17651 do
17652         for cf_add_2lib in $cf_add_libs
17653         do
17654                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
17655                 then
17656                         cf_add_1lib=
17657                         break
17658                 fi
17659         done
17660         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
17661 done
17662 LIBS="$cf_add_libs"
17663
17664         cat >conftest.$ac_ext <<_ACEOF
17665 #line 17665 "configure"
17666 #include "confdefs.h"
17667
17668 int
17669 main ()
17670 {
17671
17672   ;
17673   return 0;
17674 }
17675 _ACEOF
17676 rm -f conftest.$ac_objext conftest$ac_exeext
17677 if { (eval echo "$as_me:17677: \"$ac_link\"") >&5
17678   (eval $ac_link) 2>&5
17679   ac_status=$?
17680   echo "$as_me:17680: \$? = $ac_status" >&5
17681   (exit $ac_status); } &&
17682          { ac_try='test -s conftest$ac_exeext'
17683   { (eval echo "$as_me:17683: \"$ac_try\"") >&5
17684   (eval $ac_try) 2>&5
17685   ac_status=$?
17686   echo "$as_me:17686: \$? = $ac_status" >&5
17687   (exit $ac_status); }; }; then
17688   cf_rpath_space=no
17689 else
17690   echo "$as_me: failed program was:" >&5
17691 cat conftest.$ac_ext >&5
17692 cf_rpath_space=yes
17693 fi
17694 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17695         LIBS="$cf_save_LIBS"
17696         echo "$as_me:17696: result: $cf_rpath_space" >&5
17697 echo "${ECHO_T}$cf_rpath_space" >&6
17698         test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
17699         ;;
17700 esac
17701
17702 echo "$as_me:17702: checking if rpath-hack should be disabled" >&5
17703 echo $ECHO_N "checking if rpath-hack should be disabled... $ECHO_C" >&6
17704
17705 # Check whether --enable-rpath-hack or --disable-rpath-hack was given.
17706 if test "${enable_rpath_hack+set}" = set; then
17707   enableval="$enable_rpath_hack"
17708   test "$enableval" != no && enableval=yes
17709         if test "$enableval" != "yes" ; then
17710     cf_disable_rpath_hack=yes
17711         else
17712                 cf_disable_rpath_hack=no
17713         fi
17714 else
17715   enableval=yes
17716         cf_disable_rpath_hack=no
17717
17718 fi;
17719 echo "$as_me:17719: result: $cf_disable_rpath_hack" >&5
17720 echo "${ECHO_T}$cf_disable_rpath_hack" >&6
17721 if test "$cf_disable_rpath_hack" = no ; then
17722
17723 echo "$as_me:17723: checking for updated LDFLAGS" >&5
17724 echo $ECHO_N "checking for updated LDFLAGS... $ECHO_C" >&6
17725 if test -n "$LD_RPATH_OPT" ; then
17726         echo "$as_me:17726: result: maybe" >&5
17727 echo "${ECHO_T}maybe" >&6
17728
17729         for ac_prog in ldd
17730 do
17731   # Extract the first word of "$ac_prog", so it can be a program name with args.
17732 set dummy $ac_prog; ac_word=$2
17733 echo "$as_me:17733: checking for $ac_word" >&5
17734 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
17735 if test "${ac_cv_prog_cf_ldd_prog+set}" = set; then
17736   echo $ECHO_N "(cached) $ECHO_C" >&6
17737 else
17738   if test -n "$cf_ldd_prog"; then
17739   ac_cv_prog_cf_ldd_prog="$cf_ldd_prog" # Let the user override the test.
17740 else
17741   ac_save_IFS=$IFS; IFS=$ac_path_separator
17742 ac_dummy="$PATH"
17743 for ac_dir in $ac_dummy; do
17744   IFS=$ac_save_IFS
17745   test -z "$ac_dir" && ac_dir=.
17746   $as_executable_p "$ac_dir/$ac_word" || continue
17747 ac_cv_prog_cf_ldd_prog="$ac_prog"
17748 echo "$as_me:17748: found $ac_dir/$ac_word" >&5
17749 break
17750 done
17751
17752 fi
17753 fi
17754 cf_ldd_prog=$ac_cv_prog_cf_ldd_prog
17755 if test -n "$cf_ldd_prog"; then
17756   echo "$as_me:17756: result: $cf_ldd_prog" >&5
17757 echo "${ECHO_T}$cf_ldd_prog" >&6
17758 else
17759   echo "$as_me:17759: result: no" >&5
17760 echo "${ECHO_T}no" >&6
17761 fi
17762
17763   test -n "$cf_ldd_prog" && break
17764 done
17765 test -n "$cf_ldd_prog" || cf_ldd_prog="no"
17766
17767         cf_rpath_list="/usr/lib /lib"
17768         if test "$cf_ldd_prog" != no
17769         then
17770                 cf_rpath_oops=
17771
17772 cat >conftest.$ac_ext <<_ACEOF
17773 #line 17773 "configure"
17774 #include "confdefs.h"
17775 #include <stdio.h>
17776 int
17777 main ()
17778 {
17779 printf("Hello");
17780   ;
17781   return 0;
17782 }
17783 _ACEOF
17784 rm -f conftest.$ac_objext conftest$ac_exeext
17785 if { (eval echo "$as_me:17785: \"$ac_link\"") >&5
17786   (eval $ac_link) 2>&5
17787   ac_status=$?
17788   echo "$as_me:17788: \$? = $ac_status" >&5
17789   (exit $ac_status); } &&
17790          { ac_try='test -s conftest$ac_exeext'
17791   { (eval echo "$as_me:17791: \"$ac_try\"") >&5
17792   (eval $ac_try) 2>&5
17793   ac_status=$?
17794   echo "$as_me:17794: \$? = $ac_status" >&5
17795   (exit $ac_status); }; }; then
17796   cf_rpath_oops=`$cf_ldd_prog conftest$ac_exeext | fgrep ' not found' | sed -e 's% =>.*$%%' |sort | uniq`
17797                  cf_rpath_list=`$cf_ldd_prog conftest$ac_exeext | fgrep / | sed -e 's%^.*[      ]/%/%' -e 's%/[^/][^/]*$%%' |sort | uniq`
17798 else
17799   echo "$as_me: failed program was:" >&5
17800 cat conftest.$ac_ext >&5
17801 fi
17802 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17803
17804                 # If we passed the link-test, but get a "not found" on a given library,
17805                 # this could be due to inept reconfiguration of gcc to make it only
17806                 # partly honor /usr/local/lib (or whatever).  Sometimes this behavior
17807                 # is intentional, e.g., installing gcc in /usr/bin and suppressing the
17808                 # /usr/local libraries.
17809                 if test -n "$cf_rpath_oops"
17810                 then
17811                         for cf_rpath_src in $cf_rpath_oops
17812                         do
17813                                 for cf_rpath_dir in \
17814                                         /usr/local \
17815                                         /usr/pkg \
17816                                         /opt/sfw
17817                                 do
17818                                         if test -f $cf_rpath_dir/lib/$cf_rpath_src
17819                                         then
17820                                                 test -n "$verbose" && echo "    ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src" 1>&6
17821
17822 echo "${as_me:-configure}:17822: testing ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src ..." 1>&5
17823
17824                                                 LDFLAGS="$LDFLAGS -L$cf_rpath_dir/lib"
17825                                                 break
17826                                         fi
17827                                 done
17828                         done
17829                 fi
17830         fi
17831
17832         test -n "$verbose" && echo "    ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
17833
17834 echo "${as_me:-configure}:17834: testing ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
17835
17836 test -n "$verbose" && echo "    ...checking LDFLAGS $LDFLAGS" 1>&6
17837
17838 echo "${as_me:-configure}:17838: testing ...checking LDFLAGS $LDFLAGS ..." 1>&5
17839
17840 cf_rpath_dst=
17841 for cf_rpath_src in $LDFLAGS
17842 do
17843         case $cf_rpath_src in
17844         (-L*)
17845
17846                 # check if this refers to a directory which we will ignore
17847                 cf_rpath_skip=no
17848                 if test -n "$cf_rpath_list"
17849                 then
17850                         for cf_rpath_item in $cf_rpath_list
17851                         do
17852                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
17853                                 then
17854                                         cf_rpath_skip=yes
17855                                         break
17856                                 fi
17857                         done
17858                 fi
17859
17860                 if test "$cf_rpath_skip" = no
17861                 then
17862                         # transform the option
17863                         if test "$LD_RPATH_OPT" = "-R " ; then
17864                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
17865                         else
17866                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
17867                         fi
17868
17869                         # if we have not already added this, add it now
17870                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
17871                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
17872                         then
17873                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
17874
17875 echo "${as_me:-configure}:17875: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
17876
17877                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
17878                         fi
17879                 fi
17880                 ;;
17881         esac
17882         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
17883 done
17884 LDFLAGS=$cf_rpath_dst
17885
17886 test -n "$verbose" && echo "    ...checked LDFLAGS $LDFLAGS" 1>&6
17887
17888 echo "${as_me:-configure}:17888: testing ...checked LDFLAGS $LDFLAGS ..." 1>&5
17889
17890 test -n "$verbose" && echo "    ...checking LIBS $LIBS" 1>&6
17891
17892 echo "${as_me:-configure}:17892: testing ...checking LIBS $LIBS ..." 1>&5
17893
17894 cf_rpath_dst=
17895 for cf_rpath_src in $LIBS
17896 do
17897         case $cf_rpath_src in
17898         (-L*)
17899
17900                 # check if this refers to a directory which we will ignore
17901                 cf_rpath_skip=no
17902                 if test -n "$cf_rpath_list"
17903                 then
17904                         for cf_rpath_item in $cf_rpath_list
17905                         do
17906                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
17907                                 then
17908                                         cf_rpath_skip=yes
17909                                         break
17910                                 fi
17911                         done
17912                 fi
17913
17914                 if test "$cf_rpath_skip" = no
17915                 then
17916                         # transform the option
17917                         if test "$LD_RPATH_OPT" = "-R " ; then
17918                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
17919                         else
17920                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
17921                         fi
17922
17923                         # if we have not already added this, add it now
17924                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
17925                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
17926                         then
17927                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
17928
17929 echo "${as_me:-configure}:17929: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
17930
17931                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
17932                         fi
17933                 fi
17934                 ;;
17935         esac
17936         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
17937 done
17938 LIBS=$cf_rpath_dst
17939
17940 test -n "$verbose" && echo "    ...checked LIBS $LIBS" 1>&6
17941
17942 echo "${as_me:-configure}:17942: testing ...checked LIBS $LIBS ..." 1>&5
17943
17944         test -n "$verbose" && echo "    ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
17945
17946 echo "${as_me:-configure}:17946: testing ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
17947
17948 else
17949         echo "$as_me:17949: result: no" >&5
17950 echo "${ECHO_T}no" >&6
17951 fi
17952
17953 fi
17954
17955 TEST_ARGS="$LIBS"
17956 LIBS=
17957
17958 ac_config_files="$ac_config_files Makefile"
17959 ac_config_commands="$ac_config_commands default"
17960 cat >confcache <<\_ACEOF
17961 # This file is a shell script that caches the results of configure
17962 # tests run on this system so they can be shared between configure
17963 # scripts and configure runs, see configure's option --config-cache.
17964 # It is not useful on other systems.  If it contains results you don't
17965 # want to keep, you may remove or edit it.
17966 #
17967 # config.status only pays attention to the cache file if you give it
17968 # the --recheck option to rerun configure.
17969 #
17970 # `ac_cv_env_foo' variables (set or unset) will be overriden when
17971 # loading this file, other *unset* `ac_cv_foo' will be assigned the
17972 # following values.
17973
17974 _ACEOF
17975
17976 # The following way of writing the cache mishandles newlines in values,
17977 # but we know of no workaround that is simple, portable, and efficient.
17978 # So, don't put newlines in cache variables' values.
17979 # Ultrix sh set writes to stderr and can't be redirected directly,
17980 # and sets the high bit in the cache file unless we assign to the vars.
17981 {
17982   (set) 2>&1 |
17983     case `(ac_space=' '; set | grep ac_space) 2>&1` in
17984     *ac_space=\ *)
17985       # `set' does not quote correctly, so add quotes (double-quote
17986       # substitution turns \\\\ into \\, and sed turns \\ into \).
17987       sed -n \
17988         "s/'/'\\\\''/g;
17989           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
17990       ;;
17991     *)
17992       # `set' quotes correctly as required by POSIX, so do not add quotes.
17993       sed -n \
17994         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
17995       ;;
17996     esac;
17997 } |
17998   sed '
17999      t clear
18000      : clear
18001      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
18002      t end
18003      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
18004      : end' >>confcache
18005 if cmp -s $cache_file confcache; then :; else
18006   if test -w $cache_file; then
18007     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
18008     cat confcache >$cache_file
18009   else
18010     echo "not updating unwritable cache $cache_file"
18011   fi
18012 fi
18013 rm -f confcache
18014
18015 test "x$prefix" = xNONE && prefix=$ac_default_prefix
18016 # Let make expand exec_prefix.
18017 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
18018
18019 # VPATH may cause trouble with some makes, so we remove $(srcdir),
18020 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
18021 # trailing colons and then remove the whole line if VPATH becomes empty
18022 # (actually we leave an empty line to preserve line numbers).
18023 if test "x$srcdir" = x.; then
18024   ac_vpsub='/^[         ]*VPATH[        ]*=/{
18025 s/:*\$(srcdir):*/:/;
18026 s/:*\${srcdir}:*/:/;
18027 s/:*@srcdir@:*/:/;
18028 s/^\([^=]*=[    ]*\):*/\1/;
18029 s/:*$//;
18030 s/^[^=]*=[      ]*$//;
18031 }'
18032 fi
18033
18034 DEFS=-DHAVE_CONFIG_H
18035
18036 : ${CONFIG_STATUS=./config.status}
18037 ac_clean_files_save=$ac_clean_files
18038 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
18039 { echo "$as_me:18039: creating $CONFIG_STATUS" >&5
18040 echo "$as_me: creating $CONFIG_STATUS" >&6;}
18041 cat >$CONFIG_STATUS <<_ACEOF
18042 #! $SHELL
18043 # Generated automatically by configure.
18044 # Run this file to recreate the current configuration.
18045 # Compiler output produced by configure, useful for debugging
18046 # configure, is in config.log if it exists.
18047
18048 debug=false
18049 SHELL=\${CONFIG_SHELL-$SHELL}
18050 ac_cs_invocation="\$0 \$@"
18051
18052 _ACEOF
18053
18054 cat >>$CONFIG_STATUS <<\_ACEOF
18055 # Be Bourne compatible
18056 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
18057   emulate sh
18058   NULLCMD=:
18059 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
18060   set -o posix
18061 fi
18062
18063 # Name of the executable.
18064 as_me=`echo "$0" |sed 's,.*[\\/],,'`
18065
18066 if expr a : '\(a\)' >/dev/null 2>&1; then
18067   as_expr=expr
18068 else
18069   as_expr=false
18070 fi
18071
18072 rm -f conf$$ conf$$.exe conf$$.file
18073 echo >conf$$.file
18074 if ln -s conf$$.file conf$$ 2>/dev/null; then
18075   # We could just check for DJGPP; but this test a) works b) is more generic
18076   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
18077   if test -f conf$$.exe; then
18078     # Don't use ln at all; we don't have any links
18079     as_ln_s='cp -p'
18080   else
18081     as_ln_s='ln -s'
18082   fi
18083 elif ln conf$$.file conf$$ 2>/dev/null; then
18084   as_ln_s=ln
18085 else
18086   as_ln_s='cp -p'
18087 fi
18088 rm -f conf$$ conf$$.exe conf$$.file
18089
18090 as_executable_p="test -f"
18091
18092 # Support unset when possible.
18093 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
18094   as_unset=unset
18095 else
18096   as_unset=false
18097 fi
18098
18099 # NLS nuisances.
18100 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
18101 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
18102 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
18103 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
18104 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
18105 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
18106 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
18107 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
18108
18109 # IFS
18110 # We need space, tab and new line, in precisely that order.
18111 as_nl='
18112 '
18113 IFS="   $as_nl"
18114
18115 # CDPATH.
18116 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
18117
18118 exec 6>&1
18119
18120 _ACEOF
18121
18122 # Files that config.status was made for.
18123 if test -n "$ac_config_files"; then
18124   echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
18125 fi
18126
18127 if test -n "$ac_config_headers"; then
18128   echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
18129 fi
18130
18131 if test -n "$ac_config_links"; then
18132   echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
18133 fi
18134
18135 if test -n "$ac_config_commands"; then
18136   echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
18137 fi
18138
18139 cat >>$CONFIG_STATUS <<\EOF
18140
18141 ac_cs_usage="\
18142 \`$as_me' instantiates files from templates according to the
18143 current configuration.
18144
18145 Usage: $0 [OPTIONS] [FILE]...
18146
18147   -h, --help       print this help, then exit
18148   -V, --version    print version number, then exit
18149   -d, --debug      don't remove temporary files
18150       --recheck    update $as_me by reconfiguring in the same conditions
18151   --file=FILE[:TEMPLATE]
18152                    instantiate the configuration file FILE
18153   --header=FILE[:TEMPLATE]
18154                    instantiate the configuration header FILE
18155
18156 Configuration files:
18157 $config_files
18158
18159 Configuration headers:
18160 $config_headers
18161
18162 Configuration commands:
18163 $config_commands
18164
18165 Report bugs to <dickey@invisible-island.net>."
18166 EOF
18167
18168 cat >>$CONFIG_STATUS <<EOF
18169 ac_cs_version="\\
18170 config.status
18171 configured by $0, generated by GNU Autoconf 2.52.20150926,
18172   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
18173
18174 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
18175 Free Software Foundation, Inc.
18176 This config.status script is free software; the Free Software Foundation
18177 gives unlimited permission to copy, distribute and modify it."
18178 srcdir=$srcdir
18179 INSTALL="$INSTALL"
18180 EOF
18181
18182 cat >>$CONFIG_STATUS <<\EOF
18183 # If no file are specified by the user, then we need to provide default
18184 # value.  By we need to know if files were specified by the user.
18185 ac_need_defaults=:
18186 while test $# != 0
18187 do
18188   case $1 in
18189   --*=*)
18190     ac_option=`expr "x$1" : 'x\([^=]*\)='`
18191     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
18192     shift
18193     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
18194     shift
18195     ;;
18196   -*);;
18197   *) # This is not an option, so the user has probably given explicit
18198      # arguments.
18199      ac_need_defaults=false;;
18200   esac
18201
18202   case $1 in
18203   # Handling of the options.
18204 EOF
18205 cat >>$CONFIG_STATUS <<EOF
18206   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
18207     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
18208     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
18209 EOF
18210 cat >>$CONFIG_STATUS <<\EOF
18211   --version | --vers* | -V )
18212     echo "$ac_cs_version"; exit 0 ;;
18213   --he | --h)
18214     # Conflict between --help and --header
18215     { { echo "$as_me:18215: error: ambiguous option: $1
18216 Try \`$0 --help' for more information." >&5
18217 echo "$as_me: error: ambiguous option: $1
18218 Try \`$0 --help' for more information." >&2;}
18219    { (exit 1); exit 1; }; };;
18220   --help | --hel | -h )
18221     echo "$ac_cs_usage"; exit 0 ;;
18222   --debug | --d* | -d )
18223     debug=: ;;
18224   --file | --fil | --fi | --f )
18225     shift
18226     CONFIG_FILES="$CONFIG_FILES $1"
18227     ac_need_defaults=false;;
18228   --header | --heade | --head | --hea )
18229     shift
18230     CONFIG_HEADERS="$CONFIG_HEADERS $1"
18231     ac_need_defaults=false;;
18232
18233   # This is an error.
18234   -*) { { echo "$as_me:18234: error: unrecognized option: $1
18235 Try \`$0 --help' for more information." >&5
18236 echo "$as_me: error: unrecognized option: $1
18237 Try \`$0 --help' for more information." >&2;}
18238    { (exit 1); exit 1; }; } ;;
18239
18240   *) ac_config_targets="$ac_config_targets $1" ;;
18241
18242   esac
18243   shift
18244 done
18245
18246 exec 5>>config.log
18247 cat >&5 << _ACEOF
18248
18249 ## ----------------------- ##
18250 ## Running config.status.  ##
18251 ## ----------------------- ##
18252
18253 This file was extended by $as_me 2.52.20150926, executed with
18254   CONFIG_FILES    = $CONFIG_FILES
18255   CONFIG_HEADERS  = $CONFIG_HEADERS
18256   CONFIG_LINKS    = $CONFIG_LINKS
18257   CONFIG_COMMANDS = $CONFIG_COMMANDS
18258   > $ac_cs_invocation
18259 on `(hostname || uname -n) 2>/dev/null | sed 1q`
18260
18261 _ACEOF
18262 EOF
18263
18264 cat >>$CONFIG_STATUS <<EOF
18265 #
18266 # INIT-COMMANDS section.
18267 #
18268
18269 AWK="$AWK"
18270 ECHO_CC="$ECHO_CC"
18271 ECHO_LD="$ECHO_LD"
18272 SHOW_CC="$SHOW_LD"
18273
18274 EOF
18275
18276 cat >>$CONFIG_STATUS <<\EOF
18277 for ac_config_target in $ac_config_targets
18278 do
18279   case "$ac_config_target" in
18280   # Handling of arguments.
18281   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
18282   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
18283   "ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS ncurses_cfg.h:ncurses_tst.hin" ;;
18284   *) { { echo "$as_me:18284: error: invalid argument: $ac_config_target" >&5
18285 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
18286    { (exit 1); exit 1; }; };;
18287   esac
18288 done
18289
18290 # If the user did not use the arguments to specify the items to instantiate,
18291 # then the envvar interface is used.  Set only those that are not.
18292 # We use the long form for the default assignment because of an extremely
18293 # bizarre bug on SunOS 4.1.3.
18294 if $ac_need_defaults; then
18295   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
18296   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
18297   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
18298 fi
18299
18300 # Create a temporary directory, and hook for its removal unless debugging.
18301 $debug ||
18302 {
18303   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
18304   trap '{ (exit 1); exit 1; }' 1 2 13 15
18305 }
18306
18307 # Create a (secure) tmp directory for tmp files.
18308 : ${TMPDIR=/tmp}
18309 {
18310   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
18311   test -n "$tmp" && test -d "$tmp"
18312 }  ||
18313 {
18314   tmp=$TMPDIR/cs$$-$RANDOM
18315   (umask 077 && mkdir $tmp)
18316 } ||
18317 {
18318    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
18319    { (exit 1); exit 1; }
18320 }
18321
18322 EOF
18323
18324 cat >>$CONFIG_STATUS <<EOF
18325
18326 #
18327 # CONFIG_FILES section.
18328 #
18329
18330 # No need to generate the scripts if there are no CONFIG_FILES.
18331 # This happens for instance when ./config.status config.h
18332 if test -n "\$CONFIG_FILES"; then
18333   # Protect against being on the right side of a sed subst in config.status.
18334   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
18335    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
18336 s,@SHELL@,$SHELL,;t t
18337 s,@exec_prefix@,$exec_prefix,;t t
18338 s,@prefix@,$prefix,;t t
18339 s,@program_transform_name@,$program_transform_name,;t t
18340 s,@bindir@,$bindir,;t t
18341 s,@sbindir@,$sbindir,;t t
18342 s,@libexecdir@,$libexecdir,;t t
18343 s,@datarootdir@,$datarootdir,;t t
18344 s,@datadir@,$datadir,;t t
18345 s,@sysconfdir@,$sysconfdir,;t t
18346 s,@sharedstatedir@,$sharedstatedir,;t t
18347 s,@localstatedir@,$localstatedir,;t t
18348 s,@libdir@,$libdir,;t t
18349 s,@includedir@,$includedir,;t t
18350 s,@oldincludedir@,$oldincludedir,;t t
18351 s,@infodir@,$infodir,;t t
18352 s,@mandir@,$mandir,;t t
18353 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
18354 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
18355 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
18356 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
18357 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
18358 s,@build_alias@,$build_alias,;t t
18359 s,@host_alias@,$host_alias,;t t
18360 s,@target_alias@,$target_alias,;t t
18361 s,@ECHO_C@,$ECHO_C,;t t
18362 s,@ECHO_N@,$ECHO_N,;t t
18363 s,@ECHO_T@,$ECHO_T,;t t
18364 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
18365 s,@DEFS@,$DEFS,;t t
18366 s,@LIBS@,$LIBS,;t t
18367 s,@build@,$build,;t t
18368 s,@build_cpu@,$build_cpu,;t t
18369 s,@build_vendor@,$build_vendor,;t t
18370 s,@build_os@,$build_os,;t t
18371 s,@host@,$host,;t t
18372 s,@host_cpu@,$host_cpu,;t t
18373 s,@host_vendor@,$host_vendor,;t t
18374 s,@host_os@,$host_os,;t t
18375 s,@SET_MAKE@,$SET_MAKE,;t t
18376 s,@CC@,$CC,;t t
18377 s,@CFLAGS@,$CFLAGS,;t t
18378 s,@LDFLAGS@,$LDFLAGS,;t t
18379 s,@CPPFLAGS@,$CPPFLAGS,;t t
18380 s,@ac_ct_CC@,$ac_ct_CC,;t t
18381 s,@EXEEXT@,$EXEEXT,;t t
18382 s,@OBJEXT@,$OBJEXT,;t t
18383 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
18384 s,@CPP@,$CPP,;t t
18385 s,@AWK@,$AWK,;t t
18386 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
18387 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
18388 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
18389 s,@LINT@,$LINT,;t t
18390 s,@LINT_OPTS@,$LINT_OPTS,;t t
18391 s,@CTAGS@,$CTAGS,;t t
18392 s,@ETAGS@,$ETAGS,;t t
18393 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
18394 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
18395 s,@MATH_LIB@,$MATH_LIB,;t t
18396 s,@top_builddir@,$top_builddir,;t t
18397 s,@CC_G_OPT@,$CC_G_OPT,;t t
18398 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
18399 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
18400 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
18401 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
18402 s,@LD@,$LD,;t t
18403 s,@LDFLAGS_SHARED@,$LDFLAGS_SHARED,;t t
18404 s,@LDFLAGS_STATIC@,$LDFLAGS_STATIC,;t t
18405 s,@LD_MODEL@,$LD_MODEL,;t t
18406 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
18407 s,@LIBTOOL@,$LIBTOOL,;t t
18408 s,@LIBTOOL_OPTS@,$LIBTOOL_OPTS,;t t
18409 s,@LIB_CLEAN@,$LIB_CLEAN,;t t
18410 s,@LIB_COMPILE@,$LIB_COMPILE,;t t
18411 s,@LIB_LINK@,$LIB_LINK,;t t
18412 s,@LINK_TESTS@,$LINK_TESTS,;t t
18413 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
18414 s,@PACKAGE@,$PACKAGE,;t t
18415 s,@PTHREAD@,$PTHREAD,;t t
18416 s,@TEST_ARGS@,$TEST_ARGS,;t t
18417 s,@TEST_DEPS@,$TEST_DEPS,;t t
18418 s,@TEST_LIBS@,$TEST_LIBS,;t t
18419 s,@TINFO_LDFLAGS@,$TINFO_LDFLAGS,;t t
18420 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
18421 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
18422 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
18423 s,@includesubdir@,$includesubdir,;t t
18424 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
18425 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
18426 s,@ECHO_LT@,$ECHO_LT,;t t
18427 s,@ECHO_LD@,$ECHO_LD,;t t
18428 s,@RULE_CC@,$RULE_CC,;t t
18429 s,@SHOW_CC@,$SHOW_CC,;t t
18430 s,@ECHO_CC@,$ECHO_CC,;t t
18431 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
18432 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
18433 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
18434 s,@X_CFLAGS@,$X_CFLAGS,;t t
18435 s,@X_PRE_LIBS@,$X_PRE_LIBS,;t t
18436 s,@X_LIBS@,$X_LIBS,;t t
18437 s,@X_EXTRA_LIBS@,$X_EXTRA_LIBS,;t t
18438 s,@XCURSES_CONFIG@,$XCURSES_CONFIG,;t t
18439 s,@ac_ct_XCURSES_CONFIG@,$ac_ct_XCURSES_CONFIG,;t t
18440 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
18441 s,@cf_ldd_prog@,$cf_ldd_prog,;t t
18442 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
18443 CEOF
18444
18445 EOF
18446
18447   cat >>$CONFIG_STATUS <<\EOF
18448   # Split the substitutions into bite-sized pieces for seds with
18449   # small command number limits, like on Digital OSF/1 and HP-UX.
18450   ac_max_sed_lines=48
18451   ac_sed_frag=1 # Number of current file.
18452   ac_beg=1 # First line for current file.
18453   ac_end=$ac_max_sed_lines # Line after last line for current file.
18454   ac_more_lines=:
18455   ac_sed_cmds=
18456   while $ac_more_lines; do
18457     if test $ac_beg -gt 1; then
18458       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
18459     else
18460       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
18461     fi
18462     if test ! -s $tmp/subs.frag; then
18463       ac_more_lines=false
18464     else
18465       # The purpose of the label and of the branching condition is to
18466       # speed up the sed processing (if there are no `@' at all, there
18467       # is no need to browse any of the substitutions).
18468       # These are the two extra sed commands mentioned above.
18469       (echo ':t
18470   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
18471       # It is possible to make a multiline substitution using escaped newlines.
18472       # Ensure that we do not split the substitution between script fragments.
18473       ac_BEG=$ac_end
18474       ac_END=`expr $ac_end + $ac_max_sed_lines`
18475       sed "1,${ac_BEG}d; ${ac_END}p; q" $tmp/subs.sed >$tmp/subs.next
18476       if test -s $tmp/subs.next; then
18477         grep '^s,@[^@,][^@,]*@,.*\\$' $tmp/subs.next >$tmp/subs.edit
18478         if test ! -s $tmp/subs.edit; then
18479           grep "^s,@[^@,][^@,]*@,.*,;t t$" $tmp/subs.next >$tmp/subs.edit
18480           if test ! -s $tmp/subs.edit; then
18481             if test $ac_beg -gt 1; then
18482               ac_end=`expr $ac_end - 1`
18483               continue
18484             fi
18485           fi
18486         fi
18487       fi
18488
18489       if test -z "$ac_sed_cmds"; then
18490         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
18491       else
18492         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
18493       fi
18494       ac_sed_frag=`expr $ac_sed_frag + 1`
18495       ac_beg=$ac_end
18496       ac_end=`expr $ac_end + $ac_max_sed_lines`
18497     fi
18498   done
18499   if test -z "$ac_sed_cmds"; then
18500     ac_sed_cmds=cat
18501   fi
18502 fi # test -n "$CONFIG_FILES"
18503
18504 EOF
18505 cat >>$CONFIG_STATUS <<\EOF
18506 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
18507   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
18508   case $ac_file in
18509   - | *:- | *:-:* ) # input from stdin
18510         cat >$tmp/stdin
18511         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
18512         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
18513   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
18514         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
18515   * )   ac_file_in=$ac_file.in ;;
18516   esac
18517
18518   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
18519   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
18520          X"$ac_file" : 'X\(//\)[^/]' \| \
18521          X"$ac_file" : 'X\(//\)$' \| \
18522          X"$ac_file" : 'X\(/\)' \| \
18523          .     : '\(.\)' 2>/dev/null ||
18524 echo X"$ac_file" |
18525     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
18526           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
18527           /^X\(\/\/\)$/{ s//\1/; q; }
18528           /^X\(\/\).*/{ s//\1/; q; }
18529           s/.*/./; q'`
18530   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
18531     { case "$ac_dir" in
18532   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
18533   *)                      as_incr_dir=.;;
18534 esac
18535 as_dummy="$ac_dir"
18536 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
18537   case $as_mkdir_dir in
18538     # Skip DOS drivespec
18539     ?:) as_incr_dir=$as_mkdir_dir ;;
18540     *)
18541       as_incr_dir=$as_incr_dir/$as_mkdir_dir
18542       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
18543     ;;
18544   esac
18545 done; }
18546
18547     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
18548     # A "../" for each directory in $ac_dir_suffix.
18549     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
18550   else
18551     ac_dir_suffix= ac_dots=
18552   fi
18553
18554   case $srcdir in
18555   .)  ac_srcdir=.
18556       if test -z "$ac_dots"; then
18557          ac_top_srcdir=.
18558       else
18559          ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'`
18560       fi ;;
18561   [\\/]* | ?:[\\/]* )
18562       ac_srcdir=$srcdir$ac_dir_suffix;
18563       ac_top_srcdir=$srcdir ;;
18564   *) # Relative path.
18565     ac_srcdir=$ac_dots$srcdir$ac_dir_suffix
18566     ac_top_srcdir=$ac_dots$srcdir ;;
18567   esac
18568
18569   case $INSTALL in
18570   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
18571   *) ac_INSTALL=$ac_dots$INSTALL ;;
18572   esac
18573
18574   if test x"$ac_file" != x-; then
18575     { echo "$as_me:18575: creating $ac_file" >&5
18576 echo "$as_me: creating $ac_file" >&6;}
18577     rm -f "$ac_file"
18578   fi
18579   # Let's still pretend it is `configure' which instantiates (i.e., don't
18580   # use $as_me), people would be surprised to read:
18581   #    /* config.h.  Generated automatically by config.status.  */
18582   configure_input="Generated automatically from `echo $ac_file_in |
18583                                                  sed 's,.*/,,'` by configure."
18584
18585   # First look for the input files in the build tree, otherwise in the
18586   # src tree.
18587   ac_file_inputs=`IFS=:
18588     for f in $ac_file_in; do
18589       case $f in
18590       -) echo $tmp/stdin ;;
18591       [\\/$]*)
18592          # Absolute (can't be DOS-style, as IFS=:)
18593          test -f "$f" || { { echo "$as_me:18593: error: cannot find input file: $f" >&5
18594 echo "$as_me: error: cannot find input file: $f" >&2;}
18595    { (exit 1); exit 1; }; }
18596          echo $f;;
18597       *) # Relative
18598          if test -f "$f"; then
18599            # Build tree
18600            echo $f
18601          elif test -f "$srcdir/$f"; then
18602            # Source tree
18603            echo $srcdir/$f
18604          else
18605            # /dev/null tree
18606            { { echo "$as_me:18606: error: cannot find input file: $f" >&5
18607 echo "$as_me: error: cannot find input file: $f" >&2;}
18608    { (exit 1); exit 1; }; }
18609          fi;;
18610       esac
18611     done` || { (exit 1); exit 1; }
18612 EOF
18613 cat >>$CONFIG_STATUS <<\EOF
18614   ac_warn_datarootdir=no
18615   if test x"$ac_file" != x-; then
18616     for ac_item in $ac_file_inputs
18617     do
18618       ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' $ac_item`
18619       if test -n "$ac_seen"; then
18620         ac_used=`grep '@datarootdir@' $ac_item`
18621         if test -z "$ac_used"; then
18622           { echo "$as_me:18622: WARNING: datarootdir was used implicitly but not set:
18623 $ac_seen" >&5
18624 echo "$as_me: WARNING: datarootdir was used implicitly but not set:
18625 $ac_seen" >&2;}
18626           ac_warn_datarootdir=yes
18627         fi
18628       fi
18629       ac_seen=`grep '${datarootdir}' $ac_item`
18630       if test -n "$ac_seen"; then
18631         { echo "$as_me:18631: WARNING: datarootdir was used explicitly but not set:
18632 $ac_seen" >&5
18633 echo "$as_me: WARNING: datarootdir was used explicitly but not set:
18634 $ac_seen" >&2;}
18635         ac_warn_datarootdir=yes
18636       fi
18637     done
18638   fi
18639
18640 if test "x$ac_warn_datarootdir" = xyes; then
18641   ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
18642 fi
18643
18644 EOF
18645 cat >>$CONFIG_STATUS <<EOF
18646   sed "$ac_vpsub
18647 $extrasub
18648 EOF
18649 cat >>$CONFIG_STATUS <<\EOF
18650 :t
18651 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
18652 s,@configure_input@,$configure_input,;t t
18653 s,@srcdir@,$ac_srcdir,;t t
18654 s,@top_srcdir@,$ac_top_srcdir,;t t
18655 s,@INSTALL@,$ac_INSTALL,;t t
18656 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
18657   rm -f $tmp/stdin
18658   if test x"$ac_file" != x-; then
18659     cp $tmp/out $ac_file
18660
18661     for ac_name in prefix exec_prefix datarootdir
18662     do
18663         ac_seen=`fgrep -n '${'$ac_name'[:=].*}' $ac_file`
18664         if test -n "$ac_seen"; then
18665             ac_init=`egrep '[   ]*'$ac_name'[   ]*=' $ac_file`
18666             if test -z "$ac_init"; then
18667               ac_seen=`echo "$ac_seen" |sed -e 's,^,'$ac_file':,'`
18668               { echo "$as_me:18668: WARNING: Variable $ac_name is used but was not set:
18669 $ac_seen" >&5
18670 echo "$as_me: WARNING: Variable $ac_name is used but was not set:
18671 $ac_seen" >&2;}
18672             fi
18673         fi
18674     done
18675     egrep -n '@[a-z_][a-z_0-9]+@' $ac_file >$tmp/out
18676     egrep -n '@[A-Z_][A-Z_0-9]+@' $ac_file >>$tmp/out
18677     if test -s $tmp/out; then
18678       ac_seen=`sed -e 's,^,'$ac_file':,' < $tmp/out`
18679       { echo "$as_me:18679: WARNING: Some variables may not be substituted:
18680 $ac_seen" >&5
18681 echo "$as_me: WARNING: Some variables may not be substituted:
18682 $ac_seen" >&2;}
18683     fi
18684   else
18685     cat $tmp/out
18686   fi
18687   rm -f $tmp/out
18688
18689 done
18690 EOF
18691 cat >>$CONFIG_STATUS <<\EOF
18692
18693 #
18694 # CONFIG_HEADER section.
18695 #
18696
18697 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
18698 # NAME is the cpp macro being defined and VALUE is the value it is being given.
18699 #
18700 # ac_d sets the value in "#define NAME VALUE" lines.
18701 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
18702 ac_dB='[        ].*$,\1#\2'
18703 ac_dC=' '
18704 ac_dD=',;t'
18705 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
18706 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
18707 ac_iB='\([      ]\),\1#\2define\3'
18708 ac_iC=' '
18709 ac_iD='\4,;t'
18710 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
18711 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
18712 ac_uB='$,\1#\2define\3'
18713 ac_uC=' '
18714 ac_uD=',;t'
18715
18716 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
18717   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
18718   case $ac_file in
18719   - | *:- | *:-:* ) # input from stdin
18720         cat >$tmp/stdin
18721         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
18722         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
18723   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
18724         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
18725   * )   ac_file_in=$ac_file.in ;;
18726   esac
18727
18728   test x"$ac_file" != x- && { echo "$as_me:18728: creating $ac_file" >&5
18729 echo "$as_me: creating $ac_file" >&6;}
18730
18731   # First look for the input files in the build tree, otherwise in the
18732   # src tree.
18733   ac_file_inputs=`IFS=:
18734     for f in $ac_file_in; do
18735       case $f in
18736       -) echo $tmp/stdin ;;
18737       [\\/$]*)
18738          # Absolute (can't be DOS-style, as IFS=:)
18739          test -f "$f" || { { echo "$as_me:18739: error: cannot find input file: $f" >&5
18740 echo "$as_me: error: cannot find input file: $f" >&2;}
18741    { (exit 1); exit 1; }; }
18742          echo $f;;
18743       *) # Relative
18744          if test -f "$f"; then
18745            # Build tree
18746            echo $f
18747          elif test -f "$srcdir/$f"; then
18748            # Source tree
18749            echo $srcdir/$f
18750          else
18751            # /dev/null tree
18752            { { echo "$as_me:18752: error: cannot find input file: $f" >&5
18753 echo "$as_me: error: cannot find input file: $f" >&2;}
18754    { (exit 1); exit 1; }; }
18755          fi;;
18756       esac
18757     done` || { (exit 1); exit 1; }
18758   # Remove the trailing spaces.
18759   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
18760
18761 EOF
18762
18763 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
18764 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
18765 # be either 'cat' or 'sort'.
18766 cat confdefs.h | uniq >conftest.vals
18767
18768 # Break up conftest.vals because some shells have a limit on
18769 # the size of here documents, and old seds have small limits too.
18770
18771 rm -f conftest.tail
18772 echo '  rm -f conftest.frag' >> $CONFIG_STATUS
18773 while grep . conftest.vals >/dev/null
18774 do
18775   # Write chunks of a limited-size here document to conftest.frag.
18776   echo '  cat >> conftest.frag <<CEOF' >> $CONFIG_STATUS
18777   sed ${ac_max_here_lines}q conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> $CONFIG_STATUS
18778   echo 'CEOF' >> $CONFIG_STATUS
18779   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
18780   rm -f conftest.vals
18781   mv conftest.tail conftest.vals
18782 done
18783 rm -f conftest.vals
18784
18785 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
18786 # marker @DEFS@.
18787 echo '  cat >> conftest.edit <<CEOF
18788 /@DEFS@/r conftest.frag
18789 /@DEFS@/d
18790 CEOF
18791 sed -f conftest.edit $tmp/in > $tmp/out
18792 rm -f $tmp/in
18793 mv $tmp/out $tmp/in
18794 rm -f conftest.edit conftest.frag
18795 ' >> $CONFIG_STATUS
18796
18797 cat >>$CONFIG_STATUS <<\EOF
18798   # Let's still pretend it is `configure' which instantiates (i.e., don't
18799   # use $as_me), people would be surprised to read:
18800   #    /* config.h.  Generated automatically by config.status.  */
18801   if test x"$ac_file" = x-; then
18802     echo "/* Generated automatically by configure.  */" >$tmp/config.h
18803   else
18804     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
18805   fi
18806   cat $tmp/in >>$tmp/config.h
18807   rm -f $tmp/in
18808   if test x"$ac_file" != x-; then
18809     if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
18810       { echo "$as_me:18810: $ac_file is unchanged" >&5
18811 echo "$as_me: $ac_file is unchanged" >&6;}
18812     else
18813       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
18814          X"$ac_file" : 'X\(//\)[^/]' \| \
18815          X"$ac_file" : 'X\(//\)$' \| \
18816          X"$ac_file" : 'X\(/\)' \| \
18817          .     : '\(.\)' 2>/dev/null ||
18818 echo X"$ac_file" |
18819     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
18820           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
18821           /^X\(\/\/\)$/{ s//\1/; q; }
18822           /^X\(\/\).*/{ s//\1/; q; }
18823           s/.*/./; q'`
18824       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
18825         { case "$ac_dir" in
18826   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
18827   *)                      as_incr_dir=.;;
18828 esac
18829 as_dummy="$ac_dir"
18830 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
18831   case $as_mkdir_dir in
18832     # Skip DOS drivespec
18833     ?:) as_incr_dir=$as_mkdir_dir ;;
18834     *)
18835       as_incr_dir=$as_incr_dir/$as_mkdir_dir
18836       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
18837     ;;
18838   esac
18839 done; }
18840
18841       fi
18842       rm -f $ac_file
18843       mv $tmp/config.h $ac_file
18844     fi
18845   else
18846     cat $tmp/config.h
18847     rm -f $tmp/config.h
18848   fi
18849 done
18850 EOF
18851 cat >>$CONFIG_STATUS <<\EOF
18852 #
18853 # CONFIG_COMMANDS section.
18854 #
18855 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
18856   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
18857   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
18858
18859   case $ac_dest in
18860     default )
18861
18862 for cf_dir in .
18863 do
18864         if test ! -d $srcdir/$cf_dir; then
18865                 continue
18866         elif test -f $srcdir/$cf_dir/programs; then
18867                 $AWK -f $srcdir/mk-test.awk INSTALL=yes ECHO_LINK="$ECHO_LD" $srcdir/$cf_dir/programs >>$cf_dir/Makefile
18868         fi
18869 done
18870
18871         cat >>Makefile <<TEST_EOF
18872
18873 # These rules are generated so we do not rely on suffix rules, which do not
18874 # work consistently for different make-programs (the '\$(MODEL)/' confuses
18875 # some, and the '\$x' confuses others).
18876 TEST_EOF
18877
18878 LIST=`sed -e 's/[       ].*//' -e '/^[#@]/d' $srcdir/modules`
18879 for N in $LIST
18880 do
18881         cat >>Makefile <<TEST_EOF
18882
18883 \$(MODEL)/$N.o : \$(srcdir)/$N.c \\
18884         \$(srcdir)/test.priv.h \\
18885         ncurses_cfg.h
18886         $SHOW_CC
18887         $ECHO_CC\$(CC) -c \$(CFLAGS_DEFAULT) \$(srcdir)/$N.c
18888 TEST_EOF
18889 done
18890
18891 if test -f ../config.guess && test -f ../config.sub
18892 then
18893         cat >>Makefile <<TEST_EOF
18894
18895 # if we used CF_INHERIT for getting these files, we can remove them
18896 distclean::
18897         rm -f config.guess config.sub
18898 TEST_EOF
18899 fi
18900  ;;
18901   esac
18902 done
18903 EOF
18904
18905 cat >>$CONFIG_STATUS <<\EOF
18906
18907 { (exit 0); exit 0; }
18908 EOF
18909 chmod +x $CONFIG_STATUS
18910 ac_clean_files=$ac_clean_files_save
18911
18912 # configure is writing to config.log, and then calls config.status.
18913 # config.status does its own redirection, appending to config.log.
18914 # Unfortunately, on DOS this fails, as config.log is still kept open
18915 # by configure, so config.status won't be able to write to it; its
18916 # output is simply discarded.  So we exec the FD to /dev/null,
18917 # effectively closing config.log, so it can be properly (re)opened and
18918 # appended to by config.status.  When coming back to configure, we
18919 # need to make the FD available again.
18920 if test "$no_create" != yes; then
18921   ac_cs_success=:
18922   exec 5>/dev/null
18923   $SHELL $CONFIG_STATUS || ac_cs_success=false
18924   exec 5>>config.log
18925   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
18926   # would make configure fail if this is the last instruction.
18927   $ac_cs_success || { (exit 1); exit 1; }
18928 fi
18929