]> ncurses.scripts.mit.edu Git - ncurses.git/blob - test/configure
ncurses 6.0 - patch 20160409
[ncurses.git] / test / configure
1 #! /bin/sh
2 # Guess values for system-dependent variables and create Makefiles.
3 # Generated by Autoconf 2.52.20150926.
4 #
5 # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
6 # Free Software Foundation, Inc.
7 # This configure script is free software; the Free Software Foundation
8 # gives unlimited permission to copy, distribute and modify it.
9
10 # Avoid depending upon Character Ranges.
11 as_cr_letters='abcdefghijklmnopqrstuvwxyz'
12 as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
13 as_cr_Letters=$as_cr_letters$as_cr_LETTERS
14 as_cr_digits='0123456789'
15 as_cr_alnum=$as_cr_Letters$as_cr_digits
16
17 # Sed expression to map a string onto a valid variable name.
18 as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
19
20 # Sed expression to map a string onto a valid CPP name.
21 as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
22
23 # Be Bourne compatible
24 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
25   emulate sh
26   NULLCMD=:
27 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
28   set -o posix
29 fi
30
31 # Name of the executable.
32 as_me=`echo "$0" |sed 's,.*[\\/],,'`
33
34 if expr a : '\(a\)' >/dev/null 2>&1; then
35   as_expr=expr
36 else
37   as_expr=false
38 fi
39
40 rm -f conf$$ conf$$.exe conf$$.file
41 echo >conf$$.file
42 if ln -s conf$$.file conf$$ 2>/dev/null; then
43   # We could just check for DJGPP; but this test a) works b) is more generic
44   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
45   if test -f conf$$.exe; then
46     # Don't use ln at all; we don't have any links
47     as_ln_s='cp -p'
48   else
49     as_ln_s='ln -s'
50   fi
51 elif ln conf$$.file conf$$ 2>/dev/null; then
52   as_ln_s=ln
53 else
54   as_ln_s='cp -p'
55 fi
56 rm -f conf$$ conf$$.exe conf$$.file
57
58 as_executable_p="test -f"
59
60 # Support unset when possible.
61 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
62   as_unset=unset
63 else
64   as_unset=false
65 fi
66
67 # NLS nuisances.
68 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
69 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
70 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
71 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
72 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
73 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
74 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
75 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
76
77 # IFS
78 # We need space, tab and new line, in precisely that order.
79 as_nl='
80 '
81 IFS="   $as_nl"
82
83 # CDPATH.
84 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
85
86 # Name of the host.
87 # hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
88 # so uname gets run too.
89 ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
90
91 exec 6>&1
92
93 #
94 # Initializations.
95 #
96 ac_default_prefix=/usr/local
97 cross_compiling=no
98 subdirs=
99 MFLAGS= MAKEFLAGS=
100 SHELL=${CONFIG_SHELL-/bin/sh}
101
102 # Maximum number of lines to put in a shell here document.
103 # This variable seems obsolete.  It should probably be removed, and
104 # only ac_max_sed_lines should be used.
105 : ${ac_max_here_lines=38}
106
107 ac_unique_file="ncurses.c"
108
109 # Initialize some variables set by options.
110 ac_init_help=
111 ac_init_version=false
112 # The variables have the same names as the options, with
113 # dashes changed to underlines.
114 cache_file=/dev/null
115 exec_prefix=NONE
116 no_create=
117 no_recursion=
118 prefix=NONE
119 program_prefix=NONE
120 program_suffix=NONE
121 program_transform_name=s,x,x,
122 silent=
123 site=
124 srcdir=
125 verbose=
126 x_includes=NONE
127 x_libraries=NONE
128
129 # Installation directory options.
130 # These are left unexpanded so users can "make install exec_prefix=/foo"
131 # and all the variables that are supposed to be based on exec_prefix
132 # by default will actually change.
133 # Use braces instead of parens because sh, perl, etc. also accept them.
134 bindir='${exec_prefix}/bin'
135 sbindir='${exec_prefix}/sbin'
136 libexecdir='${exec_prefix}/libexec'
137 datarootdir='${prefix}/share'
138 datadir='${datarootdir}'
139 sysconfdir='${prefix}/etc'
140 sharedstatedir='${prefix}/com'
141 localstatedir='${prefix}/var'
142 libdir='${exec_prefix}/lib'
143 includedir='${prefix}/include'
144 oldincludedir='/usr/include'
145 infodir='${datarootdir}/info'
146 mandir='${datarootdir}/man'
147
148 # Identity of this package.
149 PACKAGE_NAME=
150 PACKAGE_TARNAME=
151 PACKAGE_VERSION=
152 PACKAGE_STRING=
153 PACKAGE_BUGREPORT=
154
155 ac_prev=
156 for ac_option
157 do
158   # If the previous option needs an argument, assign it.
159   if test -n "$ac_prev"; then
160     eval "$ac_prev=\$ac_option"
161     ac_prev=
162     continue
163   fi
164
165   ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
166
167   # Accept the important Cygnus configure options, so we can diagnose typos.
168
169   case $ac_option in
170
171   -bindir | --bindir | --bindi | --bind | --bin | --bi)
172     ac_prev=bindir ;;
173   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
174     bindir=$ac_optarg ;;
175
176   -build | --build | --buil | --bui | --bu)
177     ac_prev=build_alias ;;
178   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
179     build_alias=$ac_optarg ;;
180
181   -cache-file | --cache-file | --cache-fil | --cache-fi \
182   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
183     ac_prev=cache_file ;;
184   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
185   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
186     cache_file=$ac_optarg ;;
187
188   --config-cache | -C)
189     cache_file=config.cache ;;
190
191   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
192     ac_prev=datadir ;;
193   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
194   | --da=*)
195     datadir=$ac_optarg ;;
196
197   -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
198   | --dataroo | --dataro | --datar)
199     ac_prev=datarootdir ;;
200   -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
201   | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
202     datarootdir=$ac_optarg ;;
203
204   -disable-* | --disable-*)
205     ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
206     # Reject names that are not valid shell variable names.
207     expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
208       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
209    { (exit 1); exit 1; }; }
210     ac_feature=`echo $ac_feature | sed 's/-/_/g'`
211     eval "enable_$ac_feature=no" ;;
212
213   -enable-* | --enable-*)
214     ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
215     # Reject names that are not valid shell variable names.
216     expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
217       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
218    { (exit 1); exit 1; }; }
219     ac_feature=`echo $ac_feature | sed 's/-/_/g'`
220     case $ac_option in
221       *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
222       *) ac_optarg=yes ;;
223     esac
224     eval "enable_$ac_feature='$ac_optarg'" ;;
225
226   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
227   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
228   | --exec | --exe | --ex)
229     ac_prev=exec_prefix ;;
230   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
231   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
232   | --exec=* | --exe=* | --ex=*)
233     exec_prefix=$ac_optarg ;;
234
235   -gas | --gas | --ga | --g)
236     # Obsolete; use --with-gas.
237     with_gas=yes ;;
238
239   -help | --help | --hel | --he | -h)
240     ac_init_help=long ;;
241   -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
242     ac_init_help=recursive ;;
243   -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
244     ac_init_help=short ;;
245
246   -host | --host | --hos | --ho)
247     ac_prev=host_alias ;;
248   -host=* | --host=* | --hos=* | --ho=*)
249     host_alias=$ac_optarg ;;
250
251   -includedir | --includedir | --includedi | --included | --include \
252   | --includ | --inclu | --incl | --inc)
253     ac_prev=includedir ;;
254   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
255   | --includ=* | --inclu=* | --incl=* | --inc=*)
256     includedir=$ac_optarg ;;
257
258   -infodir | --infodir | --infodi | --infod | --info | --inf)
259     ac_prev=infodir ;;
260   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
261     infodir=$ac_optarg ;;
262
263   -libdir | --libdir | --libdi | --libd)
264     ac_prev=libdir ;;
265   -libdir=* | --libdir=* | --libdi=* | --libd=*)
266     libdir=$ac_optarg ;;
267
268   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
269   | --libexe | --libex | --libe)
270     ac_prev=libexecdir ;;
271   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
272   | --libexe=* | --libex=* | --libe=*)
273     libexecdir=$ac_optarg ;;
274
275   -localstatedir | --localstatedir | --localstatedi | --localstated \
276   | --localstate | --localstat | --localsta | --localst \
277   | --locals | --local | --loca | --loc | --lo)
278     ac_prev=localstatedir ;;
279   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
280   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
281   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
282     localstatedir=$ac_optarg ;;
283
284   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
285     ac_prev=mandir ;;
286   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
287     mandir=$ac_optarg ;;
288
289   -nfp | --nfp | --nf)
290     # Obsolete; use --without-fp.
291     with_fp=no ;;
292
293   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
294   | --no-cr | --no-c)
295     no_create=yes ;;
296
297   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
298   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
299     no_recursion=yes ;;
300
301   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
302   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
303   | --oldin | --oldi | --old | --ol | --o)
304     ac_prev=oldincludedir ;;
305   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
306   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
307   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
308     oldincludedir=$ac_optarg ;;
309
310   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
311     ac_prev=prefix ;;
312   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
313     prefix=$ac_optarg ;;
314
315   -program-prefix | --program-prefix | --program-prefi | --program-pref \
316   | --program-pre | --program-pr | --program-p)
317     ac_prev=program_prefix ;;
318   -program-prefix=* | --program-prefix=* | --program-prefi=* \
319   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
320     program_prefix=$ac_optarg ;;
321
322   -program-suffix | --program-suffix | --program-suffi | --program-suff \
323   | --program-suf | --program-su | --program-s)
324     ac_prev=program_suffix ;;
325   -program-suffix=* | --program-suffix=* | --program-suffi=* \
326   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
327     program_suffix=$ac_optarg ;;
328
329   -program-transform-name | --program-transform-name \
330   | --program-transform-nam | --program-transform-na \
331   | --program-transform-n | --program-transform- \
332   | --program-transform | --program-transfor \
333   | --program-transfo | --program-transf \
334   | --program-trans | --program-tran \
335   | --progr-tra | --program-tr | --program-t)
336     ac_prev=program_transform_name ;;
337   -program-transform-name=* | --program-transform-name=* \
338   | --program-transform-nam=* | --program-transform-na=* \
339   | --program-transform-n=* | --program-transform-=* \
340   | --program-transform=* | --program-transfor=* \
341   | --program-transfo=* | --program-transf=* \
342   | --program-trans=* | --program-tran=* \
343   | --progr-tra=* | --program-tr=* | --program-t=*)
344     program_transform_name=$ac_optarg ;;
345
346   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
347   | -silent | --silent | --silen | --sile | --sil)
348     silent=yes ;;
349
350   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
351     ac_prev=sbindir ;;
352   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
353   | --sbi=* | --sb=*)
354     sbindir=$ac_optarg ;;
355
356   -sharedstatedir | --sharedstatedir | --sharedstatedi \
357   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
358   | --sharedst | --shareds | --shared | --share | --shar \
359   | --sha | --sh)
360     ac_prev=sharedstatedir ;;
361   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
362   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
363   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
364   | --sha=* | --sh=*)
365     sharedstatedir=$ac_optarg ;;
366
367   -site | --site | --sit)
368     ac_prev=site ;;
369   -site=* | --site=* | --sit=*)
370     site=$ac_optarg ;;
371
372   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
373     ac_prev=srcdir ;;
374   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
375     srcdir=$ac_optarg ;;
376
377   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
378   | --syscon | --sysco | --sysc | --sys | --sy)
379     ac_prev=sysconfdir ;;
380   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
381   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
382     sysconfdir=$ac_optarg ;;
383
384   -target | --target | --targe | --targ | --tar | --ta | --t)
385     ac_prev=target_alias ;;
386   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
387     target_alias=$ac_optarg ;;
388
389   -v | -verbose | --verbose | --verbos | --verbo | --verb)
390     verbose=yes ;;
391
392   -version | --version | --versio | --versi | --vers | -V)
393     ac_init_version=: ;;
394
395   -with-* | --with-*)
396     ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
397     # Reject names that are not valid shell variable names.
398     expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
399       { echo "$as_me: error: invalid package name: $ac_package" >&2
400    { (exit 1); exit 1; }; }
401     ac_package=`echo $ac_package| sed 's/-/_/g'`
402     case $ac_option in
403       *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
404       *) ac_optarg=yes ;;
405     esac
406     eval "with_$ac_package='$ac_optarg'" ;;
407
408   -without-* | --without-*)
409     ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
410     # Reject names that are not valid shell variable names.
411     expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
412       { echo "$as_me: error: invalid package name: $ac_package" >&2
413    { (exit 1); exit 1; }; }
414     ac_package=`echo $ac_package | sed 's/-/_/g'`
415     eval "with_$ac_package=no" ;;
416
417   --x)
418     # Obsolete; use --with-x.
419     with_x=yes ;;
420
421   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
422   | --x-incl | --x-inc | --x-in | --x-i)
423     ac_prev=x_includes ;;
424   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
425   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
426     x_includes=$ac_optarg ;;
427
428   -x-libraries | --x-libraries | --x-librarie | --x-librari \
429   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
430     ac_prev=x_libraries ;;
431   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
432   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
433     x_libraries=$ac_optarg ;;
434
435   -*) { echo "$as_me: error: unrecognized option: $ac_option
436 Try \`$0 --help' for more information." >&2
437    { (exit 1); exit 1; }; }
438     ;;
439
440   *=*)
441     ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
442     # Reject names that are not valid shell variable names.
443     expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
444       { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
445    { (exit 1); exit 1; }; }
446     ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
447     eval "$ac_envvar='$ac_optarg'"
448     export $ac_envvar ;;
449
450   *)
451     # FIXME: should be removed in autoconf 3.0.
452     echo "$as_me: WARNING: you should use --build, --host, --target" >&2
453     expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
454       echo "$as_me: WARNING: invalid host type: $ac_option" >&2
455     : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
456     ;;
457
458   esac
459 done
460
461 if test -n "$ac_prev"; then
462   ac_option=--`echo $ac_prev | sed 's/_/-/g'`
463   { echo "$as_me: error: missing argument to $ac_option" >&2
464    { (exit 1); exit 1; }; }
465 fi
466
467 # Be sure to have absolute paths.
468 for ac_var in exec_prefix prefix
469 do
470   eval ac_val=$`echo $ac_var`
471   case $ac_val in
472     [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
473     *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
474    { (exit 1); exit 1; }; };;
475   esac
476 done
477
478 # Be sure to have absolute paths.
479 for ac_var in bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir \
480               localstatedir libdir includedir oldincludedir infodir mandir
481 do
482   eval ac_val=$`echo $ac_var`
483   case $ac_val in
484     [\\/$]* | ?:[\\/]* ) ;;
485     *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
486    { (exit 1); exit 1; }; };;
487   esac
488 done
489
490 # There might be people who depend on the old broken behavior: `$host'
491 # used to hold the argument of --host etc.
492 build=$build_alias
493 host=$host_alias
494 target=$target_alias
495
496 # FIXME: should be removed in autoconf 3.0.
497 if test "x$host_alias" != x; then
498   if test "x$build_alias" = x; then
499     cross_compiling=maybe
500     echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
501     If a cross compiler is detected then cross compile mode will be used." >&2
502   elif test "x$build_alias" != "x$host_alias"; then
503     cross_compiling=yes
504   fi
505 fi
506
507 ac_tool_prefix=
508 test -n "$host_alias" && ac_tool_prefix=$host_alias-
509
510 test "$silent" = yes && exec 6>/dev/null
511
512 # Find the source files, if location was not specified.
513 if test -z "$srcdir"; then
514   ac_srcdir_defaulted=yes
515   # Try the directory containing this script, then its parent.
516   ac_prog=$0
517   ac_confdir=`echo "$ac_prog" | sed 's%[\\/][^\\/][^\\/]*$%%'`
518   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
519   srcdir=$ac_confdir
520   if test ! -r $srcdir/$ac_unique_file; then
521     srcdir=..
522   fi
523 else
524   ac_srcdir_defaulted=no
525 fi
526 if test ! -r $srcdir/$ac_unique_file; then
527   if test "$ac_srcdir_defaulted" = yes; then
528     { echo "$as_me: error: cannot find sources in $ac_confdir or .." >&2
529    { (exit 1); exit 1; }; }
530   else
531     { echo "$as_me: error: cannot find sources in $srcdir" >&2
532    { (exit 1); exit 1; }; }
533   fi
534 fi
535 srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
536 ac_env_build_alias_set=${build_alias+set}
537 ac_env_build_alias_value=$build_alias
538 ac_cv_env_build_alias_set=${build_alias+set}
539 ac_cv_env_build_alias_value=$build_alias
540 ac_env_host_alias_set=${host_alias+set}
541 ac_env_host_alias_value=$host_alias
542 ac_cv_env_host_alias_set=${host_alias+set}
543 ac_cv_env_host_alias_value=$host_alias
544 ac_env_target_alias_set=${target_alias+set}
545 ac_env_target_alias_value=$target_alias
546 ac_cv_env_target_alias_set=${target_alias+set}
547 ac_cv_env_target_alias_value=$target_alias
548 ac_env_CC_set=${CC+set}
549 ac_env_CC_value=$CC
550 ac_cv_env_CC_set=${CC+set}
551 ac_cv_env_CC_value=$CC
552 ac_env_CFLAGS_set=${CFLAGS+set}
553 ac_env_CFLAGS_value=$CFLAGS
554 ac_cv_env_CFLAGS_set=${CFLAGS+set}
555 ac_cv_env_CFLAGS_value=$CFLAGS
556 ac_env_LDFLAGS_set=${LDFLAGS+set}
557 ac_env_LDFLAGS_value=$LDFLAGS
558 ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
559 ac_cv_env_LDFLAGS_value=$LDFLAGS
560 ac_env_CPPFLAGS_set=${CPPFLAGS+set}
561 ac_env_CPPFLAGS_value=$CPPFLAGS
562 ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
563 ac_cv_env_CPPFLAGS_value=$CPPFLAGS
564 ac_env_CPP_set=${CPP+set}
565 ac_env_CPP_value=$CPP
566 ac_cv_env_CPP_set=${CPP+set}
567 ac_cv_env_CPP_value=$CPP
568
569 #
570 # Report the --help message.
571 #
572 if test "$ac_init_help" = "long"; then
573   # Omit some internal or obsolete options to make the list less imposing.
574   # This message is too long to be a string in the A/UX 3.1 sh.
575   cat <<EOF
576 \`configure' configures this package to adapt to many kinds of systems.
577
578 Usage: $0 [OPTION]... [VAR=VALUE]...
579
580 To assign environment variables (e.g., CC, CFLAGS...), specify them as
581 VAR=VALUE.  See below for descriptions of some of the useful variables.
582
583 Defaults for the options are specified in brackets.
584
585 Configuration:
586   -h, --help              display this help and exit
587       --help=short        display options specific to this package
588       --help=recursive    display the short help of all the included packages
589   -V, --version           display version information and exit
590   -q, --quiet, --silent   do not print \`checking...' messages
591       --cache-file=FILE   cache test results in FILE [disabled]
592   -C, --config-cache      alias for \`--cache-file=config.cache'
593   -n, --no-create         do not create output files
594       --srcdir=DIR        find the sources in DIR [configure dir or \`..']
595
596 EOF
597
598   cat <<EOF
599 Installation directories:
600   --prefix=PREFIX         install architecture-independent files in PREFIX
601                           [$ac_default_prefix]
602   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
603                           [PREFIX]
604
605 By default, \`make install' will install all the files in
606 \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
607 an installation prefix other than \`$ac_default_prefix' using \`--prefix',
608 for instance \`--prefix=\$HOME'.
609
610 For better control, use the options below.
611
612 Fine tuning of the installation directories:
613   --bindir=DIR            user executables [EPREFIX/bin]
614   --sbindir=DIR           system admin executables [EPREFIX/sbin]
615   --libexecdir=DIR        program executables [EPREFIX/libexec]
616   --datarootdir=DIR       read-only architecture-independent data [PREFIX/share]
617   --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
618   --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
619   --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
620   --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
621   --libdir=DIR            object code libraries [EPREFIX/lib]
622   --includedir=DIR        C header files [PREFIX/include]
623   --oldincludedir=DIR     C header files for non-gcc [/usr/include]
624   --infodir=DIR           info documentation [DATAROOTDIR/info]
625   --mandir=DIR            man documentation [DATAROOTDIR/man]
626 EOF
627
628   cat <<\EOF
629
630 Program names:
631   --program-prefix=PREFIX            prepend PREFIX to installed program names
632   --program-suffix=SUFFIX            append SUFFIX to installed program names
633   --program-transform-name=PROGRAM   run sed PROGRAM on installed program names
634
635 X features:
636   --x-includes=DIR    X include files are in DIR
637   --x-libraries=DIR   X library files are in DIR
638
639 System types:
640   --build=BUILD           configure for building on BUILD [guessed]
641   --host=HOST       build programs to run on HOST [BUILD]
642 EOF
643 fi
644
645 if test -n "$ac_init_help"; then
646
647   cat <<\EOF
648
649 Optional Packages:
650   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
651   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
652
653 Optional Features:
654   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
655   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
656
657 General Options:
658   --with-pkg-config{=path} enable/disable use of pkg-config
659   --disable-echo          do not display "compiling" commands
660 Curses Version-dependent Options:
661   --with-ncurses-wrap-prefix naming-prefix for ncurses wrapped-variables
662   --disable-widec         disable checks for wide-character functions
663   --with-curses-dir=DIR   directory in which (n)curses is installed
664   --with-screen=XXX       use specified curses-libraries
665   --with-ncursesw         use wide ncurses-libraries
666   --with-ncurses          use ncurses-libraries
667   --with-pdcurses         compile/link with pdcurses X11 library
668   --with-curses-colr      compile/link with HPUX 10.x color-curses
669   --with-curses-5lib      compile/link with SunOS 5lib curses
670   --with-Xaw3d            link with Xaw 3d library
671   --with-Xaw3dxft         link with Xaw 3d xft library
672   --with-neXtaw           link with neXT Athena library
673   --with-XawPlus          link with Athena-Plus library
674   --with-x                use the X Window System
675 Testing/development Options:
676   --enable-warnings       test: turn on gcc compiler warnings
677   --with-dmalloc          test: use Gray Watson's dmalloc library
678   --with-dbmalloc         test: use Conor Cahill's dbmalloc library
679   --with-valgrind         test: use valgrind
680   --disable-leaks         test: free permanent memory, analyze leaks
681   --disable-rpath-hack    don't add rpath options for additional libraries
682
683 Some influential environment variables:
684   CC          C compiler command
685   CFLAGS      C compiler flags
686   LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
687               nonstandard directory <lib dir>
688   CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
689               headers in a nonstandard directory <include dir>
690   CPP         C preprocessor
691
692 Use these variables to override the choices made by `configure' or to help
693 it to find libraries and programs with nonstandard names/locations.
694
695 EOF
696 fi
697
698 if test "$ac_init_help" = "recursive"; then
699   # If there are subdirs, report their specific --help.
700   ac_popdir=`pwd`
701   for ac_subdir in : $ac_subdirs_all; do test "x$ac_subdir" = x: && continue
702     cd $ac_subdir
703     # A "../" for each directory in /$ac_subdir.
704     ac_dots=`echo $ac_subdir |
705              sed 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g'`
706
707     case $srcdir in
708     .) # No --srcdir option.  We are building in place.
709       ac_sub_srcdir=$srcdir ;;
710     [\\/]* | ?:[\\/]* ) # Absolute path.
711       ac_sub_srcdir=$srcdir/$ac_subdir ;;
712     *) # Relative path.
713       ac_sub_srcdir=$ac_dots$srcdir/$ac_subdir ;;
714     esac
715
716     # Check for guested configure; otherwise get Cygnus style configure.
717     if test -f $ac_sub_srcdir/configure.gnu; then
718       echo
719       $SHELL $ac_sub_srcdir/configure.gnu  --help=recursive
720     elif test -f $ac_sub_srcdir/configure; then
721       echo
722       $SHELL $ac_sub_srcdir/configure  --help=recursive
723     elif test -f $ac_sub_srcdir/configure.ac ||
724            test -f $ac_sub_srcdir/configure.in; then
725       echo
726       $ac_configure --help
727     else
728       echo "$as_me: WARNING: no configuration information is in $ac_subdir" >&2
729     fi
730     cd $ac_popdir
731   done
732 fi
733
734 test -n "$ac_init_help" && exit 0
735 if $ac_init_version; then
736   cat <<\EOF
737
738 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
739 Free Software Foundation, Inc.
740 This configure script is free software; the Free Software Foundation
741 gives unlimited permission to copy, distribute and modify it.
742 EOF
743   exit 0
744 fi
745 exec 5>config.log
746 cat >&5 <<EOF
747 This file contains any messages produced by compilers while
748 running configure, to aid debugging if configure makes a mistake.
749
750 It was created by $as_me, which was
751 generated by GNU Autoconf 2.52.20150926.  Invocation command line was
752
753   $ $0 $@
754
755 EOF
756 {
757 cat <<_ASUNAME
758 ## ---------- ##
759 ## Platform.  ##
760 ## ---------- ##
761
762 hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
763 uname -m = `(uname -m) 2>/dev/null || echo unknown`
764 uname -r = `(uname -r) 2>/dev/null || echo unknown`
765 uname -s = `(uname -s) 2>/dev/null || echo unknown`
766 uname -v = `(uname -v) 2>/dev/null || echo unknown`
767
768 /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
769 /bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
770
771 /bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
772 /usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
773 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
774 hostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
775 /bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
776 /usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
777 /bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
778
779 PATH = $PATH
780
781 _ASUNAME
782 } >&5
783
784 cat >&5 <<EOF
785 ## ------------ ##
786 ## Core tests.  ##
787 ## ------------ ##
788
789 EOF
790
791 # Keep a trace of the command line.
792 # Strip out --no-create and --no-recursion so they do not pile up.
793 # Also quote any args containing shell meta-characters.
794 ac_configure_args=
795 ac_sep=
796 for ac_arg
797 do
798   case $ac_arg in
799   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
800   | --no-cr | --no-c) ;;
801   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
802   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
803   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
804     ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"`
805     ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
806     ac_sep=" " ;;
807   *) ac_configure_args="$ac_configure_args$ac_sep$ac_arg"
808      ac_sep=" " ;;
809   esac
810   # Get rid of the leading space.
811 done
812
813 # When interrupted or exit'd, cleanup temporary files, and complete
814 # config.log.  We remove comments because anyway the quotes in there
815 # would cause problems or look ugly.
816 trap 'exit_status=$?
817   # Save into config.log some information that might help in debugging.
818   echo >&5
819   echo "## ----------------- ##" >&5
820   echo "## Cache variables.  ##" >&5
821   echo "## ----------------- ##" >&5
822   echo >&5
823   # The following way of writing the cache mishandles newlines in values,
824 {
825   (set) 2>&1 |
826     case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
827     *ac_space=\ *)
828       sed -n \
829         "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
830           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
831       ;;
832     *)
833       sed -n \
834         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
835       ;;
836     esac;
837 } >&5
838   sed "/^$/d" confdefs.h >conftest.log
839   if test -s conftest.log; then
840     echo >&5
841     echo "## ------------ ##" >&5
842     echo "## confdefs.h.  ##" >&5
843     echo "## ------------ ##" >&5
844     echo >&5
845     cat conftest.log >&5
846   fi
847   (echo; echo) >&5
848   test "$ac_signal" != 0 &&
849     echo "$as_me: caught signal $ac_signal" >&5
850   echo "$as_me: exit $exit_status" >&5
851   rm -rf conftest* confdefs* core core.* *.core conf$$* $ac_clean_files &&
852     exit $exit_status
853      ' 0
854 for ac_signal in 1 2 13 15; do
855   trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
856 done
857 ac_signal=0
858
859 # confdefs.h avoids OS command line length limits that DEFS can exceed.
860 rm -rf conftest* confdefs.h
861 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
862 echo >confdefs.h
863
864 # Let the site file select an alternate cache file if it wants to.
865 # Prefer explicitly selected file to automatically selected ones.
866 if test -z "$CONFIG_SITE"; then
867   if test "x$prefix" != xNONE; then
868     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
869   else
870     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
871   fi
872 fi
873 for ac_site_file in $CONFIG_SITE; do
874   if test -r "$ac_site_file"; then
875     { echo "$as_me:875: loading site script $ac_site_file" >&5
876 echo "$as_me: loading site script $ac_site_file" >&6;}
877     cat "$ac_site_file" >&5
878     . "$ac_site_file"
879   fi
880 done
881
882 if test -r "$cache_file"; then
883   # Some versions of bash will fail to source /dev/null (special
884   # files actually), so we avoid doing that.
885   if test -f "$cache_file"; then
886     { echo "$as_me:886: loading cache $cache_file" >&5
887 echo "$as_me: loading cache $cache_file" >&6;}
888     case $cache_file in
889       [\\/]* | ?:[\\/]* ) . $cache_file;;
890       *)                      . ./$cache_file;;
891     esac
892   fi
893 else
894   { echo "$as_me:894: creating cache $cache_file" >&5
895 echo "$as_me: creating cache $cache_file" >&6;}
896   >$cache_file
897 fi
898
899 # Check that the precious variables saved in the cache have kept the same
900 # value.
901 ac_cache_corrupted=false
902 for ac_var in `(set) 2>&1 |
903                sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
904   eval ac_old_set=\$ac_cv_env_${ac_var}_set
905   eval ac_new_set=\$ac_env_${ac_var}_set
906   eval ac_old_val="\$ac_cv_env_${ac_var}_value"
907   eval ac_new_val="\$ac_env_${ac_var}_value"
908   case $ac_old_set,$ac_new_set in
909     set,)
910       { echo "$as_me:910: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
911 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
912       ac_cache_corrupted=: ;;
913     ,set)
914       { echo "$as_me:914: error: \`$ac_var' was not set in the previous run" >&5
915 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
916       ac_cache_corrupted=: ;;
917     ,);;
918     *)
919       if test "x$ac_old_val" != "x$ac_new_val"; then
920         { echo "$as_me:920: error: \`$ac_var' has changed since the previous run:" >&5
921 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
922         { echo "$as_me:922:   former value:  $ac_old_val" >&5
923 echo "$as_me:   former value:  $ac_old_val" >&2;}
924         { echo "$as_me:924:   current value: $ac_new_val" >&5
925 echo "$as_me:   current value: $ac_new_val" >&2;}
926         ac_cache_corrupted=:
927       fi;;
928   esac
929   # Pass precious variables to config.status.  It doesn't matter if
930   # we pass some twice (in addition to the command line arguments).
931   if test "$ac_new_set" = set; then
932     case $ac_new_val in
933     *" "*|*"    "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
934       ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"`
935       ac_configure_args="$ac_configure_args '$ac_arg'"
936       ;;
937     *) ac_configure_args="$ac_configure_args $ac_var=$ac_new_val"
938        ;;
939     esac
940   fi
941 done
942 if $ac_cache_corrupted; then
943   { echo "$as_me:943: error: changes in the environment can compromise the build" >&5
944 echo "$as_me: error: changes in the environment can compromise the build" >&2;}
945   { { echo "$as_me:945: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
946 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
947    { (exit 1); exit 1; }; }
948 fi
949
950 ac_ext=c
951 ac_cpp='$CPP $CPPFLAGS'
952 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
953 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
954 ac_compiler_gnu=$ac_cv_c_compiler_gnu
955 ac_main_return=return
956
957 case `echo "testing\c" 2>/dev/null; echo 1,2,3`,`echo -n testing 2>/dev/null; echo 1,2,3` in
958   *c*,-n*) ECHO_N= ECHO_C=      # newlines do not sed ;-) only broken shells would use this case anyway
959                    ECHO_T='     ' ;;
960   *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
961   *)      ECHO_N= ECHO_C='\c' ECHO_T= ;;
962 esac
963 echo "#! $SHELL" >conftest.sh
964 echo  "exit 0"   >>conftest.sh
965 chmod +x conftest.sh
966 if { (echo "$as_me:966: PATH=\".;.\"; conftest.sh") >&5
967   (PATH=".;."; conftest.sh) 2>&5
968   ac_status=$?
969   echo "$as_me:969: \$? = $ac_status" >&5
970   (exit $ac_status); }; then
971   ac_path_separator=';'
972 else
973   ac_path_separator=:
974 fi
975 PATH_SEPARATOR="$ac_path_separator"
976 rm -f conftest.sh
977
978 ac_config_headers="$ac_config_headers ncurses_cfg.h:ncurses_tst.hin"
979
980 test -f config.guess || ( test -f ../config.guess && cp ../config.guess ./ )
981
982 test -f config.sub || ( test -f ../config.sub && cp ../config.sub ./ )
983
984 ac_aux_dir=
985 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
986   if test -f $ac_dir/install-sh; then
987     ac_aux_dir=$ac_dir
988     ac_install_sh="$ac_aux_dir/install-sh -c"
989     break
990   elif test -f $ac_dir/install.sh; then
991     ac_aux_dir=$ac_dir
992     ac_install_sh="$ac_aux_dir/install.sh -c"
993     break
994   elif test -f $ac_dir/shtool; then
995     ac_aux_dir=$ac_dir
996     ac_install_sh="$ac_aux_dir/shtool install -c"
997     break
998   fi
999 done
1000 if test -z "$ac_aux_dir"; then
1001   { { echo "$as_me:1001: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
1002 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
1003    { (exit 1); exit 1; }; }
1004 fi
1005 ac_config_guess="$SHELL $ac_aux_dir/config.guess"
1006 ac_config_sub="$SHELL $ac_aux_dir/config.sub"
1007 ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
1008
1009 # Make sure we can run config.sub.
1010 $ac_config_sub sun4 >/dev/null 2>&1 ||
1011   { { echo "$as_me:1011: error: cannot run $ac_config_sub" >&5
1012 echo "$as_me: error: cannot run $ac_config_sub" >&2;}
1013    { (exit 1); exit 1; }; }
1014
1015 echo "$as_me:1015: checking build system type" >&5
1016 echo $ECHO_N "checking build system type... $ECHO_C" >&6
1017 if test "${ac_cv_build+set}" = set; then
1018   echo $ECHO_N "(cached) $ECHO_C" >&6
1019 else
1020   ac_cv_build_alias=$build_alias
1021 test -z "$ac_cv_build_alias" &&
1022   ac_cv_build_alias=`$ac_config_guess`
1023 test -z "$ac_cv_build_alias" &&
1024   { { echo "$as_me:1024: error: cannot guess build type; you must specify one" >&5
1025 echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
1026    { (exit 1); exit 1; }; }
1027 ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
1028   { { echo "$as_me:1028: error: $ac_config_sub $ac_cv_build_alias failed." >&5
1029 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed." >&2;}
1030    { (exit 1); exit 1; }; }
1031
1032 fi
1033 echo "$as_me:1033: result: $ac_cv_build" >&5
1034 echo "${ECHO_T}$ac_cv_build" >&6
1035 build=$ac_cv_build
1036 build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1037 build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1038 build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1039
1040 if test -f $srcdir/config.guess || test -f $ac_aux_dir/config.guess ; then
1041         echo "$as_me:1041: checking host system type" >&5
1042 echo $ECHO_N "checking host system type... $ECHO_C" >&6
1043 if test "${ac_cv_host+set}" = set; then
1044   echo $ECHO_N "(cached) $ECHO_C" >&6
1045 else
1046   ac_cv_host_alias=$host_alias
1047 test -z "$ac_cv_host_alias" &&
1048   ac_cv_host_alias=$ac_cv_build_alias
1049 ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
1050   { { echo "$as_me:1050: error: $ac_config_sub $ac_cv_host_alias failed" >&5
1051 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
1052    { (exit 1); exit 1; }; }
1053
1054 fi
1055 echo "$as_me:1055: result: $ac_cv_host" >&5
1056 echo "${ECHO_T}$ac_cv_host" >&6
1057 host=$ac_cv_host
1058 host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1059 host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1060 host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1061
1062         system_name="$host_os"
1063 else
1064         system_name="`(uname -s -r) 2>/dev/null`"
1065         if test -z "$system_name" ; then
1066                 system_name="`(hostname) 2>/dev/null`"
1067         fi
1068 fi
1069 test -n "$system_name" &&
1070 cat >>confdefs.h <<EOF
1071 #define SYSTEM_NAME "$system_name"
1072 EOF
1073
1074 if test "${cf_cv_system_name+set}" = set; then
1075   echo $ECHO_N "(cached) $ECHO_C" >&6
1076 else
1077   cf_cv_system_name="$system_name"
1078 fi
1079
1080 test -z "$system_name" && system_name="$cf_cv_system_name"
1081 test -n "$cf_cv_system_name" && echo "$as_me:1081: result: Configuring for $cf_cv_system_name" >&5
1082 echo "${ECHO_T}Configuring for $cf_cv_system_name" >&6
1083
1084 if test ".$system_name" != ".$cf_cv_system_name" ; then
1085         echo "$as_me:1085: result: Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&5
1086 echo "${ECHO_T}Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&6
1087         { { echo "$as_me:1087: error: \"Please remove config.cache and try again.\"" >&5
1088 echo "$as_me: error: \"Please remove config.cache and try again.\"" >&2;}
1089    { (exit 1); exit 1; }; }
1090 fi
1091
1092 test "$program_prefix" != NONE &&
1093   program_transform_name="s,^,$program_prefix,;$program_transform_name"
1094 # Use a double $ so make ignores it.
1095 test "$program_suffix" != NONE &&
1096   program_transform_name="s,\$,$program_suffix,;$program_transform_name"
1097 # Double any \ or $.  echo might interpret backslashes.
1098 # By default was `s,x,x', remove it if useless.
1099 cat <<\_ACEOF >conftest.sed
1100 s/[\\$]/&&/g;s/;s,x,x,$//
1101 _ACEOF
1102 program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
1103 rm conftest.sed
1104
1105 echo "$as_me:1105: checking whether ${MAKE-make} sets \${MAKE}" >&5
1106 echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6
1107 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
1108 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
1109   echo $ECHO_N "(cached) $ECHO_C" >&6
1110 else
1111   cat >conftest.make <<\EOF
1112 all:
1113         @echo 'ac_maketemp="${MAKE}"'
1114 EOF
1115 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
1116 eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
1117 if test -n "$ac_maketemp"; then
1118   eval ac_cv_prog_make_${ac_make}_set=yes
1119 else
1120   eval ac_cv_prog_make_${ac_make}_set=no
1121 fi
1122 rm -f conftest.make
1123 fi
1124 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
1125   echo "$as_me:1125: result: yes" >&5
1126 echo "${ECHO_T}yes" >&6
1127   SET_MAKE=
1128 else
1129   echo "$as_me:1129: result: no" >&5
1130 echo "${ECHO_T}no" >&6
1131   SET_MAKE="MAKE=${MAKE-make}"
1132 fi
1133
1134 ac_ext=c
1135 ac_cpp='$CPP $CPPFLAGS'
1136 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1137 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1138 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1139 ac_main_return=return
1140 if test -n "$ac_tool_prefix"; then
1141   # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
1142 set dummy ${ac_tool_prefix}gcc; ac_word=$2
1143 echo "$as_me:1143: checking for $ac_word" >&5
1144 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1145 if test "${ac_cv_prog_CC+set}" = set; then
1146   echo $ECHO_N "(cached) $ECHO_C" >&6
1147 else
1148   if test -n "$CC"; then
1149   ac_cv_prog_CC="$CC" # Let the user override the test.
1150 else
1151   ac_save_IFS=$IFS; IFS=$ac_path_separator
1152 ac_dummy="$PATH"
1153 for ac_dir in $ac_dummy; do
1154   IFS=$ac_save_IFS
1155   test -z "$ac_dir" && ac_dir=.
1156   $as_executable_p "$ac_dir/$ac_word" || continue
1157 ac_cv_prog_CC="${ac_tool_prefix}gcc"
1158 echo "$as_me:1158: found $ac_dir/$ac_word" >&5
1159 break
1160 done
1161
1162 fi
1163 fi
1164 CC=$ac_cv_prog_CC
1165 if test -n "$CC"; then
1166   echo "$as_me:1166: result: $CC" >&5
1167 echo "${ECHO_T}$CC" >&6
1168 else
1169   echo "$as_me:1169: result: no" >&5
1170 echo "${ECHO_T}no" >&6
1171 fi
1172
1173 fi
1174 if test -z "$ac_cv_prog_CC"; then
1175   ac_ct_CC=$CC
1176   # Extract the first word of "gcc", so it can be a program name with args.
1177 set dummy gcc; ac_word=$2
1178 echo "$as_me:1178: checking for $ac_word" >&5
1179 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1180 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1181   echo $ECHO_N "(cached) $ECHO_C" >&6
1182 else
1183   if test -n "$ac_ct_CC"; then
1184   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1185 else
1186   ac_save_IFS=$IFS; IFS=$ac_path_separator
1187 ac_dummy="$PATH"
1188 for ac_dir in $ac_dummy; do
1189   IFS=$ac_save_IFS
1190   test -z "$ac_dir" && ac_dir=.
1191   $as_executable_p "$ac_dir/$ac_word" || continue
1192 ac_cv_prog_ac_ct_CC="gcc"
1193 echo "$as_me:1193: found $ac_dir/$ac_word" >&5
1194 break
1195 done
1196
1197 fi
1198 fi
1199 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1200 if test -n "$ac_ct_CC"; then
1201   echo "$as_me:1201: result: $ac_ct_CC" >&5
1202 echo "${ECHO_T}$ac_ct_CC" >&6
1203 else
1204   echo "$as_me:1204: result: no" >&5
1205 echo "${ECHO_T}no" >&6
1206 fi
1207
1208   CC=$ac_ct_CC
1209 else
1210   CC="$ac_cv_prog_CC"
1211 fi
1212
1213 if test -z "$CC"; then
1214   if test -n "$ac_tool_prefix"; then
1215   # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
1216 set dummy ${ac_tool_prefix}cc; ac_word=$2
1217 echo "$as_me:1217: checking for $ac_word" >&5
1218 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1219 if test "${ac_cv_prog_CC+set}" = set; then
1220   echo $ECHO_N "(cached) $ECHO_C" >&6
1221 else
1222   if test -n "$CC"; then
1223   ac_cv_prog_CC="$CC" # Let the user override the test.
1224 else
1225   ac_save_IFS=$IFS; IFS=$ac_path_separator
1226 ac_dummy="$PATH"
1227 for ac_dir in $ac_dummy; do
1228   IFS=$ac_save_IFS
1229   test -z "$ac_dir" && ac_dir=.
1230   $as_executable_p "$ac_dir/$ac_word" || continue
1231 ac_cv_prog_CC="${ac_tool_prefix}cc"
1232 echo "$as_me:1232: found $ac_dir/$ac_word" >&5
1233 break
1234 done
1235
1236 fi
1237 fi
1238 CC=$ac_cv_prog_CC
1239 if test -n "$CC"; then
1240   echo "$as_me:1240: result: $CC" >&5
1241 echo "${ECHO_T}$CC" >&6
1242 else
1243   echo "$as_me:1243: result: no" >&5
1244 echo "${ECHO_T}no" >&6
1245 fi
1246
1247 fi
1248 if test -z "$ac_cv_prog_CC"; then
1249   ac_ct_CC=$CC
1250   # Extract the first word of "cc", so it can be a program name with args.
1251 set dummy cc; ac_word=$2
1252 echo "$as_me:1252: checking for $ac_word" >&5
1253 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1254 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1255   echo $ECHO_N "(cached) $ECHO_C" >&6
1256 else
1257   if test -n "$ac_ct_CC"; then
1258   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1259 else
1260   ac_save_IFS=$IFS; IFS=$ac_path_separator
1261 ac_dummy="$PATH"
1262 for ac_dir in $ac_dummy; do
1263   IFS=$ac_save_IFS
1264   test -z "$ac_dir" && ac_dir=.
1265   $as_executable_p "$ac_dir/$ac_word" || continue
1266 ac_cv_prog_ac_ct_CC="cc"
1267 echo "$as_me:1267: found $ac_dir/$ac_word" >&5
1268 break
1269 done
1270
1271 fi
1272 fi
1273 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1274 if test -n "$ac_ct_CC"; then
1275   echo "$as_me:1275: result: $ac_ct_CC" >&5
1276 echo "${ECHO_T}$ac_ct_CC" >&6
1277 else
1278   echo "$as_me:1278: result: no" >&5
1279 echo "${ECHO_T}no" >&6
1280 fi
1281
1282   CC=$ac_ct_CC
1283 else
1284   CC="$ac_cv_prog_CC"
1285 fi
1286
1287 fi
1288 if test -z "$CC"; then
1289   # Extract the first word of "cc", so it can be a program name with args.
1290 set dummy cc; ac_word=$2
1291 echo "$as_me:1291: checking for $ac_word" >&5
1292 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1293 if test "${ac_cv_prog_CC+set}" = set; then
1294   echo $ECHO_N "(cached) $ECHO_C" >&6
1295 else
1296   if test -n "$CC"; then
1297   ac_cv_prog_CC="$CC" # Let the user override the test.
1298 else
1299   ac_prog_rejected=no
1300   ac_save_IFS=$IFS; IFS=$ac_path_separator
1301 ac_dummy="$PATH"
1302 for ac_dir in $ac_dummy; do
1303   IFS=$ac_save_IFS
1304   test -z "$ac_dir" && ac_dir=.
1305   $as_executable_p "$ac_dir/$ac_word" || continue
1306 if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1307   ac_prog_rejected=yes
1308   continue
1309 fi
1310 ac_cv_prog_CC="cc"
1311 echo "$as_me:1311: found $ac_dir/$ac_word" >&5
1312 break
1313 done
1314
1315 if test $ac_prog_rejected = yes; then
1316   # We found a bogon in the path, so make sure we never use it.
1317   set dummy $ac_cv_prog_CC
1318   shift
1319   if test $# != 0; then
1320     # We chose a different compiler from the bogus one.
1321     # However, it has the same basename, so the bogon will be chosen
1322     # first if we set CC to just the basename; use the full file name.
1323     shift
1324     set dummy "$ac_dir/$ac_word" ${1+"$@"}
1325     shift
1326     ac_cv_prog_CC="$@"
1327   fi
1328 fi
1329 fi
1330 fi
1331 CC=$ac_cv_prog_CC
1332 if test -n "$CC"; then
1333   echo "$as_me:1333: result: $CC" >&5
1334 echo "${ECHO_T}$CC" >&6
1335 else
1336   echo "$as_me:1336: result: no" >&5
1337 echo "${ECHO_T}no" >&6
1338 fi
1339
1340 fi
1341 if test -z "$CC"; then
1342   if test -n "$ac_tool_prefix"; then
1343   for ac_prog in cl
1344   do
1345     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
1346 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
1347 echo "$as_me:1347: checking for $ac_word" >&5
1348 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1349 if test "${ac_cv_prog_CC+set}" = set; then
1350   echo $ECHO_N "(cached) $ECHO_C" >&6
1351 else
1352   if test -n "$CC"; then
1353   ac_cv_prog_CC="$CC" # Let the user override the test.
1354 else
1355   ac_save_IFS=$IFS; IFS=$ac_path_separator
1356 ac_dummy="$PATH"
1357 for ac_dir in $ac_dummy; do
1358   IFS=$ac_save_IFS
1359   test -z "$ac_dir" && ac_dir=.
1360   $as_executable_p "$ac_dir/$ac_word" || continue
1361 ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
1362 echo "$as_me:1362: found $ac_dir/$ac_word" >&5
1363 break
1364 done
1365
1366 fi
1367 fi
1368 CC=$ac_cv_prog_CC
1369 if test -n "$CC"; then
1370   echo "$as_me:1370: result: $CC" >&5
1371 echo "${ECHO_T}$CC" >&6
1372 else
1373   echo "$as_me:1373: result: no" >&5
1374 echo "${ECHO_T}no" >&6
1375 fi
1376
1377     test -n "$CC" && break
1378   done
1379 fi
1380 if test -z "$CC"; then
1381   ac_ct_CC=$CC
1382   for ac_prog in cl
1383 do
1384   # Extract the first word of "$ac_prog", so it can be a program name with args.
1385 set dummy $ac_prog; ac_word=$2
1386 echo "$as_me:1386: checking for $ac_word" >&5
1387 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1388 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1389   echo $ECHO_N "(cached) $ECHO_C" >&6
1390 else
1391   if test -n "$ac_ct_CC"; then
1392   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1393 else
1394   ac_save_IFS=$IFS; IFS=$ac_path_separator
1395 ac_dummy="$PATH"
1396 for ac_dir in $ac_dummy; do
1397   IFS=$ac_save_IFS
1398   test -z "$ac_dir" && ac_dir=.
1399   $as_executable_p "$ac_dir/$ac_word" || continue
1400 ac_cv_prog_ac_ct_CC="$ac_prog"
1401 echo "$as_me:1401: found $ac_dir/$ac_word" >&5
1402 break
1403 done
1404
1405 fi
1406 fi
1407 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1408 if test -n "$ac_ct_CC"; then
1409   echo "$as_me:1409: result: $ac_ct_CC" >&5
1410 echo "${ECHO_T}$ac_ct_CC" >&6
1411 else
1412   echo "$as_me:1412: result: no" >&5
1413 echo "${ECHO_T}no" >&6
1414 fi
1415
1416   test -n "$ac_ct_CC" && break
1417 done
1418
1419   CC=$ac_ct_CC
1420 fi
1421
1422 fi
1423
1424 test -z "$CC" && { { echo "$as_me:1424: error: no acceptable cc found in \$PATH" >&5
1425 echo "$as_me: error: no acceptable cc found in \$PATH" >&2;}
1426    { (exit 1); exit 1; }; }
1427
1428 # Provide some information about the compiler.
1429 echo "$as_me:1429:" \
1430      "checking for C compiler version" >&5
1431 ac_compiler=`set X $ac_compile; echo $2`
1432 { (eval echo "$as_me:1432: \"$ac_compiler --version </dev/null >&5\"") >&5
1433   (eval $ac_compiler --version </dev/null >&5) 2>&5
1434   ac_status=$?
1435   echo "$as_me:1435: \$? = $ac_status" >&5
1436   (exit $ac_status); }
1437 { (eval echo "$as_me:1437: \"$ac_compiler -v </dev/null >&5\"") >&5
1438   (eval $ac_compiler -v </dev/null >&5) 2>&5
1439   ac_status=$?
1440   echo "$as_me:1440: \$? = $ac_status" >&5
1441   (exit $ac_status); }
1442 { (eval echo "$as_me:1442: \"$ac_compiler -V </dev/null >&5\"") >&5
1443   (eval $ac_compiler -V </dev/null >&5) 2>&5
1444   ac_status=$?
1445   echo "$as_me:1445: \$? = $ac_status" >&5
1446   (exit $ac_status); }
1447
1448 cat >conftest.$ac_ext <<_ACEOF
1449 #line 1449 "configure"
1450 #include "confdefs.h"
1451
1452 int
1453 main ()
1454 {
1455
1456   ;
1457   return 0;
1458 }
1459 _ACEOF
1460 ac_clean_files_save=$ac_clean_files
1461 ac_clean_files="$ac_clean_files a.out a.exe"
1462 # Try to create an executable without -o first, disregard a.out.
1463 # It will help us diagnose broken compilers, and finding out an intuition
1464 # of exeext.
1465 echo "$as_me:1465: checking for C compiler default output" >&5
1466 echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
1467 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
1468 if { (eval echo "$as_me:1468: \"$ac_link_default\"") >&5
1469   (eval $ac_link_default) 2>&5
1470   ac_status=$?
1471   echo "$as_me:1471: \$? = $ac_status" >&5
1472   (exit $ac_status); }; then
1473   # Find the output, starting from the most likely.  This scheme is
1474 # not robust to junk in `.', hence go to wildcards (a.*) only as a last
1475 # resort.
1476 for ac_file in `ls a.exe conftest.exe 2>/dev/null;
1477                 ls a.out conftest 2>/dev/null;
1478                 ls a.* conftest.* 2>/dev/null`; do
1479   case $ac_file in
1480     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1481     a.out ) # We found the default executable, but exeext='' is most
1482             # certainly right.
1483             break;;
1484     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1485           # FIXME: I believe we export ac_cv_exeext for Libtool --akim.
1486           export ac_cv_exeext
1487           break;;
1488     * ) break;;
1489   esac
1490 done
1491 else
1492   echo "$as_me: failed program was:" >&5
1493 cat conftest.$ac_ext >&5
1494 { { echo "$as_me:1494: error: C compiler cannot create executables" >&5
1495 echo "$as_me: error: C compiler cannot create executables" >&2;}
1496    { (exit 77); exit 77; }; }
1497 fi
1498
1499 ac_exeext=$ac_cv_exeext
1500 echo "$as_me:1500: result: $ac_file" >&5
1501 echo "${ECHO_T}$ac_file" >&6
1502
1503 # Check the compiler produces executables we can run.  If not, either
1504 # the compiler is broken, or we cross compile.
1505 echo "$as_me:1505: checking whether the C compiler works" >&5
1506 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
1507 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0
1508 # If not cross compiling, check that we can run a simple program.
1509 if test "$cross_compiling" != yes; then
1510   if { ac_try='./$ac_file'
1511   { (eval echo "$as_me:1511: \"$ac_try\"") >&5
1512   (eval $ac_try) 2>&5
1513   ac_status=$?
1514   echo "$as_me:1514: \$? = $ac_status" >&5
1515   (exit $ac_status); }; }; then
1516     cross_compiling=no
1517   else
1518     if test "$cross_compiling" = maybe; then
1519         cross_compiling=yes
1520     else
1521         { { echo "$as_me:1521: error: cannot run C compiled programs.
1522 If you meant to cross compile, use \`--host'." >&5
1523 echo "$as_me: error: cannot run C compiled programs.
1524 If you meant to cross compile, use \`--host'." >&2;}
1525    { (exit 1); exit 1; }; }
1526     fi
1527   fi
1528 fi
1529 echo "$as_me:1529: result: yes" >&5
1530 echo "${ECHO_T}yes" >&6
1531
1532 rm -f a.out a.exe conftest$ac_cv_exeext
1533 ac_clean_files=$ac_clean_files_save
1534 # Check the compiler produces executables we can run.  If not, either
1535 # the compiler is broken, or we cross compile.
1536 echo "$as_me:1536: checking whether we are cross compiling" >&5
1537 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
1538 echo "$as_me:1538: result: $cross_compiling" >&5
1539 echo "${ECHO_T}$cross_compiling" >&6
1540
1541 echo "$as_me:1541: checking for executable suffix" >&5
1542 echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6
1543 if { (eval echo "$as_me:1543: \"$ac_link\"") >&5
1544   (eval $ac_link) 2>&5
1545   ac_status=$?
1546   echo "$as_me:1546: \$? = $ac_status" >&5
1547   (exit $ac_status); }; then
1548   # If both `conftest.exe' and `conftest' are `present' (well, observable)
1549 # catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
1550 # work properly (i.e., refer to `conftest.exe'), while it won't with
1551 # `rm'.
1552 for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do
1553   case $ac_file in
1554     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1555     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1556           export ac_cv_exeext
1557           break;;
1558     * ) break;;
1559   esac
1560 done
1561 else
1562   { { echo "$as_me:1562: error: cannot compute EXEEXT: cannot compile and link" >&5
1563 echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;}
1564    { (exit 1); exit 1; }; }
1565 fi
1566
1567 rm -f conftest$ac_cv_exeext
1568 echo "$as_me:1568: result: $ac_cv_exeext" >&5
1569 echo "${ECHO_T}$ac_cv_exeext" >&6
1570
1571 rm -f conftest.$ac_ext
1572 EXEEXT=$ac_cv_exeext
1573 ac_exeext=$EXEEXT
1574 echo "$as_me:1574: checking for object suffix" >&5
1575 echo $ECHO_N "checking for object suffix... $ECHO_C" >&6
1576 if test "${ac_cv_objext+set}" = set; then
1577   echo $ECHO_N "(cached) $ECHO_C" >&6
1578 else
1579   cat >conftest.$ac_ext <<_ACEOF
1580 #line 1580 "configure"
1581 #include "confdefs.h"
1582
1583 int
1584 main ()
1585 {
1586
1587   ;
1588   return 0;
1589 }
1590 _ACEOF
1591 rm -f conftest.o conftest.obj
1592 if { (eval echo "$as_me:1592: \"$ac_compile\"") >&5
1593   (eval $ac_compile) 2>&5
1594   ac_status=$?
1595   echo "$as_me:1595: \$? = $ac_status" >&5
1596   (exit $ac_status); }; then
1597   for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
1598   case $ac_file in
1599     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.map | *.inf ) ;;
1600     *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
1601        break;;
1602   esac
1603 done
1604 else
1605   echo "$as_me: failed program was:" >&5
1606 cat conftest.$ac_ext >&5
1607 { { echo "$as_me:1607: error: cannot compute OBJEXT: cannot compile" >&5
1608 echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;}
1609    { (exit 1); exit 1; }; }
1610 fi
1611
1612 rm -f conftest.$ac_cv_objext conftest.$ac_ext
1613 fi
1614 echo "$as_me:1614: result: $ac_cv_objext" >&5
1615 echo "${ECHO_T}$ac_cv_objext" >&6
1616 OBJEXT=$ac_cv_objext
1617 ac_objext=$OBJEXT
1618 echo "$as_me:1618: checking whether we are using the GNU C compiler" >&5
1619 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
1620 if test "${ac_cv_c_compiler_gnu+set}" = set; then
1621   echo $ECHO_N "(cached) $ECHO_C" >&6
1622 else
1623   cat >conftest.$ac_ext <<_ACEOF
1624 #line 1624 "configure"
1625 #include "confdefs.h"
1626
1627 int
1628 main ()
1629 {
1630 #ifndef __GNUC__
1631        choke me
1632 #endif
1633
1634   ;
1635   return 0;
1636 }
1637 _ACEOF
1638 rm -f conftest.$ac_objext
1639 if { (eval echo "$as_me:1639: \"$ac_compile\"") >&5
1640   (eval $ac_compile) 2>&5
1641   ac_status=$?
1642   echo "$as_me:1642: \$? = $ac_status" >&5
1643   (exit $ac_status); } &&
1644          { ac_try='test -s conftest.$ac_objext'
1645   { (eval echo "$as_me:1645: \"$ac_try\"") >&5
1646   (eval $ac_try) 2>&5
1647   ac_status=$?
1648   echo "$as_me:1648: \$? = $ac_status" >&5
1649   (exit $ac_status); }; }; then
1650   ac_compiler_gnu=yes
1651 else
1652   echo "$as_me: failed program was:" >&5
1653 cat conftest.$ac_ext >&5
1654 ac_compiler_gnu=no
1655 fi
1656 rm -f conftest.$ac_objext conftest.$ac_ext
1657 ac_cv_c_compiler_gnu=$ac_compiler_gnu
1658
1659 fi
1660 echo "$as_me:1660: result: $ac_cv_c_compiler_gnu" >&5
1661 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
1662 GCC=`test $ac_compiler_gnu = yes && echo yes`
1663 ac_test_CFLAGS=${CFLAGS+set}
1664 ac_save_CFLAGS=$CFLAGS
1665 CFLAGS="-g"
1666 echo "$as_me:1666: checking whether $CC accepts -g" >&5
1667 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
1668 if test "${ac_cv_prog_cc_g+set}" = set; then
1669   echo $ECHO_N "(cached) $ECHO_C" >&6
1670 else
1671   cat >conftest.$ac_ext <<_ACEOF
1672 #line 1672 "configure"
1673 #include "confdefs.h"
1674
1675 int
1676 main ()
1677 {
1678
1679   ;
1680   return 0;
1681 }
1682 _ACEOF
1683 rm -f conftest.$ac_objext
1684 if { (eval echo "$as_me:1684: \"$ac_compile\"") >&5
1685   (eval $ac_compile) 2>&5
1686   ac_status=$?
1687   echo "$as_me:1687: \$? = $ac_status" >&5
1688   (exit $ac_status); } &&
1689          { ac_try='test -s conftest.$ac_objext'
1690   { (eval echo "$as_me:1690: \"$ac_try\"") >&5
1691   (eval $ac_try) 2>&5
1692   ac_status=$?
1693   echo "$as_me:1693: \$? = $ac_status" >&5
1694   (exit $ac_status); }; }; then
1695   ac_cv_prog_cc_g=yes
1696 else
1697   echo "$as_me: failed program was:" >&5
1698 cat conftest.$ac_ext >&5
1699 ac_cv_prog_cc_g=no
1700 fi
1701 rm -f conftest.$ac_objext conftest.$ac_ext
1702 fi
1703 echo "$as_me:1703: result: $ac_cv_prog_cc_g" >&5
1704 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
1705 if test "$ac_test_CFLAGS" = set; then
1706   CFLAGS=$ac_save_CFLAGS
1707 elif test $ac_cv_prog_cc_g = yes; then
1708   if test "$GCC" = yes; then
1709     CFLAGS="-g -O2"
1710   else
1711     CFLAGS="-g"
1712   fi
1713 else
1714   if test "$GCC" = yes; then
1715     CFLAGS="-O2"
1716   else
1717     CFLAGS=
1718   fi
1719 fi
1720 # Some people use a C++ compiler to compile C.  Since we use `exit',
1721 # in C++ we need to declare it.  In case someone uses the same compiler
1722 # for both compiling C and C++ we need to have the C++ compiler decide
1723 # the declaration of exit, since it's the most demanding environment.
1724 cat >conftest.$ac_ext <<_ACEOF
1725 #ifndef __cplusplus
1726   choke me
1727 #endif
1728 _ACEOF
1729 rm -f conftest.$ac_objext
1730 if { (eval echo "$as_me:1730: \"$ac_compile\"") >&5
1731   (eval $ac_compile) 2>&5
1732   ac_status=$?
1733   echo "$as_me:1733: \$? = $ac_status" >&5
1734   (exit $ac_status); } &&
1735          { ac_try='test -s conftest.$ac_objext'
1736   { (eval echo "$as_me:1736: \"$ac_try\"") >&5
1737   (eval $ac_try) 2>&5
1738   ac_status=$?
1739   echo "$as_me:1739: \$? = $ac_status" >&5
1740   (exit $ac_status); }; }; then
1741   for ac_declaration in \
1742    ''\
1743    '#include <stdlib.h>' \
1744    'extern "C" void std::exit (int) throw (); using std::exit;' \
1745    'extern "C" void std::exit (int); using std::exit;' \
1746    'extern "C" void exit (int) throw ();' \
1747    'extern "C" void exit (int);' \
1748    'void exit (int);'
1749 do
1750   cat >conftest.$ac_ext <<_ACEOF
1751 #line 1751 "configure"
1752 #include "confdefs.h"
1753 #include <stdlib.h>
1754 $ac_declaration
1755 int
1756 main ()
1757 {
1758 exit (42);
1759   ;
1760   return 0;
1761 }
1762 _ACEOF
1763 rm -f conftest.$ac_objext
1764 if { (eval echo "$as_me:1764: \"$ac_compile\"") >&5
1765   (eval $ac_compile) 2>&5
1766   ac_status=$?
1767   echo "$as_me:1767: \$? = $ac_status" >&5
1768   (exit $ac_status); } &&
1769          { ac_try='test -s conftest.$ac_objext'
1770   { (eval echo "$as_me:1770: \"$ac_try\"") >&5
1771   (eval $ac_try) 2>&5
1772   ac_status=$?
1773   echo "$as_me:1773: \$? = $ac_status" >&5
1774   (exit $ac_status); }; }; then
1775   :
1776 else
1777   echo "$as_me: failed program was:" >&5
1778 cat conftest.$ac_ext >&5
1779 continue
1780 fi
1781 rm -f conftest.$ac_objext conftest.$ac_ext
1782   cat >conftest.$ac_ext <<_ACEOF
1783 #line 1783 "configure"
1784 #include "confdefs.h"
1785 $ac_declaration
1786 int
1787 main ()
1788 {
1789 exit (42);
1790   ;
1791   return 0;
1792 }
1793 _ACEOF
1794 rm -f conftest.$ac_objext
1795 if { (eval echo "$as_me:1795: \"$ac_compile\"") >&5
1796   (eval $ac_compile) 2>&5
1797   ac_status=$?
1798   echo "$as_me:1798: \$? = $ac_status" >&5
1799   (exit $ac_status); } &&
1800          { ac_try='test -s conftest.$ac_objext'
1801   { (eval echo "$as_me:1801: \"$ac_try\"") >&5
1802   (eval $ac_try) 2>&5
1803   ac_status=$?
1804   echo "$as_me:1804: \$? = $ac_status" >&5
1805   (exit $ac_status); }; }; then
1806   break
1807 else
1808   echo "$as_me: failed program was:" >&5
1809 cat conftest.$ac_ext >&5
1810 fi
1811 rm -f conftest.$ac_objext conftest.$ac_ext
1812 done
1813 rm -rf conftest*
1814 if test -n "$ac_declaration"; then
1815   echo '#ifdef __cplusplus' >>confdefs.h
1816   echo $ac_declaration      >>confdefs.h
1817   echo '#endif'             >>confdefs.h
1818 fi
1819
1820 else
1821   echo "$as_me: failed program was:" >&5
1822 cat conftest.$ac_ext >&5
1823 fi
1824 rm -f conftest.$ac_objext conftest.$ac_ext
1825 ac_ext=c
1826 ac_cpp='$CPP $CPPFLAGS'
1827 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1828 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1829 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1830 ac_main_return=return
1831
1832 GCC_VERSION=none
1833 if test "$GCC" = yes ; then
1834         echo "$as_me:1834: checking version of $CC" >&5
1835 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
1836         GCC_VERSION="`${CC} --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(GCC[^)]*) //' -e 's/^.*(Debian[^)]*) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`"
1837         test -z "$GCC_VERSION" && GCC_VERSION=unknown
1838         echo "$as_me:1838: result: $GCC_VERSION" >&5
1839 echo "${ECHO_T}$GCC_VERSION" >&6
1840 fi
1841
1842 echo "$as_me:1842: checking for $CC option to accept ANSI C" >&5
1843 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
1844 if test "${ac_cv_prog_cc_stdc+set}" = set; then
1845   echo $ECHO_N "(cached) $ECHO_C" >&6
1846 else
1847   ac_cv_prog_cc_stdc=no
1848 ac_save_CC=$CC
1849 cat >conftest.$ac_ext <<_ACEOF
1850 #line 1850 "configure"
1851 #include "confdefs.h"
1852 #include <stdarg.h>
1853 #include <stdio.h>
1854 #include <sys/types.h>
1855 #include <sys/stat.h>
1856 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
1857 struct buf { int x; };
1858 FILE * (*rcsopen) (struct buf *, struct stat *, int);
1859 static char *e (p, i)
1860      char **p;
1861      int i;
1862 {
1863   return p[i];
1864 }
1865 static char *f (char * (*g) (char **, int), char **p, ...)
1866 {
1867   char *s;
1868   va_list v;
1869   va_start (v,p);
1870   s = g (p, va_arg (v,int));
1871   va_end (v);
1872   return s;
1873 }
1874 int test (int i, double x);
1875 struct s1 {int (*f) (int a);};
1876 struct s2 {int (*f) (double a);};
1877 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
1878 int argc;
1879 char **argv;
1880 int
1881 main ()
1882 {
1883 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
1884   ;
1885   return 0;
1886 }
1887 _ACEOF
1888 # Don't try gcc -ansi; that turns off useful extensions and
1889 # breaks some systems' header files.
1890 # AIX                   -qlanglvl=ansi
1891 # Ultrix and OSF/1      -std1
1892 # HP-UX 10.20 and later -Ae
1893 # HP-UX older versions  -Aa -D_HPUX_SOURCE
1894 # SVR4                  -Xc -D__EXTENSIONS__
1895 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
1896 do
1897   CC="$ac_save_CC $ac_arg"
1898   rm -f conftest.$ac_objext
1899 if { (eval echo "$as_me:1899: \"$ac_compile\"") >&5
1900   (eval $ac_compile) 2>&5
1901   ac_status=$?
1902   echo "$as_me:1902: \$? = $ac_status" >&5
1903   (exit $ac_status); } &&
1904          { ac_try='test -s conftest.$ac_objext'
1905   { (eval echo "$as_me:1905: \"$ac_try\"") >&5
1906   (eval $ac_try) 2>&5
1907   ac_status=$?
1908   echo "$as_me:1908: \$? = $ac_status" >&5
1909   (exit $ac_status); }; }; then
1910   ac_cv_prog_cc_stdc=$ac_arg
1911 break
1912 else
1913   echo "$as_me: failed program was:" >&5
1914 cat conftest.$ac_ext >&5
1915 fi
1916 rm -f conftest.$ac_objext
1917 done
1918 rm -f conftest.$ac_ext conftest.$ac_objext
1919 CC=$ac_save_CC
1920
1921 fi
1922
1923 case "x$ac_cv_prog_cc_stdc" in
1924   x|xno)
1925     echo "$as_me:1925: result: none needed" >&5
1926 echo "${ECHO_T}none needed" >&6 ;;
1927   *)
1928     echo "$as_me:1928: result: $ac_cv_prog_cc_stdc" >&5
1929 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
1930     CC="$CC $ac_cv_prog_cc_stdc" ;;
1931 esac
1932
1933 # This should have been defined by AC_PROG_CC
1934 : ${CC:=cc}
1935
1936 echo "$as_me:1936: checking \$CC variable" >&5
1937 echo $ECHO_N "checking \$CC variable... $ECHO_C" >&6
1938 case "$CC" in
1939 (*[\ \  ]-[IUD]*)
1940         echo "$as_me:1940: result: broken" >&5
1941 echo "${ECHO_T}broken" >&6
1942         { echo "$as_me:1942: WARNING: your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options" >&5
1943 echo "$as_me: WARNING: your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options" >&2;}
1944         # humor him...
1945         cf_flags=`echo "$CC" | sed -e 's/^[^    ]*[     ]//'`
1946         CC=`echo "$CC" | sed -e 's/[    ].*//'`
1947
1948 cf_fix_cppflags=no
1949 cf_new_cflags=
1950 cf_new_cppflags=
1951 cf_new_extra_cppflags=
1952
1953 for cf_add_cflags in $cf_flags
1954 do
1955 case $cf_fix_cppflags in
1956 (no)
1957         case $cf_add_cflags in
1958         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
1959                 case $cf_add_cflags in
1960                 (-D*)
1961                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
1962
1963                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
1964                                 && test -z "${cf_tst_cflags}" \
1965                                 && cf_fix_cppflags=yes
1966
1967                         if test $cf_fix_cppflags = yes ; then
1968                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
1969                                 continue
1970                         elif test "${cf_tst_cflags}" = "\"'" ; then
1971                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
1972                                 continue
1973                         fi
1974                         ;;
1975                 esac
1976                 case "$CPPFLAGS" in
1977                 (*$cf_add_cflags)
1978                         ;;
1979                 (*)
1980                         case $cf_add_cflags in
1981                         (-D*)
1982                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
1983
1984 CPPFLAGS=`echo "$CPPFLAGS" | \
1985         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
1986                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
1987
1988                                 ;;
1989                         esac
1990                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
1991                         ;;
1992                 esac
1993                 ;;
1994         (*)
1995                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
1996                 ;;
1997         esac
1998         ;;
1999 (yes)
2000         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
2001
2002         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
2003
2004         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2005                 && test -z "${cf_tst_cflags}" \
2006                 && cf_fix_cppflags=no
2007         ;;
2008 esac
2009 done
2010
2011 if test -n "$cf_new_cflags" ; then
2012
2013         CFLAGS="$CFLAGS $cf_new_cflags"
2014 fi
2015
2016 if test -n "$cf_new_cppflags" ; then
2017
2018         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
2019 fi
2020
2021 if test -n "$cf_new_extra_cppflags" ; then
2022
2023         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
2024 fi
2025
2026         ;;
2027 (*)
2028         echo "$as_me:2028: result: ok" >&5
2029 echo "${ECHO_T}ok" >&6
2030         ;;
2031 esac
2032
2033 ac_ext=c
2034 ac_cpp='$CPP $CPPFLAGS'
2035 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2036 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2037 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2038 ac_main_return=return
2039 echo "$as_me:2039: checking how to run the C preprocessor" >&5
2040 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
2041 # On Suns, sometimes $CPP names a directory.
2042 if test -n "$CPP" && test -d "$CPP"; then
2043   CPP=
2044 fi
2045 if test -z "$CPP"; then
2046   if test "${ac_cv_prog_CPP+set}" = set; then
2047   echo $ECHO_N "(cached) $ECHO_C" >&6
2048 else
2049       # Double quotes because CPP needs to be expanded
2050     for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
2051     do
2052       ac_preproc_ok=false
2053 for ac_c_preproc_warn_flag in '' yes
2054 do
2055   # Use a header file that comes with gcc, so configuring glibc
2056   # with a fresh cross-compiler works.
2057   # On the NeXT, cc -E runs the code through the compiler's parser,
2058   # not just through cpp. "Syntax error" is here to catch this case.
2059   cat >conftest.$ac_ext <<_ACEOF
2060 #line 2060 "configure"
2061 #include "confdefs.h"
2062 #include <assert.h>
2063                      Syntax error
2064 _ACEOF
2065 if { (eval echo "$as_me:2065: \"$ac_cpp conftest.$ac_ext\"") >&5
2066   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2067   ac_status=$?
2068   egrep -v '^ *\+' conftest.er1 >conftest.err
2069   rm -f conftest.er1
2070   cat conftest.err >&5
2071   echo "$as_me:2071: \$? = $ac_status" >&5
2072   (exit $ac_status); } >/dev/null; then
2073   if test -s conftest.err; then
2074     ac_cpp_err=$ac_c_preproc_warn_flag
2075   else
2076     ac_cpp_err=
2077   fi
2078 else
2079   ac_cpp_err=yes
2080 fi
2081 if test -z "$ac_cpp_err"; then
2082   :
2083 else
2084   echo "$as_me: failed program was:" >&5
2085   cat conftest.$ac_ext >&5
2086   # Broken: fails on valid input.
2087 continue
2088 fi
2089 rm -f conftest.err conftest.$ac_ext
2090
2091   # OK, works on sane cases.  Now check whether non-existent headers
2092   # can be detected and how.
2093   cat >conftest.$ac_ext <<_ACEOF
2094 #line 2094 "configure"
2095 #include "confdefs.h"
2096 #include <ac_nonexistent.h>
2097 _ACEOF
2098 if { (eval echo "$as_me:2098: \"$ac_cpp conftest.$ac_ext\"") >&5
2099   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2100   ac_status=$?
2101   egrep -v '^ *\+' conftest.er1 >conftest.err
2102   rm -f conftest.er1
2103   cat conftest.err >&5
2104   echo "$as_me:2104: \$? = $ac_status" >&5
2105   (exit $ac_status); } >/dev/null; then
2106   if test -s conftest.err; then
2107     ac_cpp_err=$ac_c_preproc_warn_flag
2108   else
2109     ac_cpp_err=
2110   fi
2111 else
2112   ac_cpp_err=yes
2113 fi
2114 if test -z "$ac_cpp_err"; then
2115   # Broken: success on invalid input.
2116 continue
2117 else
2118   echo "$as_me: failed program was:" >&5
2119   cat conftest.$ac_ext >&5
2120   # Passes both tests.
2121 ac_preproc_ok=:
2122 break
2123 fi
2124 rm -f conftest.err conftest.$ac_ext
2125
2126 done
2127 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2128 rm -f conftest.err conftest.$ac_ext
2129 if $ac_preproc_ok; then
2130   break
2131 fi
2132
2133     done
2134     ac_cv_prog_CPP=$CPP
2135
2136 fi
2137   CPP=$ac_cv_prog_CPP
2138 else
2139   ac_cv_prog_CPP=$CPP
2140 fi
2141 echo "$as_me:2141: result: $CPP" >&5
2142 echo "${ECHO_T}$CPP" >&6
2143 ac_preproc_ok=false
2144 for ac_c_preproc_warn_flag in '' yes
2145 do
2146   # Use a header file that comes with gcc, so configuring glibc
2147   # with a fresh cross-compiler works.
2148   # On the NeXT, cc -E runs the code through the compiler's parser,
2149   # not just through cpp. "Syntax error" is here to catch this case.
2150   cat >conftest.$ac_ext <<_ACEOF
2151 #line 2151 "configure"
2152 #include "confdefs.h"
2153 #include <assert.h>
2154                      Syntax error
2155 _ACEOF
2156 if { (eval echo "$as_me:2156: \"$ac_cpp conftest.$ac_ext\"") >&5
2157   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2158   ac_status=$?
2159   egrep -v '^ *\+' conftest.er1 >conftest.err
2160   rm -f conftest.er1
2161   cat conftest.err >&5
2162   echo "$as_me:2162: \$? = $ac_status" >&5
2163   (exit $ac_status); } >/dev/null; then
2164   if test -s conftest.err; then
2165     ac_cpp_err=$ac_c_preproc_warn_flag
2166   else
2167     ac_cpp_err=
2168   fi
2169 else
2170   ac_cpp_err=yes
2171 fi
2172 if test -z "$ac_cpp_err"; then
2173   :
2174 else
2175   echo "$as_me: failed program was:" >&5
2176   cat conftest.$ac_ext >&5
2177   # Broken: fails on valid input.
2178 continue
2179 fi
2180 rm -f conftest.err conftest.$ac_ext
2181
2182   # OK, works on sane cases.  Now check whether non-existent headers
2183   # can be detected and how.
2184   cat >conftest.$ac_ext <<_ACEOF
2185 #line 2185 "configure"
2186 #include "confdefs.h"
2187 #include <ac_nonexistent.h>
2188 _ACEOF
2189 if { (eval echo "$as_me:2189: \"$ac_cpp conftest.$ac_ext\"") >&5
2190   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2191   ac_status=$?
2192   egrep -v '^ *\+' conftest.er1 >conftest.err
2193   rm -f conftest.er1
2194   cat conftest.err >&5
2195   echo "$as_me:2195: \$? = $ac_status" >&5
2196   (exit $ac_status); } >/dev/null; then
2197   if test -s conftest.err; then
2198     ac_cpp_err=$ac_c_preproc_warn_flag
2199   else
2200     ac_cpp_err=
2201   fi
2202 else
2203   ac_cpp_err=yes
2204 fi
2205 if test -z "$ac_cpp_err"; then
2206   # Broken: success on invalid input.
2207 continue
2208 else
2209   echo "$as_me: failed program was:" >&5
2210   cat conftest.$ac_ext >&5
2211   # Passes both tests.
2212 ac_preproc_ok=:
2213 break
2214 fi
2215 rm -f conftest.err conftest.$ac_ext
2216
2217 done
2218 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2219 rm -f conftest.err conftest.$ac_ext
2220 if $ac_preproc_ok; then
2221   :
2222 else
2223   { { echo "$as_me:2223: error: C preprocessor \"$CPP\" fails sanity check" >&5
2224 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;}
2225    { (exit 1); exit 1; }; }
2226 fi
2227
2228 ac_ext=c
2229 ac_cpp='$CPP $CPPFLAGS'
2230 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2231 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2232 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2233 ac_main_return=return
2234
2235 for ac_prog in mawk gawk nawk awk
2236 do
2237   # Extract the first word of "$ac_prog", so it can be a program name with args.
2238 set dummy $ac_prog; ac_word=$2
2239 echo "$as_me:2239: checking for $ac_word" >&5
2240 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2241 if test "${ac_cv_prog_AWK+set}" = set; then
2242   echo $ECHO_N "(cached) $ECHO_C" >&6
2243 else
2244   if test -n "$AWK"; then
2245   ac_cv_prog_AWK="$AWK" # Let the user override the test.
2246 else
2247   ac_save_IFS=$IFS; IFS=$ac_path_separator
2248 ac_dummy="$PATH"
2249 for ac_dir in $ac_dummy; do
2250   IFS=$ac_save_IFS
2251   test -z "$ac_dir" && ac_dir=.
2252   $as_executable_p "$ac_dir/$ac_word" || continue
2253 ac_cv_prog_AWK="$ac_prog"
2254 echo "$as_me:2254: found $ac_dir/$ac_word" >&5
2255 break
2256 done
2257
2258 fi
2259 fi
2260 AWK=$ac_cv_prog_AWK
2261 if test -n "$AWK"; then
2262   echo "$as_me:2262: result: $AWK" >&5
2263 echo "${ECHO_T}$AWK" >&6
2264 else
2265   echo "$as_me:2265: result: no" >&5
2266 echo "${ECHO_T}no" >&6
2267 fi
2268
2269   test -n "$AWK" && break
2270 done
2271
2272 # Find a good install program.  We prefer a C program (faster),
2273 # so one script is as good as another.  But avoid the broken or
2274 # incompatible versions:
2275 # SysV /etc/install, /usr/sbin/install
2276 # SunOS /usr/etc/install
2277 # IRIX /sbin/install
2278 # AIX /bin/install
2279 # AmigaOS /C/install, which installs bootblocks on floppy discs
2280 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2281 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2282 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2283 # ./install, which can be erroneously created by make from ./install.sh.
2284 echo "$as_me:2284: checking for a BSD compatible install" >&5
2285 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
2286 if test -z "$INSTALL"; then
2287 if test "${ac_cv_path_install+set}" = set; then
2288   echo $ECHO_N "(cached) $ECHO_C" >&6
2289 else
2290     ac_save_IFS=$IFS; IFS=$ac_path_separator
2291   for ac_dir in $PATH; do
2292     IFS=$ac_save_IFS
2293     # Account for people who put trailing slashes in PATH elements.
2294     case $ac_dir/ in
2295     / | ./ | .// | /cC/* \
2296     | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
2297     | /usr/ucb/* ) ;;
2298     *)
2299       # OSF1 and SCO ODT 3.0 have their own names for install.
2300       # Don't use installbsd from OSF since it installs stuff as root
2301       # by default.
2302       for ac_prog in ginstall scoinst install; do
2303         if $as_executable_p "$ac_dir/$ac_prog"; then
2304           if test $ac_prog = install &&
2305             grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2306             # AIX install.  It has an incompatible calling convention.
2307             :
2308           elif test $ac_prog = install &&
2309             grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2310             # program-specific install script used by HP pwplus--don't use.
2311             :
2312           else
2313             ac_cv_path_install="$ac_dir/$ac_prog -c"
2314             break 2
2315           fi
2316         fi
2317       done
2318       ;;
2319     esac
2320   done
2321
2322 fi
2323   if test "${ac_cv_path_install+set}" = set; then
2324     INSTALL=$ac_cv_path_install
2325   else
2326     # As a last resort, use the slow shell script.  We don't cache a
2327     # path for INSTALL within a source directory, because that will
2328     # break other packages using the cache if that directory is
2329     # removed, or if the path is relative.
2330     INSTALL=$ac_install_sh
2331   fi
2332 fi
2333 echo "$as_me:2333: result: $INSTALL" >&5
2334 echo "${ECHO_T}$INSTALL" >&6
2335
2336 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2337 # It thinks the first close brace ends the variable substitution.
2338 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2339
2340 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2341
2342 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2343
2344 case $INSTALL in
2345 (/*)
2346         ;;
2347 (*)
2348         cf_dir=`echo $INSTALL | sed -e 's%/[^/]*$%%'`
2349         test -z "$cf_dir" && cf_dir=.
2350         INSTALL=`cd $cf_dir && pwd`/`echo $INSTALL | sed -e 's%^.*/%%'`
2351         ;;
2352 esac
2353
2354 for ac_prog in tdlint lint alint splint lclint
2355 do
2356   # Extract the first word of "$ac_prog", so it can be a program name with args.
2357 set dummy $ac_prog; ac_word=$2
2358 echo "$as_me:2358: checking for $ac_word" >&5
2359 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2360 if test "${ac_cv_prog_LINT+set}" = set; then
2361   echo $ECHO_N "(cached) $ECHO_C" >&6
2362 else
2363   if test -n "$LINT"; then
2364   ac_cv_prog_LINT="$LINT" # Let the user override the test.
2365 else
2366   ac_save_IFS=$IFS; IFS=$ac_path_separator
2367 ac_dummy="$PATH"
2368 for ac_dir in $ac_dummy; do
2369   IFS=$ac_save_IFS
2370   test -z "$ac_dir" && ac_dir=.
2371   $as_executable_p "$ac_dir/$ac_word" || continue
2372 ac_cv_prog_LINT="$ac_prog"
2373 echo "$as_me:2373: found $ac_dir/$ac_word" >&5
2374 break
2375 done
2376
2377 fi
2378 fi
2379 LINT=$ac_cv_prog_LINT
2380 if test -n "$LINT"; then
2381   echo "$as_me:2381: result: $LINT" >&5
2382 echo "${ECHO_T}$LINT" >&6
2383 else
2384   echo "$as_me:2384: result: no" >&5
2385 echo "${ECHO_T}no" >&6
2386 fi
2387
2388   test -n "$LINT" && break
2389 done
2390
2391 echo "$as_me:2391: checking if filesystem supports mixed-case filenames" >&5
2392 echo $ECHO_N "checking if filesystem supports mixed-case filenames... $ECHO_C" >&6
2393 if test "${cf_cv_mixedcase+set}" = set; then
2394   echo $ECHO_N "(cached) $ECHO_C" >&6
2395 else
2396
2397 if test "$cross_compiling" = yes ; then
2398         case $target_alias in
2399         (*-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw*|*-uwin*)
2400                 cf_cv_mixedcase=no
2401                 ;;
2402         (*)
2403                 cf_cv_mixedcase=yes
2404                 ;;
2405         esac
2406 else
2407         rm -f conftest CONFTEST
2408         echo test >conftest
2409         if test -f CONFTEST ; then
2410                 cf_cv_mixedcase=no
2411         else
2412                 cf_cv_mixedcase=yes
2413         fi
2414         rm -f conftest CONFTEST
2415 fi
2416
2417 fi
2418 echo "$as_me:2418: result: $cf_cv_mixedcase" >&5
2419 echo "${ECHO_T}$cf_cv_mixedcase" >&6
2420 test "$cf_cv_mixedcase" = yes &&
2421 cat >>confdefs.h <<\EOF
2422 #define MIXEDCASE_FILENAMES 1
2423 EOF
2424
2425 for ac_prog in exctags ctags
2426 do
2427   # Extract the first word of "$ac_prog", so it can be a program name with args.
2428 set dummy $ac_prog; ac_word=$2
2429 echo "$as_me:2429: checking for $ac_word" >&5
2430 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2431 if test "${ac_cv_prog_CTAGS+set}" = set; then
2432   echo $ECHO_N "(cached) $ECHO_C" >&6
2433 else
2434   if test -n "$CTAGS"; then
2435   ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test.
2436 else
2437   ac_save_IFS=$IFS; IFS=$ac_path_separator
2438 ac_dummy="$PATH"
2439 for ac_dir in $ac_dummy; do
2440   IFS=$ac_save_IFS
2441   test -z "$ac_dir" && ac_dir=.
2442   $as_executable_p "$ac_dir/$ac_word" || continue
2443 ac_cv_prog_CTAGS="$ac_prog"
2444 echo "$as_me:2444: found $ac_dir/$ac_word" >&5
2445 break
2446 done
2447
2448 fi
2449 fi
2450 CTAGS=$ac_cv_prog_CTAGS
2451 if test -n "$CTAGS"; then
2452   echo "$as_me:2452: result: $CTAGS" >&5
2453 echo "${ECHO_T}$CTAGS" >&6
2454 else
2455   echo "$as_me:2455: result: no" >&5
2456 echo "${ECHO_T}no" >&6
2457 fi
2458
2459   test -n "$CTAGS" && break
2460 done
2461
2462 for ac_prog in exetags etags
2463 do
2464   # Extract the first word of "$ac_prog", so it can be a program name with args.
2465 set dummy $ac_prog; ac_word=$2
2466 echo "$as_me:2466: checking for $ac_word" >&5
2467 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2468 if test "${ac_cv_prog_ETAGS+set}" = set; then
2469   echo $ECHO_N "(cached) $ECHO_C" >&6
2470 else
2471   if test -n "$ETAGS"; then
2472   ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test.
2473 else
2474   ac_save_IFS=$IFS; IFS=$ac_path_separator
2475 ac_dummy="$PATH"
2476 for ac_dir in $ac_dummy; do
2477   IFS=$ac_save_IFS
2478   test -z "$ac_dir" && ac_dir=.
2479   $as_executable_p "$ac_dir/$ac_word" || continue
2480 ac_cv_prog_ETAGS="$ac_prog"
2481 echo "$as_me:2481: found $ac_dir/$ac_word" >&5
2482 break
2483 done
2484
2485 fi
2486 fi
2487 ETAGS=$ac_cv_prog_ETAGS
2488 if test -n "$ETAGS"; then
2489   echo "$as_me:2489: result: $ETAGS" >&5
2490 echo "${ECHO_T}$ETAGS" >&6
2491 else
2492   echo "$as_me:2492: result: no" >&5
2493 echo "${ECHO_T}no" >&6
2494 fi
2495
2496   test -n "$ETAGS" && break
2497 done
2498
2499 # Extract the first word of "${CTAGS:-ctags}", so it can be a program name with args.
2500 set dummy ${CTAGS:-ctags}; ac_word=$2
2501 echo "$as_me:2501: checking for $ac_word" >&5
2502 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2503 if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" = set; then
2504   echo $ECHO_N "(cached) $ECHO_C" >&6
2505 else
2506   if test -n "$MAKE_LOWER_TAGS"; then
2507   ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test.
2508 else
2509   ac_save_IFS=$IFS; IFS=$ac_path_separator
2510 ac_dummy="$PATH"
2511 for ac_dir in $ac_dummy; do
2512   IFS=$ac_save_IFS
2513   test -z "$ac_dir" && ac_dir=.
2514   $as_executable_p "$ac_dir/$ac_word" || continue
2515 ac_cv_prog_MAKE_LOWER_TAGS="yes"
2516 echo "$as_me:2516: found $ac_dir/$ac_word" >&5
2517 break
2518 done
2519
2520   test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no"
2521 fi
2522 fi
2523 MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS
2524 if test -n "$MAKE_LOWER_TAGS"; then
2525   echo "$as_me:2525: result: $MAKE_LOWER_TAGS" >&5
2526 echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6
2527 else
2528   echo "$as_me:2528: result: no" >&5
2529 echo "${ECHO_T}no" >&6
2530 fi
2531
2532 if test "$cf_cv_mixedcase" = yes ; then
2533         # Extract the first word of "${ETAGS:-etags}", so it can be a program name with args.
2534 set dummy ${ETAGS:-etags}; ac_word=$2
2535 echo "$as_me:2535: checking for $ac_word" >&5
2536 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2537 if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" = set; then
2538   echo $ECHO_N "(cached) $ECHO_C" >&6
2539 else
2540   if test -n "$MAKE_UPPER_TAGS"; then
2541   ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test.
2542 else
2543   ac_save_IFS=$IFS; IFS=$ac_path_separator
2544 ac_dummy="$PATH"
2545 for ac_dir in $ac_dummy; do
2546   IFS=$ac_save_IFS
2547   test -z "$ac_dir" && ac_dir=.
2548   $as_executable_p "$ac_dir/$ac_word" || continue
2549 ac_cv_prog_MAKE_UPPER_TAGS="yes"
2550 echo "$as_me:2550: found $ac_dir/$ac_word" >&5
2551 break
2552 done
2553
2554   test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no"
2555 fi
2556 fi
2557 MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS
2558 if test -n "$MAKE_UPPER_TAGS"; then
2559   echo "$as_me:2559: result: $MAKE_UPPER_TAGS" >&5
2560 echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6
2561 else
2562   echo "$as_me:2562: result: no" >&5
2563 echo "${ECHO_T}no" >&6
2564 fi
2565
2566 else
2567         MAKE_UPPER_TAGS=no
2568 fi
2569
2570 if test "$MAKE_UPPER_TAGS" = yes ; then
2571         MAKE_UPPER_TAGS=
2572 else
2573         MAKE_UPPER_TAGS="#"
2574 fi
2575
2576 if test "$MAKE_LOWER_TAGS" = yes ; then
2577         MAKE_LOWER_TAGS=
2578 else
2579         MAKE_LOWER_TAGS="#"
2580 fi
2581
2582 echo "$as_me:2582: checking if -lm needed for math functions" >&5
2583 echo $ECHO_N "checking if -lm needed for math functions... $ECHO_C" >&6
2584 if test "${cf_cv_need_libm+set}" = set; then
2585   echo $ECHO_N "(cached) $ECHO_C" >&6
2586 else
2587
2588         cat >conftest.$ac_ext <<_ACEOF
2589 #line 2589 "configure"
2590 #include "confdefs.h"
2591
2592         #include <stdio.h>
2593         #include <math.h>
2594
2595 int
2596 main ()
2597 {
2598 double x = rand(); printf("result = %g\n", pow(sin(x),x))
2599   ;
2600   return 0;
2601 }
2602 _ACEOF
2603 rm -f conftest.$ac_objext conftest$ac_exeext
2604 if { (eval echo "$as_me:2604: \"$ac_link\"") >&5
2605   (eval $ac_link) 2>&5
2606   ac_status=$?
2607   echo "$as_me:2607: \$? = $ac_status" >&5
2608   (exit $ac_status); } &&
2609          { ac_try='test -s conftest$ac_exeext'
2610   { (eval echo "$as_me:2610: \"$ac_try\"") >&5
2611   (eval $ac_try) 2>&5
2612   ac_status=$?
2613   echo "$as_me:2613: \$? = $ac_status" >&5
2614   (exit $ac_status); }; }; then
2615   cf_cv_need_libm=no
2616 else
2617   echo "$as_me: failed program was:" >&5
2618 cat conftest.$ac_ext >&5
2619 cf_cv_need_libm=yes
2620 fi
2621 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
2622 fi
2623 echo "$as_me:2623: result: $cf_cv_need_libm" >&5
2624 echo "${ECHO_T}$cf_cv_need_libm" >&6
2625 if test "$cf_cv_need_libm" = yes
2626 then
2627 MATH_LIB=-lm
2628 fi
2629
2630 top_builddir=`pwd`
2631
2632 CC_G_OPT="-g"
2633 CC_SHARED_OPTS=unknown
2634 CPPFLAGS="$CPPFLAGS"
2635 DFT_DEP_SUFFIX=""
2636 DFT_OBJ_SUBDIR=`pwd|sed -e's:.*/::'`
2637 DFT_UPR_MODEL="NORMAL"
2638 LD="ld"
2639 LDFLAGS_SHARED=""
2640 LDFLAGS_STATIC=""
2641 LD_MODEL=""
2642 LD_SHARED_OPTS=""
2643 LIBTOOL=""
2644 LIBTOOL_OPTS=""
2645 LIB_CLEAN=""
2646 LIB_COMPILE=""
2647 LIB_LINK='${CC}'
2648 LINK_TESTS=""
2649 LOCAL_LDFLAGS=""
2650 PACKAGE="ncurses-examples"
2651 PTHREAD="-lm"
2652 TEST_ARGS=""
2653 TEST_DEPS=""
2654 TEST_LIBS=""
2655 TINFO_LDFLAGS=''
2656 TINFO_LIBS='$(LIBS_CURSES)'
2657 cf_cv_abi_version=""
2658 cf_cv_rel_version=""
2659 includesubdir=""
2660
2661 cf_cv_screen=curses
2662 cf_cv_libtype=
2663
2664 if test "$GCC" = yes
2665 then
2666 cat > conftest.i <<EOF
2667 #ifndef GCC_PRINTF
2668 #define GCC_PRINTF 0
2669 #endif
2670 #ifndef GCC_SCANF
2671 #define GCC_SCANF 0
2672 #endif
2673 #ifndef GCC_NORETURN
2674 #define GCC_NORETURN /* nothing */
2675 #endif
2676 #ifndef GCC_UNUSED
2677 #define GCC_UNUSED /* nothing */
2678 #endif
2679 EOF
2680 if test "$GCC" = yes
2681 then
2682         { echo "$as_me:2682: checking for $CC __attribute__ directives..." >&5
2683 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
2684 cat > conftest.$ac_ext <<EOF
2685 #line 2685 "${as_me:-configure}"
2686 #include "confdefs.h"
2687 #include "conftest.h"
2688 #include "conftest.i"
2689 #if     GCC_PRINTF
2690 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
2691 #else
2692 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
2693 #endif
2694 #if     GCC_SCANF
2695 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
2696 #else
2697 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
2698 #endif
2699 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
2700 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
2701 extern void foo(void) GCC_NORETURN;
2702 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
2703 EOF
2704         cf_printf_attribute=no
2705         cf_scanf_attribute=no
2706         for cf_attribute in scanf printf unused noreturn
2707         do
2708
2709 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
2710
2711                 cf_directive="__attribute__(($cf_attribute))"
2712                 echo "checking for $CC $cf_directive" 1>&5
2713
2714                 case $cf_attribute in
2715                 (printf)
2716                         cf_printf_attribute=yes
2717                         cat >conftest.h <<EOF
2718 #define GCC_$cf_ATTRIBUTE 1
2719 EOF
2720                         ;;
2721                 (scanf)
2722                         cf_scanf_attribute=yes
2723                         cat >conftest.h <<EOF
2724 #define GCC_$cf_ATTRIBUTE 1
2725 EOF
2726                         ;;
2727                 (*)
2728                         cat >conftest.h <<EOF
2729 #define GCC_$cf_ATTRIBUTE $cf_directive
2730 EOF
2731                         ;;
2732                 esac
2733
2734                 if { (eval echo "$as_me:2734: \"$ac_compile\"") >&5
2735   (eval $ac_compile) 2>&5
2736   ac_status=$?
2737   echo "$as_me:2737: \$? = $ac_status" >&5
2738   (exit $ac_status); }; then
2739                         test -n "$verbose" && echo "$as_me:2739: result: ... $cf_attribute" >&5
2740 echo "${ECHO_T}... $cf_attribute" >&6
2741                         cat conftest.h >>confdefs.h
2742                         case $cf_attribute in
2743                         (noreturn)
2744
2745 cat >>confdefs.h <<EOF
2746 #define GCC_NORETURN $cf_directive
2747 EOF
2748
2749                                 ;;
2750                         (printf)
2751                                 cf_value='/* nothing */'
2752                                 if test "$cf_printf_attribute" != no ; then
2753                                         cf_value='__attribute__((format(printf,fmt,var)))'
2754
2755 cat >>confdefs.h <<\EOF
2756 #define GCC_PRINTF 1
2757 EOF
2758
2759                                 fi
2760
2761 cat >>confdefs.h <<EOF
2762 #define GCC_PRINTFLIKE(fmt,var) $cf_value
2763 EOF
2764
2765                                 ;;
2766                         (scanf)
2767                                 cf_value='/* nothing */'
2768                                 if test "$cf_scanf_attribute" != no ; then
2769                                         cf_value='__attribute__((format(scanf,fmt,var)))'
2770
2771 cat >>confdefs.h <<\EOF
2772 #define GCC_SCANF 1
2773 EOF
2774
2775                                 fi
2776
2777 cat >>confdefs.h <<EOF
2778 #define GCC_SCANFLIKE(fmt,var) $cf_value
2779 EOF
2780
2781                                 ;;
2782                         (unused)
2783
2784 cat >>confdefs.h <<EOF
2785 #define GCC_UNUSED $cf_directive
2786 EOF
2787
2788                                 ;;
2789                         esac
2790                 fi
2791         done
2792 else
2793         fgrep define conftest.i >>confdefs.h
2794 fi
2795 rm -rf conftest*
2796 fi
2797
2798 cf_XOPEN_SOURCE=500
2799 cf_POSIX_C_SOURCE=199506L
2800 cf_xopen_source=
2801
2802 case $host_os in
2803 (aix[4-7]*)
2804         cf_xopen_source="-D_ALL_SOURCE"
2805         ;;
2806 (cygwin|msys)
2807         cf_XOPEN_SOURCE=600
2808         ;;
2809 (darwin[0-8].*)
2810         cf_xopen_source="-D_APPLE_C_SOURCE"
2811         ;;
2812 (darwin*)
2813         cf_xopen_source="-D_DARWIN_C_SOURCE"
2814         cf_XOPEN_SOURCE=
2815         ;;
2816 (freebsd*|dragonfly*)
2817         # 5.x headers associate
2818         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
2819         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
2820         cf_POSIX_C_SOURCE=200112L
2821         cf_XOPEN_SOURCE=600
2822         cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
2823         ;;
2824 (hpux11*)
2825         cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
2826         ;;
2827 (hpux*)
2828         cf_xopen_source="-D_HPUX_SOURCE"
2829         ;;
2830 (irix[56].*)
2831         cf_xopen_source="-D_SGI_SOURCE"
2832         cf_XOPEN_SOURCE=
2833         ;;
2834 (linux*|gnu*|mint*|k*bsd*-gnu)
2835
2836 echo "$as_me:2836: checking if we must define _GNU_SOURCE" >&5
2837 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
2838 if test "${cf_cv_gnu_source+set}" = set; then
2839   echo $ECHO_N "(cached) $ECHO_C" >&6
2840 else
2841
2842 cat >conftest.$ac_ext <<_ACEOF
2843 #line 2843 "configure"
2844 #include "confdefs.h"
2845 #include <sys/types.h>
2846 int
2847 main ()
2848 {
2849
2850 #ifndef _XOPEN_SOURCE
2851 make an error
2852 #endif
2853   ;
2854   return 0;
2855 }
2856 _ACEOF
2857 rm -f conftest.$ac_objext
2858 if { (eval echo "$as_me:2858: \"$ac_compile\"") >&5
2859   (eval $ac_compile) 2>&5
2860   ac_status=$?
2861   echo "$as_me:2861: \$? = $ac_status" >&5
2862   (exit $ac_status); } &&
2863          { ac_try='test -s conftest.$ac_objext'
2864   { (eval echo "$as_me:2864: \"$ac_try\"") >&5
2865   (eval $ac_try) 2>&5
2866   ac_status=$?
2867   echo "$as_me:2867: \$? = $ac_status" >&5
2868   (exit $ac_status); }; }; then
2869   cf_cv_gnu_source=no
2870 else
2871   echo "$as_me: failed program was:" >&5
2872 cat conftest.$ac_ext >&5
2873 cf_save="$CPPFLAGS"
2874          CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
2875          cat >conftest.$ac_ext <<_ACEOF
2876 #line 2876 "configure"
2877 #include "confdefs.h"
2878 #include <sys/types.h>
2879 int
2880 main ()
2881 {
2882
2883 #ifdef _XOPEN_SOURCE
2884 make an error
2885 #endif
2886   ;
2887   return 0;
2888 }
2889 _ACEOF
2890 rm -f conftest.$ac_objext
2891 if { (eval echo "$as_me:2891: \"$ac_compile\"") >&5
2892   (eval $ac_compile) 2>&5
2893   ac_status=$?
2894   echo "$as_me:2894: \$? = $ac_status" >&5
2895   (exit $ac_status); } &&
2896          { ac_try='test -s conftest.$ac_objext'
2897   { (eval echo "$as_me:2897: \"$ac_try\"") >&5
2898   (eval $ac_try) 2>&5
2899   ac_status=$?
2900   echo "$as_me:2900: \$? = $ac_status" >&5
2901   (exit $ac_status); }; }; then
2902   cf_cv_gnu_source=no
2903 else
2904   echo "$as_me: failed program was:" >&5
2905 cat conftest.$ac_ext >&5
2906 cf_cv_gnu_source=yes
2907 fi
2908 rm -f conftest.$ac_objext conftest.$ac_ext
2909         CPPFLAGS="$cf_save"
2910
2911 fi
2912 rm -f conftest.$ac_objext conftest.$ac_ext
2913
2914 fi
2915 echo "$as_me:2915: result: $cf_cv_gnu_source" >&5
2916 echo "${ECHO_T}$cf_cv_gnu_source" >&6
2917 test "$cf_cv_gnu_source" = yes && CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
2918
2919         ;;
2920 (minix*)
2921         cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this...
2922         ;;
2923 (mirbsd*)
2924         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
2925         cf_XOPEN_SOURCE=
2926
2927 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
2928
2929 cf_save_CFLAGS="$CFLAGS"
2930 cf_save_CPPFLAGS="$CPPFLAGS"
2931
2932 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
2933         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
2934                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
2935
2936 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
2937         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
2938                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
2939
2940 echo "$as_me:2940: checking if we should define _POSIX_C_SOURCE" >&5
2941 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
2942 if test "${cf_cv_posix_c_source+set}" = set; then
2943   echo $ECHO_N "(cached) $ECHO_C" >&6
2944 else
2945
2946 echo "${as_me:-configure}:2946: testing if the symbol is already defined go no further ..." 1>&5
2947
2948         cat >conftest.$ac_ext <<_ACEOF
2949 #line 2949 "configure"
2950 #include "confdefs.h"
2951 #include <sys/types.h>
2952 int
2953 main ()
2954 {
2955
2956 #ifndef _POSIX_C_SOURCE
2957 make an error
2958 #endif
2959   ;
2960   return 0;
2961 }
2962 _ACEOF
2963 rm -f conftest.$ac_objext
2964 if { (eval echo "$as_me:2964: \"$ac_compile\"") >&5
2965   (eval $ac_compile) 2>&5
2966   ac_status=$?
2967   echo "$as_me:2967: \$? = $ac_status" >&5
2968   (exit $ac_status); } &&
2969          { ac_try='test -s conftest.$ac_objext'
2970   { (eval echo "$as_me:2970: \"$ac_try\"") >&5
2971   (eval $ac_try) 2>&5
2972   ac_status=$?
2973   echo "$as_me:2973: \$? = $ac_status" >&5
2974   (exit $ac_status); }; }; then
2975   cf_cv_posix_c_source=no
2976 else
2977   echo "$as_me: failed program was:" >&5
2978 cat conftest.$ac_ext >&5
2979 cf_want_posix_source=no
2980          case .$cf_POSIX_C_SOURCE in
2981          (.[12]??*)
2982                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
2983                 ;;
2984          (.2)
2985                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
2986                 cf_want_posix_source=yes
2987                 ;;
2988          (.*)
2989                 cf_want_posix_source=yes
2990                 ;;
2991          esac
2992          if test "$cf_want_posix_source" = yes ; then
2993                 cat >conftest.$ac_ext <<_ACEOF
2994 #line 2994 "configure"
2995 #include "confdefs.h"
2996 #include <sys/types.h>
2997 int
2998 main ()
2999 {
3000
3001 #ifdef _POSIX_SOURCE
3002 make an error
3003 #endif
3004   ;
3005   return 0;
3006 }
3007 _ACEOF
3008 rm -f conftest.$ac_objext
3009 if { (eval echo "$as_me:3009: \"$ac_compile\"") >&5
3010   (eval $ac_compile) 2>&5
3011   ac_status=$?
3012   echo "$as_me:3012: \$? = $ac_status" >&5
3013   (exit $ac_status); } &&
3014          { ac_try='test -s conftest.$ac_objext'
3015   { (eval echo "$as_me:3015: \"$ac_try\"") >&5
3016   (eval $ac_try) 2>&5
3017   ac_status=$?
3018   echo "$as_me:3018: \$? = $ac_status" >&5
3019   (exit $ac_status); }; }; then
3020   :
3021 else
3022   echo "$as_me: failed program was:" >&5
3023 cat conftest.$ac_ext >&5
3024 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
3025 fi
3026 rm -f conftest.$ac_objext conftest.$ac_ext
3027          fi
3028
3029 echo "${as_me:-configure}:3029: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
3030
3031          CFLAGS="$cf_trim_CFLAGS"
3032          CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
3033
3034 echo "${as_me:-configure}:3034: testing if the second compile does not leave our definition intact error ..." 1>&5
3035
3036          cat >conftest.$ac_ext <<_ACEOF
3037 #line 3037 "configure"
3038 #include "confdefs.h"
3039 #include <sys/types.h>
3040 int
3041 main ()
3042 {
3043
3044 #ifndef _POSIX_C_SOURCE
3045 make an error
3046 #endif
3047   ;
3048   return 0;
3049 }
3050 _ACEOF
3051 rm -f conftest.$ac_objext
3052 if { (eval echo "$as_me:3052: \"$ac_compile\"") >&5
3053   (eval $ac_compile) 2>&5
3054   ac_status=$?
3055   echo "$as_me:3055: \$? = $ac_status" >&5
3056   (exit $ac_status); } &&
3057          { ac_try='test -s conftest.$ac_objext'
3058   { (eval echo "$as_me:3058: \"$ac_try\"") >&5
3059   (eval $ac_try) 2>&5
3060   ac_status=$?
3061   echo "$as_me:3061: \$? = $ac_status" >&5
3062   (exit $ac_status); }; }; then
3063   :
3064 else
3065   echo "$as_me: failed program was:" >&5
3066 cat conftest.$ac_ext >&5
3067 cf_cv_posix_c_source=no
3068 fi
3069 rm -f conftest.$ac_objext conftest.$ac_ext
3070          CFLAGS="$cf_save_CFLAGS"
3071          CPPFLAGS="$cf_save_CPPFLAGS"
3072
3073 fi
3074 rm -f conftest.$ac_objext conftest.$ac_ext
3075
3076 fi
3077 echo "$as_me:3077: result: $cf_cv_posix_c_source" >&5
3078 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
3079
3080 if test "$cf_cv_posix_c_source" != no ; then
3081         CFLAGS="$cf_trim_CFLAGS"
3082         CPPFLAGS="$cf_trim_CPPFLAGS"
3083
3084 cf_fix_cppflags=no
3085 cf_new_cflags=
3086 cf_new_cppflags=
3087 cf_new_extra_cppflags=
3088
3089 for cf_add_cflags in $cf_cv_posix_c_source
3090 do
3091 case $cf_fix_cppflags in
3092 (no)
3093         case $cf_add_cflags in
3094         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
3095                 case $cf_add_cflags in
3096                 (-D*)
3097                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3098
3099                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3100                                 && test -z "${cf_tst_cflags}" \
3101                                 && cf_fix_cppflags=yes
3102
3103                         if test $cf_fix_cppflags = yes ; then
3104                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3105                                 continue
3106                         elif test "${cf_tst_cflags}" = "\"'" ; then
3107                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3108                                 continue
3109                         fi
3110                         ;;
3111                 esac
3112                 case "$CPPFLAGS" in
3113                 (*$cf_add_cflags)
3114                         ;;
3115                 (*)
3116                         case $cf_add_cflags in
3117                         (-D*)
3118                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3119
3120 CPPFLAGS=`echo "$CPPFLAGS" | \
3121         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3122                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3123
3124                                 ;;
3125                         esac
3126                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3127                         ;;
3128                 esac
3129                 ;;
3130         (*)
3131                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
3132                 ;;
3133         esac
3134         ;;
3135 (yes)
3136         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3137
3138         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3139
3140         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3141                 && test -z "${cf_tst_cflags}" \
3142                 && cf_fix_cppflags=no
3143         ;;
3144 esac
3145 done
3146
3147 if test -n "$cf_new_cflags" ; then
3148
3149         CFLAGS="$CFLAGS $cf_new_cflags"
3150 fi
3151
3152 if test -n "$cf_new_cppflags" ; then
3153
3154         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
3155 fi
3156
3157 if test -n "$cf_new_extra_cppflags" ; then
3158
3159         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
3160 fi
3161
3162 fi
3163
3164         ;;
3165 (netbsd*)
3166         cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
3167         ;;
3168 (openbsd[4-9]*)
3169         # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
3170         cf_xopen_source="-D_BSD_SOURCE"
3171         cf_XOPEN_SOURCE=600
3172         ;;
3173 (openbsd*)
3174         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
3175         ;;
3176 (os2*)
3177         cf_XOPEN_SOURCE=
3178         ;;
3179 (osf[45]*)
3180         cf_xopen_source="-D_OSF_SOURCE"
3181         ;;
3182 (nto-qnx*)
3183         cf_xopen_source="-D_QNX_SOURCE"
3184         ;;
3185 (sco*)
3186         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
3187         ;;
3188 (solaris2.*)
3189         cf_xopen_source="-D__EXTENSIONS__"
3190         cf_cv_xopen_source=broken
3191         ;;
3192 (sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
3193         cf_XOPEN_SOURCE=
3194         cf_POSIX_C_SOURCE=
3195         ;;
3196 (*)
3197
3198 echo "$as_me:3198: checking if we should define _XOPEN_SOURCE" >&5
3199 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
3200 if test "${cf_cv_xopen_source+set}" = set; then
3201   echo $ECHO_N "(cached) $ECHO_C" >&6
3202 else
3203
3204         cat >conftest.$ac_ext <<_ACEOF
3205 #line 3205 "configure"
3206 #include "confdefs.h"
3207
3208 #include <stdlib.h>
3209 #include <string.h>
3210 #include <sys/types.h>
3211
3212 int
3213 main ()
3214 {
3215
3216 #ifndef _XOPEN_SOURCE
3217 make an error
3218 #endif
3219   ;
3220   return 0;
3221 }
3222 _ACEOF
3223 rm -f conftest.$ac_objext
3224 if { (eval echo "$as_me:3224: \"$ac_compile\"") >&5
3225   (eval $ac_compile) 2>&5
3226   ac_status=$?
3227   echo "$as_me:3227: \$? = $ac_status" >&5
3228   (exit $ac_status); } &&
3229          { ac_try='test -s conftest.$ac_objext'
3230   { (eval echo "$as_me:3230: \"$ac_try\"") >&5
3231   (eval $ac_try) 2>&5
3232   ac_status=$?
3233   echo "$as_me:3233: \$? = $ac_status" >&5
3234   (exit $ac_status); }; }; then
3235   cf_cv_xopen_source=no
3236 else
3237   echo "$as_me: failed program was:" >&5
3238 cat conftest.$ac_ext >&5
3239 cf_save="$CPPFLAGS"
3240          CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
3241          cat >conftest.$ac_ext <<_ACEOF
3242 #line 3242 "configure"
3243 #include "confdefs.h"
3244
3245 #include <stdlib.h>
3246 #include <string.h>
3247 #include <sys/types.h>
3248
3249 int
3250 main ()
3251 {
3252
3253 #ifdef _XOPEN_SOURCE
3254 make an error
3255 #endif
3256   ;
3257   return 0;
3258 }
3259 _ACEOF
3260 rm -f conftest.$ac_objext
3261 if { (eval echo "$as_me:3261: \"$ac_compile\"") >&5
3262   (eval $ac_compile) 2>&5
3263   ac_status=$?
3264   echo "$as_me:3264: \$? = $ac_status" >&5
3265   (exit $ac_status); } &&
3266          { ac_try='test -s conftest.$ac_objext'
3267   { (eval echo "$as_me:3267: \"$ac_try\"") >&5
3268   (eval $ac_try) 2>&5
3269   ac_status=$?
3270   echo "$as_me:3270: \$? = $ac_status" >&5
3271   (exit $ac_status); }; }; then
3272   cf_cv_xopen_source=no
3273 else
3274   echo "$as_me: failed program was:" >&5
3275 cat conftest.$ac_ext >&5
3276 cf_cv_xopen_source=$cf_XOPEN_SOURCE
3277 fi
3278 rm -f conftest.$ac_objext conftest.$ac_ext
3279         CPPFLAGS="$cf_save"
3280
3281 fi
3282 rm -f conftest.$ac_objext conftest.$ac_ext
3283
3284 fi
3285 echo "$as_me:3285: result: $cf_cv_xopen_source" >&5
3286 echo "${ECHO_T}$cf_cv_xopen_source" >&6
3287
3288 if test "$cf_cv_xopen_source" != no ; then
3289
3290 CFLAGS=`echo "$CFLAGS" | \
3291         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
3292                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
3293
3294 CPPFLAGS=`echo "$CPPFLAGS" | \
3295         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
3296                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
3297
3298         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
3299
3300 cf_fix_cppflags=no
3301 cf_new_cflags=
3302 cf_new_cppflags=
3303 cf_new_extra_cppflags=
3304
3305 for cf_add_cflags in $cf_temp_xopen_source
3306 do
3307 case $cf_fix_cppflags in
3308 (no)
3309         case $cf_add_cflags in
3310         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
3311                 case $cf_add_cflags in
3312                 (-D*)
3313                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3314
3315                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3316                                 && test -z "${cf_tst_cflags}" \
3317                                 && cf_fix_cppflags=yes
3318
3319                         if test $cf_fix_cppflags = yes ; then
3320                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3321                                 continue
3322                         elif test "${cf_tst_cflags}" = "\"'" ; then
3323                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3324                                 continue
3325                         fi
3326                         ;;
3327                 esac
3328                 case "$CPPFLAGS" in
3329                 (*$cf_add_cflags)
3330                         ;;
3331                 (*)
3332                         case $cf_add_cflags in
3333                         (-D*)
3334                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3335
3336 CPPFLAGS=`echo "$CPPFLAGS" | \
3337         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3338                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3339
3340                                 ;;
3341                         esac
3342                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3343                         ;;
3344                 esac
3345                 ;;
3346         (*)
3347                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
3348                 ;;
3349         esac
3350         ;;
3351 (yes)
3352         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3353
3354         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3355
3356         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3357                 && test -z "${cf_tst_cflags}" \
3358                 && cf_fix_cppflags=no
3359         ;;
3360 esac
3361 done
3362
3363 if test -n "$cf_new_cflags" ; then
3364
3365         CFLAGS="$CFLAGS $cf_new_cflags"
3366 fi
3367
3368 if test -n "$cf_new_cppflags" ; then
3369
3370         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
3371 fi
3372
3373 if test -n "$cf_new_extra_cppflags" ; then
3374
3375         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
3376 fi
3377
3378 fi
3379
3380 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
3381
3382 cf_save_CFLAGS="$CFLAGS"
3383 cf_save_CPPFLAGS="$CPPFLAGS"
3384
3385 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
3386         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
3387                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
3388
3389 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
3390         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
3391                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
3392
3393 echo "$as_me:3393: checking if we should define _POSIX_C_SOURCE" >&5
3394 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
3395 if test "${cf_cv_posix_c_source+set}" = set; then
3396   echo $ECHO_N "(cached) $ECHO_C" >&6
3397 else
3398
3399 echo "${as_me:-configure}:3399: testing if the symbol is already defined go no further ..." 1>&5
3400
3401         cat >conftest.$ac_ext <<_ACEOF
3402 #line 3402 "configure"
3403 #include "confdefs.h"
3404 #include <sys/types.h>
3405 int
3406 main ()
3407 {
3408
3409 #ifndef _POSIX_C_SOURCE
3410 make an error
3411 #endif
3412   ;
3413   return 0;
3414 }
3415 _ACEOF
3416 rm -f conftest.$ac_objext
3417 if { (eval echo "$as_me:3417: \"$ac_compile\"") >&5
3418   (eval $ac_compile) 2>&5
3419   ac_status=$?
3420   echo "$as_me:3420: \$? = $ac_status" >&5
3421   (exit $ac_status); } &&
3422          { ac_try='test -s conftest.$ac_objext'
3423   { (eval echo "$as_me:3423: \"$ac_try\"") >&5
3424   (eval $ac_try) 2>&5
3425   ac_status=$?
3426   echo "$as_me:3426: \$? = $ac_status" >&5
3427   (exit $ac_status); }; }; then
3428   cf_cv_posix_c_source=no
3429 else
3430   echo "$as_me: failed program was:" >&5
3431 cat conftest.$ac_ext >&5
3432 cf_want_posix_source=no
3433          case .$cf_POSIX_C_SOURCE in
3434          (.[12]??*)
3435                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
3436                 ;;
3437          (.2)
3438                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
3439                 cf_want_posix_source=yes
3440                 ;;
3441          (.*)
3442                 cf_want_posix_source=yes
3443                 ;;
3444          esac
3445          if test "$cf_want_posix_source" = yes ; then
3446                 cat >conftest.$ac_ext <<_ACEOF
3447 #line 3447 "configure"
3448 #include "confdefs.h"
3449 #include <sys/types.h>
3450 int
3451 main ()
3452 {
3453
3454 #ifdef _POSIX_SOURCE
3455 make an error
3456 #endif
3457   ;
3458   return 0;
3459 }
3460 _ACEOF
3461 rm -f conftest.$ac_objext
3462 if { (eval echo "$as_me:3462: \"$ac_compile\"") >&5
3463   (eval $ac_compile) 2>&5
3464   ac_status=$?
3465   echo "$as_me:3465: \$? = $ac_status" >&5
3466   (exit $ac_status); } &&
3467          { ac_try='test -s conftest.$ac_objext'
3468   { (eval echo "$as_me:3468: \"$ac_try\"") >&5
3469   (eval $ac_try) 2>&5
3470   ac_status=$?
3471   echo "$as_me:3471: \$? = $ac_status" >&5
3472   (exit $ac_status); }; }; then
3473   :
3474 else
3475   echo "$as_me: failed program was:" >&5
3476 cat conftest.$ac_ext >&5
3477 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
3478 fi
3479 rm -f conftest.$ac_objext conftest.$ac_ext
3480          fi
3481
3482 echo "${as_me:-configure}:3482: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
3483
3484          CFLAGS="$cf_trim_CFLAGS"
3485          CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
3486
3487 echo "${as_me:-configure}:3487: testing if the second compile does not leave our definition intact error ..." 1>&5
3488
3489          cat >conftest.$ac_ext <<_ACEOF
3490 #line 3490 "configure"
3491 #include "confdefs.h"
3492 #include <sys/types.h>
3493 int
3494 main ()
3495 {
3496
3497 #ifndef _POSIX_C_SOURCE
3498 make an error
3499 #endif
3500   ;
3501   return 0;
3502 }
3503 _ACEOF
3504 rm -f conftest.$ac_objext
3505 if { (eval echo "$as_me:3505: \"$ac_compile\"") >&5
3506   (eval $ac_compile) 2>&5
3507   ac_status=$?
3508   echo "$as_me:3508: \$? = $ac_status" >&5
3509   (exit $ac_status); } &&
3510          { ac_try='test -s conftest.$ac_objext'
3511   { (eval echo "$as_me:3511: \"$ac_try\"") >&5
3512   (eval $ac_try) 2>&5
3513   ac_status=$?
3514   echo "$as_me:3514: \$? = $ac_status" >&5
3515   (exit $ac_status); }; }; then
3516   :
3517 else
3518   echo "$as_me: failed program was:" >&5
3519 cat conftest.$ac_ext >&5
3520 cf_cv_posix_c_source=no
3521 fi
3522 rm -f conftest.$ac_objext conftest.$ac_ext
3523          CFLAGS="$cf_save_CFLAGS"
3524          CPPFLAGS="$cf_save_CPPFLAGS"
3525
3526 fi
3527 rm -f conftest.$ac_objext conftest.$ac_ext
3528
3529 fi
3530 echo "$as_me:3530: result: $cf_cv_posix_c_source" >&5
3531 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
3532
3533 if test "$cf_cv_posix_c_source" != no ; then
3534         CFLAGS="$cf_trim_CFLAGS"
3535         CPPFLAGS="$cf_trim_CPPFLAGS"
3536
3537 cf_fix_cppflags=no
3538 cf_new_cflags=
3539 cf_new_cppflags=
3540 cf_new_extra_cppflags=
3541
3542 for cf_add_cflags in $cf_cv_posix_c_source
3543 do
3544 case $cf_fix_cppflags in
3545 (no)
3546         case $cf_add_cflags in
3547         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
3548                 case $cf_add_cflags in
3549                 (-D*)
3550                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3551
3552                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3553                                 && test -z "${cf_tst_cflags}" \
3554                                 && cf_fix_cppflags=yes
3555
3556                         if test $cf_fix_cppflags = yes ; then
3557                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3558                                 continue
3559                         elif test "${cf_tst_cflags}" = "\"'" ; then
3560                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3561                                 continue
3562                         fi
3563                         ;;
3564                 esac
3565                 case "$CPPFLAGS" in
3566                 (*$cf_add_cflags)
3567                         ;;
3568                 (*)
3569                         case $cf_add_cflags in
3570                         (-D*)
3571                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3572
3573 CPPFLAGS=`echo "$CPPFLAGS" | \
3574         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3575                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3576
3577                                 ;;
3578                         esac
3579                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3580                         ;;
3581                 esac
3582                 ;;
3583         (*)
3584                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
3585                 ;;
3586         esac
3587         ;;
3588 (yes)
3589         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3590
3591         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3592
3593         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3594                 && test -z "${cf_tst_cflags}" \
3595                 && cf_fix_cppflags=no
3596         ;;
3597 esac
3598 done
3599
3600 if test -n "$cf_new_cflags" ; then
3601
3602         CFLAGS="$CFLAGS $cf_new_cflags"
3603 fi
3604
3605 if test -n "$cf_new_cppflags" ; then
3606
3607         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
3608 fi
3609
3610 if test -n "$cf_new_extra_cppflags" ; then
3611
3612         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
3613 fi
3614
3615 fi
3616
3617         ;;
3618 esac
3619
3620 if test -n "$cf_xopen_source" ; then
3621
3622 cf_fix_cppflags=no
3623 cf_new_cflags=
3624 cf_new_cppflags=
3625 cf_new_extra_cppflags=
3626
3627 for cf_add_cflags in $cf_xopen_source
3628 do
3629 case $cf_fix_cppflags in
3630 (no)
3631         case $cf_add_cflags in
3632         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
3633                 case $cf_add_cflags in
3634                 (-D*)
3635                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3636
3637                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3638                                 && test -z "${cf_tst_cflags}" \
3639                                 && cf_fix_cppflags=yes
3640
3641                         if test $cf_fix_cppflags = yes ; then
3642                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3643                                 continue
3644                         elif test "${cf_tst_cflags}" = "\"'" ; then
3645                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3646                                 continue
3647                         fi
3648                         ;;
3649                 esac
3650                 case "$CPPFLAGS" in
3651                 (*$cf_add_cflags)
3652                         ;;
3653                 (*)
3654                         case $cf_add_cflags in
3655                         (-D*)
3656                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3657
3658 CPPFLAGS=`echo "$CPPFLAGS" | \
3659         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3660                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3661
3662                                 ;;
3663                         esac
3664                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3665                         ;;
3666                 esac
3667                 ;;
3668         (*)
3669                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
3670                 ;;
3671         esac
3672         ;;
3673 (yes)
3674         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3675
3676         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3677
3678         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3679                 && test -z "${cf_tst_cflags}" \
3680                 && cf_fix_cppflags=no
3681         ;;
3682 esac
3683 done
3684
3685 if test -n "$cf_new_cflags" ; then
3686         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
3687
3688 echo "${as_me:-configure}:3688: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
3689
3690         CFLAGS="$CFLAGS $cf_new_cflags"
3691 fi
3692
3693 if test -n "$cf_new_cppflags" ; then
3694         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
3695
3696 echo "${as_me:-configure}:3696: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
3697
3698         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
3699 fi
3700
3701 if test -n "$cf_new_extra_cppflags" ; then
3702         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
3703
3704 echo "${as_me:-configure}:3704: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
3705
3706         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
3707 fi
3708
3709 fi
3710
3711 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
3712         echo "$as_me:3712: checking if _XOPEN_SOURCE really is set" >&5
3713 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
3714         cat >conftest.$ac_ext <<_ACEOF
3715 #line 3715 "configure"
3716 #include "confdefs.h"
3717 #include <stdlib.h>
3718 int
3719 main ()
3720 {
3721
3722 #ifndef _XOPEN_SOURCE
3723 make an error
3724 #endif
3725   ;
3726   return 0;
3727 }
3728 _ACEOF
3729 rm -f conftest.$ac_objext
3730 if { (eval echo "$as_me:3730: \"$ac_compile\"") >&5
3731   (eval $ac_compile) 2>&5
3732   ac_status=$?
3733   echo "$as_me:3733: \$? = $ac_status" >&5
3734   (exit $ac_status); } &&
3735          { ac_try='test -s conftest.$ac_objext'
3736   { (eval echo "$as_me:3736: \"$ac_try\"") >&5
3737   (eval $ac_try) 2>&5
3738   ac_status=$?
3739   echo "$as_me:3739: \$? = $ac_status" >&5
3740   (exit $ac_status); }; }; then
3741   cf_XOPEN_SOURCE_set=yes
3742 else
3743   echo "$as_me: failed program was:" >&5
3744 cat conftest.$ac_ext >&5
3745 cf_XOPEN_SOURCE_set=no
3746 fi
3747 rm -f conftest.$ac_objext conftest.$ac_ext
3748         echo "$as_me:3748: result: $cf_XOPEN_SOURCE_set" >&5
3749 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
3750         if test $cf_XOPEN_SOURCE_set = yes
3751         then
3752                 cat >conftest.$ac_ext <<_ACEOF
3753 #line 3753 "configure"
3754 #include "confdefs.h"
3755 #include <stdlib.h>
3756 int
3757 main ()
3758 {
3759
3760 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
3761 make an error
3762 #endif
3763   ;
3764   return 0;
3765 }
3766 _ACEOF
3767 rm -f conftest.$ac_objext
3768 if { (eval echo "$as_me:3768: \"$ac_compile\"") >&5
3769   (eval $ac_compile) 2>&5
3770   ac_status=$?
3771   echo "$as_me:3771: \$? = $ac_status" >&5
3772   (exit $ac_status); } &&
3773          { ac_try='test -s conftest.$ac_objext'
3774   { (eval echo "$as_me:3774: \"$ac_try\"") >&5
3775   (eval $ac_try) 2>&5
3776   ac_status=$?
3777   echo "$as_me:3777: \$? = $ac_status" >&5
3778   (exit $ac_status); }; }; then
3779   cf_XOPEN_SOURCE_set_ok=yes
3780 else
3781   echo "$as_me: failed program was:" >&5
3782 cat conftest.$ac_ext >&5
3783 cf_XOPEN_SOURCE_set_ok=no
3784 fi
3785 rm -f conftest.$ac_objext conftest.$ac_ext
3786                 if test $cf_XOPEN_SOURCE_set_ok = no
3787                 then
3788                         { echo "$as_me:3788: WARNING: _XOPEN_SOURCE is lower than requested" >&5
3789 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
3790                 fi
3791         else
3792
3793 echo "$as_me:3793: checking if we should define _XOPEN_SOURCE" >&5
3794 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
3795 if test "${cf_cv_xopen_source+set}" = set; then
3796   echo $ECHO_N "(cached) $ECHO_C" >&6
3797 else
3798
3799         cat >conftest.$ac_ext <<_ACEOF
3800 #line 3800 "configure"
3801 #include "confdefs.h"
3802
3803 #include <stdlib.h>
3804 #include <string.h>
3805 #include <sys/types.h>
3806
3807 int
3808 main ()
3809 {
3810
3811 #ifndef _XOPEN_SOURCE
3812 make an error
3813 #endif
3814   ;
3815   return 0;
3816 }
3817 _ACEOF
3818 rm -f conftest.$ac_objext
3819 if { (eval echo "$as_me:3819: \"$ac_compile\"") >&5
3820   (eval $ac_compile) 2>&5
3821   ac_status=$?
3822   echo "$as_me:3822: \$? = $ac_status" >&5
3823   (exit $ac_status); } &&
3824          { ac_try='test -s conftest.$ac_objext'
3825   { (eval echo "$as_me:3825: \"$ac_try\"") >&5
3826   (eval $ac_try) 2>&5
3827   ac_status=$?
3828   echo "$as_me:3828: \$? = $ac_status" >&5
3829   (exit $ac_status); }; }; then
3830   cf_cv_xopen_source=no
3831 else
3832   echo "$as_me: failed program was:" >&5
3833 cat conftest.$ac_ext >&5
3834 cf_save="$CPPFLAGS"
3835          CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
3836          cat >conftest.$ac_ext <<_ACEOF
3837 #line 3837 "configure"
3838 #include "confdefs.h"
3839
3840 #include <stdlib.h>
3841 #include <string.h>
3842 #include <sys/types.h>
3843
3844 int
3845 main ()
3846 {
3847
3848 #ifdef _XOPEN_SOURCE
3849 make an error
3850 #endif
3851   ;
3852   return 0;
3853 }
3854 _ACEOF
3855 rm -f conftest.$ac_objext
3856 if { (eval echo "$as_me:3856: \"$ac_compile\"") >&5
3857   (eval $ac_compile) 2>&5
3858   ac_status=$?
3859   echo "$as_me:3859: \$? = $ac_status" >&5
3860   (exit $ac_status); } &&
3861          { ac_try='test -s conftest.$ac_objext'
3862   { (eval echo "$as_me:3862: \"$ac_try\"") >&5
3863   (eval $ac_try) 2>&5
3864   ac_status=$?
3865   echo "$as_me:3865: \$? = $ac_status" >&5
3866   (exit $ac_status); }; }; then
3867   cf_cv_xopen_source=no
3868 else
3869   echo "$as_me: failed program was:" >&5
3870 cat conftest.$ac_ext >&5
3871 cf_cv_xopen_source=$cf_XOPEN_SOURCE
3872 fi
3873 rm -f conftest.$ac_objext conftest.$ac_ext
3874         CPPFLAGS="$cf_save"
3875
3876 fi
3877 rm -f conftest.$ac_objext conftest.$ac_ext
3878
3879 fi
3880 echo "$as_me:3880: result: $cf_cv_xopen_source" >&5
3881 echo "${ECHO_T}$cf_cv_xopen_source" >&6
3882
3883 if test "$cf_cv_xopen_source" != no ; then
3884
3885 CFLAGS=`echo "$CFLAGS" | \
3886         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
3887                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
3888
3889 CPPFLAGS=`echo "$CPPFLAGS" | \
3890         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
3891                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
3892
3893         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
3894
3895 cf_fix_cppflags=no
3896 cf_new_cflags=
3897 cf_new_cppflags=
3898 cf_new_extra_cppflags=
3899
3900 for cf_add_cflags in $cf_temp_xopen_source
3901 do
3902 case $cf_fix_cppflags in
3903 (no)
3904         case $cf_add_cflags in
3905         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
3906                 case $cf_add_cflags in
3907                 (-D*)
3908                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3909
3910                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3911                                 && test -z "${cf_tst_cflags}" \
3912                                 && cf_fix_cppflags=yes
3913
3914                         if test $cf_fix_cppflags = yes ; then
3915                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3916                                 continue
3917                         elif test "${cf_tst_cflags}" = "\"'" ; then
3918                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3919                                 continue
3920                         fi
3921                         ;;
3922                 esac
3923                 case "$CPPFLAGS" in
3924                 (*$cf_add_cflags)
3925                         ;;
3926                 (*)
3927                         case $cf_add_cflags in
3928                         (-D*)
3929                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3930
3931 CPPFLAGS=`echo "$CPPFLAGS" | \
3932         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3933                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3934
3935                                 ;;
3936                         esac
3937                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3938                         ;;
3939                 esac
3940                 ;;
3941         (*)
3942                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
3943                 ;;
3944         esac
3945         ;;
3946 (yes)
3947         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3948
3949         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3950
3951         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3952                 && test -z "${cf_tst_cflags}" \
3953                 && cf_fix_cppflags=no
3954         ;;
3955 esac
3956 done
3957
3958 if test -n "$cf_new_cflags" ; then
3959
3960         CFLAGS="$CFLAGS $cf_new_cflags"
3961 fi
3962
3963 if test -n "$cf_new_cppflags" ; then
3964
3965         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
3966 fi
3967
3968 if test -n "$cf_new_extra_cppflags" ; then
3969
3970         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
3971 fi
3972
3973 fi
3974
3975         fi
3976 fi
3977
3978 echo "$as_me:3978: checking for signal global datatype" >&5
3979 echo $ECHO_N "checking for signal global datatype... $ECHO_C" >&6
3980 if test "${cf_cv_sig_atomic_t+set}" = set; then
3981   echo $ECHO_N "(cached) $ECHO_C" >&6
3982 else
3983
3984         for cf_type in \
3985                 "volatile sig_atomic_t" \
3986                 "sig_atomic_t" \
3987                 "int"
3988         do
3989         cat >conftest.$ac_ext <<_ACEOF
3990 #line 3990 "configure"
3991 #include "confdefs.h"
3992
3993 #include <sys/types.h>
3994 #include <signal.h>
3995 #include <stdio.h>
3996
3997 extern $cf_type x;
3998 $cf_type x;
3999 static void handler(int sig)
4000 {
4001         x = 5;
4002 }
4003 int
4004 main ()
4005 {
4006 signal(SIGINT, handler);
4007                  x = 1
4008   ;
4009   return 0;
4010 }
4011 _ACEOF
4012 rm -f conftest.$ac_objext
4013 if { (eval echo "$as_me:4013: \"$ac_compile\"") >&5
4014   (eval $ac_compile) 2>&5
4015   ac_status=$?
4016   echo "$as_me:4016: \$? = $ac_status" >&5
4017   (exit $ac_status); } &&
4018          { ac_try='test -s conftest.$ac_objext'
4019   { (eval echo "$as_me:4019: \"$ac_try\"") >&5
4020   (eval $ac_try) 2>&5
4021   ac_status=$?
4022   echo "$as_me:4022: \$? = $ac_status" >&5
4023   (exit $ac_status); }; }; then
4024   cf_cv_sig_atomic_t=$cf_type
4025 else
4026   echo "$as_me: failed program was:" >&5
4027 cat conftest.$ac_ext >&5
4028 cf_cv_sig_atomic_t=no
4029 fi
4030 rm -f conftest.$ac_objext conftest.$ac_ext
4031                 test "$cf_cv_sig_atomic_t" != no && break
4032         done
4033
4034 fi
4035
4036 echo "$as_me:4036: result: $cf_cv_sig_atomic_t" >&5
4037 echo "${ECHO_T}$cf_cv_sig_atomic_t" >&6
4038 test "$cf_cv_sig_atomic_t" != no &&
4039 cat >>confdefs.h <<EOF
4040 #define SIG_ATOMIC_T $cf_cv_sig_atomic_t
4041 EOF
4042
4043 # Work around breakage on OS X
4044
4045 echo "$as_me:4045: checking if SIGWINCH is defined" >&5
4046 echo $ECHO_N "checking if SIGWINCH is defined... $ECHO_C" >&6
4047 if test "${cf_cv_define_sigwinch+set}" = set; then
4048   echo $ECHO_N "(cached) $ECHO_C" >&6
4049 else
4050
4051         cat >conftest.$ac_ext <<_ACEOF
4052 #line 4052 "configure"
4053 #include "confdefs.h"
4054
4055 #include <sys/types.h>
4056 #include <sys/signal.h>
4057
4058 int
4059 main ()
4060 {
4061 int x = SIGWINCH
4062   ;
4063   return 0;
4064 }
4065 _ACEOF
4066 rm -f conftest.$ac_objext
4067 if { (eval echo "$as_me:4067: \"$ac_compile\"") >&5
4068   (eval $ac_compile) 2>&5
4069   ac_status=$?
4070   echo "$as_me:4070: \$? = $ac_status" >&5
4071   (exit $ac_status); } &&
4072          { ac_try='test -s conftest.$ac_objext'
4073   { (eval echo "$as_me:4073: \"$ac_try\"") >&5
4074   (eval $ac_try) 2>&5
4075   ac_status=$?
4076   echo "$as_me:4076: \$? = $ac_status" >&5
4077   (exit $ac_status); }; }; then
4078   cf_cv_define_sigwinch=yes
4079 else
4080   echo "$as_me: failed program was:" >&5
4081 cat conftest.$ac_ext >&5
4082 cat >conftest.$ac_ext <<_ACEOF
4083 #line 4083 "configure"
4084 #include "confdefs.h"
4085
4086 #undef _XOPEN_SOURCE
4087 #undef _POSIX_SOURCE
4088 #undef _POSIX_C_SOURCE
4089 #include <sys/types.h>
4090 #include <sys/signal.h>
4091
4092 int
4093 main ()
4094 {
4095 int x = SIGWINCH
4096   ;
4097   return 0;
4098 }
4099 _ACEOF
4100 rm -f conftest.$ac_objext
4101 if { (eval echo "$as_me:4101: \"$ac_compile\"") >&5
4102   (eval $ac_compile) 2>&5
4103   ac_status=$?
4104   echo "$as_me:4104: \$? = $ac_status" >&5
4105   (exit $ac_status); } &&
4106          { ac_try='test -s conftest.$ac_objext'
4107   { (eval echo "$as_me:4107: \"$ac_try\"") >&5
4108   (eval $ac_try) 2>&5
4109   ac_status=$?
4110   echo "$as_me:4110: \$? = $ac_status" >&5
4111   (exit $ac_status); }; }; then
4112   cf_cv_define_sigwinch=maybe
4113 else
4114   echo "$as_me: failed program was:" >&5
4115 cat conftest.$ac_ext >&5
4116 cf_cv_define_sigwinch=no
4117 fi
4118 rm -f conftest.$ac_objext conftest.$ac_ext
4119
4120 fi
4121 rm -f conftest.$ac_objext conftest.$ac_ext
4122
4123 fi
4124 echo "$as_me:4124: result: $cf_cv_define_sigwinch" >&5
4125 echo "${ECHO_T}$cf_cv_define_sigwinch" >&6
4126
4127 if test "$cf_cv_define_sigwinch" = maybe ; then
4128 echo "$as_me:4128: checking for actual SIGWINCH definition" >&5
4129 echo $ECHO_N "checking for actual SIGWINCH definition... $ECHO_C" >&6
4130 if test "${cf_cv_fixup_sigwinch+set}" = set; then
4131   echo $ECHO_N "(cached) $ECHO_C" >&6
4132 else
4133
4134 cf_cv_fixup_sigwinch=unknown
4135 cf_sigwinch=32
4136 while test $cf_sigwinch != 1
4137 do
4138         cat >conftest.$ac_ext <<_ACEOF
4139 #line 4139 "configure"
4140 #include "confdefs.h"
4141
4142 #undef _XOPEN_SOURCE
4143 #undef _POSIX_SOURCE
4144 #undef _POSIX_C_SOURCE
4145 #include <sys/types.h>
4146 #include <sys/signal.h>
4147
4148 int
4149 main ()
4150 {
4151
4152 #if SIGWINCH != $cf_sigwinch
4153 make an error
4154 #endif
4155 int x = SIGWINCH
4156   ;
4157   return 0;
4158 }
4159 _ACEOF
4160 rm -f conftest.$ac_objext
4161 if { (eval echo "$as_me:4161: \"$ac_compile\"") >&5
4162   (eval $ac_compile) 2>&5
4163   ac_status=$?
4164   echo "$as_me:4164: \$? = $ac_status" >&5
4165   (exit $ac_status); } &&
4166          { ac_try='test -s conftest.$ac_objext'
4167   { (eval echo "$as_me:4167: \"$ac_try\"") >&5
4168   (eval $ac_try) 2>&5
4169   ac_status=$?
4170   echo "$as_me:4170: \$? = $ac_status" >&5
4171   (exit $ac_status); }; }; then
4172   cf_cv_fixup_sigwinch=$cf_sigwinch
4173          break
4174 else
4175   echo "$as_me: failed program was:" >&5
4176 cat conftest.$ac_ext >&5
4177 fi
4178 rm -f conftest.$ac_objext conftest.$ac_ext
4179
4180 cf_sigwinch=`expr $cf_sigwinch - 1`
4181 done
4182
4183 fi
4184 echo "$as_me:4184: result: $cf_cv_fixup_sigwinch" >&5
4185 echo "${ECHO_T}$cf_cv_fixup_sigwinch" >&6
4186
4187         if test "$cf_cv_fixup_sigwinch" != unknown ; then
4188                 CPPFLAGS="$CPPFLAGS -DSIGWINCH=$cf_cv_fixup_sigwinch"
4189         fi
4190 fi
4191
4192 # Checks for CODESET support.
4193
4194 echo "$as_me:4194: checking for nl_langinfo and CODESET" >&5
4195 echo $ECHO_N "checking for nl_langinfo and CODESET... $ECHO_C" >&6
4196 if test "${am_cv_langinfo_codeset+set}" = set; then
4197   echo $ECHO_N "(cached) $ECHO_C" >&6
4198 else
4199   cat >conftest.$ac_ext <<_ACEOF
4200 #line 4200 "configure"
4201 #include "confdefs.h"
4202 #include <langinfo.h>
4203 int
4204 main ()
4205 {
4206 char* cs = nl_langinfo(CODESET);
4207   ;
4208   return 0;
4209 }
4210 _ACEOF
4211 rm -f conftest.$ac_objext conftest$ac_exeext
4212 if { (eval echo "$as_me:4212: \"$ac_link\"") >&5
4213   (eval $ac_link) 2>&5
4214   ac_status=$?
4215   echo "$as_me:4215: \$? = $ac_status" >&5
4216   (exit $ac_status); } &&
4217          { ac_try='test -s conftest$ac_exeext'
4218   { (eval echo "$as_me:4218: \"$ac_try\"") >&5
4219   (eval $ac_try) 2>&5
4220   ac_status=$?
4221   echo "$as_me:4221: \$? = $ac_status" >&5
4222   (exit $ac_status); }; }; then
4223   am_cv_langinfo_codeset=yes
4224 else
4225   echo "$as_me: failed program was:" >&5
4226 cat conftest.$ac_ext >&5
4227 am_cv_langinfo_codeset=no
4228 fi
4229 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4230
4231 fi
4232 echo "$as_me:4232: result: $am_cv_langinfo_codeset" >&5
4233 echo "${ECHO_T}$am_cv_langinfo_codeset" >&6
4234         if test $am_cv_langinfo_codeset = yes; then
4235
4236 cat >>confdefs.h <<\EOF
4237 #define HAVE_LANGINFO_CODESET 1
4238 EOF
4239
4240         fi
4241
4242 echo "$as_me:4242: checking if you want to use pkg-config" >&5
4243 echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6
4244
4245 # Check whether --with-pkg-config or --without-pkg-config was given.
4246 if test "${with_pkg_config+set}" = set; then
4247   withval="$with_pkg_config"
4248   cf_pkg_config=$withval
4249 else
4250   cf_pkg_config=yes
4251 fi;
4252 echo "$as_me:4252: result: $cf_pkg_config" >&5
4253 echo "${ECHO_T}$cf_pkg_config" >&6
4254
4255 case $cf_pkg_config in
4256 (no)
4257         PKG_CONFIG=none
4258         ;;
4259 (yes)
4260
4261 if test -n "$ac_tool_prefix"; then
4262   # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
4263 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
4264 echo "$as_me:4264: checking for $ac_word" >&5
4265 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4266 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
4267   echo $ECHO_N "(cached) $ECHO_C" >&6
4268 else
4269   case $PKG_CONFIG in
4270   [\\/]* | ?:[\\/]*)
4271   ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
4272   ;;
4273   *)
4274   ac_save_IFS=$IFS; IFS=$ac_path_separator
4275 ac_dummy="$PATH"
4276 for ac_dir in $ac_dummy; do
4277   IFS=$ac_save_IFS
4278   test -z "$ac_dir" && ac_dir=.
4279   if $as_executable_p "$ac_dir/$ac_word"; then
4280    ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
4281    echo "$as_me:4281: found $ac_dir/$ac_word" >&5
4282    break
4283 fi
4284 done
4285
4286   ;;
4287 esac
4288 fi
4289 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
4290
4291 if test -n "$PKG_CONFIG"; then
4292   echo "$as_me:4292: result: $PKG_CONFIG" >&5
4293 echo "${ECHO_T}$PKG_CONFIG" >&6
4294 else
4295   echo "$as_me:4295: result: no" >&5
4296 echo "${ECHO_T}no" >&6
4297 fi
4298
4299 fi
4300 if test -z "$ac_cv_path_PKG_CONFIG"; then
4301   ac_pt_PKG_CONFIG=$PKG_CONFIG
4302   # Extract the first word of "pkg-config", so it can be a program name with args.
4303 set dummy pkg-config; ac_word=$2
4304 echo "$as_me:4304: checking for $ac_word" >&5
4305 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4306 if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
4307   echo $ECHO_N "(cached) $ECHO_C" >&6
4308 else
4309   case $ac_pt_PKG_CONFIG in
4310   [\\/]* | ?:[\\/]*)
4311   ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
4312   ;;
4313   *)
4314   ac_save_IFS=$IFS; IFS=$ac_path_separator
4315 ac_dummy="$PATH"
4316 for ac_dir in $ac_dummy; do
4317   IFS=$ac_save_IFS
4318   test -z "$ac_dir" && ac_dir=.
4319   if $as_executable_p "$ac_dir/$ac_word"; then
4320    ac_cv_path_ac_pt_PKG_CONFIG="$ac_dir/$ac_word"
4321    echo "$as_me:4321: found $ac_dir/$ac_word" >&5
4322    break
4323 fi
4324 done
4325
4326   test -z "$ac_cv_path_ac_pt_PKG_CONFIG" && ac_cv_path_ac_pt_PKG_CONFIG="none"
4327   ;;
4328 esac
4329 fi
4330 ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
4331
4332 if test -n "$ac_pt_PKG_CONFIG"; then
4333   echo "$as_me:4333: result: $ac_pt_PKG_CONFIG" >&5
4334 echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
4335 else
4336   echo "$as_me:4336: result: no" >&5
4337 echo "${ECHO_T}no" >&6
4338 fi
4339
4340   PKG_CONFIG=$ac_pt_PKG_CONFIG
4341 else
4342   PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
4343 fi
4344
4345         ;;
4346 (*)
4347         PKG_CONFIG=$withval
4348         ;;
4349 esac
4350
4351 test -z "$PKG_CONFIG" && PKG_CONFIG=none
4352 if test "$PKG_CONFIG" != none ; then
4353
4354 if test "x$prefix" != xNONE; then
4355         cf_path_syntax="$prefix"
4356 else
4357         cf_path_syntax="$ac_default_prefix"
4358 fi
4359
4360 case ".$PKG_CONFIG" in
4361 (.\$\(*\)*|.\'*\'*)
4362         ;;
4363 (..|./*|.\\*)
4364         ;;
4365 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
4366         ;;
4367 (.\${*prefix}*|.\${*dir}*)
4368         eval PKG_CONFIG="$PKG_CONFIG"
4369         case ".$PKG_CONFIG" in
4370         (.NONE/*)
4371                 PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
4372                 ;;
4373         esac
4374         ;;
4375 (.no|.NONE/*)
4376         PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
4377         ;;
4378 (*)
4379         { { echo "$as_me:4379: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
4380 echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
4381    { (exit 1); exit 1; }; }
4382         ;;
4383 esac
4384
4385 elif test "x$cf_pkg_config" != xno ; then
4386         { echo "$as_me:4386: WARNING: pkg-config is not installed" >&5
4387 echo "$as_me: WARNING: pkg-config is not installed" >&2;}
4388 fi
4389
4390 echo "$as_me:4390: checking if you want to see long compiling messages" >&5
4391 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
4392
4393 # Check whether --enable-echo or --disable-echo was given.
4394 if test "${enable_echo+set}" = set; then
4395   enableval="$enable_echo"
4396   test "$enableval" != no && enableval=yes
4397         if test "$enableval" != "yes" ; then
4398
4399         ECHO_LT='--silent'
4400         ECHO_LD='@echo linking $@;'
4401         RULE_CC='@echo compiling $<'
4402         SHOW_CC='@echo compiling $@'
4403         ECHO_CC='@'
4404
4405         else
4406
4407         ECHO_LT=''
4408         ECHO_LD=''
4409         RULE_CC=''
4410         SHOW_CC=''
4411         ECHO_CC=''
4412
4413         fi
4414 else
4415   enableval=yes
4416
4417         ECHO_LT=''
4418         ECHO_LD=''
4419         RULE_CC=''
4420         SHOW_CC=''
4421         ECHO_CC=''
4422
4423 fi;
4424 echo "$as_me:4424: result: $enableval" >&5
4425 echo "${ECHO_T}$enableval" >&6
4426
4427 echo "$as_me:4427: checking for ncurses wrap-prefix" >&5
4428 echo $ECHO_N "checking for ncurses wrap-prefix... $ECHO_C" >&6
4429
4430 # Check whether --with-ncurses-wrap-prefix or --without-ncurses-wrap-prefix was given.
4431 if test "${with_ncurses_wrap_prefix+set}" = set; then
4432   withval="$with_ncurses_wrap_prefix"
4433   NCURSES_WRAP_PREFIX=$withval
4434 else
4435   NCURSES_WRAP_PREFIX=_nc_
4436 fi;
4437 echo "$as_me:4437: result: $NCURSES_WRAP_PREFIX" >&5
4438 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
4439
4440 echo "$as_me:4440: checking if you want to check for wide-character functions" >&5
4441 echo $ECHO_N "checking if you want to check for wide-character functions... $ECHO_C" >&6
4442
4443 # Check whether --enable-widec or --disable-widec was given.
4444 if test "${enable_widec+set}" = set; then
4445   enableval="$enable_widec"
4446   test "$enableval" != no && enableval=yes
4447         if test "$enableval" != "yes" ; then
4448     cf_enable_widec=no
4449         else
4450                 cf_enable_widec=yes
4451         fi
4452 else
4453   enableval=yes
4454         cf_enable_widec=yes
4455
4456 fi;
4457 echo "$as_me:4457: result: $cf_enable_widec" >&5
4458 echo "${ECHO_T}$cf_enable_widec" >&6
4459
4460 echo "$as_me:4460: checking for specific curses-directory" >&5
4461 echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
4462
4463 # Check whether --with-curses-dir or --without-curses-dir was given.
4464 if test "${with_curses_dir+set}" = set; then
4465   withval="$with_curses_dir"
4466   cf_cv_curses_dir=$withval
4467 else
4468   cf_cv_curses_dir=no
4469 fi;
4470 echo "$as_me:4470: result: $cf_cv_curses_dir" >&5
4471 echo "${ECHO_T}$cf_cv_curses_dir" >&6
4472
4473 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
4474 then
4475
4476 if test "x$prefix" != xNONE; then
4477         cf_path_syntax="$prefix"
4478 else
4479         cf_path_syntax="$ac_default_prefix"
4480 fi
4481
4482 case ".$withval" in
4483 (.\$\(*\)*|.\'*\'*)
4484         ;;
4485 (..|./*|.\\*)
4486         ;;
4487 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
4488         ;;
4489 (.\${*prefix}*|.\${*dir}*)
4490         eval withval="$withval"
4491         case ".$withval" in
4492         (.NONE/*)
4493                 withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
4494                 ;;
4495         esac
4496         ;;
4497 (.no|.NONE/*)
4498         withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
4499         ;;
4500 (*)
4501         { { echo "$as_me:4501: error: expected a pathname, not \"$withval\"" >&5
4502 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
4503    { (exit 1); exit 1; }; }
4504         ;;
4505 esac
4506
4507         if test -d "$cf_cv_curses_dir"
4508         then
4509
4510 if test -n "$cf_cv_curses_dir/include" ; then
4511   for cf_add_incdir in $cf_cv_curses_dir/include
4512   do
4513         while test $cf_add_incdir != /usr/include
4514         do
4515           if test -d $cf_add_incdir
4516           then
4517                 cf_have_incdir=no
4518                 if test -n "$CFLAGS$CPPFLAGS" ; then
4519                   # a loop is needed to ensure we can add subdirs of existing dirs
4520                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4521                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4522                           cf_have_incdir=yes; break
4523                         fi
4524                   done
4525                 fi
4526
4527                 if test "$cf_have_incdir" = no ; then
4528                   if test "$cf_add_incdir" = /usr/local/include ; then
4529                         if test "$GCC" = yes
4530                         then
4531                           cf_save_CPPFLAGS=$CPPFLAGS
4532                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4533                           cat >conftest.$ac_ext <<_ACEOF
4534 #line 4534 "configure"
4535 #include "confdefs.h"
4536 #include <stdio.h>
4537 int
4538 main ()
4539 {
4540 printf("Hello")
4541   ;
4542   return 0;
4543 }
4544 _ACEOF
4545 rm -f conftest.$ac_objext
4546 if { (eval echo "$as_me:4546: \"$ac_compile\"") >&5
4547   (eval $ac_compile) 2>&5
4548   ac_status=$?
4549   echo "$as_me:4549: \$? = $ac_status" >&5
4550   (exit $ac_status); } &&
4551          { ac_try='test -s conftest.$ac_objext'
4552   { (eval echo "$as_me:4552: \"$ac_try\"") >&5
4553   (eval $ac_try) 2>&5
4554   ac_status=$?
4555   echo "$as_me:4555: \$? = $ac_status" >&5
4556   (exit $ac_status); }; }; then
4557   :
4558 else
4559   echo "$as_me: failed program was:" >&5
4560 cat conftest.$ac_ext >&5
4561 cf_have_incdir=yes
4562 fi
4563 rm -f conftest.$ac_objext conftest.$ac_ext
4564                           CPPFLAGS=$cf_save_CPPFLAGS
4565                         fi
4566                   fi
4567                 fi
4568
4569                 if test "$cf_have_incdir" = no ; then
4570                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4571
4572 echo "${as_me:-configure}:4572: testing adding $cf_add_incdir to include-path ..." 1>&5
4573
4574                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4575
4576                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
4577                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4578                   cf_add_incdir="$cf_top_incdir"
4579                 else
4580                   break
4581                 fi
4582           else
4583                 break
4584           fi
4585         done
4586   done
4587 fi
4588
4589 if test -n "$cf_cv_curses_dir/lib" ; then
4590         for cf_add_libdir in $cf_cv_curses_dir/lib
4591         do
4592                 if test $cf_add_libdir = /usr/lib ; then
4593                         :
4594                 elif test -d $cf_add_libdir
4595                 then
4596                         cf_have_libdir=no
4597                         if test -n "$LDFLAGS$LIBS" ; then
4598                                 # a loop is needed to ensure we can add subdirs of existing dirs
4599                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
4600                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
4601                                                 cf_have_libdir=yes; break
4602                                         fi
4603                                 done
4604                         fi
4605                         if test "$cf_have_libdir" = no ; then
4606                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
4607
4608 echo "${as_me:-configure}:4608: testing adding $cf_add_libdir to library-path ..." 1>&5
4609
4610                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
4611                         fi
4612                 fi
4613         done
4614 fi
4615
4616         fi
4617 fi
4618
4619 cf_cv_screen=curses
4620
4621 echo "$as_me:4621: checking for specified curses library type" >&5
4622 echo $ECHO_N "checking for specified curses library type... $ECHO_C" >&6
4623
4624 # Check whether --with-screen or --without-screen was given.
4625 if test "${with_screen+set}" = set; then
4626   withval="$with_screen"
4627   cf_cv_screen=$withval
4628 else
4629
4630 # Check whether --with-ncursesw or --without-ncursesw was given.
4631 if test "${with_ncursesw+set}" = set; then
4632   withval="$with_ncursesw"
4633   cf_cv_screen=ncursesw
4634 else
4635
4636 # Check whether --with-ncurses or --without-ncurses was given.
4637 if test "${with_ncurses+set}" = set; then
4638   withval="$with_ncurses"
4639   cf_cv_screen=ncurses
4640 else
4641
4642 # Check whether --with-pdcurses or --without-pdcurses was given.
4643 if test "${with_pdcurses+set}" = set; then
4644   withval="$with_pdcurses"
4645   cf_cv_screen=pdcurses
4646 else
4647
4648 # Check whether --with-curses-colr or --without-curses-colr was given.
4649 if test "${with_curses_colr+set}" = set; then
4650   withval="$with_curses_colr"
4651   cf_cv_screen=curses_colr
4652 else
4653
4654 # Check whether --with-curses-5lib or --without-curses-5lib was given.
4655 if test "${with_curses_5lib+set}" = set; then
4656   withval="$with_curses_5lib"
4657   cf_cv_screen=curses_5lib
4658 fi;
4659 fi;
4660 fi;
4661 fi;
4662 fi;
4663 fi;
4664
4665 echo "$as_me:4665: result: $cf_cv_screen" >&5
4666 echo "${ECHO_T}$cf_cv_screen" >&6
4667
4668 case $cf_cv_screen in
4669 (curses|curses_*)
4670
4671 echo "$as_me:4671: checking for extra include directories" >&5
4672 echo $ECHO_N "checking for extra include directories... $ECHO_C" >&6
4673 if test "${cf_cv_curses_incdir+set}" = set; then
4674   echo $ECHO_N "(cached) $ECHO_C" >&6
4675 else
4676
4677 cf_cv_curses_incdir=no
4678 case $host_os in
4679 (hpux10.*)
4680         if test "x$cf_cv_screen" = "xcurses_colr"
4681         then
4682                 test -d /usr/include/curses_colr && \
4683                 cf_cv_curses_incdir="-I/usr/include/curses_colr"
4684         fi
4685         ;;
4686 (sunos3*|sunos4*)
4687         if test "x$cf_cv_screen" = "xcurses_5lib"
4688         then
4689                 test -d /usr/5lib && \
4690                 test -d /usr/5include && \
4691                 cf_cv_curses_incdir="-I/usr/5include"
4692         fi
4693         ;;
4694 esac
4695
4696 fi
4697 echo "$as_me:4697: result: $cf_cv_curses_incdir" >&5
4698 echo "${ECHO_T}$cf_cv_curses_incdir" >&6
4699 test "$cf_cv_curses_incdir" != no && CPPFLAGS="$CPPFLAGS $cf_cv_curses_incdir"
4700
4701 echo "$as_me:4701: checking if we have identified curses headers" >&5
4702 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
4703 if test "${cf_cv_ncurses_header+set}" = set; then
4704   echo $ECHO_N "(cached) $ECHO_C" >&6
4705 else
4706
4707 cf_cv_ncurses_header=none
4708 for cf_header in \
4709         ncurses.h  \
4710         curses.h  ncurses/ncurses.h ncurses/curses.h
4711 do
4712 cat >conftest.$ac_ext <<_ACEOF
4713 #line 4713 "configure"
4714 #include "confdefs.h"
4715 #include <${cf_header}>
4716 int
4717 main ()
4718 {
4719 initscr(); tgoto("?", 0,0)
4720   ;
4721   return 0;
4722 }
4723 _ACEOF
4724 rm -f conftest.$ac_objext
4725 if { (eval echo "$as_me:4725: \"$ac_compile\"") >&5
4726   (eval $ac_compile) 2>&5
4727   ac_status=$?
4728   echo "$as_me:4728: \$? = $ac_status" >&5
4729   (exit $ac_status); } &&
4730          { ac_try='test -s conftest.$ac_objext'
4731   { (eval echo "$as_me:4731: \"$ac_try\"") >&5
4732   (eval $ac_try) 2>&5
4733   ac_status=$?
4734   echo "$as_me:4734: \$? = $ac_status" >&5
4735   (exit $ac_status); }; }; then
4736   cf_cv_ncurses_header=$cf_header; break
4737 else
4738   echo "$as_me: failed program was:" >&5
4739 cat conftest.$ac_ext >&5
4740 fi
4741 rm -f conftest.$ac_objext conftest.$ac_ext
4742 done
4743
4744 fi
4745 echo "$as_me:4745: result: $cf_cv_ncurses_header" >&5
4746 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
4747
4748 if test "$cf_cv_ncurses_header" = none ; then
4749         { { echo "$as_me:4749: error: No curses header-files found" >&5
4750 echo "$as_me: error: No curses header-files found" >&2;}
4751    { (exit 1); exit 1; }; }
4752 fi
4753
4754 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
4755
4756 for ac_header in $cf_cv_ncurses_header
4757 do
4758 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
4759 echo "$as_me:4759: checking for $ac_header" >&5
4760 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
4761 if eval "test \"\${$as_ac_Header+set}\" = set"; then
4762   echo $ECHO_N "(cached) $ECHO_C" >&6
4763 else
4764   cat >conftest.$ac_ext <<_ACEOF
4765 #line 4765 "configure"
4766 #include "confdefs.h"
4767 #include <$ac_header>
4768 _ACEOF
4769 if { (eval echo "$as_me:4769: \"$ac_cpp conftest.$ac_ext\"") >&5
4770   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
4771   ac_status=$?
4772   egrep -v '^ *\+' conftest.er1 >conftest.err
4773   rm -f conftest.er1
4774   cat conftest.err >&5
4775   echo "$as_me:4775: \$? = $ac_status" >&5
4776   (exit $ac_status); } >/dev/null; then
4777   if test -s conftest.err; then
4778     ac_cpp_err=$ac_c_preproc_warn_flag
4779   else
4780     ac_cpp_err=
4781   fi
4782 else
4783   ac_cpp_err=yes
4784 fi
4785 if test -z "$ac_cpp_err"; then
4786   eval "$as_ac_Header=yes"
4787 else
4788   echo "$as_me: failed program was:" >&5
4789   cat conftest.$ac_ext >&5
4790   eval "$as_ac_Header=no"
4791 fi
4792 rm -f conftest.err conftest.$ac_ext
4793 fi
4794 echo "$as_me:4794: result: `eval echo '${'$as_ac_Header'}'`" >&5
4795 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
4796 if test `eval echo '${'$as_ac_Header'}'` = yes; then
4797   cat >>confdefs.h <<EOF
4798 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
4799 EOF
4800
4801 fi
4802 done
4803
4804 echo "$as_me:4804: checking for terminfo header" >&5
4805 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
4806 if test "${cf_cv_term_header+set}" = set; then
4807   echo $ECHO_N "(cached) $ECHO_C" >&6
4808 else
4809
4810 case ${cf_cv_ncurses_header} in
4811 (*/ncurses.h|*/ncursesw.h)
4812         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
4813         ;;
4814 (*)
4815         cf_term_header=term.h
4816         ;;
4817 esac
4818
4819 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
4820 do
4821 cat >conftest.$ac_ext <<_ACEOF
4822 #line 4822 "configure"
4823 #include "confdefs.h"
4824 #include <stdio.h>
4825 #include <${cf_cv_ncurses_header:-curses.h}>
4826 #include <$cf_test>
4827
4828 int
4829 main ()
4830 {
4831 int x = auto_left_margin
4832   ;
4833   return 0;
4834 }
4835 _ACEOF
4836 rm -f conftest.$ac_objext
4837 if { (eval echo "$as_me:4837: \"$ac_compile\"") >&5
4838   (eval $ac_compile) 2>&5
4839   ac_status=$?
4840   echo "$as_me:4840: \$? = $ac_status" >&5
4841   (exit $ac_status); } &&
4842          { ac_try='test -s conftest.$ac_objext'
4843   { (eval echo "$as_me:4843: \"$ac_try\"") >&5
4844   (eval $ac_try) 2>&5
4845   ac_status=$?
4846   echo "$as_me:4846: \$? = $ac_status" >&5
4847   (exit $ac_status); }; }; then
4848
4849         cf_cv_term_header="$cf_test"
4850 else
4851   echo "$as_me: failed program was:" >&5
4852 cat conftest.$ac_ext >&5
4853
4854         cf_cv_term_header=unknown
4855
4856 fi
4857 rm -f conftest.$ac_objext conftest.$ac_ext
4858         test "$cf_cv_term_header" != unknown && break
4859 done
4860
4861 fi
4862 echo "$as_me:4862: result: $cf_cv_term_header" >&5
4863 echo "${ECHO_T}$cf_cv_term_header" >&6
4864
4865 # Set definitions to allow ifdef'ing to accommodate subdirectories
4866
4867 case $cf_cv_term_header in
4868 (*term.h)
4869
4870 cat >>confdefs.h <<\EOF
4871 #define HAVE_TERM_H 1
4872 EOF
4873
4874         ;;
4875 esac
4876
4877 case $cf_cv_term_header in
4878 (ncurses/term.h)
4879
4880 cat >>confdefs.h <<\EOF
4881 #define HAVE_NCURSES_TERM_H 1
4882 EOF
4883
4884         ;;
4885 (ncursesw/term.h)
4886
4887 cat >>confdefs.h <<\EOF
4888 #define HAVE_NCURSESW_TERM_H 1
4889 EOF
4890
4891         ;;
4892 esac
4893
4894 echo "$as_me:4894: checking for ncurses version" >&5
4895 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
4896 if test "${cf_cv_ncurses_version+set}" = set; then
4897   echo $ECHO_N "(cached) $ECHO_C" >&6
4898 else
4899
4900         cf_cv_ncurses_version=no
4901         cf_tempfile=out$$
4902         rm -f $cf_tempfile
4903         if test "$cross_compiling" = yes; then
4904
4905         # This will not work if the preprocessor splits the line after the
4906         # Autoconf token.  The 'unproto' program does that.
4907         cat > conftest.$ac_ext <<EOF
4908 #include <${cf_cv_ncurses_header:-curses.h}>
4909 #undef Autoconf
4910 #ifdef NCURSES_VERSION
4911 Autoconf NCURSES_VERSION
4912 #else
4913 #ifdef __NCURSES_H
4914 Autoconf "old"
4915 #endif
4916 ;
4917 #endif
4918 EOF
4919         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
4920         { (eval echo "$as_me:4920: \"$cf_try\"") >&5
4921   (eval $cf_try) 2>&5
4922   ac_status=$?
4923   echo "$as_me:4923: \$? = $ac_status" >&5
4924   (exit $ac_status); }
4925         if test -f conftest.out ; then
4926                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
4927                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
4928                 rm -f conftest.out
4929         fi
4930
4931 else
4932   cat >conftest.$ac_ext <<_ACEOF
4933 #line 4933 "configure"
4934 #include "confdefs.h"
4935
4936 #include <${cf_cv_ncurses_header:-curses.h}>
4937 #include <stdio.h>
4938 int main()
4939 {
4940         FILE *fp = fopen("$cf_tempfile", "w");
4941 #ifdef NCURSES_VERSION
4942 # ifdef NCURSES_VERSION_PATCH
4943         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
4944 # else
4945         fprintf(fp, "%s\n", NCURSES_VERSION);
4946 # endif
4947 #else
4948 # ifdef __NCURSES_H
4949         fprintf(fp, "old\n");
4950 # else
4951         make an error
4952 # endif
4953 #endif
4954         ${cf_cv_main_return:-return}(0);
4955 }
4956 _ACEOF
4957 rm -f conftest$ac_exeext
4958 if { (eval echo "$as_me:4958: \"$ac_link\"") >&5
4959   (eval $ac_link) 2>&5
4960   ac_status=$?
4961   echo "$as_me:4961: \$? = $ac_status" >&5
4962   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
4963   { (eval echo "$as_me:4963: \"$ac_try\"") >&5
4964   (eval $ac_try) 2>&5
4965   ac_status=$?
4966   echo "$as_me:4966: \$? = $ac_status" >&5
4967   (exit $ac_status); }; }; then
4968
4969         cf_cv_ncurses_version=`cat $cf_tempfile`
4970 else
4971   echo "$as_me: program exited with status $ac_status" >&5
4972 echo "$as_me: failed program was:" >&5
4973 cat conftest.$ac_ext >&5
4974 fi
4975 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
4976 fi
4977         rm -f $cf_tempfile
4978
4979 fi
4980 echo "$as_me:4980: result: $cf_cv_ncurses_version" >&5
4981 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
4982 test "$cf_cv_ncurses_version" = no ||
4983 cat >>confdefs.h <<\EOF
4984 #define NCURSES 1
4985 EOF
4986
4987 echo "$as_me:4987: checking if we have identified curses libraries" >&5
4988 echo $ECHO_N "checking if we have identified curses libraries... $ECHO_C" >&6
4989 cat >conftest.$ac_ext <<_ACEOF
4990 #line 4990 "configure"
4991 #include "confdefs.h"
4992 #include <${cf_cv_ncurses_header:-curses.h}>
4993 int
4994 main ()
4995 {
4996 initscr(); tgoto("?", 0,0)
4997   ;
4998   return 0;
4999 }
5000 _ACEOF
5001 rm -f conftest.$ac_objext conftest$ac_exeext
5002 if { (eval echo "$as_me:5002: \"$ac_link\"") >&5
5003   (eval $ac_link) 2>&5
5004   ac_status=$?
5005   echo "$as_me:5005: \$? = $ac_status" >&5
5006   (exit $ac_status); } &&
5007          { ac_try='test -s conftest$ac_exeext'
5008   { (eval echo "$as_me:5008: \"$ac_try\"") >&5
5009   (eval $ac_try) 2>&5
5010   ac_status=$?
5011   echo "$as_me:5011: \$? = $ac_status" >&5
5012   (exit $ac_status); }; }; then
5013   cf_result=yes
5014 else
5015   echo "$as_me: failed program was:" >&5
5016 cat conftest.$ac_ext >&5
5017 cf_result=no
5018 fi
5019 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5020 echo "$as_me:5020: result: $cf_result" >&5
5021 echo "${ECHO_T}$cf_result" >&6
5022
5023 if test "$cf_result" = no ; then
5024 case $host_os in
5025 (freebsd*)
5026         echo "$as_me:5026: checking for tgoto in -lmytinfo" >&5
5027 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
5028 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
5029   echo $ECHO_N "(cached) $ECHO_C" >&6
5030 else
5031   ac_check_lib_save_LIBS=$LIBS
5032 LIBS="-lmytinfo  $LIBS"
5033 cat >conftest.$ac_ext <<_ACEOF
5034 #line 5034 "configure"
5035 #include "confdefs.h"
5036
5037 /* Override any gcc2 internal prototype to avoid an error.  */
5038 #ifdef __cplusplus
5039 extern "C"
5040 #endif
5041 /* We use char because int might match the return type of a gcc2
5042    builtin and then its argument prototype would still apply.  */
5043 char tgoto ();
5044 int
5045 main ()
5046 {
5047 tgoto ();
5048   ;
5049   return 0;
5050 }
5051 _ACEOF
5052 rm -f conftest.$ac_objext conftest$ac_exeext
5053 if { (eval echo "$as_me:5053: \"$ac_link\"") >&5
5054   (eval $ac_link) 2>&5
5055   ac_status=$?
5056   echo "$as_me:5056: \$? = $ac_status" >&5
5057   (exit $ac_status); } &&
5058          { ac_try='test -s conftest$ac_exeext'
5059   { (eval echo "$as_me:5059: \"$ac_try\"") >&5
5060   (eval $ac_try) 2>&5
5061   ac_status=$?
5062   echo "$as_me:5062: \$? = $ac_status" >&5
5063   (exit $ac_status); }; }; then
5064   ac_cv_lib_mytinfo_tgoto=yes
5065 else
5066   echo "$as_me: failed program was:" >&5
5067 cat conftest.$ac_ext >&5
5068 ac_cv_lib_mytinfo_tgoto=no
5069 fi
5070 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5071 LIBS=$ac_check_lib_save_LIBS
5072 fi
5073 echo "$as_me:5073: result: $ac_cv_lib_mytinfo_tgoto" >&5
5074 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
5075 if test $ac_cv_lib_mytinfo_tgoto = yes; then
5076
5077 cf_add_libs="-lmytinfo"
5078 # Filter out duplicates - this happens with badly-designed ".pc" files...
5079 for cf_add_1lib in $LIBS
5080 do
5081         for cf_add_2lib in $cf_add_libs
5082         do
5083                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5084                 then
5085                         cf_add_1lib=
5086                         break
5087                 fi
5088         done
5089         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5090 done
5091 LIBS="$cf_add_libs"
5092
5093 fi
5094
5095         ;;
5096 (hpux10.*)
5097         # Looking at HPUX 10.20, the Hcurses library is the oldest (1997), cur_colr
5098         # next (1998), and xcurses "newer" (2000).  There is no header file for
5099         # Hcurses; the subdirectory curses_colr has the headers (curses.h and
5100         # term.h) for cur_colr
5101         if test "x$cf_cv_screen" = "xcurses_colr"
5102         then
5103                 echo "$as_me:5103: checking for initscr in -lcur_colr" >&5
5104 echo $ECHO_N "checking for initscr in -lcur_colr... $ECHO_C" >&6
5105 if test "${ac_cv_lib_cur_colr_initscr+set}" = set; then
5106   echo $ECHO_N "(cached) $ECHO_C" >&6
5107 else
5108   ac_check_lib_save_LIBS=$LIBS
5109 LIBS="-lcur_colr  $LIBS"
5110 cat >conftest.$ac_ext <<_ACEOF
5111 #line 5111 "configure"
5112 #include "confdefs.h"
5113
5114 /* Override any gcc2 internal prototype to avoid an error.  */
5115 #ifdef __cplusplus
5116 extern "C"
5117 #endif
5118 /* We use char because int might match the return type of a gcc2
5119    builtin and then its argument prototype would still apply.  */
5120 char initscr ();
5121 int
5122 main ()
5123 {
5124 initscr ();
5125   ;
5126   return 0;
5127 }
5128 _ACEOF
5129 rm -f conftest.$ac_objext conftest$ac_exeext
5130 if { (eval echo "$as_me:5130: \"$ac_link\"") >&5
5131   (eval $ac_link) 2>&5
5132   ac_status=$?
5133   echo "$as_me:5133: \$? = $ac_status" >&5
5134   (exit $ac_status); } &&
5135          { ac_try='test -s conftest$ac_exeext'
5136   { (eval echo "$as_me:5136: \"$ac_try\"") >&5
5137   (eval $ac_try) 2>&5
5138   ac_status=$?
5139   echo "$as_me:5139: \$? = $ac_status" >&5
5140   (exit $ac_status); }; }; then
5141   ac_cv_lib_cur_colr_initscr=yes
5142 else
5143   echo "$as_me: failed program was:" >&5
5144 cat conftest.$ac_ext >&5
5145 ac_cv_lib_cur_colr_initscr=no
5146 fi
5147 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5148 LIBS=$ac_check_lib_save_LIBS
5149 fi
5150 echo "$as_me:5150: result: $ac_cv_lib_cur_colr_initscr" >&5
5151 echo "${ECHO_T}$ac_cv_lib_cur_colr_initscr" >&6
5152 if test $ac_cv_lib_cur_colr_initscr = yes; then
5153
5154 cf_add_libs="-lcur_colr"
5155 # Filter out duplicates - this happens with badly-designed ".pc" files...
5156 for cf_add_1lib in $LIBS
5157 do
5158         for cf_add_2lib in $cf_add_libs
5159         do
5160                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5161                 then
5162                         cf_add_1lib=
5163                         break
5164                 fi
5165         done
5166         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5167 done
5168 LIBS="$cf_add_libs"
5169
5170                         ac_cv_func_initscr=yes
5171
5172 else
5173
5174                 echo "$as_me:5174: checking for initscr in -lHcurses" >&5
5175 echo $ECHO_N "checking for initscr in -lHcurses... $ECHO_C" >&6
5176 if test "${ac_cv_lib_Hcurses_initscr+set}" = set; then
5177   echo $ECHO_N "(cached) $ECHO_C" >&6
5178 else
5179   ac_check_lib_save_LIBS=$LIBS
5180 LIBS="-lHcurses  $LIBS"
5181 cat >conftest.$ac_ext <<_ACEOF
5182 #line 5182 "configure"
5183 #include "confdefs.h"
5184
5185 /* Override any gcc2 internal prototype to avoid an error.  */
5186 #ifdef __cplusplus
5187 extern "C"
5188 #endif
5189 /* We use char because int might match the return type of a gcc2
5190    builtin and then its argument prototype would still apply.  */
5191 char initscr ();
5192 int
5193 main ()
5194 {
5195 initscr ();
5196   ;
5197   return 0;
5198 }
5199 _ACEOF
5200 rm -f conftest.$ac_objext conftest$ac_exeext
5201 if { (eval echo "$as_me:5201: \"$ac_link\"") >&5
5202   (eval $ac_link) 2>&5
5203   ac_status=$?
5204   echo "$as_me:5204: \$? = $ac_status" >&5
5205   (exit $ac_status); } &&
5206          { ac_try='test -s conftest$ac_exeext'
5207   { (eval echo "$as_me:5207: \"$ac_try\"") >&5
5208   (eval $ac_try) 2>&5
5209   ac_status=$?
5210   echo "$as_me:5210: \$? = $ac_status" >&5
5211   (exit $ac_status); }; }; then
5212   ac_cv_lib_Hcurses_initscr=yes
5213 else
5214   echo "$as_me: failed program was:" >&5
5215 cat conftest.$ac_ext >&5
5216 ac_cv_lib_Hcurses_initscr=no
5217 fi
5218 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5219 LIBS=$ac_check_lib_save_LIBS
5220 fi
5221 echo "$as_me:5221: result: $ac_cv_lib_Hcurses_initscr" >&5
5222 echo "${ECHO_T}$ac_cv_lib_Hcurses_initscr" >&6
5223 if test $ac_cv_lib_Hcurses_initscr = yes; then
5224
5225                         # HP's header uses __HP_CURSES, but user claims _HP_CURSES.
5226
5227 cf_add_libs="-lHcurses"
5228 # Filter out duplicates - this happens with badly-designed ".pc" files...
5229 for cf_add_1lib in $LIBS
5230 do
5231         for cf_add_2lib in $cf_add_libs
5232         do
5233                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5234                 then
5235                         cf_add_1lib=
5236                         break
5237                 fi
5238         done
5239         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5240 done
5241 LIBS="$cf_add_libs"
5242
5243                         CPPFLAGS="$CPPFLAGS -D__HP_CURSES -D_HP_CURSES"
5244                         ac_cv_func_initscr=yes
5245
5246 fi
5247
5248 fi
5249
5250         fi
5251         ;;
5252 (linux*)
5253         case `arch 2>/dev/null` in
5254         (x86_64)
5255                 if test -d /lib64
5256                 then
5257
5258 if test -n "/lib64" ; then
5259         for cf_add_libdir in /lib64
5260         do
5261                 if test $cf_add_libdir = /usr/lib ; then
5262                         :
5263                 elif test -d $cf_add_libdir
5264                 then
5265                         cf_have_libdir=no
5266                         if test -n "$LDFLAGS$LIBS" ; then
5267                                 # a loop is needed to ensure we can add subdirs of existing dirs
5268                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
5269                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5270                                                 cf_have_libdir=yes; break
5271                                         fi
5272                                 done
5273                         fi
5274                         if test "$cf_have_libdir" = no ; then
5275                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5276
5277 echo "${as_me:-configure}:5277: testing adding $cf_add_libdir to library-path ..." 1>&5
5278
5279                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5280                         fi
5281                 fi
5282         done
5283 fi
5284
5285                 else
5286
5287 if test -n "/lib" ; then
5288         for cf_add_libdir in /lib
5289         do
5290                 if test $cf_add_libdir = /usr/lib ; then
5291                         :
5292                 elif test -d $cf_add_libdir
5293                 then
5294                         cf_have_libdir=no
5295                         if test -n "$LDFLAGS$LIBS" ; then
5296                                 # a loop is needed to ensure we can add subdirs of existing dirs
5297                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
5298                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5299                                                 cf_have_libdir=yes; break
5300                                         fi
5301                                 done
5302                         fi
5303                         if test "$cf_have_libdir" = no ; then
5304                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5305
5306 echo "${as_me:-configure}:5306: testing adding $cf_add_libdir to library-path ..." 1>&5
5307
5308                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5309                         fi
5310                 fi
5311         done
5312 fi
5313
5314                 fi
5315                 ;;
5316         (*)
5317
5318 if test -n "/lib" ; then
5319         for cf_add_libdir in /lib
5320         do
5321                 if test $cf_add_libdir = /usr/lib ; then
5322                         :
5323                 elif test -d $cf_add_libdir
5324                 then
5325                         cf_have_libdir=no
5326                         if test -n "$LDFLAGS$LIBS" ; then
5327                                 # a loop is needed to ensure we can add subdirs of existing dirs
5328                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
5329                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5330                                                 cf_have_libdir=yes; break
5331                                         fi
5332                                 done
5333                         fi
5334                         if test "$cf_have_libdir" = no ; then
5335                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5336
5337 echo "${as_me:-configure}:5337: testing adding $cf_add_libdir to library-path ..." 1>&5
5338
5339                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5340                         fi
5341                 fi
5342         done
5343 fi
5344
5345                 ;;
5346         esac
5347         ;;
5348 (sunos3*|sunos4*)
5349         if test "x$cf_cv_screen" = "xcurses_5lib"
5350         then
5351                 if test -d /usr/5lib ; then
5352
5353 if test -n "/usr/5lib" ; then
5354         for cf_add_libdir in /usr/5lib
5355         do
5356                 if test $cf_add_libdir = /usr/lib ; then
5357                         :
5358                 elif test -d $cf_add_libdir
5359                 then
5360                         cf_have_libdir=no
5361                         if test -n "$LDFLAGS$LIBS" ; then
5362                                 # a loop is needed to ensure we can add subdirs of existing dirs
5363                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
5364                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5365                                                 cf_have_libdir=yes; break
5366                                         fi
5367                                 done
5368                         fi
5369                         if test "$cf_have_libdir" = no ; then
5370                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5371
5372 echo "${as_me:-configure}:5372: testing adding $cf_add_libdir to library-path ..." 1>&5
5373
5374                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5375                         fi
5376                 fi
5377         done
5378 fi
5379
5380 cf_add_libs="-lcurses -ltermcap"
5381 # Filter out duplicates - this happens with badly-designed ".pc" files...
5382 for cf_add_1lib in $LIBS
5383 do
5384         for cf_add_2lib in $cf_add_libs
5385         do
5386                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5387                 then
5388                         cf_add_1lib=
5389                         break
5390                 fi
5391         done
5392         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5393 done
5394 LIBS="$cf_add_libs"
5395
5396                 fi
5397         fi
5398         ac_cv_func_initscr=yes
5399         ;;
5400 esac
5401
5402 if test ".$ac_cv_func_initscr" != .yes ; then
5403         cf_save_LIBS="$LIBS"
5404
5405         if test ".${cf_cv_ncurses_version:-no}" != .no
5406         then
5407                 cf_check_list="ncurses curses cursesX"
5408         else
5409                 cf_check_list="cursesX curses ncurses"
5410         fi
5411
5412         # Check for library containing tgoto.  Do this before curses library
5413         # because it may be needed to link the test-case for initscr.
5414         if test "x$cf_term_lib" = x
5415         then
5416                 echo "$as_me:5416: checking for tgoto" >&5
5417 echo $ECHO_N "checking for tgoto... $ECHO_C" >&6
5418 if test "${ac_cv_func_tgoto+set}" = set; then
5419   echo $ECHO_N "(cached) $ECHO_C" >&6
5420 else
5421   cat >conftest.$ac_ext <<_ACEOF
5422 #line 5422 "configure"
5423 #include "confdefs.h"
5424 /* System header to define __stub macros and hopefully few prototypes,
5425     which can conflict with char tgoto (); below.  */
5426 #include <assert.h>
5427 /* Override any gcc2 internal prototype to avoid an error.  */
5428 #ifdef __cplusplus
5429 extern "C"
5430 #endif
5431 /* We use char because int might match the return type of a gcc2
5432    builtin and then its argument prototype would still apply.  */
5433 char tgoto ();
5434 char (*f) ();
5435
5436 int
5437 main ()
5438 {
5439 /* The GNU C library defines this for functions which it implements
5440     to always fail with ENOSYS.  Some functions are actually named
5441     something starting with __ and the normal name is an alias.  */
5442 #if defined (__stub_tgoto) || defined (__stub___tgoto)
5443 choke me
5444 #else
5445 f = tgoto; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
5446 #endif
5447
5448   ;
5449   return 0;
5450 }
5451 _ACEOF
5452 rm -f conftest.$ac_objext conftest$ac_exeext
5453 if { (eval echo "$as_me:5453: \"$ac_link\"") >&5
5454   (eval $ac_link) 2>&5
5455   ac_status=$?
5456   echo "$as_me:5456: \$? = $ac_status" >&5
5457   (exit $ac_status); } &&
5458          { ac_try='test -s conftest$ac_exeext'
5459   { (eval echo "$as_me:5459: \"$ac_try\"") >&5
5460   (eval $ac_try) 2>&5
5461   ac_status=$?
5462   echo "$as_me:5462: \$? = $ac_status" >&5
5463   (exit $ac_status); }; }; then
5464   ac_cv_func_tgoto=yes
5465 else
5466   echo "$as_me: failed program was:" >&5
5467 cat conftest.$ac_ext >&5
5468 ac_cv_func_tgoto=no
5469 fi
5470 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5471 fi
5472 echo "$as_me:5472: result: $ac_cv_func_tgoto" >&5
5473 echo "${ECHO_T}$ac_cv_func_tgoto" >&6
5474 if test $ac_cv_func_tgoto = yes; then
5475   cf_term_lib=predefined
5476 else
5477
5478                         for cf_term_lib in $cf_check_list otermcap termcap tinfo termlib unknown
5479                         do
5480                                 as_ac_Lib=`echo "ac_cv_lib_$cf_term_lib''_tgoto" | $as_tr_sh`
5481 echo "$as_me:5481: checking for tgoto in -l$cf_term_lib" >&5
5482 echo $ECHO_N "checking for tgoto in -l$cf_term_lib... $ECHO_C" >&6
5483 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
5484   echo $ECHO_N "(cached) $ECHO_C" >&6
5485 else
5486   ac_check_lib_save_LIBS=$LIBS
5487 LIBS="-l$cf_term_lib  $LIBS"
5488 cat >conftest.$ac_ext <<_ACEOF
5489 #line 5489 "configure"
5490 #include "confdefs.h"
5491
5492 /* Override any gcc2 internal prototype to avoid an error.  */
5493 #ifdef __cplusplus
5494 extern "C"
5495 #endif
5496 /* We use char because int might match the return type of a gcc2
5497    builtin and then its argument prototype would still apply.  */
5498 char tgoto ();
5499 int
5500 main ()
5501 {
5502 tgoto ();
5503   ;
5504   return 0;
5505 }
5506 _ACEOF
5507 rm -f conftest.$ac_objext conftest$ac_exeext
5508 if { (eval echo "$as_me:5508: \"$ac_link\"") >&5
5509   (eval $ac_link) 2>&5
5510   ac_status=$?
5511   echo "$as_me:5511: \$? = $ac_status" >&5
5512   (exit $ac_status); } &&
5513          { ac_try='test -s conftest$ac_exeext'
5514   { (eval echo "$as_me:5514: \"$ac_try\"") >&5
5515   (eval $ac_try) 2>&5
5516   ac_status=$?
5517   echo "$as_me:5517: \$? = $ac_status" >&5
5518   (exit $ac_status); }; }; then
5519   eval "$as_ac_Lib=yes"
5520 else
5521   echo "$as_me: failed program was:" >&5
5522 cat conftest.$ac_ext >&5
5523 eval "$as_ac_Lib=no"
5524 fi
5525 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5526 LIBS=$ac_check_lib_save_LIBS
5527 fi
5528 echo "$as_me:5528: result: `eval echo '${'$as_ac_Lib'}'`" >&5
5529 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
5530 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
5531   break
5532 fi
5533
5534                         done
5535
5536 fi
5537
5538         fi
5539
5540         # Check for library containing initscr
5541         test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS"
5542         if test "x$cf_curs_lib" = x
5543         then
5544                 for cf_curs_lib in $cf_check_list xcurses jcurses pdcurses unknown
5545                 do
5546                         as_ac_Lib=`echo "ac_cv_lib_$cf_curs_lib''_initscr" | $as_tr_sh`
5547 echo "$as_me:5547: checking for initscr in -l$cf_curs_lib" >&5
5548 echo $ECHO_N "checking for initscr in -l$cf_curs_lib... $ECHO_C" >&6
5549 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
5550   echo $ECHO_N "(cached) $ECHO_C" >&6
5551 else
5552   ac_check_lib_save_LIBS=$LIBS
5553 LIBS="-l$cf_curs_lib  $LIBS"
5554 cat >conftest.$ac_ext <<_ACEOF
5555 #line 5555 "configure"
5556 #include "confdefs.h"
5557
5558 /* Override any gcc2 internal prototype to avoid an error.  */
5559 #ifdef __cplusplus
5560 extern "C"
5561 #endif
5562 /* We use char because int might match the return type of a gcc2
5563    builtin and then its argument prototype would still apply.  */
5564 char initscr ();
5565 int
5566 main ()
5567 {
5568 initscr ();
5569   ;
5570   return 0;
5571 }
5572 _ACEOF
5573 rm -f conftest.$ac_objext conftest$ac_exeext
5574 if { (eval echo "$as_me:5574: \"$ac_link\"") >&5
5575   (eval $ac_link) 2>&5
5576   ac_status=$?
5577   echo "$as_me:5577: \$? = $ac_status" >&5
5578   (exit $ac_status); } &&
5579          { ac_try='test -s conftest$ac_exeext'
5580   { (eval echo "$as_me:5580: \"$ac_try\"") >&5
5581   (eval $ac_try) 2>&5
5582   ac_status=$?
5583   echo "$as_me:5583: \$? = $ac_status" >&5
5584   (exit $ac_status); }; }; then
5585   eval "$as_ac_Lib=yes"
5586 else
5587   echo "$as_me: failed program was:" >&5
5588 cat conftest.$ac_ext >&5
5589 eval "$as_ac_Lib=no"
5590 fi
5591 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5592 LIBS=$ac_check_lib_save_LIBS
5593 fi
5594 echo "$as_me:5594: result: `eval echo '${'$as_ac_Lib'}'`" >&5
5595 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
5596 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
5597   break
5598 fi
5599
5600                 done
5601         fi
5602         test $cf_curs_lib = unknown && { { echo "$as_me:5602: error: no curses library found" >&5
5603 echo "$as_me: error: no curses library found" >&2;}
5604    { (exit 1); exit 1; }; }
5605
5606         LIBS="-l$cf_curs_lib $cf_save_LIBS"
5607         if test "$cf_term_lib" = unknown ; then
5608                 echo "$as_me:5608: checking if we can link with $cf_curs_lib library" >&5
5609 echo $ECHO_N "checking if we can link with $cf_curs_lib library... $ECHO_C" >&6
5610                 cat >conftest.$ac_ext <<_ACEOF
5611 #line 5611 "configure"
5612 #include "confdefs.h"
5613 #include <${cf_cv_ncurses_header:-curses.h}>
5614 int
5615 main ()
5616 {
5617 initscr()
5618   ;
5619   return 0;
5620 }
5621 _ACEOF
5622 rm -f conftest.$ac_objext conftest$ac_exeext
5623 if { (eval echo "$as_me:5623: \"$ac_link\"") >&5
5624   (eval $ac_link) 2>&5
5625   ac_status=$?
5626   echo "$as_me:5626: \$? = $ac_status" >&5
5627   (exit $ac_status); } &&
5628          { ac_try='test -s conftest$ac_exeext'
5629   { (eval echo "$as_me:5629: \"$ac_try\"") >&5
5630   (eval $ac_try) 2>&5
5631   ac_status=$?
5632   echo "$as_me:5632: \$? = $ac_status" >&5
5633   (exit $ac_status); }; }; then
5634   cf_result=yes
5635 else
5636   echo "$as_me: failed program was:" >&5
5637 cat conftest.$ac_ext >&5
5638 cf_result=no
5639 fi
5640 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5641                 echo "$as_me:5641: result: $cf_result" >&5
5642 echo "${ECHO_T}$cf_result" >&6
5643                 test $cf_result = no && { { echo "$as_me:5643: error: Cannot link curses library" >&5
5644 echo "$as_me: error: Cannot link curses library" >&2;}
5645    { (exit 1); exit 1; }; }
5646         elif test "$cf_curs_lib" = "$cf_term_lib" ; then
5647                 :
5648         elif test "$cf_term_lib" != predefined ; then
5649                 echo "$as_me:5649: checking if we need both $cf_curs_lib and $cf_term_lib libraries" >&5
5650 echo $ECHO_N "checking if we need both $cf_curs_lib and $cf_term_lib libraries... $ECHO_C" >&6
5651                 cat >conftest.$ac_ext <<_ACEOF
5652 #line 5652 "configure"
5653 #include "confdefs.h"
5654 #include <${cf_cv_ncurses_header:-curses.h}>
5655 int
5656 main ()
5657 {
5658 initscr(); tgoto((char *)0, 0, 0);
5659   ;
5660   return 0;
5661 }
5662 _ACEOF
5663 rm -f conftest.$ac_objext conftest$ac_exeext
5664 if { (eval echo "$as_me:5664: \"$ac_link\"") >&5
5665   (eval $ac_link) 2>&5
5666   ac_status=$?
5667   echo "$as_me:5667: \$? = $ac_status" >&5
5668   (exit $ac_status); } &&
5669          { ac_try='test -s conftest$ac_exeext'
5670   { (eval echo "$as_me:5670: \"$ac_try\"") >&5
5671   (eval $ac_try) 2>&5
5672   ac_status=$?
5673   echo "$as_me:5673: \$? = $ac_status" >&5
5674   (exit $ac_status); }; }; then
5675   cf_result=no
5676 else
5677   echo "$as_me: failed program was:" >&5
5678 cat conftest.$ac_ext >&5
5679
5680                         LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
5681                         cat >conftest.$ac_ext <<_ACEOF
5682 #line 5682 "configure"
5683 #include "confdefs.h"
5684 #include <${cf_cv_ncurses_header:-curses.h}>
5685 int
5686 main ()
5687 {
5688 initscr()
5689   ;
5690   return 0;
5691 }
5692 _ACEOF
5693 rm -f conftest.$ac_objext conftest$ac_exeext
5694 if { (eval echo "$as_me:5694: \"$ac_link\"") >&5
5695   (eval $ac_link) 2>&5
5696   ac_status=$?
5697   echo "$as_me:5697: \$? = $ac_status" >&5
5698   (exit $ac_status); } &&
5699          { ac_try='test -s conftest$ac_exeext'
5700   { (eval echo "$as_me:5700: \"$ac_try\"") >&5
5701   (eval $ac_try) 2>&5
5702   ac_status=$?
5703   echo "$as_me:5703: \$? = $ac_status" >&5
5704   (exit $ac_status); }; }; then
5705   cf_result=yes
5706 else
5707   echo "$as_me: failed program was:" >&5
5708 cat conftest.$ac_ext >&5
5709 cf_result=error
5710 fi
5711 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5712
5713 fi
5714 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5715                 echo "$as_me:5715: result: $cf_result" >&5
5716 echo "${ECHO_T}$cf_result" >&6
5717         fi
5718 fi
5719 fi
5720
5721         ;;
5722 (ncursesw*)
5723
5724 echo "$as_me:5724: checking for multibyte character support" >&5
5725 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
5726 if test "${cf_cv_utf8_lib+set}" = set; then
5727   echo $ECHO_N "(cached) $ECHO_C" >&6
5728 else
5729
5730         cf_save_LIBS="$LIBS"
5731         cat >conftest.$ac_ext <<_ACEOF
5732 #line 5732 "configure"
5733 #include "confdefs.h"
5734
5735 #include <stdlib.h>
5736 int
5737 main ()
5738 {
5739 putwc(0,0);
5740   ;
5741   return 0;
5742 }
5743 _ACEOF
5744 rm -f conftest.$ac_objext conftest$ac_exeext
5745 if { (eval echo "$as_me:5745: \"$ac_link\"") >&5
5746   (eval $ac_link) 2>&5
5747   ac_status=$?
5748   echo "$as_me:5748: \$? = $ac_status" >&5
5749   (exit $ac_status); } &&
5750          { ac_try='test -s conftest$ac_exeext'
5751   { (eval echo "$as_me:5751: \"$ac_try\"") >&5
5752   (eval $ac_try) 2>&5
5753   ac_status=$?
5754   echo "$as_me:5754: \$? = $ac_status" >&5
5755   (exit $ac_status); }; }; then
5756   cf_cv_utf8_lib=yes
5757 else
5758   echo "$as_me: failed program was:" >&5
5759 cat conftest.$ac_ext >&5
5760
5761 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
5762 # will be set on completion of the AC_TRY_LINK below.
5763 cf_cv_header_path_utf8=
5764 cf_cv_library_path_utf8=
5765
5766 echo "${as_me:-configure}:5766: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
5767
5768 cf_save_LIBS="$LIBS"
5769
5770 cat >conftest.$ac_ext <<_ACEOF
5771 #line 5771 "configure"
5772 #include "confdefs.h"
5773
5774 #include <libutf8.h>
5775 int
5776 main ()
5777 {
5778 putwc(0,0);
5779   ;
5780   return 0;
5781 }
5782 _ACEOF
5783 rm -f conftest.$ac_objext conftest$ac_exeext
5784 if { (eval echo "$as_me:5784: \"$ac_link\"") >&5
5785   (eval $ac_link) 2>&5
5786   ac_status=$?
5787   echo "$as_me:5787: \$? = $ac_status" >&5
5788   (exit $ac_status); } &&
5789          { ac_try='test -s conftest$ac_exeext'
5790   { (eval echo "$as_me:5790: \"$ac_try\"") >&5
5791   (eval $ac_try) 2>&5
5792   ac_status=$?
5793   echo "$as_me:5793: \$? = $ac_status" >&5
5794   (exit $ac_status); }; }; then
5795
5796         cf_cv_find_linkage_utf8=yes
5797         cf_cv_header_path_utf8=/usr/include
5798         cf_cv_library_path_utf8=/usr/lib
5799
5800 else
5801   echo "$as_me: failed program was:" >&5
5802 cat conftest.$ac_ext >&5
5803
5804 LIBS="-lutf8  $cf_save_LIBS"
5805
5806 cat >conftest.$ac_ext <<_ACEOF
5807 #line 5807 "configure"
5808 #include "confdefs.h"
5809
5810 #include <libutf8.h>
5811 int
5812 main ()
5813 {
5814 putwc(0,0);
5815   ;
5816   return 0;
5817 }
5818 _ACEOF
5819 rm -f conftest.$ac_objext conftest$ac_exeext
5820 if { (eval echo "$as_me:5820: \"$ac_link\"") >&5
5821   (eval $ac_link) 2>&5
5822   ac_status=$?
5823   echo "$as_me:5823: \$? = $ac_status" >&5
5824   (exit $ac_status); } &&
5825          { ac_try='test -s conftest$ac_exeext'
5826   { (eval echo "$as_me:5826: \"$ac_try\"") >&5
5827   (eval $ac_try) 2>&5
5828   ac_status=$?
5829   echo "$as_me:5829: \$? = $ac_status" >&5
5830   (exit $ac_status); }; }; then
5831
5832         cf_cv_find_linkage_utf8=yes
5833         cf_cv_header_path_utf8=/usr/include
5834         cf_cv_library_path_utf8=/usr/lib
5835         cf_cv_library_file_utf8="-lutf8"
5836
5837 else
5838   echo "$as_me: failed program was:" >&5
5839 cat conftest.$ac_ext >&5
5840
5841         cf_cv_find_linkage_utf8=no
5842         LIBS="$cf_save_LIBS"
5843
5844         test -n "$verbose" && echo "    find linkage for utf8 library" 1>&6
5845
5846 echo "${as_me:-configure}:5846: testing find linkage for utf8 library ..." 1>&5
5847
5848 echo "${as_me:-configure}:5848: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
5849
5850         cf_save_CPPFLAGS="$CPPFLAGS"
5851         cf_test_CPPFLAGS="$CPPFLAGS"
5852
5853 cf_search=
5854
5855 # collect the current set of include-directories from compiler flags
5856 cf_header_path_list=""
5857 if test -n "${CFLAGS}${CPPFLAGS}" ; then
5858         for cf_header_path in $CPPFLAGS $CFLAGS
5859         do
5860                 case $cf_header_path in
5861                 (-I*)
5862                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
5863
5864 test "x$cf_header_path" != "xNONE" && \
5865 test -d "$cf_header_path" && \
5866  {
5867         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
5868         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
5869         test -d $cf_header_path/include/utf8 &&       cf_search="$cf_search $cf_header_path/include/utf8"
5870         test -d $cf_header_path/include/utf8/include &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
5871         test -d $cf_header_path/utf8/include &&       cf_search="$cf_search $cf_header_path/utf8/include"
5872         test -d $cf_header_path/utf8/include/utf8 &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
5873 }
5874
5875                         cf_header_path_list="$cf_header_path_list $cf_search"
5876                         ;;
5877                 esac
5878         done
5879 fi
5880
5881 # add the variations for the package we are looking for
5882
5883 cf_search=
5884
5885 test "x$prefix" != "xNONE" && \
5886 test -d "$prefix" && \
5887  {
5888         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
5889         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
5890         test -d $prefix/include/utf8 &&       cf_search="$cf_search $prefix/include/utf8"
5891         test -d $prefix/include/utf8/include &&    cf_search="$cf_search $prefix/include/utf8/include"
5892         test -d $prefix/utf8/include &&       cf_search="$cf_search $prefix/utf8/include"
5893         test -d $prefix/utf8/include/utf8 &&    cf_search="$cf_search $prefix/utf8/include/utf8"
5894 }
5895
5896 for cf_subdir_prefix in \
5897         /usr \
5898         /usr/local \
5899         /usr/pkg \
5900         /opt \
5901         /opt/local \
5902         $HOME
5903 do
5904
5905 test "x$cf_subdir_prefix" != "x$prefix" && \
5906 test -d "$cf_subdir_prefix" && \
5907 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
5908         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
5909         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
5910         test -d $cf_subdir_prefix/include/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/include/utf8"
5911         test -d $cf_subdir_prefix/include/utf8/include &&    cf_search="$cf_search $cf_subdir_prefix/include/utf8/include"
5912         test -d $cf_subdir_prefix/utf8/include &&       cf_search="$cf_search $cf_subdir_prefix/utf8/include"
5913         test -d $cf_subdir_prefix/utf8/include/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/include/utf8"
5914 }
5915
5916 done
5917
5918 test "$includedir" != NONE && \
5919 test "$includedir" != "/usr/include" && \
5920 test -d "$includedir" && {
5921         test -d $includedir &&    cf_search="$cf_search $includedir"
5922         test -d $includedir/utf8 && cf_search="$cf_search $includedir/utf8"
5923 }
5924
5925 test "$oldincludedir" != NONE && \
5926 test "$oldincludedir" != "/usr/include" && \
5927 test -d "$oldincludedir" && {
5928         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
5929         test -d $oldincludedir/utf8 && cf_search="$cf_search $oldincludedir/utf8"
5930 }
5931
5932 cf_search="$cf_search $cf_header_path_list"
5933
5934         for cf_cv_header_path_utf8 in $cf_search
5935         do
5936                 if test -d $cf_cv_header_path_utf8 ; then
5937                         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
5938
5939 echo "${as_me:-configure}:5939: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
5940
5941                         CPPFLAGS="$cf_save_CPPFLAGS -I$cf_cv_header_path_utf8"
5942                         cat >conftest.$ac_ext <<_ACEOF
5943 #line 5943 "configure"
5944 #include "confdefs.h"
5945
5946 #include <libutf8.h>
5947 int
5948 main ()
5949 {
5950 putwc(0,0);
5951   ;
5952   return 0;
5953 }
5954 _ACEOF
5955 rm -f conftest.$ac_objext
5956 if { (eval echo "$as_me:5956: \"$ac_compile\"") >&5
5957   (eval $ac_compile) 2>&5
5958   ac_status=$?
5959   echo "$as_me:5959: \$? = $ac_status" >&5
5960   (exit $ac_status); } &&
5961          { ac_try='test -s conftest.$ac_objext'
5962   { (eval echo "$as_me:5962: \"$ac_try\"") >&5
5963   (eval $ac_try) 2>&5
5964   ac_status=$?
5965   echo "$as_me:5965: \$? = $ac_status" >&5
5966   (exit $ac_status); }; }; then
5967
5968                                 test -n "$verbose" && echo "    ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
5969
5970 echo "${as_me:-configure}:5970: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
5971
5972                                 cf_cv_find_linkage_utf8=maybe
5973                                 cf_test_CPPFLAGS="$CPPFLAGS"
5974                                 break
5975 else
5976   echo "$as_me: failed program was:" >&5
5977 cat conftest.$ac_ext >&5
5978
5979                                 CPPFLAGS="$cf_save_CPPFLAGS"
5980
5981 fi
5982 rm -f conftest.$ac_objext conftest.$ac_ext
5983                 fi
5984         done
5985
5986         if test "$cf_cv_find_linkage_utf8" = maybe ; then
5987
5988 echo "${as_me:-configure}:5988: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
5989
5990                 cf_save_LIBS="$LIBS"
5991                 cf_save_LDFLAGS="$LDFLAGS"
5992
5993                 if test "$cf_cv_find_linkage_utf8" != yes ; then
5994
5995 cf_search=
5996 cf_library_path_list=""
5997 if test -n "${LDFLAGS}${LIBS}" ; then
5998         for cf_library_path in $LDFLAGS $LIBS
5999         do
6000                 case $cf_library_path in
6001                 (-L*)
6002                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
6003
6004 test "x$cf_library_path" != "xNONE" && \
6005 test -d "$cf_library_path" && \
6006  {
6007         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
6008         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
6009         test -d $cf_library_path/lib/utf8 &&       cf_search="$cf_search $cf_library_path/lib/utf8"
6010         test -d $cf_library_path/lib/utf8/lib &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
6011         test -d $cf_library_path/utf8/lib &&       cf_search="$cf_search $cf_library_path/utf8/lib"
6012         test -d $cf_library_path/utf8/lib/utf8 &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
6013 }
6014
6015                         cf_library_path_list="$cf_library_path_list $cf_search"
6016                         ;;
6017                 esac
6018         done
6019 fi
6020
6021 cf_search=
6022
6023 test "x$prefix" != "xNONE" && \
6024 test -d "$prefix" && \
6025  {
6026         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
6027         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
6028         test -d $prefix/lib/utf8 &&       cf_search="$cf_search $prefix/lib/utf8"
6029         test -d $prefix/lib/utf8/lib &&    cf_search="$cf_search $prefix/lib/utf8/lib"
6030         test -d $prefix/utf8/lib &&       cf_search="$cf_search $prefix/utf8/lib"
6031         test -d $prefix/utf8/lib/utf8 &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
6032 }
6033
6034 for cf_subdir_prefix in \
6035         /usr \
6036         /usr/local \
6037         /usr/pkg \
6038         /opt \
6039         /opt/local \
6040         $HOME
6041 do
6042
6043 test "x$cf_subdir_prefix" != "x$prefix" && \
6044 test -d "$cf_subdir_prefix" && \
6045 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
6046         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
6047         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
6048         test -d $cf_subdir_prefix/lib/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/lib/utf8"
6049         test -d $cf_subdir_prefix/lib/utf8/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/utf8/lib"
6050         test -d $cf_subdir_prefix/utf8/lib &&       cf_search="$cf_search $cf_subdir_prefix/utf8/lib"
6051         test -d $cf_subdir_prefix/utf8/lib/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/lib/utf8"
6052 }
6053
6054 done
6055
6056 cf_search="$cf_library_path_list $cf_search"
6057
6058                         for cf_cv_library_path_utf8 in $cf_search
6059                         do
6060                                 if test -d $cf_cv_library_path_utf8 ; then
6061                                         test -n "$verbose" && echo "    ... testing $cf_cv_library_path_utf8" 1>&6
6062
6063 echo "${as_me:-configure}:6063: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
6064
6065                                         CPPFLAGS="$cf_test_CPPFLAGS"
6066                                         LIBS="-lutf8  $cf_save_LIBS"
6067                                         LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
6068                                         cat >conftest.$ac_ext <<_ACEOF
6069 #line 6069 "configure"
6070 #include "confdefs.h"
6071
6072 #include <libutf8.h>
6073 int
6074 main ()
6075 {
6076 putwc(0,0);
6077   ;
6078   return 0;
6079 }
6080 _ACEOF
6081 rm -f conftest.$ac_objext conftest$ac_exeext
6082 if { (eval echo "$as_me:6082: \"$ac_link\"") >&5
6083   (eval $ac_link) 2>&5
6084   ac_status=$?
6085   echo "$as_me:6085: \$? = $ac_status" >&5
6086   (exit $ac_status); } &&
6087          { ac_try='test -s conftest$ac_exeext'
6088   { (eval echo "$as_me:6088: \"$ac_try\"") >&5
6089   (eval $ac_try) 2>&5
6090   ac_status=$?
6091   echo "$as_me:6091: \$? = $ac_status" >&5
6092   (exit $ac_status); }; }; then
6093
6094                                         test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
6095
6096 echo "${as_me:-configure}:6096: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
6097
6098                                         cf_cv_find_linkage_utf8=yes
6099                                         cf_cv_library_file_utf8="-lutf8"
6100                                         break
6101 else
6102   echo "$as_me: failed program was:" >&5
6103 cat conftest.$ac_ext >&5
6104
6105                                         CPPFLAGS="$cf_save_CPPFLAGS"
6106                                         LIBS="$cf_save_LIBS"
6107                                         LDFLAGS="$cf_save_LDFLAGS"
6108
6109 fi
6110 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6111                                 fi
6112                         done
6113                         CPPFLAGS="$cf_save_CPPFLAGS"
6114                         LDFLAGS="$cf_save_LDFLAGS"
6115                 fi
6116
6117         else
6118                 cf_cv_find_linkage_utf8=no
6119         fi
6120
6121 fi
6122 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6123
6124 fi
6125 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6126
6127 LIBS="$cf_save_LIBS"
6128
6129 if test "$cf_cv_find_linkage_utf8" = yes ; then
6130 cf_cv_utf8_lib=add-on
6131 else
6132 cf_cv_utf8_lib=no
6133 fi
6134
6135 fi
6136 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6137 fi
6138 echo "$as_me:6138: result: $cf_cv_utf8_lib" >&5
6139 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
6140
6141 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
6142 # ncurses/ncursesw:
6143 if test "$cf_cv_utf8_lib" = "add-on" ; then
6144
6145 cat >>confdefs.h <<\EOF
6146 #define HAVE_LIBUTF8_H 1
6147 EOF
6148
6149 if test -n "$cf_cv_header_path_utf8" ; then
6150   for cf_add_incdir in $cf_cv_header_path_utf8
6151   do
6152         while test $cf_add_incdir != /usr/include
6153         do
6154           if test -d $cf_add_incdir
6155           then
6156                 cf_have_incdir=no
6157                 if test -n "$CFLAGS$CPPFLAGS" ; then
6158                   # a loop is needed to ensure we can add subdirs of existing dirs
6159                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6160                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6161                           cf_have_incdir=yes; break
6162                         fi
6163                   done
6164                 fi
6165
6166                 if test "$cf_have_incdir" = no ; then
6167                   if test "$cf_add_incdir" = /usr/local/include ; then
6168                         if test "$GCC" = yes
6169                         then
6170                           cf_save_CPPFLAGS=$CPPFLAGS
6171                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6172                           cat >conftest.$ac_ext <<_ACEOF
6173 #line 6173 "configure"
6174 #include "confdefs.h"
6175 #include <stdio.h>
6176 int
6177 main ()
6178 {
6179 printf("Hello")
6180   ;
6181   return 0;
6182 }
6183 _ACEOF
6184 rm -f conftest.$ac_objext
6185 if { (eval echo "$as_me:6185: \"$ac_compile\"") >&5
6186   (eval $ac_compile) 2>&5
6187   ac_status=$?
6188   echo "$as_me:6188: \$? = $ac_status" >&5
6189   (exit $ac_status); } &&
6190          { ac_try='test -s conftest.$ac_objext'
6191   { (eval echo "$as_me:6191: \"$ac_try\"") >&5
6192   (eval $ac_try) 2>&5
6193   ac_status=$?
6194   echo "$as_me:6194: \$? = $ac_status" >&5
6195   (exit $ac_status); }; }; then
6196   :
6197 else
6198   echo "$as_me: failed program was:" >&5
6199 cat conftest.$ac_ext >&5
6200 cf_have_incdir=yes
6201 fi
6202 rm -f conftest.$ac_objext conftest.$ac_ext
6203                           CPPFLAGS=$cf_save_CPPFLAGS
6204                         fi
6205                   fi
6206                 fi
6207
6208                 if test "$cf_have_incdir" = no ; then
6209                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6210
6211 echo "${as_me:-configure}:6211: testing adding $cf_add_incdir to include-path ..." 1>&5
6212
6213                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6214
6215                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6216                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6217                   cf_add_incdir="$cf_top_incdir"
6218                 else
6219                   break
6220                 fi
6221           else
6222                 break
6223           fi
6224         done
6225   done
6226 fi
6227
6228 if test -n "$cf_cv_library_path_utf8" ; then
6229         for cf_add_libdir in $cf_cv_library_path_utf8
6230         do
6231                 if test $cf_add_libdir = /usr/lib ; then
6232                         :
6233                 elif test -d $cf_add_libdir
6234                 then
6235                         cf_have_libdir=no
6236                         if test -n "$LDFLAGS$LIBS" ; then
6237                                 # a loop is needed to ensure we can add subdirs of existing dirs
6238                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6239                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6240                                                 cf_have_libdir=yes; break
6241                                         fi
6242                                 done
6243                         fi
6244                         if test "$cf_have_libdir" = no ; then
6245                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6246
6247 echo "${as_me:-configure}:6247: testing adding $cf_add_libdir to library-path ..." 1>&5
6248
6249                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6250                         fi
6251                 fi
6252         done
6253 fi
6254
6255 cf_add_libs="$cf_cv_library_file_utf8"
6256 # Filter out duplicates - this happens with badly-designed ".pc" files...
6257 for cf_add_1lib in $LIBS
6258 do
6259         for cf_add_2lib in $cf_add_libs
6260         do
6261                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6262                 then
6263                         cf_add_1lib=
6264                         break
6265                 fi
6266         done
6267         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6268 done
6269 LIBS="$cf_add_libs"
6270
6271 fi
6272
6273 cf_ncuconfig_root=$cf_cv_screen
6274 cf_have_ncuconfig=no
6275
6276 if test "x${PKG_CONFIG:=none}" != xnone; then
6277         echo "$as_me:6277: checking pkg-config for $cf_ncuconfig_root" >&5
6278 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
6279         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
6280                 echo "$as_me:6280: result: yes" >&5
6281 echo "${ECHO_T}yes" >&6
6282
6283                 echo "$as_me:6283: checking if the $cf_ncuconfig_root package files work" >&5
6284 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
6285                 cf_have_ncuconfig=unknown
6286
6287                 cf_save_CPPFLAGS="$CPPFLAGS"
6288                 cf_save_LIBS="$LIBS"
6289
6290                 CPPFLAGS="$CPPFLAGS `$PKG_CONFIG --cflags $cf_ncuconfig_root`"
6291
6292 cf_add_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
6293 # Filter out duplicates - this happens with badly-designed ".pc" files...
6294 for cf_add_1lib in $LIBS
6295 do
6296         for cf_add_2lib in $cf_add_libs
6297         do
6298                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6299                 then
6300                         cf_add_1lib=
6301                         break
6302                 fi
6303         done
6304         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6305 done
6306 LIBS="$cf_add_libs"
6307
6308                 cat >conftest.$ac_ext <<_ACEOF
6309 #line 6309 "configure"
6310 #include "confdefs.h"
6311 #include <${cf_cv_ncurses_header:-curses.h}>
6312 int
6313 main ()
6314 {
6315 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
6316   ;
6317   return 0;
6318 }
6319 _ACEOF
6320 rm -f conftest.$ac_objext conftest$ac_exeext
6321 if { (eval echo "$as_me:6321: \"$ac_link\"") >&5
6322   (eval $ac_link) 2>&5
6323   ac_status=$?
6324   echo "$as_me:6324: \$? = $ac_status" >&5
6325   (exit $ac_status); } &&
6326          { ac_try='test -s conftest$ac_exeext'
6327   { (eval echo "$as_me:6327: \"$ac_try\"") >&5
6328   (eval $ac_try) 2>&5
6329   ac_status=$?
6330   echo "$as_me:6330: \$? = $ac_status" >&5
6331   (exit $ac_status); }; }; then
6332   if test "$cross_compiling" = yes; then
6333   cf_have_ncuconfig=maybe
6334 else
6335   cat >conftest.$ac_ext <<_ACEOF
6336 #line 6336 "configure"
6337 #include "confdefs.h"
6338 #include <${cf_cv_ncurses_header:-curses.h}>
6339                                 int main(void)
6340                                 { char *xx = curses_version(); return (xx == 0); }
6341 _ACEOF
6342 rm -f conftest$ac_exeext
6343 if { (eval echo "$as_me:6343: \"$ac_link\"") >&5
6344   (eval $ac_link) 2>&5
6345   ac_status=$?
6346   echo "$as_me:6346: \$? = $ac_status" >&5
6347   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
6348   { (eval echo "$as_me:6348: \"$ac_try\"") >&5
6349   (eval $ac_try) 2>&5
6350   ac_status=$?
6351   echo "$as_me:6351: \$? = $ac_status" >&5
6352   (exit $ac_status); }; }; then
6353   cf_have_ncuconfig=yes
6354 else
6355   echo "$as_me: program exited with status $ac_status" >&5
6356 echo "$as_me: failed program was:" >&5
6357 cat conftest.$ac_ext >&5
6358 cf_have_ncuconfig=no
6359 fi
6360 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
6361 fi
6362 else
6363   echo "$as_me: failed program was:" >&5
6364 cat conftest.$ac_ext >&5
6365 cf_have_ncuconfig=no
6366 fi
6367 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6368                 echo "$as_me:6368: result: $cf_have_ncuconfig" >&5
6369 echo "${ECHO_T}$cf_have_ncuconfig" >&6
6370                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
6371                 if test "$cf_have_ncuconfig" != "yes"
6372                 then
6373                         CPPFLAGS="$cf_save_CPPFLAGS"
6374                         LIBS="$cf_save_LIBS"
6375                         NCURSES_CONFIG_PKG=none
6376                 else
6377
6378 cat >>confdefs.h <<\EOF
6379 #define NCURSES 1
6380 EOF
6381
6382                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
6383                 fi
6384
6385         else
6386                 echo "$as_me:6386: result: no" >&5
6387 echo "${ECHO_T}no" >&6
6388                 NCURSES_CONFIG_PKG=none
6389         fi
6390 else
6391         NCURSES_CONFIG_PKG=none
6392 fi
6393
6394 if test "x$cf_have_ncuconfig" = "xno"; then
6395         echo "Looking for ${cf_ncuconfig_root}-config"
6396
6397 if test -n "$ac_tool_prefix"; then
6398   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
6399   do
6400     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
6401 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
6402 echo "$as_me:6402: checking for $ac_word" >&5
6403 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
6404 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
6405   echo $ECHO_N "(cached) $ECHO_C" >&6
6406 else
6407   if test -n "$NCURSES_CONFIG"; then
6408   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
6409 else
6410   ac_save_IFS=$IFS; IFS=$ac_path_separator
6411 ac_dummy="$PATH"
6412 for ac_dir in $ac_dummy; do
6413   IFS=$ac_save_IFS
6414   test -z "$ac_dir" && ac_dir=.
6415   $as_executable_p "$ac_dir/$ac_word" || continue
6416 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
6417 echo "$as_me:6417: found $ac_dir/$ac_word" >&5
6418 break
6419 done
6420
6421 fi
6422 fi
6423 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
6424 if test -n "$NCURSES_CONFIG"; then
6425   echo "$as_me:6425: result: $NCURSES_CONFIG" >&5
6426 echo "${ECHO_T}$NCURSES_CONFIG" >&6
6427 else
6428   echo "$as_me:6428: result: no" >&5
6429 echo "${ECHO_T}no" >&6
6430 fi
6431
6432     test -n "$NCURSES_CONFIG" && break
6433   done
6434 fi
6435 if test -z "$NCURSES_CONFIG"; then
6436   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
6437   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
6438 do
6439   # Extract the first word of "$ac_prog", so it can be a program name with args.
6440 set dummy $ac_prog; ac_word=$2
6441 echo "$as_me:6441: checking for $ac_word" >&5
6442 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
6443 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
6444   echo $ECHO_N "(cached) $ECHO_C" >&6
6445 else
6446   if test -n "$ac_ct_NCURSES_CONFIG"; then
6447   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
6448 else
6449   ac_save_IFS=$IFS; IFS=$ac_path_separator
6450 ac_dummy="$PATH"
6451 for ac_dir in $ac_dummy; do
6452   IFS=$ac_save_IFS
6453   test -z "$ac_dir" && ac_dir=.
6454   $as_executable_p "$ac_dir/$ac_word" || continue
6455 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
6456 echo "$as_me:6456: found $ac_dir/$ac_word" >&5
6457 break
6458 done
6459
6460 fi
6461 fi
6462 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
6463 if test -n "$ac_ct_NCURSES_CONFIG"; then
6464   echo "$as_me:6464: result: $ac_ct_NCURSES_CONFIG" >&5
6465 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
6466 else
6467   echo "$as_me:6467: result: no" >&5
6468 echo "${ECHO_T}no" >&6
6469 fi
6470
6471   test -n "$ac_ct_NCURSES_CONFIG" && break
6472 done
6473 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
6474
6475   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
6476 fi
6477
6478         if test "$NCURSES_CONFIG" != none ; then
6479
6480                 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
6481
6482 cf_add_libs="`$NCURSES_CONFIG --libs`"
6483 # Filter out duplicates - this happens with badly-designed ".pc" files...
6484 for cf_add_1lib in $LIBS
6485 do
6486         for cf_add_2lib in $cf_add_libs
6487         do
6488                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6489                 then
6490                         cf_add_1lib=
6491                         break
6492                 fi
6493         done
6494         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6495 done
6496 LIBS="$cf_add_libs"
6497
6498                 # even with config script, some packages use no-override for curses.h
6499
6500 echo "$as_me:6500: checking if we have identified curses headers" >&5
6501 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
6502 if test "${cf_cv_ncurses_header+set}" = set; then
6503   echo $ECHO_N "(cached) $ECHO_C" >&6
6504 else
6505
6506 cf_cv_ncurses_header=none
6507 for cf_header in \
6508         ncurses.h $cf_cv_screen/ncurses.h \
6509         curses.h $cf_cv_screen/curses.h
6510 do
6511 cat >conftest.$ac_ext <<_ACEOF
6512 #line 6512 "configure"
6513 #include "confdefs.h"
6514 #include <${cf_header}>
6515 int
6516 main ()
6517 {
6518 initscr(); tgoto("?", 0,0)
6519   ;
6520   return 0;
6521 }
6522 _ACEOF
6523 rm -f conftest.$ac_objext
6524 if { (eval echo "$as_me:6524: \"$ac_compile\"") >&5
6525   (eval $ac_compile) 2>&5
6526   ac_status=$?
6527   echo "$as_me:6527: \$? = $ac_status" >&5
6528   (exit $ac_status); } &&
6529          { ac_try='test -s conftest.$ac_objext'
6530   { (eval echo "$as_me:6530: \"$ac_try\"") >&5
6531   (eval $ac_try) 2>&5
6532   ac_status=$?
6533   echo "$as_me:6533: \$? = $ac_status" >&5
6534   (exit $ac_status); }; }; then
6535   cf_cv_ncurses_header=$cf_header; break
6536 else
6537   echo "$as_me: failed program was:" >&5
6538 cat conftest.$ac_ext >&5
6539 fi
6540 rm -f conftest.$ac_objext conftest.$ac_ext
6541 done
6542
6543 fi
6544 echo "$as_me:6544: result: $cf_cv_ncurses_header" >&5
6545 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
6546
6547 if test "$cf_cv_ncurses_header" = none ; then
6548         { { echo "$as_me:6548: error: No curses header-files found" >&5
6549 echo "$as_me: error: No curses header-files found" >&2;}
6550    { (exit 1); exit 1; }; }
6551 fi
6552
6553 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
6554
6555 for ac_header in $cf_cv_ncurses_header
6556 do
6557 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
6558 echo "$as_me:6558: checking for $ac_header" >&5
6559 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
6560 if eval "test \"\${$as_ac_Header+set}\" = set"; then
6561   echo $ECHO_N "(cached) $ECHO_C" >&6
6562 else
6563   cat >conftest.$ac_ext <<_ACEOF
6564 #line 6564 "configure"
6565 #include "confdefs.h"
6566 #include <$ac_header>
6567 _ACEOF
6568 if { (eval echo "$as_me:6568: \"$ac_cpp conftest.$ac_ext\"") >&5
6569   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
6570   ac_status=$?
6571   egrep -v '^ *\+' conftest.er1 >conftest.err
6572   rm -f conftest.er1
6573   cat conftest.err >&5
6574   echo "$as_me:6574: \$? = $ac_status" >&5
6575   (exit $ac_status); } >/dev/null; then
6576   if test -s conftest.err; then
6577     ac_cpp_err=$ac_c_preproc_warn_flag
6578   else
6579     ac_cpp_err=
6580   fi
6581 else
6582   ac_cpp_err=yes
6583 fi
6584 if test -z "$ac_cpp_err"; then
6585   eval "$as_ac_Header=yes"
6586 else
6587   echo "$as_me: failed program was:" >&5
6588   cat conftest.$ac_ext >&5
6589   eval "$as_ac_Header=no"
6590 fi
6591 rm -f conftest.err conftest.$ac_ext
6592 fi
6593 echo "$as_me:6593: result: `eval echo '${'$as_ac_Header'}'`" >&5
6594 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
6595 if test `eval echo '${'$as_ac_Header'}'` = yes; then
6596   cat >>confdefs.h <<EOF
6597 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
6598 EOF
6599
6600 fi
6601 done
6602
6603 cat >>confdefs.h <<\EOF
6604 #define NCURSES 1
6605 EOF
6606
6607 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
6608
6609                 cat >>confdefs.h <<EOF
6610 #define $cf_nculib_ROOT 1
6611 EOF
6612
6613                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
6614
6615         else
6616
6617 cf_ncuhdr_root=$cf_cv_screen
6618
6619 test -n "$cf_cv_curses_dir" && \
6620 test "$cf_cv_curses_dir" != "no" && { \
6621
6622 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
6623   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
6624   do
6625         while test $cf_add_incdir != /usr/include
6626         do
6627           if test -d $cf_add_incdir
6628           then
6629                 cf_have_incdir=no
6630                 if test -n "$CFLAGS$CPPFLAGS" ; then
6631                   # a loop is needed to ensure we can add subdirs of existing dirs
6632                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6633                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6634                           cf_have_incdir=yes; break
6635                         fi
6636                   done
6637                 fi
6638
6639                 if test "$cf_have_incdir" = no ; then
6640                   if test "$cf_add_incdir" = /usr/local/include ; then
6641                         if test "$GCC" = yes
6642                         then
6643                           cf_save_CPPFLAGS=$CPPFLAGS
6644                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6645                           cat >conftest.$ac_ext <<_ACEOF
6646 #line 6646 "configure"
6647 #include "confdefs.h"
6648 #include <stdio.h>
6649 int
6650 main ()
6651 {
6652 printf("Hello")
6653   ;
6654   return 0;
6655 }
6656 _ACEOF
6657 rm -f conftest.$ac_objext
6658 if { (eval echo "$as_me:6658: \"$ac_compile\"") >&5
6659   (eval $ac_compile) 2>&5
6660   ac_status=$?
6661   echo "$as_me:6661: \$? = $ac_status" >&5
6662   (exit $ac_status); } &&
6663          { ac_try='test -s conftest.$ac_objext'
6664   { (eval echo "$as_me:6664: \"$ac_try\"") >&5
6665   (eval $ac_try) 2>&5
6666   ac_status=$?
6667   echo "$as_me:6667: \$? = $ac_status" >&5
6668   (exit $ac_status); }; }; then
6669   :
6670 else
6671   echo "$as_me: failed program was:" >&5
6672 cat conftest.$ac_ext >&5
6673 cf_have_incdir=yes
6674 fi
6675 rm -f conftest.$ac_objext conftest.$ac_ext
6676                           CPPFLAGS=$cf_save_CPPFLAGS
6677                         fi
6678                   fi
6679                 fi
6680
6681                 if test "$cf_have_incdir" = no ; then
6682                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6683
6684 echo "${as_me:-configure}:6684: testing adding $cf_add_incdir to include-path ..." 1>&5
6685
6686                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6687
6688                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6689                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6690                   cf_add_incdir="$cf_top_incdir"
6691                 else
6692                   break
6693                 fi
6694           else
6695                 break
6696           fi
6697         done
6698   done
6699 fi
6700
6701 }
6702
6703 echo "$as_me:6703: checking for $cf_ncuhdr_root header in include-path" >&5
6704 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
6705 if test "${cf_cv_ncurses_h+set}" = set; then
6706   echo $ECHO_N "(cached) $ECHO_C" >&6
6707 else
6708
6709         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
6710         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
6711         for cf_header in $cf_header_list
6712         do
6713
6714         cat >conftest.$ac_ext <<_ACEOF
6715 #line 6715 "configure"
6716 #include "confdefs.h"
6717
6718 #include <$cf_header>
6719 int
6720 main ()
6721 {
6722
6723 #ifdef NCURSES_VERSION
6724
6725 printf("%s\n", NCURSES_VERSION);
6726 #else
6727 #ifdef __NCURSES_H
6728 printf("old\n");
6729 #else
6730         make an error
6731 #endif
6732 #endif
6733
6734   ;
6735   return 0;
6736 }
6737 _ACEOF
6738 rm -f conftest.$ac_objext
6739 if { (eval echo "$as_me:6739: \"$ac_compile\"") >&5
6740   (eval $ac_compile) 2>&5
6741   ac_status=$?
6742   echo "$as_me:6742: \$? = $ac_status" >&5
6743   (exit $ac_status); } &&
6744          { ac_try='test -s conftest.$ac_objext'
6745   { (eval echo "$as_me:6745: \"$ac_try\"") >&5
6746   (eval $ac_try) 2>&5
6747   ac_status=$?
6748   echo "$as_me:6748: \$? = $ac_status" >&5
6749   (exit $ac_status); }; }; then
6750   cf_cv_ncurses_h=$cf_header
6751
6752 else
6753   echo "$as_me: failed program was:" >&5
6754 cat conftest.$ac_ext >&5
6755 cf_cv_ncurses_h=no
6756 fi
6757 rm -f conftest.$ac_objext conftest.$ac_ext
6758
6759                 test "$cf_cv_ncurses_h" != no && break
6760         done
6761
6762 fi
6763 echo "$as_me:6763: result: $cf_cv_ncurses_h" >&5
6764 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
6765
6766 if test "$cf_cv_ncurses_h" != no ; then
6767         cf_cv_ncurses_header=$cf_cv_ncurses_h
6768 else
6769
6770 echo "$as_me:6770: checking for $cf_ncuhdr_root include-path" >&5
6771 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
6772 if test "${cf_cv_ncurses_h2+set}" = set; then
6773   echo $ECHO_N "(cached) $ECHO_C" >&6
6774 else
6775
6776         test -n "$verbose" && echo
6777
6778 cf_search=
6779
6780 # collect the current set of include-directories from compiler flags
6781 cf_header_path_list=""
6782 if test -n "${CFLAGS}${CPPFLAGS}" ; then
6783         for cf_header_path in $CPPFLAGS $CFLAGS
6784         do
6785                 case $cf_header_path in
6786                 (-I*)
6787                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
6788
6789 test "x$cf_header_path" != "xNONE" && \
6790 test -d "$cf_header_path" && \
6791  {
6792         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
6793         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
6794         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
6795         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
6796         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
6797         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"
6798 }
6799
6800                         cf_header_path_list="$cf_header_path_list $cf_search"
6801                         ;;
6802                 esac
6803         done
6804 fi
6805
6806 # add the variations for the package we are looking for
6807
6808 cf_search=
6809
6810 test "x$prefix" != "xNONE" && \
6811 test -d "$prefix" && \
6812  {
6813         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
6814         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
6815         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
6816         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
6817         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
6818         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
6819 }
6820
6821 for cf_subdir_prefix in \
6822         /usr \
6823         /usr/local \
6824         /usr/pkg \
6825         /opt \
6826         /opt/local \
6827         $HOME
6828 do
6829
6830 test "x$cf_subdir_prefix" != "x$prefix" && \
6831 test -d "$cf_subdir_prefix" && \
6832 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
6833         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
6834         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
6835         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
6836         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
6837         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
6838         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"
6839 }
6840
6841 done
6842
6843 test "$includedir" != NONE && \
6844 test "$includedir" != "/usr/include" && \
6845 test -d "$includedir" && {
6846         test -d $includedir &&    cf_search="$cf_search $includedir"
6847         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
6848 }
6849
6850 test "$oldincludedir" != NONE && \
6851 test "$oldincludedir" != "/usr/include" && \
6852 test -d "$oldincludedir" && {
6853         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
6854         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
6855 }
6856
6857 cf_search="$cf_search $cf_header_path_list"
6858
6859         test -n "$verbose" && echo search path $cf_search
6860         cf_save2_CPPFLAGS="$CPPFLAGS"
6861         for cf_incdir in $cf_search
6862         do
6863
6864 if test -n "$cf_incdir" ; then
6865   for cf_add_incdir in $cf_incdir
6866   do
6867         while test $cf_add_incdir != /usr/include
6868         do
6869           if test -d $cf_add_incdir
6870           then
6871                 cf_have_incdir=no
6872                 if test -n "$CFLAGS$CPPFLAGS" ; then
6873                   # a loop is needed to ensure we can add subdirs of existing dirs
6874                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6875                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6876                           cf_have_incdir=yes; break
6877                         fi
6878                   done
6879                 fi
6880
6881                 if test "$cf_have_incdir" = no ; then
6882                   if test "$cf_add_incdir" = /usr/local/include ; then
6883                         if test "$GCC" = yes
6884                         then
6885                           cf_save_CPPFLAGS=$CPPFLAGS
6886                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6887                           cat >conftest.$ac_ext <<_ACEOF
6888 #line 6888 "configure"
6889 #include "confdefs.h"
6890 #include <stdio.h>
6891 int
6892 main ()
6893 {
6894 printf("Hello")
6895   ;
6896   return 0;
6897 }
6898 _ACEOF
6899 rm -f conftest.$ac_objext
6900 if { (eval echo "$as_me:6900: \"$ac_compile\"") >&5
6901   (eval $ac_compile) 2>&5
6902   ac_status=$?
6903   echo "$as_me:6903: \$? = $ac_status" >&5
6904   (exit $ac_status); } &&
6905          { ac_try='test -s conftest.$ac_objext'
6906   { (eval echo "$as_me:6906: \"$ac_try\"") >&5
6907   (eval $ac_try) 2>&5
6908   ac_status=$?
6909   echo "$as_me:6909: \$? = $ac_status" >&5
6910   (exit $ac_status); }; }; then
6911   :
6912 else
6913   echo "$as_me: failed program was:" >&5
6914 cat conftest.$ac_ext >&5
6915 cf_have_incdir=yes
6916 fi
6917 rm -f conftest.$ac_objext conftest.$ac_ext
6918                           CPPFLAGS=$cf_save_CPPFLAGS
6919                         fi
6920                   fi
6921                 fi
6922
6923                 if test "$cf_have_incdir" = no ; then
6924                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6925
6926 echo "${as_me:-configure}:6926: testing adding $cf_add_incdir to include-path ..." 1>&5
6927
6928                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6929
6930                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6931                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6932                   cf_add_incdir="$cf_top_incdir"
6933                 else
6934                   break
6935                 fi
6936           else
6937                 break
6938           fi
6939         done
6940   done
6941 fi
6942
6943                 for cf_header in \
6944                         ncurses.h \
6945                         curses.h
6946                 do
6947
6948         cat >conftest.$ac_ext <<_ACEOF
6949 #line 6949 "configure"
6950 #include "confdefs.h"
6951
6952 #include <$cf_header>
6953 int
6954 main ()
6955 {
6956
6957 #ifdef NCURSES_VERSION
6958
6959 printf("%s\n", NCURSES_VERSION);
6960 #else
6961 #ifdef __NCURSES_H
6962 printf("old\n");
6963 #else
6964         make an error
6965 #endif
6966 #endif
6967
6968   ;
6969   return 0;
6970 }
6971 _ACEOF
6972 rm -f conftest.$ac_objext
6973 if { (eval echo "$as_me:6973: \"$ac_compile\"") >&5
6974   (eval $ac_compile) 2>&5
6975   ac_status=$?
6976   echo "$as_me:6976: \$? = $ac_status" >&5
6977   (exit $ac_status); } &&
6978          { ac_try='test -s conftest.$ac_objext'
6979   { (eval echo "$as_me:6979: \"$ac_try\"") >&5
6980   (eval $ac_try) 2>&5
6981   ac_status=$?
6982   echo "$as_me:6982: \$? = $ac_status" >&5
6983   (exit $ac_status); }; }; then
6984   cf_cv_ncurses_h2=$cf_header
6985
6986 else
6987   echo "$as_me: failed program was:" >&5
6988 cat conftest.$ac_ext >&5
6989 cf_cv_ncurses_h2=no
6990 fi
6991 rm -f conftest.$ac_objext conftest.$ac_ext
6992
6993                         if test "$cf_cv_ncurses_h2" != no ; then
6994                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
6995                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
6996                                 break
6997                         fi
6998                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
6999                 done
7000                 CPPFLAGS="$cf_save2_CPPFLAGS"
7001                 test "$cf_cv_ncurses_h2" != no && break
7002         done
7003         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:7003: error: not found" >&5
7004 echo "$as_me: error: not found" >&2;}
7005    { (exit 1); exit 1; }; }
7006
7007 fi
7008 echo "$as_me:7008: result: $cf_cv_ncurses_h2" >&5
7009 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
7010
7011         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
7012         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
7013         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
7014                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
7015         fi
7016
7017 if test -n "$cf_1st_incdir" ; then
7018   for cf_add_incdir in $cf_1st_incdir
7019   do
7020         while test $cf_add_incdir != /usr/include
7021         do
7022           if test -d $cf_add_incdir
7023           then
7024                 cf_have_incdir=no
7025                 if test -n "$CFLAGS$CPPFLAGS" ; then
7026                   # a loop is needed to ensure we can add subdirs of existing dirs
7027                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7028                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7029                           cf_have_incdir=yes; break
7030                         fi
7031                   done
7032                 fi
7033
7034                 if test "$cf_have_incdir" = no ; then
7035                   if test "$cf_add_incdir" = /usr/local/include ; then
7036                         if test "$GCC" = yes
7037                         then
7038                           cf_save_CPPFLAGS=$CPPFLAGS
7039                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7040                           cat >conftest.$ac_ext <<_ACEOF
7041 #line 7041 "configure"
7042 #include "confdefs.h"
7043 #include <stdio.h>
7044 int
7045 main ()
7046 {
7047 printf("Hello")
7048   ;
7049   return 0;
7050 }
7051 _ACEOF
7052 rm -f conftest.$ac_objext
7053 if { (eval echo "$as_me:7053: \"$ac_compile\"") >&5
7054   (eval $ac_compile) 2>&5
7055   ac_status=$?
7056   echo "$as_me:7056: \$? = $ac_status" >&5
7057   (exit $ac_status); } &&
7058          { ac_try='test -s conftest.$ac_objext'
7059   { (eval echo "$as_me:7059: \"$ac_try\"") >&5
7060   (eval $ac_try) 2>&5
7061   ac_status=$?
7062   echo "$as_me:7062: \$? = $ac_status" >&5
7063   (exit $ac_status); }; }; then
7064   :
7065 else
7066   echo "$as_me: failed program was:" >&5
7067 cat conftest.$ac_ext >&5
7068 cf_have_incdir=yes
7069 fi
7070 rm -f conftest.$ac_objext conftest.$ac_ext
7071                           CPPFLAGS=$cf_save_CPPFLAGS
7072                         fi
7073                   fi
7074                 fi
7075
7076                 if test "$cf_have_incdir" = no ; then
7077                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7078
7079 echo "${as_me:-configure}:7079: testing adding $cf_add_incdir to include-path ..." 1>&5
7080
7081                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7082
7083                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7084                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7085                   cf_add_incdir="$cf_top_incdir"
7086                 else
7087                   break
7088                 fi
7089           else
7090                 break
7091           fi
7092         done
7093   done
7094 fi
7095
7096 fi
7097
7098 # Set definitions to allow ifdef'ing for ncurses.h
7099
7100 case $cf_cv_ncurses_header in
7101 (*ncurses.h)
7102
7103 cat >>confdefs.h <<\EOF
7104 #define HAVE_NCURSES_H 1
7105 EOF
7106
7107         ;;
7108 esac
7109
7110 case $cf_cv_ncurses_header in
7111 (ncurses/curses.h|ncurses/ncurses.h)
7112
7113 cat >>confdefs.h <<\EOF
7114 #define HAVE_NCURSES_NCURSES_H 1
7115 EOF
7116
7117         ;;
7118 (ncursesw/curses.h|ncursesw/ncurses.h)
7119
7120 cat >>confdefs.h <<\EOF
7121 #define HAVE_NCURSESW_NCURSES_H 1
7122 EOF
7123
7124         ;;
7125 esac
7126
7127 echo "$as_me:7127: checking for terminfo header" >&5
7128 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
7129 if test "${cf_cv_term_header+set}" = set; then
7130   echo $ECHO_N "(cached) $ECHO_C" >&6
7131 else
7132
7133 case ${cf_cv_ncurses_header} in
7134 (*/ncurses.h|*/ncursesw.h)
7135         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
7136         ;;
7137 (*)
7138         cf_term_header=term.h
7139         ;;
7140 esac
7141
7142 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
7143 do
7144 cat >conftest.$ac_ext <<_ACEOF
7145 #line 7145 "configure"
7146 #include "confdefs.h"
7147 #include <stdio.h>
7148 #include <${cf_cv_ncurses_header:-curses.h}>
7149 #include <$cf_test>
7150
7151 int
7152 main ()
7153 {
7154 int x = auto_left_margin
7155   ;
7156   return 0;
7157 }
7158 _ACEOF
7159 rm -f conftest.$ac_objext
7160 if { (eval echo "$as_me:7160: \"$ac_compile\"") >&5
7161   (eval $ac_compile) 2>&5
7162   ac_status=$?
7163   echo "$as_me:7163: \$? = $ac_status" >&5
7164   (exit $ac_status); } &&
7165          { ac_try='test -s conftest.$ac_objext'
7166   { (eval echo "$as_me:7166: \"$ac_try\"") >&5
7167   (eval $ac_try) 2>&5
7168   ac_status=$?
7169   echo "$as_me:7169: \$? = $ac_status" >&5
7170   (exit $ac_status); }; }; then
7171
7172         cf_cv_term_header="$cf_test"
7173 else
7174   echo "$as_me: failed program was:" >&5
7175 cat conftest.$ac_ext >&5
7176
7177         cf_cv_term_header=unknown
7178
7179 fi
7180 rm -f conftest.$ac_objext conftest.$ac_ext
7181         test "$cf_cv_term_header" != unknown && break
7182 done
7183
7184 fi
7185 echo "$as_me:7185: result: $cf_cv_term_header" >&5
7186 echo "${ECHO_T}$cf_cv_term_header" >&6
7187
7188 # Set definitions to allow ifdef'ing to accommodate subdirectories
7189
7190 case $cf_cv_term_header in
7191 (*term.h)
7192
7193 cat >>confdefs.h <<\EOF
7194 #define HAVE_TERM_H 1
7195 EOF
7196
7197         ;;
7198 esac
7199
7200 case $cf_cv_term_header in
7201 (ncurses/term.h)
7202
7203 cat >>confdefs.h <<\EOF
7204 #define HAVE_NCURSES_TERM_H 1
7205 EOF
7206
7207         ;;
7208 (ncursesw/term.h)
7209
7210 cat >>confdefs.h <<\EOF
7211 #define HAVE_NCURSESW_TERM_H 1
7212 EOF
7213
7214         ;;
7215 esac
7216
7217 # some applications need this, but should check for NCURSES_VERSION
7218
7219 cat >>confdefs.h <<\EOF
7220 #define NCURSES 1
7221 EOF
7222
7223 echo "$as_me:7223: checking for ncurses version" >&5
7224 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
7225 if test "${cf_cv_ncurses_version+set}" = set; then
7226   echo $ECHO_N "(cached) $ECHO_C" >&6
7227 else
7228
7229         cf_cv_ncurses_version=no
7230         cf_tempfile=out$$
7231         rm -f $cf_tempfile
7232         if test "$cross_compiling" = yes; then
7233
7234         # This will not work if the preprocessor splits the line after the
7235         # Autoconf token.  The 'unproto' program does that.
7236         cat > conftest.$ac_ext <<EOF
7237 #include <${cf_cv_ncurses_header:-curses.h}>
7238 #undef Autoconf
7239 #ifdef NCURSES_VERSION
7240 Autoconf NCURSES_VERSION
7241 #else
7242 #ifdef __NCURSES_H
7243 Autoconf "old"
7244 #endif
7245 ;
7246 #endif
7247 EOF
7248         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
7249         { (eval echo "$as_me:7249: \"$cf_try\"") >&5
7250   (eval $cf_try) 2>&5
7251   ac_status=$?
7252   echo "$as_me:7252: \$? = $ac_status" >&5
7253   (exit $ac_status); }
7254         if test -f conftest.out ; then
7255                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
7256                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
7257                 rm -f conftest.out
7258         fi
7259
7260 else
7261   cat >conftest.$ac_ext <<_ACEOF
7262 #line 7262 "configure"
7263 #include "confdefs.h"
7264
7265 #include <${cf_cv_ncurses_header:-curses.h}>
7266 #include <stdio.h>
7267 int main()
7268 {
7269         FILE *fp = fopen("$cf_tempfile", "w");
7270 #ifdef NCURSES_VERSION
7271 # ifdef NCURSES_VERSION_PATCH
7272         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
7273 # else
7274         fprintf(fp, "%s\n", NCURSES_VERSION);
7275 # endif
7276 #else
7277 # ifdef __NCURSES_H
7278         fprintf(fp, "old\n");
7279 # else
7280         make an error
7281 # endif
7282 #endif
7283         ${cf_cv_main_return:-return}(0);
7284 }
7285 _ACEOF
7286 rm -f conftest$ac_exeext
7287 if { (eval echo "$as_me:7287: \"$ac_link\"") >&5
7288   (eval $ac_link) 2>&5
7289   ac_status=$?
7290   echo "$as_me:7290: \$? = $ac_status" >&5
7291   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
7292   { (eval echo "$as_me:7292: \"$ac_try\"") >&5
7293   (eval $ac_try) 2>&5
7294   ac_status=$?
7295   echo "$as_me:7295: \$? = $ac_status" >&5
7296   (exit $ac_status); }; }; then
7297
7298         cf_cv_ncurses_version=`cat $cf_tempfile`
7299 else
7300   echo "$as_me: program exited with status $ac_status" >&5
7301 echo "$as_me: failed program was:" >&5
7302 cat conftest.$ac_ext >&5
7303 fi
7304 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
7305 fi
7306         rm -f $cf_tempfile
7307
7308 fi
7309 echo "$as_me:7309: result: $cf_cv_ncurses_version" >&5
7310 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
7311 test "$cf_cv_ncurses_version" = no ||
7312 cat >>confdefs.h <<\EOF
7313 #define NCURSES 1
7314 EOF
7315
7316 cf_nculib_root=$cf_cv_screen
7317         # This works, except for the special case where we find gpm, but
7318         # ncurses is in a nonstandard location via $LIBS, and we really want
7319         # to link gpm.
7320 cf_ncurses_LIBS=""
7321 cf_ncurses_SAVE="$LIBS"
7322 echo "$as_me:7322: checking for Gpm_Open in -lgpm" >&5
7323 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
7324 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
7325   echo $ECHO_N "(cached) $ECHO_C" >&6
7326 else
7327   ac_check_lib_save_LIBS=$LIBS
7328 LIBS="-lgpm  $LIBS"
7329 cat >conftest.$ac_ext <<_ACEOF
7330 #line 7330 "configure"
7331 #include "confdefs.h"
7332
7333 /* Override any gcc2 internal prototype to avoid an error.  */
7334 #ifdef __cplusplus
7335 extern "C"
7336 #endif
7337 /* We use char because int might match the return type of a gcc2
7338    builtin and then its argument prototype would still apply.  */
7339 char Gpm_Open ();
7340 int
7341 main ()
7342 {
7343 Gpm_Open ();
7344   ;
7345   return 0;
7346 }
7347 _ACEOF
7348 rm -f conftest.$ac_objext conftest$ac_exeext
7349 if { (eval echo "$as_me:7349: \"$ac_link\"") >&5
7350   (eval $ac_link) 2>&5
7351   ac_status=$?
7352   echo "$as_me:7352: \$? = $ac_status" >&5
7353   (exit $ac_status); } &&
7354          { ac_try='test -s conftest$ac_exeext'
7355   { (eval echo "$as_me:7355: \"$ac_try\"") >&5
7356   (eval $ac_try) 2>&5
7357   ac_status=$?
7358   echo "$as_me:7358: \$? = $ac_status" >&5
7359   (exit $ac_status); }; }; then
7360   ac_cv_lib_gpm_Gpm_Open=yes
7361 else
7362   echo "$as_me: failed program was:" >&5
7363 cat conftest.$ac_ext >&5
7364 ac_cv_lib_gpm_Gpm_Open=no
7365 fi
7366 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7367 LIBS=$ac_check_lib_save_LIBS
7368 fi
7369 echo "$as_me:7369: result: $ac_cv_lib_gpm_Gpm_Open" >&5
7370 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
7371 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
7372   echo "$as_me:7372: checking for initscr in -lgpm" >&5
7373 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
7374 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
7375   echo $ECHO_N "(cached) $ECHO_C" >&6
7376 else
7377   ac_check_lib_save_LIBS=$LIBS
7378 LIBS="-lgpm  $LIBS"
7379 cat >conftest.$ac_ext <<_ACEOF
7380 #line 7380 "configure"
7381 #include "confdefs.h"
7382
7383 /* Override any gcc2 internal prototype to avoid an error.  */
7384 #ifdef __cplusplus
7385 extern "C"
7386 #endif
7387 /* We use char because int might match the return type of a gcc2
7388    builtin and then its argument prototype would still apply.  */
7389 char initscr ();
7390 int
7391 main ()
7392 {
7393 initscr ();
7394   ;
7395   return 0;
7396 }
7397 _ACEOF
7398 rm -f conftest.$ac_objext conftest$ac_exeext
7399 if { (eval echo "$as_me:7399: \"$ac_link\"") >&5
7400   (eval $ac_link) 2>&5
7401   ac_status=$?
7402   echo "$as_me:7402: \$? = $ac_status" >&5
7403   (exit $ac_status); } &&
7404          { ac_try='test -s conftest$ac_exeext'
7405   { (eval echo "$as_me:7405: \"$ac_try\"") >&5
7406   (eval $ac_try) 2>&5
7407   ac_status=$?
7408   echo "$as_me:7408: \$? = $ac_status" >&5
7409   (exit $ac_status); }; }; then
7410   ac_cv_lib_gpm_initscr=yes
7411 else
7412   echo "$as_me: failed program was:" >&5
7413 cat conftest.$ac_ext >&5
7414 ac_cv_lib_gpm_initscr=no
7415 fi
7416 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7417 LIBS=$ac_check_lib_save_LIBS
7418 fi
7419 echo "$as_me:7419: result: $ac_cv_lib_gpm_initscr" >&5
7420 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
7421 if test $ac_cv_lib_gpm_initscr = yes; then
7422   LIBS="$cf_ncurses_SAVE"
7423 else
7424   cf_ncurses_LIBS="-lgpm"
7425 fi
7426
7427 fi
7428
7429 case $host_os in
7430 (freebsd*)
7431         # This is only necessary if you are linking against an obsolete
7432         # version of ncurses (but it should do no harm, since it's static).
7433         if test "$cf_nculib_root" = ncurses ; then
7434                 echo "$as_me:7434: checking for tgoto in -lmytinfo" >&5
7435 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
7436 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
7437   echo $ECHO_N "(cached) $ECHO_C" >&6
7438 else
7439   ac_check_lib_save_LIBS=$LIBS
7440 LIBS="-lmytinfo  $LIBS"
7441 cat >conftest.$ac_ext <<_ACEOF
7442 #line 7442 "configure"
7443 #include "confdefs.h"
7444
7445 /* Override any gcc2 internal prototype to avoid an error.  */
7446 #ifdef __cplusplus
7447 extern "C"
7448 #endif
7449 /* We use char because int might match the return type of a gcc2
7450    builtin and then its argument prototype would still apply.  */
7451 char tgoto ();
7452 int
7453 main ()
7454 {
7455 tgoto ();
7456   ;
7457   return 0;
7458 }
7459 _ACEOF
7460 rm -f conftest.$ac_objext conftest$ac_exeext
7461 if { (eval echo "$as_me:7461: \"$ac_link\"") >&5
7462   (eval $ac_link) 2>&5
7463   ac_status=$?
7464   echo "$as_me:7464: \$? = $ac_status" >&5
7465   (exit $ac_status); } &&
7466          { ac_try='test -s conftest$ac_exeext'
7467   { (eval echo "$as_me:7467: \"$ac_try\"") >&5
7468   (eval $ac_try) 2>&5
7469   ac_status=$?
7470   echo "$as_me:7470: \$? = $ac_status" >&5
7471   (exit $ac_status); }; }; then
7472   ac_cv_lib_mytinfo_tgoto=yes
7473 else
7474   echo "$as_me: failed program was:" >&5
7475 cat conftest.$ac_ext >&5
7476 ac_cv_lib_mytinfo_tgoto=no
7477 fi
7478 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7479 LIBS=$ac_check_lib_save_LIBS
7480 fi
7481 echo "$as_me:7481: result: $ac_cv_lib_mytinfo_tgoto" >&5
7482 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
7483 if test $ac_cv_lib_mytinfo_tgoto = yes; then
7484   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
7485 fi
7486
7487         fi
7488         ;;
7489 esac
7490
7491 cf_add_libs="$cf_ncurses_LIBS"
7492 # Filter out duplicates - this happens with badly-designed ".pc" files...
7493 for cf_add_1lib in $LIBS
7494 do
7495         for cf_add_2lib in $cf_add_libs
7496         do
7497                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7498                 then
7499                         cf_add_1lib=
7500                         break
7501                 fi
7502         done
7503         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7504 done
7505 LIBS="$cf_add_libs"
7506
7507 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
7508 then
7509
7510 cf_add_libs="-l$cf_nculib_root"
7511 # Filter out duplicates - this happens with badly-designed ".pc" files...
7512 for cf_add_1lib in $LIBS
7513 do
7514         for cf_add_2lib in $cf_add_libs
7515         do
7516                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7517                 then
7518                         cf_add_1lib=
7519                         break
7520                 fi
7521         done
7522         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7523 done
7524 LIBS="$cf_add_libs"
7525
7526 else
7527
7528         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
7529         cf_libdir=""
7530         echo "$as_me:7530: checking for initscr" >&5
7531 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
7532 if test "${ac_cv_func_initscr+set}" = set; then
7533   echo $ECHO_N "(cached) $ECHO_C" >&6
7534 else
7535   cat >conftest.$ac_ext <<_ACEOF
7536 #line 7536 "configure"
7537 #include "confdefs.h"
7538 /* System header to define __stub macros and hopefully few prototypes,
7539     which can conflict with char initscr (); below.  */
7540 #include <assert.h>
7541 /* Override any gcc2 internal prototype to avoid an error.  */
7542 #ifdef __cplusplus
7543 extern "C"
7544 #endif
7545 /* We use char because int might match the return type of a gcc2
7546    builtin and then its argument prototype would still apply.  */
7547 char initscr ();
7548 char (*f) ();
7549
7550 int
7551 main ()
7552 {
7553 /* The GNU C library defines this for functions which it implements
7554     to always fail with ENOSYS.  Some functions are actually named
7555     something starting with __ and the normal name is an alias.  */
7556 #if defined (__stub_initscr) || defined (__stub___initscr)
7557 choke me
7558 #else
7559 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
7560 #endif
7561
7562   ;
7563   return 0;
7564 }
7565 _ACEOF
7566 rm -f conftest.$ac_objext conftest$ac_exeext
7567 if { (eval echo "$as_me:7567: \"$ac_link\"") >&5
7568   (eval $ac_link) 2>&5
7569   ac_status=$?
7570   echo "$as_me:7570: \$? = $ac_status" >&5
7571   (exit $ac_status); } &&
7572          { ac_try='test -s conftest$ac_exeext'
7573   { (eval echo "$as_me:7573: \"$ac_try\"") >&5
7574   (eval $ac_try) 2>&5
7575   ac_status=$?
7576   echo "$as_me:7576: \$? = $ac_status" >&5
7577   (exit $ac_status); }; }; then
7578   ac_cv_func_initscr=yes
7579 else
7580   echo "$as_me: failed program was:" >&5
7581 cat conftest.$ac_ext >&5
7582 ac_cv_func_initscr=no
7583 fi
7584 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7585 fi
7586 echo "$as_me:7586: result: $ac_cv_func_initscr" >&5
7587 echo "${ECHO_T}$ac_cv_func_initscr" >&6
7588 if test $ac_cv_func_initscr = yes; then
7589   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
7590 else
7591
7592                 cf_save_LIBS="$LIBS"
7593                 echo "$as_me:7593: checking for initscr in -l$cf_nculib_root" >&5
7594 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
7595                 LIBS="-l$cf_nculib_root $LIBS"
7596                 cat >conftest.$ac_ext <<_ACEOF
7597 #line 7597 "configure"
7598 #include "confdefs.h"
7599 #include <${cf_cv_ncurses_header:-curses.h}>
7600 int
7601 main ()
7602 {
7603 initscr()
7604   ;
7605   return 0;
7606 }
7607 _ACEOF
7608 rm -f conftest.$ac_objext conftest$ac_exeext
7609 if { (eval echo "$as_me:7609: \"$ac_link\"") >&5
7610   (eval $ac_link) 2>&5
7611   ac_status=$?
7612   echo "$as_me:7612: \$? = $ac_status" >&5
7613   (exit $ac_status); } &&
7614          { ac_try='test -s conftest$ac_exeext'
7615   { (eval echo "$as_me:7615: \"$ac_try\"") >&5
7616   (eval $ac_try) 2>&5
7617   ac_status=$?
7618   echo "$as_me:7618: \$? = $ac_status" >&5
7619   (exit $ac_status); }; }; then
7620   echo "$as_me:7620: result: yes" >&5
7621 echo "${ECHO_T}yes" >&6
7622                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
7623
7624 else
7625   echo "$as_me: failed program was:" >&5
7626 cat conftest.$ac_ext >&5
7627 echo "$as_me:7627: result: no" >&5
7628 echo "${ECHO_T}no" >&6
7629
7630 cf_search=
7631 cf_library_path_list=""
7632 if test -n "${LDFLAGS}${LIBS}" ; then
7633         for cf_library_path in $LDFLAGS $LIBS
7634         do
7635                 case $cf_library_path in
7636                 (-L*)
7637                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
7638
7639 test "x$cf_library_path" != "xNONE" && \
7640 test -d "$cf_library_path" && \
7641  {
7642         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
7643         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
7644         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
7645         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
7646         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
7647         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"
7648 }
7649
7650                         cf_library_path_list="$cf_library_path_list $cf_search"
7651                         ;;
7652                 esac
7653         done
7654 fi
7655
7656 cf_search=
7657
7658 test "x$prefix" != "xNONE" && \
7659 test -d "$prefix" && \
7660  {
7661         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
7662         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
7663         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
7664         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
7665         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
7666         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
7667 }
7668
7669 for cf_subdir_prefix in \
7670         /usr \
7671         /usr/local \
7672         /usr/pkg \
7673         /opt \
7674         /opt/local \
7675         $HOME
7676 do
7677
7678 test "x$cf_subdir_prefix" != "x$prefix" && \
7679 test -d "$cf_subdir_prefix" && \
7680 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
7681         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
7682         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
7683         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
7684         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
7685         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
7686         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"
7687 }
7688
7689 done
7690
7691 cf_search="$cf_library_path_list $cf_search"
7692
7693                         for cf_libdir in $cf_search
7694                         do
7695                                 echo "$as_me:7695: checking for -l$cf_nculib_root in $cf_libdir" >&5
7696 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
7697                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
7698                                 cat >conftest.$ac_ext <<_ACEOF
7699 #line 7699 "configure"
7700 #include "confdefs.h"
7701 #include <${cf_cv_ncurses_header:-curses.h}>
7702 int
7703 main ()
7704 {
7705 initscr()
7706   ;
7707   return 0;
7708 }
7709 _ACEOF
7710 rm -f conftest.$ac_objext conftest$ac_exeext
7711 if { (eval echo "$as_me:7711: \"$ac_link\"") >&5
7712   (eval $ac_link) 2>&5
7713   ac_status=$?
7714   echo "$as_me:7714: \$? = $ac_status" >&5
7715   (exit $ac_status); } &&
7716          { ac_try='test -s conftest$ac_exeext'
7717   { (eval echo "$as_me:7717: \"$ac_try\"") >&5
7718   (eval $ac_try) 2>&5
7719   ac_status=$?
7720   echo "$as_me:7720: \$? = $ac_status" >&5
7721   (exit $ac_status); }; }; then
7722   echo "$as_me:7722: result: yes" >&5
7723 echo "${ECHO_T}yes" >&6
7724                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
7725                                          break
7726 else
7727   echo "$as_me: failed program was:" >&5
7728 cat conftest.$ac_ext >&5
7729 echo "$as_me:7729: result: no" >&5
7730 echo "${ECHO_T}no" >&6
7731                                          LIBS="$cf_save_LIBS"
7732 fi
7733 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7734                         done
7735
7736 fi
7737 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7738
7739 fi
7740
7741 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
7742
7743 if test $cf_found_library = no ; then
7744         { { echo "$as_me:7744: error: Cannot link $cf_nculib_root library" >&5
7745 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
7746    { (exit 1); exit 1; }; }
7747 fi
7748
7749 fi
7750
7751 if test -n "$cf_ncurses_LIBS" ; then
7752         echo "$as_me:7752: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
7753 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
7754         cf_ncurses_SAVE="$LIBS"
7755         for p in $cf_ncurses_LIBS ; do
7756                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
7757                 if test "$q" != "$LIBS" ; then
7758                         LIBS="$q"
7759                 fi
7760         done
7761         cat >conftest.$ac_ext <<_ACEOF
7762 #line 7762 "configure"
7763 #include "confdefs.h"
7764 #include <${cf_cv_ncurses_header:-curses.h}>
7765 int
7766 main ()
7767 {
7768 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
7769   ;
7770   return 0;
7771 }
7772 _ACEOF
7773 rm -f conftest.$ac_objext conftest$ac_exeext
7774 if { (eval echo "$as_me:7774: \"$ac_link\"") >&5
7775   (eval $ac_link) 2>&5
7776   ac_status=$?
7777   echo "$as_me:7777: \$? = $ac_status" >&5
7778   (exit $ac_status); } &&
7779          { ac_try='test -s conftest$ac_exeext'
7780   { (eval echo "$as_me:7780: \"$ac_try\"") >&5
7781   (eval $ac_try) 2>&5
7782   ac_status=$?
7783   echo "$as_me:7783: \$? = $ac_status" >&5
7784   (exit $ac_status); }; }; then
7785   echo "$as_me:7785: result: yes" >&5
7786 echo "${ECHO_T}yes" >&6
7787 else
7788   echo "$as_me: failed program was:" >&5
7789 cat conftest.$ac_ext >&5
7790 echo "$as_me:7790: result: no" >&5
7791 echo "${ECHO_T}no" >&6
7792                  LIBS="$cf_ncurses_SAVE"
7793 fi
7794 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7795 fi
7796
7797 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
7798
7799 cat >>confdefs.h <<EOF
7800 #define $cf_nculib_ROOT 1
7801 EOF
7802
7803         fi
7804 else
7805         NCURSES_CONFIG=none
7806 fi
7807
7808         ;;
7809 (ncurses*)
7810
7811 cf_ncuconfig_root=$cf_cv_screen
7812 cf_have_ncuconfig=no
7813
7814 if test "x${PKG_CONFIG:=none}" != xnone; then
7815         echo "$as_me:7815: checking pkg-config for $cf_ncuconfig_root" >&5
7816 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
7817         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
7818                 echo "$as_me:7818: result: yes" >&5
7819 echo "${ECHO_T}yes" >&6
7820
7821                 echo "$as_me:7821: checking if the $cf_ncuconfig_root package files work" >&5
7822 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
7823                 cf_have_ncuconfig=unknown
7824
7825                 cf_save_CPPFLAGS="$CPPFLAGS"
7826                 cf_save_LIBS="$LIBS"
7827
7828                 CPPFLAGS="$CPPFLAGS `$PKG_CONFIG --cflags $cf_ncuconfig_root`"
7829
7830 cf_add_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
7831 # Filter out duplicates - this happens with badly-designed ".pc" files...
7832 for cf_add_1lib in $LIBS
7833 do
7834         for cf_add_2lib in $cf_add_libs
7835         do
7836                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7837                 then
7838                         cf_add_1lib=
7839                         break
7840                 fi
7841         done
7842         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7843 done
7844 LIBS="$cf_add_libs"
7845
7846                 cat >conftest.$ac_ext <<_ACEOF
7847 #line 7847 "configure"
7848 #include "confdefs.h"
7849 #include <${cf_cv_ncurses_header:-curses.h}>
7850 int
7851 main ()
7852 {
7853 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
7854   ;
7855   return 0;
7856 }
7857 _ACEOF
7858 rm -f conftest.$ac_objext conftest$ac_exeext
7859 if { (eval echo "$as_me:7859: \"$ac_link\"") >&5
7860   (eval $ac_link) 2>&5
7861   ac_status=$?
7862   echo "$as_me:7862: \$? = $ac_status" >&5
7863   (exit $ac_status); } &&
7864          { ac_try='test -s conftest$ac_exeext'
7865   { (eval echo "$as_me:7865: \"$ac_try\"") >&5
7866   (eval $ac_try) 2>&5
7867   ac_status=$?
7868   echo "$as_me:7868: \$? = $ac_status" >&5
7869   (exit $ac_status); }; }; then
7870   if test "$cross_compiling" = yes; then
7871   cf_have_ncuconfig=maybe
7872 else
7873   cat >conftest.$ac_ext <<_ACEOF
7874 #line 7874 "configure"
7875 #include "confdefs.h"
7876 #include <${cf_cv_ncurses_header:-curses.h}>
7877                                 int main(void)
7878                                 { char *xx = curses_version(); return (xx == 0); }
7879 _ACEOF
7880 rm -f conftest$ac_exeext
7881 if { (eval echo "$as_me:7881: \"$ac_link\"") >&5
7882   (eval $ac_link) 2>&5
7883   ac_status=$?
7884   echo "$as_me:7884: \$? = $ac_status" >&5
7885   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
7886   { (eval echo "$as_me:7886: \"$ac_try\"") >&5
7887   (eval $ac_try) 2>&5
7888   ac_status=$?
7889   echo "$as_me:7889: \$? = $ac_status" >&5
7890   (exit $ac_status); }; }; then
7891   cf_have_ncuconfig=yes
7892 else
7893   echo "$as_me: program exited with status $ac_status" >&5
7894 echo "$as_me: failed program was:" >&5
7895 cat conftest.$ac_ext >&5
7896 cf_have_ncuconfig=no
7897 fi
7898 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
7899 fi
7900 else
7901   echo "$as_me: failed program was:" >&5
7902 cat conftest.$ac_ext >&5
7903 cf_have_ncuconfig=no
7904 fi
7905 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7906                 echo "$as_me:7906: result: $cf_have_ncuconfig" >&5
7907 echo "${ECHO_T}$cf_have_ncuconfig" >&6
7908                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
7909                 if test "$cf_have_ncuconfig" != "yes"
7910                 then
7911                         CPPFLAGS="$cf_save_CPPFLAGS"
7912                         LIBS="$cf_save_LIBS"
7913                         NCURSES_CONFIG_PKG=none
7914                 else
7915
7916 cat >>confdefs.h <<\EOF
7917 #define NCURSES 1
7918 EOF
7919
7920                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
7921                 fi
7922
7923         else
7924                 echo "$as_me:7924: result: no" >&5
7925 echo "${ECHO_T}no" >&6
7926                 NCURSES_CONFIG_PKG=none
7927         fi
7928 else
7929         NCURSES_CONFIG_PKG=none
7930 fi
7931
7932 if test "x$cf_have_ncuconfig" = "xno"; then
7933         echo "Looking for ${cf_ncuconfig_root}-config"
7934
7935 if test -n "$ac_tool_prefix"; then
7936   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7937   do
7938     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
7939 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
7940 echo "$as_me:7940: checking for $ac_word" >&5
7941 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7942 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
7943   echo $ECHO_N "(cached) $ECHO_C" >&6
7944 else
7945   if test -n "$NCURSES_CONFIG"; then
7946   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
7947 else
7948   ac_save_IFS=$IFS; IFS=$ac_path_separator
7949 ac_dummy="$PATH"
7950 for ac_dir in $ac_dummy; do
7951   IFS=$ac_save_IFS
7952   test -z "$ac_dir" && ac_dir=.
7953   $as_executable_p "$ac_dir/$ac_word" || continue
7954 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
7955 echo "$as_me:7955: found $ac_dir/$ac_word" >&5
7956 break
7957 done
7958
7959 fi
7960 fi
7961 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
7962 if test -n "$NCURSES_CONFIG"; then
7963   echo "$as_me:7963: result: $NCURSES_CONFIG" >&5
7964 echo "${ECHO_T}$NCURSES_CONFIG" >&6
7965 else
7966   echo "$as_me:7966: result: no" >&5
7967 echo "${ECHO_T}no" >&6
7968 fi
7969
7970     test -n "$NCURSES_CONFIG" && break
7971   done
7972 fi
7973 if test -z "$NCURSES_CONFIG"; then
7974   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
7975   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7976 do
7977   # Extract the first word of "$ac_prog", so it can be a program name with args.
7978 set dummy $ac_prog; ac_word=$2
7979 echo "$as_me:7979: checking for $ac_word" >&5
7980 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7981 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
7982   echo $ECHO_N "(cached) $ECHO_C" >&6
7983 else
7984   if test -n "$ac_ct_NCURSES_CONFIG"; then
7985   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
7986 else
7987   ac_save_IFS=$IFS; IFS=$ac_path_separator
7988 ac_dummy="$PATH"
7989 for ac_dir in $ac_dummy; do
7990   IFS=$ac_save_IFS
7991   test -z "$ac_dir" && ac_dir=.
7992   $as_executable_p "$ac_dir/$ac_word" || continue
7993 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
7994 echo "$as_me:7994: found $ac_dir/$ac_word" >&5
7995 break
7996 done
7997
7998 fi
7999 fi
8000 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
8001 if test -n "$ac_ct_NCURSES_CONFIG"; then
8002   echo "$as_me:8002: result: $ac_ct_NCURSES_CONFIG" >&5
8003 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
8004 else
8005   echo "$as_me:8005: result: no" >&5
8006 echo "${ECHO_T}no" >&6
8007 fi
8008
8009   test -n "$ac_ct_NCURSES_CONFIG" && break
8010 done
8011 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
8012
8013   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
8014 fi
8015
8016         if test "$NCURSES_CONFIG" != none ; then
8017
8018                 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
8019
8020 cf_add_libs="`$NCURSES_CONFIG --libs`"
8021 # Filter out duplicates - this happens with badly-designed ".pc" files...
8022 for cf_add_1lib in $LIBS
8023 do
8024         for cf_add_2lib in $cf_add_libs
8025         do
8026                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
8027                 then
8028                         cf_add_1lib=
8029                         break
8030                 fi
8031         done
8032         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
8033 done
8034 LIBS="$cf_add_libs"
8035
8036                 # even with config script, some packages use no-override for curses.h
8037
8038 echo "$as_me:8038: checking if we have identified curses headers" >&5
8039 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
8040 if test "${cf_cv_ncurses_header+set}" = set; then
8041   echo $ECHO_N "(cached) $ECHO_C" >&6
8042 else
8043
8044 cf_cv_ncurses_header=none
8045 for cf_header in \
8046         ncurses.h $cf_cv_screen/ncurses.h \
8047         curses.h $cf_cv_screen/curses.h
8048 do
8049 cat >conftest.$ac_ext <<_ACEOF
8050 #line 8050 "configure"
8051 #include "confdefs.h"
8052 #include <${cf_header}>
8053 int
8054 main ()
8055 {
8056 initscr(); tgoto("?", 0,0)
8057   ;
8058   return 0;
8059 }
8060 _ACEOF
8061 rm -f conftest.$ac_objext
8062 if { (eval echo "$as_me:8062: \"$ac_compile\"") >&5
8063   (eval $ac_compile) 2>&5
8064   ac_status=$?
8065   echo "$as_me:8065: \$? = $ac_status" >&5
8066   (exit $ac_status); } &&
8067          { ac_try='test -s conftest.$ac_objext'
8068   { (eval echo "$as_me:8068: \"$ac_try\"") >&5
8069   (eval $ac_try) 2>&5
8070   ac_status=$?
8071   echo "$as_me:8071: \$? = $ac_status" >&5
8072   (exit $ac_status); }; }; then
8073   cf_cv_ncurses_header=$cf_header; break
8074 else
8075   echo "$as_me: failed program was:" >&5
8076 cat conftest.$ac_ext >&5
8077 fi
8078 rm -f conftest.$ac_objext conftest.$ac_ext
8079 done
8080
8081 fi
8082 echo "$as_me:8082: result: $cf_cv_ncurses_header" >&5
8083 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
8084
8085 if test "$cf_cv_ncurses_header" = none ; then
8086         { { echo "$as_me:8086: error: No curses header-files found" >&5
8087 echo "$as_me: error: No curses header-files found" >&2;}
8088    { (exit 1); exit 1; }; }
8089 fi
8090
8091 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
8092
8093 for ac_header in $cf_cv_ncurses_header
8094 do
8095 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
8096 echo "$as_me:8096: checking for $ac_header" >&5
8097 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
8098 if eval "test \"\${$as_ac_Header+set}\" = set"; then
8099   echo $ECHO_N "(cached) $ECHO_C" >&6
8100 else
8101   cat >conftest.$ac_ext <<_ACEOF
8102 #line 8102 "configure"
8103 #include "confdefs.h"
8104 #include <$ac_header>
8105 _ACEOF
8106 if { (eval echo "$as_me:8106: \"$ac_cpp conftest.$ac_ext\"") >&5
8107   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
8108   ac_status=$?
8109   egrep -v '^ *\+' conftest.er1 >conftest.err
8110   rm -f conftest.er1
8111   cat conftest.err >&5
8112   echo "$as_me:8112: \$? = $ac_status" >&5
8113   (exit $ac_status); } >/dev/null; then
8114   if test -s conftest.err; then
8115     ac_cpp_err=$ac_c_preproc_warn_flag
8116   else
8117     ac_cpp_err=
8118   fi
8119 else
8120   ac_cpp_err=yes
8121 fi
8122 if test -z "$ac_cpp_err"; then
8123   eval "$as_ac_Header=yes"
8124 else
8125   echo "$as_me: failed program was:" >&5
8126   cat conftest.$ac_ext >&5
8127   eval "$as_ac_Header=no"
8128 fi
8129 rm -f conftest.err conftest.$ac_ext
8130 fi
8131 echo "$as_me:8131: result: `eval echo '${'$as_ac_Header'}'`" >&5
8132 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
8133 if test `eval echo '${'$as_ac_Header'}'` = yes; then
8134   cat >>confdefs.h <<EOF
8135 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
8136 EOF
8137
8138 fi
8139 done
8140
8141 cat >>confdefs.h <<\EOF
8142 #define NCURSES 1
8143 EOF
8144
8145 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
8146
8147                 cat >>confdefs.h <<EOF
8148 #define $cf_nculib_ROOT 1
8149 EOF
8150
8151                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
8152
8153         else
8154
8155 cf_ncuhdr_root=$cf_cv_screen
8156
8157 test -n "$cf_cv_curses_dir" && \
8158 test "$cf_cv_curses_dir" != "no" && { \
8159
8160 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
8161   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
8162   do
8163         while test $cf_add_incdir != /usr/include
8164         do
8165           if test -d $cf_add_incdir
8166           then
8167                 cf_have_incdir=no
8168                 if test -n "$CFLAGS$CPPFLAGS" ; then
8169                   # a loop is needed to ensure we can add subdirs of existing dirs
8170                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8171                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8172                           cf_have_incdir=yes; break
8173                         fi
8174                   done
8175                 fi
8176
8177                 if test "$cf_have_incdir" = no ; then
8178                   if test "$cf_add_incdir" = /usr/local/include ; then
8179                         if test "$GCC" = yes
8180                         then
8181                           cf_save_CPPFLAGS=$CPPFLAGS
8182                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8183                           cat >conftest.$ac_ext <<_ACEOF
8184 #line 8184 "configure"
8185 #include "confdefs.h"
8186 #include <stdio.h>
8187 int
8188 main ()
8189 {
8190 printf("Hello")
8191   ;
8192   return 0;
8193 }
8194 _ACEOF
8195 rm -f conftest.$ac_objext
8196 if { (eval echo "$as_me:8196: \"$ac_compile\"") >&5
8197   (eval $ac_compile) 2>&5
8198   ac_status=$?
8199   echo "$as_me:8199: \$? = $ac_status" >&5
8200   (exit $ac_status); } &&
8201          { ac_try='test -s conftest.$ac_objext'
8202   { (eval echo "$as_me:8202: \"$ac_try\"") >&5
8203   (eval $ac_try) 2>&5
8204   ac_status=$?
8205   echo "$as_me:8205: \$? = $ac_status" >&5
8206   (exit $ac_status); }; }; then
8207   :
8208 else
8209   echo "$as_me: failed program was:" >&5
8210 cat conftest.$ac_ext >&5
8211 cf_have_incdir=yes
8212 fi
8213 rm -f conftest.$ac_objext conftest.$ac_ext
8214                           CPPFLAGS=$cf_save_CPPFLAGS
8215                         fi
8216                   fi
8217                 fi
8218
8219                 if test "$cf_have_incdir" = no ; then
8220                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8221
8222 echo "${as_me:-configure}:8222: testing adding $cf_add_incdir to include-path ..." 1>&5
8223
8224                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8225
8226                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8227                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8228                   cf_add_incdir="$cf_top_incdir"
8229                 else
8230                   break
8231                 fi
8232           else
8233                 break
8234           fi
8235         done
8236   done
8237 fi
8238
8239 }
8240
8241 echo "$as_me:8241: checking for $cf_ncuhdr_root header in include-path" >&5
8242 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
8243 if test "${cf_cv_ncurses_h+set}" = set; then
8244   echo $ECHO_N "(cached) $ECHO_C" >&6
8245 else
8246
8247         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
8248         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
8249         for cf_header in $cf_header_list
8250         do
8251
8252         cat >conftest.$ac_ext <<_ACEOF
8253 #line 8253 "configure"
8254 #include "confdefs.h"
8255
8256 #include <$cf_header>
8257 int
8258 main ()
8259 {
8260
8261 #ifdef NCURSES_VERSION
8262
8263 printf("%s\n", NCURSES_VERSION);
8264 #else
8265 #ifdef __NCURSES_H
8266 printf("old\n");
8267 #else
8268         make an error
8269 #endif
8270 #endif
8271
8272   ;
8273   return 0;
8274 }
8275 _ACEOF
8276 rm -f conftest.$ac_objext
8277 if { (eval echo "$as_me:8277: \"$ac_compile\"") >&5
8278   (eval $ac_compile) 2>&5
8279   ac_status=$?
8280   echo "$as_me:8280: \$? = $ac_status" >&5
8281   (exit $ac_status); } &&
8282          { ac_try='test -s conftest.$ac_objext'
8283   { (eval echo "$as_me:8283: \"$ac_try\"") >&5
8284   (eval $ac_try) 2>&5
8285   ac_status=$?
8286   echo "$as_me:8286: \$? = $ac_status" >&5
8287   (exit $ac_status); }; }; then
8288   cf_cv_ncurses_h=$cf_header
8289
8290 else
8291   echo "$as_me: failed program was:" >&5
8292 cat conftest.$ac_ext >&5
8293 cf_cv_ncurses_h=no
8294 fi
8295 rm -f conftest.$ac_objext conftest.$ac_ext
8296
8297                 test "$cf_cv_ncurses_h" != no && break
8298         done
8299
8300 fi
8301 echo "$as_me:8301: result: $cf_cv_ncurses_h" >&5
8302 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
8303
8304 if test "$cf_cv_ncurses_h" != no ; then
8305         cf_cv_ncurses_header=$cf_cv_ncurses_h
8306 else
8307
8308 echo "$as_me:8308: checking for $cf_ncuhdr_root include-path" >&5
8309 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
8310 if test "${cf_cv_ncurses_h2+set}" = set; then
8311   echo $ECHO_N "(cached) $ECHO_C" >&6
8312 else
8313
8314         test -n "$verbose" && echo
8315
8316 cf_search=
8317
8318 # collect the current set of include-directories from compiler flags
8319 cf_header_path_list=""
8320 if test -n "${CFLAGS}${CPPFLAGS}" ; then
8321         for cf_header_path in $CPPFLAGS $CFLAGS
8322         do
8323                 case $cf_header_path in
8324                 (-I*)
8325                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
8326
8327 test "x$cf_header_path" != "xNONE" && \
8328 test -d "$cf_header_path" && \
8329  {
8330         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
8331         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
8332         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
8333         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
8334         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
8335         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"
8336 }
8337
8338                         cf_header_path_list="$cf_header_path_list $cf_search"
8339                         ;;
8340                 esac
8341         done
8342 fi
8343
8344 # add the variations for the package we are looking for
8345
8346 cf_search=
8347
8348 test "x$prefix" != "xNONE" && \
8349 test -d "$prefix" && \
8350  {
8351         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
8352         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
8353         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
8354         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
8355         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
8356         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8357 }
8358
8359 for cf_subdir_prefix in \
8360         /usr \
8361         /usr/local \
8362         /usr/pkg \
8363         /opt \
8364         /opt/local \
8365         $HOME
8366 do
8367
8368 test "x$cf_subdir_prefix" != "x$prefix" && \
8369 test -d "$cf_subdir_prefix" && \
8370 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
8371         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
8372         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
8373         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
8374         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
8375         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
8376         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"
8377 }
8378
8379 done
8380
8381 test "$includedir" != NONE && \
8382 test "$includedir" != "/usr/include" && \
8383 test -d "$includedir" && {
8384         test -d $includedir &&    cf_search="$cf_search $includedir"
8385         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
8386 }
8387
8388 test "$oldincludedir" != NONE && \
8389 test "$oldincludedir" != "/usr/include" && \
8390 test -d "$oldincludedir" && {
8391         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
8392         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
8393 }
8394
8395 cf_search="$cf_search $cf_header_path_list"
8396
8397         test -n "$verbose" && echo search path $cf_search
8398         cf_save2_CPPFLAGS="$CPPFLAGS"
8399         for cf_incdir in $cf_search
8400         do
8401
8402 if test -n "$cf_incdir" ; then
8403   for cf_add_incdir in $cf_incdir
8404   do
8405         while test $cf_add_incdir != /usr/include
8406         do
8407           if test -d $cf_add_incdir
8408           then
8409                 cf_have_incdir=no
8410                 if test -n "$CFLAGS$CPPFLAGS" ; then
8411                   # a loop is needed to ensure we can add subdirs of existing dirs
8412                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8413                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8414                           cf_have_incdir=yes; break
8415                         fi
8416                   done
8417                 fi
8418
8419                 if test "$cf_have_incdir" = no ; then
8420                   if test "$cf_add_incdir" = /usr/local/include ; then
8421                         if test "$GCC" = yes
8422                         then
8423                           cf_save_CPPFLAGS=$CPPFLAGS
8424                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8425                           cat >conftest.$ac_ext <<_ACEOF
8426 #line 8426 "configure"
8427 #include "confdefs.h"
8428 #include <stdio.h>
8429 int
8430 main ()
8431 {
8432 printf("Hello")
8433   ;
8434   return 0;
8435 }
8436 _ACEOF
8437 rm -f conftest.$ac_objext
8438 if { (eval echo "$as_me:8438: \"$ac_compile\"") >&5
8439   (eval $ac_compile) 2>&5
8440   ac_status=$?
8441   echo "$as_me:8441: \$? = $ac_status" >&5
8442   (exit $ac_status); } &&
8443          { ac_try='test -s conftest.$ac_objext'
8444   { (eval echo "$as_me:8444: \"$ac_try\"") >&5
8445   (eval $ac_try) 2>&5
8446   ac_status=$?
8447   echo "$as_me:8447: \$? = $ac_status" >&5
8448   (exit $ac_status); }; }; then
8449   :
8450 else
8451   echo "$as_me: failed program was:" >&5
8452 cat conftest.$ac_ext >&5
8453 cf_have_incdir=yes
8454 fi
8455 rm -f conftest.$ac_objext conftest.$ac_ext
8456                           CPPFLAGS=$cf_save_CPPFLAGS
8457                         fi
8458                   fi
8459                 fi
8460
8461                 if test "$cf_have_incdir" = no ; then
8462                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8463
8464 echo "${as_me:-configure}:8464: testing adding $cf_add_incdir to include-path ..." 1>&5
8465
8466                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8467
8468                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8469                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8470                   cf_add_incdir="$cf_top_incdir"
8471                 else
8472                   break
8473                 fi
8474           else
8475                 break
8476           fi
8477         done
8478   done
8479 fi
8480
8481                 for cf_header in \
8482                         ncurses.h \
8483                         curses.h
8484                 do
8485
8486         cat >conftest.$ac_ext <<_ACEOF
8487 #line 8487 "configure"
8488 #include "confdefs.h"
8489
8490 #include <$cf_header>
8491 int
8492 main ()
8493 {
8494
8495 #ifdef NCURSES_VERSION
8496
8497 printf("%s\n", NCURSES_VERSION);
8498 #else
8499 #ifdef __NCURSES_H
8500 printf("old\n");
8501 #else
8502         make an error
8503 #endif
8504 #endif
8505
8506   ;
8507   return 0;
8508 }
8509 _ACEOF
8510 rm -f conftest.$ac_objext
8511 if { (eval echo "$as_me:8511: \"$ac_compile\"") >&5
8512   (eval $ac_compile) 2>&5
8513   ac_status=$?
8514   echo "$as_me:8514: \$? = $ac_status" >&5
8515   (exit $ac_status); } &&
8516          { ac_try='test -s conftest.$ac_objext'
8517   { (eval echo "$as_me:8517: \"$ac_try\"") >&5
8518   (eval $ac_try) 2>&5
8519   ac_status=$?
8520   echo "$as_me:8520: \$? = $ac_status" >&5
8521   (exit $ac_status); }; }; then
8522   cf_cv_ncurses_h2=$cf_header
8523
8524 else
8525   echo "$as_me: failed program was:" >&5
8526 cat conftest.$ac_ext >&5
8527 cf_cv_ncurses_h2=no
8528 fi
8529 rm -f conftest.$ac_objext conftest.$ac_ext
8530
8531                         if test "$cf_cv_ncurses_h2" != no ; then
8532                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
8533                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
8534                                 break
8535                         fi
8536                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
8537                 done
8538                 CPPFLAGS="$cf_save2_CPPFLAGS"
8539                 test "$cf_cv_ncurses_h2" != no && break
8540         done
8541         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:8541: error: not found" >&5
8542 echo "$as_me: error: not found" >&2;}
8543    { (exit 1); exit 1; }; }
8544
8545 fi
8546 echo "$as_me:8546: result: $cf_cv_ncurses_h2" >&5
8547 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
8548
8549         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
8550         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
8551         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
8552                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
8553         fi
8554
8555 if test -n "$cf_1st_incdir" ; then
8556   for cf_add_incdir in $cf_1st_incdir
8557   do
8558         while test $cf_add_incdir != /usr/include
8559         do
8560           if test -d $cf_add_incdir
8561           then
8562                 cf_have_incdir=no
8563                 if test -n "$CFLAGS$CPPFLAGS" ; then
8564                   # a loop is needed to ensure we can add subdirs of existing dirs
8565                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8566                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8567                           cf_have_incdir=yes; break
8568                         fi
8569                   done
8570                 fi
8571
8572                 if test "$cf_have_incdir" = no ; then
8573                   if test "$cf_add_incdir" = /usr/local/include ; then
8574                         if test "$GCC" = yes
8575                         then
8576                           cf_save_CPPFLAGS=$CPPFLAGS
8577                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8578                           cat >conftest.$ac_ext <<_ACEOF
8579 #line 8579 "configure"
8580 #include "confdefs.h"
8581 #include <stdio.h>
8582 int
8583 main ()
8584 {
8585 printf("Hello")
8586   ;
8587   return 0;
8588 }
8589 _ACEOF
8590 rm -f conftest.$ac_objext
8591 if { (eval echo "$as_me:8591: \"$ac_compile\"") >&5
8592   (eval $ac_compile) 2>&5
8593   ac_status=$?
8594   echo "$as_me:8594: \$? = $ac_status" >&5
8595   (exit $ac_status); } &&
8596          { ac_try='test -s conftest.$ac_objext'
8597   { (eval echo "$as_me:8597: \"$ac_try\"") >&5
8598   (eval $ac_try) 2>&5
8599   ac_status=$?
8600   echo "$as_me:8600: \$? = $ac_status" >&5
8601   (exit $ac_status); }; }; then
8602   :
8603 else
8604   echo "$as_me: failed program was:" >&5
8605 cat conftest.$ac_ext >&5
8606 cf_have_incdir=yes
8607 fi
8608 rm -f conftest.$ac_objext conftest.$ac_ext
8609                           CPPFLAGS=$cf_save_CPPFLAGS
8610                         fi
8611                   fi
8612                 fi
8613
8614                 if test "$cf_have_incdir" = no ; then
8615                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8616
8617 echo "${as_me:-configure}:8617: testing adding $cf_add_incdir to include-path ..." 1>&5
8618
8619                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8620
8621                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8622                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8623                   cf_add_incdir="$cf_top_incdir"
8624                 else
8625                   break
8626                 fi
8627           else
8628                 break
8629           fi
8630         done
8631   done
8632 fi
8633
8634 fi
8635
8636 # Set definitions to allow ifdef'ing for ncurses.h
8637
8638 case $cf_cv_ncurses_header in
8639 (*ncurses.h)
8640
8641 cat >>confdefs.h <<\EOF
8642 #define HAVE_NCURSES_H 1
8643 EOF
8644
8645         ;;
8646 esac
8647
8648 case $cf_cv_ncurses_header in
8649 (ncurses/curses.h|ncurses/ncurses.h)
8650
8651 cat >>confdefs.h <<\EOF
8652 #define HAVE_NCURSES_NCURSES_H 1
8653 EOF
8654
8655         ;;
8656 (ncursesw/curses.h|ncursesw/ncurses.h)
8657
8658 cat >>confdefs.h <<\EOF
8659 #define HAVE_NCURSESW_NCURSES_H 1
8660 EOF
8661
8662         ;;
8663 esac
8664
8665 echo "$as_me:8665: checking for terminfo header" >&5
8666 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
8667 if test "${cf_cv_term_header+set}" = set; then
8668   echo $ECHO_N "(cached) $ECHO_C" >&6
8669 else
8670
8671 case ${cf_cv_ncurses_header} in
8672 (*/ncurses.h|*/ncursesw.h)
8673         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
8674         ;;
8675 (*)
8676         cf_term_header=term.h
8677         ;;
8678 esac
8679
8680 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
8681 do
8682 cat >conftest.$ac_ext <<_ACEOF
8683 #line 8683 "configure"
8684 #include "confdefs.h"
8685 #include <stdio.h>
8686 #include <${cf_cv_ncurses_header:-curses.h}>
8687 #include <$cf_test>
8688
8689 int
8690 main ()
8691 {
8692 int x = auto_left_margin
8693   ;
8694   return 0;
8695 }
8696 _ACEOF
8697 rm -f conftest.$ac_objext
8698 if { (eval echo "$as_me:8698: \"$ac_compile\"") >&5
8699   (eval $ac_compile) 2>&5
8700   ac_status=$?
8701   echo "$as_me:8701: \$? = $ac_status" >&5
8702   (exit $ac_status); } &&
8703          { ac_try='test -s conftest.$ac_objext'
8704   { (eval echo "$as_me:8704: \"$ac_try\"") >&5
8705   (eval $ac_try) 2>&5
8706   ac_status=$?
8707   echo "$as_me:8707: \$? = $ac_status" >&5
8708   (exit $ac_status); }; }; then
8709
8710         cf_cv_term_header="$cf_test"
8711 else
8712   echo "$as_me: failed program was:" >&5
8713 cat conftest.$ac_ext >&5
8714
8715         cf_cv_term_header=unknown
8716
8717 fi
8718 rm -f conftest.$ac_objext conftest.$ac_ext
8719         test "$cf_cv_term_header" != unknown && break
8720 done
8721
8722 fi
8723 echo "$as_me:8723: result: $cf_cv_term_header" >&5
8724 echo "${ECHO_T}$cf_cv_term_header" >&6
8725
8726 # Set definitions to allow ifdef'ing to accommodate subdirectories
8727
8728 case $cf_cv_term_header in
8729 (*term.h)
8730
8731 cat >>confdefs.h <<\EOF
8732 #define HAVE_TERM_H 1
8733 EOF
8734
8735         ;;
8736 esac
8737
8738 case $cf_cv_term_header in
8739 (ncurses/term.h)
8740
8741 cat >>confdefs.h <<\EOF
8742 #define HAVE_NCURSES_TERM_H 1
8743 EOF
8744
8745         ;;
8746 (ncursesw/term.h)
8747
8748 cat >>confdefs.h <<\EOF
8749 #define HAVE_NCURSESW_TERM_H 1
8750 EOF
8751
8752         ;;
8753 esac
8754
8755 # some applications need this, but should check for NCURSES_VERSION
8756
8757 cat >>confdefs.h <<\EOF
8758 #define NCURSES 1
8759 EOF
8760
8761 echo "$as_me:8761: checking for ncurses version" >&5
8762 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
8763 if test "${cf_cv_ncurses_version+set}" = set; then
8764   echo $ECHO_N "(cached) $ECHO_C" >&6
8765 else
8766
8767         cf_cv_ncurses_version=no
8768         cf_tempfile=out$$
8769         rm -f $cf_tempfile
8770         if test "$cross_compiling" = yes; then
8771
8772         # This will not work if the preprocessor splits the line after the
8773         # Autoconf token.  The 'unproto' program does that.
8774         cat > conftest.$ac_ext <<EOF
8775 #include <${cf_cv_ncurses_header:-curses.h}>
8776 #undef Autoconf
8777 #ifdef NCURSES_VERSION
8778 Autoconf NCURSES_VERSION
8779 #else
8780 #ifdef __NCURSES_H
8781 Autoconf "old"
8782 #endif
8783 ;
8784 #endif
8785 EOF
8786         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
8787         { (eval echo "$as_me:8787: \"$cf_try\"") >&5
8788   (eval $cf_try) 2>&5
8789   ac_status=$?
8790   echo "$as_me:8790: \$? = $ac_status" >&5
8791   (exit $ac_status); }
8792         if test -f conftest.out ; then
8793                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
8794                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
8795                 rm -f conftest.out
8796         fi
8797
8798 else
8799   cat >conftest.$ac_ext <<_ACEOF
8800 #line 8800 "configure"
8801 #include "confdefs.h"
8802
8803 #include <${cf_cv_ncurses_header:-curses.h}>
8804 #include <stdio.h>
8805 int main()
8806 {
8807         FILE *fp = fopen("$cf_tempfile", "w");
8808 #ifdef NCURSES_VERSION
8809 # ifdef NCURSES_VERSION_PATCH
8810         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
8811 # else
8812         fprintf(fp, "%s\n", NCURSES_VERSION);
8813 # endif
8814 #else
8815 # ifdef __NCURSES_H
8816         fprintf(fp, "old\n");
8817 # else
8818         make an error
8819 # endif
8820 #endif
8821         ${cf_cv_main_return:-return}(0);
8822 }
8823 _ACEOF
8824 rm -f conftest$ac_exeext
8825 if { (eval echo "$as_me:8825: \"$ac_link\"") >&5
8826   (eval $ac_link) 2>&5
8827   ac_status=$?
8828   echo "$as_me:8828: \$? = $ac_status" >&5
8829   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
8830   { (eval echo "$as_me:8830: \"$ac_try\"") >&5
8831   (eval $ac_try) 2>&5
8832   ac_status=$?
8833   echo "$as_me:8833: \$? = $ac_status" >&5
8834   (exit $ac_status); }; }; then
8835
8836         cf_cv_ncurses_version=`cat $cf_tempfile`
8837 else
8838   echo "$as_me: program exited with status $ac_status" >&5
8839 echo "$as_me: failed program was:" >&5
8840 cat conftest.$ac_ext >&5
8841 fi
8842 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
8843 fi
8844         rm -f $cf_tempfile
8845
8846 fi
8847 echo "$as_me:8847: result: $cf_cv_ncurses_version" >&5
8848 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
8849 test "$cf_cv_ncurses_version" = no ||
8850 cat >>confdefs.h <<\EOF
8851 #define NCURSES 1
8852 EOF
8853
8854 cf_nculib_root=$cf_cv_screen
8855         # This works, except for the special case where we find gpm, but
8856         # ncurses is in a nonstandard location via $LIBS, and we really want
8857         # to link gpm.
8858 cf_ncurses_LIBS=""
8859 cf_ncurses_SAVE="$LIBS"
8860 echo "$as_me:8860: checking for Gpm_Open in -lgpm" >&5
8861 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
8862 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
8863   echo $ECHO_N "(cached) $ECHO_C" >&6
8864 else
8865   ac_check_lib_save_LIBS=$LIBS
8866 LIBS="-lgpm  $LIBS"
8867 cat >conftest.$ac_ext <<_ACEOF
8868 #line 8868 "configure"
8869 #include "confdefs.h"
8870
8871 /* Override any gcc2 internal prototype to avoid an error.  */
8872 #ifdef __cplusplus
8873 extern "C"
8874 #endif
8875 /* We use char because int might match the return type of a gcc2
8876    builtin and then its argument prototype would still apply.  */
8877 char Gpm_Open ();
8878 int
8879 main ()
8880 {
8881 Gpm_Open ();
8882   ;
8883   return 0;
8884 }
8885 _ACEOF
8886 rm -f conftest.$ac_objext conftest$ac_exeext
8887 if { (eval echo "$as_me:8887: \"$ac_link\"") >&5
8888   (eval $ac_link) 2>&5
8889   ac_status=$?
8890   echo "$as_me:8890: \$? = $ac_status" >&5
8891   (exit $ac_status); } &&
8892          { ac_try='test -s conftest$ac_exeext'
8893   { (eval echo "$as_me:8893: \"$ac_try\"") >&5
8894   (eval $ac_try) 2>&5
8895   ac_status=$?
8896   echo "$as_me:8896: \$? = $ac_status" >&5
8897   (exit $ac_status); }; }; then
8898   ac_cv_lib_gpm_Gpm_Open=yes
8899 else
8900   echo "$as_me: failed program was:" >&5
8901 cat conftest.$ac_ext >&5
8902 ac_cv_lib_gpm_Gpm_Open=no
8903 fi
8904 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8905 LIBS=$ac_check_lib_save_LIBS
8906 fi
8907 echo "$as_me:8907: result: $ac_cv_lib_gpm_Gpm_Open" >&5
8908 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
8909 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
8910   echo "$as_me:8910: checking for initscr in -lgpm" >&5
8911 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
8912 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
8913   echo $ECHO_N "(cached) $ECHO_C" >&6
8914 else
8915   ac_check_lib_save_LIBS=$LIBS
8916 LIBS="-lgpm  $LIBS"
8917 cat >conftest.$ac_ext <<_ACEOF
8918 #line 8918 "configure"
8919 #include "confdefs.h"
8920
8921 /* Override any gcc2 internal prototype to avoid an error.  */
8922 #ifdef __cplusplus
8923 extern "C"
8924 #endif
8925 /* We use char because int might match the return type of a gcc2
8926    builtin and then its argument prototype would still apply.  */
8927 char initscr ();
8928 int
8929 main ()
8930 {
8931 initscr ();
8932   ;
8933   return 0;
8934 }
8935 _ACEOF
8936 rm -f conftest.$ac_objext conftest$ac_exeext
8937 if { (eval echo "$as_me:8937: \"$ac_link\"") >&5
8938   (eval $ac_link) 2>&5
8939   ac_status=$?
8940   echo "$as_me:8940: \$? = $ac_status" >&5
8941   (exit $ac_status); } &&
8942          { ac_try='test -s conftest$ac_exeext'
8943   { (eval echo "$as_me:8943: \"$ac_try\"") >&5
8944   (eval $ac_try) 2>&5
8945   ac_status=$?
8946   echo "$as_me:8946: \$? = $ac_status" >&5
8947   (exit $ac_status); }; }; then
8948   ac_cv_lib_gpm_initscr=yes
8949 else
8950   echo "$as_me: failed program was:" >&5
8951 cat conftest.$ac_ext >&5
8952 ac_cv_lib_gpm_initscr=no
8953 fi
8954 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8955 LIBS=$ac_check_lib_save_LIBS
8956 fi
8957 echo "$as_me:8957: result: $ac_cv_lib_gpm_initscr" >&5
8958 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
8959 if test $ac_cv_lib_gpm_initscr = yes; then
8960   LIBS="$cf_ncurses_SAVE"
8961 else
8962   cf_ncurses_LIBS="-lgpm"
8963 fi
8964
8965 fi
8966
8967 case $host_os in
8968 (freebsd*)
8969         # This is only necessary if you are linking against an obsolete
8970         # version of ncurses (but it should do no harm, since it's static).
8971         if test "$cf_nculib_root" = ncurses ; then
8972                 echo "$as_me:8972: checking for tgoto in -lmytinfo" >&5
8973 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
8974 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
8975   echo $ECHO_N "(cached) $ECHO_C" >&6
8976 else
8977   ac_check_lib_save_LIBS=$LIBS
8978 LIBS="-lmytinfo  $LIBS"
8979 cat >conftest.$ac_ext <<_ACEOF
8980 #line 8980 "configure"
8981 #include "confdefs.h"
8982
8983 /* Override any gcc2 internal prototype to avoid an error.  */
8984 #ifdef __cplusplus
8985 extern "C"
8986 #endif
8987 /* We use char because int might match the return type of a gcc2
8988    builtin and then its argument prototype would still apply.  */
8989 char tgoto ();
8990 int
8991 main ()
8992 {
8993 tgoto ();
8994   ;
8995   return 0;
8996 }
8997 _ACEOF
8998 rm -f conftest.$ac_objext conftest$ac_exeext
8999 if { (eval echo "$as_me:8999: \"$ac_link\"") >&5
9000   (eval $ac_link) 2>&5
9001   ac_status=$?
9002   echo "$as_me:9002: \$? = $ac_status" >&5
9003   (exit $ac_status); } &&
9004          { ac_try='test -s conftest$ac_exeext'
9005   { (eval echo "$as_me:9005: \"$ac_try\"") >&5
9006   (eval $ac_try) 2>&5
9007   ac_status=$?
9008   echo "$as_me:9008: \$? = $ac_status" >&5
9009   (exit $ac_status); }; }; then
9010   ac_cv_lib_mytinfo_tgoto=yes
9011 else
9012   echo "$as_me: failed program was:" >&5
9013 cat conftest.$ac_ext >&5
9014 ac_cv_lib_mytinfo_tgoto=no
9015 fi
9016 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9017 LIBS=$ac_check_lib_save_LIBS
9018 fi
9019 echo "$as_me:9019: result: $ac_cv_lib_mytinfo_tgoto" >&5
9020 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
9021 if test $ac_cv_lib_mytinfo_tgoto = yes; then
9022   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
9023 fi
9024
9025         fi
9026         ;;
9027 esac
9028
9029 cf_add_libs="$cf_ncurses_LIBS"
9030 # Filter out duplicates - this happens with badly-designed ".pc" files...
9031 for cf_add_1lib in $LIBS
9032 do
9033         for cf_add_2lib in $cf_add_libs
9034         do
9035                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
9036                 then
9037                         cf_add_1lib=
9038                         break
9039                 fi
9040         done
9041         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
9042 done
9043 LIBS="$cf_add_libs"
9044
9045 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
9046 then
9047
9048 cf_add_libs="-l$cf_nculib_root"
9049 # Filter out duplicates - this happens with badly-designed ".pc" files...
9050 for cf_add_1lib in $LIBS
9051 do
9052         for cf_add_2lib in $cf_add_libs
9053         do
9054                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
9055                 then
9056                         cf_add_1lib=
9057                         break
9058                 fi
9059         done
9060         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
9061 done
9062 LIBS="$cf_add_libs"
9063
9064 else
9065
9066         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
9067         cf_libdir=""
9068         echo "$as_me:9068: checking for initscr" >&5
9069 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
9070 if test "${ac_cv_func_initscr+set}" = set; then
9071   echo $ECHO_N "(cached) $ECHO_C" >&6
9072 else
9073   cat >conftest.$ac_ext <<_ACEOF
9074 #line 9074 "configure"
9075 #include "confdefs.h"
9076 /* System header to define __stub macros and hopefully few prototypes,
9077     which can conflict with char initscr (); below.  */
9078 #include <assert.h>
9079 /* Override any gcc2 internal prototype to avoid an error.  */
9080 #ifdef __cplusplus
9081 extern "C"
9082 #endif
9083 /* We use char because int might match the return type of a gcc2
9084    builtin and then its argument prototype would still apply.  */
9085 char initscr ();
9086 char (*f) ();
9087
9088 int
9089 main ()
9090 {
9091 /* The GNU C library defines this for functions which it implements
9092     to always fail with ENOSYS.  Some functions are actually named
9093     something starting with __ and the normal name is an alias.  */
9094 #if defined (__stub_initscr) || defined (__stub___initscr)
9095 choke me
9096 #else
9097 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
9098 #endif
9099
9100   ;
9101   return 0;
9102 }
9103 _ACEOF
9104 rm -f conftest.$ac_objext conftest$ac_exeext
9105 if { (eval echo "$as_me:9105: \"$ac_link\"") >&5
9106   (eval $ac_link) 2>&5
9107   ac_status=$?
9108   echo "$as_me:9108: \$? = $ac_status" >&5
9109   (exit $ac_status); } &&
9110          { ac_try='test -s conftest$ac_exeext'
9111   { (eval echo "$as_me:9111: \"$ac_try\"") >&5
9112   (eval $ac_try) 2>&5
9113   ac_status=$?
9114   echo "$as_me:9114: \$? = $ac_status" >&5
9115   (exit $ac_status); }; }; then
9116   ac_cv_func_initscr=yes
9117 else
9118   echo "$as_me: failed program was:" >&5
9119 cat conftest.$ac_ext >&5
9120 ac_cv_func_initscr=no
9121 fi
9122 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9123 fi
9124 echo "$as_me:9124: result: $ac_cv_func_initscr" >&5
9125 echo "${ECHO_T}$ac_cv_func_initscr" >&6
9126 if test $ac_cv_func_initscr = yes; then
9127   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9128 else
9129
9130                 cf_save_LIBS="$LIBS"
9131                 echo "$as_me:9131: checking for initscr in -l$cf_nculib_root" >&5
9132 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
9133                 LIBS="-l$cf_nculib_root $LIBS"
9134                 cat >conftest.$ac_ext <<_ACEOF
9135 #line 9135 "configure"
9136 #include "confdefs.h"
9137 #include <${cf_cv_ncurses_header:-curses.h}>
9138 int
9139 main ()
9140 {
9141 initscr()
9142   ;
9143   return 0;
9144 }
9145 _ACEOF
9146 rm -f conftest.$ac_objext conftest$ac_exeext
9147 if { (eval echo "$as_me:9147: \"$ac_link\"") >&5
9148   (eval $ac_link) 2>&5
9149   ac_status=$?
9150   echo "$as_me:9150: \$? = $ac_status" >&5
9151   (exit $ac_status); } &&
9152          { ac_try='test -s conftest$ac_exeext'
9153   { (eval echo "$as_me:9153: \"$ac_try\"") >&5
9154   (eval $ac_try) 2>&5
9155   ac_status=$?
9156   echo "$as_me:9156: \$? = $ac_status" >&5
9157   (exit $ac_status); }; }; then
9158   echo "$as_me:9158: result: yes" >&5
9159 echo "${ECHO_T}yes" >&6
9160                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9161
9162 else
9163   echo "$as_me: failed program was:" >&5
9164 cat conftest.$ac_ext >&5
9165 echo "$as_me:9165: result: no" >&5
9166 echo "${ECHO_T}no" >&6
9167
9168 cf_search=
9169 cf_library_path_list=""
9170 if test -n "${LDFLAGS}${LIBS}" ; then
9171         for cf_library_path in $LDFLAGS $LIBS
9172         do
9173                 case $cf_library_path in
9174                 (-L*)
9175                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
9176
9177 test "x$cf_library_path" != "xNONE" && \
9178 test -d "$cf_library_path" && \
9179  {
9180         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
9181         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
9182         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
9183         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
9184         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
9185         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"
9186 }
9187
9188                         cf_library_path_list="$cf_library_path_list $cf_search"
9189                         ;;
9190                 esac
9191         done
9192 fi
9193
9194 cf_search=
9195
9196 test "x$prefix" != "xNONE" && \
9197 test -d "$prefix" && \
9198  {
9199         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
9200         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
9201         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
9202         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
9203         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
9204         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
9205 }
9206
9207 for cf_subdir_prefix in \
9208         /usr \
9209         /usr/local \
9210         /usr/pkg \
9211         /opt \
9212         /opt/local \
9213         $HOME
9214 do
9215
9216 test "x$cf_subdir_prefix" != "x$prefix" && \
9217 test -d "$cf_subdir_prefix" && \
9218 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
9219         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
9220         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
9221         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
9222         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
9223         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
9224         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"
9225 }
9226
9227 done
9228
9229 cf_search="$cf_library_path_list $cf_search"
9230
9231                         for cf_libdir in $cf_search
9232                         do
9233                                 echo "$as_me:9233: checking for -l$cf_nculib_root in $cf_libdir" >&5
9234 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
9235                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
9236                                 cat >conftest.$ac_ext <<_ACEOF
9237 #line 9237 "configure"
9238 #include "confdefs.h"
9239 #include <${cf_cv_ncurses_header:-curses.h}>
9240 int
9241 main ()
9242 {
9243 initscr()
9244   ;
9245   return 0;
9246 }
9247 _ACEOF
9248 rm -f conftest.$ac_objext conftest$ac_exeext
9249 if { (eval echo "$as_me:9249: \"$ac_link\"") >&5
9250   (eval $ac_link) 2>&5
9251   ac_status=$?
9252   echo "$as_me:9252: \$? = $ac_status" >&5
9253   (exit $ac_status); } &&
9254          { ac_try='test -s conftest$ac_exeext'
9255   { (eval echo "$as_me:9255: \"$ac_try\"") >&5
9256   (eval $ac_try) 2>&5
9257   ac_status=$?
9258   echo "$as_me:9258: \$? = $ac_status" >&5
9259   (exit $ac_status); }; }; then
9260   echo "$as_me:9260: result: yes" >&5
9261 echo "${ECHO_T}yes" >&6
9262                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9263                                          break
9264 else
9265   echo "$as_me: failed program was:" >&5
9266 cat conftest.$ac_ext >&5
9267 echo "$as_me:9267: result: no" >&5
9268 echo "${ECHO_T}no" >&6
9269                                          LIBS="$cf_save_LIBS"
9270 fi
9271 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9272                         done
9273
9274 fi
9275 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9276
9277 fi
9278
9279 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
9280
9281 if test $cf_found_library = no ; then
9282         { { echo "$as_me:9282: error: Cannot link $cf_nculib_root library" >&5
9283 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
9284    { (exit 1); exit 1; }; }
9285 fi
9286
9287 fi
9288
9289 if test -n "$cf_ncurses_LIBS" ; then
9290         echo "$as_me:9290: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
9291 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
9292         cf_ncurses_SAVE="$LIBS"
9293         for p in $cf_ncurses_LIBS ; do
9294                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
9295                 if test "$q" != "$LIBS" ; then
9296                         LIBS="$q"
9297                 fi
9298         done
9299         cat >conftest.$ac_ext <<_ACEOF
9300 #line 9300 "configure"
9301 #include "confdefs.h"
9302 #include <${cf_cv_ncurses_header:-curses.h}>
9303 int
9304 main ()
9305 {
9306 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
9307   ;
9308   return 0;
9309 }
9310 _ACEOF
9311 rm -f conftest.$ac_objext conftest$ac_exeext
9312 if { (eval echo "$as_me:9312: \"$ac_link\"") >&5
9313   (eval $ac_link) 2>&5
9314   ac_status=$?
9315   echo "$as_me:9315: \$? = $ac_status" >&5
9316   (exit $ac_status); } &&
9317          { ac_try='test -s conftest$ac_exeext'
9318   { (eval echo "$as_me:9318: \"$ac_try\"") >&5
9319   (eval $ac_try) 2>&5
9320   ac_status=$?
9321   echo "$as_me:9321: \$? = $ac_status" >&5
9322   (exit $ac_status); }; }; then
9323   echo "$as_me:9323: result: yes" >&5
9324 echo "${ECHO_T}yes" >&6
9325 else
9326   echo "$as_me: failed program was:" >&5
9327 cat conftest.$ac_ext >&5
9328 echo "$as_me:9328: result: no" >&5
9329 echo "${ECHO_T}no" >&6
9330                  LIBS="$cf_ncurses_SAVE"
9331 fi
9332 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9333 fi
9334
9335 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9336
9337 cat >>confdefs.h <<EOF
9338 #define $cf_nculib_ROOT 1
9339 EOF
9340
9341         fi
9342 else
9343         NCURSES_CONFIG=none
9344 fi
9345
9346         ;;
9347 (pdcurses)
9348         echo "$as_me:9348: checking for X" >&5
9349 echo $ECHO_N "checking for X... $ECHO_C" >&6
9350
9351 # Check whether --with-x or --without-x was given.
9352 if test "${with_x+set}" = set; then
9353   withval="$with_x"
9354
9355 fi;
9356 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
9357 if test "x$with_x" = xno; then
9358   # The user explicitly disabled X.
9359   have_x=disabled
9360 else
9361   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
9362     # Both variables are already set.
9363     have_x=yes
9364   else
9365     if test "${ac_cv_have_x+set}" = set; then
9366   echo $ECHO_N "(cached) $ECHO_C" >&6
9367 else
9368   # One or both of the vars are not set, and there is no cached value.
9369 ac_x_includes=no ac_x_libraries=no
9370 rm -fr conftest.dir
9371 if mkdir conftest.dir; then
9372   cd conftest.dir
9373   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
9374   cat >Imakefile <<'EOF'
9375 acfindx:
9376         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
9377 EOF
9378   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
9379     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
9380     eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
9381     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
9382     for ac_extension in a so sl dylib dll; do
9383       if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
9384          test -f $ac_im_libdir/libX11.$ac_extension; then
9385         ac_im_usrlibdir=$ac_im_libdir; break
9386       fi
9387     done
9388     # Screen out bogus values from the imake configuration.  They are
9389     # bogus both because they are the default anyway, and because
9390     # using them would break gcc on systems where it needs fixed includes.
9391     case $ac_im_incroot in
9392         /usr/include) ;;
9393         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
9394     esac
9395     case $ac_im_usrlibdir in
9396         /usr/lib | /lib) ;;
9397         *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
9398     esac
9399   fi
9400   cd ..
9401   rm -fr conftest.dir
9402 fi
9403
9404 # Standard set of common directories for X headers.
9405 # Check X11 before X11Rn because it is often a symlink to the current release.
9406 ac_x_header_dirs='
9407 /usr/X11/include
9408 /usr/X11R6/include
9409 /usr/X11R5/include
9410 /usr/X11R4/include
9411
9412 /usr/include/X11
9413 /usr/include/X11R6
9414 /usr/include/X11R5
9415 /usr/include/X11R4
9416
9417 /usr/local/X11/include
9418 /usr/local/X11R6/include
9419 /usr/local/X11R5/include
9420 /usr/local/X11R4/include
9421
9422 /usr/local/include/X11
9423 /usr/local/include/X11R6
9424 /usr/local/include/X11R5
9425 /usr/local/include/X11R4
9426
9427 /usr/X386/include
9428 /usr/x386/include
9429 /usr/XFree86/include/X11
9430
9431 /usr/include
9432 /usr/local/include
9433 /usr/unsupported/include
9434 /usr/athena/include
9435 /usr/local/x11r5/include
9436 /usr/lpp/Xamples/include
9437
9438 /usr/openwin/include
9439 /usr/openwin/share/include'
9440
9441 if test "$ac_x_includes" = no; then
9442   # Guess where to find include files, by looking for Intrinsic.h.
9443   # First, try using that file with no special directory specified.
9444   cat >conftest.$ac_ext <<_ACEOF
9445 #line 9445 "configure"
9446 #include "confdefs.h"
9447 #include <X11/Intrinsic.h>
9448 _ACEOF
9449 if { (eval echo "$as_me:9449: \"$ac_cpp conftest.$ac_ext\"") >&5
9450   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
9451   ac_status=$?
9452   egrep -v '^ *\+' conftest.er1 >conftest.err
9453   rm -f conftest.er1
9454   cat conftest.err >&5
9455   echo "$as_me:9455: \$? = $ac_status" >&5
9456   (exit $ac_status); } >/dev/null; then
9457   if test -s conftest.err; then
9458     ac_cpp_err=$ac_c_preproc_warn_flag
9459   else
9460     ac_cpp_err=
9461   fi
9462 else
9463   ac_cpp_err=yes
9464 fi
9465 if test -z "$ac_cpp_err"; then
9466   # We can compile using X headers with no special include directory.
9467 ac_x_includes=
9468 else
9469   echo "$as_me: failed program was:" >&5
9470   cat conftest.$ac_ext >&5
9471   for ac_dir in $ac_x_header_dirs; do
9472   if test -r "$ac_dir/X11/Intrinsic.h"; then
9473     ac_x_includes=$ac_dir
9474     break
9475   fi
9476 done
9477 fi
9478 rm -f conftest.err conftest.$ac_ext
9479 fi # $ac_x_includes = no
9480
9481 if test "$ac_x_libraries" = no; then
9482   # Check for the libraries.
9483   # See if we find them without any special options.
9484   # Don't add to $LIBS permanently.
9485   ac_save_LIBS=$LIBS
9486   LIBS="-lXt $LIBS"
9487   cat >conftest.$ac_ext <<_ACEOF
9488 #line 9488 "configure"
9489 #include "confdefs.h"
9490 #include <X11/Intrinsic.h>
9491 int
9492 main ()
9493 {
9494 XtMalloc (0)
9495   ;
9496   return 0;
9497 }
9498 _ACEOF
9499 rm -f conftest.$ac_objext conftest$ac_exeext
9500 if { (eval echo "$as_me:9500: \"$ac_link\"") >&5
9501   (eval $ac_link) 2>&5
9502   ac_status=$?
9503   echo "$as_me:9503: \$? = $ac_status" >&5
9504   (exit $ac_status); } &&
9505          { ac_try='test -s conftest$ac_exeext'
9506   { (eval echo "$as_me:9506: \"$ac_try\"") >&5
9507   (eval $ac_try) 2>&5
9508   ac_status=$?
9509   echo "$as_me:9509: \$? = $ac_status" >&5
9510   (exit $ac_status); }; }; then
9511   LIBS=$ac_save_LIBS
9512 # We can link X programs with no special library path.
9513 ac_x_libraries=
9514 else
9515   echo "$as_me: failed program was:" >&5
9516 cat conftest.$ac_ext >&5
9517 LIBS=$ac_save_LIBS
9518 for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
9519 do
9520   # Don't even attempt the hair of trying to link an X program!
9521   for ac_extension in a so sl dylib dll; do
9522     if test -r $ac_dir/libXt.$ac_extension; then
9523       ac_x_libraries=$ac_dir
9524       break 2
9525     fi
9526   done
9527 done
9528 fi
9529 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9530 fi # $ac_x_libraries = no
9531
9532 if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then
9533   # Didn't find X anywhere.  Cache the known absence of X.
9534   ac_cv_have_x="have_x=no"
9535 else
9536   # Record where we found X for the cache.
9537   ac_cv_have_x="have_x=yes \
9538                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
9539 fi
9540 fi
9541
9542   fi
9543   eval "$ac_cv_have_x"
9544 fi # $with_x != no
9545
9546 if test "$have_x" != yes; then
9547   echo "$as_me:9547: result: $have_x" >&5
9548 echo "${ECHO_T}$have_x" >&6
9549   no_x=yes
9550 else
9551   # If each of the values was on the command line, it overrides each guess.
9552   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
9553   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
9554   # Update the cache value to reflect the command line values.
9555   ac_cv_have_x="have_x=yes \
9556                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
9557   echo "$as_me:9557: result: libraries $x_libraries, headers $x_includes" >&5
9558 echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6
9559 fi
9560
9561 if test "$no_x" = yes; then
9562   # Not all programs may use this symbol, but it does not hurt to define it.
9563
9564 cat >>confdefs.h <<\EOF
9565 #define X_DISPLAY_MISSING 1
9566 EOF
9567
9568   X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
9569 else
9570   if test -n "$x_includes"; then
9571     X_CFLAGS="$X_CFLAGS -I$x_includes"
9572   fi
9573
9574   # It would also be nice to do this for all -L options, not just this one.
9575   if test -n "$x_libraries"; then
9576     X_LIBS="$X_LIBS -L$x_libraries"
9577     # For Solaris; some versions of Sun CC require a space after -R and
9578     # others require no space.  Words are not sufficient . . . .
9579     case `(uname -sr) 2>/dev/null` in
9580     "SunOS 5"*)
9581       echo "$as_me:9581: checking whether -R must be followed by a space" >&5
9582 echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6
9583       ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
9584       cat >conftest.$ac_ext <<_ACEOF
9585 #line 9585 "configure"
9586 #include "confdefs.h"
9587
9588 int
9589 main ()
9590 {
9591
9592   ;
9593   return 0;
9594 }
9595 _ACEOF
9596 rm -f conftest.$ac_objext conftest$ac_exeext
9597 if { (eval echo "$as_me:9597: \"$ac_link\"") >&5
9598   (eval $ac_link) 2>&5
9599   ac_status=$?
9600   echo "$as_me:9600: \$? = $ac_status" >&5
9601   (exit $ac_status); } &&
9602          { ac_try='test -s conftest$ac_exeext'
9603   { (eval echo "$as_me:9603: \"$ac_try\"") >&5
9604   (eval $ac_try) 2>&5
9605   ac_status=$?
9606   echo "$as_me:9606: \$? = $ac_status" >&5
9607   (exit $ac_status); }; }; then
9608   ac_R_nospace=yes
9609 else
9610   echo "$as_me: failed program was:" >&5
9611 cat conftest.$ac_ext >&5
9612 ac_R_nospace=no
9613 fi
9614 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9615       if test $ac_R_nospace = yes; then
9616         echo "$as_me:9616: result: no" >&5
9617 echo "${ECHO_T}no" >&6
9618         X_LIBS="$X_LIBS -R$x_libraries"
9619       else
9620         LIBS="$ac_xsave_LIBS -R $x_libraries"
9621         cat >conftest.$ac_ext <<_ACEOF
9622 #line 9622 "configure"
9623 #include "confdefs.h"
9624
9625 int
9626 main ()
9627 {
9628
9629   ;
9630   return 0;
9631 }
9632 _ACEOF
9633 rm -f conftest.$ac_objext conftest$ac_exeext
9634 if { (eval echo "$as_me:9634: \"$ac_link\"") >&5
9635   (eval $ac_link) 2>&5
9636   ac_status=$?
9637   echo "$as_me:9637: \$? = $ac_status" >&5
9638   (exit $ac_status); } &&
9639          { ac_try='test -s conftest$ac_exeext'
9640   { (eval echo "$as_me:9640: \"$ac_try\"") >&5
9641   (eval $ac_try) 2>&5
9642   ac_status=$?
9643   echo "$as_me:9643: \$? = $ac_status" >&5
9644   (exit $ac_status); }; }; then
9645   ac_R_space=yes
9646 else
9647   echo "$as_me: failed program was:" >&5
9648 cat conftest.$ac_ext >&5
9649 ac_R_space=no
9650 fi
9651 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9652         if test $ac_R_space = yes; then
9653           echo "$as_me:9653: result: yes" >&5
9654 echo "${ECHO_T}yes" >&6
9655           X_LIBS="$X_LIBS -R $x_libraries"
9656         else
9657           echo "$as_me:9657: result: neither works" >&5
9658 echo "${ECHO_T}neither works" >&6
9659         fi
9660       fi
9661       LIBS=$ac_xsave_LIBS
9662     esac
9663   fi
9664
9665   # Check for system-dependent libraries X programs must link with.
9666   # Do this before checking for the system-independent R6 libraries
9667   # (-lICE), since we may need -lsocket or whatever for X linking.
9668
9669   if test "$ISC" = yes; then
9670     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
9671   else
9672     # Martyn Johnson says this is needed for Ultrix, if the X
9673     # libraries were built with DECnet support.  And Karl Berry says
9674     # the Alpha needs dnet_stub (dnet does not exist).
9675     ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
9676     cat >conftest.$ac_ext <<_ACEOF
9677 #line 9677 "configure"
9678 #include "confdefs.h"
9679
9680 /* Override any gcc2 internal prototype to avoid an error.  */
9681 #ifdef __cplusplus
9682 extern "C"
9683 #endif
9684 /* We use char because int might match the return type of a gcc2
9685    builtin and then its argument prototype would still apply.  */
9686 char XOpenDisplay ();
9687 int
9688 main ()
9689 {
9690 XOpenDisplay ();
9691   ;
9692   return 0;
9693 }
9694 _ACEOF
9695 rm -f conftest.$ac_objext conftest$ac_exeext
9696 if { (eval echo "$as_me:9696: \"$ac_link\"") >&5
9697   (eval $ac_link) 2>&5
9698   ac_status=$?
9699   echo "$as_me:9699: \$? = $ac_status" >&5
9700   (exit $ac_status); } &&
9701          { ac_try='test -s conftest$ac_exeext'
9702   { (eval echo "$as_me:9702: \"$ac_try\"") >&5
9703   (eval $ac_try) 2>&5
9704   ac_status=$?
9705   echo "$as_me:9705: \$? = $ac_status" >&5
9706   (exit $ac_status); }; }; then
9707   :
9708 else
9709   echo "$as_me: failed program was:" >&5
9710 cat conftest.$ac_ext >&5
9711 echo "$as_me:9711: checking for dnet_ntoa in -ldnet" >&5
9712 echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6
9713 if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then
9714   echo $ECHO_N "(cached) $ECHO_C" >&6
9715 else
9716   ac_check_lib_save_LIBS=$LIBS
9717 LIBS="-ldnet  $LIBS"
9718 cat >conftest.$ac_ext <<_ACEOF
9719 #line 9719 "configure"
9720 #include "confdefs.h"
9721
9722 /* Override any gcc2 internal prototype to avoid an error.  */
9723 #ifdef __cplusplus
9724 extern "C"
9725 #endif
9726 /* We use char because int might match the return type of a gcc2
9727    builtin and then its argument prototype would still apply.  */
9728 char dnet_ntoa ();
9729 int
9730 main ()
9731 {
9732 dnet_ntoa ();
9733   ;
9734   return 0;
9735 }
9736 _ACEOF
9737 rm -f conftest.$ac_objext conftest$ac_exeext
9738 if { (eval echo "$as_me:9738: \"$ac_link\"") >&5
9739   (eval $ac_link) 2>&5
9740   ac_status=$?
9741   echo "$as_me:9741: \$? = $ac_status" >&5
9742   (exit $ac_status); } &&
9743          { ac_try='test -s conftest$ac_exeext'
9744   { (eval echo "$as_me:9744: \"$ac_try\"") >&5
9745   (eval $ac_try) 2>&5
9746   ac_status=$?
9747   echo "$as_me:9747: \$? = $ac_status" >&5
9748   (exit $ac_status); }; }; then
9749   ac_cv_lib_dnet_dnet_ntoa=yes
9750 else
9751   echo "$as_me: failed program was:" >&5
9752 cat conftest.$ac_ext >&5
9753 ac_cv_lib_dnet_dnet_ntoa=no
9754 fi
9755 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9756 LIBS=$ac_check_lib_save_LIBS
9757 fi
9758 echo "$as_me:9758: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
9759 echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6
9760 if test $ac_cv_lib_dnet_dnet_ntoa = yes; then
9761   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
9762 fi
9763
9764     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
9765       echo "$as_me:9765: checking for dnet_ntoa in -ldnet_stub" >&5
9766 echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6
9767 if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then
9768   echo $ECHO_N "(cached) $ECHO_C" >&6
9769 else
9770   ac_check_lib_save_LIBS=$LIBS
9771 LIBS="-ldnet_stub  $LIBS"
9772 cat >conftest.$ac_ext <<_ACEOF
9773 #line 9773 "configure"
9774 #include "confdefs.h"
9775
9776 /* Override any gcc2 internal prototype to avoid an error.  */
9777 #ifdef __cplusplus
9778 extern "C"
9779 #endif
9780 /* We use char because int might match the return type of a gcc2
9781    builtin and then its argument prototype would still apply.  */
9782 char dnet_ntoa ();
9783 int
9784 main ()
9785 {
9786 dnet_ntoa ();
9787   ;
9788   return 0;
9789 }
9790 _ACEOF
9791 rm -f conftest.$ac_objext conftest$ac_exeext
9792 if { (eval echo "$as_me:9792: \"$ac_link\"") >&5
9793   (eval $ac_link) 2>&5
9794   ac_status=$?
9795   echo "$as_me:9795: \$? = $ac_status" >&5
9796   (exit $ac_status); } &&
9797          { ac_try='test -s conftest$ac_exeext'
9798   { (eval echo "$as_me:9798: \"$ac_try\"") >&5
9799   (eval $ac_try) 2>&5
9800   ac_status=$?
9801   echo "$as_me:9801: \$? = $ac_status" >&5
9802   (exit $ac_status); }; }; then
9803   ac_cv_lib_dnet_stub_dnet_ntoa=yes
9804 else
9805   echo "$as_me: failed program was:" >&5
9806 cat conftest.$ac_ext >&5
9807 ac_cv_lib_dnet_stub_dnet_ntoa=no
9808 fi
9809 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9810 LIBS=$ac_check_lib_save_LIBS
9811 fi
9812 echo "$as_me:9812: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
9813 echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6
9814 if test $ac_cv_lib_dnet_stub_dnet_ntoa = yes; then
9815   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
9816 fi
9817
9818     fi
9819 fi
9820 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9821     LIBS="$ac_xsave_LIBS"
9822
9823     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
9824     # to get the SysV transport functions.
9825     # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4)
9826     # needs -lnsl.
9827     # The nsl library prevents programs from opening the X display
9828     # on Irix 5.2, according to T.E. Dickey.
9829     # The functions gethostbyname, getservbyname, and inet_addr are
9830     # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
9831     echo "$as_me:9831: checking for gethostbyname" >&5
9832 echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6
9833 if test "${ac_cv_func_gethostbyname+set}" = set; then
9834   echo $ECHO_N "(cached) $ECHO_C" >&6
9835 else
9836   cat >conftest.$ac_ext <<_ACEOF
9837 #line 9837 "configure"
9838 #include "confdefs.h"
9839 /* System header to define __stub macros and hopefully few prototypes,
9840     which can conflict with char gethostbyname (); below.  */
9841 #include <assert.h>
9842 /* Override any gcc2 internal prototype to avoid an error.  */
9843 #ifdef __cplusplus
9844 extern "C"
9845 #endif
9846 /* We use char because int might match the return type of a gcc2
9847    builtin and then its argument prototype would still apply.  */
9848 char gethostbyname ();
9849 char (*f) ();
9850
9851 int
9852 main ()
9853 {
9854 /* The GNU C library defines this for functions which it implements
9855     to always fail with ENOSYS.  Some functions are actually named
9856     something starting with __ and the normal name is an alias.  */
9857 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
9858 choke me
9859 #else
9860 f = gethostbyname; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
9861 #endif
9862
9863   ;
9864   return 0;
9865 }
9866 _ACEOF
9867 rm -f conftest.$ac_objext conftest$ac_exeext
9868 if { (eval echo "$as_me:9868: \"$ac_link\"") >&5
9869   (eval $ac_link) 2>&5
9870   ac_status=$?
9871   echo "$as_me:9871: \$? = $ac_status" >&5
9872   (exit $ac_status); } &&
9873          { ac_try='test -s conftest$ac_exeext'
9874   { (eval echo "$as_me:9874: \"$ac_try\"") >&5
9875   (eval $ac_try) 2>&5
9876   ac_status=$?
9877   echo "$as_me:9877: \$? = $ac_status" >&5
9878   (exit $ac_status); }; }; then
9879   ac_cv_func_gethostbyname=yes
9880 else
9881   echo "$as_me: failed program was:" >&5
9882 cat conftest.$ac_ext >&5
9883 ac_cv_func_gethostbyname=no
9884 fi
9885 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9886 fi
9887 echo "$as_me:9887: result: $ac_cv_func_gethostbyname" >&5
9888 echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6
9889
9890     if test $ac_cv_func_gethostbyname = no; then
9891       echo "$as_me:9891: checking for gethostbyname in -lnsl" >&5
9892 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6
9893 if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
9894   echo $ECHO_N "(cached) $ECHO_C" >&6
9895 else
9896   ac_check_lib_save_LIBS=$LIBS
9897 LIBS="-lnsl  $LIBS"
9898 cat >conftest.$ac_ext <<_ACEOF
9899 #line 9899 "configure"
9900 #include "confdefs.h"
9901
9902 /* Override any gcc2 internal prototype to avoid an error.  */
9903 #ifdef __cplusplus
9904 extern "C"
9905 #endif
9906 /* We use char because int might match the return type of a gcc2
9907    builtin and then its argument prototype would still apply.  */
9908 char gethostbyname ();
9909 int
9910 main ()
9911 {
9912 gethostbyname ();
9913   ;
9914   return 0;
9915 }
9916 _ACEOF
9917 rm -f conftest.$ac_objext conftest$ac_exeext
9918 if { (eval echo "$as_me:9918: \"$ac_link\"") >&5
9919   (eval $ac_link) 2>&5
9920   ac_status=$?
9921   echo "$as_me:9921: \$? = $ac_status" >&5
9922   (exit $ac_status); } &&
9923          { ac_try='test -s conftest$ac_exeext'
9924   { (eval echo "$as_me:9924: \"$ac_try\"") >&5
9925   (eval $ac_try) 2>&5
9926   ac_status=$?
9927   echo "$as_me:9927: \$? = $ac_status" >&5
9928   (exit $ac_status); }; }; then
9929   ac_cv_lib_nsl_gethostbyname=yes
9930 else
9931   echo "$as_me: failed program was:" >&5
9932 cat conftest.$ac_ext >&5
9933 ac_cv_lib_nsl_gethostbyname=no
9934 fi
9935 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9936 LIBS=$ac_check_lib_save_LIBS
9937 fi
9938 echo "$as_me:9938: result: $ac_cv_lib_nsl_gethostbyname" >&5
9939 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6
9940 if test $ac_cv_lib_nsl_gethostbyname = yes; then
9941   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
9942 fi
9943
9944       if test $ac_cv_lib_nsl_gethostbyname = no; then
9945         echo "$as_me:9945: checking for gethostbyname in -lbsd" >&5
9946 echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6
9947 if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then
9948   echo $ECHO_N "(cached) $ECHO_C" >&6
9949 else
9950   ac_check_lib_save_LIBS=$LIBS
9951 LIBS="-lbsd  $LIBS"
9952 cat >conftest.$ac_ext <<_ACEOF
9953 #line 9953 "configure"
9954 #include "confdefs.h"
9955
9956 /* Override any gcc2 internal prototype to avoid an error.  */
9957 #ifdef __cplusplus
9958 extern "C"
9959 #endif
9960 /* We use char because int might match the return type of a gcc2
9961    builtin and then its argument prototype would still apply.  */
9962 char gethostbyname ();
9963 int
9964 main ()
9965 {
9966 gethostbyname ();
9967   ;
9968   return 0;
9969 }
9970 _ACEOF
9971 rm -f conftest.$ac_objext conftest$ac_exeext
9972 if { (eval echo "$as_me:9972: \"$ac_link\"") >&5
9973   (eval $ac_link) 2>&5
9974   ac_status=$?
9975   echo "$as_me:9975: \$? = $ac_status" >&5
9976   (exit $ac_status); } &&
9977          { ac_try='test -s conftest$ac_exeext'
9978   { (eval echo "$as_me:9978: \"$ac_try\"") >&5
9979   (eval $ac_try) 2>&5
9980   ac_status=$?
9981   echo "$as_me:9981: \$? = $ac_status" >&5
9982   (exit $ac_status); }; }; then
9983   ac_cv_lib_bsd_gethostbyname=yes
9984 else
9985   echo "$as_me: failed program was:" >&5
9986 cat conftest.$ac_ext >&5
9987 ac_cv_lib_bsd_gethostbyname=no
9988 fi
9989 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9990 LIBS=$ac_check_lib_save_LIBS
9991 fi
9992 echo "$as_me:9992: result: $ac_cv_lib_bsd_gethostbyname" >&5
9993 echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6
9994 if test $ac_cv_lib_bsd_gethostbyname = yes; then
9995   X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
9996 fi
9997
9998       fi
9999     fi
10000
10001     # lieder@skyler.mavd.honeywell.com says without -lsocket,
10002     # socket/setsockopt and other routines are undefined under SCO ODT
10003     # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
10004     # on later versions), says Simon Leinen: it contains gethostby*
10005     # variants that don't use the nameserver (or something).  -lsocket
10006     # must be given before -lnsl if both are needed.  We assume that
10007     # if connect needs -lnsl, so does gethostbyname.
10008     echo "$as_me:10008: checking for connect" >&5
10009 echo $ECHO_N "checking for connect... $ECHO_C" >&6
10010 if test "${ac_cv_func_connect+set}" = set; then
10011   echo $ECHO_N "(cached) $ECHO_C" >&6
10012 else
10013   cat >conftest.$ac_ext <<_ACEOF
10014 #line 10014 "configure"
10015 #include "confdefs.h"
10016 /* System header to define __stub macros and hopefully few prototypes,
10017     which can conflict with char connect (); below.  */
10018 #include <assert.h>
10019 /* Override any gcc2 internal prototype to avoid an error.  */
10020 #ifdef __cplusplus
10021 extern "C"
10022 #endif
10023 /* We use char because int might match the return type of a gcc2
10024    builtin and then its argument prototype would still apply.  */
10025 char connect ();
10026 char (*f) ();
10027
10028 int
10029 main ()
10030 {
10031 /* The GNU C library defines this for functions which it implements
10032     to always fail with ENOSYS.  Some functions are actually named
10033     something starting with __ and the normal name is an alias.  */
10034 #if defined (__stub_connect) || defined (__stub___connect)
10035 choke me
10036 #else
10037 f = connect; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
10038 #endif
10039
10040   ;
10041   return 0;
10042 }
10043 _ACEOF
10044 rm -f conftest.$ac_objext conftest$ac_exeext
10045 if { (eval echo "$as_me:10045: \"$ac_link\"") >&5
10046   (eval $ac_link) 2>&5
10047   ac_status=$?
10048   echo "$as_me:10048: \$? = $ac_status" >&5
10049   (exit $ac_status); } &&
10050          { ac_try='test -s conftest$ac_exeext'
10051   { (eval echo "$as_me:10051: \"$ac_try\"") >&5
10052   (eval $ac_try) 2>&5
10053   ac_status=$?
10054   echo "$as_me:10054: \$? = $ac_status" >&5
10055   (exit $ac_status); }; }; then
10056   ac_cv_func_connect=yes
10057 else
10058   echo "$as_me: failed program was:" >&5
10059 cat conftest.$ac_ext >&5
10060 ac_cv_func_connect=no
10061 fi
10062 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10063 fi
10064 echo "$as_me:10064: result: $ac_cv_func_connect" >&5
10065 echo "${ECHO_T}$ac_cv_func_connect" >&6
10066
10067     if test $ac_cv_func_connect = no; then
10068       echo "$as_me:10068: checking for connect in -lsocket" >&5
10069 echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6
10070 if test "${ac_cv_lib_socket_connect+set}" = set; then
10071   echo $ECHO_N "(cached) $ECHO_C" >&6
10072 else
10073   ac_check_lib_save_LIBS=$LIBS
10074 LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
10075 cat >conftest.$ac_ext <<_ACEOF
10076 #line 10076 "configure"
10077 #include "confdefs.h"
10078
10079 /* Override any gcc2 internal prototype to avoid an error.  */
10080 #ifdef __cplusplus
10081 extern "C"
10082 #endif
10083 /* We use char because int might match the return type of a gcc2
10084    builtin and then its argument prototype would still apply.  */
10085 char connect ();
10086 int
10087 main ()
10088 {
10089 connect ();
10090   ;
10091   return 0;
10092 }
10093 _ACEOF
10094 rm -f conftest.$ac_objext conftest$ac_exeext
10095 if { (eval echo "$as_me:10095: \"$ac_link\"") >&5
10096   (eval $ac_link) 2>&5
10097   ac_status=$?
10098   echo "$as_me:10098: \$? = $ac_status" >&5
10099   (exit $ac_status); } &&
10100          { ac_try='test -s conftest$ac_exeext'
10101   { (eval echo "$as_me:10101: \"$ac_try\"") >&5
10102   (eval $ac_try) 2>&5
10103   ac_status=$?
10104   echo "$as_me:10104: \$? = $ac_status" >&5
10105   (exit $ac_status); }; }; then
10106   ac_cv_lib_socket_connect=yes
10107 else
10108   echo "$as_me: failed program was:" >&5
10109 cat conftest.$ac_ext >&5
10110 ac_cv_lib_socket_connect=no
10111 fi
10112 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10113 LIBS=$ac_check_lib_save_LIBS
10114 fi
10115 echo "$as_me:10115: result: $ac_cv_lib_socket_connect" >&5
10116 echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6
10117 if test $ac_cv_lib_socket_connect = yes; then
10118   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
10119 fi
10120
10121     fi
10122
10123     # Guillermo Gomez says -lposix is necessary on A/UX.
10124     echo "$as_me:10124: checking for remove" >&5
10125 echo $ECHO_N "checking for remove... $ECHO_C" >&6
10126 if test "${ac_cv_func_remove+set}" = set; then
10127   echo $ECHO_N "(cached) $ECHO_C" >&6
10128 else
10129   cat >conftest.$ac_ext <<_ACEOF
10130 #line 10130 "configure"
10131 #include "confdefs.h"
10132 /* System header to define __stub macros and hopefully few prototypes,
10133     which can conflict with char remove (); below.  */
10134 #include <assert.h>
10135 /* Override any gcc2 internal prototype to avoid an error.  */
10136 #ifdef __cplusplus
10137 extern "C"
10138 #endif
10139 /* We use char because int might match the return type of a gcc2
10140    builtin and then its argument prototype would still apply.  */
10141 char remove ();
10142 char (*f) ();
10143
10144 int
10145 main ()
10146 {
10147 /* The GNU C library defines this for functions which it implements
10148     to always fail with ENOSYS.  Some functions are actually named
10149     something starting with __ and the normal name is an alias.  */
10150 #if defined (__stub_remove) || defined (__stub___remove)
10151 choke me
10152 #else
10153 f = remove; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
10154 #endif
10155
10156   ;
10157   return 0;
10158 }
10159 _ACEOF
10160 rm -f conftest.$ac_objext conftest$ac_exeext
10161 if { (eval echo "$as_me:10161: \"$ac_link\"") >&5
10162   (eval $ac_link) 2>&5
10163   ac_status=$?
10164   echo "$as_me:10164: \$? = $ac_status" >&5
10165   (exit $ac_status); } &&
10166          { ac_try='test -s conftest$ac_exeext'
10167   { (eval echo "$as_me:10167: \"$ac_try\"") >&5
10168   (eval $ac_try) 2>&5
10169   ac_status=$?
10170   echo "$as_me:10170: \$? = $ac_status" >&5
10171   (exit $ac_status); }; }; then
10172   ac_cv_func_remove=yes
10173 else
10174   echo "$as_me: failed program was:" >&5
10175 cat conftest.$ac_ext >&5
10176 ac_cv_func_remove=no
10177 fi
10178 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10179 fi
10180 echo "$as_me:10180: result: $ac_cv_func_remove" >&5
10181 echo "${ECHO_T}$ac_cv_func_remove" >&6
10182
10183     if test $ac_cv_func_remove = no; then
10184       echo "$as_me:10184: checking for remove in -lposix" >&5
10185 echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6
10186 if test "${ac_cv_lib_posix_remove+set}" = set; then
10187   echo $ECHO_N "(cached) $ECHO_C" >&6
10188 else
10189   ac_check_lib_save_LIBS=$LIBS
10190 LIBS="-lposix  $LIBS"
10191 cat >conftest.$ac_ext <<_ACEOF
10192 #line 10192 "configure"
10193 #include "confdefs.h"
10194
10195 /* Override any gcc2 internal prototype to avoid an error.  */
10196 #ifdef __cplusplus
10197 extern "C"
10198 #endif
10199 /* We use char because int might match the return type of a gcc2
10200    builtin and then its argument prototype would still apply.  */
10201 char remove ();
10202 int
10203 main ()
10204 {
10205 remove ();
10206   ;
10207   return 0;
10208 }
10209 _ACEOF
10210 rm -f conftest.$ac_objext conftest$ac_exeext
10211 if { (eval echo "$as_me:10211: \"$ac_link\"") >&5
10212   (eval $ac_link) 2>&5
10213   ac_status=$?
10214   echo "$as_me:10214: \$? = $ac_status" >&5
10215   (exit $ac_status); } &&
10216          { ac_try='test -s conftest$ac_exeext'
10217   { (eval echo "$as_me:10217: \"$ac_try\"") >&5
10218   (eval $ac_try) 2>&5
10219   ac_status=$?
10220   echo "$as_me:10220: \$? = $ac_status" >&5
10221   (exit $ac_status); }; }; then
10222   ac_cv_lib_posix_remove=yes
10223 else
10224   echo "$as_me: failed program was:" >&5
10225 cat conftest.$ac_ext >&5
10226 ac_cv_lib_posix_remove=no
10227 fi
10228 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10229 LIBS=$ac_check_lib_save_LIBS
10230 fi
10231 echo "$as_me:10231: result: $ac_cv_lib_posix_remove" >&5
10232 echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6
10233 if test $ac_cv_lib_posix_remove = yes; then
10234   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
10235 fi
10236
10237     fi
10238
10239     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
10240     echo "$as_me:10240: checking for shmat" >&5
10241 echo $ECHO_N "checking for shmat... $ECHO_C" >&6
10242 if test "${ac_cv_func_shmat+set}" = set; then
10243   echo $ECHO_N "(cached) $ECHO_C" >&6
10244 else
10245   cat >conftest.$ac_ext <<_ACEOF
10246 #line 10246 "configure"
10247 #include "confdefs.h"
10248 /* System header to define __stub macros and hopefully few prototypes,
10249     which can conflict with char shmat (); below.  */
10250 #include <assert.h>
10251 /* Override any gcc2 internal prototype to avoid an error.  */
10252 #ifdef __cplusplus
10253 extern "C"
10254 #endif
10255 /* We use char because int might match the return type of a gcc2
10256    builtin and then its argument prototype would still apply.  */
10257 char shmat ();
10258 char (*f) ();
10259
10260 int
10261 main ()
10262 {
10263 /* The GNU C library defines this for functions which it implements
10264     to always fail with ENOSYS.  Some functions are actually named
10265     something starting with __ and the normal name is an alias.  */
10266 #if defined (__stub_shmat) || defined (__stub___shmat)
10267 choke me
10268 #else
10269 f = shmat; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
10270 #endif
10271
10272   ;
10273   return 0;
10274 }
10275 _ACEOF
10276 rm -f conftest.$ac_objext conftest$ac_exeext
10277 if { (eval echo "$as_me:10277: \"$ac_link\"") >&5
10278   (eval $ac_link) 2>&5
10279   ac_status=$?
10280   echo "$as_me:10280: \$? = $ac_status" >&5
10281   (exit $ac_status); } &&
10282          { ac_try='test -s conftest$ac_exeext'
10283   { (eval echo "$as_me:10283: \"$ac_try\"") >&5
10284   (eval $ac_try) 2>&5
10285   ac_status=$?
10286   echo "$as_me:10286: \$? = $ac_status" >&5
10287   (exit $ac_status); }; }; then
10288   ac_cv_func_shmat=yes
10289 else
10290   echo "$as_me: failed program was:" >&5
10291 cat conftest.$ac_ext >&5
10292 ac_cv_func_shmat=no
10293 fi
10294 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10295 fi
10296 echo "$as_me:10296: result: $ac_cv_func_shmat" >&5
10297 echo "${ECHO_T}$ac_cv_func_shmat" >&6
10298
10299     if test $ac_cv_func_shmat = no; then
10300       echo "$as_me:10300: checking for shmat in -lipc" >&5
10301 echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6
10302 if test "${ac_cv_lib_ipc_shmat+set}" = set; then
10303   echo $ECHO_N "(cached) $ECHO_C" >&6
10304 else
10305   ac_check_lib_save_LIBS=$LIBS
10306 LIBS="-lipc  $LIBS"
10307 cat >conftest.$ac_ext <<_ACEOF
10308 #line 10308 "configure"
10309 #include "confdefs.h"
10310
10311 /* Override any gcc2 internal prototype to avoid an error.  */
10312 #ifdef __cplusplus
10313 extern "C"
10314 #endif
10315 /* We use char because int might match the return type of a gcc2
10316    builtin and then its argument prototype would still apply.  */
10317 char shmat ();
10318 int
10319 main ()
10320 {
10321 shmat ();
10322   ;
10323   return 0;
10324 }
10325 _ACEOF
10326 rm -f conftest.$ac_objext conftest$ac_exeext
10327 if { (eval echo "$as_me:10327: \"$ac_link\"") >&5
10328   (eval $ac_link) 2>&5
10329   ac_status=$?
10330   echo "$as_me:10330: \$? = $ac_status" >&5
10331   (exit $ac_status); } &&
10332          { ac_try='test -s conftest$ac_exeext'
10333   { (eval echo "$as_me:10333: \"$ac_try\"") >&5
10334   (eval $ac_try) 2>&5
10335   ac_status=$?
10336   echo "$as_me:10336: \$? = $ac_status" >&5
10337   (exit $ac_status); }; }; then
10338   ac_cv_lib_ipc_shmat=yes
10339 else
10340   echo "$as_me: failed program was:" >&5
10341 cat conftest.$ac_ext >&5
10342 ac_cv_lib_ipc_shmat=no
10343 fi
10344 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10345 LIBS=$ac_check_lib_save_LIBS
10346 fi
10347 echo "$as_me:10347: result: $ac_cv_lib_ipc_shmat" >&5
10348 echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6
10349 if test $ac_cv_lib_ipc_shmat = yes; then
10350   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
10351 fi
10352
10353     fi
10354   fi
10355
10356   # Check for libraries that X11R6 Xt/Xaw programs need.
10357   ac_save_LDFLAGS=$LDFLAGS
10358   test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
10359   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
10360   # check for ICE first), but we must link in the order -lSM -lICE or
10361   # we get undefined symbols.  So assume we have SM if we have ICE.
10362   # These have to be linked with before -lX11, unlike the other
10363   # libraries we check for below, so use a different variable.
10364   # John Interrante, Karl Berry
10365   echo "$as_me:10365: checking for IceConnectionNumber in -lICE" >&5
10366 echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6
10367 if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then
10368   echo $ECHO_N "(cached) $ECHO_C" >&6
10369 else
10370   ac_check_lib_save_LIBS=$LIBS
10371 LIBS="-lICE $X_EXTRA_LIBS $LIBS"
10372 cat >conftest.$ac_ext <<_ACEOF
10373 #line 10373 "configure"
10374 #include "confdefs.h"
10375
10376 /* Override any gcc2 internal prototype to avoid an error.  */
10377 #ifdef __cplusplus
10378 extern "C"
10379 #endif
10380 /* We use char because int might match the return type of a gcc2
10381    builtin and then its argument prototype would still apply.  */
10382 char IceConnectionNumber ();
10383 int
10384 main ()
10385 {
10386 IceConnectionNumber ();
10387   ;
10388   return 0;
10389 }
10390 _ACEOF
10391 rm -f conftest.$ac_objext conftest$ac_exeext
10392 if { (eval echo "$as_me:10392: \"$ac_link\"") >&5
10393   (eval $ac_link) 2>&5
10394   ac_status=$?
10395   echo "$as_me:10395: \$? = $ac_status" >&5
10396   (exit $ac_status); } &&
10397          { ac_try='test -s conftest$ac_exeext'
10398   { (eval echo "$as_me:10398: \"$ac_try\"") >&5
10399   (eval $ac_try) 2>&5
10400   ac_status=$?
10401   echo "$as_me:10401: \$? = $ac_status" >&5
10402   (exit $ac_status); }; }; then
10403   ac_cv_lib_ICE_IceConnectionNumber=yes
10404 else
10405   echo "$as_me: failed program was:" >&5
10406 cat conftest.$ac_ext >&5
10407 ac_cv_lib_ICE_IceConnectionNumber=no
10408 fi
10409 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10410 LIBS=$ac_check_lib_save_LIBS
10411 fi
10412 echo "$as_me:10412: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
10413 echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6
10414 if test $ac_cv_lib_ICE_IceConnectionNumber = yes; then
10415   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
10416 fi
10417
10418   LDFLAGS=$ac_save_LDFLAGS
10419
10420 fi
10421
10422 cf_x_athena=${cf_x_athena:-Xaw}
10423
10424 echo "$as_me:10424: checking if you want to link with Xaw 3d library" >&5
10425 echo $ECHO_N "checking if you want to link with Xaw 3d library... $ECHO_C" >&6
10426 withval=
10427
10428 # Check whether --with-Xaw3d or --without-Xaw3d was given.
10429 if test "${with_Xaw3d+set}" = set; then
10430   withval="$with_Xaw3d"
10431
10432 fi;
10433 if test "$withval" = yes ; then
10434         cf_x_athena=Xaw3d
10435         echo "$as_me:10435: result: yes" >&5
10436 echo "${ECHO_T}yes" >&6
10437 else
10438         echo "$as_me:10438: result: no" >&5
10439 echo "${ECHO_T}no" >&6
10440 fi
10441
10442 echo "$as_me:10442: checking if you want to link with Xaw 3d xft library" >&5
10443 echo $ECHO_N "checking if you want to link with Xaw 3d xft library... $ECHO_C" >&6
10444 withval=
10445
10446 # Check whether --with-Xaw3dxft or --without-Xaw3dxft was given.
10447 if test "${with_Xaw3dxft+set}" = set; then
10448   withval="$with_Xaw3dxft"
10449
10450 fi;
10451 if test "$withval" = yes ; then
10452         cf_x_athena=Xaw3dxft
10453         echo "$as_me:10453: result: yes" >&5
10454 echo "${ECHO_T}yes" >&6
10455 else
10456         echo "$as_me:10456: result: no" >&5
10457 echo "${ECHO_T}no" >&6
10458 fi
10459
10460 echo "$as_me:10460: checking if you want to link with neXT Athena library" >&5
10461 echo $ECHO_N "checking if you want to link with neXT Athena library... $ECHO_C" >&6
10462 withval=
10463
10464 # Check whether --with-neXtaw or --without-neXtaw was given.
10465 if test "${with_neXtaw+set}" = set; then
10466   withval="$with_neXtaw"
10467
10468 fi;
10469 if test "$withval" = yes ; then
10470         cf_x_athena=neXtaw
10471         echo "$as_me:10471: result: yes" >&5
10472 echo "${ECHO_T}yes" >&6
10473 else
10474         echo "$as_me:10474: result: no" >&5
10475 echo "${ECHO_T}no" >&6
10476 fi
10477
10478 echo "$as_me:10478: checking if you want to link with Athena-Plus library" >&5
10479 echo $ECHO_N "checking if you want to link with Athena-Plus library... $ECHO_C" >&6
10480 withval=
10481
10482 # Check whether --with-XawPlus or --without-XawPlus was given.
10483 if test "${with_XawPlus+set}" = set; then
10484   withval="$with_XawPlus"
10485
10486 fi;
10487 if test "$withval" = yes ; then
10488         cf_x_athena=XawPlus
10489         echo "$as_me:10489: result: yes" >&5
10490 echo "${ECHO_T}yes" >&6
10491 else
10492         echo "$as_me:10492: result: no" >&5
10493 echo "${ECHO_T}no" >&6
10494 fi
10495
10496 cf_x_athena_lib=""
10497
10498 if test "$PKG_CONFIG" != none ; then
10499         cf_athena_list=
10500         test "$cf_x_athena" = Xaw && cf_athena_list="xaw8 xaw7 xaw6"
10501         for cf_athena_pkg in \
10502                 $cf_athena_list \
10503                 ${cf_x_athena} \
10504                 ${cf_x_athena}-devel \
10505                 lib${cf_x_athena} \
10506                 lib${cf_x_athena}-devel
10507         do
10508
10509 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists $cf_athena_pkg; then
10510         test -n "$verbose" && echo "    found package $cf_athena_pkg" 1>&6
10511
10512 echo "${as_me:-configure}:10512: testing found package $cf_athena_pkg ..." 1>&5
10513
10514         cf_pkgconfig_incs="`$PKG_CONFIG --cflags $cf_athena_pkg 2>/dev/null`"
10515         cf_pkgconfig_libs="`$PKG_CONFIG --libs   $cf_athena_pkg 2>/dev/null`"
10516         test -n "$verbose" && echo "    package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs" 1>&6
10517
10518 echo "${as_me:-configure}:10518: testing package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs ..." 1>&5
10519
10520         test -n "$verbose" && echo "    package $cf_athena_pkg LIBS: $cf_pkgconfig_libs" 1>&6
10521
10522 echo "${as_me:-configure}:10522: testing package $cf_athena_pkg LIBS: $cf_pkgconfig_libs ..." 1>&5
10523
10524 cf_fix_cppflags=no
10525 cf_new_cflags=
10526 cf_new_cppflags=
10527 cf_new_extra_cppflags=
10528
10529 for cf_add_cflags in $cf_pkgconfig_incs
10530 do
10531 case $cf_fix_cppflags in
10532 (no)
10533         case $cf_add_cflags in
10534         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10535                 case $cf_add_cflags in
10536                 (-D*)
10537                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10538
10539                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10540                                 && test -z "${cf_tst_cflags}" \
10541                                 && cf_fix_cppflags=yes
10542
10543                         if test $cf_fix_cppflags = yes ; then
10544                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10545                                 continue
10546                         elif test "${cf_tst_cflags}" = "\"'" ; then
10547                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10548                                 continue
10549                         fi
10550                         ;;
10551                 esac
10552                 case "$CPPFLAGS" in
10553                 (*$cf_add_cflags)
10554                         ;;
10555                 (*)
10556                         case $cf_add_cflags in
10557                         (-D*)
10558                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10559
10560 CPPFLAGS=`echo "$CPPFLAGS" | \
10561         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10562                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10563
10564                                 ;;
10565                         esac
10566                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10567                         ;;
10568                 esac
10569                 ;;
10570         (*)
10571                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10572                 ;;
10573         esac
10574         ;;
10575 (yes)
10576         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10577
10578         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10579
10580         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10581                 && test -z "${cf_tst_cflags}" \
10582                 && cf_fix_cppflags=no
10583         ;;
10584 esac
10585 done
10586
10587 if test -n "$cf_new_cflags" ; then
10588
10589         CFLAGS="$CFLAGS $cf_new_cflags"
10590 fi
10591
10592 if test -n "$cf_new_cppflags" ; then
10593
10594         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10595 fi
10596
10597 if test -n "$cf_new_extra_cppflags" ; then
10598
10599         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10600 fi
10601
10602 cf_add_libs="$cf_pkgconfig_libs"
10603 # Filter out duplicates - this happens with badly-designed ".pc" files...
10604 for cf_add_1lib in $LIBS
10605 do
10606         for cf_add_2lib in $cf_add_libs
10607         do
10608                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
10609                 then
10610                         cf_add_1lib=
10611                         break
10612                 fi
10613         done
10614         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
10615 done
10616 LIBS="$cf_add_libs"
10617
10618                         cf_x_athena_lib="$cf_pkgconfig_libs"
10619
10620 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
10621
10622                         cat >>confdefs.h <<EOF
10623 #define $cf_x_athena_LIBS 1
10624 EOF
10625
10626         for cf_trim_lib in Xmu Xt X11
10627         do
10628                 case "$LIBS" in
10629                 (*-l$cf_trim_lib\ *-l$cf_trim_lib*)
10630                         LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
10631                         test -n "$verbose" && echo "    ..trimmed $LIBS" 1>&6
10632
10633 echo "${as_me:-configure}:10633: testing ..trimmed $LIBS ..." 1>&5
10634
10635                         ;;
10636                 esac
10637         done
10638
10639 echo "$as_me:10639: checking for usable $cf_x_athena/Xmu package" >&5
10640 echo $ECHO_N "checking for usable $cf_x_athena/Xmu package... $ECHO_C" >&6
10641 if test "${cf_cv_xaw_compat+set}" = set; then
10642   echo $ECHO_N "(cached) $ECHO_C" >&6
10643 else
10644
10645 cat >conftest.$ac_ext <<_ACEOF
10646 #line 10646 "configure"
10647 #include "confdefs.h"
10648
10649 #include <X11/Xmu/CharSet.h>
10650
10651 int
10652 main ()
10653 {
10654
10655 int check = XmuCompareISOLatin1("big", "small")
10656
10657   ;
10658   return 0;
10659 }
10660 _ACEOF
10661 rm -f conftest.$ac_objext conftest$ac_exeext
10662 if { (eval echo "$as_me:10662: \"$ac_link\"") >&5
10663   (eval $ac_link) 2>&5
10664   ac_status=$?
10665   echo "$as_me:10665: \$? = $ac_status" >&5
10666   (exit $ac_status); } &&
10667          { ac_try='test -s conftest$ac_exeext'
10668   { (eval echo "$as_me:10668: \"$ac_try\"") >&5
10669   (eval $ac_try) 2>&5
10670   ac_status=$?
10671   echo "$as_me:10671: \$? = $ac_status" >&5
10672   (exit $ac_status); }; }; then
10673   cf_cv_xaw_compat=yes
10674 else
10675   echo "$as_me: failed program was:" >&5
10676 cat conftest.$ac_ext >&5
10677 cf_cv_xaw_compat=no
10678 fi
10679 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10680 fi
10681 echo "$as_me:10681: result: $cf_cv_xaw_compat" >&5
10682 echo "${ECHO_T}$cf_cv_xaw_compat" >&6
10683
10684                         if test "$cf_cv_xaw_compat" = no
10685                         then
10686                                 # workaround for broken ".pc" files...
10687                                 case "$cf_x_athena_lib" in
10688                                 (*-lXmu*)
10689                                         ;;
10690                                 (*)
10691                                         test -n "$verbose" && echo "    work around broken package" 1>&6
10692
10693 echo "${as_me:-configure}:10693: testing work around broken package ..." 1>&5
10694
10695                                         cf_save_xmu="$LIBS"
10696                                         cf_first_lib=`echo "$cf_save_xmu" | sed -e 's/^  *//' -e 's/ .*//'`
10697
10698 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xmu; then
10699         test -n "$verbose" && echo "    found package xmu" 1>&6
10700
10701 echo "${as_me:-configure}:10701: testing found package xmu ..." 1>&5
10702
10703         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xmu 2>/dev/null`"
10704         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xmu 2>/dev/null`"
10705         test -n "$verbose" && echo "    package xmu CFLAGS: $cf_pkgconfig_incs" 1>&6
10706
10707 echo "${as_me:-configure}:10707: testing package xmu CFLAGS: $cf_pkgconfig_incs ..." 1>&5
10708
10709         test -n "$verbose" && echo "    package xmu LIBS: $cf_pkgconfig_libs" 1>&6
10710
10711 echo "${as_me:-configure}:10711: testing package xmu LIBS: $cf_pkgconfig_libs ..." 1>&5
10712
10713 cf_fix_cppflags=no
10714 cf_new_cflags=
10715 cf_new_cppflags=
10716 cf_new_extra_cppflags=
10717
10718 for cf_add_cflags in $cf_pkgconfig_incs
10719 do
10720 case $cf_fix_cppflags in
10721 (no)
10722         case $cf_add_cflags in
10723         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10724                 case $cf_add_cflags in
10725                 (-D*)
10726                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10727
10728                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10729                                 && test -z "${cf_tst_cflags}" \
10730                                 && cf_fix_cppflags=yes
10731
10732                         if test $cf_fix_cppflags = yes ; then
10733                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10734                                 continue
10735                         elif test "${cf_tst_cflags}" = "\"'" ; then
10736                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10737                                 continue
10738                         fi
10739                         ;;
10740                 esac
10741                 case "$CPPFLAGS" in
10742                 (*$cf_add_cflags)
10743                         ;;
10744                 (*)
10745                         case $cf_add_cflags in
10746                         (-D*)
10747                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10748
10749 CPPFLAGS=`echo "$CPPFLAGS" | \
10750         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10751                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10752
10753                                 ;;
10754                         esac
10755                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10756                         ;;
10757                 esac
10758                 ;;
10759         (*)
10760                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10761                 ;;
10762         esac
10763         ;;
10764 (yes)
10765         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10766
10767         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10768
10769         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10770                 && test -z "${cf_tst_cflags}" \
10771                 && cf_fix_cppflags=no
10772         ;;
10773 esac
10774 done
10775
10776 if test -n "$cf_new_cflags" ; then
10777
10778         CFLAGS="$CFLAGS $cf_new_cflags"
10779 fi
10780
10781 if test -n "$cf_new_cppflags" ; then
10782
10783         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10784 fi
10785
10786 if test -n "$cf_new_extra_cppflags" ; then
10787
10788         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10789 fi
10790
10791 cf_add_libs="$cf_pkgconfig_libs"
10792 # Filter out duplicates - this happens with badly-designed ".pc" files...
10793 for cf_add_1lib in $LIBS
10794 do
10795         for cf_add_2lib in $cf_add_libs
10796         do
10797                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
10798                 then
10799                         cf_add_1lib=
10800                         break
10801                 fi
10802         done
10803         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
10804 done
10805 LIBS="$cf_add_libs"
10806
10807                                                         LIBS="$cf_save_xmu"
10808
10809 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
10810
10811 echo "${as_me:-configure}:10811: testing ...before $LIBS ..." 1>&5
10812
10813 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib $cf_pkgconfig_libs %" -e 's%  % %g'`
10814 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
10815
10816 echo "${as_me:-configure}:10816: testing ...after  $LIBS ..." 1>&5
10817
10818 else
10819         cf_pkgconfig_incs=
10820         cf_pkgconfig_libs=
10821
10822 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
10823
10824 echo "${as_me:-configure}:10824: testing ...before $LIBS ..." 1>&5
10825
10826 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib -lXmu %" -e 's%  % %g'`
10827 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
10828
10829 echo "${as_me:-configure}:10829: testing ...after  $LIBS ..." 1>&5
10830
10831 fi
10832
10833         for cf_trim_lib in Xmu Xt X11
10834         do
10835                 case "$LIBS" in
10836                 (*-l$cf_trim_lib\ *-l$cf_trim_lib*)
10837                         LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
10838                         test -n "$verbose" && echo "    ..trimmed $LIBS" 1>&6
10839
10840 echo "${as_me:-configure}:10840: testing ..trimmed $LIBS ..." 1>&5
10841
10842                         ;;
10843                 esac
10844         done
10845
10846                                         ;;
10847                                 esac
10848                         fi
10849
10850                         break
10851 else
10852         cf_pkgconfig_incs=
10853         cf_pkgconfig_libs=
10854         :
10855 fi
10856
10857         done
10858 fi
10859
10860 if test -z "$cf_x_athena_lib" ; then
10861
10862 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists Xext; then
10863         test -n "$verbose" && echo "    found package Xext" 1>&6
10864
10865 echo "${as_me:-configure}:10865: testing found package Xext ..." 1>&5
10866
10867         cf_pkgconfig_incs="`$PKG_CONFIG --cflags Xext 2>/dev/null`"
10868         cf_pkgconfig_libs="`$PKG_CONFIG --libs   Xext 2>/dev/null`"
10869         test -n "$verbose" && echo "    package Xext CFLAGS: $cf_pkgconfig_incs" 1>&6
10870
10871 echo "${as_me:-configure}:10871: testing package Xext CFLAGS: $cf_pkgconfig_incs ..." 1>&5
10872
10873         test -n "$verbose" && echo "    package Xext LIBS: $cf_pkgconfig_libs" 1>&6
10874
10875 echo "${as_me:-configure}:10875: testing package Xext LIBS: $cf_pkgconfig_libs ..." 1>&5
10876
10877 cf_fix_cppflags=no
10878 cf_new_cflags=
10879 cf_new_cppflags=
10880 cf_new_extra_cppflags=
10881
10882 for cf_add_cflags in $cf_pkgconfig_incs
10883 do
10884 case $cf_fix_cppflags in
10885 (no)
10886         case $cf_add_cflags in
10887         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10888                 case $cf_add_cflags in
10889                 (-D*)
10890                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10891
10892                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10893                                 && test -z "${cf_tst_cflags}" \
10894                                 && cf_fix_cppflags=yes
10895
10896                         if test $cf_fix_cppflags = yes ; then
10897                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10898                                 continue
10899                         elif test "${cf_tst_cflags}" = "\"'" ; then
10900                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10901                                 continue
10902                         fi
10903                         ;;
10904                 esac
10905                 case "$CPPFLAGS" in
10906                 (*$cf_add_cflags)
10907                         ;;
10908                 (*)
10909                         case $cf_add_cflags in
10910                         (-D*)
10911                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10912
10913 CPPFLAGS=`echo "$CPPFLAGS" | \
10914         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10915                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10916
10917                                 ;;
10918                         esac
10919                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10920                         ;;
10921                 esac
10922                 ;;
10923         (*)
10924                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10925                 ;;
10926         esac
10927         ;;
10928 (yes)
10929         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10930
10931         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10932
10933         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10934                 && test -z "${cf_tst_cflags}" \
10935                 && cf_fix_cppflags=no
10936         ;;
10937 esac
10938 done
10939
10940 if test -n "$cf_new_cflags" ; then
10941
10942         CFLAGS="$CFLAGS $cf_new_cflags"
10943 fi
10944
10945 if test -n "$cf_new_cppflags" ; then
10946
10947         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10948 fi
10949
10950 if test -n "$cf_new_extra_cppflags" ; then
10951
10952         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10953 fi
10954
10955 cf_add_libs="$cf_pkgconfig_libs"
10956 # Filter out duplicates - this happens with badly-designed ".pc" files...
10957 for cf_add_1lib in $LIBS
10958 do
10959         for cf_add_2lib in $cf_add_libs
10960         do
10961                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
10962                 then
10963                         cf_add_1lib=
10964                         break
10965                 fi
10966         done
10967         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
10968 done
10969 LIBS="$cf_add_libs"
10970
10971         :
10972 else
10973         cf_pkgconfig_incs=
10974         cf_pkgconfig_libs=
10975
10976         echo "$as_me:10976: checking for XextCreateExtension in -lXext" >&5
10977 echo $ECHO_N "checking for XextCreateExtension in -lXext... $ECHO_C" >&6
10978 if test "${ac_cv_lib_Xext_XextCreateExtension+set}" = set; then
10979   echo $ECHO_N "(cached) $ECHO_C" >&6
10980 else
10981   ac_check_lib_save_LIBS=$LIBS
10982 LIBS="-lXext  $LIBS"
10983 cat >conftest.$ac_ext <<_ACEOF
10984 #line 10984 "configure"
10985 #include "confdefs.h"
10986
10987 /* Override any gcc2 internal prototype to avoid an error.  */
10988 #ifdef __cplusplus
10989 extern "C"
10990 #endif
10991 /* We use char because int might match the return type of a gcc2
10992    builtin and then its argument prototype would still apply.  */
10993 char XextCreateExtension ();
10994 int
10995 main ()
10996 {
10997 XextCreateExtension ();
10998   ;
10999   return 0;
11000 }
11001 _ACEOF
11002 rm -f conftest.$ac_objext conftest$ac_exeext
11003 if { (eval echo "$as_me:11003: \"$ac_link\"") >&5
11004   (eval $ac_link) 2>&5
11005   ac_status=$?
11006   echo "$as_me:11006: \$? = $ac_status" >&5
11007   (exit $ac_status); } &&
11008          { ac_try='test -s conftest$ac_exeext'
11009   { (eval echo "$as_me:11009: \"$ac_try\"") >&5
11010   (eval $ac_try) 2>&5
11011   ac_status=$?
11012   echo "$as_me:11012: \$? = $ac_status" >&5
11013   (exit $ac_status); }; }; then
11014   ac_cv_lib_Xext_XextCreateExtension=yes
11015 else
11016   echo "$as_me: failed program was:" >&5
11017 cat conftest.$ac_ext >&5
11018 ac_cv_lib_Xext_XextCreateExtension=no
11019 fi
11020 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11021 LIBS=$ac_check_lib_save_LIBS
11022 fi
11023 echo "$as_me:11023: result: $ac_cv_lib_Xext_XextCreateExtension" >&5
11024 echo "${ECHO_T}$ac_cv_lib_Xext_XextCreateExtension" >&6
11025 if test $ac_cv_lib_Xext_XextCreateExtension = yes; then
11026
11027 cf_add_libs="-lXext"
11028 # Filter out duplicates - this happens with badly-designed ".pc" files...
11029 for cf_add_1lib in $LIBS
11030 do
11031         for cf_add_2lib in $cf_add_libs
11032         do
11033                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11034                 then
11035                         cf_add_1lib=
11036                         break
11037                 fi
11038         done
11039         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11040 done
11041 LIBS="$cf_add_libs"
11042
11043 fi
11044
11045 fi
11046
11047 # OSX is schizoid about who owns /usr/X11 (old) versus /opt/X11 (new), and (and
11048 # in some cases has installed dummy files in the former, other cases replaced
11049 # it with a link to the new location).  This complicates the configure script.
11050 # Check for that pitfall, and recover using pkg-config
11051 #
11052 # If none of these are set, the configuration is almost certainly broken.
11053 if test -z "${X_CFLAGS}${X_PRE_LIBS}${X_LIBS}${X_EXTRA_LIBS}"
11054 then
11055
11056 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists x11; then
11057         test -n "$verbose" && echo "    found package x11" 1>&6
11058
11059 echo "${as_me:-configure}:11059: testing found package x11 ..." 1>&5
11060
11061         cf_pkgconfig_incs="`$PKG_CONFIG --cflags x11 2>/dev/null`"
11062         cf_pkgconfig_libs="`$PKG_CONFIG --libs   x11 2>/dev/null`"
11063         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
11064
11065 echo "${as_me:-configure}:11065: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11066
11067         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
11068
11069 echo "${as_me:-configure}:11069: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
11070
11071 cf_fix_cppflags=no
11072 cf_new_cflags=
11073 cf_new_cppflags=
11074 cf_new_extra_cppflags=
11075
11076 for cf_add_cflags in $cf_pkgconfig_incs
11077 do
11078 case $cf_fix_cppflags in
11079 (no)
11080         case $cf_add_cflags in
11081         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11082                 case $cf_add_cflags in
11083                 (-D*)
11084                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11085
11086                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11087                                 && test -z "${cf_tst_cflags}" \
11088                                 && cf_fix_cppflags=yes
11089
11090                         if test $cf_fix_cppflags = yes ; then
11091                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11092                                 continue
11093                         elif test "${cf_tst_cflags}" = "\"'" ; then
11094                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11095                                 continue
11096                         fi
11097                         ;;
11098                 esac
11099                 case "$CPPFLAGS" in
11100                 (*$cf_add_cflags)
11101                         ;;
11102                 (*)
11103                         case $cf_add_cflags in
11104                         (-D*)
11105                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11106
11107 CPPFLAGS=`echo "$CPPFLAGS" | \
11108         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11109                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11110
11111                                 ;;
11112                         esac
11113                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11114                         ;;
11115                 esac
11116                 ;;
11117         (*)
11118                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11119                 ;;
11120         esac
11121         ;;
11122 (yes)
11123         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11124
11125         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11126
11127         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11128                 && test -z "${cf_tst_cflags}" \
11129                 && cf_fix_cppflags=no
11130         ;;
11131 esac
11132 done
11133
11134 if test -n "$cf_new_cflags" ; then
11135
11136         CFLAGS="$CFLAGS $cf_new_cflags"
11137 fi
11138
11139 if test -n "$cf_new_cppflags" ; then
11140
11141         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11142 fi
11143
11144 if test -n "$cf_new_extra_cppflags" ; then
11145
11146         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11147 fi
11148
11149 cf_add_libs="$cf_pkgconfig_libs"
11150 # Filter out duplicates - this happens with badly-designed ".pc" files...
11151 for cf_add_1lib in $LIBS
11152 do
11153         for cf_add_2lib in $cf_add_libs
11154         do
11155                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11156                 then
11157                         cf_add_1lib=
11158                         break
11159                 fi
11160         done
11161         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11162 done
11163 LIBS="$cf_add_libs"
11164
11165         :
11166 else
11167         cf_pkgconfig_incs=
11168         cf_pkgconfig_libs=
11169         { echo "$as_me:11169: WARNING: unable to find X11 library" >&5
11170 echo "$as_me: WARNING: unable to find X11 library" >&2;}
11171 fi
11172
11173 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists ice; then
11174         test -n "$verbose" && echo "    found package ice" 1>&6
11175
11176 echo "${as_me:-configure}:11176: testing found package ice ..." 1>&5
11177
11178         cf_pkgconfig_incs="`$PKG_CONFIG --cflags ice 2>/dev/null`"
11179         cf_pkgconfig_libs="`$PKG_CONFIG --libs   ice 2>/dev/null`"
11180         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
11181
11182 echo "${as_me:-configure}:11182: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11183
11184         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
11185
11186 echo "${as_me:-configure}:11186: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
11187
11188 cf_fix_cppflags=no
11189 cf_new_cflags=
11190 cf_new_cppflags=
11191 cf_new_extra_cppflags=
11192
11193 for cf_add_cflags in $cf_pkgconfig_incs
11194 do
11195 case $cf_fix_cppflags in
11196 (no)
11197         case $cf_add_cflags in
11198         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11199                 case $cf_add_cflags in
11200                 (-D*)
11201                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11202
11203                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11204                                 && test -z "${cf_tst_cflags}" \
11205                                 && cf_fix_cppflags=yes
11206
11207                         if test $cf_fix_cppflags = yes ; then
11208                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11209                                 continue
11210                         elif test "${cf_tst_cflags}" = "\"'" ; then
11211                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11212                                 continue
11213                         fi
11214                         ;;
11215                 esac
11216                 case "$CPPFLAGS" in
11217                 (*$cf_add_cflags)
11218                         ;;
11219                 (*)
11220                         case $cf_add_cflags in
11221                         (-D*)
11222                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11223
11224 CPPFLAGS=`echo "$CPPFLAGS" | \
11225         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11226                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11227
11228                                 ;;
11229                         esac
11230                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11231                         ;;
11232                 esac
11233                 ;;
11234         (*)
11235                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11236                 ;;
11237         esac
11238         ;;
11239 (yes)
11240         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11241
11242         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11243
11244         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11245                 && test -z "${cf_tst_cflags}" \
11246                 && cf_fix_cppflags=no
11247         ;;
11248 esac
11249 done
11250
11251 if test -n "$cf_new_cflags" ; then
11252
11253         CFLAGS="$CFLAGS $cf_new_cflags"
11254 fi
11255
11256 if test -n "$cf_new_cppflags" ; then
11257
11258         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11259 fi
11260
11261 if test -n "$cf_new_extra_cppflags" ; then
11262
11263         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11264 fi
11265
11266 cf_add_libs="$cf_pkgconfig_libs"
11267 # Filter out duplicates - this happens with badly-designed ".pc" files...
11268 for cf_add_1lib in $LIBS
11269 do
11270         for cf_add_2lib in $cf_add_libs
11271         do
11272                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11273                 then
11274                         cf_add_1lib=
11275                         break
11276                 fi
11277         done
11278         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11279 done
11280 LIBS="$cf_add_libs"
11281
11282         :
11283 else
11284         cf_pkgconfig_incs=
11285         cf_pkgconfig_libs=
11286         { echo "$as_me:11286: WARNING: unable to find ICE library" >&5
11287 echo "$as_me: WARNING: unable to find ICE library" >&2;}
11288 fi
11289
11290 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists sm; then
11291         test -n "$verbose" && echo "    found package sm" 1>&6
11292
11293 echo "${as_me:-configure}:11293: testing found package sm ..." 1>&5
11294
11295         cf_pkgconfig_incs="`$PKG_CONFIG --cflags sm 2>/dev/null`"
11296         cf_pkgconfig_libs="`$PKG_CONFIG --libs   sm 2>/dev/null`"
11297         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
11298
11299 echo "${as_me:-configure}:11299: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11300
11301         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
11302
11303 echo "${as_me:-configure}:11303: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
11304
11305 cf_fix_cppflags=no
11306 cf_new_cflags=
11307 cf_new_cppflags=
11308 cf_new_extra_cppflags=
11309
11310 for cf_add_cflags in $cf_pkgconfig_incs
11311 do
11312 case $cf_fix_cppflags in
11313 (no)
11314         case $cf_add_cflags in
11315         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11316                 case $cf_add_cflags in
11317                 (-D*)
11318                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11319
11320                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11321                                 && test -z "${cf_tst_cflags}" \
11322                                 && cf_fix_cppflags=yes
11323
11324                         if test $cf_fix_cppflags = yes ; then
11325                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11326                                 continue
11327                         elif test "${cf_tst_cflags}" = "\"'" ; then
11328                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11329                                 continue
11330                         fi
11331                         ;;
11332                 esac
11333                 case "$CPPFLAGS" in
11334                 (*$cf_add_cflags)
11335                         ;;
11336                 (*)
11337                         case $cf_add_cflags in
11338                         (-D*)
11339                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11340
11341 CPPFLAGS=`echo "$CPPFLAGS" | \
11342         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11343                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11344
11345                                 ;;
11346                         esac
11347                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11348                         ;;
11349                 esac
11350                 ;;
11351         (*)
11352                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11353                 ;;
11354         esac
11355         ;;
11356 (yes)
11357         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11358
11359         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11360
11361         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11362                 && test -z "${cf_tst_cflags}" \
11363                 && cf_fix_cppflags=no
11364         ;;
11365 esac
11366 done
11367
11368 if test -n "$cf_new_cflags" ; then
11369
11370         CFLAGS="$CFLAGS $cf_new_cflags"
11371 fi
11372
11373 if test -n "$cf_new_cppflags" ; then
11374
11375         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11376 fi
11377
11378 if test -n "$cf_new_extra_cppflags" ; then
11379
11380         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11381 fi
11382
11383 cf_add_libs="$cf_pkgconfig_libs"
11384 # Filter out duplicates - this happens with badly-designed ".pc" files...
11385 for cf_add_1lib in $LIBS
11386 do
11387         for cf_add_2lib in $cf_add_libs
11388         do
11389                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11390                 then
11391                         cf_add_1lib=
11392                         break
11393                 fi
11394         done
11395         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11396 done
11397 LIBS="$cf_add_libs"
11398
11399         :
11400 else
11401         cf_pkgconfig_incs=
11402         cf_pkgconfig_libs=
11403         { echo "$as_me:11403: WARNING: unable to find SM library" >&5
11404 echo "$as_me: WARNING: unable to find SM library" >&2;}
11405 fi
11406
11407 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xt; then
11408         test -n "$verbose" && echo "    found package xt" 1>&6
11409
11410 echo "${as_me:-configure}:11410: testing found package xt ..." 1>&5
11411
11412         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xt 2>/dev/null`"
11413         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xt 2>/dev/null`"
11414         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
11415
11416 echo "${as_me:-configure}:11416: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11417
11418         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
11419
11420 echo "${as_me:-configure}:11420: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
11421
11422 cf_fix_cppflags=no
11423 cf_new_cflags=
11424 cf_new_cppflags=
11425 cf_new_extra_cppflags=
11426
11427 for cf_add_cflags in $cf_pkgconfig_incs
11428 do
11429 case $cf_fix_cppflags in
11430 (no)
11431         case $cf_add_cflags in
11432         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11433                 case $cf_add_cflags in
11434                 (-D*)
11435                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11436
11437                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11438                                 && test -z "${cf_tst_cflags}" \
11439                                 && cf_fix_cppflags=yes
11440
11441                         if test $cf_fix_cppflags = yes ; then
11442                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11443                                 continue
11444                         elif test "${cf_tst_cflags}" = "\"'" ; then
11445                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11446                                 continue
11447                         fi
11448                         ;;
11449                 esac
11450                 case "$CPPFLAGS" in
11451                 (*$cf_add_cflags)
11452                         ;;
11453                 (*)
11454                         case $cf_add_cflags in
11455                         (-D*)
11456                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11457
11458 CPPFLAGS=`echo "$CPPFLAGS" | \
11459         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11460                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11461
11462                                 ;;
11463                         esac
11464                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11465                         ;;
11466                 esac
11467                 ;;
11468         (*)
11469                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11470                 ;;
11471         esac
11472         ;;
11473 (yes)
11474         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11475
11476         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11477
11478         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11479                 && test -z "${cf_tst_cflags}" \
11480                 && cf_fix_cppflags=no
11481         ;;
11482 esac
11483 done
11484
11485 if test -n "$cf_new_cflags" ; then
11486
11487         CFLAGS="$CFLAGS $cf_new_cflags"
11488 fi
11489
11490 if test -n "$cf_new_cppflags" ; then
11491
11492         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11493 fi
11494
11495 if test -n "$cf_new_extra_cppflags" ; then
11496
11497         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11498 fi
11499
11500 cf_add_libs="$cf_pkgconfig_libs"
11501 # Filter out duplicates - this happens with badly-designed ".pc" files...
11502 for cf_add_1lib in $LIBS
11503 do
11504         for cf_add_2lib in $cf_add_libs
11505         do
11506                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11507                 then
11508                         cf_add_1lib=
11509                         break
11510                 fi
11511         done
11512         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11513 done
11514 LIBS="$cf_add_libs"
11515
11516         :
11517 else
11518         cf_pkgconfig_incs=
11519         cf_pkgconfig_libs=
11520         { echo "$as_me:11520: WARNING: unable to find Xt library" >&5
11521 echo "$as_me: WARNING: unable to find Xt library" >&2;}
11522 fi
11523
11524 fi
11525
11526 cf_have_X_LIBS=no
11527
11528 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xt; then
11529         test -n "$verbose" && echo "    found package xt" 1>&6
11530
11531 echo "${as_me:-configure}:11531: testing found package xt ..." 1>&5
11532
11533         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xt 2>/dev/null`"
11534         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xt 2>/dev/null`"
11535         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
11536
11537 echo "${as_me:-configure}:11537: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11538
11539         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
11540
11541 echo "${as_me:-configure}:11541: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
11542
11543 cf_fix_cppflags=no
11544 cf_new_cflags=
11545 cf_new_cppflags=
11546 cf_new_extra_cppflags=
11547
11548 for cf_add_cflags in $cf_pkgconfig_incs
11549 do
11550 case $cf_fix_cppflags in
11551 (no)
11552         case $cf_add_cflags in
11553         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11554                 case $cf_add_cflags in
11555                 (-D*)
11556                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11557
11558                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11559                                 && test -z "${cf_tst_cflags}" \
11560                                 && cf_fix_cppflags=yes
11561
11562                         if test $cf_fix_cppflags = yes ; then
11563                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11564                                 continue
11565                         elif test "${cf_tst_cflags}" = "\"'" ; then
11566                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11567                                 continue
11568                         fi
11569                         ;;
11570                 esac
11571                 case "$CPPFLAGS" in
11572                 (*$cf_add_cflags)
11573                         ;;
11574                 (*)
11575                         case $cf_add_cflags in
11576                         (-D*)
11577                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11578
11579 CPPFLAGS=`echo "$CPPFLAGS" | \
11580         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11581                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11582
11583                                 ;;
11584                         esac
11585                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11586                         ;;
11587                 esac
11588                 ;;
11589         (*)
11590                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11591                 ;;
11592         esac
11593         ;;
11594 (yes)
11595         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11596
11597         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11598
11599         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11600                 && test -z "${cf_tst_cflags}" \
11601                 && cf_fix_cppflags=no
11602         ;;
11603 esac
11604 done
11605
11606 if test -n "$cf_new_cflags" ; then
11607
11608         CFLAGS="$CFLAGS $cf_new_cflags"
11609 fi
11610
11611 if test -n "$cf_new_cppflags" ; then
11612
11613         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11614 fi
11615
11616 if test -n "$cf_new_extra_cppflags" ; then
11617
11618         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11619 fi
11620
11621 cf_add_libs="$cf_pkgconfig_libs"
11622 # Filter out duplicates - this happens with badly-designed ".pc" files...
11623 for cf_add_1lib in $LIBS
11624 do
11625         for cf_add_2lib in $cf_add_libs
11626         do
11627                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11628                 then
11629                         cf_add_1lib=
11630                         break
11631                 fi
11632         done
11633         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11634 done
11635 LIBS="$cf_add_libs"
11636
11637         case "x$LIBS" in
11638         (*-lX11*)
11639                 ;;
11640         (*)
11641 # we have an "xt" package, but it may omit Xt's dependency on X11
11642 echo "$as_me:11642: checking for usable X dependency" >&5
11643 echo $ECHO_N "checking for usable X dependency... $ECHO_C" >&6
11644 if test "${cf_cv_xt_x11_compat+set}" = set; then
11645   echo $ECHO_N "(cached) $ECHO_C" >&6
11646 else
11647
11648 cat >conftest.$ac_ext <<_ACEOF
11649 #line 11649 "configure"
11650 #include "confdefs.h"
11651
11652 #include <X11/Xlib.h>
11653
11654 int
11655 main ()
11656 {
11657
11658         int rc1 = XDrawLine((Display*) 0, (Drawable) 0, (GC) 0, 0, 0, 0, 0);
11659         int rc2 = XClearWindow((Display*) 0, (Window) 0);
11660         int rc3 = XMoveWindow((Display*) 0, (Window) 0, 0, 0);
11661         int rc4 = XMoveResizeWindow((Display*)0, (Window)0, 0, 0, 0, 0);
11662
11663   ;
11664   return 0;
11665 }
11666 _ACEOF
11667 rm -f conftest.$ac_objext conftest$ac_exeext
11668 if { (eval echo "$as_me:11668: \"$ac_link\"") >&5
11669   (eval $ac_link) 2>&5
11670   ac_status=$?
11671   echo "$as_me:11671: \$? = $ac_status" >&5
11672   (exit $ac_status); } &&
11673          { ac_try='test -s conftest$ac_exeext'
11674   { (eval echo "$as_me:11674: \"$ac_try\"") >&5
11675   (eval $ac_try) 2>&5
11676   ac_status=$?
11677   echo "$as_me:11677: \$? = $ac_status" >&5
11678   (exit $ac_status); }; }; then
11679   cf_cv_xt_x11_compat=yes
11680 else
11681   echo "$as_me: failed program was:" >&5
11682 cat conftest.$ac_ext >&5
11683 cf_cv_xt_x11_compat=no
11684 fi
11685 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11686 fi
11687 echo "$as_me:11687: result: $cf_cv_xt_x11_compat" >&5
11688 echo "${ECHO_T}$cf_cv_xt_x11_compat" >&6
11689                 if test "$cf_cv_xt_x11_compat" = no
11690                 then
11691                         test -n "$verbose" && echo "    work around broken X11 dependency" 1>&6
11692
11693 echo "${as_me:-configure}:11693: testing work around broken X11 dependency ..." 1>&5
11694
11695                         # 2010/11/19 - good enough until a working Xt on Xcb is delivered.
11696
11697 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists x11; then
11698         test -n "$verbose" && echo "    found package x11" 1>&6
11699
11700 echo "${as_me:-configure}:11700: testing found package x11 ..." 1>&5
11701
11702         cf_pkgconfig_incs="`$PKG_CONFIG --cflags x11 2>/dev/null`"
11703         cf_pkgconfig_libs="`$PKG_CONFIG --libs   x11 2>/dev/null`"
11704         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
11705
11706 echo "${as_me:-configure}:11706: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11707
11708         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
11709
11710 echo "${as_me:-configure}:11710: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
11711
11712 cf_fix_cppflags=no
11713 cf_new_cflags=
11714 cf_new_cppflags=
11715 cf_new_extra_cppflags=
11716
11717 for cf_add_cflags in $cf_pkgconfig_incs
11718 do
11719 case $cf_fix_cppflags in
11720 (no)
11721         case $cf_add_cflags in
11722         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11723                 case $cf_add_cflags in
11724                 (-D*)
11725                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11726
11727                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11728                                 && test -z "${cf_tst_cflags}" \
11729                                 && cf_fix_cppflags=yes
11730
11731                         if test $cf_fix_cppflags = yes ; then
11732                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11733                                 continue
11734                         elif test "${cf_tst_cflags}" = "\"'" ; then
11735                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11736                                 continue
11737                         fi
11738                         ;;
11739                 esac
11740                 case "$CPPFLAGS" in
11741                 (*$cf_add_cflags)
11742                         ;;
11743                 (*)
11744                         case $cf_add_cflags in
11745                         (-D*)
11746                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11747
11748 CPPFLAGS=`echo "$CPPFLAGS" | \
11749         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11750                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11751
11752                                 ;;
11753                         esac
11754                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11755                         ;;
11756                 esac
11757                 ;;
11758         (*)
11759                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11760                 ;;
11761         esac
11762         ;;
11763 (yes)
11764         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11765
11766         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11767
11768         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11769                 && test -z "${cf_tst_cflags}" \
11770                 && cf_fix_cppflags=no
11771         ;;
11772 esac
11773 done
11774
11775 if test -n "$cf_new_cflags" ; then
11776
11777         CFLAGS="$CFLAGS $cf_new_cflags"
11778 fi
11779
11780 if test -n "$cf_new_cppflags" ; then
11781
11782         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11783 fi
11784
11785 if test -n "$cf_new_extra_cppflags" ; then
11786
11787         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11788 fi
11789
11790 cf_add_libs="$cf_pkgconfig_libs"
11791 # Filter out duplicates - this happens with badly-designed ".pc" files...
11792 for cf_add_1lib in $LIBS
11793 do
11794         for cf_add_2lib in $cf_add_libs
11795         do
11796                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11797                 then
11798                         cf_add_1lib=
11799                         break
11800                 fi
11801         done
11802         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11803 done
11804 LIBS="$cf_add_libs"
11805
11806         :
11807 else
11808         cf_pkgconfig_incs=
11809         cf_pkgconfig_libs=
11810
11811 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
11812
11813 echo "${as_me:-configure}:11813: testing ...before $LIBS ..." 1>&5
11814
11815 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%-lXt %-lXt -lX11 %" -e 's%  % %g'`
11816 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
11817
11818 echo "${as_me:-configure}:11818: testing ...after  $LIBS ..." 1>&5
11819
11820 fi
11821
11822                 fi
11823                 ;;
11824         esac
11825
11826 echo "$as_me:11826: checking for usable X Toolkit package" >&5
11827 echo $ECHO_N "checking for usable X Toolkit package... $ECHO_C" >&6
11828 if test "${cf_cv_xt_ice_compat+set}" = set; then
11829   echo $ECHO_N "(cached) $ECHO_C" >&6
11830 else
11831
11832 cat >conftest.$ac_ext <<_ACEOF
11833 #line 11833 "configure"
11834 #include "confdefs.h"
11835
11836 #include <X11/Shell.h>
11837
11838 int
11839 main ()
11840 {
11841 int num = IceConnectionNumber(0)
11842
11843   ;
11844   return 0;
11845 }
11846 _ACEOF
11847 rm -f conftest.$ac_objext conftest$ac_exeext
11848 if { (eval echo "$as_me:11848: \"$ac_link\"") >&5
11849   (eval $ac_link) 2>&5
11850   ac_status=$?
11851   echo "$as_me:11851: \$? = $ac_status" >&5
11852   (exit $ac_status); } &&
11853          { ac_try='test -s conftest$ac_exeext'
11854   { (eval echo "$as_me:11854: \"$ac_try\"") >&5
11855   (eval $ac_try) 2>&5
11856   ac_status=$?
11857   echo "$as_me:11857: \$? = $ac_status" >&5
11858   (exit $ac_status); }; }; then
11859   cf_cv_xt_ice_compat=yes
11860 else
11861   echo "$as_me: failed program was:" >&5
11862 cat conftest.$ac_ext >&5
11863 cf_cv_xt_ice_compat=no
11864 fi
11865 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11866 fi
11867 echo "$as_me:11867: result: $cf_cv_xt_ice_compat" >&5
11868 echo "${ECHO_T}$cf_cv_xt_ice_compat" >&6
11869
11870         if test "$cf_cv_xt_ice_compat" = no
11871         then
11872                 # workaround for broken ".pc" files used for X Toolkit.
11873                 case "x$X_PRE_LIBS" in
11874                 (*-lICE*)
11875                         case "x$LIBS" in
11876                         (*-lICE*)
11877                                 ;;
11878                         (*)
11879                                 test -n "$verbose" && echo "    work around broken ICE dependency" 1>&6
11880
11881 echo "${as_me:-configure}:11881: testing work around broken ICE dependency ..." 1>&5
11882
11883 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists ice; then
11884         test -n "$verbose" && echo "    found package ice" 1>&6
11885
11886 echo "${as_me:-configure}:11886: testing found package ice ..." 1>&5
11887
11888         cf_pkgconfig_incs="`$PKG_CONFIG --cflags ice 2>/dev/null`"
11889         cf_pkgconfig_libs="`$PKG_CONFIG --libs   ice 2>/dev/null`"
11890         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
11891
11892 echo "${as_me:-configure}:11892: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11893
11894         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
11895
11896 echo "${as_me:-configure}:11896: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
11897
11898 cf_fix_cppflags=no
11899 cf_new_cflags=
11900 cf_new_cppflags=
11901 cf_new_extra_cppflags=
11902
11903 for cf_add_cflags in $cf_pkgconfig_incs
11904 do
11905 case $cf_fix_cppflags in
11906 (no)
11907         case $cf_add_cflags in
11908         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11909                 case $cf_add_cflags in
11910                 (-D*)
11911                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11912
11913                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11914                                 && test -z "${cf_tst_cflags}" \
11915                                 && cf_fix_cppflags=yes
11916
11917                         if test $cf_fix_cppflags = yes ; then
11918                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11919                                 continue
11920                         elif test "${cf_tst_cflags}" = "\"'" ; then
11921                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11922                                 continue
11923                         fi
11924                         ;;
11925                 esac
11926                 case "$CPPFLAGS" in
11927                 (*$cf_add_cflags)
11928                         ;;
11929                 (*)
11930                         case $cf_add_cflags in
11931                         (-D*)
11932                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11933
11934 CPPFLAGS=`echo "$CPPFLAGS" | \
11935         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11936                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11937
11938                                 ;;
11939                         esac
11940                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11941                         ;;
11942                 esac
11943                 ;;
11944         (*)
11945                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11946                 ;;
11947         esac
11948         ;;
11949 (yes)
11950         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11951
11952         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11953
11954         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11955                 && test -z "${cf_tst_cflags}" \
11956                 && cf_fix_cppflags=no
11957         ;;
11958 esac
11959 done
11960
11961 if test -n "$cf_new_cflags" ; then
11962
11963         CFLAGS="$CFLAGS $cf_new_cflags"
11964 fi
11965
11966 if test -n "$cf_new_cppflags" ; then
11967
11968         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11969 fi
11970
11971 if test -n "$cf_new_extra_cppflags" ; then
11972
11973         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11974 fi
11975
11976 cf_add_libs="$cf_pkgconfig_libs"
11977 # Filter out duplicates - this happens with badly-designed ".pc" files...
11978 for cf_add_1lib in $LIBS
11979 do
11980         for cf_add_2lib in $cf_add_libs
11981         do
11982                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11983                 then
11984                         cf_add_1lib=
11985                         break
11986                 fi
11987         done
11988         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11989 done
11990 LIBS="$cf_add_libs"
11991
11992 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists sm; then
11993         test -n "$verbose" && echo "    found package sm" 1>&6
11994
11995 echo "${as_me:-configure}:11995: testing found package sm ..." 1>&5
11996
11997         cf_pkgconfig_incs="`$PKG_CONFIG --cflags sm 2>/dev/null`"
11998         cf_pkgconfig_libs="`$PKG_CONFIG --libs   sm 2>/dev/null`"
11999         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
12000
12001 echo "${as_me:-configure}:12001: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12002
12003         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
12004
12005 echo "${as_me:-configure}:12005: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
12006
12007 cf_fix_cppflags=no
12008 cf_new_cflags=
12009 cf_new_cppflags=
12010 cf_new_extra_cppflags=
12011
12012 for cf_add_cflags in $cf_pkgconfig_incs
12013 do
12014 case $cf_fix_cppflags in
12015 (no)
12016         case $cf_add_cflags in
12017         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12018                 case $cf_add_cflags in
12019                 (-D*)
12020                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12021
12022                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12023                                 && test -z "${cf_tst_cflags}" \
12024                                 && cf_fix_cppflags=yes
12025
12026                         if test $cf_fix_cppflags = yes ; then
12027                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12028                                 continue
12029                         elif test "${cf_tst_cflags}" = "\"'" ; then
12030                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12031                                 continue
12032                         fi
12033                         ;;
12034                 esac
12035                 case "$CPPFLAGS" in
12036                 (*$cf_add_cflags)
12037                         ;;
12038                 (*)
12039                         case $cf_add_cflags in
12040                         (-D*)
12041                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12042
12043 CPPFLAGS=`echo "$CPPFLAGS" | \
12044         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12045                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12046
12047                                 ;;
12048                         esac
12049                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
12050                         ;;
12051                 esac
12052                 ;;
12053         (*)
12054                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
12055                 ;;
12056         esac
12057         ;;
12058 (yes)
12059         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12060
12061         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12062
12063         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12064                 && test -z "${cf_tst_cflags}" \
12065                 && cf_fix_cppflags=no
12066         ;;
12067 esac
12068 done
12069
12070 if test -n "$cf_new_cflags" ; then
12071
12072         CFLAGS="$CFLAGS $cf_new_cflags"
12073 fi
12074
12075 if test -n "$cf_new_cppflags" ; then
12076
12077         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
12078 fi
12079
12080 if test -n "$cf_new_extra_cppflags" ; then
12081
12082         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
12083 fi
12084
12085 cf_add_libs="$cf_pkgconfig_libs"
12086 # Filter out duplicates - this happens with badly-designed ".pc" files...
12087 for cf_add_1lib in $LIBS
12088 do
12089         for cf_add_2lib in $cf_add_libs
12090         do
12091                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12092                 then
12093                         cf_add_1lib=
12094                         break
12095                 fi
12096         done
12097         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12098 done
12099 LIBS="$cf_add_libs"
12100
12101         :
12102 else
12103         cf_pkgconfig_incs=
12104         cf_pkgconfig_libs=
12105         :
12106 fi
12107
12108 else
12109         cf_pkgconfig_incs=
12110         cf_pkgconfig_libs=
12111
12112 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
12113
12114 echo "${as_me:-configure}:12114: testing ...before $LIBS ..." 1>&5
12115
12116 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%-lXt %-lXt $X_PRE_LIBS %" -e 's%  % %g'`
12117 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
12118
12119 echo "${as_me:-configure}:12119: testing ...after  $LIBS ..." 1>&5
12120
12121 fi
12122
12123                                 ;;
12124                         esac
12125                         ;;
12126                 esac
12127         fi
12128
12129         cf_have_X_LIBS=yes
12130
12131 else
12132         cf_pkgconfig_incs=
12133         cf_pkgconfig_libs=
12134
12135         LDFLAGS="$X_LIBS $LDFLAGS"
12136
12137 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
12138
12139 echo "${as_me:-configure}:12139: testing checking additions to CFLAGS ..." 1>&5
12140
12141 cf_check_cflags="$CFLAGS"
12142 cf_check_cppflags="$CPPFLAGS"
12143
12144 cf_fix_cppflags=no
12145 cf_new_cflags=
12146 cf_new_cppflags=
12147 cf_new_extra_cppflags=
12148
12149 for cf_add_cflags in $X_CFLAGS
12150 do
12151 case $cf_fix_cppflags in
12152 (no)
12153         case $cf_add_cflags in
12154         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12155                 case $cf_add_cflags in
12156                 (-D*)
12157                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12158
12159                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12160                                 && test -z "${cf_tst_cflags}" \
12161                                 && cf_fix_cppflags=yes
12162
12163                         if test $cf_fix_cppflags = yes ; then
12164                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12165                                 continue
12166                         elif test "${cf_tst_cflags}" = "\"'" ; then
12167                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12168                                 continue
12169                         fi
12170                         ;;
12171                 esac
12172                 case "$CPPFLAGS" in
12173                 (*$cf_add_cflags)
12174                         ;;
12175                 (*)
12176                         case $cf_add_cflags in
12177                         (-D*)
12178                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12179
12180 CPPFLAGS=`echo "$CPPFLAGS" | \
12181         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12182                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12183
12184                                 ;;
12185                         esac
12186                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
12187                         ;;
12188                 esac
12189                 ;;
12190         (*)
12191                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
12192                 ;;
12193         esac
12194         ;;
12195 (yes)
12196         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12197
12198         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12199
12200         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12201                 && test -z "${cf_tst_cflags}" \
12202                 && cf_fix_cppflags=no
12203         ;;
12204 esac
12205 done
12206
12207 if test -n "$cf_new_cflags" ; then
12208         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
12209
12210 echo "${as_me:-configure}:12210: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
12211
12212         CFLAGS="$CFLAGS $cf_new_cflags"
12213 fi
12214
12215 if test -n "$cf_new_cppflags" ; then
12216         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
12217
12218 echo "${as_me:-configure}:12218: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
12219
12220         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
12221 fi
12222
12223 if test -n "$cf_new_extra_cppflags" ; then
12224         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
12225
12226 echo "${as_me:-configure}:12226: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
12227
12228         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
12229 fi
12230
12231 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
12232 cat >conftest.$ac_ext <<_ACEOF
12233 #line 12233 "configure"
12234 #include "confdefs.h"
12235 #include <stdio.h>
12236 int
12237 main ()
12238 {
12239 printf("Hello world");
12240   ;
12241   return 0;
12242 }
12243 _ACEOF
12244 rm -f conftest.$ac_objext conftest$ac_exeext
12245 if { (eval echo "$as_me:12245: \"$ac_link\"") >&5
12246   (eval $ac_link) 2>&5
12247   ac_status=$?
12248   echo "$as_me:12248: \$? = $ac_status" >&5
12249   (exit $ac_status); } &&
12250          { ac_try='test -s conftest$ac_exeext'
12251   { (eval echo "$as_me:12251: \"$ac_try\"") >&5
12252   (eval $ac_try) 2>&5
12253   ac_status=$?
12254   echo "$as_me:12254: \$? = $ac_status" >&5
12255   (exit $ac_status); }; }; then
12256   :
12257 else
12258   echo "$as_me: failed program was:" >&5
12259 cat conftest.$ac_ext >&5
12260 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
12261
12262 echo "${as_me:-configure}:12262: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
12263
12264          if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
12265                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
12266
12267 echo "${as_me:-configure}:12267: testing but keeping change to \$CPPFLAGS ..." 1>&5
12268
12269          fi
12270          CFLAGS="$cf_check_flags"
12271 fi
12272 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12273 fi
12274
12275         echo "$as_me:12275: checking for XOpenDisplay" >&5
12276 echo $ECHO_N "checking for XOpenDisplay... $ECHO_C" >&6
12277 if test "${ac_cv_func_XOpenDisplay+set}" = set; then
12278   echo $ECHO_N "(cached) $ECHO_C" >&6
12279 else
12280   cat >conftest.$ac_ext <<_ACEOF
12281 #line 12281 "configure"
12282 #include "confdefs.h"
12283 /* System header to define __stub macros and hopefully few prototypes,
12284     which can conflict with char XOpenDisplay (); below.  */
12285 #include <assert.h>
12286 /* Override any gcc2 internal prototype to avoid an error.  */
12287 #ifdef __cplusplus
12288 extern "C"
12289 #endif
12290 /* We use char because int might match the return type of a gcc2
12291    builtin and then its argument prototype would still apply.  */
12292 char XOpenDisplay ();
12293 char (*f) ();
12294
12295 int
12296 main ()
12297 {
12298 /* The GNU C library defines this for functions which it implements
12299     to always fail with ENOSYS.  Some functions are actually named
12300     something starting with __ and the normal name is an alias.  */
12301 #if defined (__stub_XOpenDisplay) || defined (__stub___XOpenDisplay)
12302 choke me
12303 #else
12304 f = XOpenDisplay; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
12305 #endif
12306
12307   ;
12308   return 0;
12309 }
12310 _ACEOF
12311 rm -f conftest.$ac_objext conftest$ac_exeext
12312 if { (eval echo "$as_me:12312: \"$ac_link\"") >&5
12313   (eval $ac_link) 2>&5
12314   ac_status=$?
12315   echo "$as_me:12315: \$? = $ac_status" >&5
12316   (exit $ac_status); } &&
12317          { ac_try='test -s conftest$ac_exeext'
12318   { (eval echo "$as_me:12318: \"$ac_try\"") >&5
12319   (eval $ac_try) 2>&5
12320   ac_status=$?
12321   echo "$as_me:12321: \$? = $ac_status" >&5
12322   (exit $ac_status); }; }; then
12323   ac_cv_func_XOpenDisplay=yes
12324 else
12325   echo "$as_me: failed program was:" >&5
12326 cat conftest.$ac_ext >&5
12327 ac_cv_func_XOpenDisplay=no
12328 fi
12329 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12330 fi
12331 echo "$as_me:12331: result: $ac_cv_func_XOpenDisplay" >&5
12332 echo "${ECHO_T}$ac_cv_func_XOpenDisplay" >&6
12333 if test $ac_cv_func_XOpenDisplay = yes; then
12334   :
12335 else
12336
12337         echo "$as_me:12337: checking for XOpenDisplay in -lX11" >&5
12338 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
12339 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
12340   echo $ECHO_N "(cached) $ECHO_C" >&6
12341 else
12342   ac_check_lib_save_LIBS=$LIBS
12343 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
12344 cat >conftest.$ac_ext <<_ACEOF
12345 #line 12345 "configure"
12346 #include "confdefs.h"
12347
12348 /* Override any gcc2 internal prototype to avoid an error.  */
12349 #ifdef __cplusplus
12350 extern "C"
12351 #endif
12352 /* We use char because int might match the return type of a gcc2
12353    builtin and then its argument prototype would still apply.  */
12354 char XOpenDisplay ();
12355 int
12356 main ()
12357 {
12358 XOpenDisplay ();
12359   ;
12360   return 0;
12361 }
12362 _ACEOF
12363 rm -f conftest.$ac_objext conftest$ac_exeext
12364 if { (eval echo "$as_me:12364: \"$ac_link\"") >&5
12365   (eval $ac_link) 2>&5
12366   ac_status=$?
12367   echo "$as_me:12367: \$? = $ac_status" >&5
12368   (exit $ac_status); } &&
12369          { ac_try='test -s conftest$ac_exeext'
12370   { (eval echo "$as_me:12370: \"$ac_try\"") >&5
12371   (eval $ac_try) 2>&5
12372   ac_status=$?
12373   echo "$as_me:12373: \$? = $ac_status" >&5
12374   (exit $ac_status); }; }; then
12375   ac_cv_lib_X11_XOpenDisplay=yes
12376 else
12377   echo "$as_me: failed program was:" >&5
12378 cat conftest.$ac_ext >&5
12379 ac_cv_lib_X11_XOpenDisplay=no
12380 fi
12381 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12382 LIBS=$ac_check_lib_save_LIBS
12383 fi
12384 echo "$as_me:12384: result: $ac_cv_lib_X11_XOpenDisplay" >&5
12385 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
12386 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
12387
12388 cf_add_libs="-lX11"
12389 # Filter out duplicates - this happens with badly-designed ".pc" files...
12390 for cf_add_1lib in $LIBS
12391 do
12392         for cf_add_2lib in $cf_add_libs
12393         do
12394                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12395                 then
12396                         cf_add_1lib=
12397                         break
12398                 fi
12399         done
12400         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12401 done
12402 LIBS="$cf_add_libs"
12403
12404 fi
12405
12406 fi
12407
12408         echo "$as_me:12408: checking for XtAppInitialize" >&5
12409 echo $ECHO_N "checking for XtAppInitialize... $ECHO_C" >&6
12410 if test "${ac_cv_func_XtAppInitialize+set}" = set; then
12411   echo $ECHO_N "(cached) $ECHO_C" >&6
12412 else
12413   cat >conftest.$ac_ext <<_ACEOF
12414 #line 12414 "configure"
12415 #include "confdefs.h"
12416 /* System header to define __stub macros and hopefully few prototypes,
12417     which can conflict with char XtAppInitialize (); below.  */
12418 #include <assert.h>
12419 /* Override any gcc2 internal prototype to avoid an error.  */
12420 #ifdef __cplusplus
12421 extern "C"
12422 #endif
12423 /* We use char because int might match the return type of a gcc2
12424    builtin and then its argument prototype would still apply.  */
12425 char XtAppInitialize ();
12426 char (*f) ();
12427
12428 int
12429 main ()
12430 {
12431 /* The GNU C library defines this for functions which it implements
12432     to always fail with ENOSYS.  Some functions are actually named
12433     something starting with __ and the normal name is an alias.  */
12434 #if defined (__stub_XtAppInitialize) || defined (__stub___XtAppInitialize)
12435 choke me
12436 #else
12437 f = XtAppInitialize; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
12438 #endif
12439
12440   ;
12441   return 0;
12442 }
12443 _ACEOF
12444 rm -f conftest.$ac_objext conftest$ac_exeext
12445 if { (eval echo "$as_me:12445: \"$ac_link\"") >&5
12446   (eval $ac_link) 2>&5
12447   ac_status=$?
12448   echo "$as_me:12448: \$? = $ac_status" >&5
12449   (exit $ac_status); } &&
12450          { ac_try='test -s conftest$ac_exeext'
12451   { (eval echo "$as_me:12451: \"$ac_try\"") >&5
12452   (eval $ac_try) 2>&5
12453   ac_status=$?
12454   echo "$as_me:12454: \$? = $ac_status" >&5
12455   (exit $ac_status); }; }; then
12456   ac_cv_func_XtAppInitialize=yes
12457 else
12458   echo "$as_me: failed program was:" >&5
12459 cat conftest.$ac_ext >&5
12460 ac_cv_func_XtAppInitialize=no
12461 fi
12462 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12463 fi
12464 echo "$as_me:12464: result: $ac_cv_func_XtAppInitialize" >&5
12465 echo "${ECHO_T}$ac_cv_func_XtAppInitialize" >&6
12466 if test $ac_cv_func_XtAppInitialize = yes; then
12467   :
12468 else
12469
12470         echo "$as_me:12470: checking for XtAppInitialize in -lXt" >&5
12471 echo $ECHO_N "checking for XtAppInitialize in -lXt... $ECHO_C" >&6
12472 if test "${ac_cv_lib_Xt_XtAppInitialize+set}" = set; then
12473   echo $ECHO_N "(cached) $ECHO_C" >&6
12474 else
12475   ac_check_lib_save_LIBS=$LIBS
12476 LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
12477 cat >conftest.$ac_ext <<_ACEOF
12478 #line 12478 "configure"
12479 #include "confdefs.h"
12480
12481 /* Override any gcc2 internal prototype to avoid an error.  */
12482 #ifdef __cplusplus
12483 extern "C"
12484 #endif
12485 /* We use char because int might match the return type of a gcc2
12486    builtin and then its argument prototype would still apply.  */
12487 char XtAppInitialize ();
12488 int
12489 main ()
12490 {
12491 XtAppInitialize ();
12492   ;
12493   return 0;
12494 }
12495 _ACEOF
12496 rm -f conftest.$ac_objext conftest$ac_exeext
12497 if { (eval echo "$as_me:12497: \"$ac_link\"") >&5
12498   (eval $ac_link) 2>&5
12499   ac_status=$?
12500   echo "$as_me:12500: \$? = $ac_status" >&5
12501   (exit $ac_status); } &&
12502          { ac_try='test -s conftest$ac_exeext'
12503   { (eval echo "$as_me:12503: \"$ac_try\"") >&5
12504   (eval $ac_try) 2>&5
12505   ac_status=$?
12506   echo "$as_me:12506: \$? = $ac_status" >&5
12507   (exit $ac_status); }; }; then
12508   ac_cv_lib_Xt_XtAppInitialize=yes
12509 else
12510   echo "$as_me: failed program was:" >&5
12511 cat conftest.$ac_ext >&5
12512 ac_cv_lib_Xt_XtAppInitialize=no
12513 fi
12514 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12515 LIBS=$ac_check_lib_save_LIBS
12516 fi
12517 echo "$as_me:12517: result: $ac_cv_lib_Xt_XtAppInitialize" >&5
12518 echo "${ECHO_T}$ac_cv_lib_Xt_XtAppInitialize" >&6
12519 if test $ac_cv_lib_Xt_XtAppInitialize = yes; then
12520
12521 cat >>confdefs.h <<\EOF
12522 #define HAVE_LIBXT 1
12523 EOF
12524
12525                  cf_have_X_LIBS=Xt
12526                  LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS"
12527 fi
12528
12529 fi
12530
12531 fi
12532
12533 if test $cf_have_X_LIBS = no ; then
12534         { echo "$as_me:12534: WARNING: Unable to successfully link X Toolkit library (-lXt) with
12535 test program.  You will have to check and add the proper libraries by hand
12536 to makefile." >&5
12537 echo "$as_me: WARNING: Unable to successfully link X Toolkit library (-lXt) with
12538 test program.  You will have to check and add the proper libraries by hand
12539 to makefile." >&2;}
12540 fi
12541
12542 cf_x_athena_root=$cf_x_athena
12543 cf_x_athena_inc=""
12544
12545 for cf_path in default \
12546         /usr/contrib/X11R6 \
12547         /usr/contrib/X11R5 \
12548         /usr/lib/X11R5 \
12549         /usr/local
12550 do
12551         if test -z "$cf_x_athena_inc" ; then
12552                 cf_save="$CPPFLAGS"
12553                 cf_test=X11/$cf_x_athena_root/SimpleMenu.h
12554                 if test $cf_path != default ; then
12555                         CPPFLAGS="$cf_save -I$cf_path/include"
12556                         echo "$as_me:12556: checking for $cf_test in $cf_path" >&5
12557 echo $ECHO_N "checking for $cf_test in $cf_path... $ECHO_C" >&6
12558                 else
12559                         echo "$as_me:12559: checking for $cf_test" >&5
12560 echo $ECHO_N "checking for $cf_test... $ECHO_C" >&6
12561                 fi
12562                 cat >conftest.$ac_ext <<_ACEOF
12563 #line 12563 "configure"
12564 #include "confdefs.h"
12565
12566 #include <X11/Intrinsic.h>
12567 #include <$cf_test>
12568 int
12569 main ()
12570 {
12571
12572   ;
12573   return 0;
12574 }
12575 _ACEOF
12576 rm -f conftest.$ac_objext
12577 if { (eval echo "$as_me:12577: \"$ac_compile\"") >&5
12578   (eval $ac_compile) 2>&5
12579   ac_status=$?
12580   echo "$as_me:12580: \$? = $ac_status" >&5
12581   (exit $ac_status); } &&
12582          { ac_try='test -s conftest.$ac_objext'
12583   { (eval echo "$as_me:12583: \"$ac_try\"") >&5
12584   (eval $ac_try) 2>&5
12585   ac_status=$?
12586   echo "$as_me:12586: \$? = $ac_status" >&5
12587   (exit $ac_status); }; }; then
12588   cf_result=yes
12589 else
12590   echo "$as_me: failed program was:" >&5
12591 cat conftest.$ac_ext >&5
12592 cf_result=no
12593 fi
12594 rm -f conftest.$ac_objext conftest.$ac_ext
12595                 echo "$as_me:12595: result: $cf_result" >&5
12596 echo "${ECHO_T}$cf_result" >&6
12597                 if test "$cf_result" = yes ; then
12598                         cf_x_athena_inc=$cf_path
12599                         break
12600                 else
12601                         CPPFLAGS="$cf_save"
12602                 fi
12603         fi
12604 done
12605
12606 if test -z "$cf_x_athena_inc" ; then
12607         { echo "$as_me:12607: WARNING: Unable to successfully find Athena header files with test program" >&5
12608 echo "$as_me: WARNING: Unable to successfully find Athena header files with test program" >&2;}
12609 elif test "$cf_x_athena_inc" != default ; then
12610         CPPFLAGS="$CPPFLAGS -I$cf_x_athena_inc"
12611 fi
12612
12613 cf_x_athena_root=$cf_x_athena
12614 cf_x_athena_lib=""
12615
12616 for cf_path in default \
12617         /usr/contrib/X11R6 \
12618         /usr/contrib/X11R5 \
12619         /usr/lib/X11R5 \
12620         /usr/local
12621 do
12622         for cf_lib in \
12623                 ${cf_x_athena_root} \
12624                 ${cf_x_athena_root}7 \
12625                 ${cf_x_athena_root}6
12626         do
12627         for cf_libs in \
12628                 "-l$cf_lib -lXmu" \
12629                 "-l$cf_lib -lXpm -lXmu" \
12630                 "-l${cf_lib}_s -lXmu_s"
12631         do
12632                 if test -z "$cf_x_athena_lib" ; then
12633                         cf_save="$LIBS"
12634                         cf_test=XawSimpleMenuAddGlobalActions
12635                         if test $cf_path != default ; then
12636
12637 cf_add_libs="-L$cf_path/lib $cf_libs"
12638 # Filter out duplicates - this happens with badly-designed ".pc" files...
12639 for cf_add_1lib in $LIBS
12640 do
12641         for cf_add_2lib in $cf_add_libs
12642         do
12643                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12644                 then
12645                         cf_add_1lib=
12646                         break
12647                 fi
12648         done
12649         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12650 done
12651 LIBS="$cf_add_libs"
12652
12653                                 echo "$as_me:12653: checking for $cf_libs in $cf_path" >&5
12654 echo $ECHO_N "checking for $cf_libs in $cf_path... $ECHO_C" >&6
12655                         else
12656
12657 cf_add_libs="$cf_libs"
12658 # Filter out duplicates - this happens with badly-designed ".pc" files...
12659 for cf_add_1lib in $LIBS
12660 do
12661         for cf_add_2lib in $cf_add_libs
12662         do
12663                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12664                 then
12665                         cf_add_1lib=
12666                         break
12667                 fi
12668         done
12669         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12670 done
12671 LIBS="$cf_add_libs"
12672
12673                                 echo "$as_me:12673: checking for $cf_test in $cf_libs" >&5
12674 echo $ECHO_N "checking for $cf_test in $cf_libs... $ECHO_C" >&6
12675                         fi
12676                         cat >conftest.$ac_ext <<_ACEOF
12677 #line 12677 "configure"
12678 #include "confdefs.h"
12679
12680 #include <X11/Intrinsic.h>
12681 #include <X11/$cf_x_athena_root/SimpleMenu.h>
12682
12683 int
12684 main ()
12685 {
12686
12687 $cf_test((XtAppContext) 0)
12688   ;
12689   return 0;
12690 }
12691 _ACEOF
12692 rm -f conftest.$ac_objext conftest$ac_exeext
12693 if { (eval echo "$as_me:12693: \"$ac_link\"") >&5
12694   (eval $ac_link) 2>&5
12695   ac_status=$?
12696   echo "$as_me:12696: \$? = $ac_status" >&5
12697   (exit $ac_status); } &&
12698          { ac_try='test -s conftest$ac_exeext'
12699   { (eval echo "$as_me:12699: \"$ac_try\"") >&5
12700   (eval $ac_try) 2>&5
12701   ac_status=$?
12702   echo "$as_me:12702: \$? = $ac_status" >&5
12703   (exit $ac_status); }; }; then
12704   cf_result=yes
12705 else
12706   echo "$as_me: failed program was:" >&5
12707 cat conftest.$ac_ext >&5
12708 cf_result=no
12709 fi
12710 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12711                         echo "$as_me:12711: result: $cf_result" >&5
12712 echo "${ECHO_T}$cf_result" >&6
12713                         if test "$cf_result" = yes ; then
12714                                 cf_x_athena_lib="$cf_libs"
12715                                 break
12716                         fi
12717                         LIBS="$cf_save"
12718                 fi
12719         done # cf_libs
12720                 test -n "$cf_x_athena_lib" && break
12721         done # cf_lib
12722 done
12723
12724 if test -z "$cf_x_athena_lib" ; then
12725         { { echo "$as_me:12725: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&5
12726 echo "$as_me: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&2;}
12727    { (exit 1); exit 1; }; }
12728 fi
12729
12730 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
12731
12732 cat >>confdefs.h <<EOF
12733 #define $cf_x_athena_LIBS 1
12734 EOF
12735
12736 fi
12737
12738 if test -n "$ac_tool_prefix"; then
12739   for ac_prog in xcurses-config
12740   do
12741     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
12742 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
12743 echo "$as_me:12743: checking for $ac_word" >&5
12744 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
12745 if test "${ac_cv_prog_XCURSES_CONFIG+set}" = set; then
12746   echo $ECHO_N "(cached) $ECHO_C" >&6
12747 else
12748   if test -n "$XCURSES_CONFIG"; then
12749   ac_cv_prog_XCURSES_CONFIG="$XCURSES_CONFIG" # Let the user override the test.
12750 else
12751   ac_save_IFS=$IFS; IFS=$ac_path_separator
12752 ac_dummy="$PATH"
12753 for ac_dir in $ac_dummy; do
12754   IFS=$ac_save_IFS
12755   test -z "$ac_dir" && ac_dir=.
12756   $as_executable_p "$ac_dir/$ac_word" || continue
12757 ac_cv_prog_XCURSES_CONFIG="$ac_tool_prefix$ac_prog"
12758 echo "$as_me:12758: found $ac_dir/$ac_word" >&5
12759 break
12760 done
12761
12762 fi
12763 fi
12764 XCURSES_CONFIG=$ac_cv_prog_XCURSES_CONFIG
12765 if test -n "$XCURSES_CONFIG"; then
12766   echo "$as_me:12766: result: $XCURSES_CONFIG" >&5
12767 echo "${ECHO_T}$XCURSES_CONFIG" >&6
12768 else
12769   echo "$as_me:12769: result: no" >&5
12770 echo "${ECHO_T}no" >&6
12771 fi
12772
12773     test -n "$XCURSES_CONFIG" && break
12774   done
12775 fi
12776 if test -z "$XCURSES_CONFIG"; then
12777   ac_ct_XCURSES_CONFIG=$XCURSES_CONFIG
12778   for ac_prog in xcurses-config
12779 do
12780   # Extract the first word of "$ac_prog", so it can be a program name with args.
12781 set dummy $ac_prog; ac_word=$2
12782 echo "$as_me:12782: checking for $ac_word" >&5
12783 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
12784 if test "${ac_cv_prog_ac_ct_XCURSES_CONFIG+set}" = set; then
12785   echo $ECHO_N "(cached) $ECHO_C" >&6
12786 else
12787   if test -n "$ac_ct_XCURSES_CONFIG"; then
12788   ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_ct_XCURSES_CONFIG" # Let the user override the test.
12789 else
12790   ac_save_IFS=$IFS; IFS=$ac_path_separator
12791 ac_dummy="$PATH"
12792 for ac_dir in $ac_dummy; do
12793   IFS=$ac_save_IFS
12794   test -z "$ac_dir" && ac_dir=.
12795   $as_executable_p "$ac_dir/$ac_word" || continue
12796 ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_prog"
12797 echo "$as_me:12797: found $ac_dir/$ac_word" >&5
12798 break
12799 done
12800
12801 fi
12802 fi
12803 ac_ct_XCURSES_CONFIG=$ac_cv_prog_ac_ct_XCURSES_CONFIG
12804 if test -n "$ac_ct_XCURSES_CONFIG"; then
12805   echo "$as_me:12805: result: $ac_ct_XCURSES_CONFIG" >&5
12806 echo "${ECHO_T}$ac_ct_XCURSES_CONFIG" >&6
12807 else
12808   echo "$as_me:12808: result: no" >&5
12809 echo "${ECHO_T}no" >&6
12810 fi
12811
12812   test -n "$ac_ct_XCURSES_CONFIG" && break
12813 done
12814 test -n "$ac_ct_XCURSES_CONFIG" || ac_ct_XCURSES_CONFIG="none"
12815
12816   XCURSES_CONFIG=$ac_ct_XCURSES_CONFIG
12817 fi
12818
12819 if test "$XCURSES_CONFIG" != none ; then
12820
12821 CPPFLAGS="$CPPFLAGS `$XCURSES_CONFIG --cflags`"
12822
12823 cf_add_libs="`$XCURSES_CONFIG --libs`"
12824 # Filter out duplicates - this happens with badly-designed ".pc" files...
12825 for cf_add_1lib in $LIBS
12826 do
12827         for cf_add_2lib in $cf_add_libs
12828         do
12829                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12830                 then
12831                         cf_add_1lib=
12832                         break
12833                 fi
12834         done
12835         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12836 done
12837 LIBS="$cf_add_libs"
12838
12839 cf_cv_lib_XCurses=yes
12840
12841 else
12842
12843 LDFLAGS="$LDFLAGS $X_LIBS"
12844
12845 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
12846
12847 echo "${as_me:-configure}:12847: testing checking additions to CFLAGS ..." 1>&5
12848
12849 cf_check_cflags="$CFLAGS"
12850 cf_check_cppflags="$CPPFLAGS"
12851
12852 cf_fix_cppflags=no
12853 cf_new_cflags=
12854 cf_new_cppflags=
12855 cf_new_extra_cppflags=
12856
12857 for cf_add_cflags in $X_CFLAGS
12858 do
12859 case $cf_fix_cppflags in
12860 (no)
12861         case $cf_add_cflags in
12862         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12863                 case $cf_add_cflags in
12864                 (-D*)
12865                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12866
12867                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12868                                 && test -z "${cf_tst_cflags}" \
12869                                 && cf_fix_cppflags=yes
12870
12871                         if test $cf_fix_cppflags = yes ; then
12872                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12873                                 continue
12874                         elif test "${cf_tst_cflags}" = "\"'" ; then
12875                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12876                                 continue
12877                         fi
12878                         ;;
12879                 esac
12880                 case "$CPPFLAGS" in
12881                 (*$cf_add_cflags)
12882                         ;;
12883                 (*)
12884                         case $cf_add_cflags in
12885                         (-D*)
12886                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12887
12888 CPPFLAGS=`echo "$CPPFLAGS" | \
12889         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12890                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12891
12892                                 ;;
12893                         esac
12894                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
12895                         ;;
12896                 esac
12897                 ;;
12898         (*)
12899                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
12900                 ;;
12901         esac
12902         ;;
12903 (yes)
12904         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12905
12906         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12907
12908         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12909                 && test -z "${cf_tst_cflags}" \
12910                 && cf_fix_cppflags=no
12911         ;;
12912 esac
12913 done
12914
12915 if test -n "$cf_new_cflags" ; then
12916         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
12917
12918 echo "${as_me:-configure}:12918: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
12919
12920         CFLAGS="$CFLAGS $cf_new_cflags"
12921 fi
12922
12923 if test -n "$cf_new_cppflags" ; then
12924         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
12925
12926 echo "${as_me:-configure}:12926: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
12927
12928         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
12929 fi
12930
12931 if test -n "$cf_new_extra_cppflags" ; then
12932         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
12933
12934 echo "${as_me:-configure}:12934: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
12935
12936         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
12937 fi
12938
12939 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
12940 cat >conftest.$ac_ext <<_ACEOF
12941 #line 12941 "configure"
12942 #include "confdefs.h"
12943 #include <stdio.h>
12944 int
12945 main ()
12946 {
12947 printf("Hello world");
12948   ;
12949   return 0;
12950 }
12951 _ACEOF
12952 rm -f conftest.$ac_objext conftest$ac_exeext
12953 if { (eval echo "$as_me:12953: \"$ac_link\"") >&5
12954   (eval $ac_link) 2>&5
12955   ac_status=$?
12956   echo "$as_me:12956: \$? = $ac_status" >&5
12957   (exit $ac_status); } &&
12958          { ac_try='test -s conftest$ac_exeext'
12959   { (eval echo "$as_me:12959: \"$ac_try\"") >&5
12960   (eval $ac_try) 2>&5
12961   ac_status=$?
12962   echo "$as_me:12962: \$? = $ac_status" >&5
12963   (exit $ac_status); }; }; then
12964   :
12965 else
12966   echo "$as_me: failed program was:" >&5
12967 cat conftest.$ac_ext >&5
12968 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
12969
12970 echo "${as_me:-configure}:12970: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
12971
12972          if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
12973                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
12974
12975 echo "${as_me:-configure}:12975: testing but keeping change to \$CPPFLAGS ..." 1>&5
12976
12977          fi
12978          CFLAGS="$cf_check_flags"
12979 fi
12980 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12981 fi
12982
12983 echo "$as_me:12983: checking for XOpenDisplay in -lX11" >&5
12984 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
12985 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
12986   echo $ECHO_N "(cached) $ECHO_C" >&6
12987 else
12988   ac_check_lib_save_LIBS=$LIBS
12989 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
12990 cat >conftest.$ac_ext <<_ACEOF
12991 #line 12991 "configure"
12992 #include "confdefs.h"
12993
12994 /* Override any gcc2 internal prototype to avoid an error.  */
12995 #ifdef __cplusplus
12996 extern "C"
12997 #endif
12998 /* We use char because int might match the return type of a gcc2
12999    builtin and then its argument prototype would still apply.  */
13000 char XOpenDisplay ();
13001 int
13002 main ()
13003 {
13004 XOpenDisplay ();
13005   ;
13006   return 0;
13007 }
13008 _ACEOF
13009 rm -f conftest.$ac_objext conftest$ac_exeext
13010 if { (eval echo "$as_me:13010: \"$ac_link\"") >&5
13011   (eval $ac_link) 2>&5
13012   ac_status=$?
13013   echo "$as_me:13013: \$? = $ac_status" >&5
13014   (exit $ac_status); } &&
13015          { ac_try='test -s conftest$ac_exeext'
13016   { (eval echo "$as_me:13016: \"$ac_try\"") >&5
13017   (eval $ac_try) 2>&5
13018   ac_status=$?
13019   echo "$as_me:13019: \$? = $ac_status" >&5
13020   (exit $ac_status); }; }; then
13021   ac_cv_lib_X11_XOpenDisplay=yes
13022 else
13023   echo "$as_me: failed program was:" >&5
13024 cat conftest.$ac_ext >&5
13025 ac_cv_lib_X11_XOpenDisplay=no
13026 fi
13027 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13028 LIBS=$ac_check_lib_save_LIBS
13029 fi
13030 echo "$as_me:13030: result: $ac_cv_lib_X11_XOpenDisplay" >&5
13031 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
13032 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
13033
13034 cf_add_libs="-lX11"
13035 # Filter out duplicates - this happens with badly-designed ".pc" files...
13036 for cf_add_1lib in $LIBS
13037 do
13038         for cf_add_2lib in $cf_add_libs
13039         do
13040                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13041                 then
13042                         cf_add_1lib=
13043                         break
13044                 fi
13045         done
13046         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13047 done
13048 LIBS="$cf_add_libs"
13049
13050 fi
13051
13052 echo "$as_me:13052: checking for XCurses library" >&5
13053 echo $ECHO_N "checking for XCurses library... $ECHO_C" >&6
13054 if test "${cf_cv_lib_XCurses+set}" = set; then
13055   echo $ECHO_N "(cached) $ECHO_C" >&6
13056 else
13057
13058 cf_add_libs="-lXCurses"
13059 # Filter out duplicates - this happens with badly-designed ".pc" files...
13060 for cf_add_1lib in $LIBS
13061 do
13062         for cf_add_2lib in $cf_add_libs
13063         do
13064                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13065                 then
13066                         cf_add_1lib=
13067                         break
13068                 fi
13069         done
13070         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13071 done
13072 LIBS="$cf_add_libs"
13073
13074 cat >conftest.$ac_ext <<_ACEOF
13075 #line 13075 "configure"
13076 #include "confdefs.h"
13077
13078 #include <xcurses.h>
13079 char *XCursesProgramName = "test";
13080
13081 int
13082 main ()
13083 {
13084 XCursesExit();
13085   ;
13086   return 0;
13087 }
13088 _ACEOF
13089 rm -f conftest.$ac_objext conftest$ac_exeext
13090 if { (eval echo "$as_me:13090: \"$ac_link\"") >&5
13091   (eval $ac_link) 2>&5
13092   ac_status=$?
13093   echo "$as_me:13093: \$? = $ac_status" >&5
13094   (exit $ac_status); } &&
13095          { ac_try='test -s conftest$ac_exeext'
13096   { (eval echo "$as_me:13096: \"$ac_try\"") >&5
13097   (eval $ac_try) 2>&5
13098   ac_status=$?
13099   echo "$as_me:13099: \$? = $ac_status" >&5
13100   (exit $ac_status); }; }; then
13101   cf_cv_lib_XCurses=yes
13102 else
13103   echo "$as_me: failed program was:" >&5
13104 cat conftest.$ac_ext >&5
13105 cf_cv_lib_XCurses=no
13106 fi
13107 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13108
13109 fi
13110 echo "$as_me:13110: result: $cf_cv_lib_XCurses" >&5
13111 echo "${ECHO_T}$cf_cv_lib_XCurses" >&6
13112
13113 fi
13114
13115 if test $cf_cv_lib_XCurses = yes ; then
13116
13117 cat >>confdefs.h <<\EOF
13118 #define UNIX 1
13119 EOF
13120
13121 cat >>confdefs.h <<\EOF
13122 #define XCURSES 1
13123 EOF
13124
13125         echo "$as_me:13125: checking for xcurses.h" >&5
13126 echo $ECHO_N "checking for xcurses.h... $ECHO_C" >&6
13127 if test "${ac_cv_header_xcurses_h+set}" = set; then
13128   echo $ECHO_N "(cached) $ECHO_C" >&6
13129 else
13130   cat >conftest.$ac_ext <<_ACEOF
13131 #line 13131 "configure"
13132 #include "confdefs.h"
13133 #include <xcurses.h>
13134 _ACEOF
13135 if { (eval echo "$as_me:13135: \"$ac_cpp conftest.$ac_ext\"") >&5
13136   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13137   ac_status=$?
13138   egrep -v '^ *\+' conftest.er1 >conftest.err
13139   rm -f conftest.er1
13140   cat conftest.err >&5
13141   echo "$as_me:13141: \$? = $ac_status" >&5
13142   (exit $ac_status); } >/dev/null; then
13143   if test -s conftest.err; then
13144     ac_cpp_err=$ac_c_preproc_warn_flag
13145   else
13146     ac_cpp_err=
13147   fi
13148 else
13149   ac_cpp_err=yes
13150 fi
13151 if test -z "$ac_cpp_err"; then
13152   ac_cv_header_xcurses_h=yes
13153 else
13154   echo "$as_me: failed program was:" >&5
13155   cat conftest.$ac_ext >&5
13156   ac_cv_header_xcurses_h=no
13157 fi
13158 rm -f conftest.err conftest.$ac_ext
13159 fi
13160 echo "$as_me:13160: result: $ac_cv_header_xcurses_h" >&5
13161 echo "${ECHO_T}$ac_cv_header_xcurses_h" >&6
13162 if test $ac_cv_header_xcurses_h = yes; then
13163
13164 cat >>confdefs.h <<\EOF
13165 #define HAVE_XCURSES 1
13166 EOF
13167
13168 fi
13169
13170 else
13171         { { echo "$as_me:13171: error: Cannot link with XCurses" >&5
13172 echo "$as_me: error: Cannot link with XCurses" >&2;}
13173    { (exit 1); exit 1; }; }
13174 fi
13175
13176         ;;
13177 (*)
13178         { { echo "$as_me:13178: error: unexpected screen-value: $cf_cv_screen" >&5
13179 echo "$as_me: error: unexpected screen-value: $cf_cv_screen" >&2;}
13180    { (exit 1); exit 1; }; }
13181         ;;
13182 esac
13183
13184 : ${cf_nculib_root:=$cf_cv_screen}
13185 echo "$as_me:13185: checking if $cf_nculib_root uses pthreads" >&5
13186 echo $ECHO_N "checking if $cf_nculib_root uses pthreads... $ECHO_C" >&6
13187 if test "${cf_cv_ncurses_pthreads+set}" = set; then
13188   echo $ECHO_N "(cached) $ECHO_C" >&6
13189 else
13190
13191         as_ac_Lib=`echo "ac_cv_lib_$cf_nculib_root''__nc_init_pthreads" | $as_tr_sh`
13192 echo "$as_me:13192: checking for _nc_init_pthreads in -l$cf_nculib_root" >&5
13193 echo $ECHO_N "checking for _nc_init_pthreads in -l$cf_nculib_root... $ECHO_C" >&6
13194 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
13195   echo $ECHO_N "(cached) $ECHO_C" >&6
13196 else
13197   ac_check_lib_save_LIBS=$LIBS
13198 LIBS="-l$cf_nculib_root  $LIBS"
13199 cat >conftest.$ac_ext <<_ACEOF
13200 #line 13200 "configure"
13201 #include "confdefs.h"
13202
13203 /* Override any gcc2 internal prototype to avoid an error.  */
13204 #ifdef __cplusplus
13205 extern "C"
13206 #endif
13207 /* We use char because int might match the return type of a gcc2
13208    builtin and then its argument prototype would still apply.  */
13209 char _nc_init_pthreads ();
13210 int
13211 main ()
13212 {
13213 _nc_init_pthreads ();
13214   ;
13215   return 0;
13216 }
13217 _ACEOF
13218 rm -f conftest.$ac_objext conftest$ac_exeext
13219 if { (eval echo "$as_me:13219: \"$ac_link\"") >&5
13220   (eval $ac_link) 2>&5
13221   ac_status=$?
13222   echo "$as_me:13222: \$? = $ac_status" >&5
13223   (exit $ac_status); } &&
13224          { ac_try='test -s conftest$ac_exeext'
13225   { (eval echo "$as_me:13225: \"$ac_try\"") >&5
13226   (eval $ac_try) 2>&5
13227   ac_status=$?
13228   echo "$as_me:13228: \$? = $ac_status" >&5
13229   (exit $ac_status); }; }; then
13230   eval "$as_ac_Lib=yes"
13231 else
13232   echo "$as_me: failed program was:" >&5
13233 cat conftest.$ac_ext >&5
13234 eval "$as_ac_Lib=no"
13235 fi
13236 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13237 LIBS=$ac_check_lib_save_LIBS
13238 fi
13239 echo "$as_me:13239: result: `eval echo '${'$as_ac_Lib'}'`" >&5
13240 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
13241 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
13242   cf_cv_ncurses_pthreads=yes
13243 else
13244   cf_cv_ncurses_pthreads=no
13245 fi
13246
13247 fi
13248 echo "$as_me:13248: result: $cf_cv_ncurses_pthreads" >&5
13249 echo "${ECHO_T}$cf_cv_ncurses_pthreads" >&6
13250 if test "$cf_cv_ncurses_pthreads" = yes
13251 then
13252
13253 cf_add_libs="-lpthread"
13254 # Filter out duplicates - this happens with badly-designed ".pc" files...
13255 for cf_add_1lib in $LIBS
13256 do
13257         for cf_add_2lib in $cf_add_libs
13258         do
13259                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13260                 then
13261                         cf_add_1lib=
13262                         break
13263                 fi
13264         done
13265         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13266 done
13267 LIBS="$cf_add_libs"
13268
13269 fi
13270
13271 case $cf_cv_screen in
13272 (ncurses*)
13273         cf_cv_libtype=`echo "$cf_cv_screen" | sed -e 's/^ncurses//'`
13274         ;;
13275 (curses|curses_*)
13276
13277 echo "$as_me:13277: checking for NetBSD form.h" >&5
13278 echo $ECHO_N "checking for NetBSD form.h... $ECHO_C" >&6
13279 if test "${cf_cv_netbsd_form_h+set}" = set; then
13280   echo $ECHO_N "(cached) $ECHO_C" >&6
13281 else
13282
13283 cat >conftest.$ac_ext <<_ACEOF
13284 #line 13284 "configure"
13285 #include "confdefs.h"
13286
13287 #include <${cf_cv_ncurses_header:-curses.h}>
13288 #include <form.h>
13289
13290 int
13291 main ()
13292 {
13293
13294         FORM *form;
13295         int y = current_field(form)->cursor_ypos;
13296         int x = current_field(form)->cursor_xpos;
13297
13298   ;
13299   return 0;
13300 }
13301 _ACEOF
13302 rm -f conftest.$ac_objext
13303 if { (eval echo "$as_me:13303: \"$ac_compile\"") >&5
13304   (eval $ac_compile) 2>&5
13305   ac_status=$?
13306   echo "$as_me:13306: \$? = $ac_status" >&5
13307   (exit $ac_status); } &&
13308          { ac_try='test -s conftest.$ac_objext'
13309   { (eval echo "$as_me:13309: \"$ac_try\"") >&5
13310   (eval $ac_try) 2>&5
13311   ac_status=$?
13312   echo "$as_me:13312: \$? = $ac_status" >&5
13313   (exit $ac_status); }; }; then
13314   cf_cv_netbsd_form_h=yes
13315
13316 else
13317   echo "$as_me: failed program was:" >&5
13318 cat conftest.$ac_ext >&5
13319 cf_cv_netbsd_form_h=no
13320 fi
13321 rm -f conftest.$ac_objext conftest.$ac_ext
13322
13323 fi
13324 echo "$as_me:13324: result: $cf_cv_netbsd_form_h" >&5
13325 echo "${ECHO_T}$cf_cv_netbsd_form_h" >&6
13326
13327 test "$cf_cv_netbsd_form_h" = yes &&
13328 cat >>confdefs.h <<\EOF
13329 #define HAVE_NETBSD_FORM_H 1
13330 EOF
13331
13332 echo "$as_me:13332: checking for NetBSD menu.h" >&5
13333 echo $ECHO_N "checking for NetBSD menu.h... $ECHO_C" >&6
13334 if test "${cf_cv_netbsd_menu_h+set}" = set; then
13335   echo $ECHO_N "(cached) $ECHO_C" >&6
13336 else
13337
13338 cat >conftest.$ac_ext <<_ACEOF
13339 #line 13339 "configure"
13340 #include "confdefs.h"
13341
13342 #include <${cf_cv_ncurses_header:-curses.h}>
13343 #include <menu.h>
13344
13345 int
13346 main ()
13347 {
13348
13349         MENU *menu;
13350         int y = menu->max_item_width;
13351
13352   ;
13353   return 0;
13354 }
13355 _ACEOF
13356 rm -f conftest.$ac_objext
13357 if { (eval echo "$as_me:13357: \"$ac_compile\"") >&5
13358   (eval $ac_compile) 2>&5
13359   ac_status=$?
13360   echo "$as_me:13360: \$? = $ac_status" >&5
13361   (exit $ac_status); } &&
13362          { ac_try='test -s conftest.$ac_objext'
13363   { (eval echo "$as_me:13363: \"$ac_try\"") >&5
13364   (eval $ac_try) 2>&5
13365   ac_status=$?
13366   echo "$as_me:13366: \$? = $ac_status" >&5
13367   (exit $ac_status); }; }; then
13368   cf_cv_netbsd_menu_h=yes
13369
13370 else
13371   echo "$as_me: failed program was:" >&5
13372 cat conftest.$ac_ext >&5
13373 cf_cv_netbsd_menu_h=no
13374 fi
13375 rm -f conftest.$ac_objext conftest.$ac_ext
13376
13377 fi
13378 echo "$as_me:13378: result: $cf_cv_netbsd_menu_h" >&5
13379 echo "${ECHO_T}$cf_cv_netbsd_menu_h" >&6
13380
13381 test "$cf_cv_netbsd_menu_h" = yes &&
13382 cat >>confdefs.h <<\EOF
13383 #define HAVE_NETBSD_MENU_H 1
13384 EOF
13385
13386         ;;
13387 esac
13388
13389 case $cf_cv_screen in
13390 (pdcurses)
13391         ;;
13392 (*)
13393         # look for curses-related libraries
13394
13395 as_ac_Lib=`echo "ac_cv_lib_panel$cf_cv_libtype''_new_panel" | $as_tr_sh`
13396 echo "$as_me:13396: checking for new_panel in -lpanel$cf_cv_libtype" >&5
13397 echo $ECHO_N "checking for new_panel in -lpanel$cf_cv_libtype... $ECHO_C" >&6
13398 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
13399   echo $ECHO_N "(cached) $ECHO_C" >&6
13400 else
13401   ac_check_lib_save_LIBS=$LIBS
13402 LIBS="-lpanel$cf_cv_libtype  $LIBS"
13403 cat >conftest.$ac_ext <<_ACEOF
13404 #line 13404 "configure"
13405 #include "confdefs.h"
13406
13407 /* Override any gcc2 internal prototype to avoid an error.  */
13408 #ifdef __cplusplus
13409 extern "C"
13410 #endif
13411 /* We use char because int might match the return type of a gcc2
13412    builtin and then its argument prototype would still apply.  */
13413 char new_panel ();
13414 int
13415 main ()
13416 {
13417 new_panel ();
13418   ;
13419   return 0;
13420 }
13421 _ACEOF
13422 rm -f conftest.$ac_objext conftest$ac_exeext
13423 if { (eval echo "$as_me:13423: \"$ac_link\"") >&5
13424   (eval $ac_link) 2>&5
13425   ac_status=$?
13426   echo "$as_me:13426: \$? = $ac_status" >&5
13427   (exit $ac_status); } &&
13428          { ac_try='test -s conftest$ac_exeext'
13429   { (eval echo "$as_me:13429: \"$ac_try\"") >&5
13430   (eval $ac_try) 2>&5
13431   ac_status=$?
13432   echo "$as_me:13432: \$? = $ac_status" >&5
13433   (exit $ac_status); }; }; then
13434   eval "$as_ac_Lib=yes"
13435 else
13436   echo "$as_me: failed program was:" >&5
13437 cat conftest.$ac_ext >&5
13438 eval "$as_ac_Lib=no"
13439 fi
13440 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13441 LIBS=$ac_check_lib_save_LIBS
13442 fi
13443 echo "$as_me:13443: result: `eval echo '${'$as_ac_Lib'}'`" >&5
13444 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
13445 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
13446
13447 cf_upper=`echo "have_libpanel" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
13448
13449 cf_add_libs="-lpanel$cf_cv_libtype"
13450 # Filter out duplicates - this happens with badly-designed ".pc" files...
13451 for cf_add_1lib in $LIBS
13452 do
13453         for cf_add_2lib in $cf_add_libs
13454         do
13455                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13456                 then
13457                         cf_add_1lib=
13458                         break
13459                 fi
13460         done
13461         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13462 done
13463 LIBS="$cf_add_libs"
13464
13465 cat >>confdefs.h <<EOF
13466 #define $cf_upper 1
13467 EOF
13468
13469 fi
13470
13471 as_ac_Lib=`echo "ac_cv_lib_menu$cf_cv_libtype''_menu_driver" | $as_tr_sh`
13472 echo "$as_me:13472: checking for menu_driver in -lmenu$cf_cv_libtype" >&5
13473 echo $ECHO_N "checking for menu_driver in -lmenu$cf_cv_libtype... $ECHO_C" >&6
13474 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
13475   echo $ECHO_N "(cached) $ECHO_C" >&6
13476 else
13477   ac_check_lib_save_LIBS=$LIBS
13478 LIBS="-lmenu$cf_cv_libtype  $LIBS"
13479 cat >conftest.$ac_ext <<_ACEOF
13480 #line 13480 "configure"
13481 #include "confdefs.h"
13482
13483 /* Override any gcc2 internal prototype to avoid an error.  */
13484 #ifdef __cplusplus
13485 extern "C"
13486 #endif
13487 /* We use char because int might match the return type of a gcc2
13488    builtin and then its argument prototype would still apply.  */
13489 char menu_driver ();
13490 int
13491 main ()
13492 {
13493 menu_driver ();
13494   ;
13495   return 0;
13496 }
13497 _ACEOF
13498 rm -f conftest.$ac_objext conftest$ac_exeext
13499 if { (eval echo "$as_me:13499: \"$ac_link\"") >&5
13500   (eval $ac_link) 2>&5
13501   ac_status=$?
13502   echo "$as_me:13502: \$? = $ac_status" >&5
13503   (exit $ac_status); } &&
13504          { ac_try='test -s conftest$ac_exeext'
13505   { (eval echo "$as_me:13505: \"$ac_try\"") >&5
13506   (eval $ac_try) 2>&5
13507   ac_status=$?
13508   echo "$as_me:13508: \$? = $ac_status" >&5
13509   (exit $ac_status); }; }; then
13510   eval "$as_ac_Lib=yes"
13511 else
13512   echo "$as_me: failed program was:" >&5
13513 cat conftest.$ac_ext >&5
13514 eval "$as_ac_Lib=no"
13515 fi
13516 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13517 LIBS=$ac_check_lib_save_LIBS
13518 fi
13519 echo "$as_me:13519: result: `eval echo '${'$as_ac_Lib'}'`" >&5
13520 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
13521 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
13522
13523 cf_upper=`echo "have_libmenu" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
13524
13525 cf_add_libs="-lmenu$cf_cv_libtype"
13526 # Filter out duplicates - this happens with badly-designed ".pc" files...
13527 for cf_add_1lib in $LIBS
13528 do
13529         for cf_add_2lib in $cf_add_libs
13530         do
13531                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13532                 then
13533                         cf_add_1lib=
13534                         break
13535                 fi
13536         done
13537         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13538 done
13539 LIBS="$cf_add_libs"
13540
13541 cat >>confdefs.h <<EOF
13542 #define $cf_upper 1
13543 EOF
13544
13545 fi
13546
13547 as_ac_Lib=`echo "ac_cv_lib_form$cf_cv_libtype''_form_driver" | $as_tr_sh`
13548 echo "$as_me:13548: checking for form_driver in -lform$cf_cv_libtype" >&5
13549 echo $ECHO_N "checking for form_driver in -lform$cf_cv_libtype... $ECHO_C" >&6
13550 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
13551   echo $ECHO_N "(cached) $ECHO_C" >&6
13552 else
13553   ac_check_lib_save_LIBS=$LIBS
13554 LIBS="-lform$cf_cv_libtype  $LIBS"
13555 cat >conftest.$ac_ext <<_ACEOF
13556 #line 13556 "configure"
13557 #include "confdefs.h"
13558
13559 /* Override any gcc2 internal prototype to avoid an error.  */
13560 #ifdef __cplusplus
13561 extern "C"
13562 #endif
13563 /* We use char because int might match the return type of a gcc2
13564    builtin and then its argument prototype would still apply.  */
13565 char form_driver ();
13566 int
13567 main ()
13568 {
13569 form_driver ();
13570   ;
13571   return 0;
13572 }
13573 _ACEOF
13574 rm -f conftest.$ac_objext conftest$ac_exeext
13575 if { (eval echo "$as_me:13575: \"$ac_link\"") >&5
13576   (eval $ac_link) 2>&5
13577   ac_status=$?
13578   echo "$as_me:13578: \$? = $ac_status" >&5
13579   (exit $ac_status); } &&
13580          { ac_try='test -s conftest$ac_exeext'
13581   { (eval echo "$as_me:13581: \"$ac_try\"") >&5
13582   (eval $ac_try) 2>&5
13583   ac_status=$?
13584   echo "$as_me:13584: \$? = $ac_status" >&5
13585   (exit $ac_status); }; }; then
13586   eval "$as_ac_Lib=yes"
13587 else
13588   echo "$as_me: failed program was:" >&5
13589 cat conftest.$ac_ext >&5
13590 eval "$as_ac_Lib=no"
13591 fi
13592 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13593 LIBS=$ac_check_lib_save_LIBS
13594 fi
13595 echo "$as_me:13595: result: `eval echo '${'$as_ac_Lib'}'`" >&5
13596 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
13597 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
13598
13599 cf_upper=`echo "have_libform" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
13600
13601 cf_add_libs="-lform$cf_cv_libtype"
13602 # Filter out duplicates - this happens with badly-designed ".pc" files...
13603 for cf_add_1lib in $LIBS
13604 do
13605         for cf_add_2lib in $cf_add_libs
13606         do
13607                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13608                 then
13609                         cf_add_1lib=
13610                         break
13611                 fi
13612         done
13613         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13614 done
13615 LIBS="$cf_add_libs"
13616
13617 cat >>confdefs.h <<EOF
13618 #define $cf_upper 1
13619 EOF
13620
13621 fi
13622
13623         # look for curses-related headers
13624
13625 for ac_header in \
13626                 nc_alloc.h \
13627                 nomacros.h \
13628                 form.h \
13629                 menu.h \
13630                 panel.h \
13631                 term_entry.h \
13632
13633 do
13634 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
13635 echo "$as_me:13635: checking for $ac_header" >&5
13636 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
13637 if eval "test \"\${$as_ac_Header+set}\" = set"; then
13638   echo $ECHO_N "(cached) $ECHO_C" >&6
13639 else
13640   cat >conftest.$ac_ext <<_ACEOF
13641 #line 13641 "configure"
13642 #include "confdefs.h"
13643 #include <$ac_header>
13644 _ACEOF
13645 if { (eval echo "$as_me:13645: \"$ac_cpp conftest.$ac_ext\"") >&5
13646   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13647   ac_status=$?
13648   egrep -v '^ *\+' conftest.er1 >conftest.err
13649   rm -f conftest.er1
13650   cat conftest.err >&5
13651   echo "$as_me:13651: \$? = $ac_status" >&5
13652   (exit $ac_status); } >/dev/null; then
13653   if test -s conftest.err; then
13654     ac_cpp_err=$ac_c_preproc_warn_flag
13655   else
13656     ac_cpp_err=
13657   fi
13658 else
13659   ac_cpp_err=yes
13660 fi
13661 if test -z "$ac_cpp_err"; then
13662   eval "$as_ac_Header=yes"
13663 else
13664   echo "$as_me: failed program was:" >&5
13665   cat conftest.$ac_ext >&5
13666   eval "$as_ac_Header=no"
13667 fi
13668 rm -f conftest.err conftest.$ac_ext
13669 fi
13670 echo "$as_me:13670: result: `eval echo '${'$as_ac_Header'}'`" >&5
13671 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
13672 if test `eval echo '${'$as_ac_Header'}'` = yes; then
13673   cat >>confdefs.h <<EOF
13674 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
13675 EOF
13676
13677 fi
13678 done
13679
13680         ;;
13681 esac
13682
13683 echo "$as_me:13683: checking for ANSI C header files" >&5
13684 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
13685 if test "${ac_cv_header_stdc+set}" = set; then
13686   echo $ECHO_N "(cached) $ECHO_C" >&6
13687 else
13688   cat >conftest.$ac_ext <<_ACEOF
13689 #line 13689 "configure"
13690 #include "confdefs.h"
13691 #include <stdlib.h>
13692 #include <stdarg.h>
13693 #include <string.h>
13694 #include <float.h>
13695
13696 _ACEOF
13697 if { (eval echo "$as_me:13697: \"$ac_cpp conftest.$ac_ext\"") >&5
13698   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13699   ac_status=$?
13700   egrep -v '^ *\+' conftest.er1 >conftest.err
13701   rm -f conftest.er1
13702   cat conftest.err >&5
13703   echo "$as_me:13703: \$? = $ac_status" >&5
13704   (exit $ac_status); } >/dev/null; then
13705   if test -s conftest.err; then
13706     ac_cpp_err=$ac_c_preproc_warn_flag
13707   else
13708     ac_cpp_err=
13709   fi
13710 else
13711   ac_cpp_err=yes
13712 fi
13713 if test -z "$ac_cpp_err"; then
13714   ac_cv_header_stdc=yes
13715 else
13716   echo "$as_me: failed program was:" >&5
13717   cat conftest.$ac_ext >&5
13718   ac_cv_header_stdc=no
13719 fi
13720 rm -f conftest.err conftest.$ac_ext
13721
13722 if test $ac_cv_header_stdc = yes; then
13723   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
13724   cat >conftest.$ac_ext <<_ACEOF
13725 #line 13725 "configure"
13726 #include "confdefs.h"
13727 #include <string.h>
13728
13729 _ACEOF
13730 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13731   egrep "memchr" >/dev/null 2>&1; then
13732   :
13733 else
13734   ac_cv_header_stdc=no
13735 fi
13736 rm -rf conftest*
13737
13738 fi
13739
13740 if test $ac_cv_header_stdc = yes; then
13741   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
13742   cat >conftest.$ac_ext <<_ACEOF
13743 #line 13743 "configure"
13744 #include "confdefs.h"
13745 #include <stdlib.h>
13746
13747 _ACEOF
13748 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13749   egrep "free" >/dev/null 2>&1; then
13750   :
13751 else
13752   ac_cv_header_stdc=no
13753 fi
13754 rm -rf conftest*
13755
13756 fi
13757
13758 if test $ac_cv_header_stdc = yes; then
13759   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
13760   if test "$cross_compiling" = yes; then
13761   :
13762 else
13763   cat >conftest.$ac_ext <<_ACEOF
13764 #line 13764 "configure"
13765 #include "confdefs.h"
13766 #include <ctype.h>
13767 #if ((' ' & 0x0FF) == 0x020)
13768 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
13769 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
13770 #else
13771 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
13772                      || ('j' <= (c) && (c) <= 'r') \
13773                      || ('s' <= (c) && (c) <= 'z'))
13774 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
13775 #endif
13776
13777 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
13778 int
13779 main ()
13780 {
13781   int i;
13782   for (i = 0; i < 256; i++)
13783     if (XOR (islower (i), ISLOWER (i))
13784         || toupper (i) != TOUPPER (i))
13785       $ac_main_return(2);
13786   $ac_main_return (0);
13787 }
13788 _ACEOF
13789 rm -f conftest$ac_exeext
13790 if { (eval echo "$as_me:13790: \"$ac_link\"") >&5
13791   (eval $ac_link) 2>&5
13792   ac_status=$?
13793   echo "$as_me:13793: \$? = $ac_status" >&5
13794   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
13795   { (eval echo "$as_me:13795: \"$ac_try\"") >&5
13796   (eval $ac_try) 2>&5
13797   ac_status=$?
13798   echo "$as_me:13798: \$? = $ac_status" >&5
13799   (exit $ac_status); }; }; then
13800   :
13801 else
13802   echo "$as_me: program exited with status $ac_status" >&5
13803 echo "$as_me: failed program was:" >&5
13804 cat conftest.$ac_ext >&5
13805 ac_cv_header_stdc=no
13806 fi
13807 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
13808 fi
13809 fi
13810 fi
13811 echo "$as_me:13811: result: $ac_cv_header_stdc" >&5
13812 echo "${ECHO_T}$ac_cv_header_stdc" >&6
13813 if test $ac_cv_header_stdc = yes; then
13814
13815 cat >>confdefs.h <<\EOF
13816 #define STDC_HEADERS 1
13817 EOF
13818
13819 fi
13820
13821 echo "$as_me:13821: checking whether time.h and sys/time.h may both be included" >&5
13822 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
13823 if test "${ac_cv_header_time+set}" = set; then
13824   echo $ECHO_N "(cached) $ECHO_C" >&6
13825 else
13826   cat >conftest.$ac_ext <<_ACEOF
13827 #line 13827 "configure"
13828 #include "confdefs.h"
13829 #include <sys/types.h>
13830 #include <sys/time.h>
13831 #include <time.h>
13832
13833 int
13834 main ()
13835 {
13836 if ((struct tm *) 0)
13837 return 0;
13838   ;
13839   return 0;
13840 }
13841 _ACEOF
13842 rm -f conftest.$ac_objext
13843 if { (eval echo "$as_me:13843: \"$ac_compile\"") >&5
13844   (eval $ac_compile) 2>&5
13845   ac_status=$?
13846   echo "$as_me:13846: \$? = $ac_status" >&5
13847   (exit $ac_status); } &&
13848          { ac_try='test -s conftest.$ac_objext'
13849   { (eval echo "$as_me:13849: \"$ac_try\"") >&5
13850   (eval $ac_try) 2>&5
13851   ac_status=$?
13852   echo "$as_me:13852: \$? = $ac_status" >&5
13853   (exit $ac_status); }; }; then
13854   ac_cv_header_time=yes
13855 else
13856   echo "$as_me: failed program was:" >&5
13857 cat conftest.$ac_ext >&5
13858 ac_cv_header_time=no
13859 fi
13860 rm -f conftest.$ac_objext conftest.$ac_ext
13861 fi
13862 echo "$as_me:13862: result: $ac_cv_header_time" >&5
13863 echo "${ECHO_T}$ac_cv_header_time" >&6
13864 if test $ac_cv_header_time = yes; then
13865
13866 cat >>confdefs.h <<\EOF
13867 #define TIME_WITH_SYS_TIME 1
13868 EOF
13869
13870 fi
13871
13872 for ac_header in \
13873 getopt.h \
13874 locale.h \
13875 math.h \
13876 stdarg.h \
13877 sys/ioctl.h \
13878 sys/select.h \
13879 sys/time.h \
13880 termios.h \
13881 unistd.h \
13882
13883 do
13884 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
13885 echo "$as_me:13885: checking for $ac_header" >&5
13886 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
13887 if eval "test \"\${$as_ac_Header+set}\" = set"; then
13888   echo $ECHO_N "(cached) $ECHO_C" >&6
13889 else
13890   cat >conftest.$ac_ext <<_ACEOF
13891 #line 13891 "configure"
13892 #include "confdefs.h"
13893 #include <$ac_header>
13894 _ACEOF
13895 if { (eval echo "$as_me:13895: \"$ac_cpp conftest.$ac_ext\"") >&5
13896   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13897   ac_status=$?
13898   egrep -v '^ *\+' conftest.er1 >conftest.err
13899   rm -f conftest.er1
13900   cat conftest.err >&5
13901   echo "$as_me:13901: \$? = $ac_status" >&5
13902   (exit $ac_status); } >/dev/null; then
13903   if test -s conftest.err; then
13904     ac_cpp_err=$ac_c_preproc_warn_flag
13905   else
13906     ac_cpp_err=
13907   fi
13908 else
13909   ac_cpp_err=yes
13910 fi
13911 if test -z "$ac_cpp_err"; then
13912   eval "$as_ac_Header=yes"
13913 else
13914   echo "$as_me: failed program was:" >&5
13915   cat conftest.$ac_ext >&5
13916   eval "$as_ac_Header=no"
13917 fi
13918 rm -f conftest.err conftest.$ac_ext
13919 fi
13920 echo "$as_me:13920: result: `eval echo '${'$as_ac_Header'}'`" >&5
13921 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
13922 if test `eval echo '${'$as_ac_Header'}'` = yes; then
13923   cat >>confdefs.h <<EOF
13924 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
13925 EOF
13926
13927 fi
13928 done
13929
13930 for ac_header in unistd.h getopt.h
13931 do
13932 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
13933 echo "$as_me:13933: checking for $ac_header" >&5
13934 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
13935 if eval "test \"\${$as_ac_Header+set}\" = set"; then
13936   echo $ECHO_N "(cached) $ECHO_C" >&6
13937 else
13938   cat >conftest.$ac_ext <<_ACEOF
13939 #line 13939 "configure"
13940 #include "confdefs.h"
13941 #include <$ac_header>
13942 _ACEOF
13943 if { (eval echo "$as_me:13943: \"$ac_cpp conftest.$ac_ext\"") >&5
13944   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13945   ac_status=$?
13946   egrep -v '^ *\+' conftest.er1 >conftest.err
13947   rm -f conftest.er1
13948   cat conftest.err >&5
13949   echo "$as_me:13949: \$? = $ac_status" >&5
13950   (exit $ac_status); } >/dev/null; then
13951   if test -s conftest.err; then
13952     ac_cpp_err=$ac_c_preproc_warn_flag
13953   else
13954     ac_cpp_err=
13955   fi
13956 else
13957   ac_cpp_err=yes
13958 fi
13959 if test -z "$ac_cpp_err"; then
13960   eval "$as_ac_Header=yes"
13961 else
13962   echo "$as_me: failed program was:" >&5
13963   cat conftest.$ac_ext >&5
13964   eval "$as_ac_Header=no"
13965 fi
13966 rm -f conftest.err conftest.$ac_ext
13967 fi
13968 echo "$as_me:13968: result: `eval echo '${'$as_ac_Header'}'`" >&5
13969 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
13970 if test `eval echo '${'$as_ac_Header'}'` = yes; then
13971   cat >>confdefs.h <<EOF
13972 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
13973 EOF
13974
13975 fi
13976 done
13977
13978 echo "$as_me:13978: checking for header declaring getopt variables" >&5
13979 echo $ECHO_N "checking for header declaring getopt variables... $ECHO_C" >&6
13980 if test "${cf_cv_getopt_header+set}" = set; then
13981   echo $ECHO_N "(cached) $ECHO_C" >&6
13982 else
13983
13984 cf_cv_getopt_header=none
13985 for cf_header in stdio.h stdlib.h unistd.h getopt.h
13986 do
13987 cat >conftest.$ac_ext <<_ACEOF
13988 #line 13988 "configure"
13989 #include "confdefs.h"
13990
13991 #include <$cf_header>
13992 int
13993 main ()
13994 {
13995 int x = optind; char *y = optarg
13996   ;
13997   return 0;
13998 }
13999 _ACEOF
14000 rm -f conftest.$ac_objext
14001 if { (eval echo "$as_me:14001: \"$ac_compile\"") >&5
14002   (eval $ac_compile) 2>&5
14003   ac_status=$?
14004   echo "$as_me:14004: \$? = $ac_status" >&5
14005   (exit $ac_status); } &&
14006          { ac_try='test -s conftest.$ac_objext'
14007   { (eval echo "$as_me:14007: \"$ac_try\"") >&5
14008   (eval $ac_try) 2>&5
14009   ac_status=$?
14010   echo "$as_me:14010: \$? = $ac_status" >&5
14011   (exit $ac_status); }; }; then
14012   cf_cv_getopt_header=$cf_header
14013  break
14014 else
14015   echo "$as_me: failed program was:" >&5
14016 cat conftest.$ac_ext >&5
14017 fi
14018 rm -f conftest.$ac_objext conftest.$ac_ext
14019 done
14020
14021 fi
14022 echo "$as_me:14022: result: $cf_cv_getopt_header" >&5
14023 echo "${ECHO_T}$cf_cv_getopt_header" >&6
14024 if test $cf_cv_getopt_header != none ; then
14025
14026 cat >>confdefs.h <<\EOF
14027 #define HAVE_GETOPT_HEADER 1
14028 EOF
14029
14030 fi
14031 if test $cf_cv_getopt_header = getopt.h ; then
14032
14033 cat >>confdefs.h <<\EOF
14034 #define NEED_GETOPT_H 1
14035 EOF
14036
14037 fi
14038
14039 for ac_func in \
14040 getopt \
14041 gettimeofday \
14042
14043 do
14044 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
14045 echo "$as_me:14045: checking for $ac_func" >&5
14046 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
14047 if eval "test \"\${$as_ac_var+set}\" = set"; then
14048   echo $ECHO_N "(cached) $ECHO_C" >&6
14049 else
14050   cat >conftest.$ac_ext <<_ACEOF
14051 #line 14051 "configure"
14052 #include "confdefs.h"
14053 /* System header to define __stub macros and hopefully few prototypes,
14054     which can conflict with char $ac_func (); below.  */
14055 #include <assert.h>
14056 /* Override any gcc2 internal prototype to avoid an error.  */
14057 #ifdef __cplusplus
14058 extern "C"
14059 #endif
14060 /* We use char because int might match the return type of a gcc2
14061    builtin and then its argument prototype would still apply.  */
14062 char $ac_func ();
14063 char (*f) ();
14064
14065 int
14066 main ()
14067 {
14068 /* The GNU C library defines this for functions which it implements
14069     to always fail with ENOSYS.  Some functions are actually named
14070     something starting with __ and the normal name is an alias.  */
14071 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
14072 choke me
14073 #else
14074 f = $ac_func; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
14075 #endif
14076
14077   ;
14078   return 0;
14079 }
14080 _ACEOF
14081 rm -f conftest.$ac_objext conftest$ac_exeext
14082 if { (eval echo "$as_me:14082: \"$ac_link\"") >&5
14083   (eval $ac_link) 2>&5
14084   ac_status=$?
14085   echo "$as_me:14085: \$? = $ac_status" >&5
14086   (exit $ac_status); } &&
14087          { ac_try='test -s conftest$ac_exeext'
14088   { (eval echo "$as_me:14088: \"$ac_try\"") >&5
14089   (eval $ac_try) 2>&5
14090   ac_status=$?
14091   echo "$as_me:14091: \$? = $ac_status" >&5
14092   (exit $ac_status); }; }; then
14093   eval "$as_ac_var=yes"
14094 else
14095   echo "$as_me: failed program was:" >&5
14096 cat conftest.$ac_ext >&5
14097 eval "$as_ac_var=no"
14098 fi
14099 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14100 fi
14101 echo "$as_me:14101: result: `eval echo '${'$as_ac_var'}'`" >&5
14102 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
14103 if test `eval echo '${'$as_ac_var'}'` = yes; then
14104   cat >>confdefs.h <<EOF
14105 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
14106 EOF
14107
14108 fi
14109 done
14110
14111 if test "x$ac_cv_func_getopt" = xno; then
14112         { { echo "$as_me:14112: error: getopt is required for building programs" >&5
14113 echo "$as_me: error: getopt is required for building programs" >&2;}
14114    { (exit 1); exit 1; }; }
14115 fi
14116
14117 if test "$cf_enable_widec" = yes; then
14118
14119 for ac_func in \
14120 mblen \
14121 mbrlen \
14122 mbrtowc \
14123 mbsrtowcs \
14124 mbstowcs \
14125 mbtowc \
14126 wcsrtombs \
14127 wcstombs \
14128
14129 do
14130 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
14131 echo "$as_me:14131: checking for $ac_func" >&5
14132 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
14133 if eval "test \"\${$as_ac_var+set}\" = set"; then
14134   echo $ECHO_N "(cached) $ECHO_C" >&6
14135 else
14136   cat >conftest.$ac_ext <<_ACEOF
14137 #line 14137 "configure"
14138 #include "confdefs.h"
14139 /* System header to define __stub macros and hopefully few prototypes,
14140     which can conflict with char $ac_func (); below.  */
14141 #include <assert.h>
14142 /* Override any gcc2 internal prototype to avoid an error.  */
14143 #ifdef __cplusplus
14144 extern "C"
14145 #endif
14146 /* We use char because int might match the return type of a gcc2
14147    builtin and then its argument prototype would still apply.  */
14148 char $ac_func ();
14149 char (*f) ();
14150
14151 int
14152 main ()
14153 {
14154 /* The GNU C library defines this for functions which it implements
14155     to always fail with ENOSYS.  Some functions are actually named
14156     something starting with __ and the normal name is an alias.  */
14157 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
14158 choke me
14159 #else
14160 f = $ac_func; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
14161 #endif
14162
14163   ;
14164   return 0;
14165 }
14166 _ACEOF
14167 rm -f conftest.$ac_objext conftest$ac_exeext
14168 if { (eval echo "$as_me:14168: \"$ac_link\"") >&5
14169   (eval $ac_link) 2>&5
14170   ac_status=$?
14171   echo "$as_me:14171: \$? = $ac_status" >&5
14172   (exit $ac_status); } &&
14173          { ac_try='test -s conftest$ac_exeext'
14174   { (eval echo "$as_me:14174: \"$ac_try\"") >&5
14175   (eval $ac_try) 2>&5
14176   ac_status=$?
14177   echo "$as_me:14177: \$? = $ac_status" >&5
14178   (exit $ac_status); }; }; then
14179   eval "$as_ac_var=yes"
14180 else
14181   echo "$as_me: failed program was:" >&5
14182 cat conftest.$ac_ext >&5
14183 eval "$as_ac_var=no"
14184 fi
14185 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14186 fi
14187 echo "$as_me:14187: result: `eval echo '${'$as_ac_var'}'`" >&5
14188 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
14189 if test `eval echo '${'$as_ac_var'}'` = yes; then
14190   cat >>confdefs.h <<EOF
14191 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
14192 EOF
14193
14194 fi
14195 done
14196
14197 fi
14198
14199 echo "$as_me:14199: checking definition to turn on extended curses functions" >&5
14200 echo $ECHO_N "checking definition to turn on extended curses functions... $ECHO_C" >&6
14201 if test "${cf_cv_need_xopen_extension+set}" = set; then
14202   echo $ECHO_N "(cached) $ECHO_C" >&6
14203 else
14204
14205 cf_cv_need_xopen_extension=unknown
14206 cat >conftest.$ac_ext <<_ACEOF
14207 #line 14207 "configure"
14208 #include "confdefs.h"
14209
14210 #include <stdlib.h>
14211 #include <${cf_cv_ncurses_header:-curses.h}>
14212 int
14213 main ()
14214 {
14215
14216 #if defined(NCURSES_VERSION_PATCH)
14217 #if (NCURSES_VERSION_PATCH < 20100501) && (NCURSES_VERSION_PATCH >= 20100403)
14218         make an error
14219 #endif
14220 #endif
14221 #ifdef NCURSES_VERSION
14222         cchar_t check;
14223         int check2 = curs_set((int)sizeof(check));
14224 #endif
14225         long x = winnstr(stdscr, "", 0);
14226         int x1, y1;
14227         getbegyx(stdscr, y1, x1)
14228   ;
14229   return 0;
14230 }
14231 _ACEOF
14232 rm -f conftest.$ac_objext conftest$ac_exeext
14233 if { (eval echo "$as_me:14233: \"$ac_link\"") >&5
14234   (eval $ac_link) 2>&5
14235   ac_status=$?
14236   echo "$as_me:14236: \$? = $ac_status" >&5
14237   (exit $ac_status); } &&
14238          { ac_try='test -s conftest$ac_exeext'
14239   { (eval echo "$as_me:14239: \"$ac_try\"") >&5
14240   (eval $ac_try) 2>&5
14241   ac_status=$?
14242   echo "$as_me:14242: \$? = $ac_status" >&5
14243   (exit $ac_status); }; }; then
14244   cf_cv_need_xopen_extension=none
14245 else
14246   echo "$as_me: failed program was:" >&5
14247 cat conftest.$ac_ext >&5
14248
14249         for cf_try_xopen_extension in _XOPEN_SOURCE_EXTENDED NCURSES_WIDECHAR
14250         do
14251                 cat >conftest.$ac_ext <<_ACEOF
14252 #line 14252 "configure"
14253 #include "confdefs.h"
14254
14255 #define $cf_try_xopen_extension 1
14256 #include <stdlib.h>
14257 #include <${cf_cv_ncurses_header:-curses.h}>
14258 int
14259 main ()
14260 {
14261
14262 #ifdef NCURSES_VERSION
14263                 cchar_t check;
14264                 int check2 = curs_set((int)sizeof(check));
14265 #endif
14266                 long x = winnstr(stdscr, "", 0);
14267                 int x1, y1;
14268                 getbegyx(stdscr, y1, x1)
14269   ;
14270   return 0;
14271 }
14272 _ACEOF
14273 rm -f conftest.$ac_objext conftest$ac_exeext
14274 if { (eval echo "$as_me:14274: \"$ac_link\"") >&5
14275   (eval $ac_link) 2>&5
14276   ac_status=$?
14277   echo "$as_me:14277: \$? = $ac_status" >&5
14278   (exit $ac_status); } &&
14279          { ac_try='test -s conftest$ac_exeext'
14280   { (eval echo "$as_me:14280: \"$ac_try\"") >&5
14281   (eval $ac_try) 2>&5
14282   ac_status=$?
14283   echo "$as_me:14283: \$? = $ac_status" >&5
14284   (exit $ac_status); }; }; then
14285   cf_cv_need_xopen_extension=$cf_try_xopen_extension; break
14286 else
14287   echo "$as_me: failed program was:" >&5
14288 cat conftest.$ac_ext >&5
14289 fi
14290 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14291         done
14292
14293 fi
14294 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14295
14296 fi
14297 echo "$as_me:14297: result: $cf_cv_need_xopen_extension" >&5
14298 echo "${ECHO_T}$cf_cv_need_xopen_extension" >&6
14299
14300 case $cf_cv_need_xopen_extension in
14301 (*_*)
14302         CPPFLAGS="$CPPFLAGS -D$cf_cv_need_xopen_extension"
14303         ;;
14304 esac
14305
14306 echo "$as_me:14306: checking for term.h" >&5
14307 echo $ECHO_N "checking for term.h... $ECHO_C" >&6
14308 if test "${cf_cv_term_header+set}" = set; then
14309   echo $ECHO_N "(cached) $ECHO_C" >&6
14310 else
14311
14312 # If we found <ncurses/curses.h>, look for <ncurses/term.h>, but always look
14313 # for <term.h> if we do not find the variant.
14314
14315 cf_header_list="term.h ncurses/term.h ncursesw/term.h"
14316
14317 case ${cf_cv_ncurses_header:-curses.h} in
14318 (*/*)
14319         cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`term.h
14320         cf_header_list="$cf_header_item $cf_header_list"
14321         ;;
14322 esac
14323
14324 for cf_header in $cf_header_list
14325 do
14326         cat >conftest.$ac_ext <<_ACEOF
14327 #line 14327 "configure"
14328 #include "confdefs.h"
14329
14330 #include <${cf_cv_ncurses_header:-curses.h}>
14331 #include <${cf_header}>
14332 int
14333 main ()
14334 {
14335 WINDOW *x
14336   ;
14337   return 0;
14338 }
14339 _ACEOF
14340 rm -f conftest.$ac_objext
14341 if { (eval echo "$as_me:14341: \"$ac_compile\"") >&5
14342   (eval $ac_compile) 2>&5
14343   ac_status=$?
14344   echo "$as_me:14344: \$? = $ac_status" >&5
14345   (exit $ac_status); } &&
14346          { ac_try='test -s conftest.$ac_objext'
14347   { (eval echo "$as_me:14347: \"$ac_try\"") >&5
14348   (eval $ac_try) 2>&5
14349   ac_status=$?
14350   echo "$as_me:14350: \$? = $ac_status" >&5
14351   (exit $ac_status); }; }; then
14352   cf_cv_term_header=$cf_header
14353          break
14354 else
14355   echo "$as_me: failed program was:" >&5
14356 cat conftest.$ac_ext >&5
14357 cf_cv_term_header=no
14358 fi
14359 rm -f conftest.$ac_objext conftest.$ac_ext
14360 done
14361
14362 case $cf_cv_term_header in
14363 (no)
14364         # If curses is ncurses, some packagers still mess it up by trying to make
14365         # us use GNU termcap.  This handles the most common case.
14366         for cf_header in ncurses/term.h ncursesw/term.h
14367         do
14368                 cat >conftest.$ac_ext <<_ACEOF
14369 #line 14369 "configure"
14370 #include "confdefs.h"
14371
14372 #include <${cf_cv_ncurses_header:-curses.h}>
14373 #ifdef NCURSES_VERSION
14374 #include <${cf_header}>
14375 #else
14376 make an error
14377 #endif
14378 int
14379 main ()
14380 {
14381 WINDOW *x
14382   ;
14383   return 0;
14384 }
14385 _ACEOF
14386 rm -f conftest.$ac_objext
14387 if { (eval echo "$as_me:14387: \"$ac_compile\"") >&5
14388   (eval $ac_compile) 2>&5
14389   ac_status=$?
14390   echo "$as_me:14390: \$? = $ac_status" >&5
14391   (exit $ac_status); } &&
14392          { ac_try='test -s conftest.$ac_objext'
14393   { (eval echo "$as_me:14393: \"$ac_try\"") >&5
14394   (eval $ac_try) 2>&5
14395   ac_status=$?
14396   echo "$as_me:14396: \$? = $ac_status" >&5
14397   (exit $ac_status); }; }; then
14398   cf_cv_term_header=$cf_header
14399                          break
14400 else
14401   echo "$as_me: failed program was:" >&5
14402 cat conftest.$ac_ext >&5
14403 cf_cv_term_header=no
14404 fi
14405 rm -f conftest.$ac_objext conftest.$ac_ext
14406         done
14407         ;;
14408 esac
14409
14410 fi
14411 echo "$as_me:14411: result: $cf_cv_term_header" >&5
14412 echo "${ECHO_T}$cf_cv_term_header" >&6
14413
14414 case $cf_cv_term_header in
14415 (term.h)
14416
14417 cat >>confdefs.h <<\EOF
14418 #define HAVE_TERM_H 1
14419 EOF
14420
14421         ;;
14422 (ncurses/term.h)
14423
14424 cat >>confdefs.h <<\EOF
14425 #define HAVE_NCURSES_TERM_H 1
14426 EOF
14427
14428         ;;
14429 (ncursesw/term.h)
14430
14431 cat >>confdefs.h <<\EOF
14432 #define HAVE_NCURSESW_TERM_H 1
14433 EOF
14434
14435         ;;
14436 esac
14437
14438 echo "$as_me:14438: checking for unctrl.h" >&5
14439 echo $ECHO_N "checking for unctrl.h... $ECHO_C" >&6
14440 if test "${cf_cv_unctrl_header+set}" = set; then
14441   echo $ECHO_N "(cached) $ECHO_C" >&6
14442 else
14443
14444 # If we found <ncurses/curses.h>, look for <ncurses/unctrl.h>, but always look
14445 # for <unctrl.h> if we do not find the variant.
14446
14447 cf_header_list="unctrl.h ncurses/unctrl.h ncursesw/unctrl.h"
14448
14449 case ${cf_cv_ncurses_header:-curses.h} in
14450 (*/*)
14451         cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`unctrl.h
14452         cf_header_list="$cf_header_item $cf_header_list"
14453         ;;
14454 esac
14455
14456 for cf_header in $cf_header_list
14457 do
14458         cat >conftest.$ac_ext <<_ACEOF
14459 #line 14459 "configure"
14460 #include "confdefs.h"
14461
14462 #include <${cf_cv_ncurses_header:-curses.h}>
14463 #include <${cf_header}>
14464 int
14465 main ()
14466 {
14467 WINDOW *x
14468   ;
14469   return 0;
14470 }
14471 _ACEOF
14472 rm -f conftest.$ac_objext
14473 if { (eval echo "$as_me:14473: \"$ac_compile\"") >&5
14474   (eval $ac_compile) 2>&5
14475   ac_status=$?
14476   echo "$as_me:14476: \$? = $ac_status" >&5
14477   (exit $ac_status); } &&
14478          { ac_try='test -s conftest.$ac_objext'
14479   { (eval echo "$as_me:14479: \"$ac_try\"") >&5
14480   (eval $ac_try) 2>&5
14481   ac_status=$?
14482   echo "$as_me:14482: \$? = $ac_status" >&5
14483   (exit $ac_status); }; }; then
14484   cf_cv_unctrl_header=$cf_header
14485          break
14486 else
14487   echo "$as_me: failed program was:" >&5
14488 cat conftest.$ac_ext >&5
14489 cf_cv_unctrl_header=no
14490 fi
14491 rm -f conftest.$ac_objext conftest.$ac_ext
14492 done
14493
14494 fi
14495 echo "$as_me:14495: result: $cf_cv_unctrl_header" >&5
14496 echo "${ECHO_T}$cf_cv_unctrl_header" >&6
14497
14498 case $cf_cv_unctrl_header in
14499 (no)
14500         { echo "$as_me:14500: WARNING: unctrl.h header not found" >&5
14501 echo "$as_me: WARNING: unctrl.h header not found" >&2;}
14502         ;;
14503 esac
14504
14505 case $cf_cv_unctrl_header in
14506 (unctrl.h)
14507
14508 cat >>confdefs.h <<\EOF
14509 #define HAVE_UNCTRL_H 1
14510 EOF
14511
14512         ;;
14513 (ncurses/unctrl.h)
14514
14515 cat >>confdefs.h <<\EOF
14516 #define HAVE_NCURSES_UNCTRL_H 1
14517 EOF
14518
14519         ;;
14520 (ncursesw/unctrl.h)
14521
14522 cat >>confdefs.h <<\EOF
14523 #define HAVE_NCURSESW_UNCTRL_H 1
14524 EOF
14525
14526         ;;
14527 esac
14528
14529 for cf_func in \
14530 assume_default_colors \
14531 chgat \
14532 color_set \
14533 filter \
14534 getbegx \
14535 getcurx \
14536 getmaxx \
14537 getnstr \
14538 getparx \
14539 getwin \
14540 mvvline \
14541 mvwvline \
14542 napms \
14543 putwin \
14544 resize_term \
14545 resizeterm \
14546 ripoffline \
14547 scr_dump \
14548 setupterm \
14549 slk_color \
14550 slk_init \
14551 termattrs \
14552 tgetent \
14553 tigetnum \
14554 tigetstr \
14555 typeahead \
14556 use_default_colors \
14557 use_env \
14558 use_extended_names \
14559 use_screen \
14560 use_window \
14561 vid_puts \
14562 vidputs \
14563 vsscanf \
14564 vw_printw \
14565 wchgat \
14566 winsstr \
14567 wresize \
14568 wsyncdown \
14569
14570 do
14571
14572 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14573
14574         echo "$as_me:14574: checking for ${cf_func}" >&5
14575 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
14576
14577 echo "${as_me:-configure}:14577: testing ${cf_func} ..." 1>&5
14578
14579         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
14580   echo $ECHO_N "(cached) $ECHO_C" >&6
14581 else
14582
14583                 eval cf_result='$ac_cv_func_'$cf_func
14584                 if test ".$cf_result" != ".no"; then
14585                         cat >conftest.$ac_ext <<_ACEOF
14586 #line 14586 "configure"
14587 #include "confdefs.h"
14588
14589 #ifdef HAVE_XCURSES
14590 #include <xcurses.h>
14591 char * XCursesProgramName = "test";
14592 #else
14593 #include <${cf_cv_ncurses_header:-curses.h}>
14594 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
14595 #include <ncursesw/term.h>
14596 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
14597 #include <ncurses/term.h>
14598 #elif defined(HAVE_TERM_H)
14599 #include <term.h>
14600 #endif
14601 #endif
14602
14603 int
14604 main ()
14605 {
14606
14607 #ifndef ${cf_func}
14608 long foo = (long)(&${cf_func});
14609 fprintf(stderr, "testing linkage of $cf_func:%p\n", foo);
14610 if (foo + 1234 > 5678)
14611         ${cf_cv_main_return:-return}(foo);
14612 #endif
14613
14614   ;
14615   return 0;
14616 }
14617 _ACEOF
14618 rm -f conftest.$ac_objext conftest$ac_exeext
14619 if { (eval echo "$as_me:14619: \"$ac_link\"") >&5
14620   (eval $ac_link) 2>&5
14621   ac_status=$?
14622   echo "$as_me:14622: \$? = $ac_status" >&5
14623   (exit $ac_status); } &&
14624          { ac_try='test -s conftest$ac_exeext'
14625   { (eval echo "$as_me:14625: \"$ac_try\"") >&5
14626   (eval $ac_try) 2>&5
14627   ac_status=$?
14628   echo "$as_me:14628: \$? = $ac_status" >&5
14629   (exit $ac_status); }; }; then
14630   cf_result=yes
14631 else
14632   echo "$as_me: failed program was:" >&5
14633 cat conftest.$ac_ext >&5
14634 cf_result=no
14635 fi
14636 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14637                 fi
14638                 eval 'cf_cv_func_'$cf_func'=$cf_result'
14639
14640 fi
14641
14642         # use the computed/retrieved cache-value:
14643         eval 'cf_result=$cf_cv_func_'$cf_func
14644         echo "$as_me:14644: result: $cf_result" >&5
14645 echo "${ECHO_T}$cf_result" >&6
14646         if test $cf_result != no; then
14647                 cat >>confdefs.h <<EOF
14648 #define HAVE_${cf_tr_func} 1
14649 EOF
14650
14651         fi
14652 done
14653
14654 for cf_func in tputs
14655 do
14656
14657 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14658
14659         echo "$as_me:14659: checking for ${cf_func}" >&5
14660 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
14661
14662 echo "${as_me:-configure}:14662: testing ${cf_func} ..." 1>&5
14663
14664         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
14665   echo $ECHO_N "(cached) $ECHO_C" >&6
14666 else
14667
14668                 eval cf_result='$ac_cv_func_'$cf_func
14669                 if test ".$cf_result" != ".no"; then
14670                         cat >conftest.$ac_ext <<_ACEOF
14671 #line 14671 "configure"
14672 #include "confdefs.h"
14673
14674 #ifdef HAVE_XCURSES
14675 #include <xcurses.h>
14676 char * XCursesProgramName = "test";
14677 #else
14678 #include <${cf_cv_ncurses_header:-curses.h}>
14679 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
14680 #include <ncursesw/term.h>
14681 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
14682 #include <ncurses/term.h>
14683 #elif defined(HAVE_TERM_H)
14684 #include <term.h>
14685 #endif
14686 #endif
14687
14688 int
14689 main ()
14690 {
14691
14692 #ifndef ${cf_func}
14693 long foo = (long)(&${cf_func});
14694 fprintf(stderr, "testing linkage of $cf_func:%p\n", foo);
14695 if (foo + 1234 > 5678)
14696         ${cf_cv_main_return:-return}(foo);
14697 #endif
14698
14699   ;
14700   return 0;
14701 }
14702 _ACEOF
14703 rm -f conftest.$ac_objext conftest$ac_exeext
14704 if { (eval echo "$as_me:14704: \"$ac_link\"") >&5
14705   (eval $ac_link) 2>&5
14706   ac_status=$?
14707   echo "$as_me:14707: \$? = $ac_status" >&5
14708   (exit $ac_status); } &&
14709          { ac_try='test -s conftest$ac_exeext'
14710   { (eval echo "$as_me:14710: \"$ac_try\"") >&5
14711   (eval $ac_try) 2>&5
14712   ac_status=$?
14713   echo "$as_me:14713: \$? = $ac_status" >&5
14714   (exit $ac_status); }; }; then
14715   cf_result=yes
14716 else
14717   echo "$as_me: failed program was:" >&5
14718 cat conftest.$ac_ext >&5
14719 cf_result=no
14720 fi
14721 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14722                 fi
14723                 eval 'cf_cv_func_'$cf_func'=$cf_result'
14724
14725 fi
14726
14727         # use the computed/retrieved cache-value:
14728         eval 'cf_result=$cf_cv_func_'$cf_func
14729         echo "$as_me:14729: result: $cf_result" >&5
14730 echo "${ECHO_T}$cf_result" >&6
14731         if test $cf_result != no; then
14732                 cat >>confdefs.h <<EOF
14733 #define HAVE_${cf_tr_func} 1
14734 EOF
14735
14736         fi
14737 done
14738
14739 if test x$cf_cv_func_tputs = xyes
14740 then
14741         cf_done=no
14742         for cf_arg in int char
14743         do
14744                 for cf_ret in int void
14745                 do
14746                         if test $cf_ret = void
14747                         then
14748                                 cf_return="/* nothing */"
14749                         else
14750                                 cf_return="return value"
14751                         fi
14752                         cat >conftest.$ac_ext <<_ACEOF
14753 #line 14753 "configure"
14754 #include "confdefs.h"
14755
14756 #include <${cf_cv_ncurses_header:-curses.h}>
14757 #include <$cf_cv_term_header>
14758
14759 static $cf_ret outc($cf_arg value) { $cf_return; }
14760
14761 int
14762 main ()
14763 {
14764
14765         tputs("hello", 0, outc);
14766         ${cf_cv_main_return:-return}(0);
14767
14768   ;
14769   return 0;
14770 }
14771 _ACEOF
14772 rm -f conftest.$ac_objext
14773 if { (eval echo "$as_me:14773: \"$ac_compile\"") >&5
14774   (eval $ac_compile) 2>&5
14775   ac_status=$?
14776   echo "$as_me:14776: \$? = $ac_status" >&5
14777   (exit $ac_status); } &&
14778          { ac_try='test -s conftest.$ac_objext'
14779   { (eval echo "$as_me:14779: \"$ac_try\"") >&5
14780   (eval $ac_try) 2>&5
14781   ac_status=$?
14782   echo "$as_me:14782: \$? = $ac_status" >&5
14783   (exit $ac_status); }; }; then
14784
14785                 test -n "$verbose" && echo "    prototype $cf_ret func($cf_arg value)" 1>&6
14786
14787 echo "${as_me:-configure}:14787: testing prototype $cf_ret func($cf_arg value) ..." 1>&5
14788
14789                 cat >>confdefs.h <<EOF
14790 #define TPUTS_ARG               $cf_arg
14791 #define TPUTS_PROTO(func,value) $cf_ret func(TPUTS_ARG value)
14792 #define TPUTS_RETURN(value)     $cf_return
14793 EOF
14794                 cf_done=yes
14795                 break
14796
14797 else
14798   echo "$as_me: failed program was:" >&5
14799 cat conftest.$ac_ext >&5
14800 fi
14801 rm -f conftest.$ac_objext conftest.$ac_ext
14802                 done
14803                 test $cf_done = yes && break
14804         done
14805 fi
14806
14807 echo "$as_me:14807: checking for ncurses extended functions" >&5
14808 echo $ECHO_N "checking for ncurses extended functions... $ECHO_C" >&6
14809 if test "${cf_cv_ncurses_ext_funcs+set}" = set; then
14810   echo $ECHO_N "(cached) $ECHO_C" >&6
14811 else
14812
14813 cat >conftest.$ac_ext <<_ACEOF
14814 #line 14814 "configure"
14815 #include "confdefs.h"
14816
14817 #include <${cf_cv_ncurses_header:-curses.h}>
14818 int
14819 main ()
14820 {
14821
14822 int x = NCURSES_EXT_FUNCS
14823
14824   ;
14825   return 0;
14826 }
14827 _ACEOF
14828 rm -f conftest.$ac_objext
14829 if { (eval echo "$as_me:14829: \"$ac_compile\"") >&5
14830   (eval $ac_compile) 2>&5
14831   ac_status=$?
14832   echo "$as_me:14832: \$? = $ac_status" >&5
14833   (exit $ac_status); } &&
14834          { ac_try='test -s conftest.$ac_objext'
14835   { (eval echo "$as_me:14835: \"$ac_try\"") >&5
14836   (eval $ac_try) 2>&5
14837   ac_status=$?
14838   echo "$as_me:14838: \$? = $ac_status" >&5
14839   (exit $ac_status); }; }; then
14840   cf_cv_ncurses_ext_funcs=defined
14841 else
14842   echo "$as_me: failed program was:" >&5
14843 cat conftest.$ac_ext >&5
14844
14845 cat >conftest.$ac_ext <<_ACEOF
14846 #line 14846 "configure"
14847 #include "confdefs.h"
14848
14849 #include <${cf_cv_ncurses_header:-curses.h}>
14850 int
14851 main ()
14852 {
14853
14854         (void) assume_default_colors (0, 0);
14855         (void) curses_version ();
14856         (void) define_key (0, 0);
14857         (void) is_term_resized (0, 0);
14858         (void) key_defined (0);
14859         (void) keybound (0, 0);
14860         (void) keyok (0, 0);
14861         (void) resize_term (0, 0);
14862         (void) resizeterm (0, 0);
14863         (void) use_default_colors ();
14864         (void) use_extended_names (0);
14865         (void) wresize (0, 0, 0);
14866   ;
14867   return 0;
14868 }
14869 _ACEOF
14870 rm -f conftest.$ac_objext conftest$ac_exeext
14871 if { (eval echo "$as_me:14871: \"$ac_link\"") >&5
14872   (eval $ac_link) 2>&5
14873   ac_status=$?
14874   echo "$as_me:14874: \$? = $ac_status" >&5
14875   (exit $ac_status); } &&
14876          { ac_try='test -s conftest$ac_exeext'
14877   { (eval echo "$as_me:14877: \"$ac_try\"") >&5
14878   (eval $ac_try) 2>&5
14879   ac_status=$?
14880   echo "$as_me:14880: \$? = $ac_status" >&5
14881   (exit $ac_status); }; }; then
14882   cf_cv_ncurses_ext_funcs=yes
14883 else
14884   echo "$as_me: failed program was:" >&5
14885 cat conftest.$ac_ext >&5
14886 cf_cv_ncurses_ext_funcs=no
14887 fi
14888 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14889
14890 fi
14891 rm -f conftest.$ac_objext conftest.$ac_ext
14892
14893 fi
14894 echo "$as_me:14894: result: $cf_cv_ncurses_ext_funcs" >&5
14895 echo "${ECHO_T}$cf_cv_ncurses_ext_funcs" >&6
14896 test "$cf_cv_ncurses_ext_funcs" = yes &&
14897 cat >>confdefs.h <<\EOF
14898 #define NCURSES_EXT_FUNCS 1
14899 EOF
14900
14901 if test "$cf_enable_widec" = yes
14902 then
14903         # workaround for systems with ncurses before 20111029, due to change of
14904         # feature test macro from _XPG5 to _XOPEN_SOURCE
14905         if test -n "$cf_cv_ncurses_version" && test "x$cf_cv_ncurses_version" != xno
14906         then
14907                 cf_define_xpg5=no
14908                 echo "$as_me:14908: checking if _XPG5 should be defined to enable wide-characters" >&5
14909 echo $ECHO_N "checking if _XPG5 should be defined to enable wide-characters... $ECHO_C" >&6
14910
14911                 cat >conftest.$ac_ext <<_ACEOF
14912 #line 14912 "configure"
14913 #include "confdefs.h"
14914
14915 #include <${cf_cv_ncurses_header:-curses.h}>
14916 int
14917 main ()
14918 {
14919 int x = _XPG5
14920   ;
14921   return 0;
14922 }
14923 _ACEOF
14924 rm -f conftest.$ac_objext
14925 if { (eval echo "$as_me:14925: \"$ac_compile\"") >&5
14926   (eval $ac_compile) 2>&5
14927   ac_status=$?
14928   echo "$as_me:14928: \$? = $ac_status" >&5
14929   (exit $ac_status); } &&
14930          { ac_try='test -s conftest.$ac_objext'
14931   { (eval echo "$as_me:14931: \"$ac_try\"") >&5
14932   (eval $ac_try) 2>&5
14933   ac_status=$?
14934   echo "$as_me:14934: \$? = $ac_status" >&5
14935   (exit $ac_status); }; }; then
14936   :
14937 else
14938   echo "$as_me: failed program was:" >&5
14939 cat conftest.$ac_ext >&5
14940 cf_save_cppflags="$CPPFLAGS"
14941                          CPPFLAGS="$CPPFLAGS -D_XPG5"
14942                          cat >conftest.$ac_ext <<_ACEOF
14943 #line 14943 "configure"
14944 #include "confdefs.h"
14945
14946 #include <${cf_cv_ncurses_header:-curses.h}>
14947 int
14948 main ()
14949 {
14950 int x = _XPG5
14951   ;
14952   return 0;
14953 }
14954 _ACEOF
14955 rm -f conftest.$ac_objext
14956 if { (eval echo "$as_me:14956: \"$ac_compile\"") >&5
14957   (eval $ac_compile) 2>&5
14958   ac_status=$?
14959   echo "$as_me:14959: \$? = $ac_status" >&5
14960   (exit $ac_status); } &&
14961          { ac_try='test -s conftest.$ac_objext'
14962   { (eval echo "$as_me:14962: \"$ac_try\"") >&5
14963   (eval $ac_try) 2>&5
14964   ac_status=$?
14965   echo "$as_me:14965: \$? = $ac_status" >&5
14966   (exit $ac_status); }; }; then
14967   cf_define_xpg5=yes
14968 else
14969   echo "$as_me: failed program was:" >&5
14970 cat conftest.$ac_ext >&5
14971 fi
14972 rm -f conftest.$ac_objext conftest.$ac_ext
14973                          CPPFLAGS="$cf_save_cppflags"
14974 fi
14975 rm -f conftest.$ac_objext conftest.$ac_ext
14976                 echo "$as_me:14976: result: $cf_define_xpg5" >&5
14977 echo "${ECHO_T}$cf_define_xpg5" >&6
14978
14979                 if test "$cf_define_xpg5" = yes
14980                 then
14981                         CPPFLAGS="$CPPFLAGS -D_XPG5"
14982                 fi
14983         fi
14984
14985         echo "$as_me:14985: checking for wide-character functions" >&5
14986 echo $ECHO_N "checking for wide-character functions... $ECHO_C" >&6
14987 if test "${cf_cv_widechar_funcs+set}" = set; then
14988   echo $ECHO_N "(cached) $ECHO_C" >&6
14989 else
14990
14991         cat >conftest.$ac_ext <<_ACEOF
14992 #line 14992 "configure"
14993 #include "confdefs.h"
14994
14995 #include <${cf_cv_ncurses_header:-curses.h}>
14996 int
14997 main ()
14998 {
14999
15000                 static wchar_t src_wchar[2];
15001                 static cchar_t dst_cchar;
15002                 setcchar(&dst_cchar, src_wchar, A_NORMAL, 0, (void *) 0);
15003
15004   ;
15005   return 0;
15006 }
15007 _ACEOF
15008 rm -f conftest.$ac_objext conftest$ac_exeext
15009 if { (eval echo "$as_me:15009: \"$ac_link\"") >&5
15010   (eval $ac_link) 2>&5
15011   ac_status=$?
15012   echo "$as_me:15012: \$? = $ac_status" >&5
15013   (exit $ac_status); } &&
15014          { ac_try='test -s conftest$ac_exeext'
15015   { (eval echo "$as_me:15015: \"$ac_try\"") >&5
15016   (eval $ac_try) 2>&5
15017   ac_status=$?
15018   echo "$as_me:15018: \$? = $ac_status" >&5
15019   (exit $ac_status); }; }; then
15020   cf_cv_widechar_funcs=yes
15021 else
15022   echo "$as_me: failed program was:" >&5
15023 cat conftest.$ac_ext >&5
15024 cf_cv_widechar_funcs=no
15025 fi
15026 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15027
15028 fi
15029 echo "$as_me:15029: result: $cf_cv_widechar_funcs" >&5
15030 echo "${ECHO_T}$cf_cv_widechar_funcs" >&6
15031         if test "$cf_cv_widechar_funcs" != no ; then
15032
15033 cat >>confdefs.h <<\EOF
15034 #define USE_WIDEC_SUPPORT 1
15035 EOF
15036
15037         else
15038                 cat >>confdefs.h <<\EOF
15039 #define USE_WIDEC_SUPPORT 0
15040 EOF
15041
15042         fi
15043 else
15044         cat >>confdefs.h <<\EOF
15045 #define USE_WIDEC_SUPPORT 0
15046 EOF
15047
15048 fi
15049
15050 echo "$as_me:15050: checking if $cf_cv_screen library uses pthreads" >&5
15051 echo $ECHO_N "checking if $cf_cv_screen library uses pthreads... $ECHO_C" >&6
15052 if test "${cf_cv_use_pthreads+set}" = set; then
15053   echo $ECHO_N "(cached) $ECHO_C" >&6
15054 else
15055
15056 cat >conftest.$ac_ext <<_ACEOF
15057 #line 15057 "configure"
15058 #include "confdefs.h"
15059
15060 #include <${cf_cv_ncurses_header:-curses.h}>
15061 extern void _nc_init_pthreads(void);
15062
15063 int
15064 main ()
15065 {
15066
15067         initscr();
15068         _nc_init_pthreads();
15069
15070   ;
15071   return 0;
15072 }
15073 _ACEOF
15074 rm -f conftest.$ac_objext conftest$ac_exeext
15075 if { (eval echo "$as_me:15075: \"$ac_link\"") >&5
15076   (eval $ac_link) 2>&5
15077   ac_status=$?
15078   echo "$as_me:15078: \$? = $ac_status" >&5
15079   (exit $ac_status); } &&
15080          { ac_try='test -s conftest$ac_exeext'
15081   { (eval echo "$as_me:15081: \"$ac_try\"") >&5
15082   (eval $ac_try) 2>&5
15083   ac_status=$?
15084   echo "$as_me:15084: \$? = $ac_status" >&5
15085   (exit $ac_status); }; }; then
15086   cf_cv_use_pthreads=yes
15087 else
15088   echo "$as_me: failed program was:" >&5
15089 cat conftest.$ac_ext >&5
15090 cf_cv_use_pthreads=no
15091 fi
15092 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15093
15094 fi
15095 echo "$as_me:15095: result: $cf_cv_use_pthreads" >&5
15096 echo "${ECHO_T}$cf_cv_use_pthreads" >&6
15097 test $cf_cv_use_pthreads = yes && cat >>confdefs.h <<\EOF
15098 #define USE_PTHREADS 1
15099 EOF
15100
15101 echo "$as_me:15101: checking if sys/time.h works with sys/select.h" >&5
15102 echo $ECHO_N "checking if sys/time.h works with sys/select.h... $ECHO_C" >&6
15103 if test "${cf_cv_sys_time_select+set}" = set; then
15104   echo $ECHO_N "(cached) $ECHO_C" >&6
15105 else
15106
15107 cat >conftest.$ac_ext <<_ACEOF
15108 #line 15108 "configure"
15109 #include "confdefs.h"
15110
15111 #include <sys/types.h>
15112 #ifdef HAVE_SYS_TIME_H
15113 #include <sys/time.h>
15114 #endif
15115 #ifdef HAVE_SYS_SELECT_H
15116 #include <sys/select.h>
15117 #endif
15118
15119 int
15120 main ()
15121 {
15122
15123   ;
15124   return 0;
15125 }
15126 _ACEOF
15127 rm -f conftest.$ac_objext
15128 if { (eval echo "$as_me:15128: \"$ac_compile\"") >&5
15129   (eval $ac_compile) 2>&5
15130   ac_status=$?
15131   echo "$as_me:15131: \$? = $ac_status" >&5
15132   (exit $ac_status); } &&
15133          { ac_try='test -s conftest.$ac_objext'
15134   { (eval echo "$as_me:15134: \"$ac_try\"") >&5
15135   (eval $ac_try) 2>&5
15136   ac_status=$?
15137   echo "$as_me:15137: \$? = $ac_status" >&5
15138   (exit $ac_status); }; }; then
15139   cf_cv_sys_time_select=yes
15140 else
15141   echo "$as_me: failed program was:" >&5
15142 cat conftest.$ac_ext >&5
15143 cf_cv_sys_time_select=no
15144 fi
15145 rm -f conftest.$ac_objext conftest.$ac_ext
15146
15147 fi
15148
15149 echo "$as_me:15149: result: $cf_cv_sys_time_select" >&5
15150 echo "${ECHO_T}$cf_cv_sys_time_select" >&6
15151 test "$cf_cv_sys_time_select" = yes &&
15152 cat >>confdefs.h <<\EOF
15153 #define HAVE_SYS_TIME_SELECT 1
15154 EOF
15155
15156 # special check for test/ditto.c
15157
15158 echo "$as_me:15158: checking for openpty in -lutil" >&5
15159 echo $ECHO_N "checking for openpty in -lutil... $ECHO_C" >&6
15160 if test "${ac_cv_lib_util_openpty+set}" = set; then
15161   echo $ECHO_N "(cached) $ECHO_C" >&6
15162 else
15163   ac_check_lib_save_LIBS=$LIBS
15164 LIBS="-lutil  $LIBS"
15165 cat >conftest.$ac_ext <<_ACEOF
15166 #line 15166 "configure"
15167 #include "confdefs.h"
15168
15169 /* Override any gcc2 internal prototype to avoid an error.  */
15170 #ifdef __cplusplus
15171 extern "C"
15172 #endif
15173 /* We use char because int might match the return type of a gcc2
15174    builtin and then its argument prototype would still apply.  */
15175 char openpty ();
15176 int
15177 main ()
15178 {
15179 openpty ();
15180   ;
15181   return 0;
15182 }
15183 _ACEOF
15184 rm -f conftest.$ac_objext conftest$ac_exeext
15185 if { (eval echo "$as_me:15185: \"$ac_link\"") >&5
15186   (eval $ac_link) 2>&5
15187   ac_status=$?
15188   echo "$as_me:15188: \$? = $ac_status" >&5
15189   (exit $ac_status); } &&
15190          { ac_try='test -s conftest$ac_exeext'
15191   { (eval echo "$as_me:15191: \"$ac_try\"") >&5
15192   (eval $ac_try) 2>&5
15193   ac_status=$?
15194   echo "$as_me:15194: \$? = $ac_status" >&5
15195   (exit $ac_status); }; }; then
15196   ac_cv_lib_util_openpty=yes
15197 else
15198   echo "$as_me: failed program was:" >&5
15199 cat conftest.$ac_ext >&5
15200 ac_cv_lib_util_openpty=no
15201 fi
15202 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15203 LIBS=$ac_check_lib_save_LIBS
15204 fi
15205 echo "$as_me:15205: result: $ac_cv_lib_util_openpty" >&5
15206 echo "${ECHO_T}$ac_cv_lib_util_openpty" >&6
15207 if test $ac_cv_lib_util_openpty = yes; then
15208   cf_cv_lib_util=yes
15209 else
15210   cf_cv_lib_util=no
15211 fi
15212
15213 echo "$as_me:15213: checking for openpty header" >&5
15214 echo $ECHO_N "checking for openpty header... $ECHO_C" >&6
15215 if test "${cf_cv_func_openpty+set}" = set; then
15216   echo $ECHO_N "(cached) $ECHO_C" >&6
15217 else
15218
15219         cf_save_LIBS="$LIBS"
15220         test $cf_cv_lib_util = yes && {
15221 cf_add_libs="-lutil"
15222 # Filter out duplicates - this happens with badly-designed ".pc" files...
15223 for cf_add_1lib in $LIBS
15224 do
15225         for cf_add_2lib in $cf_add_libs
15226         do
15227                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
15228                 then
15229                         cf_add_1lib=
15230                         break
15231                 fi
15232         done
15233         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
15234 done
15235 LIBS="$cf_add_libs"
15236  }
15237         for cf_header in pty.h libutil.h util.h
15238         do
15239         cat >conftest.$ac_ext <<_ACEOF
15240 #line 15240 "configure"
15241 #include "confdefs.h"
15242
15243 #include <$cf_header>
15244
15245 int
15246 main ()
15247 {
15248
15249         int x = openpty((int *)0, (int *)0, (char *)0,
15250                                    (struct termios *)0, (struct winsize *)0);
15251
15252   ;
15253   return 0;
15254 }
15255 _ACEOF
15256 rm -f conftest.$ac_objext conftest$ac_exeext
15257 if { (eval echo "$as_me:15257: \"$ac_link\"") >&5
15258   (eval $ac_link) 2>&5
15259   ac_status=$?
15260   echo "$as_me:15260: \$? = $ac_status" >&5
15261   (exit $ac_status); } &&
15262          { ac_try='test -s conftest$ac_exeext'
15263   { (eval echo "$as_me:15263: \"$ac_try\"") >&5
15264   (eval $ac_try) 2>&5
15265   ac_status=$?
15266   echo "$as_me:15266: \$? = $ac_status" >&5
15267   (exit $ac_status); }; }; then
15268
15269                 cf_cv_func_openpty=$cf_header
15270                 break
15271
15272 else
15273   echo "$as_me: failed program was:" >&5
15274 cat conftest.$ac_ext >&5
15275
15276                 cf_cv_func_openpty=no
15277
15278 fi
15279 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15280         done
15281         LIBS="$cf_save_LIBS"
15282
15283 fi
15284 echo "$as_me:15284: result: $cf_cv_func_openpty" >&5
15285 echo "${ECHO_T}$cf_cv_func_openpty" >&6
15286
15287 if test "$cf_cv_func_openpty" != no ; then
15288
15289 cat >>confdefs.h <<EOF
15290 #define USE_OPENPTY_HEADER <$cf_cv_func_openpty>
15291 EOF
15292
15293 cat >>confdefs.h <<\EOF
15294 #define USE_XTERM_PTY 1
15295 EOF
15296
15297         if test "x$cf_cv_lib_util" = xyes ; then
15298
15299 cf_add_libs="-lutil"
15300 # Filter out duplicates - this happens with badly-designed ".pc" files...
15301 for cf_add_1lib in $TEST_LIBS
15302 do
15303         for cf_add_2lib in $cf_add_libs
15304         do
15305                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
15306                 then
15307                         cf_add_1lib=
15308                         break
15309                 fi
15310         done
15311         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
15312 done
15313 TEST_LIBS="$cf_add_libs"
15314
15315         fi
15316 fi
15317
15318 echo "$as_me:15318: checking for function curses_version" >&5
15319 echo $ECHO_N "checking for function curses_version... $ECHO_C" >&6
15320 if test "${cf_cv_func_curses_version+set}" = set; then
15321   echo $ECHO_N "(cached) $ECHO_C" >&6
15322 else
15323
15324 if test "$cross_compiling" = yes; then
15325   cf_cv_func_curses_version=unknown
15326 else
15327   cat >conftest.$ac_ext <<_ACEOF
15328 #line 15328 "configure"
15329 #include "confdefs.h"
15330
15331 #include <${cf_cv_ncurses_header:-curses.h}>
15332 int main()
15333 {
15334         char temp[1024];
15335         sprintf(temp, "%s\n", curses_version());
15336         ${cf_cv_main_return:-return}(0);
15337 }
15338
15339 _ACEOF
15340 rm -f conftest$ac_exeext
15341 if { (eval echo "$as_me:15341: \"$ac_link\"") >&5
15342   (eval $ac_link) 2>&5
15343   ac_status=$?
15344   echo "$as_me:15344: \$? = $ac_status" >&5
15345   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
15346   { (eval echo "$as_me:15346: \"$ac_try\"") >&5
15347   (eval $ac_try) 2>&5
15348   ac_status=$?
15349   echo "$as_me:15349: \$? = $ac_status" >&5
15350   (exit $ac_status); }; }; then
15351   cf_cv_func_curses_version=yes
15352
15353 else
15354   echo "$as_me: program exited with status $ac_status" >&5
15355 echo "$as_me: failed program was:" >&5
15356 cat conftest.$ac_ext >&5
15357 cf_cv_func_curses_version=no
15358
15359 fi
15360 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
15361 fi
15362 rm -f core
15363 fi
15364 echo "$as_me:15364: result: $cf_cv_func_curses_version" >&5
15365 echo "${ECHO_T}$cf_cv_func_curses_version" >&6
15366 test "$cf_cv_func_curses_version" = yes &&
15367 cat >>confdefs.h <<\EOF
15368 #define HAVE_CURSES_VERSION 1
15369 EOF
15370
15371 echo "$as_me:15371: checking for alternate character set array" >&5
15372 echo $ECHO_N "checking for alternate character set array... $ECHO_C" >&6
15373 if test "${cf_cv_curses_acs_map+set}" = set; then
15374   echo $ECHO_N "(cached) $ECHO_C" >&6
15375 else
15376
15377 cf_cv_curses_acs_map=unknown
15378 for name in acs_map _acs_map __acs_map ${NCURSES_WRAP_PREFIX}acs_map
15379 do
15380 cat >conftest.$ac_ext <<_ACEOF
15381 #line 15381 "configure"
15382 #include "confdefs.h"
15383
15384 #include <${cf_cv_ncurses_header:-curses.h}>
15385
15386 int
15387 main ()
15388 {
15389
15390 $name['k'] = ACS_PLUS
15391
15392   ;
15393   return 0;
15394 }
15395 _ACEOF
15396 rm -f conftest.$ac_objext conftest$ac_exeext
15397 if { (eval echo "$as_me:15397: \"$ac_link\"") >&5
15398   (eval $ac_link) 2>&5
15399   ac_status=$?
15400   echo "$as_me:15400: \$? = $ac_status" >&5
15401   (exit $ac_status); } &&
15402          { ac_try='test -s conftest$ac_exeext'
15403   { (eval echo "$as_me:15403: \"$ac_try\"") >&5
15404   (eval $ac_try) 2>&5
15405   ac_status=$?
15406   echo "$as_me:15406: \$? = $ac_status" >&5
15407   (exit $ac_status); }; }; then
15408   cf_cv_curses_acs_map=$name; break
15409 else
15410   echo "$as_me: failed program was:" >&5
15411 cat conftest.$ac_ext >&5
15412 fi
15413 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15414 done
15415
15416 fi
15417 echo "$as_me:15417: result: $cf_cv_curses_acs_map" >&5
15418 echo "${ECHO_T}$cf_cv_curses_acs_map" >&6
15419
15420 test "$cf_cv_curses_acs_map" != unknown &&
15421 cat >>confdefs.h <<EOF
15422 #define CURSES_ACS_ARRAY $cf_cv_curses_acs_map
15423 EOF
15424
15425 if test "$cf_enable_widec" = yes; then
15426
15427 echo "$as_me:15427: checking for wide alternate character set array" >&5
15428 echo $ECHO_N "checking for wide alternate character set array... $ECHO_C" >&6
15429 if test "${cf_cv_curses_wacs_map+set}" = set; then
15430   echo $ECHO_N "(cached) $ECHO_C" >&6
15431 else
15432
15433         cf_cv_curses_wacs_map=unknown
15434         for name in wacs_map _wacs_map __wacs_map _nc_wacs _wacs_char
15435         do
15436         cat >conftest.$ac_ext <<_ACEOF
15437 #line 15437 "configure"
15438 #include "confdefs.h"
15439
15440 #ifndef _XOPEN_SOURCE_EXTENDED
15441 #define _XOPEN_SOURCE_EXTENDED
15442 #endif
15443 #include <${cf_cv_ncurses_header:-curses.h}>
15444 int
15445 main ()
15446 {
15447 void *foo = &($name['k'])
15448   ;
15449   return 0;
15450 }
15451 _ACEOF
15452 rm -f conftest.$ac_objext conftest$ac_exeext
15453 if { (eval echo "$as_me:15453: \"$ac_link\"") >&5
15454   (eval $ac_link) 2>&5
15455   ac_status=$?
15456   echo "$as_me:15456: \$? = $ac_status" >&5
15457   (exit $ac_status); } &&
15458          { ac_try='test -s conftest$ac_exeext'
15459   { (eval echo "$as_me:15459: \"$ac_try\"") >&5
15460   (eval $ac_try) 2>&5
15461   ac_status=$?
15462   echo "$as_me:15462: \$? = $ac_status" >&5
15463   (exit $ac_status); }; }; then
15464   cf_cv_curses_wacs_map=$name
15465          break
15466 else
15467   echo "$as_me: failed program was:" >&5
15468 cat conftest.$ac_ext >&5
15469 fi
15470 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15471         done
15472 fi
15473 echo "$as_me:15473: result: $cf_cv_curses_wacs_map" >&5
15474 echo "${ECHO_T}$cf_cv_curses_wacs_map" >&6
15475
15476 test "$cf_cv_curses_wacs_map" != unknown &&
15477 cat >>confdefs.h <<EOF
15478 #define CURSES_WACS_ARRAY $cf_cv_curses_wacs_map
15479 EOF
15480
15481 echo "$as_me:15481: checking for wide alternate character constants" >&5
15482 echo $ECHO_N "checking for wide alternate character constants... $ECHO_C" >&6
15483 if test "${cf_cv_curses_wacs_symbols+set}" = set; then
15484   echo $ECHO_N "(cached) $ECHO_C" >&6
15485 else
15486
15487 cf_cv_curses_wacs_symbols=no
15488 if test "$cf_cv_curses_wacs_map" != unknown
15489 then
15490         cat >conftest.$ac_ext <<_ACEOF
15491 #line 15491 "configure"
15492 #include "confdefs.h"
15493
15494 #ifndef _XOPEN_SOURCE_EXTENDED
15495 #define _XOPEN_SOURCE_EXTENDED
15496 #endif
15497 #include <${cf_cv_ncurses_header:-curses.h}>
15498 int
15499 main ()
15500 {
15501 cchar_t *foo = WACS_PLUS;
15502          $cf_cv_curses_wacs_map['k'] = *WACS_PLUS
15503   ;
15504   return 0;
15505 }
15506 _ACEOF
15507 rm -f conftest.$ac_objext conftest$ac_exeext
15508 if { (eval echo "$as_me:15508: \"$ac_link\"") >&5
15509   (eval $ac_link) 2>&5
15510   ac_status=$?
15511   echo "$as_me:15511: \$? = $ac_status" >&5
15512   (exit $ac_status); } &&
15513          { ac_try='test -s conftest$ac_exeext'
15514   { (eval echo "$as_me:15514: \"$ac_try\"") >&5
15515   (eval $ac_try) 2>&5
15516   ac_status=$?
15517   echo "$as_me:15517: \$? = $ac_status" >&5
15518   (exit $ac_status); }; }; then
15519   cf_cv_curses_wacs_symbols=yes
15520 else
15521   echo "$as_me: failed program was:" >&5
15522 cat conftest.$ac_ext >&5
15523 fi
15524 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15525 else
15526         cat >conftest.$ac_ext <<_ACEOF
15527 #line 15527 "configure"
15528 #include "confdefs.h"
15529
15530 #ifndef _XOPEN_SOURCE_EXTENDED
15531 #define _XOPEN_SOURCE_EXTENDED
15532 #endif
15533 #include <${cf_cv_ncurses_header:-curses.h}>
15534 int
15535 main ()
15536 {
15537 cchar_t *foo = WACS_PLUS
15538   ;
15539   return 0;
15540 }
15541 _ACEOF
15542 rm -f conftest.$ac_objext conftest$ac_exeext
15543 if { (eval echo "$as_me:15543: \"$ac_link\"") >&5
15544   (eval $ac_link) 2>&5
15545   ac_status=$?
15546   echo "$as_me:15546: \$? = $ac_status" >&5
15547   (exit $ac_status); } &&
15548          { ac_try='test -s conftest$ac_exeext'
15549   { (eval echo "$as_me:15549: \"$ac_try\"") >&5
15550   (eval $ac_try) 2>&5
15551   ac_status=$?
15552   echo "$as_me:15552: \$? = $ac_status" >&5
15553   (exit $ac_status); }; }; then
15554   cf_cv_curses_wacs_symbols=yes
15555 else
15556   echo "$as_me: failed program was:" >&5
15557 cat conftest.$ac_ext >&5
15558 fi
15559 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15560 fi
15561
15562 fi
15563 echo "$as_me:15563: result: $cf_cv_curses_wacs_symbols" >&5
15564 echo "${ECHO_T}$cf_cv_curses_wacs_symbols" >&6
15565
15566 test "$cf_cv_curses_wacs_symbols" != no &&
15567 cat >>confdefs.h <<\EOF
15568 #define CURSES_WACS_SYMBOLS 1
15569 EOF
15570
15571 fi
15572
15573 echo "$as_me:15573: checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}" >&5
15574 echo $ECHO_N "checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
15575 cat >conftest.$ac_ext <<_ACEOF
15576 #line 15576 "configure"
15577 #include "confdefs.h"
15578
15579 #ifndef _XOPEN_SOURCE_EXTENDED
15580 #define _XOPEN_SOURCE_EXTENDED
15581 #endif
15582 #include <${cf_cv_ncurses_header:-curses.h}>
15583 int
15584 main ()
15585 {
15586
15587 attr_t foo
15588
15589   ;
15590   return 0;
15591 }
15592 _ACEOF
15593 rm -f conftest.$ac_objext
15594 if { (eval echo "$as_me:15594: \"$ac_compile\"") >&5
15595   (eval $ac_compile) 2>&5
15596   ac_status=$?
15597   echo "$as_me:15597: \$? = $ac_status" >&5
15598   (exit $ac_status); } &&
15599          { ac_try='test -s conftest.$ac_objext'
15600   { (eval echo "$as_me:15600: \"$ac_try\"") >&5
15601   (eval $ac_try) 2>&5
15602   ac_status=$?
15603   echo "$as_me:15603: \$? = $ac_status" >&5
15604   (exit $ac_status); }; }; then
15605   cf_result=yes
15606 else
15607   echo "$as_me: failed program was:" >&5
15608 cat conftest.$ac_ext >&5
15609 cf_result=no
15610 fi
15611 rm -f conftest.$ac_objext conftest.$ac_ext
15612 echo "$as_me:15612: result: $cf_result" >&5
15613 echo "${ECHO_T}$cf_result" >&6
15614 if test $cf_result = yes ; then
15615
15616 cf_result=`echo "have_type_attr_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15617
15618 cat >>confdefs.h <<EOF
15619 #define $cf_result 1
15620 EOF
15621
15622 else
15623
15624 cat >>confdefs.h <<EOF
15625 #define attr_t long
15626 EOF
15627
15628 fi
15629
15630 if test "$cf_enable_widec" = yes; then
15631
15632 # This is needed on Tru64 5.0 to declare mbstate_t
15633 echo "$as_me:15633: checking if we must include wchar.h to declare mbstate_t" >&5
15634 echo $ECHO_N "checking if we must include wchar.h to declare mbstate_t... $ECHO_C" >&6
15635 if test "${cf_cv_mbstate_t+set}" = set; then
15636   echo $ECHO_N "(cached) $ECHO_C" >&6
15637 else
15638
15639 cat >conftest.$ac_ext <<_ACEOF
15640 #line 15640 "configure"
15641 #include "confdefs.h"
15642
15643 #include <stdlib.h>
15644 #include <stdarg.h>
15645 #include <stdio.h>
15646 #ifdef HAVE_LIBUTF8_H
15647 #include <libutf8.h>
15648 #endif
15649 int
15650 main ()
15651 {
15652 mbstate_t state
15653   ;
15654   return 0;
15655 }
15656 _ACEOF
15657 rm -f conftest.$ac_objext
15658 if { (eval echo "$as_me:15658: \"$ac_compile\"") >&5
15659   (eval $ac_compile) 2>&5
15660   ac_status=$?
15661   echo "$as_me:15661: \$? = $ac_status" >&5
15662   (exit $ac_status); } &&
15663          { ac_try='test -s conftest.$ac_objext'
15664   { (eval echo "$as_me:15664: \"$ac_try\"") >&5
15665   (eval $ac_try) 2>&5
15666   ac_status=$?
15667   echo "$as_me:15667: \$? = $ac_status" >&5
15668   (exit $ac_status); }; }; then
15669   cf_cv_mbstate_t=no
15670 else
15671   echo "$as_me: failed program was:" >&5
15672 cat conftest.$ac_ext >&5
15673 cat >conftest.$ac_ext <<_ACEOF
15674 #line 15674 "configure"
15675 #include "confdefs.h"
15676
15677 #include <stdlib.h>
15678 #include <stdarg.h>
15679 #include <stdio.h>
15680 #include <wchar.h>
15681 #ifdef HAVE_LIBUTF8_H
15682 #include <libutf8.h>
15683 #endif
15684 int
15685 main ()
15686 {
15687 mbstate_t value
15688   ;
15689   return 0;
15690 }
15691 _ACEOF
15692 rm -f conftest.$ac_objext
15693 if { (eval echo "$as_me:15693: \"$ac_compile\"") >&5
15694   (eval $ac_compile) 2>&5
15695   ac_status=$?
15696   echo "$as_me:15696: \$? = $ac_status" >&5
15697   (exit $ac_status); } &&
15698          { ac_try='test -s conftest.$ac_objext'
15699   { (eval echo "$as_me:15699: \"$ac_try\"") >&5
15700   (eval $ac_try) 2>&5
15701   ac_status=$?
15702   echo "$as_me:15702: \$? = $ac_status" >&5
15703   (exit $ac_status); }; }; then
15704   cf_cv_mbstate_t=yes
15705 else
15706   echo "$as_me: failed program was:" >&5
15707 cat conftest.$ac_ext >&5
15708 cf_cv_mbstate_t=unknown
15709 fi
15710 rm -f conftest.$ac_objext conftest.$ac_ext
15711 fi
15712 rm -f conftest.$ac_objext conftest.$ac_ext
15713 fi
15714 echo "$as_me:15714: result: $cf_cv_mbstate_t" >&5
15715 echo "${ECHO_T}$cf_cv_mbstate_t" >&6
15716
15717 if test "$cf_cv_mbstate_t" = yes ; then
15718
15719 cat >>confdefs.h <<\EOF
15720 #define NEED_WCHAR_H 1
15721 EOF
15722
15723         NEED_WCHAR_H=1
15724 fi
15725
15726 # if we do not find mbstate_t in either place, use substitution to provide a fallback.
15727 if test "$cf_cv_mbstate_t" = unknown ; then
15728         NCURSES_MBSTATE_T=1
15729 fi
15730
15731 # if we find mbstate_t in either place, use substitution to provide a fallback.
15732 if test "$cf_cv_mbstate_t" != unknown ; then
15733         NCURSES_OK_MBSTATE_T=1
15734 fi
15735
15736 # This is needed on Tru64 5.0 to declare wchar_t
15737 echo "$as_me:15737: checking if we must include wchar.h to declare wchar_t" >&5
15738 echo $ECHO_N "checking if we must include wchar.h to declare wchar_t... $ECHO_C" >&6
15739 if test "${cf_cv_wchar_t+set}" = set; then
15740   echo $ECHO_N "(cached) $ECHO_C" >&6
15741 else
15742
15743 cat >conftest.$ac_ext <<_ACEOF
15744 #line 15744 "configure"
15745 #include "confdefs.h"
15746
15747 #include <stdlib.h>
15748 #include <stdarg.h>
15749 #include <stdio.h>
15750 #ifdef HAVE_LIBUTF8_H
15751 #include <libutf8.h>
15752 #endif
15753 int
15754 main ()
15755 {
15756 wchar_t state
15757   ;
15758   return 0;
15759 }
15760 _ACEOF
15761 rm -f conftest.$ac_objext
15762 if { (eval echo "$as_me:15762: \"$ac_compile\"") >&5
15763   (eval $ac_compile) 2>&5
15764   ac_status=$?
15765   echo "$as_me:15765: \$? = $ac_status" >&5
15766   (exit $ac_status); } &&
15767          { ac_try='test -s conftest.$ac_objext'
15768   { (eval echo "$as_me:15768: \"$ac_try\"") >&5
15769   (eval $ac_try) 2>&5
15770   ac_status=$?
15771   echo "$as_me:15771: \$? = $ac_status" >&5
15772   (exit $ac_status); }; }; then
15773   cf_cv_wchar_t=no
15774 else
15775   echo "$as_me: failed program was:" >&5
15776 cat conftest.$ac_ext >&5
15777 cat >conftest.$ac_ext <<_ACEOF
15778 #line 15778 "configure"
15779 #include "confdefs.h"
15780
15781 #include <stdlib.h>
15782 #include <stdarg.h>
15783 #include <stdio.h>
15784 #include <wchar.h>
15785 #ifdef HAVE_LIBUTF8_H
15786 #include <libutf8.h>
15787 #endif
15788 int
15789 main ()
15790 {
15791 wchar_t value
15792   ;
15793   return 0;
15794 }
15795 _ACEOF
15796 rm -f conftest.$ac_objext
15797 if { (eval echo "$as_me:15797: \"$ac_compile\"") >&5
15798   (eval $ac_compile) 2>&5
15799   ac_status=$?
15800   echo "$as_me:15800: \$? = $ac_status" >&5
15801   (exit $ac_status); } &&
15802          { ac_try='test -s conftest.$ac_objext'
15803   { (eval echo "$as_me:15803: \"$ac_try\"") >&5
15804   (eval $ac_try) 2>&5
15805   ac_status=$?
15806   echo "$as_me:15806: \$? = $ac_status" >&5
15807   (exit $ac_status); }; }; then
15808   cf_cv_wchar_t=yes
15809 else
15810   echo "$as_me: failed program was:" >&5
15811 cat conftest.$ac_ext >&5
15812 cf_cv_wchar_t=unknown
15813 fi
15814 rm -f conftest.$ac_objext conftest.$ac_ext
15815 fi
15816 rm -f conftest.$ac_objext conftest.$ac_ext
15817 fi
15818 echo "$as_me:15818: result: $cf_cv_wchar_t" >&5
15819 echo "${ECHO_T}$cf_cv_wchar_t" >&6
15820
15821 if test "$cf_cv_wchar_t" = yes ; then
15822
15823 cat >>confdefs.h <<\EOF
15824 #define NEED_WCHAR_H 1
15825 EOF
15826
15827         NEED_WCHAR_H=1
15828 fi
15829
15830 # if we do not find wchar_t in either place, use substitution to provide a fallback.
15831 if test "$cf_cv_wchar_t" = unknown ; then
15832         NCURSES_WCHAR_T=1
15833 fi
15834
15835 # if we find wchar_t in either place, use substitution to provide a fallback.
15836 if test "$cf_cv_wchar_t" != unknown ; then
15837         NCURSES_OK_WCHAR_T=1
15838 fi
15839
15840 # This is needed on Tru64 5.0 to declare wint_t
15841 echo "$as_me:15841: checking if we must include wchar.h to declare wint_t" >&5
15842 echo $ECHO_N "checking if we must include wchar.h to declare wint_t... $ECHO_C" >&6
15843 if test "${cf_cv_wint_t+set}" = set; then
15844   echo $ECHO_N "(cached) $ECHO_C" >&6
15845 else
15846
15847 cat >conftest.$ac_ext <<_ACEOF
15848 #line 15848 "configure"
15849 #include "confdefs.h"
15850
15851 #include <stdlib.h>
15852 #include <stdarg.h>
15853 #include <stdio.h>
15854 #ifdef HAVE_LIBUTF8_H
15855 #include <libutf8.h>
15856 #endif
15857 int
15858 main ()
15859 {
15860 wint_t state
15861   ;
15862   return 0;
15863 }
15864 _ACEOF
15865 rm -f conftest.$ac_objext
15866 if { (eval echo "$as_me:15866: \"$ac_compile\"") >&5
15867   (eval $ac_compile) 2>&5
15868   ac_status=$?
15869   echo "$as_me:15869: \$? = $ac_status" >&5
15870   (exit $ac_status); } &&
15871          { ac_try='test -s conftest.$ac_objext'
15872   { (eval echo "$as_me:15872: \"$ac_try\"") >&5
15873   (eval $ac_try) 2>&5
15874   ac_status=$?
15875   echo "$as_me:15875: \$? = $ac_status" >&5
15876   (exit $ac_status); }; }; then
15877   cf_cv_wint_t=no
15878 else
15879   echo "$as_me: failed program was:" >&5
15880 cat conftest.$ac_ext >&5
15881 cat >conftest.$ac_ext <<_ACEOF
15882 #line 15882 "configure"
15883 #include "confdefs.h"
15884
15885 #include <stdlib.h>
15886 #include <stdarg.h>
15887 #include <stdio.h>
15888 #include <wchar.h>
15889 #ifdef HAVE_LIBUTF8_H
15890 #include <libutf8.h>
15891 #endif
15892 int
15893 main ()
15894 {
15895 wint_t value
15896   ;
15897   return 0;
15898 }
15899 _ACEOF
15900 rm -f conftest.$ac_objext
15901 if { (eval echo "$as_me:15901: \"$ac_compile\"") >&5
15902   (eval $ac_compile) 2>&5
15903   ac_status=$?
15904   echo "$as_me:15904: \$? = $ac_status" >&5
15905   (exit $ac_status); } &&
15906          { ac_try='test -s conftest.$ac_objext'
15907   { (eval echo "$as_me:15907: \"$ac_try\"") >&5
15908   (eval $ac_try) 2>&5
15909   ac_status=$?
15910   echo "$as_me:15910: \$? = $ac_status" >&5
15911   (exit $ac_status); }; }; then
15912   cf_cv_wint_t=yes
15913 else
15914   echo "$as_me: failed program was:" >&5
15915 cat conftest.$ac_ext >&5
15916 cf_cv_wint_t=unknown
15917 fi
15918 rm -f conftest.$ac_objext conftest.$ac_ext
15919 fi
15920 rm -f conftest.$ac_objext conftest.$ac_ext
15921 fi
15922 echo "$as_me:15922: result: $cf_cv_wint_t" >&5
15923 echo "${ECHO_T}$cf_cv_wint_t" >&6
15924
15925 if test "$cf_cv_wint_t" = yes ; then
15926
15927 cat >>confdefs.h <<\EOF
15928 #define NEED_WCHAR_H 1
15929 EOF
15930
15931         NEED_WCHAR_H=1
15932 fi
15933
15934 # if we do not find wint_t in either place, use substitution to provide a fallback.
15935 if test "$cf_cv_wint_t" = unknown ; then
15936         NCURSES_WINT_T=1
15937 fi
15938
15939 # if we find wint_t in either place, use substitution to provide a fallback.
15940 if test "$cf_cv_wint_t" != unknown ; then
15941         NCURSES_OK_WINT_T=1
15942 fi
15943
15944         if test "$NCURSES_OK_MBSTATE_T" = 0 ; then
15945
15946 echo "$as_me:15946: checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}" >&5
15947 echo $ECHO_N "checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
15948 cat >conftest.$ac_ext <<_ACEOF
15949 #line 15949 "configure"
15950 #include "confdefs.h"
15951
15952 #ifndef _XOPEN_SOURCE_EXTENDED
15953 #define _XOPEN_SOURCE_EXTENDED
15954 #endif
15955 #include <${cf_cv_ncurses_header:-curses.h}>
15956 int
15957 main ()
15958 {
15959
15960 mbstate_t foo
15961
15962   ;
15963   return 0;
15964 }
15965 _ACEOF
15966 rm -f conftest.$ac_objext
15967 if { (eval echo "$as_me:15967: \"$ac_compile\"") >&5
15968   (eval $ac_compile) 2>&5
15969   ac_status=$?
15970   echo "$as_me:15970: \$? = $ac_status" >&5
15971   (exit $ac_status); } &&
15972          { ac_try='test -s conftest.$ac_objext'
15973   { (eval echo "$as_me:15973: \"$ac_try\"") >&5
15974   (eval $ac_try) 2>&5
15975   ac_status=$?
15976   echo "$as_me:15976: \$? = $ac_status" >&5
15977   (exit $ac_status); }; }; then
15978   cf_result=yes
15979 else
15980   echo "$as_me: failed program was:" >&5
15981 cat conftest.$ac_ext >&5
15982 cf_result=no
15983 fi
15984 rm -f conftest.$ac_objext conftest.$ac_ext
15985 echo "$as_me:15985: result: $cf_result" >&5
15986 echo "${ECHO_T}$cf_result" >&6
15987 if test $cf_result = yes ; then
15988
15989 cf_result=`echo "have_type_mbstate_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15990
15991 cat >>confdefs.h <<EOF
15992 #define $cf_result 1
15993 EOF
15994
15995 else
15996
15997 cat >>confdefs.h <<EOF
15998 #define mbstate_t long
15999 EOF
16000
16001 fi
16002
16003         fi
16004
16005         if test "$NCURSES_OK_WCHAR_T" = 0 ; then
16006
16007 echo "$as_me:16007: checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}" >&5
16008 echo $ECHO_N "checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
16009 cat >conftest.$ac_ext <<_ACEOF
16010 #line 16010 "configure"
16011 #include "confdefs.h"
16012
16013 #ifndef _XOPEN_SOURCE_EXTENDED
16014 #define _XOPEN_SOURCE_EXTENDED
16015 #endif
16016 #include <${cf_cv_ncurses_header:-curses.h}>
16017 int
16018 main ()
16019 {
16020
16021 wchar_t foo
16022
16023   ;
16024   return 0;
16025 }
16026 _ACEOF
16027 rm -f conftest.$ac_objext
16028 if { (eval echo "$as_me:16028: \"$ac_compile\"") >&5
16029   (eval $ac_compile) 2>&5
16030   ac_status=$?
16031   echo "$as_me:16031: \$? = $ac_status" >&5
16032   (exit $ac_status); } &&
16033          { ac_try='test -s conftest.$ac_objext'
16034   { (eval echo "$as_me:16034: \"$ac_try\"") >&5
16035   (eval $ac_try) 2>&5
16036   ac_status=$?
16037   echo "$as_me:16037: \$? = $ac_status" >&5
16038   (exit $ac_status); }; }; then
16039   cf_result=yes
16040 else
16041   echo "$as_me: failed program was:" >&5
16042 cat conftest.$ac_ext >&5
16043 cf_result=no
16044 fi
16045 rm -f conftest.$ac_objext conftest.$ac_ext
16046 echo "$as_me:16046: result: $cf_result" >&5
16047 echo "${ECHO_T}$cf_result" >&6
16048 if test $cf_result = yes ; then
16049
16050 cf_result=`echo "have_type_wchar_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16051
16052 cat >>confdefs.h <<EOF
16053 #define $cf_result 1
16054 EOF
16055
16056 else
16057
16058 cat >>confdefs.h <<EOF
16059 #define wchar_t long
16060 EOF
16061
16062 fi
16063
16064         fi
16065
16066         if test "$NCURSES_OK_WINT_T" = 0 ; then
16067
16068 echo "$as_me:16068: checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}" >&5
16069 echo $ECHO_N "checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
16070 cat >conftest.$ac_ext <<_ACEOF
16071 #line 16071 "configure"
16072 #include "confdefs.h"
16073
16074 #ifndef _XOPEN_SOURCE_EXTENDED
16075 #define _XOPEN_SOURCE_EXTENDED
16076 #endif
16077 #include <${cf_cv_ncurses_header:-curses.h}>
16078 int
16079 main ()
16080 {
16081
16082 wint_t foo
16083
16084   ;
16085   return 0;
16086 }
16087 _ACEOF
16088 rm -f conftest.$ac_objext
16089 if { (eval echo "$as_me:16089: \"$ac_compile\"") >&5
16090   (eval $ac_compile) 2>&5
16091   ac_status=$?
16092   echo "$as_me:16092: \$? = $ac_status" >&5
16093   (exit $ac_status); } &&
16094          { ac_try='test -s conftest.$ac_objext'
16095   { (eval echo "$as_me:16095: \"$ac_try\"") >&5
16096   (eval $ac_try) 2>&5
16097   ac_status=$?
16098   echo "$as_me:16098: \$? = $ac_status" >&5
16099   (exit $ac_status); }; }; then
16100   cf_result=yes
16101 else
16102   echo "$as_me: failed program was:" >&5
16103 cat conftest.$ac_ext >&5
16104 cf_result=no
16105 fi
16106 rm -f conftest.$ac_objext conftest.$ac_ext
16107 echo "$as_me:16107: result: $cf_result" >&5
16108 echo "${ECHO_T}$cf_result" >&6
16109 if test $cf_result = yes ; then
16110
16111 cf_result=`echo "have_type_wint_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16112
16113 cat >>confdefs.h <<EOF
16114 #define $cf_result 1
16115 EOF
16116
16117 else
16118
16119 cat >>confdefs.h <<EOF
16120 #define wint_t long
16121 EOF
16122
16123 fi
16124
16125         fi
16126 fi
16127
16128 echo "$as_me:16128: checking for data ospeed declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
16129 echo $ECHO_N "checking for data ospeed declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
16130
16131 cat >conftest.$ac_ext <<_ACEOF
16132 #line 16132 "configure"
16133 #include "confdefs.h"
16134
16135 #ifdef HAVE_XCURSES
16136 #include <xcurses.h>
16137 char * XCursesProgramName = "test";
16138 #else
16139 #include <${cf_cv_ncurses_header:-curses.h}>
16140 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16141 #include <ncursesw/term.h>
16142 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16143 #include <ncurses/term.h>
16144 #elif defined(HAVE_TERM_H)
16145 #include <term.h>
16146 #endif
16147 #endif
16148
16149 int
16150 main ()
16151 {
16152
16153 void *foo = &(ospeed)
16154
16155   ;
16156   return 0;
16157 }
16158 _ACEOF
16159 rm -f conftest.$ac_objext
16160 if { (eval echo "$as_me:16160: \"$ac_compile\"") >&5
16161   (eval $ac_compile) 2>&5
16162   ac_status=$?
16163   echo "$as_me:16163: \$? = $ac_status" >&5
16164   (exit $ac_status); } &&
16165          { ac_try='test -s conftest.$ac_objext'
16166   { (eval echo "$as_me:16166: \"$ac_try\"") >&5
16167   (eval $ac_try) 2>&5
16168   ac_status=$?
16169   echo "$as_me:16169: \$? = $ac_status" >&5
16170   (exit $ac_status); }; }; then
16171   cf_result=yes
16172 else
16173   echo "$as_me: failed program was:" >&5
16174 cat conftest.$ac_ext >&5
16175 cf_result=no
16176 fi
16177 rm -f conftest.$ac_objext conftest.$ac_ext
16178 echo "$as_me:16178: result: $cf_result" >&5
16179 echo "${ECHO_T}$cf_result" >&6
16180
16181 if test $cf_result = yes ; then
16182
16183 cf_result=`echo "have_curses_data_ospeed" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16184
16185         cat >>confdefs.h <<EOF
16186 #define $cf_result 1
16187 EOF
16188
16189 else
16190         echo "$as_me:16190: checking for data ospeed in library" >&5
16191 echo $ECHO_N "checking for data ospeed in library... $ECHO_C" >&6
16192         # BSD linkers insist on making weak linkage, but resolve at runtime.
16193         if test "$cross_compiling" = yes; then
16194
16195         # cross-compiling
16196         cat >conftest.$ac_ext <<_ACEOF
16197 #line 16197 "configure"
16198 #include "confdefs.h"
16199
16200 #ifdef HAVE_XCURSES
16201 #include <xcurses.h>
16202 char * XCursesProgramName = "test";
16203 #else
16204 #include <${cf_cv_ncurses_header:-curses.h}>
16205 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16206 #include <ncursesw/term.h>
16207 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16208 #include <ncurses/term.h>
16209 #elif defined(HAVE_TERM_H)
16210 #include <term.h>
16211 #endif
16212 #endif
16213
16214 extern char ospeed;
16215 int
16216 main ()
16217 {
16218
16219         do {
16220                 void *foo = &(ospeed);
16221                 fprintf(stderr, "testing linkage of ospeed:%p\n", foo);
16222                 ${cf_cv_main_return:-return}(foo == 0);
16223         } while (0)
16224
16225   ;
16226   return 0;
16227 }
16228 _ACEOF
16229 rm -f conftest.$ac_objext conftest$ac_exeext
16230 if { (eval echo "$as_me:16230: \"$ac_link\"") >&5
16231   (eval $ac_link) 2>&5
16232   ac_status=$?
16233   echo "$as_me:16233: \$? = $ac_status" >&5
16234   (exit $ac_status); } &&
16235          { ac_try='test -s conftest$ac_exeext'
16236   { (eval echo "$as_me:16236: \"$ac_try\"") >&5
16237   (eval $ac_try) 2>&5
16238   ac_status=$?
16239   echo "$as_me:16239: \$? = $ac_status" >&5
16240   (exit $ac_status); }; }; then
16241   cf_result=yes
16242 else
16243   echo "$as_me: failed program was:" >&5
16244 cat conftest.$ac_ext >&5
16245 cf_result=no
16246 fi
16247 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16248
16249 else
16250   cat >conftest.$ac_ext <<_ACEOF
16251 #line 16251 "configure"
16252 #include "confdefs.h"
16253
16254 #ifdef HAVE_XCURSES
16255 #include <xcurses.h>
16256 char * XCursesProgramName = "test";
16257 #else
16258 #include <${cf_cv_ncurses_header:-curses.h}>
16259 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16260 #include <ncursesw/term.h>
16261 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16262 #include <ncurses/term.h>
16263 #elif defined(HAVE_TERM_H)
16264 #include <term.h>
16265 #endif
16266 #endif
16267
16268 extern char ospeed;
16269 int main(void)
16270 {
16271         void *foo = &(ospeed);
16272         fprintf(stderr, "testing linkage of ospeed:%p\n", foo);
16273         ${cf_cv_main_return:-return}(foo == 0);
16274 }
16275 _ACEOF
16276 rm -f conftest$ac_exeext
16277 if { (eval echo "$as_me:16277: \"$ac_link\"") >&5
16278   (eval $ac_link) 2>&5
16279   ac_status=$?
16280   echo "$as_me:16280: \$? = $ac_status" >&5
16281   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
16282   { (eval echo "$as_me:16282: \"$ac_try\"") >&5
16283   (eval $ac_try) 2>&5
16284   ac_status=$?
16285   echo "$as_me:16285: \$? = $ac_status" >&5
16286   (exit $ac_status); }; }; then
16287   cf_result=yes
16288 else
16289   echo "$as_me: program exited with status $ac_status" >&5
16290 echo "$as_me: failed program was:" >&5
16291 cat conftest.$ac_ext >&5
16292 cf_result=no
16293 fi
16294 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
16295 fi
16296         echo "$as_me:16296: result: $cf_result" >&5
16297 echo "${ECHO_T}$cf_result" >&6
16298         if test $cf_result = yes ; then
16299
16300 cf_result=`echo "decl_curses_data_ospeed" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16301
16302                 cat >>confdefs.h <<EOF
16303 #define $cf_result 1
16304 EOF
16305
16306         fi
16307 fi
16308
16309 echo "$as_me:16309: checking for data boolnames declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
16310 echo $ECHO_N "checking for data boolnames declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
16311
16312 cat >conftest.$ac_ext <<_ACEOF
16313 #line 16313 "configure"
16314 #include "confdefs.h"
16315
16316 #ifdef HAVE_XCURSES
16317 #include <xcurses.h>
16318 char * XCursesProgramName = "test";
16319 #else
16320 #include <${cf_cv_ncurses_header:-curses.h}>
16321 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16322 #include <ncursesw/term.h>
16323 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16324 #include <ncurses/term.h>
16325 #elif defined(HAVE_TERM_H)
16326 #include <term.h>
16327 #endif
16328 #endif
16329
16330 int
16331 main ()
16332 {
16333
16334 void *foo = &(boolnames)
16335
16336   ;
16337   return 0;
16338 }
16339 _ACEOF
16340 rm -f conftest.$ac_objext
16341 if { (eval echo "$as_me:16341: \"$ac_compile\"") >&5
16342   (eval $ac_compile) 2>&5
16343   ac_status=$?
16344   echo "$as_me:16344: \$? = $ac_status" >&5
16345   (exit $ac_status); } &&
16346          { ac_try='test -s conftest.$ac_objext'
16347   { (eval echo "$as_me:16347: \"$ac_try\"") >&5
16348   (eval $ac_try) 2>&5
16349   ac_status=$?
16350   echo "$as_me:16350: \$? = $ac_status" >&5
16351   (exit $ac_status); }; }; then
16352   cf_result=yes
16353 else
16354   echo "$as_me: failed program was:" >&5
16355 cat conftest.$ac_ext >&5
16356 cf_result=no
16357 fi
16358 rm -f conftest.$ac_objext conftest.$ac_ext
16359 echo "$as_me:16359: result: $cf_result" >&5
16360 echo "${ECHO_T}$cf_result" >&6
16361
16362 if test $cf_result = yes ; then
16363
16364 cf_result=`echo "have_curses_data_boolnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16365
16366         cat >>confdefs.h <<EOF
16367 #define $cf_result 1
16368 EOF
16369
16370 else
16371         echo "$as_me:16371: checking for data boolnames in library" >&5
16372 echo $ECHO_N "checking for data boolnames in library... $ECHO_C" >&6
16373         # BSD linkers insist on making weak linkage, but resolve at runtime.
16374         if test "$cross_compiling" = yes; then
16375
16376         # cross-compiling
16377         cat >conftest.$ac_ext <<_ACEOF
16378 #line 16378 "configure"
16379 #include "confdefs.h"
16380
16381 #ifdef HAVE_XCURSES
16382 #include <xcurses.h>
16383 char * XCursesProgramName = "test";
16384 #else
16385 #include <${cf_cv_ncurses_header:-curses.h}>
16386 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16387 #include <ncursesw/term.h>
16388 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16389 #include <ncurses/term.h>
16390 #elif defined(HAVE_TERM_H)
16391 #include <term.h>
16392 #endif
16393 #endif
16394
16395 extern char boolnames;
16396 int
16397 main ()
16398 {
16399
16400         do {
16401                 void *foo = &(boolnames);
16402                 fprintf(stderr, "testing linkage of boolnames:%p\n", foo);
16403                 ${cf_cv_main_return:-return}(foo == 0);
16404         } while (0)
16405
16406   ;
16407   return 0;
16408 }
16409 _ACEOF
16410 rm -f conftest.$ac_objext conftest$ac_exeext
16411 if { (eval echo "$as_me:16411: \"$ac_link\"") >&5
16412   (eval $ac_link) 2>&5
16413   ac_status=$?
16414   echo "$as_me:16414: \$? = $ac_status" >&5
16415   (exit $ac_status); } &&
16416          { ac_try='test -s conftest$ac_exeext'
16417   { (eval echo "$as_me:16417: \"$ac_try\"") >&5
16418   (eval $ac_try) 2>&5
16419   ac_status=$?
16420   echo "$as_me:16420: \$? = $ac_status" >&5
16421   (exit $ac_status); }; }; then
16422   cf_result=yes
16423 else
16424   echo "$as_me: failed program was:" >&5
16425 cat conftest.$ac_ext >&5
16426 cf_result=no
16427 fi
16428 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16429
16430 else
16431   cat >conftest.$ac_ext <<_ACEOF
16432 #line 16432 "configure"
16433 #include "confdefs.h"
16434
16435 #ifdef HAVE_XCURSES
16436 #include <xcurses.h>
16437 char * XCursesProgramName = "test";
16438 #else
16439 #include <${cf_cv_ncurses_header:-curses.h}>
16440 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16441 #include <ncursesw/term.h>
16442 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16443 #include <ncurses/term.h>
16444 #elif defined(HAVE_TERM_H)
16445 #include <term.h>
16446 #endif
16447 #endif
16448
16449 extern char boolnames;
16450 int main(void)
16451 {
16452         void *foo = &(boolnames);
16453         fprintf(stderr, "testing linkage of boolnames:%p\n", foo);
16454         ${cf_cv_main_return:-return}(foo == 0);
16455 }
16456 _ACEOF
16457 rm -f conftest$ac_exeext
16458 if { (eval echo "$as_me:16458: \"$ac_link\"") >&5
16459   (eval $ac_link) 2>&5
16460   ac_status=$?
16461   echo "$as_me:16461: \$? = $ac_status" >&5
16462   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
16463   { (eval echo "$as_me:16463: \"$ac_try\"") >&5
16464   (eval $ac_try) 2>&5
16465   ac_status=$?
16466   echo "$as_me:16466: \$? = $ac_status" >&5
16467   (exit $ac_status); }; }; then
16468   cf_result=yes
16469 else
16470   echo "$as_me: program exited with status $ac_status" >&5
16471 echo "$as_me: failed program was:" >&5
16472 cat conftest.$ac_ext >&5
16473 cf_result=no
16474 fi
16475 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
16476 fi
16477         echo "$as_me:16477: result: $cf_result" >&5
16478 echo "${ECHO_T}$cf_result" >&6
16479         if test $cf_result = yes ; then
16480
16481 cf_result=`echo "decl_curses_data_boolnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16482
16483                 cat >>confdefs.h <<EOF
16484 #define $cf_result 1
16485 EOF
16486
16487         fi
16488 fi
16489
16490 echo "$as_me:16490: checking for data boolfnames declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
16491 echo $ECHO_N "checking for data boolfnames declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
16492
16493 cat >conftest.$ac_ext <<_ACEOF
16494 #line 16494 "configure"
16495 #include "confdefs.h"
16496
16497 #ifdef HAVE_XCURSES
16498 #include <xcurses.h>
16499 char * XCursesProgramName = "test";
16500 #else
16501 #include <${cf_cv_ncurses_header:-curses.h}>
16502 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16503 #include <ncursesw/term.h>
16504 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16505 #include <ncurses/term.h>
16506 #elif defined(HAVE_TERM_H)
16507 #include <term.h>
16508 #endif
16509 #endif
16510
16511 int
16512 main ()
16513 {
16514
16515 void *foo = &(boolfnames)
16516
16517   ;
16518   return 0;
16519 }
16520 _ACEOF
16521 rm -f conftest.$ac_objext
16522 if { (eval echo "$as_me:16522: \"$ac_compile\"") >&5
16523   (eval $ac_compile) 2>&5
16524   ac_status=$?
16525   echo "$as_me:16525: \$? = $ac_status" >&5
16526   (exit $ac_status); } &&
16527          { ac_try='test -s conftest.$ac_objext'
16528   { (eval echo "$as_me:16528: \"$ac_try\"") >&5
16529   (eval $ac_try) 2>&5
16530   ac_status=$?
16531   echo "$as_me:16531: \$? = $ac_status" >&5
16532   (exit $ac_status); }; }; then
16533   cf_result=yes
16534 else
16535   echo "$as_me: failed program was:" >&5
16536 cat conftest.$ac_ext >&5
16537 cf_result=no
16538 fi
16539 rm -f conftest.$ac_objext conftest.$ac_ext
16540 echo "$as_me:16540: result: $cf_result" >&5
16541 echo "${ECHO_T}$cf_result" >&6
16542
16543 if test $cf_result = yes ; then
16544
16545 cf_result=`echo "have_curses_data_boolfnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16546
16547         cat >>confdefs.h <<EOF
16548 #define $cf_result 1
16549 EOF
16550
16551 else
16552         echo "$as_me:16552: checking for data boolfnames in library" >&5
16553 echo $ECHO_N "checking for data boolfnames in library... $ECHO_C" >&6
16554         # BSD linkers insist on making weak linkage, but resolve at runtime.
16555         if test "$cross_compiling" = yes; then
16556
16557         # cross-compiling
16558         cat >conftest.$ac_ext <<_ACEOF
16559 #line 16559 "configure"
16560 #include "confdefs.h"
16561
16562 #ifdef HAVE_XCURSES
16563 #include <xcurses.h>
16564 char * XCursesProgramName = "test";
16565 #else
16566 #include <${cf_cv_ncurses_header:-curses.h}>
16567 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16568 #include <ncursesw/term.h>
16569 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16570 #include <ncurses/term.h>
16571 #elif defined(HAVE_TERM_H)
16572 #include <term.h>
16573 #endif
16574 #endif
16575
16576 extern char boolfnames;
16577 int
16578 main ()
16579 {
16580
16581         do {
16582                 void *foo = &(boolfnames);
16583                 fprintf(stderr, "testing linkage of boolfnames:%p\n", foo);
16584                 ${cf_cv_main_return:-return}(foo == 0);
16585         } while (0)
16586
16587   ;
16588   return 0;
16589 }
16590 _ACEOF
16591 rm -f conftest.$ac_objext conftest$ac_exeext
16592 if { (eval echo "$as_me:16592: \"$ac_link\"") >&5
16593   (eval $ac_link) 2>&5
16594   ac_status=$?
16595   echo "$as_me:16595: \$? = $ac_status" >&5
16596   (exit $ac_status); } &&
16597          { ac_try='test -s conftest$ac_exeext'
16598   { (eval echo "$as_me:16598: \"$ac_try\"") >&5
16599   (eval $ac_try) 2>&5
16600   ac_status=$?
16601   echo "$as_me:16601: \$? = $ac_status" >&5
16602   (exit $ac_status); }; }; then
16603   cf_result=yes
16604 else
16605   echo "$as_me: failed program was:" >&5
16606 cat conftest.$ac_ext >&5
16607 cf_result=no
16608 fi
16609 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16610
16611 else
16612   cat >conftest.$ac_ext <<_ACEOF
16613 #line 16613 "configure"
16614 #include "confdefs.h"
16615
16616 #ifdef HAVE_XCURSES
16617 #include <xcurses.h>
16618 char * XCursesProgramName = "test";
16619 #else
16620 #include <${cf_cv_ncurses_header:-curses.h}>
16621 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16622 #include <ncursesw/term.h>
16623 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16624 #include <ncurses/term.h>
16625 #elif defined(HAVE_TERM_H)
16626 #include <term.h>
16627 #endif
16628 #endif
16629
16630 extern char boolfnames;
16631 int main(void)
16632 {
16633         void *foo = &(boolfnames);
16634         fprintf(stderr, "testing linkage of boolfnames:%p\n", foo);
16635         ${cf_cv_main_return:-return}(foo == 0);
16636 }
16637 _ACEOF
16638 rm -f conftest$ac_exeext
16639 if { (eval echo "$as_me:16639: \"$ac_link\"") >&5
16640   (eval $ac_link) 2>&5
16641   ac_status=$?
16642   echo "$as_me:16642: \$? = $ac_status" >&5
16643   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
16644   { (eval echo "$as_me:16644: \"$ac_try\"") >&5
16645   (eval $ac_try) 2>&5
16646   ac_status=$?
16647   echo "$as_me:16647: \$? = $ac_status" >&5
16648   (exit $ac_status); }; }; then
16649   cf_result=yes
16650 else
16651   echo "$as_me: program exited with status $ac_status" >&5
16652 echo "$as_me: failed program was:" >&5
16653 cat conftest.$ac_ext >&5
16654 cf_result=no
16655 fi
16656 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
16657 fi
16658         echo "$as_me:16658: result: $cf_result" >&5
16659 echo "${ECHO_T}$cf_result" >&6
16660         if test $cf_result = yes ; then
16661
16662 cf_result=`echo "decl_curses_data_boolfnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16663
16664                 cat >>confdefs.h <<EOF
16665 #define $cf_result 1
16666 EOF
16667
16668         fi
16669 fi
16670
16671 if ( test "$GCC" = yes || test "$GXX" = yes )
16672 then
16673 echo "$as_me:16673: checking if you want to turn on gcc warnings" >&5
16674 echo $ECHO_N "checking if you want to turn on gcc warnings... $ECHO_C" >&6
16675
16676 # Check whether --enable-warnings or --disable-warnings was given.
16677 if test "${enable_warnings+set}" = set; then
16678   enableval="$enable_warnings"
16679   test "$enableval" != yes && enableval=no
16680         if test "$enableval" != "no" ; then
16681     with_warnings=yes
16682         else
16683                 with_warnings=no
16684         fi
16685 else
16686   enableval=no
16687         with_warnings=no
16688
16689 fi;
16690 echo "$as_me:16690: result: $with_warnings" >&5
16691 echo "${ECHO_T}$with_warnings" >&6
16692 if test "$with_warnings" = "yes"
16693 then
16694
16695 if test "$GCC" = yes
16696 then
16697 cat > conftest.i <<EOF
16698 #ifndef GCC_PRINTF
16699 #define GCC_PRINTF 0
16700 #endif
16701 #ifndef GCC_SCANF
16702 #define GCC_SCANF 0
16703 #endif
16704 #ifndef GCC_NORETURN
16705 #define GCC_NORETURN /* nothing */
16706 #endif
16707 #ifndef GCC_UNUSED
16708 #define GCC_UNUSED /* nothing */
16709 #endif
16710 EOF
16711 if test "$GCC" = yes
16712 then
16713         { echo "$as_me:16713: checking for $CC __attribute__ directives..." >&5
16714 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
16715 cat > conftest.$ac_ext <<EOF
16716 #line 16716 "${as_me:-configure}"
16717 #include "confdefs.h"
16718 #include "conftest.h"
16719 #include "conftest.i"
16720 #if     GCC_PRINTF
16721 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
16722 #else
16723 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
16724 #endif
16725 #if     GCC_SCANF
16726 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
16727 #else
16728 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
16729 #endif
16730 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
16731 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
16732 extern void foo(void) GCC_NORETURN;
16733 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
16734 EOF
16735         cf_printf_attribute=no
16736         cf_scanf_attribute=no
16737         for cf_attribute in scanf printf unused noreturn
16738         do
16739
16740 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16741
16742                 cf_directive="__attribute__(($cf_attribute))"
16743                 echo "checking for $CC $cf_directive" 1>&5
16744
16745                 case $cf_attribute in
16746                 (printf)
16747                         cf_printf_attribute=yes
16748                         cat >conftest.h <<EOF
16749 #define GCC_$cf_ATTRIBUTE 1
16750 EOF
16751                         ;;
16752                 (scanf)
16753                         cf_scanf_attribute=yes
16754                         cat >conftest.h <<EOF
16755 #define GCC_$cf_ATTRIBUTE 1
16756 EOF
16757                         ;;
16758                 (*)
16759                         cat >conftest.h <<EOF
16760 #define GCC_$cf_ATTRIBUTE $cf_directive
16761 EOF
16762                         ;;
16763                 esac
16764
16765                 if { (eval echo "$as_me:16765: \"$ac_compile\"") >&5
16766   (eval $ac_compile) 2>&5
16767   ac_status=$?
16768   echo "$as_me:16768: \$? = $ac_status" >&5
16769   (exit $ac_status); }; then
16770                         test -n "$verbose" && echo "$as_me:16770: result: ... $cf_attribute" >&5
16771 echo "${ECHO_T}... $cf_attribute" >&6
16772                         cat conftest.h >>confdefs.h
16773                         case $cf_attribute in
16774                         (noreturn)
16775
16776 cat >>confdefs.h <<EOF
16777 #define GCC_NORETURN $cf_directive
16778 EOF
16779
16780                                 ;;
16781                         (printf)
16782                                 cf_value='/* nothing */'
16783                                 if test "$cf_printf_attribute" != no ; then
16784                                         cf_value='__attribute__((format(printf,fmt,var)))'
16785
16786 cat >>confdefs.h <<\EOF
16787 #define GCC_PRINTF 1
16788 EOF
16789
16790                                 fi
16791
16792 cat >>confdefs.h <<EOF
16793 #define GCC_PRINTFLIKE(fmt,var) $cf_value
16794 EOF
16795
16796                                 ;;
16797                         (scanf)
16798                                 cf_value='/* nothing */'
16799                                 if test "$cf_scanf_attribute" != no ; then
16800                                         cf_value='__attribute__((format(scanf,fmt,var)))'
16801
16802 cat >>confdefs.h <<\EOF
16803 #define GCC_SCANF 1
16804 EOF
16805
16806                                 fi
16807
16808 cat >>confdefs.h <<EOF
16809 #define GCC_SCANFLIKE(fmt,var) $cf_value
16810 EOF
16811
16812                                 ;;
16813                         (unused)
16814
16815 cat >>confdefs.h <<EOF
16816 #define GCC_UNUSED $cf_directive
16817 EOF
16818
16819                                 ;;
16820                         esac
16821                 fi
16822         done
16823 else
16824         fgrep define conftest.i >>confdefs.h
16825 fi
16826 rm -rf conftest*
16827 fi
16828
16829 INTEL_COMPILER=no
16830
16831 if test "$GCC" = yes ; then
16832         case $host_os in
16833         (linux*|gnu*)
16834                 echo "$as_me:16834: checking if this is really Intel C compiler" >&5
16835 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
16836                 cf_save_CFLAGS="$CFLAGS"
16837                 CFLAGS="$CFLAGS -no-gcc"
16838                 cat >conftest.$ac_ext <<_ACEOF
16839 #line 16839 "configure"
16840 #include "confdefs.h"
16841
16842 int
16843 main ()
16844 {
16845
16846 #ifdef __INTEL_COMPILER
16847 #else
16848 make an error
16849 #endif
16850
16851   ;
16852   return 0;
16853 }
16854 _ACEOF
16855 rm -f conftest.$ac_objext
16856 if { (eval echo "$as_me:16856: \"$ac_compile\"") >&5
16857   (eval $ac_compile) 2>&5
16858   ac_status=$?
16859   echo "$as_me:16859: \$? = $ac_status" >&5
16860   (exit $ac_status); } &&
16861          { ac_try='test -s conftest.$ac_objext'
16862   { (eval echo "$as_me:16862: \"$ac_try\"") >&5
16863   (eval $ac_try) 2>&5
16864   ac_status=$?
16865   echo "$as_me:16865: \$? = $ac_status" >&5
16866   (exit $ac_status); }; }; then
16867   INTEL_COMPILER=yes
16868 cf_save_CFLAGS="$cf_save_CFLAGS -we147"
16869
16870 else
16871   echo "$as_me: failed program was:" >&5
16872 cat conftest.$ac_ext >&5
16873 fi
16874 rm -f conftest.$ac_objext conftest.$ac_ext
16875                 CFLAGS="$cf_save_CFLAGS"
16876                 echo "$as_me:16876: result: $INTEL_COMPILER" >&5
16877 echo "${ECHO_T}$INTEL_COMPILER" >&6
16878                 ;;
16879         esac
16880 fi
16881
16882 CLANG_COMPILER=no
16883
16884 if test "$GCC" = yes ; then
16885         echo "$as_me:16885: checking if this is really Clang C compiler" >&5
16886 echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6
16887         cf_save_CFLAGS="$CFLAGS"
16888         CFLAGS="$CFLAGS -Qunused-arguments"
16889         cat >conftest.$ac_ext <<_ACEOF
16890 #line 16890 "configure"
16891 #include "confdefs.h"
16892
16893 int
16894 main ()
16895 {
16896
16897 #ifdef __clang__
16898 #else
16899 make an error
16900 #endif
16901
16902   ;
16903   return 0;
16904 }
16905 _ACEOF
16906 rm -f conftest.$ac_objext
16907 if { (eval echo "$as_me:16907: \"$ac_compile\"") >&5
16908   (eval $ac_compile) 2>&5
16909   ac_status=$?
16910   echo "$as_me:16910: \$? = $ac_status" >&5
16911   (exit $ac_status); } &&
16912          { ac_try='test -s conftest.$ac_objext'
16913   { (eval echo "$as_me:16913: \"$ac_try\"") >&5
16914   (eval $ac_try) 2>&5
16915   ac_status=$?
16916   echo "$as_me:16916: \$? = $ac_status" >&5
16917   (exit $ac_status); }; }; then
16918   CLANG_COMPILER=yes
16919 cf_save_CFLAGS="$cf_save_CFLAGS -Qunused-arguments"
16920
16921 else
16922   echo "$as_me: failed program was:" >&5
16923 cat conftest.$ac_ext >&5
16924 fi
16925 rm -f conftest.$ac_objext conftest.$ac_ext
16926         CFLAGS="$cf_save_CFLAGS"
16927         echo "$as_me:16927: result: $CLANG_COMPILER" >&5
16928 echo "${ECHO_T}$CLANG_COMPILER" >&6
16929 fi
16930
16931 cat > conftest.$ac_ext <<EOF
16932 #line 16932 "${as_me:-configure}"
16933 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
16934 EOF
16935
16936 if test "$INTEL_COMPILER" = yes
16937 then
16938 # The "-wdXXX" options suppress warnings:
16939 # remark #1419: external declaration in primary source file
16940 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
16941 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
16942 # remark #193: zero used for undefined preprocessing identifier
16943 # remark #593: variable "curs_sb_left_arrow" was set but never used
16944 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
16945 # remark #869: parameter "tw" was never referenced
16946 # remark #981: operands are evaluated in unspecified order
16947 # warning #279: controlling expression is constant
16948
16949         { echo "$as_me:16949: checking for $CC warning options..." >&5
16950 echo "$as_me: checking for $CC warning options..." >&6;}
16951         cf_save_CFLAGS="$CFLAGS"
16952         EXTRA_CFLAGS="-Wall"
16953         for cf_opt in \
16954                 wd1419 \
16955                 wd1683 \
16956                 wd1684 \
16957                 wd193 \
16958                 wd593 \
16959                 wd279 \
16960                 wd810 \
16961                 wd869 \
16962                 wd981
16963         do
16964                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
16965                 if { (eval echo "$as_me:16965: \"$ac_compile\"") >&5
16966   (eval $ac_compile) 2>&5
16967   ac_status=$?
16968   echo "$as_me:16968: \$? = $ac_status" >&5
16969   (exit $ac_status); }; then
16970                         test -n "$verbose" && echo "$as_me:16970: result: ... -$cf_opt" >&5
16971 echo "${ECHO_T}... -$cf_opt" >&6
16972                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
16973                 fi
16974         done
16975         CFLAGS="$cf_save_CFLAGS"
16976
16977 elif test "$GCC" = yes
16978 then
16979         { echo "$as_me:16979: checking for $CC warning options..." >&5
16980 echo "$as_me: checking for $CC warning options..." >&6;}
16981         cf_save_CFLAGS="$CFLAGS"
16982         EXTRA_CFLAGS=
16983         cf_warn_CONST=""
16984         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
16985         cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
16986         test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
16987         for cf_opt in W Wall \
16988                 Wbad-function-cast \
16989                 Wcast-align \
16990                 Wcast-qual \
16991                 Wdeclaration-after-statement \
16992                 Wextra \
16993                 Winline \
16994                 Wmissing-declarations \
16995                 Wmissing-prototypes \
16996                 Wnested-externs \
16997                 Wpointer-arith \
16998                 Wshadow \
16999                 Wstrict-prototypes \
17000                 Wundef $cf_gcc_warnings $cf_warn_CONST
17001         do
17002                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
17003                 if { (eval echo "$as_me:17003: \"$ac_compile\"") >&5
17004   (eval $ac_compile) 2>&5
17005   ac_status=$?
17006   echo "$as_me:17006: \$? = $ac_status" >&5
17007   (exit $ac_status); }; then
17008                         test -n "$verbose" && echo "$as_me:17008: result: ... -$cf_opt" >&5
17009 echo "${ECHO_T}... -$cf_opt" >&6
17010                         case $cf_opt in
17011                         (Wcast-qual)
17012                                 CPPFLAGS="$CPPFLAGS -DXTSTRINGDEFINES"
17013                                 ;;
17014                         (Winline)
17015                                 case $GCC_VERSION in
17016                                 ([34].*)
17017                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
17018
17019 echo "${as_me:-configure}:17019: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
17020
17021                                         continue;;
17022                                 esac
17023                                 ;;
17024                         (Wpointer-arith)
17025                                 case $GCC_VERSION in
17026                                 ([12].*)
17027                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
17028
17029 echo "${as_me:-configure}:17029: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
17030
17031                                         continue;;
17032                                 esac
17033                                 ;;
17034                         esac
17035                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
17036                 fi
17037         done
17038         CFLAGS="$cf_save_CFLAGS"
17039 fi
17040 rm -rf conftest*
17041
17042 fi
17043 fi
17044
17045 echo "$as_me:17045: checking if you want to use dmalloc for testing" >&5
17046 echo $ECHO_N "checking if you want to use dmalloc for testing... $ECHO_C" >&6
17047
17048 # Check whether --with-dmalloc or --without-dmalloc was given.
17049 if test "${with_dmalloc+set}" = set; then
17050   withval="$with_dmalloc"
17051
17052 cat >>confdefs.h <<EOF
17053 #define USE_DMALLOC 1
17054 EOF
17055
17056         : ${with_cflags:=-g}
17057         : ${with_no_leaks:=yes}
17058          with_dmalloc=yes
17059 else
17060   with_dmalloc=
17061 fi;
17062 echo "$as_me:17062: result: ${with_dmalloc:-no}" >&5
17063 echo "${ECHO_T}${with_dmalloc:-no}" >&6
17064
17065 case .$with_cflags in
17066 (.*-g*)
17067         case .$CFLAGS in
17068         (.*-g*)
17069                 ;;
17070         (*)
17071
17072 cf_fix_cppflags=no
17073 cf_new_cflags=
17074 cf_new_cppflags=
17075 cf_new_extra_cppflags=
17076
17077 for cf_add_cflags in -g
17078 do
17079 case $cf_fix_cppflags in
17080 (no)
17081         case $cf_add_cflags in
17082         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
17083                 case $cf_add_cflags in
17084                 (-D*)
17085                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
17086
17087                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17088                                 && test -z "${cf_tst_cflags}" \
17089                                 && cf_fix_cppflags=yes
17090
17091                         if test $cf_fix_cppflags = yes ; then
17092                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
17093                                 continue
17094                         elif test "${cf_tst_cflags}" = "\"'" ; then
17095                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
17096                                 continue
17097                         fi
17098                         ;;
17099                 esac
17100                 case "$CPPFLAGS" in
17101                 (*$cf_add_cflags)
17102                         ;;
17103                 (*)
17104                         case $cf_add_cflags in
17105                         (-D*)
17106                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
17107
17108 CPPFLAGS=`echo "$CPPFLAGS" | \
17109         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
17110                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
17111
17112                                 ;;
17113                         esac
17114                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
17115                         ;;
17116                 esac
17117                 ;;
17118         (*)
17119                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
17120                 ;;
17121         esac
17122         ;;
17123 (yes)
17124         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
17125
17126         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
17127
17128         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17129                 && test -z "${cf_tst_cflags}" \
17130                 && cf_fix_cppflags=no
17131         ;;
17132 esac
17133 done
17134
17135 if test -n "$cf_new_cflags" ; then
17136
17137         CFLAGS="$CFLAGS $cf_new_cflags"
17138 fi
17139
17140 if test -n "$cf_new_cppflags" ; then
17141
17142         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
17143 fi
17144
17145 if test -n "$cf_new_extra_cppflags" ; then
17146
17147         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
17148 fi
17149
17150                 ;;
17151         esac
17152         ;;
17153 esac
17154
17155 if test "$with_dmalloc" = yes ; then
17156         echo "$as_me:17156: checking for dmalloc.h" >&5
17157 echo $ECHO_N "checking for dmalloc.h... $ECHO_C" >&6
17158 if test "${ac_cv_header_dmalloc_h+set}" = set; then
17159   echo $ECHO_N "(cached) $ECHO_C" >&6
17160 else
17161   cat >conftest.$ac_ext <<_ACEOF
17162 #line 17162 "configure"
17163 #include "confdefs.h"
17164 #include <dmalloc.h>
17165 _ACEOF
17166 if { (eval echo "$as_me:17166: \"$ac_cpp conftest.$ac_ext\"") >&5
17167   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
17168   ac_status=$?
17169   egrep -v '^ *\+' conftest.er1 >conftest.err
17170   rm -f conftest.er1
17171   cat conftest.err >&5
17172   echo "$as_me:17172: \$? = $ac_status" >&5
17173   (exit $ac_status); } >/dev/null; then
17174   if test -s conftest.err; then
17175     ac_cpp_err=$ac_c_preproc_warn_flag
17176   else
17177     ac_cpp_err=
17178   fi
17179 else
17180   ac_cpp_err=yes
17181 fi
17182 if test -z "$ac_cpp_err"; then
17183   ac_cv_header_dmalloc_h=yes
17184 else
17185   echo "$as_me: failed program was:" >&5
17186   cat conftest.$ac_ext >&5
17187   ac_cv_header_dmalloc_h=no
17188 fi
17189 rm -f conftest.err conftest.$ac_ext
17190 fi
17191 echo "$as_me:17191: result: $ac_cv_header_dmalloc_h" >&5
17192 echo "${ECHO_T}$ac_cv_header_dmalloc_h" >&6
17193 if test $ac_cv_header_dmalloc_h = yes; then
17194
17195 echo "$as_me:17195: checking for dmalloc_debug in -ldmalloc" >&5
17196 echo $ECHO_N "checking for dmalloc_debug in -ldmalloc... $ECHO_C" >&6
17197 if test "${ac_cv_lib_dmalloc_dmalloc_debug+set}" = set; then
17198   echo $ECHO_N "(cached) $ECHO_C" >&6
17199 else
17200   ac_check_lib_save_LIBS=$LIBS
17201 LIBS="-ldmalloc  $LIBS"
17202 cat >conftest.$ac_ext <<_ACEOF
17203 #line 17203 "configure"
17204 #include "confdefs.h"
17205
17206 /* Override any gcc2 internal prototype to avoid an error.  */
17207 #ifdef __cplusplus
17208 extern "C"
17209 #endif
17210 /* We use char because int might match the return type of a gcc2
17211    builtin and then its argument prototype would still apply.  */
17212 char dmalloc_debug ();
17213 int
17214 main ()
17215 {
17216 dmalloc_debug ();
17217   ;
17218   return 0;
17219 }
17220 _ACEOF
17221 rm -f conftest.$ac_objext conftest$ac_exeext
17222 if { (eval echo "$as_me:17222: \"$ac_link\"") >&5
17223   (eval $ac_link) 2>&5
17224   ac_status=$?
17225   echo "$as_me:17225: \$? = $ac_status" >&5
17226   (exit $ac_status); } &&
17227          { ac_try='test -s conftest$ac_exeext'
17228   { (eval echo "$as_me:17228: \"$ac_try\"") >&5
17229   (eval $ac_try) 2>&5
17230   ac_status=$?
17231   echo "$as_me:17231: \$? = $ac_status" >&5
17232   (exit $ac_status); }; }; then
17233   ac_cv_lib_dmalloc_dmalloc_debug=yes
17234 else
17235   echo "$as_me: failed program was:" >&5
17236 cat conftest.$ac_ext >&5
17237 ac_cv_lib_dmalloc_dmalloc_debug=no
17238 fi
17239 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17240 LIBS=$ac_check_lib_save_LIBS
17241 fi
17242 echo "$as_me:17242: result: $ac_cv_lib_dmalloc_dmalloc_debug" >&5
17243 echo "${ECHO_T}$ac_cv_lib_dmalloc_dmalloc_debug" >&6
17244 if test $ac_cv_lib_dmalloc_dmalloc_debug = yes; then
17245   cat >>confdefs.h <<EOF
17246 #define HAVE_LIBDMALLOC 1
17247 EOF
17248
17249   LIBS="-ldmalloc $LIBS"
17250
17251 fi
17252
17253 fi
17254
17255 fi
17256
17257 echo "$as_me:17257: checking if you want to use dbmalloc for testing" >&5
17258 echo $ECHO_N "checking if you want to use dbmalloc for testing... $ECHO_C" >&6
17259
17260 # Check whether --with-dbmalloc or --without-dbmalloc was given.
17261 if test "${with_dbmalloc+set}" = set; then
17262   withval="$with_dbmalloc"
17263
17264 cat >>confdefs.h <<EOF
17265 #define USE_DBMALLOC 1
17266 EOF
17267
17268         : ${with_cflags:=-g}
17269         : ${with_no_leaks:=yes}
17270          with_dbmalloc=yes
17271 else
17272   with_dbmalloc=
17273 fi;
17274 echo "$as_me:17274: result: ${with_dbmalloc:-no}" >&5
17275 echo "${ECHO_T}${with_dbmalloc:-no}" >&6
17276
17277 case .$with_cflags in
17278 (.*-g*)
17279         case .$CFLAGS in
17280         (.*-g*)
17281                 ;;
17282         (*)
17283
17284 cf_fix_cppflags=no
17285 cf_new_cflags=
17286 cf_new_cppflags=
17287 cf_new_extra_cppflags=
17288
17289 for cf_add_cflags in -g
17290 do
17291 case $cf_fix_cppflags in
17292 (no)
17293         case $cf_add_cflags in
17294         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
17295                 case $cf_add_cflags in
17296                 (-D*)
17297                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
17298
17299                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17300                                 && test -z "${cf_tst_cflags}" \
17301                                 && cf_fix_cppflags=yes
17302
17303                         if test $cf_fix_cppflags = yes ; then
17304                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
17305                                 continue
17306                         elif test "${cf_tst_cflags}" = "\"'" ; then
17307                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
17308                                 continue
17309                         fi
17310                         ;;
17311                 esac
17312                 case "$CPPFLAGS" in
17313                 (*$cf_add_cflags)
17314                         ;;
17315                 (*)
17316                         case $cf_add_cflags in
17317                         (-D*)
17318                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
17319
17320 CPPFLAGS=`echo "$CPPFLAGS" | \
17321         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
17322                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
17323
17324                                 ;;
17325                         esac
17326                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
17327                         ;;
17328                 esac
17329                 ;;
17330         (*)
17331                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
17332                 ;;
17333         esac
17334         ;;
17335 (yes)
17336         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
17337
17338         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
17339
17340         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17341                 && test -z "${cf_tst_cflags}" \
17342                 && cf_fix_cppflags=no
17343         ;;
17344 esac
17345 done
17346
17347 if test -n "$cf_new_cflags" ; then
17348
17349         CFLAGS="$CFLAGS $cf_new_cflags"
17350 fi
17351
17352 if test -n "$cf_new_cppflags" ; then
17353
17354         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
17355 fi
17356
17357 if test -n "$cf_new_extra_cppflags" ; then
17358
17359         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
17360 fi
17361
17362                 ;;
17363         esac
17364         ;;
17365 esac
17366
17367 if test "$with_dbmalloc" = yes ; then
17368         echo "$as_me:17368: checking for dbmalloc.h" >&5
17369 echo $ECHO_N "checking for dbmalloc.h... $ECHO_C" >&6
17370 if test "${ac_cv_header_dbmalloc_h+set}" = set; then
17371   echo $ECHO_N "(cached) $ECHO_C" >&6
17372 else
17373   cat >conftest.$ac_ext <<_ACEOF
17374 #line 17374 "configure"
17375 #include "confdefs.h"
17376 #include <dbmalloc.h>
17377 _ACEOF
17378 if { (eval echo "$as_me:17378: \"$ac_cpp conftest.$ac_ext\"") >&5
17379   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
17380   ac_status=$?
17381   egrep -v '^ *\+' conftest.er1 >conftest.err
17382   rm -f conftest.er1
17383   cat conftest.err >&5
17384   echo "$as_me:17384: \$? = $ac_status" >&5
17385   (exit $ac_status); } >/dev/null; then
17386   if test -s conftest.err; then
17387     ac_cpp_err=$ac_c_preproc_warn_flag
17388   else
17389     ac_cpp_err=
17390   fi
17391 else
17392   ac_cpp_err=yes
17393 fi
17394 if test -z "$ac_cpp_err"; then
17395   ac_cv_header_dbmalloc_h=yes
17396 else
17397   echo "$as_me: failed program was:" >&5
17398   cat conftest.$ac_ext >&5
17399   ac_cv_header_dbmalloc_h=no
17400 fi
17401 rm -f conftest.err conftest.$ac_ext
17402 fi
17403 echo "$as_me:17403: result: $ac_cv_header_dbmalloc_h" >&5
17404 echo "${ECHO_T}$ac_cv_header_dbmalloc_h" >&6
17405 if test $ac_cv_header_dbmalloc_h = yes; then
17406
17407 echo "$as_me:17407: checking for debug_malloc in -ldbmalloc" >&5
17408 echo $ECHO_N "checking for debug_malloc in -ldbmalloc... $ECHO_C" >&6
17409 if test "${ac_cv_lib_dbmalloc_debug_malloc+set}" = set; then
17410   echo $ECHO_N "(cached) $ECHO_C" >&6
17411 else
17412   ac_check_lib_save_LIBS=$LIBS
17413 LIBS="-ldbmalloc  $LIBS"
17414 cat >conftest.$ac_ext <<_ACEOF
17415 #line 17415 "configure"
17416 #include "confdefs.h"
17417
17418 /* Override any gcc2 internal prototype to avoid an error.  */
17419 #ifdef __cplusplus
17420 extern "C"
17421 #endif
17422 /* We use char because int might match the return type of a gcc2
17423    builtin and then its argument prototype would still apply.  */
17424 char debug_malloc ();
17425 int
17426 main ()
17427 {
17428 debug_malloc ();
17429   ;
17430   return 0;
17431 }
17432 _ACEOF
17433 rm -f conftest.$ac_objext conftest$ac_exeext
17434 if { (eval echo "$as_me:17434: \"$ac_link\"") >&5
17435   (eval $ac_link) 2>&5
17436   ac_status=$?
17437   echo "$as_me:17437: \$? = $ac_status" >&5
17438   (exit $ac_status); } &&
17439          { ac_try='test -s conftest$ac_exeext'
17440   { (eval echo "$as_me:17440: \"$ac_try\"") >&5
17441   (eval $ac_try) 2>&5
17442   ac_status=$?
17443   echo "$as_me:17443: \$? = $ac_status" >&5
17444   (exit $ac_status); }; }; then
17445   ac_cv_lib_dbmalloc_debug_malloc=yes
17446 else
17447   echo "$as_me: failed program was:" >&5
17448 cat conftest.$ac_ext >&5
17449 ac_cv_lib_dbmalloc_debug_malloc=no
17450 fi
17451 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17452 LIBS=$ac_check_lib_save_LIBS
17453 fi
17454 echo "$as_me:17454: result: $ac_cv_lib_dbmalloc_debug_malloc" >&5
17455 echo "${ECHO_T}$ac_cv_lib_dbmalloc_debug_malloc" >&6
17456 if test $ac_cv_lib_dbmalloc_debug_malloc = yes; then
17457   cat >>confdefs.h <<EOF
17458 #define HAVE_LIBDBMALLOC 1
17459 EOF
17460
17461   LIBS="-ldbmalloc $LIBS"
17462
17463 fi
17464
17465 fi
17466
17467 fi
17468
17469 echo "$as_me:17469: checking if you want to use valgrind for testing" >&5
17470 echo $ECHO_N "checking if you want to use valgrind for testing... $ECHO_C" >&6
17471
17472 # Check whether --with-valgrind or --without-valgrind was given.
17473 if test "${with_valgrind+set}" = set; then
17474   withval="$with_valgrind"
17475
17476 cat >>confdefs.h <<EOF
17477 #define USE_VALGRIND 1
17478 EOF
17479
17480         : ${with_cflags:=-g}
17481         : ${with_no_leaks:=yes}
17482          with_valgrind=yes
17483 else
17484   with_valgrind=
17485 fi;
17486 echo "$as_me:17486: result: ${with_valgrind:-no}" >&5
17487 echo "${ECHO_T}${with_valgrind:-no}" >&6
17488
17489 case .$with_cflags in
17490 (.*-g*)
17491         case .$CFLAGS in
17492         (.*-g*)
17493                 ;;
17494         (*)
17495
17496 cf_fix_cppflags=no
17497 cf_new_cflags=
17498 cf_new_cppflags=
17499 cf_new_extra_cppflags=
17500
17501 for cf_add_cflags in -g
17502 do
17503 case $cf_fix_cppflags in
17504 (no)
17505         case $cf_add_cflags in
17506         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
17507                 case $cf_add_cflags in
17508                 (-D*)
17509                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
17510
17511                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17512                                 && test -z "${cf_tst_cflags}" \
17513                                 && cf_fix_cppflags=yes
17514
17515                         if test $cf_fix_cppflags = yes ; then
17516                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
17517                                 continue
17518                         elif test "${cf_tst_cflags}" = "\"'" ; then
17519                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
17520                                 continue
17521                         fi
17522                         ;;
17523                 esac
17524                 case "$CPPFLAGS" in
17525                 (*$cf_add_cflags)
17526                         ;;
17527                 (*)
17528                         case $cf_add_cflags in
17529                         (-D*)
17530                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
17531
17532 CPPFLAGS=`echo "$CPPFLAGS" | \
17533         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
17534                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
17535
17536                                 ;;
17537                         esac
17538                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
17539                         ;;
17540                 esac
17541                 ;;
17542         (*)
17543                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
17544                 ;;
17545         esac
17546         ;;
17547 (yes)
17548         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
17549
17550         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
17551
17552         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17553                 && test -z "${cf_tst_cflags}" \
17554                 && cf_fix_cppflags=no
17555         ;;
17556 esac
17557 done
17558
17559 if test -n "$cf_new_cflags" ; then
17560
17561         CFLAGS="$CFLAGS $cf_new_cflags"
17562 fi
17563
17564 if test -n "$cf_new_cppflags" ; then
17565
17566         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
17567 fi
17568
17569 if test -n "$cf_new_extra_cppflags" ; then
17570
17571         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
17572 fi
17573
17574                 ;;
17575         esac
17576         ;;
17577 esac
17578
17579 echo "$as_me:17579: checking if you want to perform memory-leak testing" >&5
17580 echo $ECHO_N "checking if you want to perform memory-leak testing... $ECHO_C" >&6
17581
17582 # Check whether --enable-leaks or --disable-leaks was given.
17583 if test "${enable_leaks+set}" = set; then
17584   enableval="$enable_leaks"
17585   if test "x$enableval" = xno; then with_no_leaks=yes; else with_no_leaks=no; fi
17586 else
17587   : ${with_no_leaks:=no}
17588 fi;
17589 echo "$as_me:17589: result: $with_no_leaks" >&5
17590 echo "${ECHO_T}$with_no_leaks" >&6
17591
17592 if test "$with_no_leaks" = yes ; then
17593
17594 cat >>confdefs.h <<\EOF
17595 #define NO_LEAKS 1
17596 EOF
17597
17598 cat >>confdefs.h <<\EOF
17599 #define YY_NO_LEAKS 1
17600 EOF
17601
17602 fi
17603
17604 LD_RPATH_OPT=
17605 echo "$as_me:17605: checking for an rpath option" >&5
17606 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
17607 case $cf_cv_system_name in
17608 (irix*)
17609         if test "$GCC" = yes; then
17610                 LD_RPATH_OPT="-Wl,-rpath,"
17611         else
17612                 LD_RPATH_OPT="-rpath "
17613         fi
17614         ;;
17615 (linux*|gnu*|k*bsd*-gnu|freebsd*)
17616         LD_RPATH_OPT="-Wl,-rpath,"
17617         ;;
17618 (openbsd[2-9].*|mirbsd*)
17619         LD_RPATH_OPT="-Wl,-rpath,"
17620         ;;
17621 (dragonfly*)
17622         LD_RPATH_OPT="-rpath "
17623         ;;
17624 (netbsd*)
17625         LD_RPATH_OPT="-Wl,-rpath,"
17626         ;;
17627 (osf*|mls+*)
17628         LD_RPATH_OPT="-rpath "
17629         ;;
17630 (solaris2*)
17631         LD_RPATH_OPT="-R"
17632         ;;
17633 (*)
17634         ;;
17635 esac
17636 echo "$as_me:17636: result: $LD_RPATH_OPT" >&5
17637 echo "${ECHO_T}$LD_RPATH_OPT" >&6
17638
17639 case "x$LD_RPATH_OPT" in
17640 (x-R*)
17641         echo "$as_me:17641: checking if we need a space after rpath option" >&5
17642 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
17643         cf_save_LIBS="$LIBS"
17644
17645 cf_add_libs="${LD_RPATH_OPT}$libdir"
17646 # Filter out duplicates - this happens with badly-designed ".pc" files...
17647 for cf_add_1lib in $LIBS
17648 do
17649         for cf_add_2lib in $cf_add_libs
17650         do
17651                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
17652                 then
17653                         cf_add_1lib=
17654                         break
17655                 fi
17656         done
17657         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
17658 done
17659 LIBS="$cf_add_libs"
17660
17661         cat >conftest.$ac_ext <<_ACEOF
17662 #line 17662 "configure"
17663 #include "confdefs.h"
17664
17665 int
17666 main ()
17667 {
17668
17669   ;
17670   return 0;
17671 }
17672 _ACEOF
17673 rm -f conftest.$ac_objext conftest$ac_exeext
17674 if { (eval echo "$as_me:17674: \"$ac_link\"") >&5
17675   (eval $ac_link) 2>&5
17676   ac_status=$?
17677   echo "$as_me:17677: \$? = $ac_status" >&5
17678   (exit $ac_status); } &&
17679          { ac_try='test -s conftest$ac_exeext'
17680   { (eval echo "$as_me:17680: \"$ac_try\"") >&5
17681   (eval $ac_try) 2>&5
17682   ac_status=$?
17683   echo "$as_me:17683: \$? = $ac_status" >&5
17684   (exit $ac_status); }; }; then
17685   cf_rpath_space=no
17686 else
17687   echo "$as_me: failed program was:" >&5
17688 cat conftest.$ac_ext >&5
17689 cf_rpath_space=yes
17690 fi
17691 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17692         LIBS="$cf_save_LIBS"
17693         echo "$as_me:17693: result: $cf_rpath_space" >&5
17694 echo "${ECHO_T}$cf_rpath_space" >&6
17695         test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
17696         ;;
17697 esac
17698
17699 echo "$as_me:17699: checking if rpath-hack should be disabled" >&5
17700 echo $ECHO_N "checking if rpath-hack should be disabled... $ECHO_C" >&6
17701
17702 # Check whether --enable-rpath-hack or --disable-rpath-hack was given.
17703 if test "${enable_rpath_hack+set}" = set; then
17704   enableval="$enable_rpath_hack"
17705   test "$enableval" != no && enableval=yes
17706         if test "$enableval" != "yes" ; then
17707     cf_disable_rpath_hack=yes
17708         else
17709                 cf_disable_rpath_hack=no
17710         fi
17711 else
17712   enableval=yes
17713         cf_disable_rpath_hack=no
17714
17715 fi;
17716 echo "$as_me:17716: result: $cf_disable_rpath_hack" >&5
17717 echo "${ECHO_T}$cf_disable_rpath_hack" >&6
17718 if test "$cf_disable_rpath_hack" = no ; then
17719
17720 echo "$as_me:17720: checking for updated LDFLAGS" >&5
17721 echo $ECHO_N "checking for updated LDFLAGS... $ECHO_C" >&6
17722 if test -n "$LD_RPATH_OPT" ; then
17723         echo "$as_me:17723: result: maybe" >&5
17724 echo "${ECHO_T}maybe" >&6
17725
17726         for ac_prog in ldd
17727 do
17728   # Extract the first word of "$ac_prog", so it can be a program name with args.
17729 set dummy $ac_prog; ac_word=$2
17730 echo "$as_me:17730: checking for $ac_word" >&5
17731 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
17732 if test "${ac_cv_prog_cf_ldd_prog+set}" = set; then
17733   echo $ECHO_N "(cached) $ECHO_C" >&6
17734 else
17735   if test -n "$cf_ldd_prog"; then
17736   ac_cv_prog_cf_ldd_prog="$cf_ldd_prog" # Let the user override the test.
17737 else
17738   ac_save_IFS=$IFS; IFS=$ac_path_separator
17739 ac_dummy="$PATH"
17740 for ac_dir in $ac_dummy; do
17741   IFS=$ac_save_IFS
17742   test -z "$ac_dir" && ac_dir=.
17743   $as_executable_p "$ac_dir/$ac_word" || continue
17744 ac_cv_prog_cf_ldd_prog="$ac_prog"
17745 echo "$as_me:17745: found $ac_dir/$ac_word" >&5
17746 break
17747 done
17748
17749 fi
17750 fi
17751 cf_ldd_prog=$ac_cv_prog_cf_ldd_prog
17752 if test -n "$cf_ldd_prog"; then
17753   echo "$as_me:17753: result: $cf_ldd_prog" >&5
17754 echo "${ECHO_T}$cf_ldd_prog" >&6
17755 else
17756   echo "$as_me:17756: result: no" >&5
17757 echo "${ECHO_T}no" >&6
17758 fi
17759
17760   test -n "$cf_ldd_prog" && break
17761 done
17762 test -n "$cf_ldd_prog" || cf_ldd_prog="no"
17763
17764         cf_rpath_list="/usr/lib /lib"
17765         if test "$cf_ldd_prog" != no
17766         then
17767                 cf_rpath_oops=
17768
17769 cat >conftest.$ac_ext <<_ACEOF
17770 #line 17770 "configure"
17771 #include "confdefs.h"
17772 #include <stdio.h>
17773 int
17774 main ()
17775 {
17776 printf("Hello");
17777   ;
17778   return 0;
17779 }
17780 _ACEOF
17781 rm -f conftest.$ac_objext conftest$ac_exeext
17782 if { (eval echo "$as_me:17782: \"$ac_link\"") >&5
17783   (eval $ac_link) 2>&5
17784   ac_status=$?
17785   echo "$as_me:17785: \$? = $ac_status" >&5
17786   (exit $ac_status); } &&
17787          { ac_try='test -s conftest$ac_exeext'
17788   { (eval echo "$as_me:17788: \"$ac_try\"") >&5
17789   (eval $ac_try) 2>&5
17790   ac_status=$?
17791   echo "$as_me:17791: \$? = $ac_status" >&5
17792   (exit $ac_status); }; }; then
17793   cf_rpath_oops=`$cf_ldd_prog conftest$ac_exeext | fgrep ' not found' | sed -e 's% =>.*$%%' |sort | uniq`
17794                  cf_rpath_list=`$cf_ldd_prog conftest$ac_exeext | fgrep / | sed -e 's%^.*[      ]/%/%' -e 's%/[^/][^/]*$%%' |sort | uniq`
17795 else
17796   echo "$as_me: failed program was:" >&5
17797 cat conftest.$ac_ext >&5
17798 fi
17799 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17800
17801                 # If we passed the link-test, but get a "not found" on a given library,
17802                 # this could be due to inept reconfiguration of gcc to make it only
17803                 # partly honor /usr/local/lib (or whatever).  Sometimes this behavior
17804                 # is intentional, e.g., installing gcc in /usr/bin and suppressing the
17805                 # /usr/local libraries.
17806                 if test -n "$cf_rpath_oops"
17807                 then
17808                         for cf_rpath_src in $cf_rpath_oops
17809                         do
17810                                 for cf_rpath_dir in \
17811                                         /usr/local \
17812                                         /usr/pkg \
17813                                         /opt/sfw
17814                                 do
17815                                         if test -f $cf_rpath_dir/lib/$cf_rpath_src
17816                                         then
17817                                                 test -n "$verbose" && echo "    ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src" 1>&6
17818
17819 echo "${as_me:-configure}:17819: testing ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src ..." 1>&5
17820
17821                                                 LDFLAGS="$LDFLAGS -L$cf_rpath_dir/lib"
17822                                                 break
17823                                         fi
17824                                 done
17825                         done
17826                 fi
17827         fi
17828
17829         test -n "$verbose" && echo "    ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
17830
17831 echo "${as_me:-configure}:17831: testing ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
17832
17833 test -n "$verbose" && echo "    ...checking LDFLAGS $LDFLAGS" 1>&6
17834
17835 echo "${as_me:-configure}:17835: testing ...checking LDFLAGS $LDFLAGS ..." 1>&5
17836
17837 cf_rpath_dst=
17838 for cf_rpath_src in $LDFLAGS
17839 do
17840         case $cf_rpath_src in
17841         (-L*)
17842
17843                 # check if this refers to a directory which we will ignore
17844                 cf_rpath_skip=no
17845                 if test -n "$cf_rpath_list"
17846                 then
17847                         for cf_rpath_item in $cf_rpath_list
17848                         do
17849                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
17850                                 then
17851                                         cf_rpath_skip=yes
17852                                         break
17853                                 fi
17854                         done
17855                 fi
17856
17857                 if test "$cf_rpath_skip" = no
17858                 then
17859                         # transform the option
17860                         if test "$LD_RPATH_OPT" = "-R " ; then
17861                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
17862                         else
17863                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
17864                         fi
17865
17866                         # if we have not already added this, add it now
17867                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
17868                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
17869                         then
17870                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
17871
17872 echo "${as_me:-configure}:17872: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
17873
17874                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
17875                         fi
17876                 fi
17877                 ;;
17878         esac
17879         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
17880 done
17881 LDFLAGS=$cf_rpath_dst
17882
17883 test -n "$verbose" && echo "    ...checked LDFLAGS $LDFLAGS" 1>&6
17884
17885 echo "${as_me:-configure}:17885: testing ...checked LDFLAGS $LDFLAGS ..." 1>&5
17886
17887 test -n "$verbose" && echo "    ...checking LIBS $LIBS" 1>&6
17888
17889 echo "${as_me:-configure}:17889: testing ...checking LIBS $LIBS ..." 1>&5
17890
17891 cf_rpath_dst=
17892 for cf_rpath_src in $LIBS
17893 do
17894         case $cf_rpath_src in
17895         (-L*)
17896
17897                 # check if this refers to a directory which we will ignore
17898                 cf_rpath_skip=no
17899                 if test -n "$cf_rpath_list"
17900                 then
17901                         for cf_rpath_item in $cf_rpath_list
17902                         do
17903                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
17904                                 then
17905                                         cf_rpath_skip=yes
17906                                         break
17907                                 fi
17908                         done
17909                 fi
17910
17911                 if test "$cf_rpath_skip" = no
17912                 then
17913                         # transform the option
17914                         if test "$LD_RPATH_OPT" = "-R " ; then
17915                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
17916                         else
17917                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
17918                         fi
17919
17920                         # if we have not already added this, add it now
17921                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
17922                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
17923                         then
17924                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
17925
17926 echo "${as_me:-configure}:17926: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
17927
17928                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
17929                         fi
17930                 fi
17931                 ;;
17932         esac
17933         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
17934 done
17935 LIBS=$cf_rpath_dst
17936
17937 test -n "$verbose" && echo "    ...checked LIBS $LIBS" 1>&6
17938
17939 echo "${as_me:-configure}:17939: testing ...checked LIBS $LIBS ..." 1>&5
17940
17941         test -n "$verbose" && echo "    ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
17942
17943 echo "${as_me:-configure}:17943: testing ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
17944
17945 else
17946         echo "$as_me:17946: result: no" >&5
17947 echo "${ECHO_T}no" >&6
17948 fi
17949
17950 fi
17951
17952 TEST_ARGS="$LIBS"
17953 LIBS=
17954
17955 ac_config_files="$ac_config_files Makefile"
17956 ac_config_commands="$ac_config_commands default"
17957 cat >confcache <<\_ACEOF
17958 # This file is a shell script that caches the results of configure
17959 # tests run on this system so they can be shared between configure
17960 # scripts and configure runs, see configure's option --config-cache.
17961 # It is not useful on other systems.  If it contains results you don't
17962 # want to keep, you may remove or edit it.
17963 #
17964 # config.status only pays attention to the cache file if you give it
17965 # the --recheck option to rerun configure.
17966 #
17967 # `ac_cv_env_foo' variables (set or unset) will be overriden when
17968 # loading this file, other *unset* `ac_cv_foo' will be assigned the
17969 # following values.
17970
17971 _ACEOF
17972
17973 # The following way of writing the cache mishandles newlines in values,
17974 # but we know of no workaround that is simple, portable, and efficient.
17975 # So, don't put newlines in cache variables' values.
17976 # Ultrix sh set writes to stderr and can't be redirected directly,
17977 # and sets the high bit in the cache file unless we assign to the vars.
17978 {
17979   (set) 2>&1 |
17980     case `(ac_space=' '; set | grep ac_space) 2>&1` in
17981     *ac_space=\ *)
17982       # `set' does not quote correctly, so add quotes (double-quote
17983       # substitution turns \\\\ into \\, and sed turns \\ into \).
17984       sed -n \
17985         "s/'/'\\\\''/g;
17986           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
17987       ;;
17988     *)
17989       # `set' quotes correctly as required by POSIX, so do not add quotes.
17990       sed -n \
17991         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
17992       ;;
17993     esac;
17994 } |
17995   sed '
17996      t clear
17997      : clear
17998      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
17999      t end
18000      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
18001      : end' >>confcache
18002 if cmp -s $cache_file confcache; then :; else
18003   if test -w $cache_file; then
18004     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
18005     cat confcache >$cache_file
18006   else
18007     echo "not updating unwritable cache $cache_file"
18008   fi
18009 fi
18010 rm -f confcache
18011
18012 test "x$prefix" = xNONE && prefix=$ac_default_prefix
18013 # Let make expand exec_prefix.
18014 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
18015
18016 # VPATH may cause trouble with some makes, so we remove $(srcdir),
18017 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
18018 # trailing colons and then remove the whole line if VPATH becomes empty
18019 # (actually we leave an empty line to preserve line numbers).
18020 if test "x$srcdir" = x.; then
18021   ac_vpsub='/^[         ]*VPATH[        ]*=/{
18022 s/:*\$(srcdir):*/:/;
18023 s/:*\${srcdir}:*/:/;
18024 s/:*@srcdir@:*/:/;
18025 s/^\([^=]*=[    ]*\):*/\1/;
18026 s/:*$//;
18027 s/^[^=]*=[      ]*$//;
18028 }'
18029 fi
18030
18031 DEFS=-DHAVE_CONFIG_H
18032
18033 : ${CONFIG_STATUS=./config.status}
18034 ac_clean_files_save=$ac_clean_files
18035 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
18036 { echo "$as_me:18036: creating $CONFIG_STATUS" >&5
18037 echo "$as_me: creating $CONFIG_STATUS" >&6;}
18038 cat >$CONFIG_STATUS <<_ACEOF
18039 #! $SHELL
18040 # Generated automatically by configure.
18041 # Run this file to recreate the current configuration.
18042 # Compiler output produced by configure, useful for debugging
18043 # configure, is in config.log if it exists.
18044
18045 debug=false
18046 SHELL=\${CONFIG_SHELL-$SHELL}
18047 ac_cs_invocation="\$0 \$@"
18048
18049 _ACEOF
18050
18051 cat >>$CONFIG_STATUS <<\_ACEOF
18052 # Be Bourne compatible
18053 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
18054   emulate sh
18055   NULLCMD=:
18056 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
18057   set -o posix
18058 fi
18059
18060 # Name of the executable.
18061 as_me=`echo "$0" |sed 's,.*[\\/],,'`
18062
18063 if expr a : '\(a\)' >/dev/null 2>&1; then
18064   as_expr=expr
18065 else
18066   as_expr=false
18067 fi
18068
18069 rm -f conf$$ conf$$.exe conf$$.file
18070 echo >conf$$.file
18071 if ln -s conf$$.file conf$$ 2>/dev/null; then
18072   # We could just check for DJGPP; but this test a) works b) is more generic
18073   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
18074   if test -f conf$$.exe; then
18075     # Don't use ln at all; we don't have any links
18076     as_ln_s='cp -p'
18077   else
18078     as_ln_s='ln -s'
18079   fi
18080 elif ln conf$$.file conf$$ 2>/dev/null; then
18081   as_ln_s=ln
18082 else
18083   as_ln_s='cp -p'
18084 fi
18085 rm -f conf$$ conf$$.exe conf$$.file
18086
18087 as_executable_p="test -f"
18088
18089 # Support unset when possible.
18090 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
18091   as_unset=unset
18092 else
18093   as_unset=false
18094 fi
18095
18096 # NLS nuisances.
18097 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
18098 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
18099 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
18100 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
18101 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
18102 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
18103 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
18104 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
18105
18106 # IFS
18107 # We need space, tab and new line, in precisely that order.
18108 as_nl='
18109 '
18110 IFS="   $as_nl"
18111
18112 # CDPATH.
18113 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
18114
18115 exec 6>&1
18116
18117 _ACEOF
18118
18119 # Files that config.status was made for.
18120 if test -n "$ac_config_files"; then
18121   echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
18122 fi
18123
18124 if test -n "$ac_config_headers"; then
18125   echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
18126 fi
18127
18128 if test -n "$ac_config_links"; then
18129   echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
18130 fi
18131
18132 if test -n "$ac_config_commands"; then
18133   echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
18134 fi
18135
18136 cat >>$CONFIG_STATUS <<\EOF
18137
18138 ac_cs_usage="\
18139 \`$as_me' instantiates files from templates according to the
18140 current configuration.
18141
18142 Usage: $0 [OPTIONS] [FILE]...
18143
18144   -h, --help       print this help, then exit
18145   -V, --version    print version number, then exit
18146   -d, --debug      don't remove temporary files
18147       --recheck    update $as_me by reconfiguring in the same conditions
18148   --file=FILE[:TEMPLATE]
18149                    instantiate the configuration file FILE
18150   --header=FILE[:TEMPLATE]
18151                    instantiate the configuration header FILE
18152
18153 Configuration files:
18154 $config_files
18155
18156 Configuration headers:
18157 $config_headers
18158
18159 Configuration commands:
18160 $config_commands
18161
18162 Report bugs to <dickey@invisible-island.net>."
18163 EOF
18164
18165 cat >>$CONFIG_STATUS <<EOF
18166 ac_cs_version="\\
18167 config.status
18168 configured by $0, generated by GNU Autoconf 2.52.20150926,
18169   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
18170
18171 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
18172 Free Software Foundation, Inc.
18173 This config.status script is free software; the Free Software Foundation
18174 gives unlimited permission to copy, distribute and modify it."
18175 srcdir=$srcdir
18176 INSTALL="$INSTALL"
18177 EOF
18178
18179 cat >>$CONFIG_STATUS <<\EOF
18180 # If no file are specified by the user, then we need to provide default
18181 # value.  By we need to know if files were specified by the user.
18182 ac_need_defaults=:
18183 while test $# != 0
18184 do
18185   case $1 in
18186   --*=*)
18187     ac_option=`expr "x$1" : 'x\([^=]*\)='`
18188     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
18189     shift
18190     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
18191     shift
18192     ;;
18193   -*);;
18194   *) # This is not an option, so the user has probably given explicit
18195      # arguments.
18196      ac_need_defaults=false;;
18197   esac
18198
18199   case $1 in
18200   # Handling of the options.
18201 EOF
18202 cat >>$CONFIG_STATUS <<EOF
18203   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
18204     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
18205     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
18206 EOF
18207 cat >>$CONFIG_STATUS <<\EOF
18208   --version | --vers* | -V )
18209     echo "$ac_cs_version"; exit 0 ;;
18210   --he | --h)
18211     # Conflict between --help and --header
18212     { { echo "$as_me:18212: error: ambiguous option: $1
18213 Try \`$0 --help' for more information." >&5
18214 echo "$as_me: error: ambiguous option: $1
18215 Try \`$0 --help' for more information." >&2;}
18216    { (exit 1); exit 1; }; };;
18217   --help | --hel | -h )
18218     echo "$ac_cs_usage"; exit 0 ;;
18219   --debug | --d* | -d )
18220     debug=: ;;
18221   --file | --fil | --fi | --f )
18222     shift
18223     CONFIG_FILES="$CONFIG_FILES $1"
18224     ac_need_defaults=false;;
18225   --header | --heade | --head | --hea )
18226     shift
18227     CONFIG_HEADERS="$CONFIG_HEADERS $1"
18228     ac_need_defaults=false;;
18229
18230   # This is an error.
18231   -*) { { echo "$as_me:18231: error: unrecognized option: $1
18232 Try \`$0 --help' for more information." >&5
18233 echo "$as_me: error: unrecognized option: $1
18234 Try \`$0 --help' for more information." >&2;}
18235    { (exit 1); exit 1; }; } ;;
18236
18237   *) ac_config_targets="$ac_config_targets $1" ;;
18238
18239   esac
18240   shift
18241 done
18242
18243 exec 5>>config.log
18244 cat >&5 << _ACEOF
18245
18246 ## ----------------------- ##
18247 ## Running config.status.  ##
18248 ## ----------------------- ##
18249
18250 This file was extended by $as_me 2.52.20150926, executed with
18251   CONFIG_FILES    = $CONFIG_FILES
18252   CONFIG_HEADERS  = $CONFIG_HEADERS
18253   CONFIG_LINKS    = $CONFIG_LINKS
18254   CONFIG_COMMANDS = $CONFIG_COMMANDS
18255   > $ac_cs_invocation
18256 on `(hostname || uname -n) 2>/dev/null | sed 1q`
18257
18258 _ACEOF
18259 EOF
18260
18261 cat >>$CONFIG_STATUS <<EOF
18262 #
18263 # INIT-COMMANDS section.
18264 #
18265
18266 AWK="$AWK"
18267 ECHO_CC="$ECHO_CC"
18268 ECHO_LD="$ECHO_LD"
18269 SHOW_CC="$SHOW_LD"
18270
18271 EOF
18272
18273 cat >>$CONFIG_STATUS <<\EOF
18274 for ac_config_target in $ac_config_targets
18275 do
18276   case "$ac_config_target" in
18277   # Handling of arguments.
18278   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
18279   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
18280   "ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS ncurses_cfg.h:ncurses_tst.hin" ;;
18281   *) { { echo "$as_me:18281: error: invalid argument: $ac_config_target" >&5
18282 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
18283    { (exit 1); exit 1; }; };;
18284   esac
18285 done
18286
18287 # If the user did not use the arguments to specify the items to instantiate,
18288 # then the envvar interface is used.  Set only those that are not.
18289 # We use the long form for the default assignment because of an extremely
18290 # bizarre bug on SunOS 4.1.3.
18291 if $ac_need_defaults; then
18292   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
18293   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
18294   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
18295 fi
18296
18297 # Create a temporary directory, and hook for its removal unless debugging.
18298 $debug ||
18299 {
18300   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
18301   trap '{ (exit 1); exit 1; }' 1 2 13 15
18302 }
18303
18304 # Create a (secure) tmp directory for tmp files.
18305 : ${TMPDIR=/tmp}
18306 {
18307   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
18308   test -n "$tmp" && test -d "$tmp"
18309 }  ||
18310 {
18311   tmp=$TMPDIR/cs$$-$RANDOM
18312   (umask 077 && mkdir $tmp)
18313 } ||
18314 {
18315    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
18316    { (exit 1); exit 1; }
18317 }
18318
18319 EOF
18320
18321 cat >>$CONFIG_STATUS <<EOF
18322
18323 #
18324 # CONFIG_FILES section.
18325 #
18326
18327 # No need to generate the scripts if there are no CONFIG_FILES.
18328 # This happens for instance when ./config.status config.h
18329 if test -n "\$CONFIG_FILES"; then
18330   # Protect against being on the right side of a sed subst in config.status.
18331   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
18332    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
18333 s,@SHELL@,$SHELL,;t t
18334 s,@exec_prefix@,$exec_prefix,;t t
18335 s,@prefix@,$prefix,;t t
18336 s,@program_transform_name@,$program_transform_name,;t t
18337 s,@bindir@,$bindir,;t t
18338 s,@sbindir@,$sbindir,;t t
18339 s,@libexecdir@,$libexecdir,;t t
18340 s,@datarootdir@,$datarootdir,;t t
18341 s,@datadir@,$datadir,;t t
18342 s,@sysconfdir@,$sysconfdir,;t t
18343 s,@sharedstatedir@,$sharedstatedir,;t t
18344 s,@localstatedir@,$localstatedir,;t t
18345 s,@libdir@,$libdir,;t t
18346 s,@includedir@,$includedir,;t t
18347 s,@oldincludedir@,$oldincludedir,;t t
18348 s,@infodir@,$infodir,;t t
18349 s,@mandir@,$mandir,;t t
18350 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
18351 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
18352 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
18353 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
18354 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
18355 s,@build_alias@,$build_alias,;t t
18356 s,@host_alias@,$host_alias,;t t
18357 s,@target_alias@,$target_alias,;t t
18358 s,@ECHO_C@,$ECHO_C,;t t
18359 s,@ECHO_N@,$ECHO_N,;t t
18360 s,@ECHO_T@,$ECHO_T,;t t
18361 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
18362 s,@DEFS@,$DEFS,;t t
18363 s,@LIBS@,$LIBS,;t t
18364 s,@build@,$build,;t t
18365 s,@build_cpu@,$build_cpu,;t t
18366 s,@build_vendor@,$build_vendor,;t t
18367 s,@build_os@,$build_os,;t t
18368 s,@host@,$host,;t t
18369 s,@host_cpu@,$host_cpu,;t t
18370 s,@host_vendor@,$host_vendor,;t t
18371 s,@host_os@,$host_os,;t t
18372 s,@SET_MAKE@,$SET_MAKE,;t t
18373 s,@CC@,$CC,;t t
18374 s,@CFLAGS@,$CFLAGS,;t t
18375 s,@LDFLAGS@,$LDFLAGS,;t t
18376 s,@CPPFLAGS@,$CPPFLAGS,;t t
18377 s,@ac_ct_CC@,$ac_ct_CC,;t t
18378 s,@EXEEXT@,$EXEEXT,;t t
18379 s,@OBJEXT@,$OBJEXT,;t t
18380 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
18381 s,@CPP@,$CPP,;t t
18382 s,@AWK@,$AWK,;t t
18383 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
18384 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
18385 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
18386 s,@LINT@,$LINT,;t t
18387 s,@LINT_OPTS@,$LINT_OPTS,;t t
18388 s,@CTAGS@,$CTAGS,;t t
18389 s,@ETAGS@,$ETAGS,;t t
18390 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
18391 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
18392 s,@MATH_LIB@,$MATH_LIB,;t t
18393 s,@top_builddir@,$top_builddir,;t t
18394 s,@CC_G_OPT@,$CC_G_OPT,;t t
18395 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
18396 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
18397 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
18398 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
18399 s,@LD@,$LD,;t t
18400 s,@LDFLAGS_SHARED@,$LDFLAGS_SHARED,;t t
18401 s,@LDFLAGS_STATIC@,$LDFLAGS_STATIC,;t t
18402 s,@LD_MODEL@,$LD_MODEL,;t t
18403 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
18404 s,@LIBTOOL@,$LIBTOOL,;t t
18405 s,@LIBTOOL_OPTS@,$LIBTOOL_OPTS,;t t
18406 s,@LIB_CLEAN@,$LIB_CLEAN,;t t
18407 s,@LIB_COMPILE@,$LIB_COMPILE,;t t
18408 s,@LIB_LINK@,$LIB_LINK,;t t
18409 s,@LINK_TESTS@,$LINK_TESTS,;t t
18410 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
18411 s,@PACKAGE@,$PACKAGE,;t t
18412 s,@PTHREAD@,$PTHREAD,;t t
18413 s,@TEST_ARGS@,$TEST_ARGS,;t t
18414 s,@TEST_DEPS@,$TEST_DEPS,;t t
18415 s,@TEST_LIBS@,$TEST_LIBS,;t t
18416 s,@TINFO_LDFLAGS@,$TINFO_LDFLAGS,;t t
18417 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
18418 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
18419 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
18420 s,@includesubdir@,$includesubdir,;t t
18421 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
18422 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
18423 s,@ECHO_LT@,$ECHO_LT,;t t
18424 s,@ECHO_LD@,$ECHO_LD,;t t
18425 s,@RULE_CC@,$RULE_CC,;t t
18426 s,@SHOW_CC@,$SHOW_CC,;t t
18427 s,@ECHO_CC@,$ECHO_CC,;t t
18428 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
18429 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
18430 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
18431 s,@X_CFLAGS@,$X_CFLAGS,;t t
18432 s,@X_PRE_LIBS@,$X_PRE_LIBS,;t t
18433 s,@X_LIBS@,$X_LIBS,;t t
18434 s,@X_EXTRA_LIBS@,$X_EXTRA_LIBS,;t t
18435 s,@XCURSES_CONFIG@,$XCURSES_CONFIG,;t t
18436 s,@ac_ct_XCURSES_CONFIG@,$ac_ct_XCURSES_CONFIG,;t t
18437 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
18438 s,@cf_ldd_prog@,$cf_ldd_prog,;t t
18439 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
18440 CEOF
18441
18442 EOF
18443
18444   cat >>$CONFIG_STATUS <<\EOF
18445   # Split the substitutions into bite-sized pieces for seds with
18446   # small command number limits, like on Digital OSF/1 and HP-UX.
18447   ac_max_sed_lines=48
18448   ac_sed_frag=1 # Number of current file.
18449   ac_beg=1 # First line for current file.
18450   ac_end=$ac_max_sed_lines # Line after last line for current file.
18451   ac_more_lines=:
18452   ac_sed_cmds=
18453   while $ac_more_lines; do
18454     if test $ac_beg -gt 1; then
18455       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
18456     else
18457       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
18458     fi
18459     if test ! -s $tmp/subs.frag; then
18460       ac_more_lines=false
18461     else
18462       # The purpose of the label and of the branching condition is to
18463       # speed up the sed processing (if there are no `@' at all, there
18464       # is no need to browse any of the substitutions).
18465       # These are the two extra sed commands mentioned above.
18466       (echo ':t
18467   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
18468       # It is possible to make a multiline substitution using escaped newlines.
18469       # Ensure that we do not split the substitution between script fragments.
18470       ac_BEG=$ac_end
18471       ac_END=`expr $ac_end + $ac_max_sed_lines`
18472       sed "1,${ac_BEG}d; ${ac_END}p; q" $tmp/subs.sed >$tmp/subs.next
18473       if test -s $tmp/subs.next; then
18474         grep '^s,@[^@,][^@,]*@,.*\\$' $tmp/subs.next >$tmp/subs.edit
18475         if test ! -s $tmp/subs.edit; then
18476           grep "^s,@[^@,][^@,]*@,.*,;t t$" $tmp/subs.next >$tmp/subs.edit
18477           if test ! -s $tmp/subs.edit; then
18478             if test $ac_beg -gt 1; then
18479               ac_end=`expr $ac_end - 1`
18480               continue
18481             fi
18482           fi
18483         fi
18484       fi
18485
18486       if test -z "$ac_sed_cmds"; then
18487         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
18488       else
18489         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
18490       fi
18491       ac_sed_frag=`expr $ac_sed_frag + 1`
18492       ac_beg=$ac_end
18493       ac_end=`expr $ac_end + $ac_max_sed_lines`
18494     fi
18495   done
18496   if test -z "$ac_sed_cmds"; then
18497     ac_sed_cmds=cat
18498   fi
18499 fi # test -n "$CONFIG_FILES"
18500
18501 EOF
18502 cat >>$CONFIG_STATUS <<\EOF
18503 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
18504   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
18505   case $ac_file in
18506   - | *:- | *:-:* ) # input from stdin
18507         cat >$tmp/stdin
18508         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
18509         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
18510   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
18511         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
18512   * )   ac_file_in=$ac_file.in ;;
18513   esac
18514
18515   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
18516   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
18517          X"$ac_file" : 'X\(//\)[^/]' \| \
18518          X"$ac_file" : 'X\(//\)$' \| \
18519          X"$ac_file" : 'X\(/\)' \| \
18520          .     : '\(.\)' 2>/dev/null ||
18521 echo X"$ac_file" |
18522     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
18523           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
18524           /^X\(\/\/\)$/{ s//\1/; q; }
18525           /^X\(\/\).*/{ s//\1/; q; }
18526           s/.*/./; q'`
18527   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
18528     { case "$ac_dir" in
18529   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
18530   *)                      as_incr_dir=.;;
18531 esac
18532 as_dummy="$ac_dir"
18533 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
18534   case $as_mkdir_dir in
18535     # Skip DOS drivespec
18536     ?:) as_incr_dir=$as_mkdir_dir ;;
18537     *)
18538       as_incr_dir=$as_incr_dir/$as_mkdir_dir
18539       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
18540     ;;
18541   esac
18542 done; }
18543
18544     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
18545     # A "../" for each directory in $ac_dir_suffix.
18546     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
18547   else
18548     ac_dir_suffix= ac_dots=
18549   fi
18550
18551   case $srcdir in
18552   .)  ac_srcdir=.
18553       if test -z "$ac_dots"; then
18554          ac_top_srcdir=.
18555       else
18556          ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'`
18557       fi ;;
18558   [\\/]* | ?:[\\/]* )
18559       ac_srcdir=$srcdir$ac_dir_suffix;
18560       ac_top_srcdir=$srcdir ;;
18561   *) # Relative path.
18562     ac_srcdir=$ac_dots$srcdir$ac_dir_suffix
18563     ac_top_srcdir=$ac_dots$srcdir ;;
18564   esac
18565
18566   case $INSTALL in
18567   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
18568   *) ac_INSTALL=$ac_dots$INSTALL ;;
18569   esac
18570
18571   if test x"$ac_file" != x-; then
18572     { echo "$as_me:18572: creating $ac_file" >&5
18573 echo "$as_me: creating $ac_file" >&6;}
18574     rm -f "$ac_file"
18575   fi
18576   # Let's still pretend it is `configure' which instantiates (i.e., don't
18577   # use $as_me), people would be surprised to read:
18578   #    /* config.h.  Generated automatically by config.status.  */
18579   configure_input="Generated automatically from `echo $ac_file_in |
18580                                                  sed 's,.*/,,'` by configure."
18581
18582   # First look for the input files in the build tree, otherwise in the
18583   # src tree.
18584   ac_file_inputs=`IFS=:
18585     for f in $ac_file_in; do
18586       case $f in
18587       -) echo $tmp/stdin ;;
18588       [\\/$]*)
18589          # Absolute (can't be DOS-style, as IFS=:)
18590          test -f "$f" || { { echo "$as_me:18590: error: cannot find input file: $f" >&5
18591 echo "$as_me: error: cannot find input file: $f" >&2;}
18592    { (exit 1); exit 1; }; }
18593          echo $f;;
18594       *) # Relative
18595          if test -f "$f"; then
18596            # Build tree
18597            echo $f
18598          elif test -f "$srcdir/$f"; then
18599            # Source tree
18600            echo $srcdir/$f
18601          else
18602            # /dev/null tree
18603            { { echo "$as_me:18603: error: cannot find input file: $f" >&5
18604 echo "$as_me: error: cannot find input file: $f" >&2;}
18605    { (exit 1); exit 1; }; }
18606          fi;;
18607       esac
18608     done` || { (exit 1); exit 1; }
18609 EOF
18610 cat >>$CONFIG_STATUS <<\EOF
18611   ac_warn_datarootdir=no
18612   if test x"$ac_file" != x-; then
18613     for ac_item in $ac_file_inputs
18614     do
18615       ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' $ac_item`
18616       if test -n "$ac_seen"; then
18617         ac_used=`grep '@datarootdir@' $ac_item`
18618         if test -z "$ac_used"; then
18619           { echo "$as_me:18619: WARNING: datarootdir was used implicitly but not set:
18620 $ac_seen" >&5
18621 echo "$as_me: WARNING: datarootdir was used implicitly but not set:
18622 $ac_seen" >&2;}
18623           ac_warn_datarootdir=yes
18624         fi
18625       fi
18626       ac_seen=`grep '${datarootdir}' $ac_item`
18627       if test -n "$ac_seen"; then
18628         { echo "$as_me:18628: WARNING: datarootdir was used explicitly but not set:
18629 $ac_seen" >&5
18630 echo "$as_me: WARNING: datarootdir was used explicitly but not set:
18631 $ac_seen" >&2;}
18632         ac_warn_datarootdir=yes
18633       fi
18634     done
18635   fi
18636
18637 if test "x$ac_warn_datarootdir" = xyes; then
18638   ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
18639 fi
18640
18641 EOF
18642 cat >>$CONFIG_STATUS <<EOF
18643   sed "$ac_vpsub
18644 $extrasub
18645 EOF
18646 cat >>$CONFIG_STATUS <<\EOF
18647 :t
18648 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
18649 s,@configure_input@,$configure_input,;t t
18650 s,@srcdir@,$ac_srcdir,;t t
18651 s,@top_srcdir@,$ac_top_srcdir,;t t
18652 s,@INSTALL@,$ac_INSTALL,;t t
18653 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
18654   rm -f $tmp/stdin
18655   if test x"$ac_file" != x-; then
18656     cp $tmp/out $ac_file
18657
18658     for ac_name in prefix exec_prefix datarootdir
18659     do
18660         ac_seen=`fgrep -n '${'$ac_name'[:=].*}' $ac_file`
18661         if test -n "$ac_seen"; then
18662             ac_init=`egrep '[   ]*'$ac_name'[   ]*=' $ac_file`
18663             if test -z "$ac_init"; then
18664               ac_seen=`echo "$ac_seen" |sed -e 's,^,'$ac_file':,'`
18665               { echo "$as_me:18665: WARNING: Variable $ac_name is used but was not set:
18666 $ac_seen" >&5
18667 echo "$as_me: WARNING: Variable $ac_name is used but was not set:
18668 $ac_seen" >&2;}
18669             fi
18670         fi
18671     done
18672     egrep -n '@[a-z_][a-z_0-9]+@' $ac_file >$tmp/out
18673     egrep -n '@[A-Z_][A-Z_0-9]+@' $ac_file >>$tmp/out
18674     if test -s $tmp/out; then
18675       ac_seen=`sed -e 's,^,'$ac_file':,' < $tmp/out`
18676       { echo "$as_me:18676: WARNING: Some variables may not be substituted:
18677 $ac_seen" >&5
18678 echo "$as_me: WARNING: Some variables may not be substituted:
18679 $ac_seen" >&2;}
18680     fi
18681   else
18682     cat $tmp/out
18683   fi
18684   rm -f $tmp/out
18685
18686 done
18687 EOF
18688 cat >>$CONFIG_STATUS <<\EOF
18689
18690 #
18691 # CONFIG_HEADER section.
18692 #
18693
18694 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
18695 # NAME is the cpp macro being defined and VALUE is the value it is being given.
18696 #
18697 # ac_d sets the value in "#define NAME VALUE" lines.
18698 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
18699 ac_dB='[        ].*$,\1#\2'
18700 ac_dC=' '
18701 ac_dD=',;t'
18702 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
18703 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
18704 ac_iB='\([      ]\),\1#\2define\3'
18705 ac_iC=' '
18706 ac_iD='\4,;t'
18707 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
18708 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
18709 ac_uB='$,\1#\2define\3'
18710 ac_uC=' '
18711 ac_uD=',;t'
18712
18713 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
18714   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
18715   case $ac_file in
18716   - | *:- | *:-:* ) # input from stdin
18717         cat >$tmp/stdin
18718         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
18719         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
18720   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
18721         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
18722   * )   ac_file_in=$ac_file.in ;;
18723   esac
18724
18725   test x"$ac_file" != x- && { echo "$as_me:18725: creating $ac_file" >&5
18726 echo "$as_me: creating $ac_file" >&6;}
18727
18728   # First look for the input files in the build tree, otherwise in the
18729   # src tree.
18730   ac_file_inputs=`IFS=:
18731     for f in $ac_file_in; do
18732       case $f in
18733       -) echo $tmp/stdin ;;
18734       [\\/$]*)
18735          # Absolute (can't be DOS-style, as IFS=:)
18736          test -f "$f" || { { echo "$as_me:18736: error: cannot find input file: $f" >&5
18737 echo "$as_me: error: cannot find input file: $f" >&2;}
18738    { (exit 1); exit 1; }; }
18739          echo $f;;
18740       *) # Relative
18741          if test -f "$f"; then
18742            # Build tree
18743            echo $f
18744          elif test -f "$srcdir/$f"; then
18745            # Source tree
18746            echo $srcdir/$f
18747          else
18748            # /dev/null tree
18749            { { echo "$as_me:18749: error: cannot find input file: $f" >&5
18750 echo "$as_me: error: cannot find input file: $f" >&2;}
18751    { (exit 1); exit 1; }; }
18752          fi;;
18753       esac
18754     done` || { (exit 1); exit 1; }
18755   # Remove the trailing spaces.
18756   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
18757
18758 EOF
18759
18760 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
18761 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
18762 # be either 'cat' or 'sort'.
18763 cat confdefs.h | uniq >conftest.vals
18764
18765 # Break up conftest.vals because some shells have a limit on
18766 # the size of here documents, and old seds have small limits too.
18767
18768 rm -f conftest.tail
18769 echo '  rm -f conftest.frag' >> $CONFIG_STATUS
18770 while grep . conftest.vals >/dev/null
18771 do
18772   # Write chunks of a limited-size here document to conftest.frag.
18773   echo '  cat >> conftest.frag <<CEOF' >> $CONFIG_STATUS
18774   sed ${ac_max_here_lines}q conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> $CONFIG_STATUS
18775   echo 'CEOF' >> $CONFIG_STATUS
18776   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
18777   rm -f conftest.vals
18778   mv conftest.tail conftest.vals
18779 done
18780 rm -f conftest.vals
18781
18782 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
18783 # marker @DEFS@.
18784 echo '  cat >> conftest.edit <<CEOF
18785 /@DEFS@/r conftest.frag
18786 /@DEFS@/d
18787 CEOF
18788 sed -f conftest.edit $tmp/in > $tmp/out
18789 rm -f $tmp/in
18790 mv $tmp/out $tmp/in
18791 rm -f conftest.edit conftest.frag
18792 ' >> $CONFIG_STATUS
18793
18794 cat >>$CONFIG_STATUS <<\EOF
18795   # Let's still pretend it is `configure' which instantiates (i.e., don't
18796   # use $as_me), people would be surprised to read:
18797   #    /* config.h.  Generated automatically by config.status.  */
18798   if test x"$ac_file" = x-; then
18799     echo "/* Generated automatically by configure.  */" >$tmp/config.h
18800   else
18801     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
18802   fi
18803   cat $tmp/in >>$tmp/config.h
18804   rm -f $tmp/in
18805   if test x"$ac_file" != x-; then
18806     if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
18807       { echo "$as_me:18807: $ac_file is unchanged" >&5
18808 echo "$as_me: $ac_file is unchanged" >&6;}
18809     else
18810       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
18811          X"$ac_file" : 'X\(//\)[^/]' \| \
18812          X"$ac_file" : 'X\(//\)$' \| \
18813          X"$ac_file" : 'X\(/\)' \| \
18814          .     : '\(.\)' 2>/dev/null ||
18815 echo X"$ac_file" |
18816     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
18817           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
18818           /^X\(\/\/\)$/{ s//\1/; q; }
18819           /^X\(\/\).*/{ s//\1/; q; }
18820           s/.*/./; q'`
18821       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
18822         { case "$ac_dir" in
18823   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
18824   *)                      as_incr_dir=.;;
18825 esac
18826 as_dummy="$ac_dir"
18827 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
18828   case $as_mkdir_dir in
18829     # Skip DOS drivespec
18830     ?:) as_incr_dir=$as_mkdir_dir ;;
18831     *)
18832       as_incr_dir=$as_incr_dir/$as_mkdir_dir
18833       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
18834     ;;
18835   esac
18836 done; }
18837
18838       fi
18839       rm -f $ac_file
18840       mv $tmp/config.h $ac_file
18841     fi
18842   else
18843     cat $tmp/config.h
18844     rm -f $tmp/config.h
18845   fi
18846 done
18847 EOF
18848 cat >>$CONFIG_STATUS <<\EOF
18849 #
18850 # CONFIG_COMMANDS section.
18851 #
18852 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
18853   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
18854   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
18855
18856   case $ac_dest in
18857     default )
18858
18859 for cf_dir in .
18860 do
18861         if test ! -d $srcdir/$cf_dir; then
18862                 continue
18863         elif test -f $srcdir/$cf_dir/programs; then
18864                 $AWK -f $srcdir/mk-test.awk INSTALL=yes ECHO_LINK="$ECHO_LD" $srcdir/$cf_dir/programs >>$cf_dir/Makefile
18865         fi
18866 done
18867
18868         cat >>Makefile <<TEST_EOF
18869
18870 # These rules are generated so we do not rely on suffix rules, which do not
18871 # work consistently for different make-programs (the '\$(MODEL)/' confuses
18872 # some, and the '\$x' confuses others).
18873 TEST_EOF
18874
18875 LIST=`sed -e 's/[       ].*//' -e '/^[#@]/d' $srcdir/modules`
18876 for N in $LIST
18877 do
18878         cat >>Makefile <<TEST_EOF
18879
18880 \$(MODEL)/$N.o : \$(srcdir)/$N.c \\
18881         \$(srcdir)/test.priv.h \\
18882         ncurses_cfg.h
18883         $SHOW_CC
18884         $ECHO_CC\$(CC) -c \$(CFLAGS_DEFAULT) \$(srcdir)/$N.c
18885 TEST_EOF
18886 done
18887
18888 if test -f ../config.guess && test -f ../config.sub
18889 then
18890         cat >>Makefile <<TEST_EOF
18891
18892 # if we used CF_INHERIT for getting these files, we can remove them
18893 distclean::
18894         rm -f config.guess config.sub
18895 TEST_EOF
18896 fi
18897  ;;
18898   esac
18899 done
18900 EOF
18901
18902 cat >>$CONFIG_STATUS <<\EOF
18903
18904 { (exit 0); exit 0; }
18905 EOF
18906 chmod +x $CONFIG_STATUS
18907 ac_clean_files=$ac_clean_files_save
18908
18909 # configure is writing to config.log, and then calls config.status.
18910 # config.status does its own redirection, appending to config.log.
18911 # Unfortunately, on DOS this fails, as config.log is still kept open
18912 # by configure, so config.status won't be able to write to it; its
18913 # output is simply discarded.  So we exec the FD to /dev/null,
18914 # effectively closing config.log, so it can be properly (re)opened and
18915 # appended to by config.status.  When coming back to configure, we
18916 # need to make the FD available again.
18917 if test "$no_create" != yes; then
18918   ac_cs_success=:
18919   exec 5>/dev/null
18920   $SHELL $CONFIG_STATUS || ac_cs_success=false
18921   exec 5>>config.log
18922   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
18923   # would make configure fail if this is the last instruction.
18924   $ac_cs_success || { (exit 1); exit 1; }
18925 fi
18926