]> ncurses.scripts.mit.edu Git - ncurses.git/blob - test/configure
ncurses 6.0 - patch 20160806
[ncurses.git] / test / configure
1 #! /bin/sh
2 # Guess values for system-dependent variables and create Makefiles.
3 # Generated by Autoconf 2.52.20150926.
4 #
5 # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
6 # Free Software Foundation, Inc.
7 # This configure script is free software; the Free Software Foundation
8 # gives unlimited permission to copy, distribute and modify it.
9
10 # Avoid depending upon Character Ranges.
11 as_cr_letters='abcdefghijklmnopqrstuvwxyz'
12 as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
13 as_cr_Letters=$as_cr_letters$as_cr_LETTERS
14 as_cr_digits='0123456789'
15 as_cr_alnum=$as_cr_Letters$as_cr_digits
16
17 # Sed expression to map a string onto a valid variable name.
18 as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
19
20 # Sed expression to map a string onto a valid CPP name.
21 as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
22
23 # Be Bourne compatible
24 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
25   emulate sh
26   NULLCMD=:
27 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
28   set -o posix
29 fi
30
31 # Name of the executable.
32 as_me=`echo "$0" |sed 's,.*[\\/],,'`
33
34 if expr a : '\(a\)' >/dev/null 2>&1; then
35   as_expr=expr
36 else
37   as_expr=false
38 fi
39
40 rm -f conf$$ conf$$.exe conf$$.file
41 echo >conf$$.file
42 if ln -s conf$$.file conf$$ 2>/dev/null; then
43   # We could just check for DJGPP; but this test a) works b) is more generic
44   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
45   if test -f conf$$.exe; then
46     # Don't use ln at all; we don't have any links
47     as_ln_s='cp -p'
48   else
49     as_ln_s='ln -s'
50   fi
51 elif ln conf$$.file conf$$ 2>/dev/null; then
52   as_ln_s=ln
53 else
54   as_ln_s='cp -p'
55 fi
56 rm -f conf$$ conf$$.exe conf$$.file
57
58 as_executable_p="test -f"
59
60 # Support unset when possible.
61 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
62   as_unset=unset
63 else
64   as_unset=false
65 fi
66
67 # NLS nuisances.
68 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
69 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
70 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
71 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
72 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
73 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
74 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
75 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
76
77 # IFS
78 # We need space, tab and new line, in precisely that order.
79 as_nl='
80 '
81 IFS="   $as_nl"
82
83 # CDPATH.
84 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
85
86 # Name of the host.
87 # hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
88 # so uname gets run too.
89 ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
90
91 exec 6>&1
92
93 #
94 # Initializations.
95 #
96 ac_default_prefix=/usr/local
97 cross_compiling=no
98 subdirs=
99 MFLAGS= MAKEFLAGS=
100 SHELL=${CONFIG_SHELL-/bin/sh}
101
102 # Maximum number of lines to put in a shell here document.
103 # This variable seems obsolete.  It should probably be removed, and
104 # only ac_max_sed_lines should be used.
105 : ${ac_max_here_lines=38}
106
107 ac_unique_file="ncurses.c"
108
109 # Initialize some variables set by options.
110 ac_init_help=
111 ac_init_version=false
112 # The variables have the same names as the options, with
113 # dashes changed to underlines.
114 cache_file=/dev/null
115 exec_prefix=NONE
116 no_create=
117 no_recursion=
118 prefix=NONE
119 program_prefix=NONE
120 program_suffix=NONE
121 program_transform_name=s,x,x,
122 silent=
123 site=
124 srcdir=
125 verbose=
126 x_includes=NONE
127 x_libraries=NONE
128
129 # Installation directory options.
130 # These are left unexpanded so users can "make install exec_prefix=/foo"
131 # and all the variables that are supposed to be based on exec_prefix
132 # by default will actually change.
133 # Use braces instead of parens because sh, perl, etc. also accept them.
134 bindir='${exec_prefix}/bin'
135 sbindir='${exec_prefix}/sbin'
136 libexecdir='${exec_prefix}/libexec'
137 datarootdir='${prefix}/share'
138 datadir='${datarootdir}'
139 sysconfdir='${prefix}/etc'
140 sharedstatedir='${prefix}/com'
141 localstatedir='${prefix}/var'
142 libdir='${exec_prefix}/lib'
143 includedir='${prefix}/include'
144 oldincludedir='/usr/include'
145 infodir='${datarootdir}/info'
146 mandir='${datarootdir}/man'
147
148 # Identity of this package.
149 PACKAGE_NAME=
150 PACKAGE_TARNAME=
151 PACKAGE_VERSION=
152 PACKAGE_STRING=
153 PACKAGE_BUGREPORT=
154
155 ac_prev=
156 for ac_option
157 do
158   # If the previous option needs an argument, assign it.
159   if test -n "$ac_prev"; then
160     eval "$ac_prev=\$ac_option"
161     ac_prev=
162     continue
163   fi
164
165   ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
166
167   # Accept the important Cygnus configure options, so we can diagnose typos.
168
169   case $ac_option in
170
171   -bindir | --bindir | --bindi | --bind | --bin | --bi)
172     ac_prev=bindir ;;
173   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
174     bindir=$ac_optarg ;;
175
176   -build | --build | --buil | --bui | --bu)
177     ac_prev=build_alias ;;
178   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
179     build_alias=$ac_optarg ;;
180
181   -cache-file | --cache-file | --cache-fil | --cache-fi \
182   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
183     ac_prev=cache_file ;;
184   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
185   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
186     cache_file=$ac_optarg ;;
187
188   --config-cache | -C)
189     cache_file=config.cache ;;
190
191   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
192     ac_prev=datadir ;;
193   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
194   | --da=*)
195     datadir=$ac_optarg ;;
196
197   -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
198   | --dataroo | --dataro | --datar)
199     ac_prev=datarootdir ;;
200   -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
201   | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
202     datarootdir=$ac_optarg ;;
203
204   -disable-* | --disable-*)
205     ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
206     # Reject names that are not valid shell variable names.
207     expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
208       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
209    { (exit 1); exit 1; }; }
210     ac_feature=`echo $ac_feature | sed 's/-/_/g'`
211     eval "enable_$ac_feature=no" ;;
212
213   -enable-* | --enable-*)
214     ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
215     # Reject names that are not valid shell variable names.
216     expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
217       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
218    { (exit 1); exit 1; }; }
219     ac_feature=`echo $ac_feature | sed 's/-/_/g'`
220     case $ac_option in
221       *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
222       *) ac_optarg=yes ;;
223     esac
224     eval "enable_$ac_feature='$ac_optarg'" ;;
225
226   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
227   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
228   | --exec | --exe | --ex)
229     ac_prev=exec_prefix ;;
230   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
231   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
232   | --exec=* | --exe=* | --ex=*)
233     exec_prefix=$ac_optarg ;;
234
235   -gas | --gas | --ga | --g)
236     # Obsolete; use --with-gas.
237     with_gas=yes ;;
238
239   -help | --help | --hel | --he | -h)
240     ac_init_help=long ;;
241   -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
242     ac_init_help=recursive ;;
243   -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
244     ac_init_help=short ;;
245
246   -host | --host | --hos | --ho)
247     ac_prev=host_alias ;;
248   -host=* | --host=* | --hos=* | --ho=*)
249     host_alias=$ac_optarg ;;
250
251   -includedir | --includedir | --includedi | --included | --include \
252   | --includ | --inclu | --incl | --inc)
253     ac_prev=includedir ;;
254   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
255   | --includ=* | --inclu=* | --incl=* | --inc=*)
256     includedir=$ac_optarg ;;
257
258   -infodir | --infodir | --infodi | --infod | --info | --inf)
259     ac_prev=infodir ;;
260   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
261     infodir=$ac_optarg ;;
262
263   -libdir | --libdir | --libdi | --libd)
264     ac_prev=libdir ;;
265   -libdir=* | --libdir=* | --libdi=* | --libd=*)
266     libdir=$ac_optarg ;;
267
268   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
269   | --libexe | --libex | --libe)
270     ac_prev=libexecdir ;;
271   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
272   | --libexe=* | --libex=* | --libe=*)
273     libexecdir=$ac_optarg ;;
274
275   -localstatedir | --localstatedir | --localstatedi | --localstated \
276   | --localstate | --localstat | --localsta | --localst \
277   | --locals | --local | --loca | --loc | --lo)
278     ac_prev=localstatedir ;;
279   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
280   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
281   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
282     localstatedir=$ac_optarg ;;
283
284   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
285     ac_prev=mandir ;;
286   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
287     mandir=$ac_optarg ;;
288
289   -nfp | --nfp | --nf)
290     # Obsolete; use --without-fp.
291     with_fp=no ;;
292
293   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
294   | --no-cr | --no-c)
295     no_create=yes ;;
296
297   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
298   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
299     no_recursion=yes ;;
300
301   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
302   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
303   | --oldin | --oldi | --old | --ol | --o)
304     ac_prev=oldincludedir ;;
305   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
306   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
307   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
308     oldincludedir=$ac_optarg ;;
309
310   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
311     ac_prev=prefix ;;
312   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
313     prefix=$ac_optarg ;;
314
315   -program-prefix | --program-prefix | --program-prefi | --program-pref \
316   | --program-pre | --program-pr | --program-p)
317     ac_prev=program_prefix ;;
318   -program-prefix=* | --program-prefix=* | --program-prefi=* \
319   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
320     program_prefix=$ac_optarg ;;
321
322   -program-suffix | --program-suffix | --program-suffi | --program-suff \
323   | --program-suf | --program-su | --program-s)
324     ac_prev=program_suffix ;;
325   -program-suffix=* | --program-suffix=* | --program-suffi=* \
326   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
327     program_suffix=$ac_optarg ;;
328
329   -program-transform-name | --program-transform-name \
330   | --program-transform-nam | --program-transform-na \
331   | --program-transform-n | --program-transform- \
332   | --program-transform | --program-transfor \
333   | --program-transfo | --program-transf \
334   | --program-trans | --program-tran \
335   | --progr-tra | --program-tr | --program-t)
336     ac_prev=program_transform_name ;;
337   -program-transform-name=* | --program-transform-name=* \
338   | --program-transform-nam=* | --program-transform-na=* \
339   | --program-transform-n=* | --program-transform-=* \
340   | --program-transform=* | --program-transfor=* \
341   | --program-transfo=* | --program-transf=* \
342   | --program-trans=* | --program-tran=* \
343   | --progr-tra=* | --program-tr=* | --program-t=*)
344     program_transform_name=$ac_optarg ;;
345
346   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
347   | -silent | --silent | --silen | --sile | --sil)
348     silent=yes ;;
349
350   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
351     ac_prev=sbindir ;;
352   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
353   | --sbi=* | --sb=*)
354     sbindir=$ac_optarg ;;
355
356   -sharedstatedir | --sharedstatedir | --sharedstatedi \
357   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
358   | --sharedst | --shareds | --shared | --share | --shar \
359   | --sha | --sh)
360     ac_prev=sharedstatedir ;;
361   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
362   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
363   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
364   | --sha=* | --sh=*)
365     sharedstatedir=$ac_optarg ;;
366
367   -site | --site | --sit)
368     ac_prev=site ;;
369   -site=* | --site=* | --sit=*)
370     site=$ac_optarg ;;
371
372   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
373     ac_prev=srcdir ;;
374   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
375     srcdir=$ac_optarg ;;
376
377   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
378   | --syscon | --sysco | --sysc | --sys | --sy)
379     ac_prev=sysconfdir ;;
380   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
381   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
382     sysconfdir=$ac_optarg ;;
383
384   -target | --target | --targe | --targ | --tar | --ta | --t)
385     ac_prev=target_alias ;;
386   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
387     target_alias=$ac_optarg ;;
388
389   -v | -verbose | --verbose | --verbos | --verbo | --verb)
390     verbose=yes ;;
391
392   -version | --version | --versio | --versi | --vers | -V)
393     ac_init_version=: ;;
394
395   -with-* | --with-*)
396     ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
397     # Reject names that are not valid shell variable names.
398     expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
399       { echo "$as_me: error: invalid package name: $ac_package" >&2
400    { (exit 1); exit 1; }; }
401     ac_package=`echo $ac_package| sed 's/-/_/g'`
402     case $ac_option in
403       *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
404       *) ac_optarg=yes ;;
405     esac
406     eval "with_$ac_package='$ac_optarg'" ;;
407
408   -without-* | --without-*)
409     ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
410     # Reject names that are not valid shell variable names.
411     expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
412       { echo "$as_me: error: invalid package name: $ac_package" >&2
413    { (exit 1); exit 1; }; }
414     ac_package=`echo $ac_package | sed 's/-/_/g'`
415     eval "with_$ac_package=no" ;;
416
417   --x)
418     # Obsolete; use --with-x.
419     with_x=yes ;;
420
421   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
422   | --x-incl | --x-inc | --x-in | --x-i)
423     ac_prev=x_includes ;;
424   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
425   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
426     x_includes=$ac_optarg ;;
427
428   -x-libraries | --x-libraries | --x-librarie | --x-librari \
429   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
430     ac_prev=x_libraries ;;
431   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
432   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
433     x_libraries=$ac_optarg ;;
434
435   -*) { echo "$as_me: error: unrecognized option: $ac_option
436 Try \`$0 --help' for more information." >&2
437    { (exit 1); exit 1; }; }
438     ;;
439
440   *=*)
441     ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
442     # Reject names that are not valid shell variable names.
443     expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
444       { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
445    { (exit 1); exit 1; }; }
446     ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
447     eval "$ac_envvar='$ac_optarg'"
448     export $ac_envvar ;;
449
450   *)
451     # FIXME: should be removed in autoconf 3.0.
452     echo "$as_me: WARNING: you should use --build, --host, --target" >&2
453     expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
454       echo "$as_me: WARNING: invalid host type: $ac_option" >&2
455     : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
456     ;;
457
458   esac
459 done
460
461 if test -n "$ac_prev"; then
462   ac_option=--`echo $ac_prev | sed 's/_/-/g'`
463   { echo "$as_me: error: missing argument to $ac_option" >&2
464    { (exit 1); exit 1; }; }
465 fi
466
467 # Be sure to have absolute paths.
468 for ac_var in exec_prefix prefix
469 do
470   eval ac_val=$`echo $ac_var`
471   case $ac_val in
472     [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
473     *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
474    { (exit 1); exit 1; }; };;
475   esac
476 done
477
478 # Be sure to have absolute paths.
479 for ac_var in bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir \
480               localstatedir libdir includedir oldincludedir infodir mandir
481 do
482   eval ac_val=$`echo $ac_var`
483   case $ac_val in
484     [\\/$]* | ?:[\\/]* ) ;;
485     *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
486    { (exit 1); exit 1; }; };;
487   esac
488 done
489
490 # There might be people who depend on the old broken behavior: `$host'
491 # used to hold the argument of --host etc.
492 build=$build_alias
493 host=$host_alias
494 target=$target_alias
495
496 # FIXME: should be removed in autoconf 3.0.
497 if test "x$host_alias" != x; then
498   if test "x$build_alias" = x; then
499     cross_compiling=maybe
500     echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
501     If a cross compiler is detected then cross compile mode will be used." >&2
502   elif test "x$build_alias" != "x$host_alias"; then
503     cross_compiling=yes
504   fi
505 fi
506
507 ac_tool_prefix=
508 test -n "$host_alias" && ac_tool_prefix=$host_alias-
509
510 test "$silent" = yes && exec 6>/dev/null
511
512 # Find the source files, if location was not specified.
513 if test -z "$srcdir"; then
514   ac_srcdir_defaulted=yes
515   # Try the directory containing this script, then its parent.
516   ac_prog=$0
517   ac_confdir=`echo "$ac_prog" | sed 's%[\\/][^\\/][^\\/]*$%%'`
518   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
519   srcdir=$ac_confdir
520   if test ! -r $srcdir/$ac_unique_file; then
521     srcdir=..
522   fi
523 else
524   ac_srcdir_defaulted=no
525 fi
526 if test ! -r $srcdir/$ac_unique_file; then
527   if test "$ac_srcdir_defaulted" = yes; then
528     { echo "$as_me: error: cannot find sources in $ac_confdir or .." >&2
529    { (exit 1); exit 1; }; }
530   else
531     { echo "$as_me: error: cannot find sources in $srcdir" >&2
532    { (exit 1); exit 1; }; }
533   fi
534 fi
535 srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
536 ac_env_build_alias_set=${build_alias+set}
537 ac_env_build_alias_value=$build_alias
538 ac_cv_env_build_alias_set=${build_alias+set}
539 ac_cv_env_build_alias_value=$build_alias
540 ac_env_host_alias_set=${host_alias+set}
541 ac_env_host_alias_value=$host_alias
542 ac_cv_env_host_alias_set=${host_alias+set}
543 ac_cv_env_host_alias_value=$host_alias
544 ac_env_target_alias_set=${target_alias+set}
545 ac_env_target_alias_value=$target_alias
546 ac_cv_env_target_alias_set=${target_alias+set}
547 ac_cv_env_target_alias_value=$target_alias
548 ac_env_CC_set=${CC+set}
549 ac_env_CC_value=$CC
550 ac_cv_env_CC_set=${CC+set}
551 ac_cv_env_CC_value=$CC
552 ac_env_CFLAGS_set=${CFLAGS+set}
553 ac_env_CFLAGS_value=$CFLAGS
554 ac_cv_env_CFLAGS_set=${CFLAGS+set}
555 ac_cv_env_CFLAGS_value=$CFLAGS
556 ac_env_LDFLAGS_set=${LDFLAGS+set}
557 ac_env_LDFLAGS_value=$LDFLAGS
558 ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
559 ac_cv_env_LDFLAGS_value=$LDFLAGS
560 ac_env_CPPFLAGS_set=${CPPFLAGS+set}
561 ac_env_CPPFLAGS_value=$CPPFLAGS
562 ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
563 ac_cv_env_CPPFLAGS_value=$CPPFLAGS
564 ac_env_CPP_set=${CPP+set}
565 ac_env_CPP_value=$CPP
566 ac_cv_env_CPP_set=${CPP+set}
567 ac_cv_env_CPP_value=$CPP
568
569 #
570 # Report the --help message.
571 #
572 if test "$ac_init_help" = "long"; then
573   # Omit some internal or obsolete options to make the list less imposing.
574   # This message is too long to be a string in the A/UX 3.1 sh.
575   cat <<EOF
576 \`configure' configures this package to adapt to many kinds of systems.
577
578 Usage: $0 [OPTION]... [VAR=VALUE]...
579
580 To assign environment variables (e.g., CC, CFLAGS...), specify them as
581 VAR=VALUE.  See below for descriptions of some of the useful variables.
582
583 Defaults for the options are specified in brackets.
584
585 Configuration:
586   -h, --help              display this help and exit
587       --help=short        display options specific to this package
588       --help=recursive    display the short help of all the included packages
589   -V, --version           display version information and exit
590   -q, --quiet, --silent   do not print \`checking...' messages
591       --cache-file=FILE   cache test results in FILE [disabled]
592   -C, --config-cache      alias for \`--cache-file=config.cache'
593   -n, --no-create         do not create output files
594       --srcdir=DIR        find the sources in DIR [configure dir or \`..']
595
596 EOF
597
598   cat <<EOF
599 Installation directories:
600   --prefix=PREFIX         install architecture-independent files in PREFIX
601                           [$ac_default_prefix]
602   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
603                           [PREFIX]
604
605 By default, \`make install' will install all the files in
606 \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
607 an installation prefix other than \`$ac_default_prefix' using \`--prefix',
608 for instance \`--prefix=\$HOME'.
609
610 For better control, use the options below.
611
612 Fine tuning of the installation directories:
613   --bindir=DIR            user executables [EPREFIX/bin]
614   --sbindir=DIR           system admin executables [EPREFIX/sbin]
615   --libexecdir=DIR        program executables [EPREFIX/libexec]
616   --datarootdir=DIR       read-only architecture-independent data [PREFIX/share]
617   --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
618   --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
619   --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
620   --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
621   --libdir=DIR            object code libraries [EPREFIX/lib]
622   --includedir=DIR        C header files [PREFIX/include]
623   --oldincludedir=DIR     C header files for non-gcc [/usr/include]
624   --infodir=DIR           info documentation [DATAROOTDIR/info]
625   --mandir=DIR            man documentation [DATAROOTDIR/man]
626 EOF
627
628   cat <<\EOF
629
630 Program names:
631   --program-prefix=PREFIX            prepend PREFIX to installed program names
632   --program-suffix=SUFFIX            append SUFFIX to installed program names
633   --program-transform-name=PROGRAM   run sed PROGRAM on installed program names
634
635 X features:
636   --x-includes=DIR    X include files are in DIR
637   --x-libraries=DIR   X library files are in DIR
638
639 System types:
640   --build=BUILD           configure for building on BUILD [guessed]
641   --host=HOST       build programs to run on HOST [BUILD]
642 EOF
643 fi
644
645 if test -n "$ac_init_help"; then
646
647   cat <<\EOF
648
649 Optional Packages:
650   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
651   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
652
653 Optional Features:
654   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
655   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
656
657 General Options:
658   --with-pkg-config{=path} enable/disable use of pkg-config
659   --disable-echo          do not display "compiling" commands
660 Curses Version-dependent Options:
661   --with-ncurses-wrap-prefix naming-prefix for ncurses wrapped-variables
662   --disable-widec         disable checks for wide-character functions
663   --with-curses-dir=DIR   directory in which (n)curses is installed
664   --with-screen=XXX       use specified curses-libraries
665   --with-ncursesw         use wide ncurses-libraries
666   --with-ncurses          use ncurses-libraries
667   --with-pdcurses         compile/link with pdcurses X11 library
668   --with-curses-colr      compile/link with HPUX 10.x color-curses
669   --with-curses-5lib      compile/link with SunOS 5lib curses
670   --with-Xaw3d            link with Xaw 3d library
671   --with-Xaw3dxft         link with Xaw 3d xft library
672   --with-neXtaw           link with neXT Athena library
673   --with-XawPlus          link with Athena-Plus library
674   --with-x                use the X Window System
675 Testing/development Options:
676   --enable-warnings       test: turn on gcc compiler warnings
677   --with-dmalloc          test: use Gray Watson's dmalloc library
678   --with-dbmalloc         test: use Conor Cahill's dbmalloc library
679   --with-valgrind         test: use valgrind
680   --disable-leaks         test: free permanent memory, analyze leaks
681   --disable-rpath-hack    don't add rpath options for additional libraries
682
683 Some influential environment variables:
684   CC          C compiler command
685   CFLAGS      C compiler flags
686   LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
687               nonstandard directory <lib dir>
688   CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
689               headers in a nonstandard directory <include dir>
690   CPP         C preprocessor
691
692 Use these variables to override the choices made by `configure' or to help
693 it to find libraries and programs with nonstandard names/locations.
694
695 EOF
696 fi
697
698 if test "$ac_init_help" = "recursive"; then
699   # If there are subdirs, report their specific --help.
700   ac_popdir=`pwd`
701   for ac_subdir in : $ac_subdirs_all; do test "x$ac_subdir" = x: && continue
702     cd $ac_subdir
703     # A "../" for each directory in /$ac_subdir.
704     ac_dots=`echo $ac_subdir |
705              sed 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g'`
706
707     case $srcdir in
708     .) # No --srcdir option.  We are building in place.
709       ac_sub_srcdir=$srcdir ;;
710     [\\/]* | ?:[\\/]* ) # Absolute path.
711       ac_sub_srcdir=$srcdir/$ac_subdir ;;
712     *) # Relative path.
713       ac_sub_srcdir=$ac_dots$srcdir/$ac_subdir ;;
714     esac
715
716     # Check for guested configure; otherwise get Cygnus style configure.
717     if test -f $ac_sub_srcdir/configure.gnu; then
718       echo
719       $SHELL $ac_sub_srcdir/configure.gnu  --help=recursive
720     elif test -f $ac_sub_srcdir/configure; then
721       echo
722       $SHELL $ac_sub_srcdir/configure  --help=recursive
723     elif test -f $ac_sub_srcdir/configure.ac ||
724            test -f $ac_sub_srcdir/configure.in; then
725       echo
726       $ac_configure --help
727     else
728       echo "$as_me: WARNING: no configuration information is in $ac_subdir" >&2
729     fi
730     cd $ac_popdir
731   done
732 fi
733
734 test -n "$ac_init_help" && exit 0
735 if $ac_init_version; then
736   cat <<\EOF
737
738 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
739 Free Software Foundation, Inc.
740 This configure script is free software; the Free Software Foundation
741 gives unlimited permission to copy, distribute and modify it.
742 EOF
743   exit 0
744 fi
745 exec 5>config.log
746 cat >&5 <<EOF
747 This file contains any messages produced by compilers while
748 running configure, to aid debugging if configure makes a mistake.
749
750 It was created by $as_me, which was
751 generated by GNU Autoconf 2.52.20150926.  Invocation command line was
752
753   $ $0 $@
754
755 EOF
756 {
757 cat <<_ASUNAME
758 ## ---------- ##
759 ## Platform.  ##
760 ## ---------- ##
761
762 hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
763 uname -m = `(uname -m) 2>/dev/null || echo unknown`
764 uname -r = `(uname -r) 2>/dev/null || echo unknown`
765 uname -s = `(uname -s) 2>/dev/null || echo unknown`
766 uname -v = `(uname -v) 2>/dev/null || echo unknown`
767
768 /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
769 /bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
770
771 /bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
772 /usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
773 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
774 hostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
775 /bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
776 /usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
777 /bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
778
779 PATH = $PATH
780
781 _ASUNAME
782 } >&5
783
784 cat >&5 <<EOF
785 ## ------------ ##
786 ## Core tests.  ##
787 ## ------------ ##
788
789 EOF
790
791 # Keep a trace of the command line.
792 # Strip out --no-create and --no-recursion so they do not pile up.
793 # Also quote any args containing shell meta-characters.
794 ac_configure_args=
795 ac_sep=
796 for ac_arg
797 do
798   case $ac_arg in
799   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
800   | --no-cr | --no-c) ;;
801   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
802   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
803   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
804     ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"`
805     ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
806     ac_sep=" " ;;
807   *) ac_configure_args="$ac_configure_args$ac_sep$ac_arg"
808      ac_sep=" " ;;
809   esac
810   # Get rid of the leading space.
811 done
812
813 # When interrupted or exit'd, cleanup temporary files, and complete
814 # config.log.  We remove comments because anyway the quotes in there
815 # would cause problems or look ugly.
816 trap 'exit_status=$?
817   # Save into config.log some information that might help in debugging.
818   echo >&5
819   echo "## ----------------- ##" >&5
820   echo "## Cache variables.  ##" >&5
821   echo "## ----------------- ##" >&5
822   echo >&5
823   # The following way of writing the cache mishandles newlines in values,
824 {
825   (set) 2>&1 |
826     case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
827     *ac_space=\ *)
828       sed -n \
829         "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
830           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
831       ;;
832     *)
833       sed -n \
834         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
835       ;;
836     esac;
837 } >&5
838   sed "/^$/d" confdefs.h >conftest.log
839   if test -s conftest.log; then
840     echo >&5
841     echo "## ------------ ##" >&5
842     echo "## confdefs.h.  ##" >&5
843     echo "## ------------ ##" >&5
844     echo >&5
845     cat conftest.log >&5
846   fi
847   (echo; echo) >&5
848   test "$ac_signal" != 0 &&
849     echo "$as_me: caught signal $ac_signal" >&5
850   echo "$as_me: exit $exit_status" >&5
851   rm -rf conftest* confdefs* core core.* *.core conf$$* $ac_clean_files &&
852     exit $exit_status
853      ' 0
854 for ac_signal in 1 2 13 15; do
855   trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
856 done
857 ac_signal=0
858
859 # confdefs.h avoids OS command line length limits that DEFS can exceed.
860 rm -rf conftest* confdefs.h
861 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
862 echo >confdefs.h
863
864 # Let the site file select an alternate cache file if it wants to.
865 # Prefer explicitly selected file to automatically selected ones.
866 if test -z "$CONFIG_SITE"; then
867   if test "x$prefix" != xNONE; then
868     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
869   else
870     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
871   fi
872 fi
873 for ac_site_file in $CONFIG_SITE; do
874   if test -r "$ac_site_file"; then
875     { echo "$as_me:875: loading site script $ac_site_file" >&5
876 echo "$as_me: loading site script $ac_site_file" >&6;}
877     cat "$ac_site_file" >&5
878     . "$ac_site_file"
879   fi
880 done
881
882 if test -r "$cache_file"; then
883   # Some versions of bash will fail to source /dev/null (special
884   # files actually), so we avoid doing that.
885   if test -f "$cache_file"; then
886     { echo "$as_me:886: loading cache $cache_file" >&5
887 echo "$as_me: loading cache $cache_file" >&6;}
888     case $cache_file in
889       [\\/]* | ?:[\\/]* ) . $cache_file;;
890       *)                      . ./$cache_file;;
891     esac
892   fi
893 else
894   { echo "$as_me:894: creating cache $cache_file" >&5
895 echo "$as_me: creating cache $cache_file" >&6;}
896   >$cache_file
897 fi
898
899 # Check that the precious variables saved in the cache have kept the same
900 # value.
901 ac_cache_corrupted=false
902 for ac_var in `(set) 2>&1 |
903                sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
904   eval ac_old_set=\$ac_cv_env_${ac_var}_set
905   eval ac_new_set=\$ac_env_${ac_var}_set
906   eval ac_old_val="\$ac_cv_env_${ac_var}_value"
907   eval ac_new_val="\$ac_env_${ac_var}_value"
908   case $ac_old_set,$ac_new_set in
909     set,)
910       { echo "$as_me:910: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
911 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
912       ac_cache_corrupted=: ;;
913     ,set)
914       { echo "$as_me:914: error: \`$ac_var' was not set in the previous run" >&5
915 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
916       ac_cache_corrupted=: ;;
917     ,);;
918     *)
919       if test "x$ac_old_val" != "x$ac_new_val"; then
920         { echo "$as_me:920: error: \`$ac_var' has changed since the previous run:" >&5
921 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
922         { echo "$as_me:922:   former value:  $ac_old_val" >&5
923 echo "$as_me:   former value:  $ac_old_val" >&2;}
924         { echo "$as_me:924:   current value: $ac_new_val" >&5
925 echo "$as_me:   current value: $ac_new_val" >&2;}
926         ac_cache_corrupted=:
927       fi;;
928   esac
929   # Pass precious variables to config.status.  It doesn't matter if
930   # we pass some twice (in addition to the command line arguments).
931   if test "$ac_new_set" = set; then
932     case $ac_new_val in
933     *" "*|*"    "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
934       ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"`
935       ac_configure_args="$ac_configure_args '$ac_arg'"
936       ;;
937     *) ac_configure_args="$ac_configure_args $ac_var=$ac_new_val"
938        ;;
939     esac
940   fi
941 done
942 if $ac_cache_corrupted; then
943   { echo "$as_me:943: error: changes in the environment can compromise the build" >&5
944 echo "$as_me: error: changes in the environment can compromise the build" >&2;}
945   { { echo "$as_me:945: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
946 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
947    { (exit 1); exit 1; }; }
948 fi
949
950 ac_ext=c
951 ac_cpp='$CPP $CPPFLAGS'
952 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
953 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
954 ac_compiler_gnu=$ac_cv_c_compiler_gnu
955 ac_main_return=return
956
957 case `echo "testing\c" 2>/dev/null; echo 1,2,3`,`echo -n testing 2>/dev/null; echo 1,2,3` in
958   *c*,-n*) ECHO_N= ECHO_C=      # newlines do not sed ;-) only broken shells would use this case anyway
959                    ECHO_T='     ' ;;
960   *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
961   *)      ECHO_N= ECHO_C='\c' ECHO_T= ;;
962 esac
963 echo "#! $SHELL" >conftest.sh
964 echo  "exit 0"   >>conftest.sh
965 chmod +x conftest.sh
966 if { (echo "$as_me:966: PATH=\".;.\"; conftest.sh") >&5
967   (PATH=".;."; conftest.sh) 2>&5
968   ac_status=$?
969   echo "$as_me:969: \$? = $ac_status" >&5
970   (exit $ac_status); }; then
971   ac_path_separator=';'
972 else
973   ac_path_separator=:
974 fi
975 PATH_SEPARATOR="$ac_path_separator"
976 rm -f conftest.sh
977
978 ac_config_headers="$ac_config_headers ncurses_cfg.h:ncurses_tst.hin"
979
980 test -f config.guess || ( test -f ../config.guess && cp ../config.guess ./ )
981
982 test -f config.sub || ( test -f ../config.sub && cp ../config.sub ./ )
983
984 ac_aux_dir=
985 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
986   if test -f $ac_dir/install-sh; then
987     ac_aux_dir=$ac_dir
988     ac_install_sh="$ac_aux_dir/install-sh -c"
989     break
990   elif test -f $ac_dir/install.sh; then
991     ac_aux_dir=$ac_dir
992     ac_install_sh="$ac_aux_dir/install.sh -c"
993     break
994   elif test -f $ac_dir/shtool; then
995     ac_aux_dir=$ac_dir
996     ac_install_sh="$ac_aux_dir/shtool install -c"
997     break
998   fi
999 done
1000 if test -z "$ac_aux_dir"; then
1001   { { echo "$as_me:1001: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
1002 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
1003    { (exit 1); exit 1; }; }
1004 fi
1005 ac_config_guess="$SHELL $ac_aux_dir/config.guess"
1006 ac_config_sub="$SHELL $ac_aux_dir/config.sub"
1007 ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
1008
1009 # Make sure we can run config.sub.
1010 $ac_config_sub sun4 >/dev/null 2>&1 ||
1011   { { echo "$as_me:1011: error: cannot run $ac_config_sub" >&5
1012 echo "$as_me: error: cannot run $ac_config_sub" >&2;}
1013    { (exit 1); exit 1; }; }
1014
1015 echo "$as_me:1015: checking build system type" >&5
1016 echo $ECHO_N "checking build system type... $ECHO_C" >&6
1017 if test "${ac_cv_build+set}" = set; then
1018   echo $ECHO_N "(cached) $ECHO_C" >&6
1019 else
1020   ac_cv_build_alias=$build_alias
1021 test -z "$ac_cv_build_alias" &&
1022   ac_cv_build_alias=`$ac_config_guess`
1023 test -z "$ac_cv_build_alias" &&
1024   { { echo "$as_me:1024: error: cannot guess build type; you must specify one" >&5
1025 echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
1026    { (exit 1); exit 1; }; }
1027 ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
1028   { { echo "$as_me:1028: error: $ac_config_sub $ac_cv_build_alias failed." >&5
1029 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed." >&2;}
1030    { (exit 1); exit 1; }; }
1031
1032 fi
1033 echo "$as_me:1033: result: $ac_cv_build" >&5
1034 echo "${ECHO_T}$ac_cv_build" >&6
1035 build=$ac_cv_build
1036 build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1037 build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1038 build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1039
1040 if test -f $srcdir/config.guess || test -f $ac_aux_dir/config.guess ; then
1041         echo "$as_me:1041: checking host system type" >&5
1042 echo $ECHO_N "checking host system type... $ECHO_C" >&6
1043 if test "${ac_cv_host+set}" = set; then
1044   echo $ECHO_N "(cached) $ECHO_C" >&6
1045 else
1046   ac_cv_host_alias=$host_alias
1047 test -z "$ac_cv_host_alias" &&
1048   ac_cv_host_alias=$ac_cv_build_alias
1049 ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
1050   { { echo "$as_me:1050: error: $ac_config_sub $ac_cv_host_alias failed" >&5
1051 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
1052    { (exit 1); exit 1; }; }
1053
1054 fi
1055 echo "$as_me:1055: result: $ac_cv_host" >&5
1056 echo "${ECHO_T}$ac_cv_host" >&6
1057 host=$ac_cv_host
1058 host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1059 host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1060 host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1061
1062         system_name="$host_os"
1063 else
1064         system_name="`(uname -s -r) 2>/dev/null`"
1065         if test -z "$system_name" ; then
1066                 system_name="`(hostname) 2>/dev/null`"
1067         fi
1068 fi
1069 test -n "$system_name" &&
1070 cat >>confdefs.h <<EOF
1071 #define SYSTEM_NAME "$system_name"
1072 EOF
1073
1074 if test "${cf_cv_system_name+set}" = set; then
1075   echo $ECHO_N "(cached) $ECHO_C" >&6
1076 else
1077   cf_cv_system_name="$system_name"
1078 fi
1079
1080 test -z "$system_name" && system_name="$cf_cv_system_name"
1081 test -n "$cf_cv_system_name" && echo "$as_me:1081: result: Configuring for $cf_cv_system_name" >&5
1082 echo "${ECHO_T}Configuring for $cf_cv_system_name" >&6
1083
1084 if test ".$system_name" != ".$cf_cv_system_name" ; then
1085         echo "$as_me:1085: result: Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&5
1086 echo "${ECHO_T}Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&6
1087         { { echo "$as_me:1087: error: \"Please remove config.cache and try again.\"" >&5
1088 echo "$as_me: error: \"Please remove config.cache and try again.\"" >&2;}
1089    { (exit 1); exit 1; }; }
1090 fi
1091
1092 test "$program_prefix" != NONE &&
1093   program_transform_name="s,^,$program_prefix,;$program_transform_name"
1094 # Use a double $ so make ignores it.
1095 test "$program_suffix" != NONE &&
1096   program_transform_name="s,\$,$program_suffix,;$program_transform_name"
1097 # Double any \ or $.  echo might interpret backslashes.
1098 # By default was `s,x,x', remove it if useless.
1099 cat <<\_ACEOF >conftest.sed
1100 s/[\\$]/&&/g;s/;s,x,x,$//
1101 _ACEOF
1102 program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
1103 rm conftest.sed
1104
1105 echo "$as_me:1105: checking whether ${MAKE-make} sets \${MAKE}" >&5
1106 echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6
1107 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
1108 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
1109   echo $ECHO_N "(cached) $ECHO_C" >&6
1110 else
1111   cat >conftest.make <<\EOF
1112 all:
1113         @echo 'ac_maketemp="${MAKE}"'
1114 EOF
1115 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
1116 eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
1117 if test -n "$ac_maketemp"; then
1118   eval ac_cv_prog_make_${ac_make}_set=yes
1119 else
1120   eval ac_cv_prog_make_${ac_make}_set=no
1121 fi
1122 rm -f conftest.make
1123 fi
1124 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
1125   echo "$as_me:1125: result: yes" >&5
1126 echo "${ECHO_T}yes" >&6
1127   SET_MAKE=
1128 else
1129   echo "$as_me:1129: result: no" >&5
1130 echo "${ECHO_T}no" >&6
1131   SET_MAKE="MAKE=${MAKE-make}"
1132 fi
1133
1134 ac_ext=c
1135 ac_cpp='$CPP $CPPFLAGS'
1136 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1137 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1138 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1139 ac_main_return=return
1140 if test -n "$ac_tool_prefix"; then
1141   # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
1142 set dummy ${ac_tool_prefix}gcc; ac_word=$2
1143 echo "$as_me:1143: checking for $ac_word" >&5
1144 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1145 if test "${ac_cv_prog_CC+set}" = set; then
1146   echo $ECHO_N "(cached) $ECHO_C" >&6
1147 else
1148   if test -n "$CC"; then
1149   ac_cv_prog_CC="$CC" # Let the user override the test.
1150 else
1151   ac_save_IFS=$IFS; IFS=$ac_path_separator
1152 ac_dummy="$PATH"
1153 for ac_dir in $ac_dummy; do
1154   IFS=$ac_save_IFS
1155   test -z "$ac_dir" && ac_dir=.
1156   $as_executable_p "$ac_dir/$ac_word" || continue
1157 ac_cv_prog_CC="${ac_tool_prefix}gcc"
1158 echo "$as_me:1158: found $ac_dir/$ac_word" >&5
1159 break
1160 done
1161
1162 fi
1163 fi
1164 CC=$ac_cv_prog_CC
1165 if test -n "$CC"; then
1166   echo "$as_me:1166: result: $CC" >&5
1167 echo "${ECHO_T}$CC" >&6
1168 else
1169   echo "$as_me:1169: result: no" >&5
1170 echo "${ECHO_T}no" >&6
1171 fi
1172
1173 fi
1174 if test -z "$ac_cv_prog_CC"; then
1175   ac_ct_CC=$CC
1176   # Extract the first word of "gcc", so it can be a program name with args.
1177 set dummy gcc; ac_word=$2
1178 echo "$as_me:1178: checking for $ac_word" >&5
1179 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1180 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1181   echo $ECHO_N "(cached) $ECHO_C" >&6
1182 else
1183   if test -n "$ac_ct_CC"; then
1184   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1185 else
1186   ac_save_IFS=$IFS; IFS=$ac_path_separator
1187 ac_dummy="$PATH"
1188 for ac_dir in $ac_dummy; do
1189   IFS=$ac_save_IFS
1190   test -z "$ac_dir" && ac_dir=.
1191   $as_executable_p "$ac_dir/$ac_word" || continue
1192 ac_cv_prog_ac_ct_CC="gcc"
1193 echo "$as_me:1193: found $ac_dir/$ac_word" >&5
1194 break
1195 done
1196
1197 fi
1198 fi
1199 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1200 if test -n "$ac_ct_CC"; then
1201   echo "$as_me:1201: result: $ac_ct_CC" >&5
1202 echo "${ECHO_T}$ac_ct_CC" >&6
1203 else
1204   echo "$as_me:1204: result: no" >&5
1205 echo "${ECHO_T}no" >&6
1206 fi
1207
1208   CC=$ac_ct_CC
1209 else
1210   CC="$ac_cv_prog_CC"
1211 fi
1212
1213 if test -z "$CC"; then
1214   if test -n "$ac_tool_prefix"; then
1215   # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
1216 set dummy ${ac_tool_prefix}cc; ac_word=$2
1217 echo "$as_me:1217: checking for $ac_word" >&5
1218 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1219 if test "${ac_cv_prog_CC+set}" = set; then
1220   echo $ECHO_N "(cached) $ECHO_C" >&6
1221 else
1222   if test -n "$CC"; then
1223   ac_cv_prog_CC="$CC" # Let the user override the test.
1224 else
1225   ac_save_IFS=$IFS; IFS=$ac_path_separator
1226 ac_dummy="$PATH"
1227 for ac_dir in $ac_dummy; do
1228   IFS=$ac_save_IFS
1229   test -z "$ac_dir" && ac_dir=.
1230   $as_executable_p "$ac_dir/$ac_word" || continue
1231 ac_cv_prog_CC="${ac_tool_prefix}cc"
1232 echo "$as_me:1232: found $ac_dir/$ac_word" >&5
1233 break
1234 done
1235
1236 fi
1237 fi
1238 CC=$ac_cv_prog_CC
1239 if test -n "$CC"; then
1240   echo "$as_me:1240: result: $CC" >&5
1241 echo "${ECHO_T}$CC" >&6
1242 else
1243   echo "$as_me:1243: result: no" >&5
1244 echo "${ECHO_T}no" >&6
1245 fi
1246
1247 fi
1248 if test -z "$ac_cv_prog_CC"; then
1249   ac_ct_CC=$CC
1250   # Extract the first word of "cc", so it can be a program name with args.
1251 set dummy cc; ac_word=$2
1252 echo "$as_me:1252: checking for $ac_word" >&5
1253 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1254 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1255   echo $ECHO_N "(cached) $ECHO_C" >&6
1256 else
1257   if test -n "$ac_ct_CC"; then
1258   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1259 else
1260   ac_save_IFS=$IFS; IFS=$ac_path_separator
1261 ac_dummy="$PATH"
1262 for ac_dir in $ac_dummy; do
1263   IFS=$ac_save_IFS
1264   test -z "$ac_dir" && ac_dir=.
1265   $as_executable_p "$ac_dir/$ac_word" || continue
1266 ac_cv_prog_ac_ct_CC="cc"
1267 echo "$as_me:1267: found $ac_dir/$ac_word" >&5
1268 break
1269 done
1270
1271 fi
1272 fi
1273 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1274 if test -n "$ac_ct_CC"; then
1275   echo "$as_me:1275: result: $ac_ct_CC" >&5
1276 echo "${ECHO_T}$ac_ct_CC" >&6
1277 else
1278   echo "$as_me:1278: result: no" >&5
1279 echo "${ECHO_T}no" >&6
1280 fi
1281
1282   CC=$ac_ct_CC
1283 else
1284   CC="$ac_cv_prog_CC"
1285 fi
1286
1287 fi
1288 if test -z "$CC"; then
1289   # Extract the first word of "cc", so it can be a program name with args.
1290 set dummy cc; ac_word=$2
1291 echo "$as_me:1291: checking for $ac_word" >&5
1292 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1293 if test "${ac_cv_prog_CC+set}" = set; then
1294   echo $ECHO_N "(cached) $ECHO_C" >&6
1295 else
1296   if test -n "$CC"; then
1297   ac_cv_prog_CC="$CC" # Let the user override the test.
1298 else
1299   ac_prog_rejected=no
1300   ac_save_IFS=$IFS; IFS=$ac_path_separator
1301 ac_dummy="$PATH"
1302 for ac_dir in $ac_dummy; do
1303   IFS=$ac_save_IFS
1304   test -z "$ac_dir" && ac_dir=.
1305   $as_executable_p "$ac_dir/$ac_word" || continue
1306 if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1307   ac_prog_rejected=yes
1308   continue
1309 fi
1310 ac_cv_prog_CC="cc"
1311 echo "$as_me:1311: found $ac_dir/$ac_word" >&5
1312 break
1313 done
1314
1315 if test $ac_prog_rejected = yes; then
1316   # We found a bogon in the path, so make sure we never use it.
1317   set dummy $ac_cv_prog_CC
1318   shift
1319   if test $# != 0; then
1320     # We chose a different compiler from the bogus one.
1321     # However, it has the same basename, so the bogon will be chosen
1322     # first if we set CC to just the basename; use the full file name.
1323     shift
1324     set dummy "$ac_dir/$ac_word" ${1+"$@"}
1325     shift
1326     ac_cv_prog_CC="$@"
1327   fi
1328 fi
1329 fi
1330 fi
1331 CC=$ac_cv_prog_CC
1332 if test -n "$CC"; then
1333   echo "$as_me:1333: result: $CC" >&5
1334 echo "${ECHO_T}$CC" >&6
1335 else
1336   echo "$as_me:1336: result: no" >&5
1337 echo "${ECHO_T}no" >&6
1338 fi
1339
1340 fi
1341 if test -z "$CC"; then
1342   if test -n "$ac_tool_prefix"; then
1343   for ac_prog in cl
1344   do
1345     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
1346 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
1347 echo "$as_me:1347: checking for $ac_word" >&5
1348 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1349 if test "${ac_cv_prog_CC+set}" = set; then
1350   echo $ECHO_N "(cached) $ECHO_C" >&6
1351 else
1352   if test -n "$CC"; then
1353   ac_cv_prog_CC="$CC" # Let the user override the test.
1354 else
1355   ac_save_IFS=$IFS; IFS=$ac_path_separator
1356 ac_dummy="$PATH"
1357 for ac_dir in $ac_dummy; do
1358   IFS=$ac_save_IFS
1359   test -z "$ac_dir" && ac_dir=.
1360   $as_executable_p "$ac_dir/$ac_word" || continue
1361 ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
1362 echo "$as_me:1362: found $ac_dir/$ac_word" >&5
1363 break
1364 done
1365
1366 fi
1367 fi
1368 CC=$ac_cv_prog_CC
1369 if test -n "$CC"; then
1370   echo "$as_me:1370: result: $CC" >&5
1371 echo "${ECHO_T}$CC" >&6
1372 else
1373   echo "$as_me:1373: result: no" >&5
1374 echo "${ECHO_T}no" >&6
1375 fi
1376
1377     test -n "$CC" && break
1378   done
1379 fi
1380 if test -z "$CC"; then
1381   ac_ct_CC=$CC
1382   for ac_prog in cl
1383 do
1384   # Extract the first word of "$ac_prog", so it can be a program name with args.
1385 set dummy $ac_prog; ac_word=$2
1386 echo "$as_me:1386: checking for $ac_word" >&5
1387 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1388 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1389   echo $ECHO_N "(cached) $ECHO_C" >&6
1390 else
1391   if test -n "$ac_ct_CC"; then
1392   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1393 else
1394   ac_save_IFS=$IFS; IFS=$ac_path_separator
1395 ac_dummy="$PATH"
1396 for ac_dir in $ac_dummy; do
1397   IFS=$ac_save_IFS
1398   test -z "$ac_dir" && ac_dir=.
1399   $as_executable_p "$ac_dir/$ac_word" || continue
1400 ac_cv_prog_ac_ct_CC="$ac_prog"
1401 echo "$as_me:1401: found $ac_dir/$ac_word" >&5
1402 break
1403 done
1404
1405 fi
1406 fi
1407 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1408 if test -n "$ac_ct_CC"; then
1409   echo "$as_me:1409: result: $ac_ct_CC" >&5
1410 echo "${ECHO_T}$ac_ct_CC" >&6
1411 else
1412   echo "$as_me:1412: result: no" >&5
1413 echo "${ECHO_T}no" >&6
1414 fi
1415
1416   test -n "$ac_ct_CC" && break
1417 done
1418
1419   CC=$ac_ct_CC
1420 fi
1421
1422 fi
1423
1424 test -z "$CC" && { { echo "$as_me:1424: error: no acceptable cc found in \$PATH" >&5
1425 echo "$as_me: error: no acceptable cc found in \$PATH" >&2;}
1426    { (exit 1); exit 1; }; }
1427
1428 # Provide some information about the compiler.
1429 echo "$as_me:1429:" \
1430      "checking for C compiler version" >&5
1431 ac_compiler=`set X $ac_compile; echo $2`
1432 { (eval echo "$as_me:1432: \"$ac_compiler --version </dev/null >&5\"") >&5
1433   (eval $ac_compiler --version </dev/null >&5) 2>&5
1434   ac_status=$?
1435   echo "$as_me:1435: \$? = $ac_status" >&5
1436   (exit $ac_status); }
1437 { (eval echo "$as_me:1437: \"$ac_compiler -v </dev/null >&5\"") >&5
1438   (eval $ac_compiler -v </dev/null >&5) 2>&5
1439   ac_status=$?
1440   echo "$as_me:1440: \$? = $ac_status" >&5
1441   (exit $ac_status); }
1442 { (eval echo "$as_me:1442: \"$ac_compiler -V </dev/null >&5\"") >&5
1443   (eval $ac_compiler -V </dev/null >&5) 2>&5
1444   ac_status=$?
1445   echo "$as_me:1445: \$? = $ac_status" >&5
1446   (exit $ac_status); }
1447
1448 cat >conftest.$ac_ext <<_ACEOF
1449 #line 1449 "configure"
1450 #include "confdefs.h"
1451
1452 int
1453 main ()
1454 {
1455
1456   ;
1457   return 0;
1458 }
1459 _ACEOF
1460 ac_clean_files_save=$ac_clean_files
1461 ac_clean_files="$ac_clean_files a.out a.exe"
1462 # Try to create an executable without -o first, disregard a.out.
1463 # It will help us diagnose broken compilers, and finding out an intuition
1464 # of exeext.
1465 echo "$as_me:1465: checking for C compiler default output" >&5
1466 echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
1467 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
1468 if { (eval echo "$as_me:1468: \"$ac_link_default\"") >&5
1469   (eval $ac_link_default) 2>&5
1470   ac_status=$?
1471   echo "$as_me:1471: \$? = $ac_status" >&5
1472   (exit $ac_status); }; then
1473   # Find the output, starting from the most likely.  This scheme is
1474 # not robust to junk in `.', hence go to wildcards (a.*) only as a last
1475 # resort.
1476 for ac_file in `ls a.exe conftest.exe 2>/dev/null;
1477                 ls a.out conftest 2>/dev/null;
1478                 ls a.* conftest.* 2>/dev/null`; do
1479   case $ac_file in
1480     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1481     a.out ) # We found the default executable, but exeext='' is most
1482             # certainly right.
1483             break;;
1484     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1485           # FIXME: I believe we export ac_cv_exeext for Libtool --akim.
1486           export ac_cv_exeext
1487           break;;
1488     * ) break;;
1489   esac
1490 done
1491 else
1492   echo "$as_me: failed program was:" >&5
1493 cat conftest.$ac_ext >&5
1494 { { echo "$as_me:1494: error: C compiler cannot create executables" >&5
1495 echo "$as_me: error: C compiler cannot create executables" >&2;}
1496    { (exit 77); exit 77; }; }
1497 fi
1498
1499 ac_exeext=$ac_cv_exeext
1500 echo "$as_me:1500: result: $ac_file" >&5
1501 echo "${ECHO_T}$ac_file" >&6
1502
1503 # Check the compiler produces executables we can run.  If not, either
1504 # the compiler is broken, or we cross compile.
1505 echo "$as_me:1505: checking whether the C compiler works" >&5
1506 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
1507 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0
1508 # If not cross compiling, check that we can run a simple program.
1509 if test "$cross_compiling" != yes; then
1510   if { ac_try='./$ac_file'
1511   { (eval echo "$as_me:1511: \"$ac_try\"") >&5
1512   (eval $ac_try) 2>&5
1513   ac_status=$?
1514   echo "$as_me:1514: \$? = $ac_status" >&5
1515   (exit $ac_status); }; }; then
1516     cross_compiling=no
1517   else
1518     if test "$cross_compiling" = maybe; then
1519         cross_compiling=yes
1520     else
1521         { { echo "$as_me:1521: error: cannot run C compiled programs.
1522 If you meant to cross compile, use \`--host'." >&5
1523 echo "$as_me: error: cannot run C compiled programs.
1524 If you meant to cross compile, use \`--host'." >&2;}
1525    { (exit 1); exit 1; }; }
1526     fi
1527   fi
1528 fi
1529 echo "$as_me:1529: result: yes" >&5
1530 echo "${ECHO_T}yes" >&6
1531
1532 rm -f a.out a.exe conftest$ac_cv_exeext
1533 ac_clean_files=$ac_clean_files_save
1534 # Check the compiler produces executables we can run.  If not, either
1535 # the compiler is broken, or we cross compile.
1536 echo "$as_me:1536: checking whether we are cross compiling" >&5
1537 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
1538 echo "$as_me:1538: result: $cross_compiling" >&5
1539 echo "${ECHO_T}$cross_compiling" >&6
1540
1541 echo "$as_me:1541: checking for executable suffix" >&5
1542 echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6
1543 if { (eval echo "$as_me:1543: \"$ac_link\"") >&5
1544   (eval $ac_link) 2>&5
1545   ac_status=$?
1546   echo "$as_me:1546: \$? = $ac_status" >&5
1547   (exit $ac_status); }; then
1548   # If both `conftest.exe' and `conftest' are `present' (well, observable)
1549 # catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
1550 # work properly (i.e., refer to `conftest.exe'), while it won't with
1551 # `rm'.
1552 for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do
1553   case $ac_file in
1554     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1555     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1556           export ac_cv_exeext
1557           break;;
1558     * ) break;;
1559   esac
1560 done
1561 else
1562   { { echo "$as_me:1562: error: cannot compute EXEEXT: cannot compile and link" >&5
1563 echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;}
1564    { (exit 1); exit 1; }; }
1565 fi
1566
1567 rm -f conftest$ac_cv_exeext
1568 echo "$as_me:1568: result: $ac_cv_exeext" >&5
1569 echo "${ECHO_T}$ac_cv_exeext" >&6
1570
1571 rm -f conftest.$ac_ext
1572 EXEEXT=$ac_cv_exeext
1573 ac_exeext=$EXEEXT
1574 echo "$as_me:1574: checking for object suffix" >&5
1575 echo $ECHO_N "checking for object suffix... $ECHO_C" >&6
1576 if test "${ac_cv_objext+set}" = set; then
1577   echo $ECHO_N "(cached) $ECHO_C" >&6
1578 else
1579   cat >conftest.$ac_ext <<_ACEOF
1580 #line 1580 "configure"
1581 #include "confdefs.h"
1582
1583 int
1584 main ()
1585 {
1586
1587   ;
1588   return 0;
1589 }
1590 _ACEOF
1591 rm -f conftest.o conftest.obj
1592 if { (eval echo "$as_me:1592: \"$ac_compile\"") >&5
1593   (eval $ac_compile) 2>&5
1594   ac_status=$?
1595   echo "$as_me:1595: \$? = $ac_status" >&5
1596   (exit $ac_status); }; then
1597   for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
1598   case $ac_file in
1599     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.map | *.inf ) ;;
1600     *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
1601        break;;
1602   esac
1603 done
1604 else
1605   echo "$as_me: failed program was:" >&5
1606 cat conftest.$ac_ext >&5
1607 { { echo "$as_me:1607: error: cannot compute OBJEXT: cannot compile" >&5
1608 echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;}
1609    { (exit 1); exit 1; }; }
1610 fi
1611
1612 rm -f conftest.$ac_cv_objext conftest.$ac_ext
1613 fi
1614 echo "$as_me:1614: result: $ac_cv_objext" >&5
1615 echo "${ECHO_T}$ac_cv_objext" >&6
1616 OBJEXT=$ac_cv_objext
1617 ac_objext=$OBJEXT
1618 echo "$as_me:1618: checking whether we are using the GNU C compiler" >&5
1619 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
1620 if test "${ac_cv_c_compiler_gnu+set}" = set; then
1621   echo $ECHO_N "(cached) $ECHO_C" >&6
1622 else
1623   cat >conftest.$ac_ext <<_ACEOF
1624 #line 1624 "configure"
1625 #include "confdefs.h"
1626
1627 int
1628 main ()
1629 {
1630 #ifndef __GNUC__
1631        choke me
1632 #endif
1633
1634   ;
1635   return 0;
1636 }
1637 _ACEOF
1638 rm -f conftest.$ac_objext
1639 if { (eval echo "$as_me:1639: \"$ac_compile\"") >&5
1640   (eval $ac_compile) 2>&5
1641   ac_status=$?
1642   echo "$as_me:1642: \$? = $ac_status" >&5
1643   (exit $ac_status); } &&
1644          { ac_try='test -s conftest.$ac_objext'
1645   { (eval echo "$as_me:1645: \"$ac_try\"") >&5
1646   (eval $ac_try) 2>&5
1647   ac_status=$?
1648   echo "$as_me:1648: \$? = $ac_status" >&5
1649   (exit $ac_status); }; }; then
1650   ac_compiler_gnu=yes
1651 else
1652   echo "$as_me: failed program was:" >&5
1653 cat conftest.$ac_ext >&5
1654 ac_compiler_gnu=no
1655 fi
1656 rm -f conftest.$ac_objext conftest.$ac_ext
1657 ac_cv_c_compiler_gnu=$ac_compiler_gnu
1658
1659 fi
1660 echo "$as_me:1660: result: $ac_cv_c_compiler_gnu" >&5
1661 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
1662 GCC=`test $ac_compiler_gnu = yes && echo yes`
1663 ac_test_CFLAGS=${CFLAGS+set}
1664 ac_save_CFLAGS=$CFLAGS
1665 CFLAGS="-g"
1666 echo "$as_me:1666: checking whether $CC accepts -g" >&5
1667 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
1668 if test "${ac_cv_prog_cc_g+set}" = set; then
1669   echo $ECHO_N "(cached) $ECHO_C" >&6
1670 else
1671   cat >conftest.$ac_ext <<_ACEOF
1672 #line 1672 "configure"
1673 #include "confdefs.h"
1674
1675 int
1676 main ()
1677 {
1678
1679   ;
1680   return 0;
1681 }
1682 _ACEOF
1683 rm -f conftest.$ac_objext
1684 if { (eval echo "$as_me:1684: \"$ac_compile\"") >&5
1685   (eval $ac_compile) 2>&5
1686   ac_status=$?
1687   echo "$as_me:1687: \$? = $ac_status" >&5
1688   (exit $ac_status); } &&
1689          { ac_try='test -s conftest.$ac_objext'
1690   { (eval echo "$as_me:1690: \"$ac_try\"") >&5
1691   (eval $ac_try) 2>&5
1692   ac_status=$?
1693   echo "$as_me:1693: \$? = $ac_status" >&5
1694   (exit $ac_status); }; }; then
1695   ac_cv_prog_cc_g=yes
1696 else
1697   echo "$as_me: failed program was:" >&5
1698 cat conftest.$ac_ext >&5
1699 ac_cv_prog_cc_g=no
1700 fi
1701 rm -f conftest.$ac_objext conftest.$ac_ext
1702 fi
1703 echo "$as_me:1703: result: $ac_cv_prog_cc_g" >&5
1704 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
1705 if test "$ac_test_CFLAGS" = set; then
1706   CFLAGS=$ac_save_CFLAGS
1707 elif test $ac_cv_prog_cc_g = yes; then
1708   if test "$GCC" = yes; then
1709     CFLAGS="-g -O2"
1710   else
1711     CFLAGS="-g"
1712   fi
1713 else
1714   if test "$GCC" = yes; then
1715     CFLAGS="-O2"
1716   else
1717     CFLAGS=
1718   fi
1719 fi
1720 # Some people use a C++ compiler to compile C.  Since we use `exit',
1721 # in C++ we need to declare it.  In case someone uses the same compiler
1722 # for both compiling C and C++ we need to have the C++ compiler decide
1723 # the declaration of exit, since it's the most demanding environment.
1724 cat >conftest.$ac_ext <<_ACEOF
1725 #ifndef __cplusplus
1726   choke me
1727 #endif
1728 _ACEOF
1729 rm -f conftest.$ac_objext
1730 if { (eval echo "$as_me:1730: \"$ac_compile\"") >&5
1731   (eval $ac_compile) 2>&5
1732   ac_status=$?
1733   echo "$as_me:1733: \$? = $ac_status" >&5
1734   (exit $ac_status); } &&
1735          { ac_try='test -s conftest.$ac_objext'
1736   { (eval echo "$as_me:1736: \"$ac_try\"") >&5
1737   (eval $ac_try) 2>&5
1738   ac_status=$?
1739   echo "$as_me:1739: \$? = $ac_status" >&5
1740   (exit $ac_status); }; }; then
1741   for ac_declaration in \
1742    ''\
1743    '#include <stdlib.h>' \
1744    'extern "C" void std::exit (int) throw (); using std::exit;' \
1745    'extern "C" void std::exit (int); using std::exit;' \
1746    'extern "C" void exit (int) throw ();' \
1747    'extern "C" void exit (int);' \
1748    'void exit (int);'
1749 do
1750   cat >conftest.$ac_ext <<_ACEOF
1751 #line 1751 "configure"
1752 #include "confdefs.h"
1753 #include <stdlib.h>
1754 $ac_declaration
1755 int
1756 main ()
1757 {
1758 exit (42);
1759   ;
1760   return 0;
1761 }
1762 _ACEOF
1763 rm -f conftest.$ac_objext
1764 if { (eval echo "$as_me:1764: \"$ac_compile\"") >&5
1765   (eval $ac_compile) 2>&5
1766   ac_status=$?
1767   echo "$as_me:1767: \$? = $ac_status" >&5
1768   (exit $ac_status); } &&
1769          { ac_try='test -s conftest.$ac_objext'
1770   { (eval echo "$as_me:1770: \"$ac_try\"") >&5
1771   (eval $ac_try) 2>&5
1772   ac_status=$?
1773   echo "$as_me:1773: \$? = $ac_status" >&5
1774   (exit $ac_status); }; }; then
1775   :
1776 else
1777   echo "$as_me: failed program was:" >&5
1778 cat conftest.$ac_ext >&5
1779 continue
1780 fi
1781 rm -f conftest.$ac_objext conftest.$ac_ext
1782   cat >conftest.$ac_ext <<_ACEOF
1783 #line 1783 "configure"
1784 #include "confdefs.h"
1785 $ac_declaration
1786 int
1787 main ()
1788 {
1789 exit (42);
1790   ;
1791   return 0;
1792 }
1793 _ACEOF
1794 rm -f conftest.$ac_objext
1795 if { (eval echo "$as_me:1795: \"$ac_compile\"") >&5
1796   (eval $ac_compile) 2>&5
1797   ac_status=$?
1798   echo "$as_me:1798: \$? = $ac_status" >&5
1799   (exit $ac_status); } &&
1800          { ac_try='test -s conftest.$ac_objext'
1801   { (eval echo "$as_me:1801: \"$ac_try\"") >&5
1802   (eval $ac_try) 2>&5
1803   ac_status=$?
1804   echo "$as_me:1804: \$? = $ac_status" >&5
1805   (exit $ac_status); }; }; then
1806   break
1807 else
1808   echo "$as_me: failed program was:" >&5
1809 cat conftest.$ac_ext >&5
1810 fi
1811 rm -f conftest.$ac_objext conftest.$ac_ext
1812 done
1813 rm -rf conftest*
1814 if test -n "$ac_declaration"; then
1815   echo '#ifdef __cplusplus' >>confdefs.h
1816   echo $ac_declaration      >>confdefs.h
1817   echo '#endif'             >>confdefs.h
1818 fi
1819
1820 else
1821   echo "$as_me: failed program was:" >&5
1822 cat conftest.$ac_ext >&5
1823 fi
1824 rm -f conftest.$ac_objext conftest.$ac_ext
1825 ac_ext=c
1826 ac_cpp='$CPP $CPPFLAGS'
1827 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1828 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1829 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1830 ac_main_return=return
1831
1832 GCC_VERSION=none
1833 if test "$GCC" = yes ; then
1834         echo "$as_me:1834: checking version of $CC" >&5
1835 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
1836         GCC_VERSION="`${CC} --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(GCC[^)]*) //' -e 's/^.*(Debian[^)]*) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`"
1837         test -z "$GCC_VERSION" && GCC_VERSION=unknown
1838         echo "$as_me:1838: result: $GCC_VERSION" >&5
1839 echo "${ECHO_T}$GCC_VERSION" >&6
1840 fi
1841
1842 echo "$as_me:1842: checking for $CC option to accept ANSI C" >&5
1843 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
1844 if test "${ac_cv_prog_cc_stdc+set}" = set; then
1845   echo $ECHO_N "(cached) $ECHO_C" >&6
1846 else
1847   ac_cv_prog_cc_stdc=no
1848 ac_save_CC=$CC
1849 cat >conftest.$ac_ext <<_ACEOF
1850 #line 1850 "configure"
1851 #include "confdefs.h"
1852 #include <stdarg.h>
1853 #include <stdio.h>
1854 #include <sys/types.h>
1855 #include <sys/stat.h>
1856 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
1857 struct buf { int x; };
1858 FILE * (*rcsopen) (struct buf *, struct stat *, int);
1859 static char *e (p, i)
1860      char **p;
1861      int i;
1862 {
1863   return p[i];
1864 }
1865 static char *f (char * (*g) (char **, int), char **p, ...)
1866 {
1867   char *s;
1868   va_list v;
1869   va_start (v,p);
1870   s = g (p, va_arg (v,int));
1871   va_end (v);
1872   return s;
1873 }
1874 int test (int i, double x);
1875 struct s1 {int (*f) (int a);};
1876 struct s2 {int (*f) (double a);};
1877 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
1878 int argc;
1879 char **argv;
1880 int
1881 main ()
1882 {
1883 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
1884   ;
1885   return 0;
1886 }
1887 _ACEOF
1888 # Don't try gcc -ansi; that turns off useful extensions and
1889 # breaks some systems' header files.
1890 # AIX                   -qlanglvl=ansi
1891 # Ultrix and OSF/1      -std1
1892 # HP-UX 10.20 and later -Ae
1893 # HP-UX older versions  -Aa -D_HPUX_SOURCE
1894 # SVR4                  -Xc -D__EXTENSIONS__
1895 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
1896 do
1897   CC="$ac_save_CC $ac_arg"
1898   rm -f conftest.$ac_objext
1899 if { (eval echo "$as_me:1899: \"$ac_compile\"") >&5
1900   (eval $ac_compile) 2>&5
1901   ac_status=$?
1902   echo "$as_me:1902: \$? = $ac_status" >&5
1903   (exit $ac_status); } &&
1904          { ac_try='test -s conftest.$ac_objext'
1905   { (eval echo "$as_me:1905: \"$ac_try\"") >&5
1906   (eval $ac_try) 2>&5
1907   ac_status=$?
1908   echo "$as_me:1908: \$? = $ac_status" >&5
1909   (exit $ac_status); }; }; then
1910   ac_cv_prog_cc_stdc=$ac_arg
1911 break
1912 else
1913   echo "$as_me: failed program was:" >&5
1914 cat conftest.$ac_ext >&5
1915 fi
1916 rm -f conftest.$ac_objext
1917 done
1918 rm -f conftest.$ac_ext conftest.$ac_objext
1919 CC=$ac_save_CC
1920
1921 fi
1922
1923 case "x$ac_cv_prog_cc_stdc" in
1924   x|xno)
1925     echo "$as_me:1925: result: none needed" >&5
1926 echo "${ECHO_T}none needed" >&6 ;;
1927   *)
1928     echo "$as_me:1928: result: $ac_cv_prog_cc_stdc" >&5
1929 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
1930     CC="$CC $ac_cv_prog_cc_stdc" ;;
1931 esac
1932
1933 # This should have been defined by AC_PROG_CC
1934 : ${CC:=cc}
1935
1936 echo "$as_me:1936: checking \$CC variable" >&5
1937 echo $ECHO_N "checking \$CC variable... $ECHO_C" >&6
1938 case "$CC" in
1939 (*[\ \  ]-*)
1940         echo "$as_me:1940: result: broken" >&5
1941 echo "${ECHO_T}broken" >&6
1942         { echo "$as_me:1942: WARNING: your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options" >&5
1943 echo "$as_me: WARNING: your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options" >&2;}
1944         # humor him...
1945         cf_flags=`echo "$CC" | sed -e 's/^[^    ]*[     ][      ]*//'`
1946         CC=`echo "$CC " | sed -e 's/[   ]-[IUD][^       ][^     ]*//g' -e 's/[  ]*$//'`
1947
1948 cf_fix_cppflags=no
1949 cf_new_cflags=
1950 cf_new_cppflags=
1951 cf_new_extra_cppflags=
1952
1953 for cf_add_cflags in $cf_flags
1954 do
1955 case $cf_fix_cppflags in
1956 (no)
1957         case $cf_add_cflags in
1958         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
1959                 case $cf_add_cflags in
1960                 (-D*)
1961                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
1962
1963                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
1964                                 && test -z "${cf_tst_cflags}" \
1965                                 && cf_fix_cppflags=yes
1966
1967                         if test $cf_fix_cppflags = yes ; then
1968                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
1969                                 continue
1970                         elif test "${cf_tst_cflags}" = "\"'" ; then
1971                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
1972                                 continue
1973                         fi
1974                         ;;
1975                 esac
1976                 case "$CPPFLAGS" in
1977                 (*$cf_add_cflags)
1978                         ;;
1979                 (*)
1980                         case $cf_add_cflags in
1981                         (-D*)
1982                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
1983
1984 CPPFLAGS=`echo "$CPPFLAGS" | \
1985         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
1986                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
1987
1988                                 ;;
1989                         esac
1990                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
1991                         ;;
1992                 esac
1993                 ;;
1994         (*)
1995                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
1996                 ;;
1997         esac
1998         ;;
1999 (yes)
2000         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
2001
2002         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
2003
2004         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2005                 && test -z "${cf_tst_cflags}" \
2006                 && cf_fix_cppflags=no
2007         ;;
2008 esac
2009 done
2010
2011 if test -n "$cf_new_cflags" ; then
2012
2013         CFLAGS="$CFLAGS $cf_new_cflags"
2014 fi
2015
2016 if test -n "$cf_new_cppflags" ; then
2017
2018         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
2019 fi
2020
2021 if test -n "$cf_new_extra_cppflags" ; then
2022
2023         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
2024 fi
2025
2026         test -n "$verbose" && echo "    resulting CC: '$CC'" 1>&6
2027
2028 echo "${as_me:-configure}:2028: testing resulting CC: '$CC' ..." 1>&5
2029
2030         test -n "$verbose" && echo "    resulting CFLAGS: '$CFLAGS'" 1>&6
2031
2032 echo "${as_me:-configure}:2032: testing resulting CFLAGS: '$CFLAGS' ..." 1>&5
2033
2034         test -n "$verbose" && echo "    resulting CPPFLAGS: '$CPPFLAGS'" 1>&6
2035
2036 echo "${as_me:-configure}:2036: testing resulting CPPFLAGS: '$CPPFLAGS' ..." 1>&5
2037
2038         ;;
2039 (*)
2040         echo "$as_me:2040: result: ok" >&5
2041 echo "${ECHO_T}ok" >&6
2042         ;;
2043 esac
2044
2045 ac_ext=c
2046 ac_cpp='$CPP $CPPFLAGS'
2047 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2048 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2049 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2050 ac_main_return=return
2051 echo "$as_me:2051: checking how to run the C preprocessor" >&5
2052 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
2053 # On Suns, sometimes $CPP names a directory.
2054 if test -n "$CPP" && test -d "$CPP"; then
2055   CPP=
2056 fi
2057 if test -z "$CPP"; then
2058   if test "${ac_cv_prog_CPP+set}" = set; then
2059   echo $ECHO_N "(cached) $ECHO_C" >&6
2060 else
2061       # Double quotes because CPP needs to be expanded
2062     for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
2063     do
2064       ac_preproc_ok=false
2065 for ac_c_preproc_warn_flag in '' yes
2066 do
2067   # Use a header file that comes with gcc, so configuring glibc
2068   # with a fresh cross-compiler works.
2069   # On the NeXT, cc -E runs the code through the compiler's parser,
2070   # not just through cpp. "Syntax error" is here to catch this case.
2071   cat >conftest.$ac_ext <<_ACEOF
2072 #line 2072 "configure"
2073 #include "confdefs.h"
2074 #include <assert.h>
2075                      Syntax error
2076 _ACEOF
2077 if { (eval echo "$as_me:2077: \"$ac_cpp conftest.$ac_ext\"") >&5
2078   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2079   ac_status=$?
2080   egrep -v '^ *\+' conftest.er1 >conftest.err
2081   rm -f conftest.er1
2082   cat conftest.err >&5
2083   echo "$as_me:2083: \$? = $ac_status" >&5
2084   (exit $ac_status); } >/dev/null; then
2085   if test -s conftest.err; then
2086     ac_cpp_err=$ac_c_preproc_warn_flag
2087   else
2088     ac_cpp_err=
2089   fi
2090 else
2091   ac_cpp_err=yes
2092 fi
2093 if test -z "$ac_cpp_err"; then
2094   :
2095 else
2096   echo "$as_me: failed program was:" >&5
2097   cat conftest.$ac_ext >&5
2098   # Broken: fails on valid input.
2099 continue
2100 fi
2101 rm -f conftest.err conftest.$ac_ext
2102
2103   # OK, works on sane cases.  Now check whether non-existent headers
2104   # can be detected and how.
2105   cat >conftest.$ac_ext <<_ACEOF
2106 #line 2106 "configure"
2107 #include "confdefs.h"
2108 #include <ac_nonexistent.h>
2109 _ACEOF
2110 if { (eval echo "$as_me:2110: \"$ac_cpp conftest.$ac_ext\"") >&5
2111   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2112   ac_status=$?
2113   egrep -v '^ *\+' conftest.er1 >conftest.err
2114   rm -f conftest.er1
2115   cat conftest.err >&5
2116   echo "$as_me:2116: \$? = $ac_status" >&5
2117   (exit $ac_status); } >/dev/null; then
2118   if test -s conftest.err; then
2119     ac_cpp_err=$ac_c_preproc_warn_flag
2120   else
2121     ac_cpp_err=
2122   fi
2123 else
2124   ac_cpp_err=yes
2125 fi
2126 if test -z "$ac_cpp_err"; then
2127   # Broken: success on invalid input.
2128 continue
2129 else
2130   echo "$as_me: failed program was:" >&5
2131   cat conftest.$ac_ext >&5
2132   # Passes both tests.
2133 ac_preproc_ok=:
2134 break
2135 fi
2136 rm -f conftest.err conftest.$ac_ext
2137
2138 done
2139 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2140 rm -f conftest.err conftest.$ac_ext
2141 if $ac_preproc_ok; then
2142   break
2143 fi
2144
2145     done
2146     ac_cv_prog_CPP=$CPP
2147
2148 fi
2149   CPP=$ac_cv_prog_CPP
2150 else
2151   ac_cv_prog_CPP=$CPP
2152 fi
2153 echo "$as_me:2153: result: $CPP" >&5
2154 echo "${ECHO_T}$CPP" >&6
2155 ac_preproc_ok=false
2156 for ac_c_preproc_warn_flag in '' yes
2157 do
2158   # Use a header file that comes with gcc, so configuring glibc
2159   # with a fresh cross-compiler works.
2160   # On the NeXT, cc -E runs the code through the compiler's parser,
2161   # not just through cpp. "Syntax error" is here to catch this case.
2162   cat >conftest.$ac_ext <<_ACEOF
2163 #line 2163 "configure"
2164 #include "confdefs.h"
2165 #include <assert.h>
2166                      Syntax error
2167 _ACEOF
2168 if { (eval echo "$as_me:2168: \"$ac_cpp conftest.$ac_ext\"") >&5
2169   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2170   ac_status=$?
2171   egrep -v '^ *\+' conftest.er1 >conftest.err
2172   rm -f conftest.er1
2173   cat conftest.err >&5
2174   echo "$as_me:2174: \$? = $ac_status" >&5
2175   (exit $ac_status); } >/dev/null; then
2176   if test -s conftest.err; then
2177     ac_cpp_err=$ac_c_preproc_warn_flag
2178   else
2179     ac_cpp_err=
2180   fi
2181 else
2182   ac_cpp_err=yes
2183 fi
2184 if test -z "$ac_cpp_err"; then
2185   :
2186 else
2187   echo "$as_me: failed program was:" >&5
2188   cat conftest.$ac_ext >&5
2189   # Broken: fails on valid input.
2190 continue
2191 fi
2192 rm -f conftest.err conftest.$ac_ext
2193
2194   # OK, works on sane cases.  Now check whether non-existent headers
2195   # can be detected and how.
2196   cat >conftest.$ac_ext <<_ACEOF
2197 #line 2197 "configure"
2198 #include "confdefs.h"
2199 #include <ac_nonexistent.h>
2200 _ACEOF
2201 if { (eval echo "$as_me:2201: \"$ac_cpp conftest.$ac_ext\"") >&5
2202   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2203   ac_status=$?
2204   egrep -v '^ *\+' conftest.er1 >conftest.err
2205   rm -f conftest.er1
2206   cat conftest.err >&5
2207   echo "$as_me:2207: \$? = $ac_status" >&5
2208   (exit $ac_status); } >/dev/null; then
2209   if test -s conftest.err; then
2210     ac_cpp_err=$ac_c_preproc_warn_flag
2211   else
2212     ac_cpp_err=
2213   fi
2214 else
2215   ac_cpp_err=yes
2216 fi
2217 if test -z "$ac_cpp_err"; then
2218   # Broken: success on invalid input.
2219 continue
2220 else
2221   echo "$as_me: failed program was:" >&5
2222   cat conftest.$ac_ext >&5
2223   # Passes both tests.
2224 ac_preproc_ok=:
2225 break
2226 fi
2227 rm -f conftest.err conftest.$ac_ext
2228
2229 done
2230 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2231 rm -f conftest.err conftest.$ac_ext
2232 if $ac_preproc_ok; then
2233   :
2234 else
2235   { { echo "$as_me:2235: error: C preprocessor \"$CPP\" fails sanity check" >&5
2236 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;}
2237    { (exit 1); exit 1; }; }
2238 fi
2239
2240 ac_ext=c
2241 ac_cpp='$CPP $CPPFLAGS'
2242 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2243 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2244 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2245 ac_main_return=return
2246
2247 for ac_prog in mawk gawk nawk awk
2248 do
2249   # Extract the first word of "$ac_prog", so it can be a program name with args.
2250 set dummy $ac_prog; ac_word=$2
2251 echo "$as_me:2251: checking for $ac_word" >&5
2252 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2253 if test "${ac_cv_prog_AWK+set}" = set; then
2254   echo $ECHO_N "(cached) $ECHO_C" >&6
2255 else
2256   if test -n "$AWK"; then
2257   ac_cv_prog_AWK="$AWK" # Let the user override the test.
2258 else
2259   ac_save_IFS=$IFS; IFS=$ac_path_separator
2260 ac_dummy="$PATH"
2261 for ac_dir in $ac_dummy; do
2262   IFS=$ac_save_IFS
2263   test -z "$ac_dir" && ac_dir=.
2264   $as_executable_p "$ac_dir/$ac_word" || continue
2265 ac_cv_prog_AWK="$ac_prog"
2266 echo "$as_me:2266: found $ac_dir/$ac_word" >&5
2267 break
2268 done
2269
2270 fi
2271 fi
2272 AWK=$ac_cv_prog_AWK
2273 if test -n "$AWK"; then
2274   echo "$as_me:2274: result: $AWK" >&5
2275 echo "${ECHO_T}$AWK" >&6
2276 else
2277   echo "$as_me:2277: result: no" >&5
2278 echo "${ECHO_T}no" >&6
2279 fi
2280
2281   test -n "$AWK" && break
2282 done
2283
2284 # Find a good install program.  We prefer a C program (faster),
2285 # so one script is as good as another.  But avoid the broken or
2286 # incompatible versions:
2287 # SysV /etc/install, /usr/sbin/install
2288 # SunOS /usr/etc/install
2289 # IRIX /sbin/install
2290 # AIX /bin/install
2291 # AmigaOS /C/install, which installs bootblocks on floppy discs
2292 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2293 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2294 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2295 # ./install, which can be erroneously created by make from ./install.sh.
2296 echo "$as_me:2296: checking for a BSD compatible install" >&5
2297 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
2298 if test -z "$INSTALL"; then
2299 if test "${ac_cv_path_install+set}" = set; then
2300   echo $ECHO_N "(cached) $ECHO_C" >&6
2301 else
2302     ac_save_IFS=$IFS; IFS=$ac_path_separator
2303   for ac_dir in $PATH; do
2304     IFS=$ac_save_IFS
2305     # Account for people who put trailing slashes in PATH elements.
2306     case $ac_dir/ in
2307     / | ./ | .// | /cC/* \
2308     | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
2309     | /usr/ucb/* ) ;;
2310     *)
2311       # OSF1 and SCO ODT 3.0 have their own names for install.
2312       # Don't use installbsd from OSF since it installs stuff as root
2313       # by default.
2314       for ac_prog in ginstall scoinst install; do
2315         if $as_executable_p "$ac_dir/$ac_prog"; then
2316           if test $ac_prog = install &&
2317             grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2318             # AIX install.  It has an incompatible calling convention.
2319             :
2320           elif test $ac_prog = install &&
2321             grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2322             # program-specific install script used by HP pwplus--don't use.
2323             :
2324           else
2325             ac_cv_path_install="$ac_dir/$ac_prog -c"
2326             break 2
2327           fi
2328         fi
2329       done
2330       ;;
2331     esac
2332   done
2333
2334 fi
2335   if test "${ac_cv_path_install+set}" = set; then
2336     INSTALL=$ac_cv_path_install
2337   else
2338     # As a last resort, use the slow shell script.  We don't cache a
2339     # path for INSTALL within a source directory, because that will
2340     # break other packages using the cache if that directory is
2341     # removed, or if the path is relative.
2342     INSTALL=$ac_install_sh
2343   fi
2344 fi
2345 echo "$as_me:2345: result: $INSTALL" >&5
2346 echo "${ECHO_T}$INSTALL" >&6
2347
2348 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2349 # It thinks the first close brace ends the variable substitution.
2350 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2351
2352 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2353
2354 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2355
2356 case $INSTALL in
2357 (/*)
2358         ;;
2359 (*)
2360         cf_dir=`echo $INSTALL | sed -e 's%/[^/]*$%%'`
2361         test -z "$cf_dir" && cf_dir=.
2362         INSTALL=`cd $cf_dir && pwd`/`echo $INSTALL | sed -e 's%^.*/%%'`
2363         ;;
2364 esac
2365
2366 for ac_prog in lint cppcheck splint
2367 do
2368   # Extract the first word of "$ac_prog", so it can be a program name with args.
2369 set dummy $ac_prog; ac_word=$2
2370 echo "$as_me:2370: checking for $ac_word" >&5
2371 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2372 if test "${ac_cv_prog_LINT+set}" = set; then
2373   echo $ECHO_N "(cached) $ECHO_C" >&6
2374 else
2375   if test -n "$LINT"; then
2376   ac_cv_prog_LINT="$LINT" # Let the user override the test.
2377 else
2378   ac_save_IFS=$IFS; IFS=$ac_path_separator
2379 ac_dummy="$PATH"
2380 for ac_dir in $ac_dummy; do
2381   IFS=$ac_save_IFS
2382   test -z "$ac_dir" && ac_dir=.
2383   $as_executable_p "$ac_dir/$ac_word" || continue
2384 ac_cv_prog_LINT="$ac_prog"
2385 echo "$as_me:2385: found $ac_dir/$ac_word" >&5
2386 break
2387 done
2388
2389 fi
2390 fi
2391 LINT=$ac_cv_prog_LINT
2392 if test -n "$LINT"; then
2393   echo "$as_me:2393: result: $LINT" >&5
2394 echo "${ECHO_T}$LINT" >&6
2395 else
2396   echo "$as_me:2396: result: no" >&5
2397 echo "${ECHO_T}no" >&6
2398 fi
2399
2400   test -n "$LINT" && break
2401 done
2402
2403 echo "$as_me:2403: checking if filesystem supports mixed-case filenames" >&5
2404 echo $ECHO_N "checking if filesystem supports mixed-case filenames... $ECHO_C" >&6
2405 if test "${cf_cv_mixedcase+set}" = set; then
2406   echo $ECHO_N "(cached) $ECHO_C" >&6
2407 else
2408
2409 if test "$cross_compiling" = yes ; then
2410         case $target_alias in
2411         (*-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw*|*-uwin*)
2412                 cf_cv_mixedcase=no
2413                 ;;
2414         (*)
2415                 cf_cv_mixedcase=yes
2416                 ;;
2417         esac
2418 else
2419         rm -f conftest CONFTEST
2420         echo test >conftest
2421         if test -f CONFTEST ; then
2422                 cf_cv_mixedcase=no
2423         else
2424                 cf_cv_mixedcase=yes
2425         fi
2426         rm -f conftest CONFTEST
2427 fi
2428
2429 fi
2430 echo "$as_me:2430: result: $cf_cv_mixedcase" >&5
2431 echo "${ECHO_T}$cf_cv_mixedcase" >&6
2432 test "$cf_cv_mixedcase" = yes &&
2433 cat >>confdefs.h <<\EOF
2434 #define MIXEDCASE_FILENAMES 1
2435 EOF
2436
2437 for ac_prog in exctags ctags
2438 do
2439   # Extract the first word of "$ac_prog", so it can be a program name with args.
2440 set dummy $ac_prog; ac_word=$2
2441 echo "$as_me:2441: checking for $ac_word" >&5
2442 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2443 if test "${ac_cv_prog_CTAGS+set}" = set; then
2444   echo $ECHO_N "(cached) $ECHO_C" >&6
2445 else
2446   if test -n "$CTAGS"; then
2447   ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test.
2448 else
2449   ac_save_IFS=$IFS; IFS=$ac_path_separator
2450 ac_dummy="$PATH"
2451 for ac_dir in $ac_dummy; do
2452   IFS=$ac_save_IFS
2453   test -z "$ac_dir" && ac_dir=.
2454   $as_executable_p "$ac_dir/$ac_word" || continue
2455 ac_cv_prog_CTAGS="$ac_prog"
2456 echo "$as_me:2456: found $ac_dir/$ac_word" >&5
2457 break
2458 done
2459
2460 fi
2461 fi
2462 CTAGS=$ac_cv_prog_CTAGS
2463 if test -n "$CTAGS"; then
2464   echo "$as_me:2464: result: $CTAGS" >&5
2465 echo "${ECHO_T}$CTAGS" >&6
2466 else
2467   echo "$as_me:2467: result: no" >&5
2468 echo "${ECHO_T}no" >&6
2469 fi
2470
2471   test -n "$CTAGS" && break
2472 done
2473
2474 for ac_prog in exetags etags
2475 do
2476   # Extract the first word of "$ac_prog", so it can be a program name with args.
2477 set dummy $ac_prog; ac_word=$2
2478 echo "$as_me:2478: checking for $ac_word" >&5
2479 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2480 if test "${ac_cv_prog_ETAGS+set}" = set; then
2481   echo $ECHO_N "(cached) $ECHO_C" >&6
2482 else
2483   if test -n "$ETAGS"; then
2484   ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test.
2485 else
2486   ac_save_IFS=$IFS; IFS=$ac_path_separator
2487 ac_dummy="$PATH"
2488 for ac_dir in $ac_dummy; do
2489   IFS=$ac_save_IFS
2490   test -z "$ac_dir" && ac_dir=.
2491   $as_executable_p "$ac_dir/$ac_word" || continue
2492 ac_cv_prog_ETAGS="$ac_prog"
2493 echo "$as_me:2493: found $ac_dir/$ac_word" >&5
2494 break
2495 done
2496
2497 fi
2498 fi
2499 ETAGS=$ac_cv_prog_ETAGS
2500 if test -n "$ETAGS"; then
2501   echo "$as_me:2501: result: $ETAGS" >&5
2502 echo "${ECHO_T}$ETAGS" >&6
2503 else
2504   echo "$as_me:2504: result: no" >&5
2505 echo "${ECHO_T}no" >&6
2506 fi
2507
2508   test -n "$ETAGS" && break
2509 done
2510
2511 # Extract the first word of "${CTAGS:-ctags}", so it can be a program name with args.
2512 set dummy ${CTAGS:-ctags}; ac_word=$2
2513 echo "$as_me:2513: checking for $ac_word" >&5
2514 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2515 if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" = set; then
2516   echo $ECHO_N "(cached) $ECHO_C" >&6
2517 else
2518   if test -n "$MAKE_LOWER_TAGS"; then
2519   ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test.
2520 else
2521   ac_save_IFS=$IFS; IFS=$ac_path_separator
2522 ac_dummy="$PATH"
2523 for ac_dir in $ac_dummy; do
2524   IFS=$ac_save_IFS
2525   test -z "$ac_dir" && ac_dir=.
2526   $as_executable_p "$ac_dir/$ac_word" || continue
2527 ac_cv_prog_MAKE_LOWER_TAGS="yes"
2528 echo "$as_me:2528: found $ac_dir/$ac_word" >&5
2529 break
2530 done
2531
2532   test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no"
2533 fi
2534 fi
2535 MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS
2536 if test -n "$MAKE_LOWER_TAGS"; then
2537   echo "$as_me:2537: result: $MAKE_LOWER_TAGS" >&5
2538 echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6
2539 else
2540   echo "$as_me:2540: result: no" >&5
2541 echo "${ECHO_T}no" >&6
2542 fi
2543
2544 if test "$cf_cv_mixedcase" = yes ; then
2545         # Extract the first word of "${ETAGS:-etags}", so it can be a program name with args.
2546 set dummy ${ETAGS:-etags}; ac_word=$2
2547 echo "$as_me:2547: checking for $ac_word" >&5
2548 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2549 if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" = set; then
2550   echo $ECHO_N "(cached) $ECHO_C" >&6
2551 else
2552   if test -n "$MAKE_UPPER_TAGS"; then
2553   ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test.
2554 else
2555   ac_save_IFS=$IFS; IFS=$ac_path_separator
2556 ac_dummy="$PATH"
2557 for ac_dir in $ac_dummy; do
2558   IFS=$ac_save_IFS
2559   test -z "$ac_dir" && ac_dir=.
2560   $as_executable_p "$ac_dir/$ac_word" || continue
2561 ac_cv_prog_MAKE_UPPER_TAGS="yes"
2562 echo "$as_me:2562: found $ac_dir/$ac_word" >&5
2563 break
2564 done
2565
2566   test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no"
2567 fi
2568 fi
2569 MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS
2570 if test -n "$MAKE_UPPER_TAGS"; then
2571   echo "$as_me:2571: result: $MAKE_UPPER_TAGS" >&5
2572 echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6
2573 else
2574   echo "$as_me:2574: result: no" >&5
2575 echo "${ECHO_T}no" >&6
2576 fi
2577
2578 else
2579         MAKE_UPPER_TAGS=no
2580 fi
2581
2582 if test "$MAKE_UPPER_TAGS" = yes ; then
2583         MAKE_UPPER_TAGS=
2584 else
2585         MAKE_UPPER_TAGS="#"
2586 fi
2587
2588 if test "$MAKE_LOWER_TAGS" = yes ; then
2589         MAKE_LOWER_TAGS=
2590 else
2591         MAKE_LOWER_TAGS="#"
2592 fi
2593
2594 echo "$as_me:2594: checking if -lm needed for math functions" >&5
2595 echo $ECHO_N "checking if -lm needed for math functions... $ECHO_C" >&6
2596 if test "${cf_cv_need_libm+set}" = set; then
2597   echo $ECHO_N "(cached) $ECHO_C" >&6
2598 else
2599
2600         cat >conftest.$ac_ext <<_ACEOF
2601 #line 2601 "configure"
2602 #include "confdefs.h"
2603
2604         #include <stdio.h>
2605         #include <math.h>
2606
2607 int
2608 main ()
2609 {
2610 double x = rand(); printf("result = %g\n", pow(sin(x),x))
2611   ;
2612   return 0;
2613 }
2614 _ACEOF
2615 rm -f conftest.$ac_objext conftest$ac_exeext
2616 if { (eval echo "$as_me:2616: \"$ac_link\"") >&5
2617   (eval $ac_link) 2>&5
2618   ac_status=$?
2619   echo "$as_me:2619: \$? = $ac_status" >&5
2620   (exit $ac_status); } &&
2621          { ac_try='test -s conftest$ac_exeext'
2622   { (eval echo "$as_me:2622: \"$ac_try\"") >&5
2623   (eval $ac_try) 2>&5
2624   ac_status=$?
2625   echo "$as_me:2625: \$? = $ac_status" >&5
2626   (exit $ac_status); }; }; then
2627   cf_cv_need_libm=no
2628 else
2629   echo "$as_me: failed program was:" >&5
2630 cat conftest.$ac_ext >&5
2631 cf_cv_need_libm=yes
2632 fi
2633 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
2634 fi
2635 echo "$as_me:2635: result: $cf_cv_need_libm" >&5
2636 echo "${ECHO_T}$cf_cv_need_libm" >&6
2637 if test "$cf_cv_need_libm" = yes
2638 then
2639 MATH_LIB=-lm
2640 fi
2641
2642 top_builddir=`pwd`
2643
2644 CC_G_OPT="-g"
2645 CC_SHARED_OPTS=unknown
2646 CPPFLAGS="$CPPFLAGS"
2647 DFT_DEP_SUFFIX=""
2648 DFT_OBJ_SUBDIR=`pwd|sed -e's:.*/::'`
2649 DFT_UPR_MODEL="NORMAL"
2650 LD="ld"
2651 LDFLAGS_SHARED=""
2652 LDFLAGS_STATIC=""
2653 LD_MODEL=""
2654 LD_SHARED_OPTS=""
2655 LIBTOOL=""
2656 LIBTOOL_OPTS=""
2657 LIB_CLEAN=""
2658 LIB_COMPILE=""
2659 LIB_LINK='${CC}'
2660 LINK_TESTS=""
2661 LOCAL_LDFLAGS=""
2662 PACKAGE="ncurses-examples"
2663 PTHREAD="-lm"
2664 TEST_ARGS=""
2665 TEST_DEPS=""
2666 TEST_LIBS=""
2667 TINFO_LDFLAGS=''
2668 TINFO_LIBS='$(LIBS_CURSES)'
2669 cf_cv_abi_version=""
2670 cf_cv_rel_version=""
2671 includesubdir=""
2672
2673 cf_cv_screen=curses
2674 cf_cv_libtype=
2675
2676 if test "$GCC" = yes
2677 then
2678 cat > conftest.i <<EOF
2679 #ifndef GCC_PRINTF
2680 #define GCC_PRINTF 0
2681 #endif
2682 #ifndef GCC_SCANF
2683 #define GCC_SCANF 0
2684 #endif
2685 #ifndef GCC_NORETURN
2686 #define GCC_NORETURN /* nothing */
2687 #endif
2688 #ifndef GCC_UNUSED
2689 #define GCC_UNUSED /* nothing */
2690 #endif
2691 EOF
2692 if test "$GCC" = yes
2693 then
2694         { echo "$as_me:2694: checking for $CC __attribute__ directives..." >&5
2695 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
2696 cat > conftest.$ac_ext <<EOF
2697 #line 2697 "${as_me:-configure}"
2698 #include "confdefs.h"
2699 #include "conftest.h"
2700 #include "conftest.i"
2701 #if     GCC_PRINTF
2702 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
2703 #else
2704 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
2705 #endif
2706 #if     GCC_SCANF
2707 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
2708 #else
2709 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
2710 #endif
2711 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
2712 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
2713 extern void foo(void) GCC_NORETURN;
2714 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
2715 EOF
2716         cf_printf_attribute=no
2717         cf_scanf_attribute=no
2718         for cf_attribute in scanf printf unused noreturn
2719         do
2720
2721 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
2722
2723                 cf_directive="__attribute__(($cf_attribute))"
2724                 echo "checking for $CC $cf_directive" 1>&5
2725
2726                 case $cf_attribute in
2727                 (printf)
2728                         cf_printf_attribute=yes
2729                         cat >conftest.h <<EOF
2730 #define GCC_$cf_ATTRIBUTE 1
2731 EOF
2732                         ;;
2733                 (scanf)
2734                         cf_scanf_attribute=yes
2735                         cat >conftest.h <<EOF
2736 #define GCC_$cf_ATTRIBUTE 1
2737 EOF
2738                         ;;
2739                 (*)
2740                         cat >conftest.h <<EOF
2741 #define GCC_$cf_ATTRIBUTE $cf_directive
2742 EOF
2743                         ;;
2744                 esac
2745
2746                 if { (eval echo "$as_me:2746: \"$ac_compile\"") >&5
2747   (eval $ac_compile) 2>&5
2748   ac_status=$?
2749   echo "$as_me:2749: \$? = $ac_status" >&5
2750   (exit $ac_status); }; then
2751                         test -n "$verbose" && echo "$as_me:2751: result: ... $cf_attribute" >&5
2752 echo "${ECHO_T}... $cf_attribute" >&6
2753                         cat conftest.h >>confdefs.h
2754                         case $cf_attribute in
2755                         (noreturn)
2756
2757 cat >>confdefs.h <<EOF
2758 #define GCC_NORETURN $cf_directive
2759 EOF
2760
2761                                 ;;
2762                         (printf)
2763                                 cf_value='/* nothing */'
2764                                 if test "$cf_printf_attribute" != no ; then
2765                                         cf_value='__attribute__((format(printf,fmt,var)))'
2766
2767 cat >>confdefs.h <<\EOF
2768 #define GCC_PRINTF 1
2769 EOF
2770
2771                                 fi
2772
2773 cat >>confdefs.h <<EOF
2774 #define GCC_PRINTFLIKE(fmt,var) $cf_value
2775 EOF
2776
2777                                 ;;
2778                         (scanf)
2779                                 cf_value='/* nothing */'
2780                                 if test "$cf_scanf_attribute" != no ; then
2781                                         cf_value='__attribute__((format(scanf,fmt,var)))'
2782
2783 cat >>confdefs.h <<\EOF
2784 #define GCC_SCANF 1
2785 EOF
2786
2787                                 fi
2788
2789 cat >>confdefs.h <<EOF
2790 #define GCC_SCANFLIKE(fmt,var) $cf_value
2791 EOF
2792
2793                                 ;;
2794                         (unused)
2795
2796 cat >>confdefs.h <<EOF
2797 #define GCC_UNUSED $cf_directive
2798 EOF
2799
2800                                 ;;
2801                         esac
2802                 fi
2803         done
2804 else
2805         fgrep define conftest.i >>confdefs.h
2806 fi
2807 rm -rf conftest*
2808 fi
2809
2810 cf_XOPEN_SOURCE=500
2811 cf_POSIX_C_SOURCE=199506L
2812 cf_xopen_source=
2813
2814 case $host_os in
2815 (aix[4-7]*)
2816         cf_xopen_source="-D_ALL_SOURCE"
2817         ;;
2818 (cygwin|msys)
2819         cf_XOPEN_SOURCE=600
2820         ;;
2821 (darwin[0-8].*)
2822         cf_xopen_source="-D_APPLE_C_SOURCE"
2823         ;;
2824 (darwin*)
2825         cf_xopen_source="-D_DARWIN_C_SOURCE"
2826         cf_XOPEN_SOURCE=
2827         ;;
2828 (freebsd*|dragonfly*)
2829         # 5.x headers associate
2830         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
2831         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
2832         cf_POSIX_C_SOURCE=200112L
2833         cf_XOPEN_SOURCE=600
2834         cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
2835         ;;
2836 (hpux11*)
2837         cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
2838         ;;
2839 (hpux*)
2840         cf_xopen_source="-D_HPUX_SOURCE"
2841         ;;
2842 (irix[56].*)
2843         cf_xopen_source="-D_SGI_SOURCE"
2844         cf_XOPEN_SOURCE=
2845         ;;
2846 (linux*|gnu*|mint*|k*bsd*-gnu)
2847
2848 echo "$as_me:2848: checking if we must define _GNU_SOURCE" >&5
2849 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
2850 if test "${cf_cv_gnu_source+set}" = set; then
2851   echo $ECHO_N "(cached) $ECHO_C" >&6
2852 else
2853
2854 cat >conftest.$ac_ext <<_ACEOF
2855 #line 2855 "configure"
2856 #include "confdefs.h"
2857 #include <sys/types.h>
2858 int
2859 main ()
2860 {
2861
2862 #ifndef _XOPEN_SOURCE
2863 make an error
2864 #endif
2865   ;
2866   return 0;
2867 }
2868 _ACEOF
2869 rm -f conftest.$ac_objext
2870 if { (eval echo "$as_me:2870: \"$ac_compile\"") >&5
2871   (eval $ac_compile) 2>&5
2872   ac_status=$?
2873   echo "$as_me:2873: \$? = $ac_status" >&5
2874   (exit $ac_status); } &&
2875          { ac_try='test -s conftest.$ac_objext'
2876   { (eval echo "$as_me:2876: \"$ac_try\"") >&5
2877   (eval $ac_try) 2>&5
2878   ac_status=$?
2879   echo "$as_me:2879: \$? = $ac_status" >&5
2880   (exit $ac_status); }; }; then
2881   cf_cv_gnu_source=no
2882 else
2883   echo "$as_me: failed program was:" >&5
2884 cat conftest.$ac_ext >&5
2885 cf_save="$CPPFLAGS"
2886          CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
2887          cat >conftest.$ac_ext <<_ACEOF
2888 #line 2888 "configure"
2889 #include "confdefs.h"
2890 #include <sys/types.h>
2891 int
2892 main ()
2893 {
2894
2895 #ifdef _XOPEN_SOURCE
2896 make an error
2897 #endif
2898   ;
2899   return 0;
2900 }
2901 _ACEOF
2902 rm -f conftest.$ac_objext
2903 if { (eval echo "$as_me:2903: \"$ac_compile\"") >&5
2904   (eval $ac_compile) 2>&5
2905   ac_status=$?
2906   echo "$as_me:2906: \$? = $ac_status" >&5
2907   (exit $ac_status); } &&
2908          { ac_try='test -s conftest.$ac_objext'
2909   { (eval echo "$as_me:2909: \"$ac_try\"") >&5
2910   (eval $ac_try) 2>&5
2911   ac_status=$?
2912   echo "$as_me:2912: \$? = $ac_status" >&5
2913   (exit $ac_status); }; }; then
2914   cf_cv_gnu_source=no
2915 else
2916   echo "$as_me: failed program was:" >&5
2917 cat conftest.$ac_ext >&5
2918 cf_cv_gnu_source=yes
2919 fi
2920 rm -f conftest.$ac_objext conftest.$ac_ext
2921         CPPFLAGS="$cf_save"
2922
2923 fi
2924 rm -f conftest.$ac_objext conftest.$ac_ext
2925
2926 fi
2927 echo "$as_me:2927: result: $cf_cv_gnu_source" >&5
2928 echo "${ECHO_T}$cf_cv_gnu_source" >&6
2929
2930 if test "$cf_cv_gnu_source" = yes
2931 then
2932 echo "$as_me:2932: checking if we should also define _DEFAULT_SOURCE" >&5
2933 echo $ECHO_N "checking if we should also define _DEFAULT_SOURCE... $ECHO_C" >&6
2934 if test "${cf_cv_default_source+set}" = set; then
2935   echo $ECHO_N "(cached) $ECHO_C" >&6
2936 else
2937
2938 CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
2939         cat >conftest.$ac_ext <<_ACEOF
2940 #line 2940 "configure"
2941 #include "confdefs.h"
2942 #include <sys/types.h>
2943 int
2944 main ()
2945 {
2946
2947 #ifdef _DEFAULT_SOURCE
2948 make an error
2949 #endif
2950   ;
2951   return 0;
2952 }
2953 _ACEOF
2954 rm -f conftest.$ac_objext
2955 if { (eval echo "$as_me:2955: \"$ac_compile\"") >&5
2956   (eval $ac_compile) 2>&5
2957   ac_status=$?
2958   echo "$as_me:2958: \$? = $ac_status" >&5
2959   (exit $ac_status); } &&
2960          { ac_try='test -s conftest.$ac_objext'
2961   { (eval echo "$as_me:2961: \"$ac_try\"") >&5
2962   (eval $ac_try) 2>&5
2963   ac_status=$?
2964   echo "$as_me:2964: \$? = $ac_status" >&5
2965   (exit $ac_status); }; }; then
2966   cf_cv_default_source=no
2967 else
2968   echo "$as_me: failed program was:" >&5
2969 cat conftest.$ac_ext >&5
2970 cf_cv_default_source=yes
2971 fi
2972 rm -f conftest.$ac_objext conftest.$ac_ext
2973
2974 fi
2975 echo "$as_me:2975: result: $cf_cv_default_source" >&5
2976 echo "${ECHO_T}$cf_cv_default_source" >&6
2977 test "$cf_cv_default_source" = yes && CPPFLAGS="$CPPFLAGS -D_DEFAULT_SOURCE"
2978 fi
2979
2980         ;;
2981 (minix*)
2982         cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this...
2983         ;;
2984 (mirbsd*)
2985         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
2986         cf_XOPEN_SOURCE=
2987
2988 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
2989
2990 cf_save_CFLAGS="$CFLAGS"
2991 cf_save_CPPFLAGS="$CPPFLAGS"
2992
2993 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
2994         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
2995                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
2996
2997 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
2998         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
2999                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
3000
3001 echo "$as_me:3001: checking if we should define _POSIX_C_SOURCE" >&5
3002 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
3003 if test "${cf_cv_posix_c_source+set}" = set; then
3004   echo $ECHO_N "(cached) $ECHO_C" >&6
3005 else
3006
3007 echo "${as_me:-configure}:3007: testing if the symbol is already defined go no further ..." 1>&5
3008
3009         cat >conftest.$ac_ext <<_ACEOF
3010 #line 3010 "configure"
3011 #include "confdefs.h"
3012 #include <sys/types.h>
3013 int
3014 main ()
3015 {
3016
3017 #ifndef _POSIX_C_SOURCE
3018 make an error
3019 #endif
3020   ;
3021   return 0;
3022 }
3023 _ACEOF
3024 rm -f conftest.$ac_objext
3025 if { (eval echo "$as_me:3025: \"$ac_compile\"") >&5
3026   (eval $ac_compile) 2>&5
3027   ac_status=$?
3028   echo "$as_me:3028: \$? = $ac_status" >&5
3029   (exit $ac_status); } &&
3030          { ac_try='test -s conftest.$ac_objext'
3031   { (eval echo "$as_me:3031: \"$ac_try\"") >&5
3032   (eval $ac_try) 2>&5
3033   ac_status=$?
3034   echo "$as_me:3034: \$? = $ac_status" >&5
3035   (exit $ac_status); }; }; then
3036   cf_cv_posix_c_source=no
3037 else
3038   echo "$as_me: failed program was:" >&5
3039 cat conftest.$ac_ext >&5
3040 cf_want_posix_source=no
3041          case .$cf_POSIX_C_SOURCE in
3042          (.[12]??*)
3043                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
3044                 ;;
3045          (.2)
3046                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
3047                 cf_want_posix_source=yes
3048                 ;;
3049          (.*)
3050                 cf_want_posix_source=yes
3051                 ;;
3052          esac
3053          if test "$cf_want_posix_source" = yes ; then
3054                 cat >conftest.$ac_ext <<_ACEOF
3055 #line 3055 "configure"
3056 #include "confdefs.h"
3057 #include <sys/types.h>
3058 int
3059 main ()
3060 {
3061
3062 #ifdef _POSIX_SOURCE
3063 make an error
3064 #endif
3065   ;
3066   return 0;
3067 }
3068 _ACEOF
3069 rm -f conftest.$ac_objext
3070 if { (eval echo "$as_me:3070: \"$ac_compile\"") >&5
3071   (eval $ac_compile) 2>&5
3072   ac_status=$?
3073   echo "$as_me:3073: \$? = $ac_status" >&5
3074   (exit $ac_status); } &&
3075          { ac_try='test -s conftest.$ac_objext'
3076   { (eval echo "$as_me:3076: \"$ac_try\"") >&5
3077   (eval $ac_try) 2>&5
3078   ac_status=$?
3079   echo "$as_me:3079: \$? = $ac_status" >&5
3080   (exit $ac_status); }; }; then
3081   :
3082 else
3083   echo "$as_me: failed program was:" >&5
3084 cat conftest.$ac_ext >&5
3085 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
3086 fi
3087 rm -f conftest.$ac_objext conftest.$ac_ext
3088          fi
3089
3090 echo "${as_me:-configure}:3090: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
3091
3092          CFLAGS="$cf_trim_CFLAGS"
3093          CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
3094
3095 echo "${as_me:-configure}:3095: testing if the second compile does not leave our definition intact error ..." 1>&5
3096
3097          cat >conftest.$ac_ext <<_ACEOF
3098 #line 3098 "configure"
3099 #include "confdefs.h"
3100 #include <sys/types.h>
3101 int
3102 main ()
3103 {
3104
3105 #ifndef _POSIX_C_SOURCE
3106 make an error
3107 #endif
3108   ;
3109   return 0;
3110 }
3111 _ACEOF
3112 rm -f conftest.$ac_objext
3113 if { (eval echo "$as_me:3113: \"$ac_compile\"") >&5
3114   (eval $ac_compile) 2>&5
3115   ac_status=$?
3116   echo "$as_me:3116: \$? = $ac_status" >&5
3117   (exit $ac_status); } &&
3118          { ac_try='test -s conftest.$ac_objext'
3119   { (eval echo "$as_me:3119: \"$ac_try\"") >&5
3120   (eval $ac_try) 2>&5
3121   ac_status=$?
3122   echo "$as_me:3122: \$? = $ac_status" >&5
3123   (exit $ac_status); }; }; then
3124   :
3125 else
3126   echo "$as_me: failed program was:" >&5
3127 cat conftest.$ac_ext >&5
3128 cf_cv_posix_c_source=no
3129 fi
3130 rm -f conftest.$ac_objext conftest.$ac_ext
3131          CFLAGS="$cf_save_CFLAGS"
3132          CPPFLAGS="$cf_save_CPPFLAGS"
3133
3134 fi
3135 rm -f conftest.$ac_objext conftest.$ac_ext
3136
3137 fi
3138 echo "$as_me:3138: result: $cf_cv_posix_c_source" >&5
3139 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
3140
3141 if test "$cf_cv_posix_c_source" != no ; then
3142         CFLAGS="$cf_trim_CFLAGS"
3143         CPPFLAGS="$cf_trim_CPPFLAGS"
3144
3145 cf_fix_cppflags=no
3146 cf_new_cflags=
3147 cf_new_cppflags=
3148 cf_new_extra_cppflags=
3149
3150 for cf_add_cflags in $cf_cv_posix_c_source
3151 do
3152 case $cf_fix_cppflags in
3153 (no)
3154         case $cf_add_cflags in
3155         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
3156                 case $cf_add_cflags in
3157                 (-D*)
3158                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3159
3160                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3161                                 && test -z "${cf_tst_cflags}" \
3162                                 && cf_fix_cppflags=yes
3163
3164                         if test $cf_fix_cppflags = yes ; then
3165                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3166                                 continue
3167                         elif test "${cf_tst_cflags}" = "\"'" ; then
3168                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3169                                 continue
3170                         fi
3171                         ;;
3172                 esac
3173                 case "$CPPFLAGS" in
3174                 (*$cf_add_cflags)
3175                         ;;
3176                 (*)
3177                         case $cf_add_cflags in
3178                         (-D*)
3179                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3180
3181 CPPFLAGS=`echo "$CPPFLAGS" | \
3182         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3183                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3184
3185                                 ;;
3186                         esac
3187                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3188                         ;;
3189                 esac
3190                 ;;
3191         (*)
3192                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
3193                 ;;
3194         esac
3195         ;;
3196 (yes)
3197         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3198
3199         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3200
3201         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3202                 && test -z "${cf_tst_cflags}" \
3203                 && cf_fix_cppflags=no
3204         ;;
3205 esac
3206 done
3207
3208 if test -n "$cf_new_cflags" ; then
3209
3210         CFLAGS="$CFLAGS $cf_new_cflags"
3211 fi
3212
3213 if test -n "$cf_new_cppflags" ; then
3214
3215         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
3216 fi
3217
3218 if test -n "$cf_new_extra_cppflags" ; then
3219
3220         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
3221 fi
3222
3223 fi
3224
3225         ;;
3226 (netbsd*)
3227         cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
3228         ;;
3229 (openbsd[4-9]*)
3230         # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
3231         cf_xopen_source="-D_BSD_SOURCE"
3232         cf_XOPEN_SOURCE=600
3233         ;;
3234 (openbsd*)
3235         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
3236         ;;
3237 (os2*)
3238         cf_XOPEN_SOURCE=
3239         ;;
3240 (osf[45]*)
3241         cf_xopen_source="-D_OSF_SOURCE"
3242         ;;
3243 (nto-qnx*)
3244         cf_xopen_source="-D_QNX_SOURCE"
3245         ;;
3246 (sco*)
3247         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
3248         ;;
3249 (solaris2.*)
3250         cf_xopen_source="-D__EXTENSIONS__"
3251         cf_cv_xopen_source=broken
3252         ;;
3253 (sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
3254         cf_XOPEN_SOURCE=
3255         cf_POSIX_C_SOURCE=
3256         ;;
3257 (*)
3258
3259 echo "$as_me:3259: checking if we should define _XOPEN_SOURCE" >&5
3260 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
3261 if test "${cf_cv_xopen_source+set}" = set; then
3262   echo $ECHO_N "(cached) $ECHO_C" >&6
3263 else
3264
3265         cat >conftest.$ac_ext <<_ACEOF
3266 #line 3266 "configure"
3267 #include "confdefs.h"
3268
3269 #include <stdlib.h>
3270 #include <string.h>
3271 #include <sys/types.h>
3272
3273 int
3274 main ()
3275 {
3276
3277 #ifndef _XOPEN_SOURCE
3278 make an error
3279 #endif
3280   ;
3281   return 0;
3282 }
3283 _ACEOF
3284 rm -f conftest.$ac_objext
3285 if { (eval echo "$as_me:3285: \"$ac_compile\"") >&5
3286   (eval $ac_compile) 2>&5
3287   ac_status=$?
3288   echo "$as_me:3288: \$? = $ac_status" >&5
3289   (exit $ac_status); } &&
3290          { ac_try='test -s conftest.$ac_objext'
3291   { (eval echo "$as_me:3291: \"$ac_try\"") >&5
3292   (eval $ac_try) 2>&5
3293   ac_status=$?
3294   echo "$as_me:3294: \$? = $ac_status" >&5
3295   (exit $ac_status); }; }; then
3296   cf_cv_xopen_source=no
3297 else
3298   echo "$as_me: failed program was:" >&5
3299 cat conftest.$ac_ext >&5
3300 cf_save="$CPPFLAGS"
3301          CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
3302          cat >conftest.$ac_ext <<_ACEOF
3303 #line 3303 "configure"
3304 #include "confdefs.h"
3305
3306 #include <stdlib.h>
3307 #include <string.h>
3308 #include <sys/types.h>
3309
3310 int
3311 main ()
3312 {
3313
3314 #ifdef _XOPEN_SOURCE
3315 make an error
3316 #endif
3317   ;
3318   return 0;
3319 }
3320 _ACEOF
3321 rm -f conftest.$ac_objext
3322 if { (eval echo "$as_me:3322: \"$ac_compile\"") >&5
3323   (eval $ac_compile) 2>&5
3324   ac_status=$?
3325   echo "$as_me:3325: \$? = $ac_status" >&5
3326   (exit $ac_status); } &&
3327          { ac_try='test -s conftest.$ac_objext'
3328   { (eval echo "$as_me:3328: \"$ac_try\"") >&5
3329   (eval $ac_try) 2>&5
3330   ac_status=$?
3331   echo "$as_me:3331: \$? = $ac_status" >&5
3332   (exit $ac_status); }; }; then
3333   cf_cv_xopen_source=no
3334 else
3335   echo "$as_me: failed program was:" >&5
3336 cat conftest.$ac_ext >&5
3337 cf_cv_xopen_source=$cf_XOPEN_SOURCE
3338 fi
3339 rm -f conftest.$ac_objext conftest.$ac_ext
3340         CPPFLAGS="$cf_save"
3341
3342 fi
3343 rm -f conftest.$ac_objext conftest.$ac_ext
3344
3345 fi
3346 echo "$as_me:3346: result: $cf_cv_xopen_source" >&5
3347 echo "${ECHO_T}$cf_cv_xopen_source" >&6
3348
3349 if test "$cf_cv_xopen_source" != no ; then
3350
3351 CFLAGS=`echo "$CFLAGS" | \
3352         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
3353                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
3354
3355 CPPFLAGS=`echo "$CPPFLAGS" | \
3356         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
3357                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
3358
3359         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
3360
3361 cf_fix_cppflags=no
3362 cf_new_cflags=
3363 cf_new_cppflags=
3364 cf_new_extra_cppflags=
3365
3366 for cf_add_cflags in $cf_temp_xopen_source
3367 do
3368 case $cf_fix_cppflags in
3369 (no)
3370         case $cf_add_cflags in
3371         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
3372                 case $cf_add_cflags in
3373                 (-D*)
3374                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3375
3376                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3377                                 && test -z "${cf_tst_cflags}" \
3378                                 && cf_fix_cppflags=yes
3379
3380                         if test $cf_fix_cppflags = yes ; then
3381                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3382                                 continue
3383                         elif test "${cf_tst_cflags}" = "\"'" ; then
3384                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3385                                 continue
3386                         fi
3387                         ;;
3388                 esac
3389                 case "$CPPFLAGS" in
3390                 (*$cf_add_cflags)
3391                         ;;
3392                 (*)
3393                         case $cf_add_cflags in
3394                         (-D*)
3395                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3396
3397 CPPFLAGS=`echo "$CPPFLAGS" | \
3398         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3399                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3400
3401                                 ;;
3402                         esac
3403                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3404                         ;;
3405                 esac
3406                 ;;
3407         (*)
3408                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
3409                 ;;
3410         esac
3411         ;;
3412 (yes)
3413         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3414
3415         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3416
3417         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3418                 && test -z "${cf_tst_cflags}" \
3419                 && cf_fix_cppflags=no
3420         ;;
3421 esac
3422 done
3423
3424 if test -n "$cf_new_cflags" ; then
3425
3426         CFLAGS="$CFLAGS $cf_new_cflags"
3427 fi
3428
3429 if test -n "$cf_new_cppflags" ; then
3430
3431         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
3432 fi
3433
3434 if test -n "$cf_new_extra_cppflags" ; then
3435
3436         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
3437 fi
3438
3439 fi
3440
3441 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
3442
3443 cf_save_CFLAGS="$CFLAGS"
3444 cf_save_CPPFLAGS="$CPPFLAGS"
3445
3446 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
3447         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
3448                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
3449
3450 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
3451         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
3452                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
3453
3454 echo "$as_me:3454: checking if we should define _POSIX_C_SOURCE" >&5
3455 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
3456 if test "${cf_cv_posix_c_source+set}" = set; then
3457   echo $ECHO_N "(cached) $ECHO_C" >&6
3458 else
3459
3460 echo "${as_me:-configure}:3460: testing if the symbol is already defined go no further ..." 1>&5
3461
3462         cat >conftest.$ac_ext <<_ACEOF
3463 #line 3463 "configure"
3464 #include "confdefs.h"
3465 #include <sys/types.h>
3466 int
3467 main ()
3468 {
3469
3470 #ifndef _POSIX_C_SOURCE
3471 make an error
3472 #endif
3473   ;
3474   return 0;
3475 }
3476 _ACEOF
3477 rm -f conftest.$ac_objext
3478 if { (eval echo "$as_me:3478: \"$ac_compile\"") >&5
3479   (eval $ac_compile) 2>&5
3480   ac_status=$?
3481   echo "$as_me:3481: \$? = $ac_status" >&5
3482   (exit $ac_status); } &&
3483          { ac_try='test -s conftest.$ac_objext'
3484   { (eval echo "$as_me:3484: \"$ac_try\"") >&5
3485   (eval $ac_try) 2>&5
3486   ac_status=$?
3487   echo "$as_me:3487: \$? = $ac_status" >&5
3488   (exit $ac_status); }; }; then
3489   cf_cv_posix_c_source=no
3490 else
3491   echo "$as_me: failed program was:" >&5
3492 cat conftest.$ac_ext >&5
3493 cf_want_posix_source=no
3494          case .$cf_POSIX_C_SOURCE in
3495          (.[12]??*)
3496                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
3497                 ;;
3498          (.2)
3499                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
3500                 cf_want_posix_source=yes
3501                 ;;
3502          (.*)
3503                 cf_want_posix_source=yes
3504                 ;;
3505          esac
3506          if test "$cf_want_posix_source" = yes ; then
3507                 cat >conftest.$ac_ext <<_ACEOF
3508 #line 3508 "configure"
3509 #include "confdefs.h"
3510 #include <sys/types.h>
3511 int
3512 main ()
3513 {
3514
3515 #ifdef _POSIX_SOURCE
3516 make an error
3517 #endif
3518   ;
3519   return 0;
3520 }
3521 _ACEOF
3522 rm -f conftest.$ac_objext
3523 if { (eval echo "$as_me:3523: \"$ac_compile\"") >&5
3524   (eval $ac_compile) 2>&5
3525   ac_status=$?
3526   echo "$as_me:3526: \$? = $ac_status" >&5
3527   (exit $ac_status); } &&
3528          { ac_try='test -s conftest.$ac_objext'
3529   { (eval echo "$as_me:3529: \"$ac_try\"") >&5
3530   (eval $ac_try) 2>&5
3531   ac_status=$?
3532   echo "$as_me:3532: \$? = $ac_status" >&5
3533   (exit $ac_status); }; }; then
3534   :
3535 else
3536   echo "$as_me: failed program was:" >&5
3537 cat conftest.$ac_ext >&5
3538 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
3539 fi
3540 rm -f conftest.$ac_objext conftest.$ac_ext
3541          fi
3542
3543 echo "${as_me:-configure}:3543: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
3544
3545          CFLAGS="$cf_trim_CFLAGS"
3546          CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
3547
3548 echo "${as_me:-configure}:3548: testing if the second compile does not leave our definition intact error ..." 1>&5
3549
3550          cat >conftest.$ac_ext <<_ACEOF
3551 #line 3551 "configure"
3552 #include "confdefs.h"
3553 #include <sys/types.h>
3554 int
3555 main ()
3556 {
3557
3558 #ifndef _POSIX_C_SOURCE
3559 make an error
3560 #endif
3561   ;
3562   return 0;
3563 }
3564 _ACEOF
3565 rm -f conftest.$ac_objext
3566 if { (eval echo "$as_me:3566: \"$ac_compile\"") >&5
3567   (eval $ac_compile) 2>&5
3568   ac_status=$?
3569   echo "$as_me:3569: \$? = $ac_status" >&5
3570   (exit $ac_status); } &&
3571          { ac_try='test -s conftest.$ac_objext'
3572   { (eval echo "$as_me:3572: \"$ac_try\"") >&5
3573   (eval $ac_try) 2>&5
3574   ac_status=$?
3575   echo "$as_me:3575: \$? = $ac_status" >&5
3576   (exit $ac_status); }; }; then
3577   :
3578 else
3579   echo "$as_me: failed program was:" >&5
3580 cat conftest.$ac_ext >&5
3581 cf_cv_posix_c_source=no
3582 fi
3583 rm -f conftest.$ac_objext conftest.$ac_ext
3584          CFLAGS="$cf_save_CFLAGS"
3585          CPPFLAGS="$cf_save_CPPFLAGS"
3586
3587 fi
3588 rm -f conftest.$ac_objext conftest.$ac_ext
3589
3590 fi
3591 echo "$as_me:3591: result: $cf_cv_posix_c_source" >&5
3592 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
3593
3594 if test "$cf_cv_posix_c_source" != no ; then
3595         CFLAGS="$cf_trim_CFLAGS"
3596         CPPFLAGS="$cf_trim_CPPFLAGS"
3597
3598 cf_fix_cppflags=no
3599 cf_new_cflags=
3600 cf_new_cppflags=
3601 cf_new_extra_cppflags=
3602
3603 for cf_add_cflags in $cf_cv_posix_c_source
3604 do
3605 case $cf_fix_cppflags in
3606 (no)
3607         case $cf_add_cflags in
3608         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
3609                 case $cf_add_cflags in
3610                 (-D*)
3611                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3612
3613                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3614                                 && test -z "${cf_tst_cflags}" \
3615                                 && cf_fix_cppflags=yes
3616
3617                         if test $cf_fix_cppflags = yes ; then
3618                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3619                                 continue
3620                         elif test "${cf_tst_cflags}" = "\"'" ; then
3621                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3622                                 continue
3623                         fi
3624                         ;;
3625                 esac
3626                 case "$CPPFLAGS" in
3627                 (*$cf_add_cflags)
3628                         ;;
3629                 (*)
3630                         case $cf_add_cflags in
3631                         (-D*)
3632                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3633
3634 CPPFLAGS=`echo "$CPPFLAGS" | \
3635         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3636                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3637
3638                                 ;;
3639                         esac
3640                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3641                         ;;
3642                 esac
3643                 ;;
3644         (*)
3645                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
3646                 ;;
3647         esac
3648         ;;
3649 (yes)
3650         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3651
3652         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3653
3654         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3655                 && test -z "${cf_tst_cflags}" \
3656                 && cf_fix_cppflags=no
3657         ;;
3658 esac
3659 done
3660
3661 if test -n "$cf_new_cflags" ; then
3662
3663         CFLAGS="$CFLAGS $cf_new_cflags"
3664 fi
3665
3666 if test -n "$cf_new_cppflags" ; then
3667
3668         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
3669 fi
3670
3671 if test -n "$cf_new_extra_cppflags" ; then
3672
3673         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
3674 fi
3675
3676 fi
3677
3678         ;;
3679 esac
3680
3681 if test -n "$cf_xopen_source" ; then
3682
3683 cf_fix_cppflags=no
3684 cf_new_cflags=
3685 cf_new_cppflags=
3686 cf_new_extra_cppflags=
3687
3688 for cf_add_cflags in $cf_xopen_source
3689 do
3690 case $cf_fix_cppflags in
3691 (no)
3692         case $cf_add_cflags in
3693         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
3694                 case $cf_add_cflags in
3695                 (-D*)
3696                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3697
3698                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3699                                 && test -z "${cf_tst_cflags}" \
3700                                 && cf_fix_cppflags=yes
3701
3702                         if test $cf_fix_cppflags = yes ; then
3703                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3704                                 continue
3705                         elif test "${cf_tst_cflags}" = "\"'" ; then
3706                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3707                                 continue
3708                         fi
3709                         ;;
3710                 esac
3711                 case "$CPPFLAGS" in
3712                 (*$cf_add_cflags)
3713                         ;;
3714                 (*)
3715                         case $cf_add_cflags in
3716                         (-D*)
3717                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3718
3719 CPPFLAGS=`echo "$CPPFLAGS" | \
3720         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3721                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3722
3723                                 ;;
3724                         esac
3725                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3726                         ;;
3727                 esac
3728                 ;;
3729         (*)
3730                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
3731                 ;;
3732         esac
3733         ;;
3734 (yes)
3735         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3736
3737         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3738
3739         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3740                 && test -z "${cf_tst_cflags}" \
3741                 && cf_fix_cppflags=no
3742         ;;
3743 esac
3744 done
3745
3746 if test -n "$cf_new_cflags" ; then
3747         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
3748
3749 echo "${as_me:-configure}:3749: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
3750
3751         CFLAGS="$CFLAGS $cf_new_cflags"
3752 fi
3753
3754 if test -n "$cf_new_cppflags" ; then
3755         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
3756
3757 echo "${as_me:-configure}:3757: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
3758
3759         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
3760 fi
3761
3762 if test -n "$cf_new_extra_cppflags" ; then
3763         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
3764
3765 echo "${as_me:-configure}:3765: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
3766
3767         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
3768 fi
3769
3770 fi
3771
3772 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
3773         echo "$as_me:3773: checking if _XOPEN_SOURCE really is set" >&5
3774 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
3775         cat >conftest.$ac_ext <<_ACEOF
3776 #line 3776 "configure"
3777 #include "confdefs.h"
3778 #include <stdlib.h>
3779 int
3780 main ()
3781 {
3782
3783 #ifndef _XOPEN_SOURCE
3784 make an error
3785 #endif
3786   ;
3787   return 0;
3788 }
3789 _ACEOF
3790 rm -f conftest.$ac_objext
3791 if { (eval echo "$as_me:3791: \"$ac_compile\"") >&5
3792   (eval $ac_compile) 2>&5
3793   ac_status=$?
3794   echo "$as_me:3794: \$? = $ac_status" >&5
3795   (exit $ac_status); } &&
3796          { ac_try='test -s conftest.$ac_objext'
3797   { (eval echo "$as_me:3797: \"$ac_try\"") >&5
3798   (eval $ac_try) 2>&5
3799   ac_status=$?
3800   echo "$as_me:3800: \$? = $ac_status" >&5
3801   (exit $ac_status); }; }; then
3802   cf_XOPEN_SOURCE_set=yes
3803 else
3804   echo "$as_me: failed program was:" >&5
3805 cat conftest.$ac_ext >&5
3806 cf_XOPEN_SOURCE_set=no
3807 fi
3808 rm -f conftest.$ac_objext conftest.$ac_ext
3809         echo "$as_me:3809: result: $cf_XOPEN_SOURCE_set" >&5
3810 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
3811         if test $cf_XOPEN_SOURCE_set = yes
3812         then
3813                 cat >conftest.$ac_ext <<_ACEOF
3814 #line 3814 "configure"
3815 #include "confdefs.h"
3816 #include <stdlib.h>
3817 int
3818 main ()
3819 {
3820
3821 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
3822 make an error
3823 #endif
3824   ;
3825   return 0;
3826 }
3827 _ACEOF
3828 rm -f conftest.$ac_objext
3829 if { (eval echo "$as_me:3829: \"$ac_compile\"") >&5
3830   (eval $ac_compile) 2>&5
3831   ac_status=$?
3832   echo "$as_me:3832: \$? = $ac_status" >&5
3833   (exit $ac_status); } &&
3834          { ac_try='test -s conftest.$ac_objext'
3835   { (eval echo "$as_me:3835: \"$ac_try\"") >&5
3836   (eval $ac_try) 2>&5
3837   ac_status=$?
3838   echo "$as_me:3838: \$? = $ac_status" >&5
3839   (exit $ac_status); }; }; then
3840   cf_XOPEN_SOURCE_set_ok=yes
3841 else
3842   echo "$as_me: failed program was:" >&5
3843 cat conftest.$ac_ext >&5
3844 cf_XOPEN_SOURCE_set_ok=no
3845 fi
3846 rm -f conftest.$ac_objext conftest.$ac_ext
3847                 if test $cf_XOPEN_SOURCE_set_ok = no
3848                 then
3849                         { echo "$as_me:3849: WARNING: _XOPEN_SOURCE is lower than requested" >&5
3850 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
3851                 fi
3852         else
3853
3854 echo "$as_me:3854: checking if we should define _XOPEN_SOURCE" >&5
3855 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
3856 if test "${cf_cv_xopen_source+set}" = set; then
3857   echo $ECHO_N "(cached) $ECHO_C" >&6
3858 else
3859
3860         cat >conftest.$ac_ext <<_ACEOF
3861 #line 3861 "configure"
3862 #include "confdefs.h"
3863
3864 #include <stdlib.h>
3865 #include <string.h>
3866 #include <sys/types.h>
3867
3868 int
3869 main ()
3870 {
3871
3872 #ifndef _XOPEN_SOURCE
3873 make an error
3874 #endif
3875   ;
3876   return 0;
3877 }
3878 _ACEOF
3879 rm -f conftest.$ac_objext
3880 if { (eval echo "$as_me:3880: \"$ac_compile\"") >&5
3881   (eval $ac_compile) 2>&5
3882   ac_status=$?
3883   echo "$as_me:3883: \$? = $ac_status" >&5
3884   (exit $ac_status); } &&
3885          { ac_try='test -s conftest.$ac_objext'
3886   { (eval echo "$as_me:3886: \"$ac_try\"") >&5
3887   (eval $ac_try) 2>&5
3888   ac_status=$?
3889   echo "$as_me:3889: \$? = $ac_status" >&5
3890   (exit $ac_status); }; }; then
3891   cf_cv_xopen_source=no
3892 else
3893   echo "$as_me: failed program was:" >&5
3894 cat conftest.$ac_ext >&5
3895 cf_save="$CPPFLAGS"
3896          CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
3897          cat >conftest.$ac_ext <<_ACEOF
3898 #line 3898 "configure"
3899 #include "confdefs.h"
3900
3901 #include <stdlib.h>
3902 #include <string.h>
3903 #include <sys/types.h>
3904
3905 int
3906 main ()
3907 {
3908
3909 #ifdef _XOPEN_SOURCE
3910 make an error
3911 #endif
3912   ;
3913   return 0;
3914 }
3915 _ACEOF
3916 rm -f conftest.$ac_objext
3917 if { (eval echo "$as_me:3917: \"$ac_compile\"") >&5
3918   (eval $ac_compile) 2>&5
3919   ac_status=$?
3920   echo "$as_me:3920: \$? = $ac_status" >&5
3921   (exit $ac_status); } &&
3922          { ac_try='test -s conftest.$ac_objext'
3923   { (eval echo "$as_me:3923: \"$ac_try\"") >&5
3924   (eval $ac_try) 2>&5
3925   ac_status=$?
3926   echo "$as_me:3926: \$? = $ac_status" >&5
3927   (exit $ac_status); }; }; then
3928   cf_cv_xopen_source=no
3929 else
3930   echo "$as_me: failed program was:" >&5
3931 cat conftest.$ac_ext >&5
3932 cf_cv_xopen_source=$cf_XOPEN_SOURCE
3933 fi
3934 rm -f conftest.$ac_objext conftest.$ac_ext
3935         CPPFLAGS="$cf_save"
3936
3937 fi
3938 rm -f conftest.$ac_objext conftest.$ac_ext
3939
3940 fi
3941 echo "$as_me:3941: result: $cf_cv_xopen_source" >&5
3942 echo "${ECHO_T}$cf_cv_xopen_source" >&6
3943
3944 if test "$cf_cv_xopen_source" != no ; then
3945
3946 CFLAGS=`echo "$CFLAGS" | \
3947         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
3948                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
3949
3950 CPPFLAGS=`echo "$CPPFLAGS" | \
3951         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
3952                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
3953
3954         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
3955
3956 cf_fix_cppflags=no
3957 cf_new_cflags=
3958 cf_new_cppflags=
3959 cf_new_extra_cppflags=
3960
3961 for cf_add_cflags in $cf_temp_xopen_source
3962 do
3963 case $cf_fix_cppflags in
3964 (no)
3965         case $cf_add_cflags in
3966         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
3967                 case $cf_add_cflags in
3968                 (-D*)
3969                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3970
3971                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3972                                 && test -z "${cf_tst_cflags}" \
3973                                 && cf_fix_cppflags=yes
3974
3975                         if test $cf_fix_cppflags = yes ; then
3976                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3977                                 continue
3978                         elif test "${cf_tst_cflags}" = "\"'" ; then
3979                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3980                                 continue
3981                         fi
3982                         ;;
3983                 esac
3984                 case "$CPPFLAGS" in
3985                 (*$cf_add_cflags)
3986                         ;;
3987                 (*)
3988                         case $cf_add_cflags in
3989                         (-D*)
3990                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3991
3992 CPPFLAGS=`echo "$CPPFLAGS" | \
3993         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3994                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3995
3996                                 ;;
3997                         esac
3998                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3999                         ;;
4000                 esac
4001                 ;;
4002         (*)
4003                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
4004                 ;;
4005         esac
4006         ;;
4007 (yes)
4008         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
4009
4010         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4011
4012         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4013                 && test -z "${cf_tst_cflags}" \
4014                 && cf_fix_cppflags=no
4015         ;;
4016 esac
4017 done
4018
4019 if test -n "$cf_new_cflags" ; then
4020
4021         CFLAGS="$CFLAGS $cf_new_cflags"
4022 fi
4023
4024 if test -n "$cf_new_cppflags" ; then
4025
4026         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
4027 fi
4028
4029 if test -n "$cf_new_extra_cppflags" ; then
4030
4031         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
4032 fi
4033
4034 fi
4035
4036         fi
4037 fi
4038
4039 echo "$as_me:4039: checking for signal global datatype" >&5
4040 echo $ECHO_N "checking for signal global datatype... $ECHO_C" >&6
4041 if test "${cf_cv_sig_atomic_t+set}" = set; then
4042   echo $ECHO_N "(cached) $ECHO_C" >&6
4043 else
4044
4045         for cf_type in \
4046                 "volatile sig_atomic_t" \
4047                 "sig_atomic_t" \
4048                 "int"
4049         do
4050         cat >conftest.$ac_ext <<_ACEOF
4051 #line 4051 "configure"
4052 #include "confdefs.h"
4053
4054 #include <sys/types.h>
4055 #include <signal.h>
4056 #include <stdio.h>
4057
4058 extern $cf_type x;
4059 $cf_type x;
4060 static void handler(int sig)
4061 {
4062         x = 5;
4063 }
4064 int
4065 main ()
4066 {
4067 signal(SIGINT, handler);
4068                  x = 1
4069   ;
4070   return 0;
4071 }
4072 _ACEOF
4073 rm -f conftest.$ac_objext
4074 if { (eval echo "$as_me:4074: \"$ac_compile\"") >&5
4075   (eval $ac_compile) 2>&5
4076   ac_status=$?
4077   echo "$as_me:4077: \$? = $ac_status" >&5
4078   (exit $ac_status); } &&
4079          { ac_try='test -s conftest.$ac_objext'
4080   { (eval echo "$as_me:4080: \"$ac_try\"") >&5
4081   (eval $ac_try) 2>&5
4082   ac_status=$?
4083   echo "$as_me:4083: \$? = $ac_status" >&5
4084   (exit $ac_status); }; }; then
4085   cf_cv_sig_atomic_t=$cf_type
4086 else
4087   echo "$as_me: failed program was:" >&5
4088 cat conftest.$ac_ext >&5
4089 cf_cv_sig_atomic_t=no
4090 fi
4091 rm -f conftest.$ac_objext conftest.$ac_ext
4092                 test "$cf_cv_sig_atomic_t" != no && break
4093         done
4094
4095 fi
4096
4097 echo "$as_me:4097: result: $cf_cv_sig_atomic_t" >&5
4098 echo "${ECHO_T}$cf_cv_sig_atomic_t" >&6
4099 test "$cf_cv_sig_atomic_t" != no &&
4100 cat >>confdefs.h <<EOF
4101 #define SIG_ATOMIC_T $cf_cv_sig_atomic_t
4102 EOF
4103
4104 # Work around breakage on OS X
4105
4106 echo "$as_me:4106: checking if SIGWINCH is defined" >&5
4107 echo $ECHO_N "checking if SIGWINCH is defined... $ECHO_C" >&6
4108 if test "${cf_cv_define_sigwinch+set}" = set; then
4109   echo $ECHO_N "(cached) $ECHO_C" >&6
4110 else
4111
4112         cat >conftest.$ac_ext <<_ACEOF
4113 #line 4113 "configure"
4114 #include "confdefs.h"
4115
4116 #include <sys/types.h>
4117 #include <sys/signal.h>
4118
4119 int
4120 main ()
4121 {
4122 int x = SIGWINCH
4123   ;
4124   return 0;
4125 }
4126 _ACEOF
4127 rm -f conftest.$ac_objext
4128 if { (eval echo "$as_me:4128: \"$ac_compile\"") >&5
4129   (eval $ac_compile) 2>&5
4130   ac_status=$?
4131   echo "$as_me:4131: \$? = $ac_status" >&5
4132   (exit $ac_status); } &&
4133          { ac_try='test -s conftest.$ac_objext'
4134   { (eval echo "$as_me:4134: \"$ac_try\"") >&5
4135   (eval $ac_try) 2>&5
4136   ac_status=$?
4137   echo "$as_me:4137: \$? = $ac_status" >&5
4138   (exit $ac_status); }; }; then
4139   cf_cv_define_sigwinch=yes
4140 else
4141   echo "$as_me: failed program was:" >&5
4142 cat conftest.$ac_ext >&5
4143 cat >conftest.$ac_ext <<_ACEOF
4144 #line 4144 "configure"
4145 #include "confdefs.h"
4146
4147 #undef _XOPEN_SOURCE
4148 #undef _POSIX_SOURCE
4149 #undef _POSIX_C_SOURCE
4150 #include <sys/types.h>
4151 #include <sys/signal.h>
4152
4153 int
4154 main ()
4155 {
4156 int x = SIGWINCH
4157   ;
4158   return 0;
4159 }
4160 _ACEOF
4161 rm -f conftest.$ac_objext
4162 if { (eval echo "$as_me:4162: \"$ac_compile\"") >&5
4163   (eval $ac_compile) 2>&5
4164   ac_status=$?
4165   echo "$as_me:4165: \$? = $ac_status" >&5
4166   (exit $ac_status); } &&
4167          { ac_try='test -s conftest.$ac_objext'
4168   { (eval echo "$as_me:4168: \"$ac_try\"") >&5
4169   (eval $ac_try) 2>&5
4170   ac_status=$?
4171   echo "$as_me:4171: \$? = $ac_status" >&5
4172   (exit $ac_status); }; }; then
4173   cf_cv_define_sigwinch=maybe
4174 else
4175   echo "$as_me: failed program was:" >&5
4176 cat conftest.$ac_ext >&5
4177 cf_cv_define_sigwinch=no
4178 fi
4179 rm -f conftest.$ac_objext conftest.$ac_ext
4180
4181 fi
4182 rm -f conftest.$ac_objext conftest.$ac_ext
4183
4184 fi
4185 echo "$as_me:4185: result: $cf_cv_define_sigwinch" >&5
4186 echo "${ECHO_T}$cf_cv_define_sigwinch" >&6
4187
4188 if test "$cf_cv_define_sigwinch" = maybe ; then
4189 echo "$as_me:4189: checking for actual SIGWINCH definition" >&5
4190 echo $ECHO_N "checking for actual SIGWINCH definition... $ECHO_C" >&6
4191 if test "${cf_cv_fixup_sigwinch+set}" = set; then
4192   echo $ECHO_N "(cached) $ECHO_C" >&6
4193 else
4194
4195 cf_cv_fixup_sigwinch=unknown
4196 cf_sigwinch=32
4197 while test $cf_sigwinch != 1
4198 do
4199         cat >conftest.$ac_ext <<_ACEOF
4200 #line 4200 "configure"
4201 #include "confdefs.h"
4202
4203 #undef _XOPEN_SOURCE
4204 #undef _POSIX_SOURCE
4205 #undef _POSIX_C_SOURCE
4206 #include <sys/types.h>
4207 #include <sys/signal.h>
4208
4209 int
4210 main ()
4211 {
4212
4213 #if SIGWINCH != $cf_sigwinch
4214 make an error
4215 #endif
4216 int x = SIGWINCH
4217   ;
4218   return 0;
4219 }
4220 _ACEOF
4221 rm -f conftest.$ac_objext
4222 if { (eval echo "$as_me:4222: \"$ac_compile\"") >&5
4223   (eval $ac_compile) 2>&5
4224   ac_status=$?
4225   echo "$as_me:4225: \$? = $ac_status" >&5
4226   (exit $ac_status); } &&
4227          { ac_try='test -s conftest.$ac_objext'
4228   { (eval echo "$as_me:4228: \"$ac_try\"") >&5
4229   (eval $ac_try) 2>&5
4230   ac_status=$?
4231   echo "$as_me:4231: \$? = $ac_status" >&5
4232   (exit $ac_status); }; }; then
4233   cf_cv_fixup_sigwinch=$cf_sigwinch
4234          break
4235 else
4236   echo "$as_me: failed program was:" >&5
4237 cat conftest.$ac_ext >&5
4238 fi
4239 rm -f conftest.$ac_objext conftest.$ac_ext
4240
4241 cf_sigwinch=`expr $cf_sigwinch - 1`
4242 done
4243
4244 fi
4245 echo "$as_me:4245: result: $cf_cv_fixup_sigwinch" >&5
4246 echo "${ECHO_T}$cf_cv_fixup_sigwinch" >&6
4247
4248         if test "$cf_cv_fixup_sigwinch" != unknown ; then
4249                 CPPFLAGS="$CPPFLAGS -DSIGWINCH=$cf_cv_fixup_sigwinch"
4250         fi
4251 fi
4252
4253 # Checks for CODESET support.
4254
4255 echo "$as_me:4255: checking for nl_langinfo and CODESET" >&5
4256 echo $ECHO_N "checking for nl_langinfo and CODESET... $ECHO_C" >&6
4257 if test "${am_cv_langinfo_codeset+set}" = set; then
4258   echo $ECHO_N "(cached) $ECHO_C" >&6
4259 else
4260   cat >conftest.$ac_ext <<_ACEOF
4261 #line 4261 "configure"
4262 #include "confdefs.h"
4263 #include <langinfo.h>
4264 int
4265 main ()
4266 {
4267 char* cs = nl_langinfo(CODESET);
4268   ;
4269   return 0;
4270 }
4271 _ACEOF
4272 rm -f conftest.$ac_objext conftest$ac_exeext
4273 if { (eval echo "$as_me:4273: \"$ac_link\"") >&5
4274   (eval $ac_link) 2>&5
4275   ac_status=$?
4276   echo "$as_me:4276: \$? = $ac_status" >&5
4277   (exit $ac_status); } &&
4278          { ac_try='test -s conftest$ac_exeext'
4279   { (eval echo "$as_me:4279: \"$ac_try\"") >&5
4280   (eval $ac_try) 2>&5
4281   ac_status=$?
4282   echo "$as_me:4282: \$? = $ac_status" >&5
4283   (exit $ac_status); }; }; then
4284   am_cv_langinfo_codeset=yes
4285 else
4286   echo "$as_me: failed program was:" >&5
4287 cat conftest.$ac_ext >&5
4288 am_cv_langinfo_codeset=no
4289 fi
4290 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4291
4292 fi
4293 echo "$as_me:4293: result: $am_cv_langinfo_codeset" >&5
4294 echo "${ECHO_T}$am_cv_langinfo_codeset" >&6
4295         if test $am_cv_langinfo_codeset = yes; then
4296
4297 cat >>confdefs.h <<\EOF
4298 #define HAVE_LANGINFO_CODESET 1
4299 EOF
4300
4301         fi
4302
4303 echo "$as_me:4303: checking if you want to use pkg-config" >&5
4304 echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6
4305
4306 # Check whether --with-pkg-config or --without-pkg-config was given.
4307 if test "${with_pkg_config+set}" = set; then
4308   withval="$with_pkg_config"
4309   cf_pkg_config=$withval
4310 else
4311   cf_pkg_config=yes
4312 fi;
4313 echo "$as_me:4313: result: $cf_pkg_config" >&5
4314 echo "${ECHO_T}$cf_pkg_config" >&6
4315
4316 case $cf_pkg_config in
4317 (no)
4318         PKG_CONFIG=none
4319         ;;
4320 (yes)
4321
4322 if test -n "$ac_tool_prefix"; then
4323   # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
4324 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
4325 echo "$as_me:4325: checking for $ac_word" >&5
4326 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4327 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
4328   echo $ECHO_N "(cached) $ECHO_C" >&6
4329 else
4330   case $PKG_CONFIG in
4331   [\\/]* | ?:[\\/]*)
4332   ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
4333   ;;
4334   *)
4335   ac_save_IFS=$IFS; IFS=$ac_path_separator
4336 ac_dummy="$PATH"
4337 for ac_dir in $ac_dummy; do
4338   IFS=$ac_save_IFS
4339   test -z "$ac_dir" && ac_dir=.
4340   if $as_executable_p "$ac_dir/$ac_word"; then
4341    ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
4342    echo "$as_me:4342: found $ac_dir/$ac_word" >&5
4343    break
4344 fi
4345 done
4346
4347   ;;
4348 esac
4349 fi
4350 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
4351
4352 if test -n "$PKG_CONFIG"; then
4353   echo "$as_me:4353: result: $PKG_CONFIG" >&5
4354 echo "${ECHO_T}$PKG_CONFIG" >&6
4355 else
4356   echo "$as_me:4356: result: no" >&5
4357 echo "${ECHO_T}no" >&6
4358 fi
4359
4360 fi
4361 if test -z "$ac_cv_path_PKG_CONFIG"; then
4362   ac_pt_PKG_CONFIG=$PKG_CONFIG
4363   # Extract the first word of "pkg-config", so it can be a program name with args.
4364 set dummy pkg-config; ac_word=$2
4365 echo "$as_me:4365: checking for $ac_word" >&5
4366 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4367 if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
4368   echo $ECHO_N "(cached) $ECHO_C" >&6
4369 else
4370   case $ac_pt_PKG_CONFIG in
4371   [\\/]* | ?:[\\/]*)
4372   ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
4373   ;;
4374   *)
4375   ac_save_IFS=$IFS; IFS=$ac_path_separator
4376 ac_dummy="$PATH"
4377 for ac_dir in $ac_dummy; do
4378   IFS=$ac_save_IFS
4379   test -z "$ac_dir" && ac_dir=.
4380   if $as_executable_p "$ac_dir/$ac_word"; then
4381    ac_cv_path_ac_pt_PKG_CONFIG="$ac_dir/$ac_word"
4382    echo "$as_me:4382: found $ac_dir/$ac_word" >&5
4383    break
4384 fi
4385 done
4386
4387   test -z "$ac_cv_path_ac_pt_PKG_CONFIG" && ac_cv_path_ac_pt_PKG_CONFIG="none"
4388   ;;
4389 esac
4390 fi
4391 ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
4392
4393 if test -n "$ac_pt_PKG_CONFIG"; then
4394   echo "$as_me:4394: result: $ac_pt_PKG_CONFIG" >&5
4395 echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
4396 else
4397   echo "$as_me:4397: result: no" >&5
4398 echo "${ECHO_T}no" >&6
4399 fi
4400
4401   PKG_CONFIG=$ac_pt_PKG_CONFIG
4402 else
4403   PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
4404 fi
4405
4406         ;;
4407 (*)
4408         PKG_CONFIG=$withval
4409         ;;
4410 esac
4411
4412 test -z "$PKG_CONFIG" && PKG_CONFIG=none
4413 if test "$PKG_CONFIG" != none ; then
4414
4415 if test "x$prefix" != xNONE; then
4416         cf_path_syntax="$prefix"
4417 else
4418         cf_path_syntax="$ac_default_prefix"
4419 fi
4420
4421 case ".$PKG_CONFIG" in
4422 (.\$\(*\)*|.\'*\'*)
4423         ;;
4424 (..|./*|.\\*)
4425         ;;
4426 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
4427         ;;
4428 (.\${*prefix}*|.\${*dir}*)
4429         eval PKG_CONFIG="$PKG_CONFIG"
4430         case ".$PKG_CONFIG" in
4431         (.NONE/*)
4432                 PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
4433                 ;;
4434         esac
4435         ;;
4436 (.no|.NONE/*)
4437         PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
4438         ;;
4439 (*)
4440         { { echo "$as_me:4440: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
4441 echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
4442    { (exit 1); exit 1; }; }
4443         ;;
4444 esac
4445
4446 elif test "x$cf_pkg_config" != xno ; then
4447         { echo "$as_me:4447: WARNING: pkg-config is not installed" >&5
4448 echo "$as_me: WARNING: pkg-config is not installed" >&2;}
4449 fi
4450
4451 echo "$as_me:4451: checking if you want to see long compiling messages" >&5
4452 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
4453
4454 # Check whether --enable-echo or --disable-echo was given.
4455 if test "${enable_echo+set}" = set; then
4456   enableval="$enable_echo"
4457   test "$enableval" != no && enableval=yes
4458         if test "$enableval" != "yes" ; then
4459
4460         ECHO_LT='--silent'
4461         ECHO_LD='@echo linking $@;'
4462         RULE_CC='@echo compiling $<'
4463         SHOW_CC='@echo compiling $@'
4464         ECHO_CC='@'
4465
4466         else
4467
4468         ECHO_LT=''
4469         ECHO_LD=''
4470         RULE_CC=''
4471         SHOW_CC=''
4472         ECHO_CC=''
4473
4474         fi
4475 else
4476   enableval=yes
4477
4478         ECHO_LT=''
4479         ECHO_LD=''
4480         RULE_CC=''
4481         SHOW_CC=''
4482         ECHO_CC=''
4483
4484 fi;
4485 echo "$as_me:4485: result: $enableval" >&5
4486 echo "${ECHO_T}$enableval" >&6
4487
4488 echo "$as_me:4488: checking for ncurses wrap-prefix" >&5
4489 echo $ECHO_N "checking for ncurses wrap-prefix... $ECHO_C" >&6
4490
4491 # Check whether --with-ncurses-wrap-prefix or --without-ncurses-wrap-prefix was given.
4492 if test "${with_ncurses_wrap_prefix+set}" = set; then
4493   withval="$with_ncurses_wrap_prefix"
4494   NCURSES_WRAP_PREFIX=$withval
4495 else
4496   NCURSES_WRAP_PREFIX=_nc_
4497 fi;
4498 echo "$as_me:4498: result: $NCURSES_WRAP_PREFIX" >&5
4499 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
4500
4501 echo "$as_me:4501: checking if you want to check for wide-character functions" >&5
4502 echo $ECHO_N "checking if you want to check for wide-character functions... $ECHO_C" >&6
4503
4504 # Check whether --enable-widec or --disable-widec was given.
4505 if test "${enable_widec+set}" = set; then
4506   enableval="$enable_widec"
4507   test "$enableval" != no && enableval=yes
4508         if test "$enableval" != "yes" ; then
4509     cf_enable_widec=no
4510         else
4511                 cf_enable_widec=yes
4512         fi
4513 else
4514   enableval=yes
4515         cf_enable_widec=yes
4516
4517 fi;
4518 echo "$as_me:4518: result: $cf_enable_widec" >&5
4519 echo "${ECHO_T}$cf_enable_widec" >&6
4520
4521 echo "$as_me:4521: checking for specific curses-directory" >&5
4522 echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
4523
4524 # Check whether --with-curses-dir or --without-curses-dir was given.
4525 if test "${with_curses_dir+set}" = set; then
4526   withval="$with_curses_dir"
4527   cf_cv_curses_dir=$withval
4528 else
4529   cf_cv_curses_dir=no
4530 fi;
4531 echo "$as_me:4531: result: $cf_cv_curses_dir" >&5
4532 echo "${ECHO_T}$cf_cv_curses_dir" >&6
4533
4534 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
4535 then
4536
4537 if test "x$prefix" != xNONE; then
4538         cf_path_syntax="$prefix"
4539 else
4540         cf_path_syntax="$ac_default_prefix"
4541 fi
4542
4543 case ".$withval" in
4544 (.\$\(*\)*|.\'*\'*)
4545         ;;
4546 (..|./*|.\\*)
4547         ;;
4548 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
4549         ;;
4550 (.\${*prefix}*|.\${*dir}*)
4551         eval withval="$withval"
4552         case ".$withval" in
4553         (.NONE/*)
4554                 withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
4555                 ;;
4556         esac
4557         ;;
4558 (.no|.NONE/*)
4559         withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
4560         ;;
4561 (*)
4562         { { echo "$as_me:4562: error: expected a pathname, not \"$withval\"" >&5
4563 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
4564    { (exit 1); exit 1; }; }
4565         ;;
4566 esac
4567
4568         if test -d "$cf_cv_curses_dir"
4569         then
4570
4571 if test -n "$cf_cv_curses_dir/include" ; then
4572   for cf_add_incdir in $cf_cv_curses_dir/include
4573   do
4574         while test $cf_add_incdir != /usr/include
4575         do
4576           if test -d $cf_add_incdir
4577           then
4578                 cf_have_incdir=no
4579                 if test -n "$CFLAGS$CPPFLAGS" ; then
4580                   # a loop is needed to ensure we can add subdirs of existing dirs
4581                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4582                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4583                           cf_have_incdir=yes; break
4584                         fi
4585                   done
4586                 fi
4587
4588                 if test "$cf_have_incdir" = no ; then
4589                   if test "$cf_add_incdir" = /usr/local/include ; then
4590                         if test "$GCC" = yes
4591                         then
4592                           cf_save_CPPFLAGS=$CPPFLAGS
4593                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4594                           cat >conftest.$ac_ext <<_ACEOF
4595 #line 4595 "configure"
4596 #include "confdefs.h"
4597 #include <stdio.h>
4598 int
4599 main ()
4600 {
4601 printf("Hello")
4602   ;
4603   return 0;
4604 }
4605 _ACEOF
4606 rm -f conftest.$ac_objext
4607 if { (eval echo "$as_me:4607: \"$ac_compile\"") >&5
4608   (eval $ac_compile) 2>&5
4609   ac_status=$?
4610   echo "$as_me:4610: \$? = $ac_status" >&5
4611   (exit $ac_status); } &&
4612          { ac_try='test -s conftest.$ac_objext'
4613   { (eval echo "$as_me:4613: \"$ac_try\"") >&5
4614   (eval $ac_try) 2>&5
4615   ac_status=$?
4616   echo "$as_me:4616: \$? = $ac_status" >&5
4617   (exit $ac_status); }; }; then
4618   :
4619 else
4620   echo "$as_me: failed program was:" >&5
4621 cat conftest.$ac_ext >&5
4622 cf_have_incdir=yes
4623 fi
4624 rm -f conftest.$ac_objext conftest.$ac_ext
4625                           CPPFLAGS=$cf_save_CPPFLAGS
4626                         fi
4627                   fi
4628                 fi
4629
4630                 if test "$cf_have_incdir" = no ; then
4631                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4632
4633 echo "${as_me:-configure}:4633: testing adding $cf_add_incdir to include-path ..." 1>&5
4634
4635                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4636
4637                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
4638                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4639                   cf_add_incdir="$cf_top_incdir"
4640                 else
4641                   break
4642                 fi
4643           else
4644                 break
4645           fi
4646         done
4647   done
4648 fi
4649
4650 if test -n "$cf_cv_curses_dir/lib" ; then
4651         for cf_add_libdir in $cf_cv_curses_dir/lib
4652         do
4653                 if test $cf_add_libdir = /usr/lib ; then
4654                         :
4655                 elif test -d $cf_add_libdir
4656                 then
4657                         cf_have_libdir=no
4658                         if test -n "$LDFLAGS$LIBS" ; then
4659                                 # a loop is needed to ensure we can add subdirs of existing dirs
4660                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
4661                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
4662                                                 cf_have_libdir=yes; break
4663                                         fi
4664                                 done
4665                         fi
4666                         if test "$cf_have_libdir" = no ; then
4667                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
4668
4669 echo "${as_me:-configure}:4669: testing adding $cf_add_libdir to library-path ..." 1>&5
4670
4671                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
4672                         fi
4673                 fi
4674         done
4675 fi
4676
4677         fi
4678 fi
4679
4680 cf_cv_screen=curses
4681
4682 echo "$as_me:4682: checking for specified curses library type" >&5
4683 echo $ECHO_N "checking for specified curses library type... $ECHO_C" >&6
4684
4685 # Check whether --with-screen or --without-screen was given.
4686 if test "${with_screen+set}" = set; then
4687   withval="$with_screen"
4688   cf_cv_screen=$withval
4689 else
4690
4691 # Check whether --with-ncursesw or --without-ncursesw was given.
4692 if test "${with_ncursesw+set}" = set; then
4693   withval="$with_ncursesw"
4694   cf_cv_screen=ncursesw
4695 else
4696
4697 # Check whether --with-ncurses or --without-ncurses was given.
4698 if test "${with_ncurses+set}" = set; then
4699   withval="$with_ncurses"
4700   cf_cv_screen=ncurses
4701 else
4702
4703 # Check whether --with-pdcurses or --without-pdcurses was given.
4704 if test "${with_pdcurses+set}" = set; then
4705   withval="$with_pdcurses"
4706   cf_cv_screen=pdcurses
4707 else
4708
4709 # Check whether --with-curses-colr or --without-curses-colr was given.
4710 if test "${with_curses_colr+set}" = set; then
4711   withval="$with_curses_colr"
4712   cf_cv_screen=curses_colr
4713 else
4714
4715 # Check whether --with-curses-5lib or --without-curses-5lib was given.
4716 if test "${with_curses_5lib+set}" = set; then
4717   withval="$with_curses_5lib"
4718   cf_cv_screen=curses_5lib
4719 fi;
4720 fi;
4721 fi;
4722 fi;
4723 fi;
4724 fi;
4725
4726 echo "$as_me:4726: result: $cf_cv_screen" >&5
4727 echo "${ECHO_T}$cf_cv_screen" >&6
4728
4729 case $cf_cv_screen in
4730 (curses|curses_*)
4731
4732 echo "$as_me:4732: checking for extra include directories" >&5
4733 echo $ECHO_N "checking for extra include directories... $ECHO_C" >&6
4734 if test "${cf_cv_curses_incdir+set}" = set; then
4735   echo $ECHO_N "(cached) $ECHO_C" >&6
4736 else
4737
4738 cf_cv_curses_incdir=no
4739 case $host_os in
4740 (hpux10.*)
4741         if test "x$cf_cv_screen" = "xcurses_colr"
4742         then
4743                 test -d /usr/include/curses_colr && \
4744                 cf_cv_curses_incdir="-I/usr/include/curses_colr"
4745         fi
4746         ;;
4747 (sunos3*|sunos4*)
4748         if test "x$cf_cv_screen" = "xcurses_5lib"
4749         then
4750                 test -d /usr/5lib && \
4751                 test -d /usr/5include && \
4752                 cf_cv_curses_incdir="-I/usr/5include"
4753         fi
4754         ;;
4755 esac
4756
4757 fi
4758 echo "$as_me:4758: result: $cf_cv_curses_incdir" >&5
4759 echo "${ECHO_T}$cf_cv_curses_incdir" >&6
4760 test "$cf_cv_curses_incdir" != no && CPPFLAGS="$CPPFLAGS $cf_cv_curses_incdir"
4761
4762 echo "$as_me:4762: checking if we have identified curses headers" >&5
4763 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
4764 if test "${cf_cv_ncurses_header+set}" = set; then
4765   echo $ECHO_N "(cached) $ECHO_C" >&6
4766 else
4767
4768 cf_cv_ncurses_header=none
4769 for cf_header in \
4770         ncurses.h  \
4771         curses.h  ncurses/ncurses.h ncurses/curses.h
4772 do
4773 cat >conftest.$ac_ext <<_ACEOF
4774 #line 4774 "configure"
4775 #include "confdefs.h"
4776 #include <${cf_header}>
4777 int
4778 main ()
4779 {
4780 initscr(); tgoto("?", 0,0)
4781   ;
4782   return 0;
4783 }
4784 _ACEOF
4785 rm -f conftest.$ac_objext
4786 if { (eval echo "$as_me:4786: \"$ac_compile\"") >&5
4787   (eval $ac_compile) 2>&5
4788   ac_status=$?
4789   echo "$as_me:4789: \$? = $ac_status" >&5
4790   (exit $ac_status); } &&
4791          { ac_try='test -s conftest.$ac_objext'
4792   { (eval echo "$as_me:4792: \"$ac_try\"") >&5
4793   (eval $ac_try) 2>&5
4794   ac_status=$?
4795   echo "$as_me:4795: \$? = $ac_status" >&5
4796   (exit $ac_status); }; }; then
4797   cf_cv_ncurses_header=$cf_header; break
4798 else
4799   echo "$as_me: failed program was:" >&5
4800 cat conftest.$ac_ext >&5
4801 fi
4802 rm -f conftest.$ac_objext conftest.$ac_ext
4803 done
4804
4805 fi
4806 echo "$as_me:4806: result: $cf_cv_ncurses_header" >&5
4807 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
4808
4809 if test "$cf_cv_ncurses_header" = none ; then
4810         { { echo "$as_me:4810: error: No curses header-files found" >&5
4811 echo "$as_me: error: No curses header-files found" >&2;}
4812    { (exit 1); exit 1; }; }
4813 fi
4814
4815 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
4816
4817 for ac_header in $cf_cv_ncurses_header
4818 do
4819 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
4820 echo "$as_me:4820: checking for $ac_header" >&5
4821 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
4822 if eval "test \"\${$as_ac_Header+set}\" = set"; then
4823   echo $ECHO_N "(cached) $ECHO_C" >&6
4824 else
4825   cat >conftest.$ac_ext <<_ACEOF
4826 #line 4826 "configure"
4827 #include "confdefs.h"
4828 #include <$ac_header>
4829 _ACEOF
4830 if { (eval echo "$as_me:4830: \"$ac_cpp conftest.$ac_ext\"") >&5
4831   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
4832   ac_status=$?
4833   egrep -v '^ *\+' conftest.er1 >conftest.err
4834   rm -f conftest.er1
4835   cat conftest.err >&5
4836   echo "$as_me:4836: \$? = $ac_status" >&5
4837   (exit $ac_status); } >/dev/null; then
4838   if test -s conftest.err; then
4839     ac_cpp_err=$ac_c_preproc_warn_flag
4840   else
4841     ac_cpp_err=
4842   fi
4843 else
4844   ac_cpp_err=yes
4845 fi
4846 if test -z "$ac_cpp_err"; then
4847   eval "$as_ac_Header=yes"
4848 else
4849   echo "$as_me: failed program was:" >&5
4850   cat conftest.$ac_ext >&5
4851   eval "$as_ac_Header=no"
4852 fi
4853 rm -f conftest.err conftest.$ac_ext
4854 fi
4855 echo "$as_me:4855: result: `eval echo '${'$as_ac_Header'}'`" >&5
4856 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
4857 if test `eval echo '${'$as_ac_Header'}'` = yes; then
4858   cat >>confdefs.h <<EOF
4859 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
4860 EOF
4861
4862 fi
4863 done
4864
4865 echo "$as_me:4865: checking for terminfo header" >&5
4866 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
4867 if test "${cf_cv_term_header+set}" = set; then
4868   echo $ECHO_N "(cached) $ECHO_C" >&6
4869 else
4870
4871 case ${cf_cv_ncurses_header} in
4872 (*/ncurses.h|*/ncursesw.h)
4873         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
4874         ;;
4875 (*)
4876         cf_term_header=term.h
4877         ;;
4878 esac
4879
4880 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
4881 do
4882 cat >conftest.$ac_ext <<_ACEOF
4883 #line 4883 "configure"
4884 #include "confdefs.h"
4885 #include <stdio.h>
4886 #include <${cf_cv_ncurses_header:-curses.h}>
4887 #include <$cf_test>
4888
4889 int
4890 main ()
4891 {
4892 int x = auto_left_margin
4893   ;
4894   return 0;
4895 }
4896 _ACEOF
4897 rm -f conftest.$ac_objext
4898 if { (eval echo "$as_me:4898: \"$ac_compile\"") >&5
4899   (eval $ac_compile) 2>&5
4900   ac_status=$?
4901   echo "$as_me:4901: \$? = $ac_status" >&5
4902   (exit $ac_status); } &&
4903          { ac_try='test -s conftest.$ac_objext'
4904   { (eval echo "$as_me:4904: \"$ac_try\"") >&5
4905   (eval $ac_try) 2>&5
4906   ac_status=$?
4907   echo "$as_me:4907: \$? = $ac_status" >&5
4908   (exit $ac_status); }; }; then
4909
4910         cf_cv_term_header="$cf_test"
4911 else
4912   echo "$as_me: failed program was:" >&5
4913 cat conftest.$ac_ext >&5
4914
4915         cf_cv_term_header=unknown
4916
4917 fi
4918 rm -f conftest.$ac_objext conftest.$ac_ext
4919         test "$cf_cv_term_header" != unknown && break
4920 done
4921
4922 fi
4923 echo "$as_me:4923: result: $cf_cv_term_header" >&5
4924 echo "${ECHO_T}$cf_cv_term_header" >&6
4925
4926 # Set definitions to allow ifdef'ing to accommodate subdirectories
4927
4928 case $cf_cv_term_header in
4929 (*term.h)
4930
4931 cat >>confdefs.h <<\EOF
4932 #define HAVE_TERM_H 1
4933 EOF
4934
4935         ;;
4936 esac
4937
4938 case $cf_cv_term_header in
4939 (ncurses/term.h)
4940
4941 cat >>confdefs.h <<\EOF
4942 #define HAVE_NCURSES_TERM_H 1
4943 EOF
4944
4945         ;;
4946 (ncursesw/term.h)
4947
4948 cat >>confdefs.h <<\EOF
4949 #define HAVE_NCURSESW_TERM_H 1
4950 EOF
4951
4952         ;;
4953 esac
4954
4955 echo "$as_me:4955: checking for ncurses version" >&5
4956 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
4957 if test "${cf_cv_ncurses_version+set}" = set; then
4958   echo $ECHO_N "(cached) $ECHO_C" >&6
4959 else
4960
4961         cf_cv_ncurses_version=no
4962         cf_tempfile=out$$
4963         rm -f $cf_tempfile
4964         if test "$cross_compiling" = yes; then
4965
4966         # This will not work if the preprocessor splits the line after the
4967         # Autoconf token.  The 'unproto' program does that.
4968         cat > conftest.$ac_ext <<EOF
4969 #include <${cf_cv_ncurses_header:-curses.h}>
4970 #undef Autoconf
4971 #ifdef NCURSES_VERSION
4972 Autoconf NCURSES_VERSION
4973 #else
4974 #ifdef __NCURSES_H
4975 Autoconf "old"
4976 #endif
4977 ;
4978 #endif
4979 EOF
4980         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
4981         { (eval echo "$as_me:4981: \"$cf_try\"") >&5
4982   (eval $cf_try) 2>&5
4983   ac_status=$?
4984   echo "$as_me:4984: \$? = $ac_status" >&5
4985   (exit $ac_status); }
4986         if test -f conftest.out ; then
4987                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
4988                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
4989                 rm -f conftest.out
4990         fi
4991
4992 else
4993   cat >conftest.$ac_ext <<_ACEOF
4994 #line 4994 "configure"
4995 #include "confdefs.h"
4996
4997 #include <${cf_cv_ncurses_header:-curses.h}>
4998 #include <stdio.h>
4999 int main()
5000 {
5001         FILE *fp = fopen("$cf_tempfile", "w");
5002 #ifdef NCURSES_VERSION
5003 # ifdef NCURSES_VERSION_PATCH
5004         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
5005 # else
5006         fprintf(fp, "%s\n", NCURSES_VERSION);
5007 # endif
5008 #else
5009 # ifdef __NCURSES_H
5010         fprintf(fp, "old\n");
5011 # else
5012         make an error
5013 # endif
5014 #endif
5015         ${cf_cv_main_return:-return}(0);
5016 }
5017 _ACEOF
5018 rm -f conftest$ac_exeext
5019 if { (eval echo "$as_me:5019: \"$ac_link\"") >&5
5020   (eval $ac_link) 2>&5
5021   ac_status=$?
5022   echo "$as_me:5022: \$? = $ac_status" >&5
5023   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
5024   { (eval echo "$as_me:5024: \"$ac_try\"") >&5
5025   (eval $ac_try) 2>&5
5026   ac_status=$?
5027   echo "$as_me:5027: \$? = $ac_status" >&5
5028   (exit $ac_status); }; }; then
5029
5030         cf_cv_ncurses_version=`cat $cf_tempfile`
5031 else
5032   echo "$as_me: program exited with status $ac_status" >&5
5033 echo "$as_me: failed program was:" >&5
5034 cat conftest.$ac_ext >&5
5035 fi
5036 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
5037 fi
5038         rm -f $cf_tempfile
5039
5040 fi
5041 echo "$as_me:5041: result: $cf_cv_ncurses_version" >&5
5042 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
5043 test "$cf_cv_ncurses_version" = no ||
5044 cat >>confdefs.h <<\EOF
5045 #define NCURSES 1
5046 EOF
5047
5048 echo "$as_me:5048: checking if we have identified curses libraries" >&5
5049 echo $ECHO_N "checking if we have identified curses libraries... $ECHO_C" >&6
5050 cat >conftest.$ac_ext <<_ACEOF
5051 #line 5051 "configure"
5052 #include "confdefs.h"
5053 #include <${cf_cv_ncurses_header:-curses.h}>
5054 int
5055 main ()
5056 {
5057 initscr(); tgoto("?", 0,0)
5058   ;
5059   return 0;
5060 }
5061 _ACEOF
5062 rm -f conftest.$ac_objext conftest$ac_exeext
5063 if { (eval echo "$as_me:5063: \"$ac_link\"") >&5
5064   (eval $ac_link) 2>&5
5065   ac_status=$?
5066   echo "$as_me:5066: \$? = $ac_status" >&5
5067   (exit $ac_status); } &&
5068          { ac_try='test -s conftest$ac_exeext'
5069   { (eval echo "$as_me:5069: \"$ac_try\"") >&5
5070   (eval $ac_try) 2>&5
5071   ac_status=$?
5072   echo "$as_me:5072: \$? = $ac_status" >&5
5073   (exit $ac_status); }; }; then
5074   cf_result=yes
5075 else
5076   echo "$as_me: failed program was:" >&5
5077 cat conftest.$ac_ext >&5
5078 cf_result=no
5079 fi
5080 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5081 echo "$as_me:5081: result: $cf_result" >&5
5082 echo "${ECHO_T}$cf_result" >&6
5083
5084 if test "$cf_result" = no ; then
5085 case $host_os in
5086 (freebsd*)
5087         echo "$as_me:5087: checking for tgoto in -lmytinfo" >&5
5088 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
5089 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
5090   echo $ECHO_N "(cached) $ECHO_C" >&6
5091 else
5092   ac_check_lib_save_LIBS=$LIBS
5093 LIBS="-lmytinfo  $LIBS"
5094 cat >conftest.$ac_ext <<_ACEOF
5095 #line 5095 "configure"
5096 #include "confdefs.h"
5097
5098 /* Override any gcc2 internal prototype to avoid an error.  */
5099 #ifdef __cplusplus
5100 extern "C"
5101 #endif
5102 /* We use char because int might match the return type of a gcc2
5103    builtin and then its argument prototype would still apply.  */
5104 char tgoto ();
5105 int
5106 main ()
5107 {
5108 tgoto ();
5109   ;
5110   return 0;
5111 }
5112 _ACEOF
5113 rm -f conftest.$ac_objext conftest$ac_exeext
5114 if { (eval echo "$as_me:5114: \"$ac_link\"") >&5
5115   (eval $ac_link) 2>&5
5116   ac_status=$?
5117   echo "$as_me:5117: \$? = $ac_status" >&5
5118   (exit $ac_status); } &&
5119          { ac_try='test -s conftest$ac_exeext'
5120   { (eval echo "$as_me:5120: \"$ac_try\"") >&5
5121   (eval $ac_try) 2>&5
5122   ac_status=$?
5123   echo "$as_me:5123: \$? = $ac_status" >&5
5124   (exit $ac_status); }; }; then
5125   ac_cv_lib_mytinfo_tgoto=yes
5126 else
5127   echo "$as_me: failed program was:" >&5
5128 cat conftest.$ac_ext >&5
5129 ac_cv_lib_mytinfo_tgoto=no
5130 fi
5131 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5132 LIBS=$ac_check_lib_save_LIBS
5133 fi
5134 echo "$as_me:5134: result: $ac_cv_lib_mytinfo_tgoto" >&5
5135 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
5136 if test $ac_cv_lib_mytinfo_tgoto = yes; then
5137
5138 cf_add_libs="-lmytinfo"
5139 # Filter out duplicates - this happens with badly-designed ".pc" files...
5140 for cf_add_1lib in $LIBS
5141 do
5142         for cf_add_2lib in $cf_add_libs
5143         do
5144                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5145                 then
5146                         cf_add_1lib=
5147                         break
5148                 fi
5149         done
5150         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5151 done
5152 LIBS="$cf_add_libs"
5153
5154 fi
5155
5156         ;;
5157 (hpux10.*)
5158         # Looking at HPUX 10.20, the Hcurses library is the oldest (1997), cur_colr
5159         # next (1998), and xcurses "newer" (2000).  There is no header file for
5160         # Hcurses; the subdirectory curses_colr has the headers (curses.h and
5161         # term.h) for cur_colr
5162         if test "x$cf_cv_screen" = "xcurses_colr"
5163         then
5164                 echo "$as_me:5164: checking for initscr in -lcur_colr" >&5
5165 echo $ECHO_N "checking for initscr in -lcur_colr... $ECHO_C" >&6
5166 if test "${ac_cv_lib_cur_colr_initscr+set}" = set; then
5167   echo $ECHO_N "(cached) $ECHO_C" >&6
5168 else
5169   ac_check_lib_save_LIBS=$LIBS
5170 LIBS="-lcur_colr  $LIBS"
5171 cat >conftest.$ac_ext <<_ACEOF
5172 #line 5172 "configure"
5173 #include "confdefs.h"
5174
5175 /* Override any gcc2 internal prototype to avoid an error.  */
5176 #ifdef __cplusplus
5177 extern "C"
5178 #endif
5179 /* We use char because int might match the return type of a gcc2
5180    builtin and then its argument prototype would still apply.  */
5181 char initscr ();
5182 int
5183 main ()
5184 {
5185 initscr ();
5186   ;
5187   return 0;
5188 }
5189 _ACEOF
5190 rm -f conftest.$ac_objext conftest$ac_exeext
5191 if { (eval echo "$as_me:5191: \"$ac_link\"") >&5
5192   (eval $ac_link) 2>&5
5193   ac_status=$?
5194   echo "$as_me:5194: \$? = $ac_status" >&5
5195   (exit $ac_status); } &&
5196          { ac_try='test -s conftest$ac_exeext'
5197   { (eval echo "$as_me:5197: \"$ac_try\"") >&5
5198   (eval $ac_try) 2>&5
5199   ac_status=$?
5200   echo "$as_me:5200: \$? = $ac_status" >&5
5201   (exit $ac_status); }; }; then
5202   ac_cv_lib_cur_colr_initscr=yes
5203 else
5204   echo "$as_me: failed program was:" >&5
5205 cat conftest.$ac_ext >&5
5206 ac_cv_lib_cur_colr_initscr=no
5207 fi
5208 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5209 LIBS=$ac_check_lib_save_LIBS
5210 fi
5211 echo "$as_me:5211: result: $ac_cv_lib_cur_colr_initscr" >&5
5212 echo "${ECHO_T}$ac_cv_lib_cur_colr_initscr" >&6
5213 if test $ac_cv_lib_cur_colr_initscr = yes; then
5214
5215 cf_add_libs="-lcur_colr"
5216 # Filter out duplicates - this happens with badly-designed ".pc" files...
5217 for cf_add_1lib in $LIBS
5218 do
5219         for cf_add_2lib in $cf_add_libs
5220         do
5221                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5222                 then
5223                         cf_add_1lib=
5224                         break
5225                 fi
5226         done
5227         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5228 done
5229 LIBS="$cf_add_libs"
5230
5231                         ac_cv_func_initscr=yes
5232
5233 else
5234
5235                 echo "$as_me:5235: checking for initscr in -lHcurses" >&5
5236 echo $ECHO_N "checking for initscr in -lHcurses... $ECHO_C" >&6
5237 if test "${ac_cv_lib_Hcurses_initscr+set}" = set; then
5238   echo $ECHO_N "(cached) $ECHO_C" >&6
5239 else
5240   ac_check_lib_save_LIBS=$LIBS
5241 LIBS="-lHcurses  $LIBS"
5242 cat >conftest.$ac_ext <<_ACEOF
5243 #line 5243 "configure"
5244 #include "confdefs.h"
5245
5246 /* Override any gcc2 internal prototype to avoid an error.  */
5247 #ifdef __cplusplus
5248 extern "C"
5249 #endif
5250 /* We use char because int might match the return type of a gcc2
5251    builtin and then its argument prototype would still apply.  */
5252 char initscr ();
5253 int
5254 main ()
5255 {
5256 initscr ();
5257   ;
5258   return 0;
5259 }
5260 _ACEOF
5261 rm -f conftest.$ac_objext conftest$ac_exeext
5262 if { (eval echo "$as_me:5262: \"$ac_link\"") >&5
5263   (eval $ac_link) 2>&5
5264   ac_status=$?
5265   echo "$as_me:5265: \$? = $ac_status" >&5
5266   (exit $ac_status); } &&
5267          { ac_try='test -s conftest$ac_exeext'
5268   { (eval echo "$as_me:5268: \"$ac_try\"") >&5
5269   (eval $ac_try) 2>&5
5270   ac_status=$?
5271   echo "$as_me:5271: \$? = $ac_status" >&5
5272   (exit $ac_status); }; }; then
5273   ac_cv_lib_Hcurses_initscr=yes
5274 else
5275   echo "$as_me: failed program was:" >&5
5276 cat conftest.$ac_ext >&5
5277 ac_cv_lib_Hcurses_initscr=no
5278 fi
5279 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5280 LIBS=$ac_check_lib_save_LIBS
5281 fi
5282 echo "$as_me:5282: result: $ac_cv_lib_Hcurses_initscr" >&5
5283 echo "${ECHO_T}$ac_cv_lib_Hcurses_initscr" >&6
5284 if test $ac_cv_lib_Hcurses_initscr = yes; then
5285
5286                         # HP's header uses __HP_CURSES, but user claims _HP_CURSES.
5287
5288 cf_add_libs="-lHcurses"
5289 # Filter out duplicates - this happens with badly-designed ".pc" files...
5290 for cf_add_1lib in $LIBS
5291 do
5292         for cf_add_2lib in $cf_add_libs
5293         do
5294                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5295                 then
5296                         cf_add_1lib=
5297                         break
5298                 fi
5299         done
5300         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5301 done
5302 LIBS="$cf_add_libs"
5303
5304                         CPPFLAGS="$CPPFLAGS -D__HP_CURSES -D_HP_CURSES"
5305                         ac_cv_func_initscr=yes
5306
5307 fi
5308
5309 fi
5310
5311         fi
5312         ;;
5313 (linux*)
5314         case `arch 2>/dev/null` in
5315         (x86_64)
5316                 if test -d /lib64
5317                 then
5318
5319 if test -n "/lib64" ; then
5320         for cf_add_libdir in /lib64
5321         do
5322                 if test $cf_add_libdir = /usr/lib ; then
5323                         :
5324                 elif test -d $cf_add_libdir
5325                 then
5326                         cf_have_libdir=no
5327                         if test -n "$LDFLAGS$LIBS" ; then
5328                                 # a loop is needed to ensure we can add subdirs of existing dirs
5329                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
5330                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5331                                                 cf_have_libdir=yes; break
5332                                         fi
5333                                 done
5334                         fi
5335                         if test "$cf_have_libdir" = no ; then
5336                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5337
5338 echo "${as_me:-configure}:5338: testing adding $cf_add_libdir to library-path ..." 1>&5
5339
5340                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5341                         fi
5342                 fi
5343         done
5344 fi
5345
5346                 else
5347
5348 if test -n "/lib" ; then
5349         for cf_add_libdir in /lib
5350         do
5351                 if test $cf_add_libdir = /usr/lib ; then
5352                         :
5353                 elif test -d $cf_add_libdir
5354                 then
5355                         cf_have_libdir=no
5356                         if test -n "$LDFLAGS$LIBS" ; then
5357                                 # a loop is needed to ensure we can add subdirs of existing dirs
5358                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
5359                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5360                                                 cf_have_libdir=yes; break
5361                                         fi
5362                                 done
5363                         fi
5364                         if test "$cf_have_libdir" = no ; then
5365                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5366
5367 echo "${as_me:-configure}:5367: testing adding $cf_add_libdir to library-path ..." 1>&5
5368
5369                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5370                         fi
5371                 fi
5372         done
5373 fi
5374
5375                 fi
5376                 ;;
5377         (*)
5378
5379 if test -n "/lib" ; then
5380         for cf_add_libdir in /lib
5381         do
5382                 if test $cf_add_libdir = /usr/lib ; then
5383                         :
5384                 elif test -d $cf_add_libdir
5385                 then
5386                         cf_have_libdir=no
5387                         if test -n "$LDFLAGS$LIBS" ; then
5388                                 # a loop is needed to ensure we can add subdirs of existing dirs
5389                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
5390                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5391                                                 cf_have_libdir=yes; break
5392                                         fi
5393                                 done
5394                         fi
5395                         if test "$cf_have_libdir" = no ; then
5396                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5397
5398 echo "${as_me:-configure}:5398: testing adding $cf_add_libdir to library-path ..." 1>&5
5399
5400                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5401                         fi
5402                 fi
5403         done
5404 fi
5405
5406                 ;;
5407         esac
5408         ;;
5409 (sunos3*|sunos4*)
5410         if test "x$cf_cv_screen" = "xcurses_5lib"
5411         then
5412                 if test -d /usr/5lib ; then
5413
5414 if test -n "/usr/5lib" ; then
5415         for cf_add_libdir in /usr/5lib
5416         do
5417                 if test $cf_add_libdir = /usr/lib ; then
5418                         :
5419                 elif test -d $cf_add_libdir
5420                 then
5421                         cf_have_libdir=no
5422                         if test -n "$LDFLAGS$LIBS" ; then
5423                                 # a loop is needed to ensure we can add subdirs of existing dirs
5424                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
5425                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5426                                                 cf_have_libdir=yes; break
5427                                         fi
5428                                 done
5429                         fi
5430                         if test "$cf_have_libdir" = no ; then
5431                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5432
5433 echo "${as_me:-configure}:5433: testing adding $cf_add_libdir to library-path ..." 1>&5
5434
5435                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5436                         fi
5437                 fi
5438         done
5439 fi
5440
5441 cf_add_libs="-lcurses -ltermcap"
5442 # Filter out duplicates - this happens with badly-designed ".pc" files...
5443 for cf_add_1lib in $LIBS
5444 do
5445         for cf_add_2lib in $cf_add_libs
5446         do
5447                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5448                 then
5449                         cf_add_1lib=
5450                         break
5451                 fi
5452         done
5453         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5454 done
5455 LIBS="$cf_add_libs"
5456
5457                 fi
5458         fi
5459         ac_cv_func_initscr=yes
5460         ;;
5461 esac
5462
5463 if test ".$ac_cv_func_initscr" != .yes ; then
5464         cf_save_LIBS="$LIBS"
5465
5466         if test ".${cf_cv_ncurses_version:-no}" != .no
5467         then
5468                 cf_check_list="ncurses curses cursesX"
5469         else
5470                 cf_check_list="cursesX curses ncurses"
5471         fi
5472
5473         # Check for library containing tgoto.  Do this before curses library
5474         # because it may be needed to link the test-case for initscr.
5475         if test "x$cf_term_lib" = x
5476         then
5477                 echo "$as_me:5477: checking for tgoto" >&5
5478 echo $ECHO_N "checking for tgoto... $ECHO_C" >&6
5479 if test "${ac_cv_func_tgoto+set}" = set; then
5480   echo $ECHO_N "(cached) $ECHO_C" >&6
5481 else
5482   cat >conftest.$ac_ext <<_ACEOF
5483 #line 5483 "configure"
5484 #include "confdefs.h"
5485 /* System header to define __stub macros and hopefully few prototypes,
5486     which can conflict with char tgoto (); below.  */
5487 #include <assert.h>
5488 /* Override any gcc2 internal prototype to avoid an error.  */
5489 #ifdef __cplusplus
5490 extern "C"
5491 #endif
5492 /* We use char because int might match the return type of a gcc2
5493    builtin and then its argument prototype would still apply.  */
5494 char tgoto ();
5495 char (*f) ();
5496
5497 int
5498 main ()
5499 {
5500 /* The GNU C library defines this for functions which it implements
5501     to always fail with ENOSYS.  Some functions are actually named
5502     something starting with __ and the normal name is an alias.  */
5503 #if defined (__stub_tgoto) || defined (__stub___tgoto)
5504 choke me
5505 #else
5506 f = tgoto; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
5507 #endif
5508
5509   ;
5510   return 0;
5511 }
5512 _ACEOF
5513 rm -f conftest.$ac_objext conftest$ac_exeext
5514 if { (eval echo "$as_me:5514: \"$ac_link\"") >&5
5515   (eval $ac_link) 2>&5
5516   ac_status=$?
5517   echo "$as_me:5517: \$? = $ac_status" >&5
5518   (exit $ac_status); } &&
5519          { ac_try='test -s conftest$ac_exeext'
5520   { (eval echo "$as_me:5520: \"$ac_try\"") >&5
5521   (eval $ac_try) 2>&5
5522   ac_status=$?
5523   echo "$as_me:5523: \$? = $ac_status" >&5
5524   (exit $ac_status); }; }; then
5525   ac_cv_func_tgoto=yes
5526 else
5527   echo "$as_me: failed program was:" >&5
5528 cat conftest.$ac_ext >&5
5529 ac_cv_func_tgoto=no
5530 fi
5531 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5532 fi
5533 echo "$as_me:5533: result: $ac_cv_func_tgoto" >&5
5534 echo "${ECHO_T}$ac_cv_func_tgoto" >&6
5535 if test $ac_cv_func_tgoto = yes; then
5536   cf_term_lib=predefined
5537 else
5538
5539                         for cf_term_lib in $cf_check_list otermcap termcap tinfo termlib unknown
5540                         do
5541                                 as_ac_Lib=`echo "ac_cv_lib_$cf_term_lib''_tgoto" | $as_tr_sh`
5542 echo "$as_me:5542: checking for tgoto in -l$cf_term_lib" >&5
5543 echo $ECHO_N "checking for tgoto in -l$cf_term_lib... $ECHO_C" >&6
5544 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
5545   echo $ECHO_N "(cached) $ECHO_C" >&6
5546 else
5547   ac_check_lib_save_LIBS=$LIBS
5548 LIBS="-l$cf_term_lib  $LIBS"
5549 cat >conftest.$ac_ext <<_ACEOF
5550 #line 5550 "configure"
5551 #include "confdefs.h"
5552
5553 /* Override any gcc2 internal prototype to avoid an error.  */
5554 #ifdef __cplusplus
5555 extern "C"
5556 #endif
5557 /* We use char because int might match the return type of a gcc2
5558    builtin and then its argument prototype would still apply.  */
5559 char tgoto ();
5560 int
5561 main ()
5562 {
5563 tgoto ();
5564   ;
5565   return 0;
5566 }
5567 _ACEOF
5568 rm -f conftest.$ac_objext conftest$ac_exeext
5569 if { (eval echo "$as_me:5569: \"$ac_link\"") >&5
5570   (eval $ac_link) 2>&5
5571   ac_status=$?
5572   echo "$as_me:5572: \$? = $ac_status" >&5
5573   (exit $ac_status); } &&
5574          { ac_try='test -s conftest$ac_exeext'
5575   { (eval echo "$as_me:5575: \"$ac_try\"") >&5
5576   (eval $ac_try) 2>&5
5577   ac_status=$?
5578   echo "$as_me:5578: \$? = $ac_status" >&5
5579   (exit $ac_status); }; }; then
5580   eval "$as_ac_Lib=yes"
5581 else
5582   echo "$as_me: failed program was:" >&5
5583 cat conftest.$ac_ext >&5
5584 eval "$as_ac_Lib=no"
5585 fi
5586 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5587 LIBS=$ac_check_lib_save_LIBS
5588 fi
5589 echo "$as_me:5589: result: `eval echo '${'$as_ac_Lib'}'`" >&5
5590 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
5591 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
5592   break
5593 fi
5594
5595                         done
5596
5597 fi
5598
5599         fi
5600
5601         # Check for library containing initscr
5602         test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS"
5603         if test "x$cf_curs_lib" = x
5604         then
5605                 for cf_curs_lib in $cf_check_list xcurses jcurses pdcurses unknown
5606                 do
5607                         as_ac_Lib=`echo "ac_cv_lib_$cf_curs_lib''_initscr" | $as_tr_sh`
5608 echo "$as_me:5608: checking for initscr in -l$cf_curs_lib" >&5
5609 echo $ECHO_N "checking for initscr in -l$cf_curs_lib... $ECHO_C" >&6
5610 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
5611   echo $ECHO_N "(cached) $ECHO_C" >&6
5612 else
5613   ac_check_lib_save_LIBS=$LIBS
5614 LIBS="-l$cf_curs_lib  $LIBS"
5615 cat >conftest.$ac_ext <<_ACEOF
5616 #line 5616 "configure"
5617 #include "confdefs.h"
5618
5619 /* Override any gcc2 internal prototype to avoid an error.  */
5620 #ifdef __cplusplus
5621 extern "C"
5622 #endif
5623 /* We use char because int might match the return type of a gcc2
5624    builtin and then its argument prototype would still apply.  */
5625 char initscr ();
5626 int
5627 main ()
5628 {
5629 initscr ();
5630   ;
5631   return 0;
5632 }
5633 _ACEOF
5634 rm -f conftest.$ac_objext conftest$ac_exeext
5635 if { (eval echo "$as_me:5635: \"$ac_link\"") >&5
5636   (eval $ac_link) 2>&5
5637   ac_status=$?
5638   echo "$as_me:5638: \$? = $ac_status" >&5
5639   (exit $ac_status); } &&
5640          { ac_try='test -s conftest$ac_exeext'
5641   { (eval echo "$as_me:5641: \"$ac_try\"") >&5
5642   (eval $ac_try) 2>&5
5643   ac_status=$?
5644   echo "$as_me:5644: \$? = $ac_status" >&5
5645   (exit $ac_status); }; }; then
5646   eval "$as_ac_Lib=yes"
5647 else
5648   echo "$as_me: failed program was:" >&5
5649 cat conftest.$ac_ext >&5
5650 eval "$as_ac_Lib=no"
5651 fi
5652 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5653 LIBS=$ac_check_lib_save_LIBS
5654 fi
5655 echo "$as_me:5655: result: `eval echo '${'$as_ac_Lib'}'`" >&5
5656 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
5657 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
5658   break
5659 fi
5660
5661                 done
5662         fi
5663         test $cf_curs_lib = unknown && { { echo "$as_me:5663: error: no curses library found" >&5
5664 echo "$as_me: error: no curses library found" >&2;}
5665    { (exit 1); exit 1; }; }
5666
5667         LIBS="-l$cf_curs_lib $cf_save_LIBS"
5668         if test "$cf_term_lib" = unknown ; then
5669                 echo "$as_me:5669: checking if we can link with $cf_curs_lib library" >&5
5670 echo $ECHO_N "checking if we can link with $cf_curs_lib library... $ECHO_C" >&6
5671                 cat >conftest.$ac_ext <<_ACEOF
5672 #line 5672 "configure"
5673 #include "confdefs.h"
5674 #include <${cf_cv_ncurses_header:-curses.h}>
5675 int
5676 main ()
5677 {
5678 initscr()
5679   ;
5680   return 0;
5681 }
5682 _ACEOF
5683 rm -f conftest.$ac_objext conftest$ac_exeext
5684 if { (eval echo "$as_me:5684: \"$ac_link\"") >&5
5685   (eval $ac_link) 2>&5
5686   ac_status=$?
5687   echo "$as_me:5687: \$? = $ac_status" >&5
5688   (exit $ac_status); } &&
5689          { ac_try='test -s conftest$ac_exeext'
5690   { (eval echo "$as_me:5690: \"$ac_try\"") >&5
5691   (eval $ac_try) 2>&5
5692   ac_status=$?
5693   echo "$as_me:5693: \$? = $ac_status" >&5
5694   (exit $ac_status); }; }; then
5695   cf_result=yes
5696 else
5697   echo "$as_me: failed program was:" >&5
5698 cat conftest.$ac_ext >&5
5699 cf_result=no
5700 fi
5701 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5702                 echo "$as_me:5702: result: $cf_result" >&5
5703 echo "${ECHO_T}$cf_result" >&6
5704                 test $cf_result = no && { { echo "$as_me:5704: error: Cannot link curses library" >&5
5705 echo "$as_me: error: Cannot link curses library" >&2;}
5706    { (exit 1); exit 1; }; }
5707         elif test "$cf_curs_lib" = "$cf_term_lib" ; then
5708                 :
5709         elif test "$cf_term_lib" != predefined ; then
5710                 echo "$as_me:5710: checking if we need both $cf_curs_lib and $cf_term_lib libraries" >&5
5711 echo $ECHO_N "checking if we need both $cf_curs_lib and $cf_term_lib libraries... $ECHO_C" >&6
5712                 cat >conftest.$ac_ext <<_ACEOF
5713 #line 5713 "configure"
5714 #include "confdefs.h"
5715 #include <${cf_cv_ncurses_header:-curses.h}>
5716 int
5717 main ()
5718 {
5719 initscr(); tgoto((char *)0, 0, 0);
5720   ;
5721   return 0;
5722 }
5723 _ACEOF
5724 rm -f conftest.$ac_objext conftest$ac_exeext
5725 if { (eval echo "$as_me:5725: \"$ac_link\"") >&5
5726   (eval $ac_link) 2>&5
5727   ac_status=$?
5728   echo "$as_me:5728: \$? = $ac_status" >&5
5729   (exit $ac_status); } &&
5730          { ac_try='test -s conftest$ac_exeext'
5731   { (eval echo "$as_me:5731: \"$ac_try\"") >&5
5732   (eval $ac_try) 2>&5
5733   ac_status=$?
5734   echo "$as_me:5734: \$? = $ac_status" >&5
5735   (exit $ac_status); }; }; then
5736   cf_result=no
5737 else
5738   echo "$as_me: failed program was:" >&5
5739 cat conftest.$ac_ext >&5
5740
5741                         LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
5742                         cat >conftest.$ac_ext <<_ACEOF
5743 #line 5743 "configure"
5744 #include "confdefs.h"
5745 #include <${cf_cv_ncurses_header:-curses.h}>
5746 int
5747 main ()
5748 {
5749 initscr()
5750   ;
5751   return 0;
5752 }
5753 _ACEOF
5754 rm -f conftest.$ac_objext conftest$ac_exeext
5755 if { (eval echo "$as_me:5755: \"$ac_link\"") >&5
5756   (eval $ac_link) 2>&5
5757   ac_status=$?
5758   echo "$as_me:5758: \$? = $ac_status" >&5
5759   (exit $ac_status); } &&
5760          { ac_try='test -s conftest$ac_exeext'
5761   { (eval echo "$as_me:5761: \"$ac_try\"") >&5
5762   (eval $ac_try) 2>&5
5763   ac_status=$?
5764   echo "$as_me:5764: \$? = $ac_status" >&5
5765   (exit $ac_status); }; }; then
5766   cf_result=yes
5767 else
5768   echo "$as_me: failed program was:" >&5
5769 cat conftest.$ac_ext >&5
5770 cf_result=error
5771 fi
5772 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5773
5774 fi
5775 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5776                 echo "$as_me:5776: result: $cf_result" >&5
5777 echo "${ECHO_T}$cf_result" >&6
5778         fi
5779 fi
5780 fi
5781
5782         ;;
5783 (ncursesw*)
5784
5785 echo "$as_me:5785: checking for multibyte character support" >&5
5786 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
5787 if test "${cf_cv_utf8_lib+set}" = set; then
5788   echo $ECHO_N "(cached) $ECHO_C" >&6
5789 else
5790
5791         cf_save_LIBS="$LIBS"
5792         cat >conftest.$ac_ext <<_ACEOF
5793 #line 5793 "configure"
5794 #include "confdefs.h"
5795
5796 #include <stdlib.h>
5797 int
5798 main ()
5799 {
5800 putwc(0,0);
5801   ;
5802   return 0;
5803 }
5804 _ACEOF
5805 rm -f conftest.$ac_objext conftest$ac_exeext
5806 if { (eval echo "$as_me:5806: \"$ac_link\"") >&5
5807   (eval $ac_link) 2>&5
5808   ac_status=$?
5809   echo "$as_me:5809: \$? = $ac_status" >&5
5810   (exit $ac_status); } &&
5811          { ac_try='test -s conftest$ac_exeext'
5812   { (eval echo "$as_me:5812: \"$ac_try\"") >&5
5813   (eval $ac_try) 2>&5
5814   ac_status=$?
5815   echo "$as_me:5815: \$? = $ac_status" >&5
5816   (exit $ac_status); }; }; then
5817   cf_cv_utf8_lib=yes
5818 else
5819   echo "$as_me: failed program was:" >&5
5820 cat conftest.$ac_ext >&5
5821
5822 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
5823 # will be set on completion of the AC_TRY_LINK below.
5824 cf_cv_header_path_utf8=
5825 cf_cv_library_path_utf8=
5826
5827 echo "${as_me:-configure}:5827: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
5828
5829 cf_save_LIBS="$LIBS"
5830
5831 cat >conftest.$ac_ext <<_ACEOF
5832 #line 5832 "configure"
5833 #include "confdefs.h"
5834
5835 #include <libutf8.h>
5836 int
5837 main ()
5838 {
5839 putwc(0,0);
5840   ;
5841   return 0;
5842 }
5843 _ACEOF
5844 rm -f conftest.$ac_objext conftest$ac_exeext
5845 if { (eval echo "$as_me:5845: \"$ac_link\"") >&5
5846   (eval $ac_link) 2>&5
5847   ac_status=$?
5848   echo "$as_me:5848: \$? = $ac_status" >&5
5849   (exit $ac_status); } &&
5850          { ac_try='test -s conftest$ac_exeext'
5851   { (eval echo "$as_me:5851: \"$ac_try\"") >&5
5852   (eval $ac_try) 2>&5
5853   ac_status=$?
5854   echo "$as_me:5854: \$? = $ac_status" >&5
5855   (exit $ac_status); }; }; then
5856
5857         cf_cv_find_linkage_utf8=yes
5858         cf_cv_header_path_utf8=/usr/include
5859         cf_cv_library_path_utf8=/usr/lib
5860
5861 else
5862   echo "$as_me: failed program was:" >&5
5863 cat conftest.$ac_ext >&5
5864
5865 LIBS="-lutf8  $cf_save_LIBS"
5866
5867 cat >conftest.$ac_ext <<_ACEOF
5868 #line 5868 "configure"
5869 #include "confdefs.h"
5870
5871 #include <libutf8.h>
5872 int
5873 main ()
5874 {
5875 putwc(0,0);
5876   ;
5877   return 0;
5878 }
5879 _ACEOF
5880 rm -f conftest.$ac_objext conftest$ac_exeext
5881 if { (eval echo "$as_me:5881: \"$ac_link\"") >&5
5882   (eval $ac_link) 2>&5
5883   ac_status=$?
5884   echo "$as_me:5884: \$? = $ac_status" >&5
5885   (exit $ac_status); } &&
5886          { ac_try='test -s conftest$ac_exeext'
5887   { (eval echo "$as_me:5887: \"$ac_try\"") >&5
5888   (eval $ac_try) 2>&5
5889   ac_status=$?
5890   echo "$as_me:5890: \$? = $ac_status" >&5
5891   (exit $ac_status); }; }; then
5892
5893         cf_cv_find_linkage_utf8=yes
5894         cf_cv_header_path_utf8=/usr/include
5895         cf_cv_library_path_utf8=/usr/lib
5896         cf_cv_library_file_utf8="-lutf8"
5897
5898 else
5899   echo "$as_me: failed program was:" >&5
5900 cat conftest.$ac_ext >&5
5901
5902         cf_cv_find_linkage_utf8=no
5903         LIBS="$cf_save_LIBS"
5904
5905         test -n "$verbose" && echo "    find linkage for utf8 library" 1>&6
5906
5907 echo "${as_me:-configure}:5907: testing find linkage for utf8 library ..." 1>&5
5908
5909 echo "${as_me:-configure}:5909: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
5910
5911         cf_save_CPPFLAGS="$CPPFLAGS"
5912         cf_test_CPPFLAGS="$CPPFLAGS"
5913
5914 cf_search=
5915
5916 # collect the current set of include-directories from compiler flags
5917 cf_header_path_list=""
5918 if test -n "${CFLAGS}${CPPFLAGS}" ; then
5919         for cf_header_path in $CPPFLAGS $CFLAGS
5920         do
5921                 case $cf_header_path in
5922                 (-I*)
5923                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
5924
5925 test "x$cf_header_path" != "xNONE" && \
5926 test -d "$cf_header_path" && \
5927  {
5928         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
5929         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
5930         test -d $cf_header_path/include/utf8 &&       cf_search="$cf_search $cf_header_path/include/utf8"
5931         test -d $cf_header_path/include/utf8/include &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
5932         test -d $cf_header_path/utf8/include &&       cf_search="$cf_search $cf_header_path/utf8/include"
5933         test -d $cf_header_path/utf8/include/utf8 &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
5934 }
5935
5936                         cf_header_path_list="$cf_header_path_list $cf_search"
5937                         ;;
5938                 esac
5939         done
5940 fi
5941
5942 # add the variations for the package we are looking for
5943
5944 cf_search=
5945
5946 test "x$prefix" != "xNONE" && \
5947 test -d "$prefix" && \
5948  {
5949         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
5950         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
5951         test -d $prefix/include/utf8 &&       cf_search="$cf_search $prefix/include/utf8"
5952         test -d $prefix/include/utf8/include &&    cf_search="$cf_search $prefix/include/utf8/include"
5953         test -d $prefix/utf8/include &&       cf_search="$cf_search $prefix/utf8/include"
5954         test -d $prefix/utf8/include/utf8 &&    cf_search="$cf_search $prefix/utf8/include/utf8"
5955 }
5956
5957 for cf_subdir_prefix in \
5958         /usr \
5959         /usr/local \
5960         /usr/pkg \
5961         /opt \
5962         /opt/local \
5963         $HOME
5964 do
5965
5966 test "x$cf_subdir_prefix" != "x$prefix" && \
5967 test -d "$cf_subdir_prefix" && \
5968 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
5969         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
5970         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
5971         test -d $cf_subdir_prefix/include/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/include/utf8"
5972         test -d $cf_subdir_prefix/include/utf8/include &&    cf_search="$cf_search $cf_subdir_prefix/include/utf8/include"
5973         test -d $cf_subdir_prefix/utf8/include &&       cf_search="$cf_search $cf_subdir_prefix/utf8/include"
5974         test -d $cf_subdir_prefix/utf8/include/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/include/utf8"
5975 }
5976
5977 done
5978
5979 test "$includedir" != NONE && \
5980 test "$includedir" != "/usr/include" && \
5981 test -d "$includedir" && {
5982         test -d $includedir &&    cf_search="$cf_search $includedir"
5983         test -d $includedir/utf8 && cf_search="$cf_search $includedir/utf8"
5984 }
5985
5986 test "$oldincludedir" != NONE && \
5987 test "$oldincludedir" != "/usr/include" && \
5988 test -d "$oldincludedir" && {
5989         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
5990         test -d $oldincludedir/utf8 && cf_search="$cf_search $oldincludedir/utf8"
5991 }
5992
5993 cf_search="$cf_search $cf_header_path_list"
5994
5995         for cf_cv_header_path_utf8 in $cf_search
5996         do
5997                 if test -d $cf_cv_header_path_utf8 ; then
5998                         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
5999
6000 echo "${as_me:-configure}:6000: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
6001
6002                         CPPFLAGS="$cf_save_CPPFLAGS -I$cf_cv_header_path_utf8"
6003                         cat >conftest.$ac_ext <<_ACEOF
6004 #line 6004 "configure"
6005 #include "confdefs.h"
6006
6007 #include <libutf8.h>
6008 int
6009 main ()
6010 {
6011 putwc(0,0);
6012   ;
6013   return 0;
6014 }
6015 _ACEOF
6016 rm -f conftest.$ac_objext
6017 if { (eval echo "$as_me:6017: \"$ac_compile\"") >&5
6018   (eval $ac_compile) 2>&5
6019   ac_status=$?
6020   echo "$as_me:6020: \$? = $ac_status" >&5
6021   (exit $ac_status); } &&
6022          { ac_try='test -s conftest.$ac_objext'
6023   { (eval echo "$as_me:6023: \"$ac_try\"") >&5
6024   (eval $ac_try) 2>&5
6025   ac_status=$?
6026   echo "$as_me:6026: \$? = $ac_status" >&5
6027   (exit $ac_status); }; }; then
6028
6029                                 test -n "$verbose" && echo "    ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
6030
6031 echo "${as_me:-configure}:6031: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
6032
6033                                 cf_cv_find_linkage_utf8=maybe
6034                                 cf_test_CPPFLAGS="$CPPFLAGS"
6035                                 break
6036 else
6037   echo "$as_me: failed program was:" >&5
6038 cat conftest.$ac_ext >&5
6039
6040                                 CPPFLAGS="$cf_save_CPPFLAGS"
6041
6042 fi
6043 rm -f conftest.$ac_objext conftest.$ac_ext
6044                 fi
6045         done
6046
6047         if test "$cf_cv_find_linkage_utf8" = maybe ; then
6048
6049 echo "${as_me:-configure}:6049: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
6050
6051                 cf_save_LIBS="$LIBS"
6052                 cf_save_LDFLAGS="$LDFLAGS"
6053
6054                 if test "$cf_cv_find_linkage_utf8" != yes ; then
6055
6056 cf_search=
6057 cf_library_path_list=""
6058 if test -n "${LDFLAGS}${LIBS}" ; then
6059         for cf_library_path in $LDFLAGS $LIBS
6060         do
6061                 case $cf_library_path in
6062                 (-L*)
6063                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
6064
6065 test "x$cf_library_path" != "xNONE" && \
6066 test -d "$cf_library_path" && \
6067  {
6068         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
6069         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
6070         test -d $cf_library_path/lib/utf8 &&       cf_search="$cf_search $cf_library_path/lib/utf8"
6071         test -d $cf_library_path/lib/utf8/lib &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
6072         test -d $cf_library_path/utf8/lib &&       cf_search="$cf_search $cf_library_path/utf8/lib"
6073         test -d $cf_library_path/utf8/lib/utf8 &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
6074 }
6075
6076                         cf_library_path_list="$cf_library_path_list $cf_search"
6077                         ;;
6078                 esac
6079         done
6080 fi
6081
6082 cf_search=
6083
6084 test "x$prefix" != "xNONE" && \
6085 test -d "$prefix" && \
6086  {
6087         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
6088         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
6089         test -d $prefix/lib/utf8 &&       cf_search="$cf_search $prefix/lib/utf8"
6090         test -d $prefix/lib/utf8/lib &&    cf_search="$cf_search $prefix/lib/utf8/lib"
6091         test -d $prefix/utf8/lib &&       cf_search="$cf_search $prefix/utf8/lib"
6092         test -d $prefix/utf8/lib/utf8 &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
6093 }
6094
6095 for cf_subdir_prefix in \
6096         /usr \
6097         /usr/local \
6098         /usr/pkg \
6099         /opt \
6100         /opt/local \
6101         $HOME
6102 do
6103
6104 test "x$cf_subdir_prefix" != "x$prefix" && \
6105 test -d "$cf_subdir_prefix" && \
6106 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
6107         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
6108         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
6109         test -d $cf_subdir_prefix/lib/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/lib/utf8"
6110         test -d $cf_subdir_prefix/lib/utf8/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/utf8/lib"
6111         test -d $cf_subdir_prefix/utf8/lib &&       cf_search="$cf_search $cf_subdir_prefix/utf8/lib"
6112         test -d $cf_subdir_prefix/utf8/lib/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/lib/utf8"
6113 }
6114
6115 done
6116
6117 cf_search="$cf_library_path_list $cf_search"
6118
6119                         for cf_cv_library_path_utf8 in $cf_search
6120                         do
6121                                 if test -d $cf_cv_library_path_utf8 ; then
6122                                         test -n "$verbose" && echo "    ... testing $cf_cv_library_path_utf8" 1>&6
6123
6124 echo "${as_me:-configure}:6124: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
6125
6126                                         CPPFLAGS="$cf_test_CPPFLAGS"
6127                                         LIBS="-lutf8  $cf_save_LIBS"
6128                                         LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
6129                                         cat >conftest.$ac_ext <<_ACEOF
6130 #line 6130 "configure"
6131 #include "confdefs.h"
6132
6133 #include <libutf8.h>
6134 int
6135 main ()
6136 {
6137 putwc(0,0);
6138   ;
6139   return 0;
6140 }
6141 _ACEOF
6142 rm -f conftest.$ac_objext conftest$ac_exeext
6143 if { (eval echo "$as_me:6143: \"$ac_link\"") >&5
6144   (eval $ac_link) 2>&5
6145   ac_status=$?
6146   echo "$as_me:6146: \$? = $ac_status" >&5
6147   (exit $ac_status); } &&
6148          { ac_try='test -s conftest$ac_exeext'
6149   { (eval echo "$as_me:6149: \"$ac_try\"") >&5
6150   (eval $ac_try) 2>&5
6151   ac_status=$?
6152   echo "$as_me:6152: \$? = $ac_status" >&5
6153   (exit $ac_status); }; }; then
6154
6155                                         test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
6156
6157 echo "${as_me:-configure}:6157: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
6158
6159                                         cf_cv_find_linkage_utf8=yes
6160                                         cf_cv_library_file_utf8="-lutf8"
6161                                         break
6162 else
6163   echo "$as_me: failed program was:" >&5
6164 cat conftest.$ac_ext >&5
6165
6166                                         CPPFLAGS="$cf_save_CPPFLAGS"
6167                                         LIBS="$cf_save_LIBS"
6168                                         LDFLAGS="$cf_save_LDFLAGS"
6169
6170 fi
6171 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6172                                 fi
6173                         done
6174                         CPPFLAGS="$cf_save_CPPFLAGS"
6175                         LDFLAGS="$cf_save_LDFLAGS"
6176                 fi
6177
6178         else
6179                 cf_cv_find_linkage_utf8=no
6180         fi
6181
6182 fi
6183 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6184
6185 fi
6186 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6187
6188 LIBS="$cf_save_LIBS"
6189
6190 if test "$cf_cv_find_linkage_utf8" = yes ; then
6191 cf_cv_utf8_lib=add-on
6192 else
6193 cf_cv_utf8_lib=no
6194 fi
6195
6196 fi
6197 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6198 fi
6199 echo "$as_me:6199: result: $cf_cv_utf8_lib" >&5
6200 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
6201
6202 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
6203 # ncurses/ncursesw:
6204 if test "$cf_cv_utf8_lib" = "add-on" ; then
6205
6206 cat >>confdefs.h <<\EOF
6207 #define HAVE_LIBUTF8_H 1
6208 EOF
6209
6210 if test -n "$cf_cv_header_path_utf8" ; then
6211   for cf_add_incdir in $cf_cv_header_path_utf8
6212   do
6213         while test $cf_add_incdir != /usr/include
6214         do
6215           if test -d $cf_add_incdir
6216           then
6217                 cf_have_incdir=no
6218                 if test -n "$CFLAGS$CPPFLAGS" ; then
6219                   # a loop is needed to ensure we can add subdirs of existing dirs
6220                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6221                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6222                           cf_have_incdir=yes; break
6223                         fi
6224                   done
6225                 fi
6226
6227                 if test "$cf_have_incdir" = no ; then
6228                   if test "$cf_add_incdir" = /usr/local/include ; then
6229                         if test "$GCC" = yes
6230                         then
6231                           cf_save_CPPFLAGS=$CPPFLAGS
6232                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6233                           cat >conftest.$ac_ext <<_ACEOF
6234 #line 6234 "configure"
6235 #include "confdefs.h"
6236 #include <stdio.h>
6237 int
6238 main ()
6239 {
6240 printf("Hello")
6241   ;
6242   return 0;
6243 }
6244 _ACEOF
6245 rm -f conftest.$ac_objext
6246 if { (eval echo "$as_me:6246: \"$ac_compile\"") >&5
6247   (eval $ac_compile) 2>&5
6248   ac_status=$?
6249   echo "$as_me:6249: \$? = $ac_status" >&5
6250   (exit $ac_status); } &&
6251          { ac_try='test -s conftest.$ac_objext'
6252   { (eval echo "$as_me:6252: \"$ac_try\"") >&5
6253   (eval $ac_try) 2>&5
6254   ac_status=$?
6255   echo "$as_me:6255: \$? = $ac_status" >&5
6256   (exit $ac_status); }; }; then
6257   :
6258 else
6259   echo "$as_me: failed program was:" >&5
6260 cat conftest.$ac_ext >&5
6261 cf_have_incdir=yes
6262 fi
6263 rm -f conftest.$ac_objext conftest.$ac_ext
6264                           CPPFLAGS=$cf_save_CPPFLAGS
6265                         fi
6266                   fi
6267                 fi
6268
6269                 if test "$cf_have_incdir" = no ; then
6270                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6271
6272 echo "${as_me:-configure}:6272: testing adding $cf_add_incdir to include-path ..." 1>&5
6273
6274                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6275
6276                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6277                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6278                   cf_add_incdir="$cf_top_incdir"
6279                 else
6280                   break
6281                 fi
6282           else
6283                 break
6284           fi
6285         done
6286   done
6287 fi
6288
6289 if test -n "$cf_cv_library_path_utf8" ; then
6290         for cf_add_libdir in $cf_cv_library_path_utf8
6291         do
6292                 if test $cf_add_libdir = /usr/lib ; then
6293                         :
6294                 elif test -d $cf_add_libdir
6295                 then
6296                         cf_have_libdir=no
6297                         if test -n "$LDFLAGS$LIBS" ; then
6298                                 # a loop is needed to ensure we can add subdirs of existing dirs
6299                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6300                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6301                                                 cf_have_libdir=yes; break
6302                                         fi
6303                                 done
6304                         fi
6305                         if test "$cf_have_libdir" = no ; then
6306                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6307
6308 echo "${as_me:-configure}:6308: testing adding $cf_add_libdir to library-path ..." 1>&5
6309
6310                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6311                         fi
6312                 fi
6313         done
6314 fi
6315
6316 cf_add_libs="$cf_cv_library_file_utf8"
6317 # Filter out duplicates - this happens with badly-designed ".pc" files...
6318 for cf_add_1lib in $LIBS
6319 do
6320         for cf_add_2lib in $cf_add_libs
6321         do
6322                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6323                 then
6324                         cf_add_1lib=
6325                         break
6326                 fi
6327         done
6328         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6329 done
6330 LIBS="$cf_add_libs"
6331
6332 fi
6333
6334 cf_ncuconfig_root=$cf_cv_screen
6335 cf_have_ncuconfig=no
6336
6337 if test "x${PKG_CONFIG:=none}" != xnone; then
6338         echo "$as_me:6338: checking pkg-config for $cf_ncuconfig_root" >&5
6339 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
6340         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
6341                 echo "$as_me:6341: result: yes" >&5
6342 echo "${ECHO_T}yes" >&6
6343
6344                 echo "$as_me:6344: checking if the $cf_ncuconfig_root package files work" >&5
6345 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
6346                 cf_have_ncuconfig=unknown
6347
6348                 cf_save_CPPFLAGS="$CPPFLAGS"
6349                 cf_save_LIBS="$LIBS"
6350
6351                 CPPFLAGS="$CPPFLAGS `$PKG_CONFIG --cflags $cf_ncuconfig_root`"
6352
6353 cf_add_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
6354 # Filter out duplicates - this happens with badly-designed ".pc" files...
6355 for cf_add_1lib in $LIBS
6356 do
6357         for cf_add_2lib in $cf_add_libs
6358         do
6359                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6360                 then
6361                         cf_add_1lib=
6362                         break
6363                 fi
6364         done
6365         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6366 done
6367 LIBS="$cf_add_libs"
6368
6369                 cat >conftest.$ac_ext <<_ACEOF
6370 #line 6370 "configure"
6371 #include "confdefs.h"
6372 #include <${cf_cv_ncurses_header:-curses.h}>
6373 int
6374 main ()
6375 {
6376 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
6377   ;
6378   return 0;
6379 }
6380 _ACEOF
6381 rm -f conftest.$ac_objext conftest$ac_exeext
6382 if { (eval echo "$as_me:6382: \"$ac_link\"") >&5
6383   (eval $ac_link) 2>&5
6384   ac_status=$?
6385   echo "$as_me:6385: \$? = $ac_status" >&5
6386   (exit $ac_status); } &&
6387          { ac_try='test -s conftest$ac_exeext'
6388   { (eval echo "$as_me:6388: \"$ac_try\"") >&5
6389   (eval $ac_try) 2>&5
6390   ac_status=$?
6391   echo "$as_me:6391: \$? = $ac_status" >&5
6392   (exit $ac_status); }; }; then
6393   if test "$cross_compiling" = yes; then
6394   cf_have_ncuconfig=maybe
6395 else
6396   cat >conftest.$ac_ext <<_ACEOF
6397 #line 6397 "configure"
6398 #include "confdefs.h"
6399 #include <${cf_cv_ncurses_header:-curses.h}>
6400                                 int main(void)
6401                                 { char *xx = curses_version(); return (xx == 0); }
6402 _ACEOF
6403 rm -f conftest$ac_exeext
6404 if { (eval echo "$as_me:6404: \"$ac_link\"") >&5
6405   (eval $ac_link) 2>&5
6406   ac_status=$?
6407   echo "$as_me:6407: \$? = $ac_status" >&5
6408   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
6409   { (eval echo "$as_me:6409: \"$ac_try\"") >&5
6410   (eval $ac_try) 2>&5
6411   ac_status=$?
6412   echo "$as_me:6412: \$? = $ac_status" >&5
6413   (exit $ac_status); }; }; then
6414   cf_have_ncuconfig=yes
6415 else
6416   echo "$as_me: program exited with status $ac_status" >&5
6417 echo "$as_me: failed program was:" >&5
6418 cat conftest.$ac_ext >&5
6419 cf_have_ncuconfig=no
6420 fi
6421 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
6422 fi
6423 else
6424   echo "$as_me: failed program was:" >&5
6425 cat conftest.$ac_ext >&5
6426 cf_have_ncuconfig=no
6427 fi
6428 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6429                 echo "$as_me:6429: result: $cf_have_ncuconfig" >&5
6430 echo "${ECHO_T}$cf_have_ncuconfig" >&6
6431                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
6432                 if test "$cf_have_ncuconfig" != "yes"
6433                 then
6434                         CPPFLAGS="$cf_save_CPPFLAGS"
6435                         LIBS="$cf_save_LIBS"
6436                         NCURSES_CONFIG_PKG=none
6437                 else
6438
6439 cat >>confdefs.h <<\EOF
6440 #define NCURSES 1
6441 EOF
6442
6443                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
6444                 fi
6445
6446         else
6447                 echo "$as_me:6447: result: no" >&5
6448 echo "${ECHO_T}no" >&6
6449                 NCURSES_CONFIG_PKG=none
6450         fi
6451 else
6452         NCURSES_CONFIG_PKG=none
6453 fi
6454
6455 if test "x$cf_have_ncuconfig" = "xno"; then
6456         echo "Looking for ${cf_ncuconfig_root}-config"
6457
6458 if test -n "$ac_tool_prefix"; then
6459   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
6460   do
6461     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
6462 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
6463 echo "$as_me:6463: checking for $ac_word" >&5
6464 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
6465 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
6466   echo $ECHO_N "(cached) $ECHO_C" >&6
6467 else
6468   if test -n "$NCURSES_CONFIG"; then
6469   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
6470 else
6471   ac_save_IFS=$IFS; IFS=$ac_path_separator
6472 ac_dummy="$PATH"
6473 for ac_dir in $ac_dummy; do
6474   IFS=$ac_save_IFS
6475   test -z "$ac_dir" && ac_dir=.
6476   $as_executable_p "$ac_dir/$ac_word" || continue
6477 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
6478 echo "$as_me:6478: found $ac_dir/$ac_word" >&5
6479 break
6480 done
6481
6482 fi
6483 fi
6484 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
6485 if test -n "$NCURSES_CONFIG"; then
6486   echo "$as_me:6486: result: $NCURSES_CONFIG" >&5
6487 echo "${ECHO_T}$NCURSES_CONFIG" >&6
6488 else
6489   echo "$as_me:6489: result: no" >&5
6490 echo "${ECHO_T}no" >&6
6491 fi
6492
6493     test -n "$NCURSES_CONFIG" && break
6494   done
6495 fi
6496 if test -z "$NCURSES_CONFIG"; then
6497   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
6498   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
6499 do
6500   # Extract the first word of "$ac_prog", so it can be a program name with args.
6501 set dummy $ac_prog; ac_word=$2
6502 echo "$as_me:6502: checking for $ac_word" >&5
6503 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
6504 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
6505   echo $ECHO_N "(cached) $ECHO_C" >&6
6506 else
6507   if test -n "$ac_ct_NCURSES_CONFIG"; then
6508   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
6509 else
6510   ac_save_IFS=$IFS; IFS=$ac_path_separator
6511 ac_dummy="$PATH"
6512 for ac_dir in $ac_dummy; do
6513   IFS=$ac_save_IFS
6514   test -z "$ac_dir" && ac_dir=.
6515   $as_executable_p "$ac_dir/$ac_word" || continue
6516 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
6517 echo "$as_me:6517: found $ac_dir/$ac_word" >&5
6518 break
6519 done
6520
6521 fi
6522 fi
6523 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
6524 if test -n "$ac_ct_NCURSES_CONFIG"; then
6525   echo "$as_me:6525: result: $ac_ct_NCURSES_CONFIG" >&5
6526 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
6527 else
6528   echo "$as_me:6528: result: no" >&5
6529 echo "${ECHO_T}no" >&6
6530 fi
6531
6532   test -n "$ac_ct_NCURSES_CONFIG" && break
6533 done
6534 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
6535
6536   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
6537 fi
6538
6539         if test "$NCURSES_CONFIG" != none ; then
6540
6541                 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
6542
6543 cf_add_libs="`$NCURSES_CONFIG --libs`"
6544 # Filter out duplicates - this happens with badly-designed ".pc" files...
6545 for cf_add_1lib in $LIBS
6546 do
6547         for cf_add_2lib in $cf_add_libs
6548         do
6549                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6550                 then
6551                         cf_add_1lib=
6552                         break
6553                 fi
6554         done
6555         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6556 done
6557 LIBS="$cf_add_libs"
6558
6559                 # even with config script, some packages use no-override for curses.h
6560
6561 echo "$as_me:6561: checking if we have identified curses headers" >&5
6562 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
6563 if test "${cf_cv_ncurses_header+set}" = set; then
6564   echo $ECHO_N "(cached) $ECHO_C" >&6
6565 else
6566
6567 cf_cv_ncurses_header=none
6568 for cf_header in \
6569         ncurses.h $cf_cv_screen/ncurses.h \
6570         curses.h $cf_cv_screen/curses.h
6571 do
6572 cat >conftest.$ac_ext <<_ACEOF
6573 #line 6573 "configure"
6574 #include "confdefs.h"
6575 #include <${cf_header}>
6576 int
6577 main ()
6578 {
6579 initscr(); tgoto("?", 0,0)
6580   ;
6581   return 0;
6582 }
6583 _ACEOF
6584 rm -f conftest.$ac_objext
6585 if { (eval echo "$as_me:6585: \"$ac_compile\"") >&5
6586   (eval $ac_compile) 2>&5
6587   ac_status=$?
6588   echo "$as_me:6588: \$? = $ac_status" >&5
6589   (exit $ac_status); } &&
6590          { ac_try='test -s conftest.$ac_objext'
6591   { (eval echo "$as_me:6591: \"$ac_try\"") >&5
6592   (eval $ac_try) 2>&5
6593   ac_status=$?
6594   echo "$as_me:6594: \$? = $ac_status" >&5
6595   (exit $ac_status); }; }; then
6596   cf_cv_ncurses_header=$cf_header; break
6597 else
6598   echo "$as_me: failed program was:" >&5
6599 cat conftest.$ac_ext >&5
6600 fi
6601 rm -f conftest.$ac_objext conftest.$ac_ext
6602 done
6603
6604 fi
6605 echo "$as_me:6605: result: $cf_cv_ncurses_header" >&5
6606 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
6607
6608 if test "$cf_cv_ncurses_header" = none ; then
6609         { { echo "$as_me:6609: error: No curses header-files found" >&5
6610 echo "$as_me: error: No curses header-files found" >&2;}
6611    { (exit 1); exit 1; }; }
6612 fi
6613
6614 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
6615
6616 for ac_header in $cf_cv_ncurses_header
6617 do
6618 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
6619 echo "$as_me:6619: checking for $ac_header" >&5
6620 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
6621 if eval "test \"\${$as_ac_Header+set}\" = set"; then
6622   echo $ECHO_N "(cached) $ECHO_C" >&6
6623 else
6624   cat >conftest.$ac_ext <<_ACEOF
6625 #line 6625 "configure"
6626 #include "confdefs.h"
6627 #include <$ac_header>
6628 _ACEOF
6629 if { (eval echo "$as_me:6629: \"$ac_cpp conftest.$ac_ext\"") >&5
6630   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
6631   ac_status=$?
6632   egrep -v '^ *\+' conftest.er1 >conftest.err
6633   rm -f conftest.er1
6634   cat conftest.err >&5
6635   echo "$as_me:6635: \$? = $ac_status" >&5
6636   (exit $ac_status); } >/dev/null; then
6637   if test -s conftest.err; then
6638     ac_cpp_err=$ac_c_preproc_warn_flag
6639   else
6640     ac_cpp_err=
6641   fi
6642 else
6643   ac_cpp_err=yes
6644 fi
6645 if test -z "$ac_cpp_err"; then
6646   eval "$as_ac_Header=yes"
6647 else
6648   echo "$as_me: failed program was:" >&5
6649   cat conftest.$ac_ext >&5
6650   eval "$as_ac_Header=no"
6651 fi
6652 rm -f conftest.err conftest.$ac_ext
6653 fi
6654 echo "$as_me:6654: result: `eval echo '${'$as_ac_Header'}'`" >&5
6655 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
6656 if test `eval echo '${'$as_ac_Header'}'` = yes; then
6657   cat >>confdefs.h <<EOF
6658 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
6659 EOF
6660
6661 fi
6662 done
6663
6664 cat >>confdefs.h <<\EOF
6665 #define NCURSES 1
6666 EOF
6667
6668 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
6669
6670                 cat >>confdefs.h <<EOF
6671 #define $cf_nculib_ROOT 1
6672 EOF
6673
6674                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
6675
6676         else
6677
6678 cf_ncuhdr_root=$cf_cv_screen
6679
6680 test -n "$cf_cv_curses_dir" && \
6681 test "$cf_cv_curses_dir" != "no" && { \
6682
6683 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
6684   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
6685   do
6686         while test $cf_add_incdir != /usr/include
6687         do
6688           if test -d $cf_add_incdir
6689           then
6690                 cf_have_incdir=no
6691                 if test -n "$CFLAGS$CPPFLAGS" ; then
6692                   # a loop is needed to ensure we can add subdirs of existing dirs
6693                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6694                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6695                           cf_have_incdir=yes; break
6696                         fi
6697                   done
6698                 fi
6699
6700                 if test "$cf_have_incdir" = no ; then
6701                   if test "$cf_add_incdir" = /usr/local/include ; then
6702                         if test "$GCC" = yes
6703                         then
6704                           cf_save_CPPFLAGS=$CPPFLAGS
6705                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6706                           cat >conftest.$ac_ext <<_ACEOF
6707 #line 6707 "configure"
6708 #include "confdefs.h"
6709 #include <stdio.h>
6710 int
6711 main ()
6712 {
6713 printf("Hello")
6714   ;
6715   return 0;
6716 }
6717 _ACEOF
6718 rm -f conftest.$ac_objext
6719 if { (eval echo "$as_me:6719: \"$ac_compile\"") >&5
6720   (eval $ac_compile) 2>&5
6721   ac_status=$?
6722   echo "$as_me:6722: \$? = $ac_status" >&5
6723   (exit $ac_status); } &&
6724          { ac_try='test -s conftest.$ac_objext'
6725   { (eval echo "$as_me:6725: \"$ac_try\"") >&5
6726   (eval $ac_try) 2>&5
6727   ac_status=$?
6728   echo "$as_me:6728: \$? = $ac_status" >&5
6729   (exit $ac_status); }; }; then
6730   :
6731 else
6732   echo "$as_me: failed program was:" >&5
6733 cat conftest.$ac_ext >&5
6734 cf_have_incdir=yes
6735 fi
6736 rm -f conftest.$ac_objext conftest.$ac_ext
6737                           CPPFLAGS=$cf_save_CPPFLAGS
6738                         fi
6739                   fi
6740                 fi
6741
6742                 if test "$cf_have_incdir" = no ; then
6743                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6744
6745 echo "${as_me:-configure}:6745: testing adding $cf_add_incdir to include-path ..." 1>&5
6746
6747                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6748
6749                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6750                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6751                   cf_add_incdir="$cf_top_incdir"
6752                 else
6753                   break
6754                 fi
6755           else
6756                 break
6757           fi
6758         done
6759   done
6760 fi
6761
6762 }
6763
6764 echo "$as_me:6764: checking for $cf_ncuhdr_root header in include-path" >&5
6765 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
6766 if test "${cf_cv_ncurses_h+set}" = set; then
6767   echo $ECHO_N "(cached) $ECHO_C" >&6
6768 else
6769
6770         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
6771         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
6772         for cf_header in $cf_header_list
6773         do
6774
6775         cat >conftest.$ac_ext <<_ACEOF
6776 #line 6776 "configure"
6777 #include "confdefs.h"
6778
6779 #include <$cf_header>
6780 int
6781 main ()
6782 {
6783
6784 #ifdef NCURSES_VERSION
6785
6786 printf("%s\n", NCURSES_VERSION);
6787 #else
6788 #ifdef __NCURSES_H
6789 printf("old\n");
6790 #else
6791         make an error
6792 #endif
6793 #endif
6794
6795   ;
6796   return 0;
6797 }
6798 _ACEOF
6799 rm -f conftest.$ac_objext
6800 if { (eval echo "$as_me:6800: \"$ac_compile\"") >&5
6801   (eval $ac_compile) 2>&5
6802   ac_status=$?
6803   echo "$as_me:6803: \$? = $ac_status" >&5
6804   (exit $ac_status); } &&
6805          { ac_try='test -s conftest.$ac_objext'
6806   { (eval echo "$as_me:6806: \"$ac_try\"") >&5
6807   (eval $ac_try) 2>&5
6808   ac_status=$?
6809   echo "$as_me:6809: \$? = $ac_status" >&5
6810   (exit $ac_status); }; }; then
6811   cf_cv_ncurses_h=$cf_header
6812
6813 else
6814   echo "$as_me: failed program was:" >&5
6815 cat conftest.$ac_ext >&5
6816 cf_cv_ncurses_h=no
6817 fi
6818 rm -f conftest.$ac_objext conftest.$ac_ext
6819
6820                 test "$cf_cv_ncurses_h" != no && break
6821         done
6822
6823 fi
6824 echo "$as_me:6824: result: $cf_cv_ncurses_h" >&5
6825 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
6826
6827 if test "$cf_cv_ncurses_h" != no ; then
6828         cf_cv_ncurses_header=$cf_cv_ncurses_h
6829 else
6830
6831 echo "$as_me:6831: checking for $cf_ncuhdr_root include-path" >&5
6832 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
6833 if test "${cf_cv_ncurses_h2+set}" = set; then
6834   echo $ECHO_N "(cached) $ECHO_C" >&6
6835 else
6836
6837         test -n "$verbose" && echo
6838
6839 cf_search=
6840
6841 # collect the current set of include-directories from compiler flags
6842 cf_header_path_list=""
6843 if test -n "${CFLAGS}${CPPFLAGS}" ; then
6844         for cf_header_path in $CPPFLAGS $CFLAGS
6845         do
6846                 case $cf_header_path in
6847                 (-I*)
6848                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
6849
6850 test "x$cf_header_path" != "xNONE" && \
6851 test -d "$cf_header_path" && \
6852  {
6853         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
6854         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
6855         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
6856         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
6857         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
6858         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"
6859 }
6860
6861                         cf_header_path_list="$cf_header_path_list $cf_search"
6862                         ;;
6863                 esac
6864         done
6865 fi
6866
6867 # add the variations for the package we are looking for
6868
6869 cf_search=
6870
6871 test "x$prefix" != "xNONE" && \
6872 test -d "$prefix" && \
6873  {
6874         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
6875         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
6876         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
6877         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
6878         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
6879         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
6880 }
6881
6882 for cf_subdir_prefix in \
6883         /usr \
6884         /usr/local \
6885         /usr/pkg \
6886         /opt \
6887         /opt/local \
6888         $HOME
6889 do
6890
6891 test "x$cf_subdir_prefix" != "x$prefix" && \
6892 test -d "$cf_subdir_prefix" && \
6893 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
6894         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
6895         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
6896         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
6897         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
6898         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
6899         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"
6900 }
6901
6902 done
6903
6904 test "$includedir" != NONE && \
6905 test "$includedir" != "/usr/include" && \
6906 test -d "$includedir" && {
6907         test -d $includedir &&    cf_search="$cf_search $includedir"
6908         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
6909 }
6910
6911 test "$oldincludedir" != NONE && \
6912 test "$oldincludedir" != "/usr/include" && \
6913 test -d "$oldincludedir" && {
6914         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
6915         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
6916 }
6917
6918 cf_search="$cf_search $cf_header_path_list"
6919
6920         test -n "$verbose" && echo search path $cf_search
6921         cf_save2_CPPFLAGS="$CPPFLAGS"
6922         for cf_incdir in $cf_search
6923         do
6924
6925 if test -n "$cf_incdir" ; then
6926   for cf_add_incdir in $cf_incdir
6927   do
6928         while test $cf_add_incdir != /usr/include
6929         do
6930           if test -d $cf_add_incdir
6931           then
6932                 cf_have_incdir=no
6933                 if test -n "$CFLAGS$CPPFLAGS" ; then
6934                   # a loop is needed to ensure we can add subdirs of existing dirs
6935                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6936                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6937                           cf_have_incdir=yes; break
6938                         fi
6939                   done
6940                 fi
6941
6942                 if test "$cf_have_incdir" = no ; then
6943                   if test "$cf_add_incdir" = /usr/local/include ; then
6944                         if test "$GCC" = yes
6945                         then
6946                           cf_save_CPPFLAGS=$CPPFLAGS
6947                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6948                           cat >conftest.$ac_ext <<_ACEOF
6949 #line 6949 "configure"
6950 #include "confdefs.h"
6951 #include <stdio.h>
6952 int
6953 main ()
6954 {
6955 printf("Hello")
6956   ;
6957   return 0;
6958 }
6959 _ACEOF
6960 rm -f conftest.$ac_objext
6961 if { (eval echo "$as_me:6961: \"$ac_compile\"") >&5
6962   (eval $ac_compile) 2>&5
6963   ac_status=$?
6964   echo "$as_me:6964: \$? = $ac_status" >&5
6965   (exit $ac_status); } &&
6966          { ac_try='test -s conftest.$ac_objext'
6967   { (eval echo "$as_me:6967: \"$ac_try\"") >&5
6968   (eval $ac_try) 2>&5
6969   ac_status=$?
6970   echo "$as_me:6970: \$? = $ac_status" >&5
6971   (exit $ac_status); }; }; then
6972   :
6973 else
6974   echo "$as_me: failed program was:" >&5
6975 cat conftest.$ac_ext >&5
6976 cf_have_incdir=yes
6977 fi
6978 rm -f conftest.$ac_objext conftest.$ac_ext
6979                           CPPFLAGS=$cf_save_CPPFLAGS
6980                         fi
6981                   fi
6982                 fi
6983
6984                 if test "$cf_have_incdir" = no ; then
6985                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6986
6987 echo "${as_me:-configure}:6987: testing adding $cf_add_incdir to include-path ..." 1>&5
6988
6989                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6990
6991                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6992                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6993                   cf_add_incdir="$cf_top_incdir"
6994                 else
6995                   break
6996                 fi
6997           else
6998                 break
6999           fi
7000         done
7001   done
7002 fi
7003
7004                 for cf_header in \
7005                         ncurses.h \
7006                         curses.h
7007                 do
7008
7009         cat >conftest.$ac_ext <<_ACEOF
7010 #line 7010 "configure"
7011 #include "confdefs.h"
7012
7013 #include <$cf_header>
7014 int
7015 main ()
7016 {
7017
7018 #ifdef NCURSES_VERSION
7019
7020 printf("%s\n", NCURSES_VERSION);
7021 #else
7022 #ifdef __NCURSES_H
7023 printf("old\n");
7024 #else
7025         make an error
7026 #endif
7027 #endif
7028
7029   ;
7030   return 0;
7031 }
7032 _ACEOF
7033 rm -f conftest.$ac_objext
7034 if { (eval echo "$as_me:7034: \"$ac_compile\"") >&5
7035   (eval $ac_compile) 2>&5
7036   ac_status=$?
7037   echo "$as_me:7037: \$? = $ac_status" >&5
7038   (exit $ac_status); } &&
7039          { ac_try='test -s conftest.$ac_objext'
7040   { (eval echo "$as_me:7040: \"$ac_try\"") >&5
7041   (eval $ac_try) 2>&5
7042   ac_status=$?
7043   echo "$as_me:7043: \$? = $ac_status" >&5
7044   (exit $ac_status); }; }; then
7045   cf_cv_ncurses_h2=$cf_header
7046
7047 else
7048   echo "$as_me: failed program was:" >&5
7049 cat conftest.$ac_ext >&5
7050 cf_cv_ncurses_h2=no
7051 fi
7052 rm -f conftest.$ac_objext conftest.$ac_ext
7053
7054                         if test "$cf_cv_ncurses_h2" != no ; then
7055                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
7056                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
7057                                 break
7058                         fi
7059                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
7060                 done
7061                 CPPFLAGS="$cf_save2_CPPFLAGS"
7062                 test "$cf_cv_ncurses_h2" != no && break
7063         done
7064         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:7064: error: not found" >&5
7065 echo "$as_me: error: not found" >&2;}
7066    { (exit 1); exit 1; }; }
7067
7068 fi
7069 echo "$as_me:7069: result: $cf_cv_ncurses_h2" >&5
7070 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
7071
7072         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
7073         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
7074         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
7075                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
7076         fi
7077
7078 if test -n "$cf_1st_incdir" ; then
7079   for cf_add_incdir in $cf_1st_incdir
7080   do
7081         while test $cf_add_incdir != /usr/include
7082         do
7083           if test -d $cf_add_incdir
7084           then
7085                 cf_have_incdir=no
7086                 if test -n "$CFLAGS$CPPFLAGS" ; then
7087                   # a loop is needed to ensure we can add subdirs of existing dirs
7088                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7089                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7090                           cf_have_incdir=yes; break
7091                         fi
7092                   done
7093                 fi
7094
7095                 if test "$cf_have_incdir" = no ; then
7096                   if test "$cf_add_incdir" = /usr/local/include ; then
7097                         if test "$GCC" = yes
7098                         then
7099                           cf_save_CPPFLAGS=$CPPFLAGS
7100                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7101                           cat >conftest.$ac_ext <<_ACEOF
7102 #line 7102 "configure"
7103 #include "confdefs.h"
7104 #include <stdio.h>
7105 int
7106 main ()
7107 {
7108 printf("Hello")
7109   ;
7110   return 0;
7111 }
7112 _ACEOF
7113 rm -f conftest.$ac_objext
7114 if { (eval echo "$as_me:7114: \"$ac_compile\"") >&5
7115   (eval $ac_compile) 2>&5
7116   ac_status=$?
7117   echo "$as_me:7117: \$? = $ac_status" >&5
7118   (exit $ac_status); } &&
7119          { ac_try='test -s conftest.$ac_objext'
7120   { (eval echo "$as_me:7120: \"$ac_try\"") >&5
7121   (eval $ac_try) 2>&5
7122   ac_status=$?
7123   echo "$as_me:7123: \$? = $ac_status" >&5
7124   (exit $ac_status); }; }; then
7125   :
7126 else
7127   echo "$as_me: failed program was:" >&5
7128 cat conftest.$ac_ext >&5
7129 cf_have_incdir=yes
7130 fi
7131 rm -f conftest.$ac_objext conftest.$ac_ext
7132                           CPPFLAGS=$cf_save_CPPFLAGS
7133                         fi
7134                   fi
7135                 fi
7136
7137                 if test "$cf_have_incdir" = no ; then
7138                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7139
7140 echo "${as_me:-configure}:7140: testing adding $cf_add_incdir to include-path ..." 1>&5
7141
7142                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7143
7144                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7145                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7146                   cf_add_incdir="$cf_top_incdir"
7147                 else
7148                   break
7149                 fi
7150           else
7151                 break
7152           fi
7153         done
7154   done
7155 fi
7156
7157 fi
7158
7159 # Set definitions to allow ifdef'ing for ncurses.h
7160
7161 case $cf_cv_ncurses_header in
7162 (*ncurses.h)
7163
7164 cat >>confdefs.h <<\EOF
7165 #define HAVE_NCURSES_H 1
7166 EOF
7167
7168         ;;
7169 esac
7170
7171 case $cf_cv_ncurses_header in
7172 (ncurses/curses.h|ncurses/ncurses.h)
7173
7174 cat >>confdefs.h <<\EOF
7175 #define HAVE_NCURSES_NCURSES_H 1
7176 EOF
7177
7178         ;;
7179 (ncursesw/curses.h|ncursesw/ncurses.h)
7180
7181 cat >>confdefs.h <<\EOF
7182 #define HAVE_NCURSESW_NCURSES_H 1
7183 EOF
7184
7185         ;;
7186 esac
7187
7188 echo "$as_me:7188: checking for terminfo header" >&5
7189 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
7190 if test "${cf_cv_term_header+set}" = set; then
7191   echo $ECHO_N "(cached) $ECHO_C" >&6
7192 else
7193
7194 case ${cf_cv_ncurses_header} in
7195 (*/ncurses.h|*/ncursesw.h)
7196         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
7197         ;;
7198 (*)
7199         cf_term_header=term.h
7200         ;;
7201 esac
7202
7203 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
7204 do
7205 cat >conftest.$ac_ext <<_ACEOF
7206 #line 7206 "configure"
7207 #include "confdefs.h"
7208 #include <stdio.h>
7209 #include <${cf_cv_ncurses_header:-curses.h}>
7210 #include <$cf_test>
7211
7212 int
7213 main ()
7214 {
7215 int x = auto_left_margin
7216   ;
7217   return 0;
7218 }
7219 _ACEOF
7220 rm -f conftest.$ac_objext
7221 if { (eval echo "$as_me:7221: \"$ac_compile\"") >&5
7222   (eval $ac_compile) 2>&5
7223   ac_status=$?
7224   echo "$as_me:7224: \$? = $ac_status" >&5
7225   (exit $ac_status); } &&
7226          { ac_try='test -s conftest.$ac_objext'
7227   { (eval echo "$as_me:7227: \"$ac_try\"") >&5
7228   (eval $ac_try) 2>&5
7229   ac_status=$?
7230   echo "$as_me:7230: \$? = $ac_status" >&5
7231   (exit $ac_status); }; }; then
7232
7233         cf_cv_term_header="$cf_test"
7234 else
7235   echo "$as_me: failed program was:" >&5
7236 cat conftest.$ac_ext >&5
7237
7238         cf_cv_term_header=unknown
7239
7240 fi
7241 rm -f conftest.$ac_objext conftest.$ac_ext
7242         test "$cf_cv_term_header" != unknown && break
7243 done
7244
7245 fi
7246 echo "$as_me:7246: result: $cf_cv_term_header" >&5
7247 echo "${ECHO_T}$cf_cv_term_header" >&6
7248
7249 # Set definitions to allow ifdef'ing to accommodate subdirectories
7250
7251 case $cf_cv_term_header in
7252 (*term.h)
7253
7254 cat >>confdefs.h <<\EOF
7255 #define HAVE_TERM_H 1
7256 EOF
7257
7258         ;;
7259 esac
7260
7261 case $cf_cv_term_header in
7262 (ncurses/term.h)
7263
7264 cat >>confdefs.h <<\EOF
7265 #define HAVE_NCURSES_TERM_H 1
7266 EOF
7267
7268         ;;
7269 (ncursesw/term.h)
7270
7271 cat >>confdefs.h <<\EOF
7272 #define HAVE_NCURSESW_TERM_H 1
7273 EOF
7274
7275         ;;
7276 esac
7277
7278 # some applications need this, but should check for NCURSES_VERSION
7279
7280 cat >>confdefs.h <<\EOF
7281 #define NCURSES 1
7282 EOF
7283
7284 echo "$as_me:7284: checking for ncurses version" >&5
7285 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
7286 if test "${cf_cv_ncurses_version+set}" = set; then
7287   echo $ECHO_N "(cached) $ECHO_C" >&6
7288 else
7289
7290         cf_cv_ncurses_version=no
7291         cf_tempfile=out$$
7292         rm -f $cf_tempfile
7293         if test "$cross_compiling" = yes; then
7294
7295         # This will not work if the preprocessor splits the line after the
7296         # Autoconf token.  The 'unproto' program does that.
7297         cat > conftest.$ac_ext <<EOF
7298 #include <${cf_cv_ncurses_header:-curses.h}>
7299 #undef Autoconf
7300 #ifdef NCURSES_VERSION
7301 Autoconf NCURSES_VERSION
7302 #else
7303 #ifdef __NCURSES_H
7304 Autoconf "old"
7305 #endif
7306 ;
7307 #endif
7308 EOF
7309         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
7310         { (eval echo "$as_me:7310: \"$cf_try\"") >&5
7311   (eval $cf_try) 2>&5
7312   ac_status=$?
7313   echo "$as_me:7313: \$? = $ac_status" >&5
7314   (exit $ac_status); }
7315         if test -f conftest.out ; then
7316                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
7317                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
7318                 rm -f conftest.out
7319         fi
7320
7321 else
7322   cat >conftest.$ac_ext <<_ACEOF
7323 #line 7323 "configure"
7324 #include "confdefs.h"
7325
7326 #include <${cf_cv_ncurses_header:-curses.h}>
7327 #include <stdio.h>
7328 int main()
7329 {
7330         FILE *fp = fopen("$cf_tempfile", "w");
7331 #ifdef NCURSES_VERSION
7332 # ifdef NCURSES_VERSION_PATCH
7333         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
7334 # else
7335         fprintf(fp, "%s\n", NCURSES_VERSION);
7336 # endif
7337 #else
7338 # ifdef __NCURSES_H
7339         fprintf(fp, "old\n");
7340 # else
7341         make an error
7342 # endif
7343 #endif
7344         ${cf_cv_main_return:-return}(0);
7345 }
7346 _ACEOF
7347 rm -f conftest$ac_exeext
7348 if { (eval echo "$as_me:7348: \"$ac_link\"") >&5
7349   (eval $ac_link) 2>&5
7350   ac_status=$?
7351   echo "$as_me:7351: \$? = $ac_status" >&5
7352   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
7353   { (eval echo "$as_me:7353: \"$ac_try\"") >&5
7354   (eval $ac_try) 2>&5
7355   ac_status=$?
7356   echo "$as_me:7356: \$? = $ac_status" >&5
7357   (exit $ac_status); }; }; then
7358
7359         cf_cv_ncurses_version=`cat $cf_tempfile`
7360 else
7361   echo "$as_me: program exited with status $ac_status" >&5
7362 echo "$as_me: failed program was:" >&5
7363 cat conftest.$ac_ext >&5
7364 fi
7365 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
7366 fi
7367         rm -f $cf_tempfile
7368
7369 fi
7370 echo "$as_me:7370: result: $cf_cv_ncurses_version" >&5
7371 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
7372 test "$cf_cv_ncurses_version" = no ||
7373 cat >>confdefs.h <<\EOF
7374 #define NCURSES 1
7375 EOF
7376
7377 cf_nculib_root=$cf_cv_screen
7378         # This works, except for the special case where we find gpm, but
7379         # ncurses is in a nonstandard location via $LIBS, and we really want
7380         # to link gpm.
7381 cf_ncurses_LIBS=""
7382 cf_ncurses_SAVE="$LIBS"
7383 echo "$as_me:7383: checking for Gpm_Open in -lgpm" >&5
7384 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
7385 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
7386   echo $ECHO_N "(cached) $ECHO_C" >&6
7387 else
7388   ac_check_lib_save_LIBS=$LIBS
7389 LIBS="-lgpm  $LIBS"
7390 cat >conftest.$ac_ext <<_ACEOF
7391 #line 7391 "configure"
7392 #include "confdefs.h"
7393
7394 /* Override any gcc2 internal prototype to avoid an error.  */
7395 #ifdef __cplusplus
7396 extern "C"
7397 #endif
7398 /* We use char because int might match the return type of a gcc2
7399    builtin and then its argument prototype would still apply.  */
7400 char Gpm_Open ();
7401 int
7402 main ()
7403 {
7404 Gpm_Open ();
7405   ;
7406   return 0;
7407 }
7408 _ACEOF
7409 rm -f conftest.$ac_objext conftest$ac_exeext
7410 if { (eval echo "$as_me:7410: \"$ac_link\"") >&5
7411   (eval $ac_link) 2>&5
7412   ac_status=$?
7413   echo "$as_me:7413: \$? = $ac_status" >&5
7414   (exit $ac_status); } &&
7415          { ac_try='test -s conftest$ac_exeext'
7416   { (eval echo "$as_me:7416: \"$ac_try\"") >&5
7417   (eval $ac_try) 2>&5
7418   ac_status=$?
7419   echo "$as_me:7419: \$? = $ac_status" >&5
7420   (exit $ac_status); }; }; then
7421   ac_cv_lib_gpm_Gpm_Open=yes
7422 else
7423   echo "$as_me: failed program was:" >&5
7424 cat conftest.$ac_ext >&5
7425 ac_cv_lib_gpm_Gpm_Open=no
7426 fi
7427 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7428 LIBS=$ac_check_lib_save_LIBS
7429 fi
7430 echo "$as_me:7430: result: $ac_cv_lib_gpm_Gpm_Open" >&5
7431 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
7432 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
7433   echo "$as_me:7433: checking for initscr in -lgpm" >&5
7434 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
7435 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
7436   echo $ECHO_N "(cached) $ECHO_C" >&6
7437 else
7438   ac_check_lib_save_LIBS=$LIBS
7439 LIBS="-lgpm  $LIBS"
7440 cat >conftest.$ac_ext <<_ACEOF
7441 #line 7441 "configure"
7442 #include "confdefs.h"
7443
7444 /* Override any gcc2 internal prototype to avoid an error.  */
7445 #ifdef __cplusplus
7446 extern "C"
7447 #endif
7448 /* We use char because int might match the return type of a gcc2
7449    builtin and then its argument prototype would still apply.  */
7450 char initscr ();
7451 int
7452 main ()
7453 {
7454 initscr ();
7455   ;
7456   return 0;
7457 }
7458 _ACEOF
7459 rm -f conftest.$ac_objext conftest$ac_exeext
7460 if { (eval echo "$as_me:7460: \"$ac_link\"") >&5
7461   (eval $ac_link) 2>&5
7462   ac_status=$?
7463   echo "$as_me:7463: \$? = $ac_status" >&5
7464   (exit $ac_status); } &&
7465          { ac_try='test -s conftest$ac_exeext'
7466   { (eval echo "$as_me:7466: \"$ac_try\"") >&5
7467   (eval $ac_try) 2>&5
7468   ac_status=$?
7469   echo "$as_me:7469: \$? = $ac_status" >&5
7470   (exit $ac_status); }; }; then
7471   ac_cv_lib_gpm_initscr=yes
7472 else
7473   echo "$as_me: failed program was:" >&5
7474 cat conftest.$ac_ext >&5
7475 ac_cv_lib_gpm_initscr=no
7476 fi
7477 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7478 LIBS=$ac_check_lib_save_LIBS
7479 fi
7480 echo "$as_me:7480: result: $ac_cv_lib_gpm_initscr" >&5
7481 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
7482 if test $ac_cv_lib_gpm_initscr = yes; then
7483   LIBS="$cf_ncurses_SAVE"
7484 else
7485   cf_ncurses_LIBS="-lgpm"
7486 fi
7487
7488 fi
7489
7490 case $host_os in
7491 (freebsd*)
7492         # This is only necessary if you are linking against an obsolete
7493         # version of ncurses (but it should do no harm, since it's static).
7494         if test "$cf_nculib_root" = ncurses ; then
7495                 echo "$as_me:7495: checking for tgoto in -lmytinfo" >&5
7496 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
7497 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
7498   echo $ECHO_N "(cached) $ECHO_C" >&6
7499 else
7500   ac_check_lib_save_LIBS=$LIBS
7501 LIBS="-lmytinfo  $LIBS"
7502 cat >conftest.$ac_ext <<_ACEOF
7503 #line 7503 "configure"
7504 #include "confdefs.h"
7505
7506 /* Override any gcc2 internal prototype to avoid an error.  */
7507 #ifdef __cplusplus
7508 extern "C"
7509 #endif
7510 /* We use char because int might match the return type of a gcc2
7511    builtin and then its argument prototype would still apply.  */
7512 char tgoto ();
7513 int
7514 main ()
7515 {
7516 tgoto ();
7517   ;
7518   return 0;
7519 }
7520 _ACEOF
7521 rm -f conftest.$ac_objext conftest$ac_exeext
7522 if { (eval echo "$as_me:7522: \"$ac_link\"") >&5
7523   (eval $ac_link) 2>&5
7524   ac_status=$?
7525   echo "$as_me:7525: \$? = $ac_status" >&5
7526   (exit $ac_status); } &&
7527          { ac_try='test -s conftest$ac_exeext'
7528   { (eval echo "$as_me:7528: \"$ac_try\"") >&5
7529   (eval $ac_try) 2>&5
7530   ac_status=$?
7531   echo "$as_me:7531: \$? = $ac_status" >&5
7532   (exit $ac_status); }; }; then
7533   ac_cv_lib_mytinfo_tgoto=yes
7534 else
7535   echo "$as_me: failed program was:" >&5
7536 cat conftest.$ac_ext >&5
7537 ac_cv_lib_mytinfo_tgoto=no
7538 fi
7539 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7540 LIBS=$ac_check_lib_save_LIBS
7541 fi
7542 echo "$as_me:7542: result: $ac_cv_lib_mytinfo_tgoto" >&5
7543 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
7544 if test $ac_cv_lib_mytinfo_tgoto = yes; then
7545   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
7546 fi
7547
7548         fi
7549         ;;
7550 esac
7551
7552 cf_add_libs="$cf_ncurses_LIBS"
7553 # Filter out duplicates - this happens with badly-designed ".pc" files...
7554 for cf_add_1lib in $LIBS
7555 do
7556         for cf_add_2lib in $cf_add_libs
7557         do
7558                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7559                 then
7560                         cf_add_1lib=
7561                         break
7562                 fi
7563         done
7564         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7565 done
7566 LIBS="$cf_add_libs"
7567
7568 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
7569 then
7570
7571 cf_add_libs="-l$cf_nculib_root"
7572 # Filter out duplicates - this happens with badly-designed ".pc" files...
7573 for cf_add_1lib in $LIBS
7574 do
7575         for cf_add_2lib in $cf_add_libs
7576         do
7577                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7578                 then
7579                         cf_add_1lib=
7580                         break
7581                 fi
7582         done
7583         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7584 done
7585 LIBS="$cf_add_libs"
7586
7587 else
7588
7589         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
7590         cf_libdir=""
7591         echo "$as_me:7591: checking for initscr" >&5
7592 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
7593 if test "${ac_cv_func_initscr+set}" = set; then
7594   echo $ECHO_N "(cached) $ECHO_C" >&6
7595 else
7596   cat >conftest.$ac_ext <<_ACEOF
7597 #line 7597 "configure"
7598 #include "confdefs.h"
7599 /* System header to define __stub macros and hopefully few prototypes,
7600     which can conflict with char initscr (); below.  */
7601 #include <assert.h>
7602 /* Override any gcc2 internal prototype to avoid an error.  */
7603 #ifdef __cplusplus
7604 extern "C"
7605 #endif
7606 /* We use char because int might match the return type of a gcc2
7607    builtin and then its argument prototype would still apply.  */
7608 char initscr ();
7609 char (*f) ();
7610
7611 int
7612 main ()
7613 {
7614 /* The GNU C library defines this for functions which it implements
7615     to always fail with ENOSYS.  Some functions are actually named
7616     something starting with __ and the normal name is an alias.  */
7617 #if defined (__stub_initscr) || defined (__stub___initscr)
7618 choke me
7619 #else
7620 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
7621 #endif
7622
7623   ;
7624   return 0;
7625 }
7626 _ACEOF
7627 rm -f conftest.$ac_objext conftest$ac_exeext
7628 if { (eval echo "$as_me:7628: \"$ac_link\"") >&5
7629   (eval $ac_link) 2>&5
7630   ac_status=$?
7631   echo "$as_me:7631: \$? = $ac_status" >&5
7632   (exit $ac_status); } &&
7633          { ac_try='test -s conftest$ac_exeext'
7634   { (eval echo "$as_me:7634: \"$ac_try\"") >&5
7635   (eval $ac_try) 2>&5
7636   ac_status=$?
7637   echo "$as_me:7637: \$? = $ac_status" >&5
7638   (exit $ac_status); }; }; then
7639   ac_cv_func_initscr=yes
7640 else
7641   echo "$as_me: failed program was:" >&5
7642 cat conftest.$ac_ext >&5
7643 ac_cv_func_initscr=no
7644 fi
7645 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7646 fi
7647 echo "$as_me:7647: result: $ac_cv_func_initscr" >&5
7648 echo "${ECHO_T}$ac_cv_func_initscr" >&6
7649 if test $ac_cv_func_initscr = yes; then
7650   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
7651 else
7652
7653                 cf_save_LIBS="$LIBS"
7654                 echo "$as_me:7654: checking for initscr in -l$cf_nculib_root" >&5
7655 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
7656                 LIBS="-l$cf_nculib_root $LIBS"
7657                 cat >conftest.$ac_ext <<_ACEOF
7658 #line 7658 "configure"
7659 #include "confdefs.h"
7660 #include <${cf_cv_ncurses_header:-curses.h}>
7661 int
7662 main ()
7663 {
7664 initscr()
7665   ;
7666   return 0;
7667 }
7668 _ACEOF
7669 rm -f conftest.$ac_objext conftest$ac_exeext
7670 if { (eval echo "$as_me:7670: \"$ac_link\"") >&5
7671   (eval $ac_link) 2>&5
7672   ac_status=$?
7673   echo "$as_me:7673: \$? = $ac_status" >&5
7674   (exit $ac_status); } &&
7675          { ac_try='test -s conftest$ac_exeext'
7676   { (eval echo "$as_me:7676: \"$ac_try\"") >&5
7677   (eval $ac_try) 2>&5
7678   ac_status=$?
7679   echo "$as_me:7679: \$? = $ac_status" >&5
7680   (exit $ac_status); }; }; then
7681   echo "$as_me:7681: result: yes" >&5
7682 echo "${ECHO_T}yes" >&6
7683                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
7684
7685 else
7686   echo "$as_me: failed program was:" >&5
7687 cat conftest.$ac_ext >&5
7688 echo "$as_me:7688: result: no" >&5
7689 echo "${ECHO_T}no" >&6
7690
7691 cf_search=
7692 cf_library_path_list=""
7693 if test -n "${LDFLAGS}${LIBS}" ; then
7694         for cf_library_path in $LDFLAGS $LIBS
7695         do
7696                 case $cf_library_path in
7697                 (-L*)
7698                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
7699
7700 test "x$cf_library_path" != "xNONE" && \
7701 test -d "$cf_library_path" && \
7702  {
7703         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
7704         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
7705         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
7706         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
7707         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
7708         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"
7709 }
7710
7711                         cf_library_path_list="$cf_library_path_list $cf_search"
7712                         ;;
7713                 esac
7714         done
7715 fi
7716
7717 cf_search=
7718
7719 test "x$prefix" != "xNONE" && \
7720 test -d "$prefix" && \
7721  {
7722         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
7723         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
7724         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
7725         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
7726         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
7727         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
7728 }
7729
7730 for cf_subdir_prefix in \
7731         /usr \
7732         /usr/local \
7733         /usr/pkg \
7734         /opt \
7735         /opt/local \
7736         $HOME
7737 do
7738
7739 test "x$cf_subdir_prefix" != "x$prefix" && \
7740 test -d "$cf_subdir_prefix" && \
7741 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
7742         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
7743         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
7744         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
7745         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
7746         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
7747         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"
7748 }
7749
7750 done
7751
7752 cf_search="$cf_library_path_list $cf_search"
7753
7754                         for cf_libdir in $cf_search
7755                         do
7756                                 echo "$as_me:7756: checking for -l$cf_nculib_root in $cf_libdir" >&5
7757 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
7758                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
7759                                 cat >conftest.$ac_ext <<_ACEOF
7760 #line 7760 "configure"
7761 #include "confdefs.h"
7762 #include <${cf_cv_ncurses_header:-curses.h}>
7763 int
7764 main ()
7765 {
7766 initscr()
7767   ;
7768   return 0;
7769 }
7770 _ACEOF
7771 rm -f conftest.$ac_objext conftest$ac_exeext
7772 if { (eval echo "$as_me:7772: \"$ac_link\"") >&5
7773   (eval $ac_link) 2>&5
7774   ac_status=$?
7775   echo "$as_me:7775: \$? = $ac_status" >&5
7776   (exit $ac_status); } &&
7777          { ac_try='test -s conftest$ac_exeext'
7778   { (eval echo "$as_me:7778: \"$ac_try\"") >&5
7779   (eval $ac_try) 2>&5
7780   ac_status=$?
7781   echo "$as_me:7781: \$? = $ac_status" >&5
7782   (exit $ac_status); }; }; then
7783   echo "$as_me:7783: result: yes" >&5
7784 echo "${ECHO_T}yes" >&6
7785                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
7786                                          break
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_save_LIBS"
7793 fi
7794 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7795                         done
7796
7797 fi
7798 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7799
7800 fi
7801
7802 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
7803
7804 if test $cf_found_library = no ; then
7805         { { echo "$as_me:7805: error: Cannot link $cf_nculib_root library" >&5
7806 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
7807    { (exit 1); exit 1; }; }
7808 fi
7809
7810 fi
7811
7812 if test -n "$cf_ncurses_LIBS" ; then
7813         echo "$as_me:7813: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
7814 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
7815         cf_ncurses_SAVE="$LIBS"
7816         for p in $cf_ncurses_LIBS ; do
7817                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
7818                 if test "$q" != "$LIBS" ; then
7819                         LIBS="$q"
7820                 fi
7821         done
7822         cat >conftest.$ac_ext <<_ACEOF
7823 #line 7823 "configure"
7824 #include "confdefs.h"
7825 #include <${cf_cv_ncurses_header:-curses.h}>
7826 int
7827 main ()
7828 {
7829 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
7830   ;
7831   return 0;
7832 }
7833 _ACEOF
7834 rm -f conftest.$ac_objext conftest$ac_exeext
7835 if { (eval echo "$as_me:7835: \"$ac_link\"") >&5
7836   (eval $ac_link) 2>&5
7837   ac_status=$?
7838   echo "$as_me:7838: \$? = $ac_status" >&5
7839   (exit $ac_status); } &&
7840          { ac_try='test -s conftest$ac_exeext'
7841   { (eval echo "$as_me:7841: \"$ac_try\"") >&5
7842   (eval $ac_try) 2>&5
7843   ac_status=$?
7844   echo "$as_me:7844: \$? = $ac_status" >&5
7845   (exit $ac_status); }; }; then
7846   echo "$as_me:7846: result: yes" >&5
7847 echo "${ECHO_T}yes" >&6
7848 else
7849   echo "$as_me: failed program was:" >&5
7850 cat conftest.$ac_ext >&5
7851 echo "$as_me:7851: result: no" >&5
7852 echo "${ECHO_T}no" >&6
7853                  LIBS="$cf_ncurses_SAVE"
7854 fi
7855 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7856 fi
7857
7858 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
7859
7860 cat >>confdefs.h <<EOF
7861 #define $cf_nculib_ROOT 1
7862 EOF
7863
7864         fi
7865 else
7866         NCURSES_CONFIG=none
7867 fi
7868
7869         ;;
7870 (ncurses*)
7871
7872 cf_ncuconfig_root=$cf_cv_screen
7873 cf_have_ncuconfig=no
7874
7875 if test "x${PKG_CONFIG:=none}" != xnone; then
7876         echo "$as_me:7876: checking pkg-config for $cf_ncuconfig_root" >&5
7877 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
7878         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
7879                 echo "$as_me:7879: result: yes" >&5
7880 echo "${ECHO_T}yes" >&6
7881
7882                 echo "$as_me:7882: checking if the $cf_ncuconfig_root package files work" >&5
7883 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
7884                 cf_have_ncuconfig=unknown
7885
7886                 cf_save_CPPFLAGS="$CPPFLAGS"
7887                 cf_save_LIBS="$LIBS"
7888
7889                 CPPFLAGS="$CPPFLAGS `$PKG_CONFIG --cflags $cf_ncuconfig_root`"
7890
7891 cf_add_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
7892 # Filter out duplicates - this happens with badly-designed ".pc" files...
7893 for cf_add_1lib in $LIBS
7894 do
7895         for cf_add_2lib in $cf_add_libs
7896         do
7897                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7898                 then
7899                         cf_add_1lib=
7900                         break
7901                 fi
7902         done
7903         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7904 done
7905 LIBS="$cf_add_libs"
7906
7907                 cat >conftest.$ac_ext <<_ACEOF
7908 #line 7908 "configure"
7909 #include "confdefs.h"
7910 #include <${cf_cv_ncurses_header:-curses.h}>
7911 int
7912 main ()
7913 {
7914 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
7915   ;
7916   return 0;
7917 }
7918 _ACEOF
7919 rm -f conftest.$ac_objext conftest$ac_exeext
7920 if { (eval echo "$as_me:7920: \"$ac_link\"") >&5
7921   (eval $ac_link) 2>&5
7922   ac_status=$?
7923   echo "$as_me:7923: \$? = $ac_status" >&5
7924   (exit $ac_status); } &&
7925          { ac_try='test -s conftest$ac_exeext'
7926   { (eval echo "$as_me:7926: \"$ac_try\"") >&5
7927   (eval $ac_try) 2>&5
7928   ac_status=$?
7929   echo "$as_me:7929: \$? = $ac_status" >&5
7930   (exit $ac_status); }; }; then
7931   if test "$cross_compiling" = yes; then
7932   cf_have_ncuconfig=maybe
7933 else
7934   cat >conftest.$ac_ext <<_ACEOF
7935 #line 7935 "configure"
7936 #include "confdefs.h"
7937 #include <${cf_cv_ncurses_header:-curses.h}>
7938                                 int main(void)
7939                                 { char *xx = curses_version(); return (xx == 0); }
7940 _ACEOF
7941 rm -f conftest$ac_exeext
7942 if { (eval echo "$as_me:7942: \"$ac_link\"") >&5
7943   (eval $ac_link) 2>&5
7944   ac_status=$?
7945   echo "$as_me:7945: \$? = $ac_status" >&5
7946   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
7947   { (eval echo "$as_me:7947: \"$ac_try\"") >&5
7948   (eval $ac_try) 2>&5
7949   ac_status=$?
7950   echo "$as_me:7950: \$? = $ac_status" >&5
7951   (exit $ac_status); }; }; then
7952   cf_have_ncuconfig=yes
7953 else
7954   echo "$as_me: program exited with status $ac_status" >&5
7955 echo "$as_me: failed program was:" >&5
7956 cat conftest.$ac_ext >&5
7957 cf_have_ncuconfig=no
7958 fi
7959 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
7960 fi
7961 else
7962   echo "$as_me: failed program was:" >&5
7963 cat conftest.$ac_ext >&5
7964 cf_have_ncuconfig=no
7965 fi
7966 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7967                 echo "$as_me:7967: result: $cf_have_ncuconfig" >&5
7968 echo "${ECHO_T}$cf_have_ncuconfig" >&6
7969                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
7970                 if test "$cf_have_ncuconfig" != "yes"
7971                 then
7972                         CPPFLAGS="$cf_save_CPPFLAGS"
7973                         LIBS="$cf_save_LIBS"
7974                         NCURSES_CONFIG_PKG=none
7975                 else
7976
7977 cat >>confdefs.h <<\EOF
7978 #define NCURSES 1
7979 EOF
7980
7981                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
7982                 fi
7983
7984         else
7985                 echo "$as_me:7985: result: no" >&5
7986 echo "${ECHO_T}no" >&6
7987                 NCURSES_CONFIG_PKG=none
7988         fi
7989 else
7990         NCURSES_CONFIG_PKG=none
7991 fi
7992
7993 if test "x$cf_have_ncuconfig" = "xno"; then
7994         echo "Looking for ${cf_ncuconfig_root}-config"
7995
7996 if test -n "$ac_tool_prefix"; then
7997   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7998   do
7999     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
8000 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
8001 echo "$as_me:8001: checking for $ac_word" >&5
8002 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
8003 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
8004   echo $ECHO_N "(cached) $ECHO_C" >&6
8005 else
8006   if test -n "$NCURSES_CONFIG"; then
8007   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
8008 else
8009   ac_save_IFS=$IFS; IFS=$ac_path_separator
8010 ac_dummy="$PATH"
8011 for ac_dir in $ac_dummy; do
8012   IFS=$ac_save_IFS
8013   test -z "$ac_dir" && ac_dir=.
8014   $as_executable_p "$ac_dir/$ac_word" || continue
8015 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
8016 echo "$as_me:8016: found $ac_dir/$ac_word" >&5
8017 break
8018 done
8019
8020 fi
8021 fi
8022 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
8023 if test -n "$NCURSES_CONFIG"; then
8024   echo "$as_me:8024: result: $NCURSES_CONFIG" >&5
8025 echo "${ECHO_T}$NCURSES_CONFIG" >&6
8026 else
8027   echo "$as_me:8027: result: no" >&5
8028 echo "${ECHO_T}no" >&6
8029 fi
8030
8031     test -n "$NCURSES_CONFIG" && break
8032   done
8033 fi
8034 if test -z "$NCURSES_CONFIG"; then
8035   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
8036   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
8037 do
8038   # Extract the first word of "$ac_prog", so it can be a program name with args.
8039 set dummy $ac_prog; ac_word=$2
8040 echo "$as_me:8040: checking for $ac_word" >&5
8041 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
8042 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
8043   echo $ECHO_N "(cached) $ECHO_C" >&6
8044 else
8045   if test -n "$ac_ct_NCURSES_CONFIG"; then
8046   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
8047 else
8048   ac_save_IFS=$IFS; IFS=$ac_path_separator
8049 ac_dummy="$PATH"
8050 for ac_dir in $ac_dummy; do
8051   IFS=$ac_save_IFS
8052   test -z "$ac_dir" && ac_dir=.
8053   $as_executable_p "$ac_dir/$ac_word" || continue
8054 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
8055 echo "$as_me:8055: found $ac_dir/$ac_word" >&5
8056 break
8057 done
8058
8059 fi
8060 fi
8061 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
8062 if test -n "$ac_ct_NCURSES_CONFIG"; then
8063   echo "$as_me:8063: result: $ac_ct_NCURSES_CONFIG" >&5
8064 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
8065 else
8066   echo "$as_me:8066: result: no" >&5
8067 echo "${ECHO_T}no" >&6
8068 fi
8069
8070   test -n "$ac_ct_NCURSES_CONFIG" && break
8071 done
8072 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
8073
8074   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
8075 fi
8076
8077         if test "$NCURSES_CONFIG" != none ; then
8078
8079                 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
8080
8081 cf_add_libs="`$NCURSES_CONFIG --libs`"
8082 # Filter out duplicates - this happens with badly-designed ".pc" files...
8083 for cf_add_1lib in $LIBS
8084 do
8085         for cf_add_2lib in $cf_add_libs
8086         do
8087                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
8088                 then
8089                         cf_add_1lib=
8090                         break
8091                 fi
8092         done
8093         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
8094 done
8095 LIBS="$cf_add_libs"
8096
8097                 # even with config script, some packages use no-override for curses.h
8098
8099 echo "$as_me:8099: checking if we have identified curses headers" >&5
8100 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
8101 if test "${cf_cv_ncurses_header+set}" = set; then
8102   echo $ECHO_N "(cached) $ECHO_C" >&6
8103 else
8104
8105 cf_cv_ncurses_header=none
8106 for cf_header in \
8107         ncurses.h $cf_cv_screen/ncurses.h \
8108         curses.h $cf_cv_screen/curses.h
8109 do
8110 cat >conftest.$ac_ext <<_ACEOF
8111 #line 8111 "configure"
8112 #include "confdefs.h"
8113 #include <${cf_header}>
8114 int
8115 main ()
8116 {
8117 initscr(); tgoto("?", 0,0)
8118   ;
8119   return 0;
8120 }
8121 _ACEOF
8122 rm -f conftest.$ac_objext
8123 if { (eval echo "$as_me:8123: \"$ac_compile\"") >&5
8124   (eval $ac_compile) 2>&5
8125   ac_status=$?
8126   echo "$as_me:8126: \$? = $ac_status" >&5
8127   (exit $ac_status); } &&
8128          { ac_try='test -s conftest.$ac_objext'
8129   { (eval echo "$as_me:8129: \"$ac_try\"") >&5
8130   (eval $ac_try) 2>&5
8131   ac_status=$?
8132   echo "$as_me:8132: \$? = $ac_status" >&5
8133   (exit $ac_status); }; }; then
8134   cf_cv_ncurses_header=$cf_header; break
8135 else
8136   echo "$as_me: failed program was:" >&5
8137 cat conftest.$ac_ext >&5
8138 fi
8139 rm -f conftest.$ac_objext conftest.$ac_ext
8140 done
8141
8142 fi
8143 echo "$as_me:8143: result: $cf_cv_ncurses_header" >&5
8144 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
8145
8146 if test "$cf_cv_ncurses_header" = none ; then
8147         { { echo "$as_me:8147: error: No curses header-files found" >&5
8148 echo "$as_me: error: No curses header-files found" >&2;}
8149    { (exit 1); exit 1; }; }
8150 fi
8151
8152 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
8153
8154 for ac_header in $cf_cv_ncurses_header
8155 do
8156 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
8157 echo "$as_me:8157: checking for $ac_header" >&5
8158 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
8159 if eval "test \"\${$as_ac_Header+set}\" = set"; then
8160   echo $ECHO_N "(cached) $ECHO_C" >&6
8161 else
8162   cat >conftest.$ac_ext <<_ACEOF
8163 #line 8163 "configure"
8164 #include "confdefs.h"
8165 #include <$ac_header>
8166 _ACEOF
8167 if { (eval echo "$as_me:8167: \"$ac_cpp conftest.$ac_ext\"") >&5
8168   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
8169   ac_status=$?
8170   egrep -v '^ *\+' conftest.er1 >conftest.err
8171   rm -f conftest.er1
8172   cat conftest.err >&5
8173   echo "$as_me:8173: \$? = $ac_status" >&5
8174   (exit $ac_status); } >/dev/null; then
8175   if test -s conftest.err; then
8176     ac_cpp_err=$ac_c_preproc_warn_flag
8177   else
8178     ac_cpp_err=
8179   fi
8180 else
8181   ac_cpp_err=yes
8182 fi
8183 if test -z "$ac_cpp_err"; then
8184   eval "$as_ac_Header=yes"
8185 else
8186   echo "$as_me: failed program was:" >&5
8187   cat conftest.$ac_ext >&5
8188   eval "$as_ac_Header=no"
8189 fi
8190 rm -f conftest.err conftest.$ac_ext
8191 fi
8192 echo "$as_me:8192: result: `eval echo '${'$as_ac_Header'}'`" >&5
8193 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
8194 if test `eval echo '${'$as_ac_Header'}'` = yes; then
8195   cat >>confdefs.h <<EOF
8196 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
8197 EOF
8198
8199 fi
8200 done
8201
8202 cat >>confdefs.h <<\EOF
8203 #define NCURSES 1
8204 EOF
8205
8206 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
8207
8208                 cat >>confdefs.h <<EOF
8209 #define $cf_nculib_ROOT 1
8210 EOF
8211
8212                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
8213
8214         else
8215
8216 cf_ncuhdr_root=$cf_cv_screen
8217
8218 test -n "$cf_cv_curses_dir" && \
8219 test "$cf_cv_curses_dir" != "no" && { \
8220
8221 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
8222   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
8223   do
8224         while test $cf_add_incdir != /usr/include
8225         do
8226           if test -d $cf_add_incdir
8227           then
8228                 cf_have_incdir=no
8229                 if test -n "$CFLAGS$CPPFLAGS" ; then
8230                   # a loop is needed to ensure we can add subdirs of existing dirs
8231                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8232                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8233                           cf_have_incdir=yes; break
8234                         fi
8235                   done
8236                 fi
8237
8238                 if test "$cf_have_incdir" = no ; then
8239                   if test "$cf_add_incdir" = /usr/local/include ; then
8240                         if test "$GCC" = yes
8241                         then
8242                           cf_save_CPPFLAGS=$CPPFLAGS
8243                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8244                           cat >conftest.$ac_ext <<_ACEOF
8245 #line 8245 "configure"
8246 #include "confdefs.h"
8247 #include <stdio.h>
8248 int
8249 main ()
8250 {
8251 printf("Hello")
8252   ;
8253   return 0;
8254 }
8255 _ACEOF
8256 rm -f conftest.$ac_objext
8257 if { (eval echo "$as_me:8257: \"$ac_compile\"") >&5
8258   (eval $ac_compile) 2>&5
8259   ac_status=$?
8260   echo "$as_me:8260: \$? = $ac_status" >&5
8261   (exit $ac_status); } &&
8262          { ac_try='test -s conftest.$ac_objext'
8263   { (eval echo "$as_me:8263: \"$ac_try\"") >&5
8264   (eval $ac_try) 2>&5
8265   ac_status=$?
8266   echo "$as_me:8266: \$? = $ac_status" >&5
8267   (exit $ac_status); }; }; then
8268   :
8269 else
8270   echo "$as_me: failed program was:" >&5
8271 cat conftest.$ac_ext >&5
8272 cf_have_incdir=yes
8273 fi
8274 rm -f conftest.$ac_objext conftest.$ac_ext
8275                           CPPFLAGS=$cf_save_CPPFLAGS
8276                         fi
8277                   fi
8278                 fi
8279
8280                 if test "$cf_have_incdir" = no ; then
8281                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8282
8283 echo "${as_me:-configure}:8283: testing adding $cf_add_incdir to include-path ..." 1>&5
8284
8285                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8286
8287                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8288                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8289                   cf_add_incdir="$cf_top_incdir"
8290                 else
8291                   break
8292                 fi
8293           else
8294                 break
8295           fi
8296         done
8297   done
8298 fi
8299
8300 }
8301
8302 echo "$as_me:8302: checking for $cf_ncuhdr_root header in include-path" >&5
8303 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
8304 if test "${cf_cv_ncurses_h+set}" = set; then
8305   echo $ECHO_N "(cached) $ECHO_C" >&6
8306 else
8307
8308         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
8309         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
8310         for cf_header in $cf_header_list
8311         do
8312
8313         cat >conftest.$ac_ext <<_ACEOF
8314 #line 8314 "configure"
8315 #include "confdefs.h"
8316
8317 #include <$cf_header>
8318 int
8319 main ()
8320 {
8321
8322 #ifdef NCURSES_VERSION
8323
8324 printf("%s\n", NCURSES_VERSION);
8325 #else
8326 #ifdef __NCURSES_H
8327 printf("old\n");
8328 #else
8329         make an error
8330 #endif
8331 #endif
8332
8333   ;
8334   return 0;
8335 }
8336 _ACEOF
8337 rm -f conftest.$ac_objext
8338 if { (eval echo "$as_me:8338: \"$ac_compile\"") >&5
8339   (eval $ac_compile) 2>&5
8340   ac_status=$?
8341   echo "$as_me:8341: \$? = $ac_status" >&5
8342   (exit $ac_status); } &&
8343          { ac_try='test -s conftest.$ac_objext'
8344   { (eval echo "$as_me:8344: \"$ac_try\"") >&5
8345   (eval $ac_try) 2>&5
8346   ac_status=$?
8347   echo "$as_me:8347: \$? = $ac_status" >&5
8348   (exit $ac_status); }; }; then
8349   cf_cv_ncurses_h=$cf_header
8350
8351 else
8352   echo "$as_me: failed program was:" >&5
8353 cat conftest.$ac_ext >&5
8354 cf_cv_ncurses_h=no
8355 fi
8356 rm -f conftest.$ac_objext conftest.$ac_ext
8357
8358                 test "$cf_cv_ncurses_h" != no && break
8359         done
8360
8361 fi
8362 echo "$as_me:8362: result: $cf_cv_ncurses_h" >&5
8363 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
8364
8365 if test "$cf_cv_ncurses_h" != no ; then
8366         cf_cv_ncurses_header=$cf_cv_ncurses_h
8367 else
8368
8369 echo "$as_me:8369: checking for $cf_ncuhdr_root include-path" >&5
8370 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
8371 if test "${cf_cv_ncurses_h2+set}" = set; then
8372   echo $ECHO_N "(cached) $ECHO_C" >&6
8373 else
8374
8375         test -n "$verbose" && echo
8376
8377 cf_search=
8378
8379 # collect the current set of include-directories from compiler flags
8380 cf_header_path_list=""
8381 if test -n "${CFLAGS}${CPPFLAGS}" ; then
8382         for cf_header_path in $CPPFLAGS $CFLAGS
8383         do
8384                 case $cf_header_path in
8385                 (-I*)
8386                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
8387
8388 test "x$cf_header_path" != "xNONE" && \
8389 test -d "$cf_header_path" && \
8390  {
8391         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
8392         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
8393         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
8394         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
8395         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
8396         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"
8397 }
8398
8399                         cf_header_path_list="$cf_header_path_list $cf_search"
8400                         ;;
8401                 esac
8402         done
8403 fi
8404
8405 # add the variations for the package we are looking for
8406
8407 cf_search=
8408
8409 test "x$prefix" != "xNONE" && \
8410 test -d "$prefix" && \
8411  {
8412         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
8413         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
8414         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
8415         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
8416         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
8417         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8418 }
8419
8420 for cf_subdir_prefix in \
8421         /usr \
8422         /usr/local \
8423         /usr/pkg \
8424         /opt \
8425         /opt/local \
8426         $HOME
8427 do
8428
8429 test "x$cf_subdir_prefix" != "x$prefix" && \
8430 test -d "$cf_subdir_prefix" && \
8431 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
8432         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
8433         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
8434         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
8435         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
8436         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
8437         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"
8438 }
8439
8440 done
8441
8442 test "$includedir" != NONE && \
8443 test "$includedir" != "/usr/include" && \
8444 test -d "$includedir" && {
8445         test -d $includedir &&    cf_search="$cf_search $includedir"
8446         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
8447 }
8448
8449 test "$oldincludedir" != NONE && \
8450 test "$oldincludedir" != "/usr/include" && \
8451 test -d "$oldincludedir" && {
8452         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
8453         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
8454 }
8455
8456 cf_search="$cf_search $cf_header_path_list"
8457
8458         test -n "$verbose" && echo search path $cf_search
8459         cf_save2_CPPFLAGS="$CPPFLAGS"
8460         for cf_incdir in $cf_search
8461         do
8462
8463 if test -n "$cf_incdir" ; then
8464   for cf_add_incdir in $cf_incdir
8465   do
8466         while test $cf_add_incdir != /usr/include
8467         do
8468           if test -d $cf_add_incdir
8469           then
8470                 cf_have_incdir=no
8471                 if test -n "$CFLAGS$CPPFLAGS" ; then
8472                   # a loop is needed to ensure we can add subdirs of existing dirs
8473                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8474                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8475                           cf_have_incdir=yes; break
8476                         fi
8477                   done
8478                 fi
8479
8480                 if test "$cf_have_incdir" = no ; then
8481                   if test "$cf_add_incdir" = /usr/local/include ; then
8482                         if test "$GCC" = yes
8483                         then
8484                           cf_save_CPPFLAGS=$CPPFLAGS
8485                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8486                           cat >conftest.$ac_ext <<_ACEOF
8487 #line 8487 "configure"
8488 #include "confdefs.h"
8489 #include <stdio.h>
8490 int
8491 main ()
8492 {
8493 printf("Hello")
8494   ;
8495   return 0;
8496 }
8497 _ACEOF
8498 rm -f conftest.$ac_objext
8499 if { (eval echo "$as_me:8499: \"$ac_compile\"") >&5
8500   (eval $ac_compile) 2>&5
8501   ac_status=$?
8502   echo "$as_me:8502: \$? = $ac_status" >&5
8503   (exit $ac_status); } &&
8504          { ac_try='test -s conftest.$ac_objext'
8505   { (eval echo "$as_me:8505: \"$ac_try\"") >&5
8506   (eval $ac_try) 2>&5
8507   ac_status=$?
8508   echo "$as_me:8508: \$? = $ac_status" >&5
8509   (exit $ac_status); }; }; then
8510   :
8511 else
8512   echo "$as_me: failed program was:" >&5
8513 cat conftest.$ac_ext >&5
8514 cf_have_incdir=yes
8515 fi
8516 rm -f conftest.$ac_objext conftest.$ac_ext
8517                           CPPFLAGS=$cf_save_CPPFLAGS
8518                         fi
8519                   fi
8520                 fi
8521
8522                 if test "$cf_have_incdir" = no ; then
8523                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8524
8525 echo "${as_me:-configure}:8525: testing adding $cf_add_incdir to include-path ..." 1>&5
8526
8527                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8528
8529                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8530                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8531                   cf_add_incdir="$cf_top_incdir"
8532                 else
8533                   break
8534                 fi
8535           else
8536                 break
8537           fi
8538         done
8539   done
8540 fi
8541
8542                 for cf_header in \
8543                         ncurses.h \
8544                         curses.h
8545                 do
8546
8547         cat >conftest.$ac_ext <<_ACEOF
8548 #line 8548 "configure"
8549 #include "confdefs.h"
8550
8551 #include <$cf_header>
8552 int
8553 main ()
8554 {
8555
8556 #ifdef NCURSES_VERSION
8557
8558 printf("%s\n", NCURSES_VERSION);
8559 #else
8560 #ifdef __NCURSES_H
8561 printf("old\n");
8562 #else
8563         make an error
8564 #endif
8565 #endif
8566
8567   ;
8568   return 0;
8569 }
8570 _ACEOF
8571 rm -f conftest.$ac_objext
8572 if { (eval echo "$as_me:8572: \"$ac_compile\"") >&5
8573   (eval $ac_compile) 2>&5
8574   ac_status=$?
8575   echo "$as_me:8575: \$? = $ac_status" >&5
8576   (exit $ac_status); } &&
8577          { ac_try='test -s conftest.$ac_objext'
8578   { (eval echo "$as_me:8578: \"$ac_try\"") >&5
8579   (eval $ac_try) 2>&5
8580   ac_status=$?
8581   echo "$as_me:8581: \$? = $ac_status" >&5
8582   (exit $ac_status); }; }; then
8583   cf_cv_ncurses_h2=$cf_header
8584
8585 else
8586   echo "$as_me: failed program was:" >&5
8587 cat conftest.$ac_ext >&5
8588 cf_cv_ncurses_h2=no
8589 fi
8590 rm -f conftest.$ac_objext conftest.$ac_ext
8591
8592                         if test "$cf_cv_ncurses_h2" != no ; then
8593                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
8594                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
8595                                 break
8596                         fi
8597                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
8598                 done
8599                 CPPFLAGS="$cf_save2_CPPFLAGS"
8600                 test "$cf_cv_ncurses_h2" != no && break
8601         done
8602         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:8602: error: not found" >&5
8603 echo "$as_me: error: not found" >&2;}
8604    { (exit 1); exit 1; }; }
8605
8606 fi
8607 echo "$as_me:8607: result: $cf_cv_ncurses_h2" >&5
8608 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
8609
8610         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
8611         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
8612         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
8613                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
8614         fi
8615
8616 if test -n "$cf_1st_incdir" ; then
8617   for cf_add_incdir in $cf_1st_incdir
8618   do
8619         while test $cf_add_incdir != /usr/include
8620         do
8621           if test -d $cf_add_incdir
8622           then
8623                 cf_have_incdir=no
8624                 if test -n "$CFLAGS$CPPFLAGS" ; then
8625                   # a loop is needed to ensure we can add subdirs of existing dirs
8626                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8627                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8628                           cf_have_incdir=yes; break
8629                         fi
8630                   done
8631                 fi
8632
8633                 if test "$cf_have_incdir" = no ; then
8634                   if test "$cf_add_incdir" = /usr/local/include ; then
8635                         if test "$GCC" = yes
8636                         then
8637                           cf_save_CPPFLAGS=$CPPFLAGS
8638                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8639                           cat >conftest.$ac_ext <<_ACEOF
8640 #line 8640 "configure"
8641 #include "confdefs.h"
8642 #include <stdio.h>
8643 int
8644 main ()
8645 {
8646 printf("Hello")
8647   ;
8648   return 0;
8649 }
8650 _ACEOF
8651 rm -f conftest.$ac_objext
8652 if { (eval echo "$as_me:8652: \"$ac_compile\"") >&5
8653   (eval $ac_compile) 2>&5
8654   ac_status=$?
8655   echo "$as_me:8655: \$? = $ac_status" >&5
8656   (exit $ac_status); } &&
8657          { ac_try='test -s conftest.$ac_objext'
8658   { (eval echo "$as_me:8658: \"$ac_try\"") >&5
8659   (eval $ac_try) 2>&5
8660   ac_status=$?
8661   echo "$as_me:8661: \$? = $ac_status" >&5
8662   (exit $ac_status); }; }; then
8663   :
8664 else
8665   echo "$as_me: failed program was:" >&5
8666 cat conftest.$ac_ext >&5
8667 cf_have_incdir=yes
8668 fi
8669 rm -f conftest.$ac_objext conftest.$ac_ext
8670                           CPPFLAGS=$cf_save_CPPFLAGS
8671                         fi
8672                   fi
8673                 fi
8674
8675                 if test "$cf_have_incdir" = no ; then
8676                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8677
8678 echo "${as_me:-configure}:8678: testing adding $cf_add_incdir to include-path ..." 1>&5
8679
8680                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8681
8682                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8683                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8684                   cf_add_incdir="$cf_top_incdir"
8685                 else
8686                   break
8687                 fi
8688           else
8689                 break
8690           fi
8691         done
8692   done
8693 fi
8694
8695 fi
8696
8697 # Set definitions to allow ifdef'ing for ncurses.h
8698
8699 case $cf_cv_ncurses_header in
8700 (*ncurses.h)
8701
8702 cat >>confdefs.h <<\EOF
8703 #define HAVE_NCURSES_H 1
8704 EOF
8705
8706         ;;
8707 esac
8708
8709 case $cf_cv_ncurses_header in
8710 (ncurses/curses.h|ncurses/ncurses.h)
8711
8712 cat >>confdefs.h <<\EOF
8713 #define HAVE_NCURSES_NCURSES_H 1
8714 EOF
8715
8716         ;;
8717 (ncursesw/curses.h|ncursesw/ncurses.h)
8718
8719 cat >>confdefs.h <<\EOF
8720 #define HAVE_NCURSESW_NCURSES_H 1
8721 EOF
8722
8723         ;;
8724 esac
8725
8726 echo "$as_me:8726: checking for terminfo header" >&5
8727 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
8728 if test "${cf_cv_term_header+set}" = set; then
8729   echo $ECHO_N "(cached) $ECHO_C" >&6
8730 else
8731
8732 case ${cf_cv_ncurses_header} in
8733 (*/ncurses.h|*/ncursesw.h)
8734         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
8735         ;;
8736 (*)
8737         cf_term_header=term.h
8738         ;;
8739 esac
8740
8741 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
8742 do
8743 cat >conftest.$ac_ext <<_ACEOF
8744 #line 8744 "configure"
8745 #include "confdefs.h"
8746 #include <stdio.h>
8747 #include <${cf_cv_ncurses_header:-curses.h}>
8748 #include <$cf_test>
8749
8750 int
8751 main ()
8752 {
8753 int x = auto_left_margin
8754   ;
8755   return 0;
8756 }
8757 _ACEOF
8758 rm -f conftest.$ac_objext
8759 if { (eval echo "$as_me:8759: \"$ac_compile\"") >&5
8760   (eval $ac_compile) 2>&5
8761   ac_status=$?
8762   echo "$as_me:8762: \$? = $ac_status" >&5
8763   (exit $ac_status); } &&
8764          { ac_try='test -s conftest.$ac_objext'
8765   { (eval echo "$as_me:8765: \"$ac_try\"") >&5
8766   (eval $ac_try) 2>&5
8767   ac_status=$?
8768   echo "$as_me:8768: \$? = $ac_status" >&5
8769   (exit $ac_status); }; }; then
8770
8771         cf_cv_term_header="$cf_test"
8772 else
8773   echo "$as_me: failed program was:" >&5
8774 cat conftest.$ac_ext >&5
8775
8776         cf_cv_term_header=unknown
8777
8778 fi
8779 rm -f conftest.$ac_objext conftest.$ac_ext
8780         test "$cf_cv_term_header" != unknown && break
8781 done
8782
8783 fi
8784 echo "$as_me:8784: result: $cf_cv_term_header" >&5
8785 echo "${ECHO_T}$cf_cv_term_header" >&6
8786
8787 # Set definitions to allow ifdef'ing to accommodate subdirectories
8788
8789 case $cf_cv_term_header in
8790 (*term.h)
8791
8792 cat >>confdefs.h <<\EOF
8793 #define HAVE_TERM_H 1
8794 EOF
8795
8796         ;;
8797 esac
8798
8799 case $cf_cv_term_header in
8800 (ncurses/term.h)
8801
8802 cat >>confdefs.h <<\EOF
8803 #define HAVE_NCURSES_TERM_H 1
8804 EOF
8805
8806         ;;
8807 (ncursesw/term.h)
8808
8809 cat >>confdefs.h <<\EOF
8810 #define HAVE_NCURSESW_TERM_H 1
8811 EOF
8812
8813         ;;
8814 esac
8815
8816 # some applications need this, but should check for NCURSES_VERSION
8817
8818 cat >>confdefs.h <<\EOF
8819 #define NCURSES 1
8820 EOF
8821
8822 echo "$as_me:8822: checking for ncurses version" >&5
8823 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
8824 if test "${cf_cv_ncurses_version+set}" = set; then
8825   echo $ECHO_N "(cached) $ECHO_C" >&6
8826 else
8827
8828         cf_cv_ncurses_version=no
8829         cf_tempfile=out$$
8830         rm -f $cf_tempfile
8831         if test "$cross_compiling" = yes; then
8832
8833         # This will not work if the preprocessor splits the line after the
8834         # Autoconf token.  The 'unproto' program does that.
8835         cat > conftest.$ac_ext <<EOF
8836 #include <${cf_cv_ncurses_header:-curses.h}>
8837 #undef Autoconf
8838 #ifdef NCURSES_VERSION
8839 Autoconf NCURSES_VERSION
8840 #else
8841 #ifdef __NCURSES_H
8842 Autoconf "old"
8843 #endif
8844 ;
8845 #endif
8846 EOF
8847         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
8848         { (eval echo "$as_me:8848: \"$cf_try\"") >&5
8849   (eval $cf_try) 2>&5
8850   ac_status=$?
8851   echo "$as_me:8851: \$? = $ac_status" >&5
8852   (exit $ac_status); }
8853         if test -f conftest.out ; then
8854                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
8855                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
8856                 rm -f conftest.out
8857         fi
8858
8859 else
8860   cat >conftest.$ac_ext <<_ACEOF
8861 #line 8861 "configure"
8862 #include "confdefs.h"
8863
8864 #include <${cf_cv_ncurses_header:-curses.h}>
8865 #include <stdio.h>
8866 int main()
8867 {
8868         FILE *fp = fopen("$cf_tempfile", "w");
8869 #ifdef NCURSES_VERSION
8870 # ifdef NCURSES_VERSION_PATCH
8871         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
8872 # else
8873         fprintf(fp, "%s\n", NCURSES_VERSION);
8874 # endif
8875 #else
8876 # ifdef __NCURSES_H
8877         fprintf(fp, "old\n");
8878 # else
8879         make an error
8880 # endif
8881 #endif
8882         ${cf_cv_main_return:-return}(0);
8883 }
8884 _ACEOF
8885 rm -f conftest$ac_exeext
8886 if { (eval echo "$as_me:8886: \"$ac_link\"") >&5
8887   (eval $ac_link) 2>&5
8888   ac_status=$?
8889   echo "$as_me:8889: \$? = $ac_status" >&5
8890   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
8891   { (eval echo "$as_me:8891: \"$ac_try\"") >&5
8892   (eval $ac_try) 2>&5
8893   ac_status=$?
8894   echo "$as_me:8894: \$? = $ac_status" >&5
8895   (exit $ac_status); }; }; then
8896
8897         cf_cv_ncurses_version=`cat $cf_tempfile`
8898 else
8899   echo "$as_me: program exited with status $ac_status" >&5
8900 echo "$as_me: failed program was:" >&5
8901 cat conftest.$ac_ext >&5
8902 fi
8903 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
8904 fi
8905         rm -f $cf_tempfile
8906
8907 fi
8908 echo "$as_me:8908: result: $cf_cv_ncurses_version" >&5
8909 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
8910 test "$cf_cv_ncurses_version" = no ||
8911 cat >>confdefs.h <<\EOF
8912 #define NCURSES 1
8913 EOF
8914
8915 cf_nculib_root=$cf_cv_screen
8916         # This works, except for the special case where we find gpm, but
8917         # ncurses is in a nonstandard location via $LIBS, and we really want
8918         # to link gpm.
8919 cf_ncurses_LIBS=""
8920 cf_ncurses_SAVE="$LIBS"
8921 echo "$as_me:8921: checking for Gpm_Open in -lgpm" >&5
8922 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
8923 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
8924   echo $ECHO_N "(cached) $ECHO_C" >&6
8925 else
8926   ac_check_lib_save_LIBS=$LIBS
8927 LIBS="-lgpm  $LIBS"
8928 cat >conftest.$ac_ext <<_ACEOF
8929 #line 8929 "configure"
8930 #include "confdefs.h"
8931
8932 /* Override any gcc2 internal prototype to avoid an error.  */
8933 #ifdef __cplusplus
8934 extern "C"
8935 #endif
8936 /* We use char because int might match the return type of a gcc2
8937    builtin and then its argument prototype would still apply.  */
8938 char Gpm_Open ();
8939 int
8940 main ()
8941 {
8942 Gpm_Open ();
8943   ;
8944   return 0;
8945 }
8946 _ACEOF
8947 rm -f conftest.$ac_objext conftest$ac_exeext
8948 if { (eval echo "$as_me:8948: \"$ac_link\"") >&5
8949   (eval $ac_link) 2>&5
8950   ac_status=$?
8951   echo "$as_me:8951: \$? = $ac_status" >&5
8952   (exit $ac_status); } &&
8953          { ac_try='test -s conftest$ac_exeext'
8954   { (eval echo "$as_me:8954: \"$ac_try\"") >&5
8955   (eval $ac_try) 2>&5
8956   ac_status=$?
8957   echo "$as_me:8957: \$? = $ac_status" >&5
8958   (exit $ac_status); }; }; then
8959   ac_cv_lib_gpm_Gpm_Open=yes
8960 else
8961   echo "$as_me: failed program was:" >&5
8962 cat conftest.$ac_ext >&5
8963 ac_cv_lib_gpm_Gpm_Open=no
8964 fi
8965 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8966 LIBS=$ac_check_lib_save_LIBS
8967 fi
8968 echo "$as_me:8968: result: $ac_cv_lib_gpm_Gpm_Open" >&5
8969 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
8970 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
8971   echo "$as_me:8971: checking for initscr in -lgpm" >&5
8972 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
8973 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
8974   echo $ECHO_N "(cached) $ECHO_C" >&6
8975 else
8976   ac_check_lib_save_LIBS=$LIBS
8977 LIBS="-lgpm  $LIBS"
8978 cat >conftest.$ac_ext <<_ACEOF
8979 #line 8979 "configure"
8980 #include "confdefs.h"
8981
8982 /* Override any gcc2 internal prototype to avoid an error.  */
8983 #ifdef __cplusplus
8984 extern "C"
8985 #endif
8986 /* We use char because int might match the return type of a gcc2
8987    builtin and then its argument prototype would still apply.  */
8988 char initscr ();
8989 int
8990 main ()
8991 {
8992 initscr ();
8993   ;
8994   return 0;
8995 }
8996 _ACEOF
8997 rm -f conftest.$ac_objext conftest$ac_exeext
8998 if { (eval echo "$as_me:8998: \"$ac_link\"") >&5
8999   (eval $ac_link) 2>&5
9000   ac_status=$?
9001   echo "$as_me:9001: \$? = $ac_status" >&5
9002   (exit $ac_status); } &&
9003          { ac_try='test -s conftest$ac_exeext'
9004   { (eval echo "$as_me:9004: \"$ac_try\"") >&5
9005   (eval $ac_try) 2>&5
9006   ac_status=$?
9007   echo "$as_me:9007: \$? = $ac_status" >&5
9008   (exit $ac_status); }; }; then
9009   ac_cv_lib_gpm_initscr=yes
9010 else
9011   echo "$as_me: failed program was:" >&5
9012 cat conftest.$ac_ext >&5
9013 ac_cv_lib_gpm_initscr=no
9014 fi
9015 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9016 LIBS=$ac_check_lib_save_LIBS
9017 fi
9018 echo "$as_me:9018: result: $ac_cv_lib_gpm_initscr" >&5
9019 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
9020 if test $ac_cv_lib_gpm_initscr = yes; then
9021   LIBS="$cf_ncurses_SAVE"
9022 else
9023   cf_ncurses_LIBS="-lgpm"
9024 fi
9025
9026 fi
9027
9028 case $host_os in
9029 (freebsd*)
9030         # This is only necessary if you are linking against an obsolete
9031         # version of ncurses (but it should do no harm, since it's static).
9032         if test "$cf_nculib_root" = ncurses ; then
9033                 echo "$as_me:9033: checking for tgoto in -lmytinfo" >&5
9034 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
9035 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
9036   echo $ECHO_N "(cached) $ECHO_C" >&6
9037 else
9038   ac_check_lib_save_LIBS=$LIBS
9039 LIBS="-lmytinfo  $LIBS"
9040 cat >conftest.$ac_ext <<_ACEOF
9041 #line 9041 "configure"
9042 #include "confdefs.h"
9043
9044 /* Override any gcc2 internal prototype to avoid an error.  */
9045 #ifdef __cplusplus
9046 extern "C"
9047 #endif
9048 /* We use char because int might match the return type of a gcc2
9049    builtin and then its argument prototype would still apply.  */
9050 char tgoto ();
9051 int
9052 main ()
9053 {
9054 tgoto ();
9055   ;
9056   return 0;
9057 }
9058 _ACEOF
9059 rm -f conftest.$ac_objext conftest$ac_exeext
9060 if { (eval echo "$as_me:9060: \"$ac_link\"") >&5
9061   (eval $ac_link) 2>&5
9062   ac_status=$?
9063   echo "$as_me:9063: \$? = $ac_status" >&5
9064   (exit $ac_status); } &&
9065          { ac_try='test -s conftest$ac_exeext'
9066   { (eval echo "$as_me:9066: \"$ac_try\"") >&5
9067   (eval $ac_try) 2>&5
9068   ac_status=$?
9069   echo "$as_me:9069: \$? = $ac_status" >&5
9070   (exit $ac_status); }; }; then
9071   ac_cv_lib_mytinfo_tgoto=yes
9072 else
9073   echo "$as_me: failed program was:" >&5
9074 cat conftest.$ac_ext >&5
9075 ac_cv_lib_mytinfo_tgoto=no
9076 fi
9077 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9078 LIBS=$ac_check_lib_save_LIBS
9079 fi
9080 echo "$as_me:9080: result: $ac_cv_lib_mytinfo_tgoto" >&5
9081 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
9082 if test $ac_cv_lib_mytinfo_tgoto = yes; then
9083   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
9084 fi
9085
9086         fi
9087         ;;
9088 esac
9089
9090 cf_add_libs="$cf_ncurses_LIBS"
9091 # Filter out duplicates - this happens with badly-designed ".pc" files...
9092 for cf_add_1lib in $LIBS
9093 do
9094         for cf_add_2lib in $cf_add_libs
9095         do
9096                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
9097                 then
9098                         cf_add_1lib=
9099                         break
9100                 fi
9101         done
9102         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
9103 done
9104 LIBS="$cf_add_libs"
9105
9106 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
9107 then
9108
9109 cf_add_libs="-l$cf_nculib_root"
9110 # Filter out duplicates - this happens with badly-designed ".pc" files...
9111 for cf_add_1lib in $LIBS
9112 do
9113         for cf_add_2lib in $cf_add_libs
9114         do
9115                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
9116                 then
9117                         cf_add_1lib=
9118                         break
9119                 fi
9120         done
9121         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
9122 done
9123 LIBS="$cf_add_libs"
9124
9125 else
9126
9127         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
9128         cf_libdir=""
9129         echo "$as_me:9129: checking for initscr" >&5
9130 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
9131 if test "${ac_cv_func_initscr+set}" = set; then
9132   echo $ECHO_N "(cached) $ECHO_C" >&6
9133 else
9134   cat >conftest.$ac_ext <<_ACEOF
9135 #line 9135 "configure"
9136 #include "confdefs.h"
9137 /* System header to define __stub macros and hopefully few prototypes,
9138     which can conflict with char initscr (); below.  */
9139 #include <assert.h>
9140 /* Override any gcc2 internal prototype to avoid an error.  */
9141 #ifdef __cplusplus
9142 extern "C"
9143 #endif
9144 /* We use char because int might match the return type of a gcc2
9145    builtin and then its argument prototype would still apply.  */
9146 char initscr ();
9147 char (*f) ();
9148
9149 int
9150 main ()
9151 {
9152 /* The GNU C library defines this for functions which it implements
9153     to always fail with ENOSYS.  Some functions are actually named
9154     something starting with __ and the normal name is an alias.  */
9155 #if defined (__stub_initscr) || defined (__stub___initscr)
9156 choke me
9157 #else
9158 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
9159 #endif
9160
9161   ;
9162   return 0;
9163 }
9164 _ACEOF
9165 rm -f conftest.$ac_objext conftest$ac_exeext
9166 if { (eval echo "$as_me:9166: \"$ac_link\"") >&5
9167   (eval $ac_link) 2>&5
9168   ac_status=$?
9169   echo "$as_me:9169: \$? = $ac_status" >&5
9170   (exit $ac_status); } &&
9171          { ac_try='test -s conftest$ac_exeext'
9172   { (eval echo "$as_me:9172: \"$ac_try\"") >&5
9173   (eval $ac_try) 2>&5
9174   ac_status=$?
9175   echo "$as_me:9175: \$? = $ac_status" >&5
9176   (exit $ac_status); }; }; then
9177   ac_cv_func_initscr=yes
9178 else
9179   echo "$as_me: failed program was:" >&5
9180 cat conftest.$ac_ext >&5
9181 ac_cv_func_initscr=no
9182 fi
9183 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9184 fi
9185 echo "$as_me:9185: result: $ac_cv_func_initscr" >&5
9186 echo "${ECHO_T}$ac_cv_func_initscr" >&6
9187 if test $ac_cv_func_initscr = yes; then
9188   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9189 else
9190
9191                 cf_save_LIBS="$LIBS"
9192                 echo "$as_me:9192: checking for initscr in -l$cf_nculib_root" >&5
9193 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
9194                 LIBS="-l$cf_nculib_root $LIBS"
9195                 cat >conftest.$ac_ext <<_ACEOF
9196 #line 9196 "configure"
9197 #include "confdefs.h"
9198 #include <${cf_cv_ncurses_header:-curses.h}>
9199 int
9200 main ()
9201 {
9202 initscr()
9203   ;
9204   return 0;
9205 }
9206 _ACEOF
9207 rm -f conftest.$ac_objext conftest$ac_exeext
9208 if { (eval echo "$as_me:9208: \"$ac_link\"") >&5
9209   (eval $ac_link) 2>&5
9210   ac_status=$?
9211   echo "$as_me:9211: \$? = $ac_status" >&5
9212   (exit $ac_status); } &&
9213          { ac_try='test -s conftest$ac_exeext'
9214   { (eval echo "$as_me:9214: \"$ac_try\"") >&5
9215   (eval $ac_try) 2>&5
9216   ac_status=$?
9217   echo "$as_me:9217: \$? = $ac_status" >&5
9218   (exit $ac_status); }; }; then
9219   echo "$as_me:9219: result: yes" >&5
9220 echo "${ECHO_T}yes" >&6
9221                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9222
9223 else
9224   echo "$as_me: failed program was:" >&5
9225 cat conftest.$ac_ext >&5
9226 echo "$as_me:9226: result: no" >&5
9227 echo "${ECHO_T}no" >&6
9228
9229 cf_search=
9230 cf_library_path_list=""
9231 if test -n "${LDFLAGS}${LIBS}" ; then
9232         for cf_library_path in $LDFLAGS $LIBS
9233         do
9234                 case $cf_library_path in
9235                 (-L*)
9236                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
9237
9238 test "x$cf_library_path" != "xNONE" && \
9239 test -d "$cf_library_path" && \
9240  {
9241         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
9242         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
9243         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
9244         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
9245         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
9246         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"
9247 }
9248
9249                         cf_library_path_list="$cf_library_path_list $cf_search"
9250                         ;;
9251                 esac
9252         done
9253 fi
9254
9255 cf_search=
9256
9257 test "x$prefix" != "xNONE" && \
9258 test -d "$prefix" && \
9259  {
9260         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
9261         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
9262         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
9263         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
9264         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
9265         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
9266 }
9267
9268 for cf_subdir_prefix in \
9269         /usr \
9270         /usr/local \
9271         /usr/pkg \
9272         /opt \
9273         /opt/local \
9274         $HOME
9275 do
9276
9277 test "x$cf_subdir_prefix" != "x$prefix" && \
9278 test -d "$cf_subdir_prefix" && \
9279 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
9280         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
9281         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
9282         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
9283         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
9284         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
9285         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"
9286 }
9287
9288 done
9289
9290 cf_search="$cf_library_path_list $cf_search"
9291
9292                         for cf_libdir in $cf_search
9293                         do
9294                                 echo "$as_me:9294: checking for -l$cf_nculib_root in $cf_libdir" >&5
9295 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
9296                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
9297                                 cat >conftest.$ac_ext <<_ACEOF
9298 #line 9298 "configure"
9299 #include "confdefs.h"
9300 #include <${cf_cv_ncurses_header:-curses.h}>
9301 int
9302 main ()
9303 {
9304 initscr()
9305   ;
9306   return 0;
9307 }
9308 _ACEOF
9309 rm -f conftest.$ac_objext conftest$ac_exeext
9310 if { (eval echo "$as_me:9310: \"$ac_link\"") >&5
9311   (eval $ac_link) 2>&5
9312   ac_status=$?
9313   echo "$as_me:9313: \$? = $ac_status" >&5
9314   (exit $ac_status); } &&
9315          { ac_try='test -s conftest$ac_exeext'
9316   { (eval echo "$as_me:9316: \"$ac_try\"") >&5
9317   (eval $ac_try) 2>&5
9318   ac_status=$?
9319   echo "$as_me:9319: \$? = $ac_status" >&5
9320   (exit $ac_status); }; }; then
9321   echo "$as_me:9321: result: yes" >&5
9322 echo "${ECHO_T}yes" >&6
9323                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9324                                          break
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_save_LIBS"
9331 fi
9332 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9333                         done
9334
9335 fi
9336 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9337
9338 fi
9339
9340 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
9341
9342 if test $cf_found_library = no ; then
9343         { { echo "$as_me:9343: error: Cannot link $cf_nculib_root library" >&5
9344 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
9345    { (exit 1); exit 1; }; }
9346 fi
9347
9348 fi
9349
9350 if test -n "$cf_ncurses_LIBS" ; then
9351         echo "$as_me:9351: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
9352 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
9353         cf_ncurses_SAVE="$LIBS"
9354         for p in $cf_ncurses_LIBS ; do
9355                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
9356                 if test "$q" != "$LIBS" ; then
9357                         LIBS="$q"
9358                 fi
9359         done
9360         cat >conftest.$ac_ext <<_ACEOF
9361 #line 9361 "configure"
9362 #include "confdefs.h"
9363 #include <${cf_cv_ncurses_header:-curses.h}>
9364 int
9365 main ()
9366 {
9367 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
9368   ;
9369   return 0;
9370 }
9371 _ACEOF
9372 rm -f conftest.$ac_objext conftest$ac_exeext
9373 if { (eval echo "$as_me:9373: \"$ac_link\"") >&5
9374   (eval $ac_link) 2>&5
9375   ac_status=$?
9376   echo "$as_me:9376: \$? = $ac_status" >&5
9377   (exit $ac_status); } &&
9378          { ac_try='test -s conftest$ac_exeext'
9379   { (eval echo "$as_me:9379: \"$ac_try\"") >&5
9380   (eval $ac_try) 2>&5
9381   ac_status=$?
9382   echo "$as_me:9382: \$? = $ac_status" >&5
9383   (exit $ac_status); }; }; then
9384   echo "$as_me:9384: result: yes" >&5
9385 echo "${ECHO_T}yes" >&6
9386 else
9387   echo "$as_me: failed program was:" >&5
9388 cat conftest.$ac_ext >&5
9389 echo "$as_me:9389: result: no" >&5
9390 echo "${ECHO_T}no" >&6
9391                  LIBS="$cf_ncurses_SAVE"
9392 fi
9393 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9394 fi
9395
9396 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9397
9398 cat >>confdefs.h <<EOF
9399 #define $cf_nculib_ROOT 1
9400 EOF
9401
9402         fi
9403 else
9404         NCURSES_CONFIG=none
9405 fi
9406
9407         ;;
9408 (pdcurses)
9409         echo "$as_me:9409: checking for X" >&5
9410 echo $ECHO_N "checking for X... $ECHO_C" >&6
9411
9412 # Check whether --with-x or --without-x was given.
9413 if test "${with_x+set}" = set; then
9414   withval="$with_x"
9415
9416 fi;
9417 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
9418 if test "x$with_x" = xno; then
9419   # The user explicitly disabled X.
9420   have_x=disabled
9421 else
9422   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
9423     # Both variables are already set.
9424     have_x=yes
9425   else
9426     if test "${ac_cv_have_x+set}" = set; then
9427   echo $ECHO_N "(cached) $ECHO_C" >&6
9428 else
9429   # One or both of the vars are not set, and there is no cached value.
9430 ac_x_includes=no ac_x_libraries=no
9431 rm -fr conftest.dir
9432 if mkdir conftest.dir; then
9433   cd conftest.dir
9434   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
9435   cat >Imakefile <<'EOF'
9436 acfindx:
9437         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
9438 EOF
9439   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
9440     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
9441     eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
9442     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
9443     for ac_extension in a so sl dylib dll; do
9444       if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
9445          test -f $ac_im_libdir/libX11.$ac_extension; then
9446         ac_im_usrlibdir=$ac_im_libdir; break
9447       fi
9448     done
9449     # Screen out bogus values from the imake configuration.  They are
9450     # bogus both because they are the default anyway, and because
9451     # using them would break gcc on systems where it needs fixed includes.
9452     case $ac_im_incroot in
9453         /usr/include) ;;
9454         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
9455     esac
9456     case $ac_im_usrlibdir in
9457         /usr/lib | /lib) ;;
9458         *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
9459     esac
9460   fi
9461   cd ..
9462   rm -fr conftest.dir
9463 fi
9464
9465 # Standard set of common directories for X headers.
9466 # Check X11 before X11Rn because it is often a symlink to the current release.
9467 ac_x_header_dirs='
9468 /usr/X11/include
9469 /usr/X11R6/include
9470 /usr/X11R5/include
9471 /usr/X11R4/include
9472
9473 /usr/include/X11
9474 /usr/include/X11R6
9475 /usr/include/X11R5
9476 /usr/include/X11R4
9477
9478 /usr/local/X11/include
9479 /usr/local/X11R6/include
9480 /usr/local/X11R5/include
9481 /usr/local/X11R4/include
9482
9483 /usr/local/include/X11
9484 /usr/local/include/X11R6
9485 /usr/local/include/X11R5
9486 /usr/local/include/X11R4
9487
9488 /usr/X386/include
9489 /usr/x386/include
9490 /usr/XFree86/include/X11
9491
9492 /usr/include
9493 /usr/local/include
9494 /usr/unsupported/include
9495 /usr/athena/include
9496 /usr/local/x11r5/include
9497 /usr/lpp/Xamples/include
9498
9499 /usr/openwin/include
9500 /usr/openwin/share/include'
9501
9502 if test "$ac_x_includes" = no; then
9503   # Guess where to find include files, by looking for Intrinsic.h.
9504   # First, try using that file with no special directory specified.
9505   cat >conftest.$ac_ext <<_ACEOF
9506 #line 9506 "configure"
9507 #include "confdefs.h"
9508 #include <X11/Intrinsic.h>
9509 _ACEOF
9510 if { (eval echo "$as_me:9510: \"$ac_cpp conftest.$ac_ext\"") >&5
9511   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
9512   ac_status=$?
9513   egrep -v '^ *\+' conftest.er1 >conftest.err
9514   rm -f conftest.er1
9515   cat conftest.err >&5
9516   echo "$as_me:9516: \$? = $ac_status" >&5
9517   (exit $ac_status); } >/dev/null; then
9518   if test -s conftest.err; then
9519     ac_cpp_err=$ac_c_preproc_warn_flag
9520   else
9521     ac_cpp_err=
9522   fi
9523 else
9524   ac_cpp_err=yes
9525 fi
9526 if test -z "$ac_cpp_err"; then
9527   # We can compile using X headers with no special include directory.
9528 ac_x_includes=
9529 else
9530   echo "$as_me: failed program was:" >&5
9531   cat conftest.$ac_ext >&5
9532   for ac_dir in $ac_x_header_dirs; do
9533   if test -r "$ac_dir/X11/Intrinsic.h"; then
9534     ac_x_includes=$ac_dir
9535     break
9536   fi
9537 done
9538 fi
9539 rm -f conftest.err conftest.$ac_ext
9540 fi # $ac_x_includes = no
9541
9542 if test "$ac_x_libraries" = no; then
9543   # Check for the libraries.
9544   # See if we find them without any special options.
9545   # Don't add to $LIBS permanently.
9546   ac_save_LIBS=$LIBS
9547   LIBS="-lXt $LIBS"
9548   cat >conftest.$ac_ext <<_ACEOF
9549 #line 9549 "configure"
9550 #include "confdefs.h"
9551 #include <X11/Intrinsic.h>
9552 int
9553 main ()
9554 {
9555 XtMalloc (0)
9556   ;
9557   return 0;
9558 }
9559 _ACEOF
9560 rm -f conftest.$ac_objext conftest$ac_exeext
9561 if { (eval echo "$as_me:9561: \"$ac_link\"") >&5
9562   (eval $ac_link) 2>&5
9563   ac_status=$?
9564   echo "$as_me:9564: \$? = $ac_status" >&5
9565   (exit $ac_status); } &&
9566          { ac_try='test -s conftest$ac_exeext'
9567   { (eval echo "$as_me:9567: \"$ac_try\"") >&5
9568   (eval $ac_try) 2>&5
9569   ac_status=$?
9570   echo "$as_me:9570: \$? = $ac_status" >&5
9571   (exit $ac_status); }; }; then
9572   LIBS=$ac_save_LIBS
9573 # We can link X programs with no special library path.
9574 ac_x_libraries=
9575 else
9576   echo "$as_me: failed program was:" >&5
9577 cat conftest.$ac_ext >&5
9578 LIBS=$ac_save_LIBS
9579 for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
9580 do
9581   # Don't even attempt the hair of trying to link an X program!
9582   for ac_extension in a so sl dylib dll; do
9583     if test -r $ac_dir/libXt.$ac_extension; then
9584       ac_x_libraries=$ac_dir
9585       break 2
9586     fi
9587   done
9588 done
9589 fi
9590 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9591 fi # $ac_x_libraries = no
9592
9593 if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then
9594   # Didn't find X anywhere.  Cache the known absence of X.
9595   ac_cv_have_x="have_x=no"
9596 else
9597   # Record where we found X for the cache.
9598   ac_cv_have_x="have_x=yes \
9599                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
9600 fi
9601 fi
9602
9603   fi
9604   eval "$ac_cv_have_x"
9605 fi # $with_x != no
9606
9607 if test "$have_x" != yes; then
9608   echo "$as_me:9608: result: $have_x" >&5
9609 echo "${ECHO_T}$have_x" >&6
9610   no_x=yes
9611 else
9612   # If each of the values was on the command line, it overrides each guess.
9613   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
9614   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
9615   # Update the cache value to reflect the command line values.
9616   ac_cv_have_x="have_x=yes \
9617                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
9618   echo "$as_me:9618: result: libraries $x_libraries, headers $x_includes" >&5
9619 echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6
9620 fi
9621
9622 if test "$no_x" = yes; then
9623   # Not all programs may use this symbol, but it does not hurt to define it.
9624
9625 cat >>confdefs.h <<\EOF
9626 #define X_DISPLAY_MISSING 1
9627 EOF
9628
9629   X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
9630 else
9631   if test -n "$x_includes"; then
9632     X_CFLAGS="$X_CFLAGS -I$x_includes"
9633   fi
9634
9635   # It would also be nice to do this for all -L options, not just this one.
9636   if test -n "$x_libraries"; then
9637     X_LIBS="$X_LIBS -L$x_libraries"
9638     # For Solaris; some versions of Sun CC require a space after -R and
9639     # others require no space.  Words are not sufficient . . . .
9640     case `(uname -sr) 2>/dev/null` in
9641     "SunOS 5"*)
9642       echo "$as_me:9642: checking whether -R must be followed by a space" >&5
9643 echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6
9644       ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
9645       cat >conftest.$ac_ext <<_ACEOF
9646 #line 9646 "configure"
9647 #include "confdefs.h"
9648
9649 int
9650 main ()
9651 {
9652
9653   ;
9654   return 0;
9655 }
9656 _ACEOF
9657 rm -f conftest.$ac_objext conftest$ac_exeext
9658 if { (eval echo "$as_me:9658: \"$ac_link\"") >&5
9659   (eval $ac_link) 2>&5
9660   ac_status=$?
9661   echo "$as_me:9661: \$? = $ac_status" >&5
9662   (exit $ac_status); } &&
9663          { ac_try='test -s conftest$ac_exeext'
9664   { (eval echo "$as_me:9664: \"$ac_try\"") >&5
9665   (eval $ac_try) 2>&5
9666   ac_status=$?
9667   echo "$as_me:9667: \$? = $ac_status" >&5
9668   (exit $ac_status); }; }; then
9669   ac_R_nospace=yes
9670 else
9671   echo "$as_me: failed program was:" >&5
9672 cat conftest.$ac_ext >&5
9673 ac_R_nospace=no
9674 fi
9675 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9676       if test $ac_R_nospace = yes; then
9677         echo "$as_me:9677: result: no" >&5
9678 echo "${ECHO_T}no" >&6
9679         X_LIBS="$X_LIBS -R$x_libraries"
9680       else
9681         LIBS="$ac_xsave_LIBS -R $x_libraries"
9682         cat >conftest.$ac_ext <<_ACEOF
9683 #line 9683 "configure"
9684 #include "confdefs.h"
9685
9686 int
9687 main ()
9688 {
9689
9690   ;
9691   return 0;
9692 }
9693 _ACEOF
9694 rm -f conftest.$ac_objext conftest$ac_exeext
9695 if { (eval echo "$as_me:9695: \"$ac_link\"") >&5
9696   (eval $ac_link) 2>&5
9697   ac_status=$?
9698   echo "$as_me:9698: \$? = $ac_status" >&5
9699   (exit $ac_status); } &&
9700          { ac_try='test -s conftest$ac_exeext'
9701   { (eval echo "$as_me:9701: \"$ac_try\"") >&5
9702   (eval $ac_try) 2>&5
9703   ac_status=$?
9704   echo "$as_me:9704: \$? = $ac_status" >&5
9705   (exit $ac_status); }; }; then
9706   ac_R_space=yes
9707 else
9708   echo "$as_me: failed program was:" >&5
9709 cat conftest.$ac_ext >&5
9710 ac_R_space=no
9711 fi
9712 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9713         if test $ac_R_space = yes; then
9714           echo "$as_me:9714: result: yes" >&5
9715 echo "${ECHO_T}yes" >&6
9716           X_LIBS="$X_LIBS -R $x_libraries"
9717         else
9718           echo "$as_me:9718: result: neither works" >&5
9719 echo "${ECHO_T}neither works" >&6
9720         fi
9721       fi
9722       LIBS=$ac_xsave_LIBS
9723     esac
9724   fi
9725
9726   # Check for system-dependent libraries X programs must link with.
9727   # Do this before checking for the system-independent R6 libraries
9728   # (-lICE), since we may need -lsocket or whatever for X linking.
9729
9730   if test "$ISC" = yes; then
9731     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
9732   else
9733     # Martyn Johnson says this is needed for Ultrix, if the X
9734     # libraries were built with DECnet support.  And Karl Berry says
9735     # the Alpha needs dnet_stub (dnet does not exist).
9736     ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
9737     cat >conftest.$ac_ext <<_ACEOF
9738 #line 9738 "configure"
9739 #include "confdefs.h"
9740
9741 /* Override any gcc2 internal prototype to avoid an error.  */
9742 #ifdef __cplusplus
9743 extern "C"
9744 #endif
9745 /* We use char because int might match the return type of a gcc2
9746    builtin and then its argument prototype would still apply.  */
9747 char XOpenDisplay ();
9748 int
9749 main ()
9750 {
9751 XOpenDisplay ();
9752   ;
9753   return 0;
9754 }
9755 _ACEOF
9756 rm -f conftest.$ac_objext conftest$ac_exeext
9757 if { (eval echo "$as_me:9757: \"$ac_link\"") >&5
9758   (eval $ac_link) 2>&5
9759   ac_status=$?
9760   echo "$as_me:9760: \$? = $ac_status" >&5
9761   (exit $ac_status); } &&
9762          { ac_try='test -s conftest$ac_exeext'
9763   { (eval echo "$as_me:9763: \"$ac_try\"") >&5
9764   (eval $ac_try) 2>&5
9765   ac_status=$?
9766   echo "$as_me:9766: \$? = $ac_status" >&5
9767   (exit $ac_status); }; }; then
9768   :
9769 else
9770   echo "$as_me: failed program was:" >&5
9771 cat conftest.$ac_ext >&5
9772 echo "$as_me:9772: checking for dnet_ntoa in -ldnet" >&5
9773 echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6
9774 if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then
9775   echo $ECHO_N "(cached) $ECHO_C" >&6
9776 else
9777   ac_check_lib_save_LIBS=$LIBS
9778 LIBS="-ldnet  $LIBS"
9779 cat >conftest.$ac_ext <<_ACEOF
9780 #line 9780 "configure"
9781 #include "confdefs.h"
9782
9783 /* Override any gcc2 internal prototype to avoid an error.  */
9784 #ifdef __cplusplus
9785 extern "C"
9786 #endif
9787 /* We use char because int might match the return type of a gcc2
9788    builtin and then its argument prototype would still apply.  */
9789 char dnet_ntoa ();
9790 int
9791 main ()
9792 {
9793 dnet_ntoa ();
9794   ;
9795   return 0;
9796 }
9797 _ACEOF
9798 rm -f conftest.$ac_objext conftest$ac_exeext
9799 if { (eval echo "$as_me:9799: \"$ac_link\"") >&5
9800   (eval $ac_link) 2>&5
9801   ac_status=$?
9802   echo "$as_me:9802: \$? = $ac_status" >&5
9803   (exit $ac_status); } &&
9804          { ac_try='test -s conftest$ac_exeext'
9805   { (eval echo "$as_me:9805: \"$ac_try\"") >&5
9806   (eval $ac_try) 2>&5
9807   ac_status=$?
9808   echo "$as_me:9808: \$? = $ac_status" >&5
9809   (exit $ac_status); }; }; then
9810   ac_cv_lib_dnet_dnet_ntoa=yes
9811 else
9812   echo "$as_me: failed program was:" >&5
9813 cat conftest.$ac_ext >&5
9814 ac_cv_lib_dnet_dnet_ntoa=no
9815 fi
9816 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9817 LIBS=$ac_check_lib_save_LIBS
9818 fi
9819 echo "$as_me:9819: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
9820 echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6
9821 if test $ac_cv_lib_dnet_dnet_ntoa = yes; then
9822   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
9823 fi
9824
9825     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
9826       echo "$as_me:9826: checking for dnet_ntoa in -ldnet_stub" >&5
9827 echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6
9828 if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then
9829   echo $ECHO_N "(cached) $ECHO_C" >&6
9830 else
9831   ac_check_lib_save_LIBS=$LIBS
9832 LIBS="-ldnet_stub  $LIBS"
9833 cat >conftest.$ac_ext <<_ACEOF
9834 #line 9834 "configure"
9835 #include "confdefs.h"
9836
9837 /* Override any gcc2 internal prototype to avoid an error.  */
9838 #ifdef __cplusplus
9839 extern "C"
9840 #endif
9841 /* We use char because int might match the return type of a gcc2
9842    builtin and then its argument prototype would still apply.  */
9843 char dnet_ntoa ();
9844 int
9845 main ()
9846 {
9847 dnet_ntoa ();
9848   ;
9849   return 0;
9850 }
9851 _ACEOF
9852 rm -f conftest.$ac_objext conftest$ac_exeext
9853 if { (eval echo "$as_me:9853: \"$ac_link\"") >&5
9854   (eval $ac_link) 2>&5
9855   ac_status=$?
9856   echo "$as_me:9856: \$? = $ac_status" >&5
9857   (exit $ac_status); } &&
9858          { ac_try='test -s conftest$ac_exeext'
9859   { (eval echo "$as_me:9859: \"$ac_try\"") >&5
9860   (eval $ac_try) 2>&5
9861   ac_status=$?
9862   echo "$as_me:9862: \$? = $ac_status" >&5
9863   (exit $ac_status); }; }; then
9864   ac_cv_lib_dnet_stub_dnet_ntoa=yes
9865 else
9866   echo "$as_me: failed program was:" >&5
9867 cat conftest.$ac_ext >&5
9868 ac_cv_lib_dnet_stub_dnet_ntoa=no
9869 fi
9870 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9871 LIBS=$ac_check_lib_save_LIBS
9872 fi
9873 echo "$as_me:9873: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
9874 echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6
9875 if test $ac_cv_lib_dnet_stub_dnet_ntoa = yes; then
9876   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
9877 fi
9878
9879     fi
9880 fi
9881 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9882     LIBS="$ac_xsave_LIBS"
9883
9884     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
9885     # to get the SysV transport functions.
9886     # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4)
9887     # needs -lnsl.
9888     # The nsl library prevents programs from opening the X display
9889     # on Irix 5.2, according to T.E. Dickey.
9890     # The functions gethostbyname, getservbyname, and inet_addr are
9891     # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
9892     echo "$as_me:9892: checking for gethostbyname" >&5
9893 echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6
9894 if test "${ac_cv_func_gethostbyname+set}" = set; then
9895   echo $ECHO_N "(cached) $ECHO_C" >&6
9896 else
9897   cat >conftest.$ac_ext <<_ACEOF
9898 #line 9898 "configure"
9899 #include "confdefs.h"
9900 /* System header to define __stub macros and hopefully few prototypes,
9901     which can conflict with char gethostbyname (); below.  */
9902 #include <assert.h>
9903 /* Override any gcc2 internal prototype to avoid an error.  */
9904 #ifdef __cplusplus
9905 extern "C"
9906 #endif
9907 /* We use char because int might match the return type of a gcc2
9908    builtin and then its argument prototype would still apply.  */
9909 char gethostbyname ();
9910 char (*f) ();
9911
9912 int
9913 main ()
9914 {
9915 /* The GNU C library defines this for functions which it implements
9916     to always fail with ENOSYS.  Some functions are actually named
9917     something starting with __ and the normal name is an alias.  */
9918 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
9919 choke me
9920 #else
9921 f = gethostbyname; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
9922 #endif
9923
9924   ;
9925   return 0;
9926 }
9927 _ACEOF
9928 rm -f conftest.$ac_objext conftest$ac_exeext
9929 if { (eval echo "$as_me:9929: \"$ac_link\"") >&5
9930   (eval $ac_link) 2>&5
9931   ac_status=$?
9932   echo "$as_me:9932: \$? = $ac_status" >&5
9933   (exit $ac_status); } &&
9934          { ac_try='test -s conftest$ac_exeext'
9935   { (eval echo "$as_me:9935: \"$ac_try\"") >&5
9936   (eval $ac_try) 2>&5
9937   ac_status=$?
9938   echo "$as_me:9938: \$? = $ac_status" >&5
9939   (exit $ac_status); }; }; then
9940   ac_cv_func_gethostbyname=yes
9941 else
9942   echo "$as_me: failed program was:" >&5
9943 cat conftest.$ac_ext >&5
9944 ac_cv_func_gethostbyname=no
9945 fi
9946 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9947 fi
9948 echo "$as_me:9948: result: $ac_cv_func_gethostbyname" >&5
9949 echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6
9950
9951     if test $ac_cv_func_gethostbyname = no; then
9952       echo "$as_me:9952: checking for gethostbyname in -lnsl" >&5
9953 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6
9954 if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
9955   echo $ECHO_N "(cached) $ECHO_C" >&6
9956 else
9957   ac_check_lib_save_LIBS=$LIBS
9958 LIBS="-lnsl  $LIBS"
9959 cat >conftest.$ac_ext <<_ACEOF
9960 #line 9960 "configure"
9961 #include "confdefs.h"
9962
9963 /* Override any gcc2 internal prototype to avoid an error.  */
9964 #ifdef __cplusplus
9965 extern "C"
9966 #endif
9967 /* We use char because int might match the return type of a gcc2
9968    builtin and then its argument prototype would still apply.  */
9969 char gethostbyname ();
9970 int
9971 main ()
9972 {
9973 gethostbyname ();
9974   ;
9975   return 0;
9976 }
9977 _ACEOF
9978 rm -f conftest.$ac_objext conftest$ac_exeext
9979 if { (eval echo "$as_me:9979: \"$ac_link\"") >&5
9980   (eval $ac_link) 2>&5
9981   ac_status=$?
9982   echo "$as_me:9982: \$? = $ac_status" >&5
9983   (exit $ac_status); } &&
9984          { ac_try='test -s conftest$ac_exeext'
9985   { (eval echo "$as_me:9985: \"$ac_try\"") >&5
9986   (eval $ac_try) 2>&5
9987   ac_status=$?
9988   echo "$as_me:9988: \$? = $ac_status" >&5
9989   (exit $ac_status); }; }; then
9990   ac_cv_lib_nsl_gethostbyname=yes
9991 else
9992   echo "$as_me: failed program was:" >&5
9993 cat conftest.$ac_ext >&5
9994 ac_cv_lib_nsl_gethostbyname=no
9995 fi
9996 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9997 LIBS=$ac_check_lib_save_LIBS
9998 fi
9999 echo "$as_me:9999: result: $ac_cv_lib_nsl_gethostbyname" >&5
10000 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6
10001 if test $ac_cv_lib_nsl_gethostbyname = yes; then
10002   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
10003 fi
10004
10005       if test $ac_cv_lib_nsl_gethostbyname = no; then
10006         echo "$as_me:10006: checking for gethostbyname in -lbsd" >&5
10007 echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6
10008 if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then
10009   echo $ECHO_N "(cached) $ECHO_C" >&6
10010 else
10011   ac_check_lib_save_LIBS=$LIBS
10012 LIBS="-lbsd  $LIBS"
10013 cat >conftest.$ac_ext <<_ACEOF
10014 #line 10014 "configure"
10015 #include "confdefs.h"
10016
10017 /* Override any gcc2 internal prototype to avoid an error.  */
10018 #ifdef __cplusplus
10019 extern "C"
10020 #endif
10021 /* We use char because int might match the return type of a gcc2
10022    builtin and then its argument prototype would still apply.  */
10023 char gethostbyname ();
10024 int
10025 main ()
10026 {
10027 gethostbyname ();
10028   ;
10029   return 0;
10030 }
10031 _ACEOF
10032 rm -f conftest.$ac_objext conftest$ac_exeext
10033 if { (eval echo "$as_me:10033: \"$ac_link\"") >&5
10034   (eval $ac_link) 2>&5
10035   ac_status=$?
10036   echo "$as_me:10036: \$? = $ac_status" >&5
10037   (exit $ac_status); } &&
10038          { ac_try='test -s conftest$ac_exeext'
10039   { (eval echo "$as_me:10039: \"$ac_try\"") >&5
10040   (eval $ac_try) 2>&5
10041   ac_status=$?
10042   echo "$as_me:10042: \$? = $ac_status" >&5
10043   (exit $ac_status); }; }; then
10044   ac_cv_lib_bsd_gethostbyname=yes
10045 else
10046   echo "$as_me: failed program was:" >&5
10047 cat conftest.$ac_ext >&5
10048 ac_cv_lib_bsd_gethostbyname=no
10049 fi
10050 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10051 LIBS=$ac_check_lib_save_LIBS
10052 fi
10053 echo "$as_me:10053: result: $ac_cv_lib_bsd_gethostbyname" >&5
10054 echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6
10055 if test $ac_cv_lib_bsd_gethostbyname = yes; then
10056   X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
10057 fi
10058
10059       fi
10060     fi
10061
10062     # lieder@skyler.mavd.honeywell.com says without -lsocket,
10063     # socket/setsockopt and other routines are undefined under SCO ODT
10064     # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
10065     # on later versions), says Simon Leinen: it contains gethostby*
10066     # variants that don't use the nameserver (or something).  -lsocket
10067     # must be given before -lnsl if both are needed.  We assume that
10068     # if connect needs -lnsl, so does gethostbyname.
10069     echo "$as_me:10069: checking for connect" >&5
10070 echo $ECHO_N "checking for connect... $ECHO_C" >&6
10071 if test "${ac_cv_func_connect+set}" = set; then
10072   echo $ECHO_N "(cached) $ECHO_C" >&6
10073 else
10074   cat >conftest.$ac_ext <<_ACEOF
10075 #line 10075 "configure"
10076 #include "confdefs.h"
10077 /* System header to define __stub macros and hopefully few prototypes,
10078     which can conflict with char connect (); below.  */
10079 #include <assert.h>
10080 /* Override any gcc2 internal prototype to avoid an error.  */
10081 #ifdef __cplusplus
10082 extern "C"
10083 #endif
10084 /* We use char because int might match the return type of a gcc2
10085    builtin and then its argument prototype would still apply.  */
10086 char connect ();
10087 char (*f) ();
10088
10089 int
10090 main ()
10091 {
10092 /* The GNU C library defines this for functions which it implements
10093     to always fail with ENOSYS.  Some functions are actually named
10094     something starting with __ and the normal name is an alias.  */
10095 #if defined (__stub_connect) || defined (__stub___connect)
10096 choke me
10097 #else
10098 f = connect; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
10099 #endif
10100
10101   ;
10102   return 0;
10103 }
10104 _ACEOF
10105 rm -f conftest.$ac_objext conftest$ac_exeext
10106 if { (eval echo "$as_me:10106: \"$ac_link\"") >&5
10107   (eval $ac_link) 2>&5
10108   ac_status=$?
10109   echo "$as_me:10109: \$? = $ac_status" >&5
10110   (exit $ac_status); } &&
10111          { ac_try='test -s conftest$ac_exeext'
10112   { (eval echo "$as_me:10112: \"$ac_try\"") >&5
10113   (eval $ac_try) 2>&5
10114   ac_status=$?
10115   echo "$as_me:10115: \$? = $ac_status" >&5
10116   (exit $ac_status); }; }; then
10117   ac_cv_func_connect=yes
10118 else
10119   echo "$as_me: failed program was:" >&5
10120 cat conftest.$ac_ext >&5
10121 ac_cv_func_connect=no
10122 fi
10123 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10124 fi
10125 echo "$as_me:10125: result: $ac_cv_func_connect" >&5
10126 echo "${ECHO_T}$ac_cv_func_connect" >&6
10127
10128     if test $ac_cv_func_connect = no; then
10129       echo "$as_me:10129: checking for connect in -lsocket" >&5
10130 echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6
10131 if test "${ac_cv_lib_socket_connect+set}" = set; then
10132   echo $ECHO_N "(cached) $ECHO_C" >&6
10133 else
10134   ac_check_lib_save_LIBS=$LIBS
10135 LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
10136 cat >conftest.$ac_ext <<_ACEOF
10137 #line 10137 "configure"
10138 #include "confdefs.h"
10139
10140 /* Override any gcc2 internal prototype to avoid an error.  */
10141 #ifdef __cplusplus
10142 extern "C"
10143 #endif
10144 /* We use char because int might match the return type of a gcc2
10145    builtin and then its argument prototype would still apply.  */
10146 char connect ();
10147 int
10148 main ()
10149 {
10150 connect ();
10151   ;
10152   return 0;
10153 }
10154 _ACEOF
10155 rm -f conftest.$ac_objext conftest$ac_exeext
10156 if { (eval echo "$as_me:10156: \"$ac_link\"") >&5
10157   (eval $ac_link) 2>&5
10158   ac_status=$?
10159   echo "$as_me:10159: \$? = $ac_status" >&5
10160   (exit $ac_status); } &&
10161          { ac_try='test -s conftest$ac_exeext'
10162   { (eval echo "$as_me:10162: \"$ac_try\"") >&5
10163   (eval $ac_try) 2>&5
10164   ac_status=$?
10165   echo "$as_me:10165: \$? = $ac_status" >&5
10166   (exit $ac_status); }; }; then
10167   ac_cv_lib_socket_connect=yes
10168 else
10169   echo "$as_me: failed program was:" >&5
10170 cat conftest.$ac_ext >&5
10171 ac_cv_lib_socket_connect=no
10172 fi
10173 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10174 LIBS=$ac_check_lib_save_LIBS
10175 fi
10176 echo "$as_me:10176: result: $ac_cv_lib_socket_connect" >&5
10177 echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6
10178 if test $ac_cv_lib_socket_connect = yes; then
10179   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
10180 fi
10181
10182     fi
10183
10184     # Guillermo Gomez says -lposix is necessary on A/UX.
10185     echo "$as_me:10185: checking for remove" >&5
10186 echo $ECHO_N "checking for remove... $ECHO_C" >&6
10187 if test "${ac_cv_func_remove+set}" = set; then
10188   echo $ECHO_N "(cached) $ECHO_C" >&6
10189 else
10190   cat >conftest.$ac_ext <<_ACEOF
10191 #line 10191 "configure"
10192 #include "confdefs.h"
10193 /* System header to define __stub macros and hopefully few prototypes,
10194     which can conflict with char remove (); below.  */
10195 #include <assert.h>
10196 /* Override any gcc2 internal prototype to avoid an error.  */
10197 #ifdef __cplusplus
10198 extern "C"
10199 #endif
10200 /* We use char because int might match the return type of a gcc2
10201    builtin and then its argument prototype would still apply.  */
10202 char remove ();
10203 char (*f) ();
10204
10205 int
10206 main ()
10207 {
10208 /* The GNU C library defines this for functions which it implements
10209     to always fail with ENOSYS.  Some functions are actually named
10210     something starting with __ and the normal name is an alias.  */
10211 #if defined (__stub_remove) || defined (__stub___remove)
10212 choke me
10213 #else
10214 f = remove; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
10215 #endif
10216
10217   ;
10218   return 0;
10219 }
10220 _ACEOF
10221 rm -f conftest.$ac_objext conftest$ac_exeext
10222 if { (eval echo "$as_me:10222: \"$ac_link\"") >&5
10223   (eval $ac_link) 2>&5
10224   ac_status=$?
10225   echo "$as_me:10225: \$? = $ac_status" >&5
10226   (exit $ac_status); } &&
10227          { ac_try='test -s conftest$ac_exeext'
10228   { (eval echo "$as_me:10228: \"$ac_try\"") >&5
10229   (eval $ac_try) 2>&5
10230   ac_status=$?
10231   echo "$as_me:10231: \$? = $ac_status" >&5
10232   (exit $ac_status); }; }; then
10233   ac_cv_func_remove=yes
10234 else
10235   echo "$as_me: failed program was:" >&5
10236 cat conftest.$ac_ext >&5
10237 ac_cv_func_remove=no
10238 fi
10239 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10240 fi
10241 echo "$as_me:10241: result: $ac_cv_func_remove" >&5
10242 echo "${ECHO_T}$ac_cv_func_remove" >&6
10243
10244     if test $ac_cv_func_remove = no; then
10245       echo "$as_me:10245: checking for remove in -lposix" >&5
10246 echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6
10247 if test "${ac_cv_lib_posix_remove+set}" = set; then
10248   echo $ECHO_N "(cached) $ECHO_C" >&6
10249 else
10250   ac_check_lib_save_LIBS=$LIBS
10251 LIBS="-lposix  $LIBS"
10252 cat >conftest.$ac_ext <<_ACEOF
10253 #line 10253 "configure"
10254 #include "confdefs.h"
10255
10256 /* Override any gcc2 internal prototype to avoid an error.  */
10257 #ifdef __cplusplus
10258 extern "C"
10259 #endif
10260 /* We use char because int might match the return type of a gcc2
10261    builtin and then its argument prototype would still apply.  */
10262 char remove ();
10263 int
10264 main ()
10265 {
10266 remove ();
10267   ;
10268   return 0;
10269 }
10270 _ACEOF
10271 rm -f conftest.$ac_objext conftest$ac_exeext
10272 if { (eval echo "$as_me:10272: \"$ac_link\"") >&5
10273   (eval $ac_link) 2>&5
10274   ac_status=$?
10275   echo "$as_me:10275: \$? = $ac_status" >&5
10276   (exit $ac_status); } &&
10277          { ac_try='test -s conftest$ac_exeext'
10278   { (eval echo "$as_me:10278: \"$ac_try\"") >&5
10279   (eval $ac_try) 2>&5
10280   ac_status=$?
10281   echo "$as_me:10281: \$? = $ac_status" >&5
10282   (exit $ac_status); }; }; then
10283   ac_cv_lib_posix_remove=yes
10284 else
10285   echo "$as_me: failed program was:" >&5
10286 cat conftest.$ac_ext >&5
10287 ac_cv_lib_posix_remove=no
10288 fi
10289 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10290 LIBS=$ac_check_lib_save_LIBS
10291 fi
10292 echo "$as_me:10292: result: $ac_cv_lib_posix_remove" >&5
10293 echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6
10294 if test $ac_cv_lib_posix_remove = yes; then
10295   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
10296 fi
10297
10298     fi
10299
10300     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
10301     echo "$as_me:10301: checking for shmat" >&5
10302 echo $ECHO_N "checking for shmat... $ECHO_C" >&6
10303 if test "${ac_cv_func_shmat+set}" = set; then
10304   echo $ECHO_N "(cached) $ECHO_C" >&6
10305 else
10306   cat >conftest.$ac_ext <<_ACEOF
10307 #line 10307 "configure"
10308 #include "confdefs.h"
10309 /* System header to define __stub macros and hopefully few prototypes,
10310     which can conflict with char shmat (); below.  */
10311 #include <assert.h>
10312 /* Override any gcc2 internal prototype to avoid an error.  */
10313 #ifdef __cplusplus
10314 extern "C"
10315 #endif
10316 /* We use char because int might match the return type of a gcc2
10317    builtin and then its argument prototype would still apply.  */
10318 char shmat ();
10319 char (*f) ();
10320
10321 int
10322 main ()
10323 {
10324 /* The GNU C library defines this for functions which it implements
10325     to always fail with ENOSYS.  Some functions are actually named
10326     something starting with __ and the normal name is an alias.  */
10327 #if defined (__stub_shmat) || defined (__stub___shmat)
10328 choke me
10329 #else
10330 f = shmat; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
10331 #endif
10332
10333   ;
10334   return 0;
10335 }
10336 _ACEOF
10337 rm -f conftest.$ac_objext conftest$ac_exeext
10338 if { (eval echo "$as_me:10338: \"$ac_link\"") >&5
10339   (eval $ac_link) 2>&5
10340   ac_status=$?
10341   echo "$as_me:10341: \$? = $ac_status" >&5
10342   (exit $ac_status); } &&
10343          { ac_try='test -s conftest$ac_exeext'
10344   { (eval echo "$as_me:10344: \"$ac_try\"") >&5
10345   (eval $ac_try) 2>&5
10346   ac_status=$?
10347   echo "$as_me:10347: \$? = $ac_status" >&5
10348   (exit $ac_status); }; }; then
10349   ac_cv_func_shmat=yes
10350 else
10351   echo "$as_me: failed program was:" >&5
10352 cat conftest.$ac_ext >&5
10353 ac_cv_func_shmat=no
10354 fi
10355 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10356 fi
10357 echo "$as_me:10357: result: $ac_cv_func_shmat" >&5
10358 echo "${ECHO_T}$ac_cv_func_shmat" >&6
10359
10360     if test $ac_cv_func_shmat = no; then
10361       echo "$as_me:10361: checking for shmat in -lipc" >&5
10362 echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6
10363 if test "${ac_cv_lib_ipc_shmat+set}" = set; then
10364   echo $ECHO_N "(cached) $ECHO_C" >&6
10365 else
10366   ac_check_lib_save_LIBS=$LIBS
10367 LIBS="-lipc  $LIBS"
10368 cat >conftest.$ac_ext <<_ACEOF
10369 #line 10369 "configure"
10370 #include "confdefs.h"
10371
10372 /* Override any gcc2 internal prototype to avoid an error.  */
10373 #ifdef __cplusplus
10374 extern "C"
10375 #endif
10376 /* We use char because int might match the return type of a gcc2
10377    builtin and then its argument prototype would still apply.  */
10378 char shmat ();
10379 int
10380 main ()
10381 {
10382 shmat ();
10383   ;
10384   return 0;
10385 }
10386 _ACEOF
10387 rm -f conftest.$ac_objext conftest$ac_exeext
10388 if { (eval echo "$as_me:10388: \"$ac_link\"") >&5
10389   (eval $ac_link) 2>&5
10390   ac_status=$?
10391   echo "$as_me:10391: \$? = $ac_status" >&5
10392   (exit $ac_status); } &&
10393          { ac_try='test -s conftest$ac_exeext'
10394   { (eval echo "$as_me:10394: \"$ac_try\"") >&5
10395   (eval $ac_try) 2>&5
10396   ac_status=$?
10397   echo "$as_me:10397: \$? = $ac_status" >&5
10398   (exit $ac_status); }; }; then
10399   ac_cv_lib_ipc_shmat=yes
10400 else
10401   echo "$as_me: failed program was:" >&5
10402 cat conftest.$ac_ext >&5
10403 ac_cv_lib_ipc_shmat=no
10404 fi
10405 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10406 LIBS=$ac_check_lib_save_LIBS
10407 fi
10408 echo "$as_me:10408: result: $ac_cv_lib_ipc_shmat" >&5
10409 echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6
10410 if test $ac_cv_lib_ipc_shmat = yes; then
10411   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
10412 fi
10413
10414     fi
10415   fi
10416
10417   # Check for libraries that X11R6 Xt/Xaw programs need.
10418   ac_save_LDFLAGS=$LDFLAGS
10419   test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
10420   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
10421   # check for ICE first), but we must link in the order -lSM -lICE or
10422   # we get undefined symbols.  So assume we have SM if we have ICE.
10423   # These have to be linked with before -lX11, unlike the other
10424   # libraries we check for below, so use a different variable.
10425   # John Interrante, Karl Berry
10426   echo "$as_me:10426: checking for IceConnectionNumber in -lICE" >&5
10427 echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6
10428 if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then
10429   echo $ECHO_N "(cached) $ECHO_C" >&6
10430 else
10431   ac_check_lib_save_LIBS=$LIBS
10432 LIBS="-lICE $X_EXTRA_LIBS $LIBS"
10433 cat >conftest.$ac_ext <<_ACEOF
10434 #line 10434 "configure"
10435 #include "confdefs.h"
10436
10437 /* Override any gcc2 internal prototype to avoid an error.  */
10438 #ifdef __cplusplus
10439 extern "C"
10440 #endif
10441 /* We use char because int might match the return type of a gcc2
10442    builtin and then its argument prototype would still apply.  */
10443 char IceConnectionNumber ();
10444 int
10445 main ()
10446 {
10447 IceConnectionNumber ();
10448   ;
10449   return 0;
10450 }
10451 _ACEOF
10452 rm -f conftest.$ac_objext conftest$ac_exeext
10453 if { (eval echo "$as_me:10453: \"$ac_link\"") >&5
10454   (eval $ac_link) 2>&5
10455   ac_status=$?
10456   echo "$as_me:10456: \$? = $ac_status" >&5
10457   (exit $ac_status); } &&
10458          { ac_try='test -s conftest$ac_exeext'
10459   { (eval echo "$as_me:10459: \"$ac_try\"") >&5
10460   (eval $ac_try) 2>&5
10461   ac_status=$?
10462   echo "$as_me:10462: \$? = $ac_status" >&5
10463   (exit $ac_status); }; }; then
10464   ac_cv_lib_ICE_IceConnectionNumber=yes
10465 else
10466   echo "$as_me: failed program was:" >&5
10467 cat conftest.$ac_ext >&5
10468 ac_cv_lib_ICE_IceConnectionNumber=no
10469 fi
10470 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10471 LIBS=$ac_check_lib_save_LIBS
10472 fi
10473 echo "$as_me:10473: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
10474 echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6
10475 if test $ac_cv_lib_ICE_IceConnectionNumber = yes; then
10476   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
10477 fi
10478
10479   LDFLAGS=$ac_save_LDFLAGS
10480
10481 fi
10482
10483 cf_x_athena=${cf_x_athena:-Xaw}
10484
10485 echo "$as_me:10485: checking if you want to link with Xaw 3d library" >&5
10486 echo $ECHO_N "checking if you want to link with Xaw 3d library... $ECHO_C" >&6
10487 withval=
10488
10489 # Check whether --with-Xaw3d or --without-Xaw3d was given.
10490 if test "${with_Xaw3d+set}" = set; then
10491   withval="$with_Xaw3d"
10492
10493 fi;
10494 if test "$withval" = yes ; then
10495         cf_x_athena=Xaw3d
10496         echo "$as_me:10496: result: yes" >&5
10497 echo "${ECHO_T}yes" >&6
10498 else
10499         echo "$as_me:10499: result: no" >&5
10500 echo "${ECHO_T}no" >&6
10501 fi
10502
10503 echo "$as_me:10503: checking if you want to link with Xaw 3d xft library" >&5
10504 echo $ECHO_N "checking if you want to link with Xaw 3d xft library... $ECHO_C" >&6
10505 withval=
10506
10507 # Check whether --with-Xaw3dxft or --without-Xaw3dxft was given.
10508 if test "${with_Xaw3dxft+set}" = set; then
10509   withval="$with_Xaw3dxft"
10510
10511 fi;
10512 if test "$withval" = yes ; then
10513         cf_x_athena=Xaw3dxft
10514         echo "$as_me:10514: result: yes" >&5
10515 echo "${ECHO_T}yes" >&6
10516 else
10517         echo "$as_me:10517: result: no" >&5
10518 echo "${ECHO_T}no" >&6
10519 fi
10520
10521 echo "$as_me:10521: checking if you want to link with neXT Athena library" >&5
10522 echo $ECHO_N "checking if you want to link with neXT Athena library... $ECHO_C" >&6
10523 withval=
10524
10525 # Check whether --with-neXtaw or --without-neXtaw was given.
10526 if test "${with_neXtaw+set}" = set; then
10527   withval="$with_neXtaw"
10528
10529 fi;
10530 if test "$withval" = yes ; then
10531         cf_x_athena=neXtaw
10532         echo "$as_me:10532: result: yes" >&5
10533 echo "${ECHO_T}yes" >&6
10534 else
10535         echo "$as_me:10535: result: no" >&5
10536 echo "${ECHO_T}no" >&6
10537 fi
10538
10539 echo "$as_me:10539: checking if you want to link with Athena-Plus library" >&5
10540 echo $ECHO_N "checking if you want to link with Athena-Plus library... $ECHO_C" >&6
10541 withval=
10542
10543 # Check whether --with-XawPlus or --without-XawPlus was given.
10544 if test "${with_XawPlus+set}" = set; then
10545   withval="$with_XawPlus"
10546
10547 fi;
10548 if test "$withval" = yes ; then
10549         cf_x_athena=XawPlus
10550         echo "$as_me:10550: result: yes" >&5
10551 echo "${ECHO_T}yes" >&6
10552 else
10553         echo "$as_me:10553: result: no" >&5
10554 echo "${ECHO_T}no" >&6
10555 fi
10556
10557 cf_x_athena_lib=""
10558
10559 if test "$PKG_CONFIG" != none ; then
10560         cf_athena_list=
10561         test "$cf_x_athena" = Xaw && cf_athena_list="xaw8 xaw7 xaw6"
10562         for cf_athena_pkg in \
10563                 $cf_athena_list \
10564                 ${cf_x_athena} \
10565                 ${cf_x_athena}-devel \
10566                 lib${cf_x_athena} \
10567                 lib${cf_x_athena}-devel
10568         do
10569
10570 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists $cf_athena_pkg; then
10571         test -n "$verbose" && echo "    found package $cf_athena_pkg" 1>&6
10572
10573 echo "${as_me:-configure}:10573: testing found package $cf_athena_pkg ..." 1>&5
10574
10575         cf_pkgconfig_incs="`$PKG_CONFIG --cflags $cf_athena_pkg 2>/dev/null`"
10576         cf_pkgconfig_libs="`$PKG_CONFIG --libs   $cf_athena_pkg 2>/dev/null`"
10577         test -n "$verbose" && echo "    package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs" 1>&6
10578
10579 echo "${as_me:-configure}:10579: testing package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs ..." 1>&5
10580
10581         test -n "$verbose" && echo "    package $cf_athena_pkg LIBS: $cf_pkgconfig_libs" 1>&6
10582
10583 echo "${as_me:-configure}:10583: testing package $cf_athena_pkg LIBS: $cf_pkgconfig_libs ..." 1>&5
10584
10585 cf_fix_cppflags=no
10586 cf_new_cflags=
10587 cf_new_cppflags=
10588 cf_new_extra_cppflags=
10589
10590 for cf_add_cflags in $cf_pkgconfig_incs
10591 do
10592 case $cf_fix_cppflags in
10593 (no)
10594         case $cf_add_cflags in
10595         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10596                 case $cf_add_cflags in
10597                 (-D*)
10598                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10599
10600                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10601                                 && test -z "${cf_tst_cflags}" \
10602                                 && cf_fix_cppflags=yes
10603
10604                         if test $cf_fix_cppflags = yes ; then
10605                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10606                                 continue
10607                         elif test "${cf_tst_cflags}" = "\"'" ; then
10608                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10609                                 continue
10610                         fi
10611                         ;;
10612                 esac
10613                 case "$CPPFLAGS" in
10614                 (*$cf_add_cflags)
10615                         ;;
10616                 (*)
10617                         case $cf_add_cflags in
10618                         (-D*)
10619                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10620
10621 CPPFLAGS=`echo "$CPPFLAGS" | \
10622         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10623                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10624
10625                                 ;;
10626                         esac
10627                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10628                         ;;
10629                 esac
10630                 ;;
10631         (*)
10632                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10633                 ;;
10634         esac
10635         ;;
10636 (yes)
10637         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10638
10639         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10640
10641         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10642                 && test -z "${cf_tst_cflags}" \
10643                 && cf_fix_cppflags=no
10644         ;;
10645 esac
10646 done
10647
10648 if test -n "$cf_new_cflags" ; then
10649
10650         CFLAGS="$CFLAGS $cf_new_cflags"
10651 fi
10652
10653 if test -n "$cf_new_cppflags" ; then
10654
10655         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10656 fi
10657
10658 if test -n "$cf_new_extra_cppflags" ; then
10659
10660         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10661 fi
10662
10663 cf_add_libs="$cf_pkgconfig_libs"
10664 # Filter out duplicates - this happens with badly-designed ".pc" files...
10665 for cf_add_1lib in $LIBS
10666 do
10667         for cf_add_2lib in $cf_add_libs
10668         do
10669                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
10670                 then
10671                         cf_add_1lib=
10672                         break
10673                 fi
10674         done
10675         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
10676 done
10677 LIBS="$cf_add_libs"
10678
10679                         cf_x_athena_lib="$cf_pkgconfig_libs"
10680
10681 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
10682
10683                         cat >>confdefs.h <<EOF
10684 #define $cf_x_athena_LIBS 1
10685 EOF
10686
10687         for cf_trim_lib in Xmu Xt X11
10688         do
10689                 case "$LIBS" in
10690                 (*-l$cf_trim_lib\ *-l$cf_trim_lib*)
10691                         LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
10692                         test -n "$verbose" && echo "    ..trimmed $LIBS" 1>&6
10693
10694 echo "${as_me:-configure}:10694: testing ..trimmed $LIBS ..." 1>&5
10695
10696                         ;;
10697                 esac
10698         done
10699
10700 echo "$as_me:10700: checking for usable $cf_x_athena/Xmu package" >&5
10701 echo $ECHO_N "checking for usable $cf_x_athena/Xmu package... $ECHO_C" >&6
10702 if test "${cf_cv_xaw_compat+set}" = set; then
10703   echo $ECHO_N "(cached) $ECHO_C" >&6
10704 else
10705
10706 cat >conftest.$ac_ext <<_ACEOF
10707 #line 10707 "configure"
10708 #include "confdefs.h"
10709
10710 #include <X11/Xmu/CharSet.h>
10711
10712 int
10713 main ()
10714 {
10715
10716 int check = XmuCompareISOLatin1("big", "small")
10717
10718   ;
10719   return 0;
10720 }
10721 _ACEOF
10722 rm -f conftest.$ac_objext conftest$ac_exeext
10723 if { (eval echo "$as_me:10723: \"$ac_link\"") >&5
10724   (eval $ac_link) 2>&5
10725   ac_status=$?
10726   echo "$as_me:10726: \$? = $ac_status" >&5
10727   (exit $ac_status); } &&
10728          { ac_try='test -s conftest$ac_exeext'
10729   { (eval echo "$as_me:10729: \"$ac_try\"") >&5
10730   (eval $ac_try) 2>&5
10731   ac_status=$?
10732   echo "$as_me:10732: \$? = $ac_status" >&5
10733   (exit $ac_status); }; }; then
10734   cf_cv_xaw_compat=yes
10735 else
10736   echo "$as_me: failed program was:" >&5
10737 cat conftest.$ac_ext >&5
10738 cf_cv_xaw_compat=no
10739 fi
10740 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10741 fi
10742 echo "$as_me:10742: result: $cf_cv_xaw_compat" >&5
10743 echo "${ECHO_T}$cf_cv_xaw_compat" >&6
10744
10745                         if test "$cf_cv_xaw_compat" = no
10746                         then
10747                                 # workaround for broken ".pc" files...
10748                                 case "$cf_x_athena_lib" in
10749                                 (*-lXmu*)
10750                                         ;;
10751                                 (*)
10752                                         test -n "$verbose" && echo "    work around broken package" 1>&6
10753
10754 echo "${as_me:-configure}:10754: testing work around broken package ..." 1>&5
10755
10756                                         cf_save_xmu="$LIBS"
10757                                         cf_first_lib=`echo "$cf_save_xmu" | sed -e 's/^  *//' -e 's/ .*//'`
10758
10759 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xmu; then
10760         test -n "$verbose" && echo "    found package xmu" 1>&6
10761
10762 echo "${as_me:-configure}:10762: testing found package xmu ..." 1>&5
10763
10764         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xmu 2>/dev/null`"
10765         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xmu 2>/dev/null`"
10766         test -n "$verbose" && echo "    package xmu CFLAGS: $cf_pkgconfig_incs" 1>&6
10767
10768 echo "${as_me:-configure}:10768: testing package xmu CFLAGS: $cf_pkgconfig_incs ..." 1>&5
10769
10770         test -n "$verbose" && echo "    package xmu LIBS: $cf_pkgconfig_libs" 1>&6
10771
10772 echo "${as_me:-configure}:10772: testing package xmu LIBS: $cf_pkgconfig_libs ..." 1>&5
10773
10774 cf_fix_cppflags=no
10775 cf_new_cflags=
10776 cf_new_cppflags=
10777 cf_new_extra_cppflags=
10778
10779 for cf_add_cflags in $cf_pkgconfig_incs
10780 do
10781 case $cf_fix_cppflags in
10782 (no)
10783         case $cf_add_cflags in
10784         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10785                 case $cf_add_cflags in
10786                 (-D*)
10787                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10788
10789                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10790                                 && test -z "${cf_tst_cflags}" \
10791                                 && cf_fix_cppflags=yes
10792
10793                         if test $cf_fix_cppflags = yes ; then
10794                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10795                                 continue
10796                         elif test "${cf_tst_cflags}" = "\"'" ; then
10797                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10798                                 continue
10799                         fi
10800                         ;;
10801                 esac
10802                 case "$CPPFLAGS" in
10803                 (*$cf_add_cflags)
10804                         ;;
10805                 (*)
10806                         case $cf_add_cflags in
10807                         (-D*)
10808                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10809
10810 CPPFLAGS=`echo "$CPPFLAGS" | \
10811         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10812                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10813
10814                                 ;;
10815                         esac
10816                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10817                         ;;
10818                 esac
10819                 ;;
10820         (*)
10821                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10822                 ;;
10823         esac
10824         ;;
10825 (yes)
10826         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10827
10828         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10829
10830         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10831                 && test -z "${cf_tst_cflags}" \
10832                 && cf_fix_cppflags=no
10833         ;;
10834 esac
10835 done
10836
10837 if test -n "$cf_new_cflags" ; then
10838
10839         CFLAGS="$CFLAGS $cf_new_cflags"
10840 fi
10841
10842 if test -n "$cf_new_cppflags" ; then
10843
10844         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10845 fi
10846
10847 if test -n "$cf_new_extra_cppflags" ; then
10848
10849         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10850 fi
10851
10852 cf_add_libs="$cf_pkgconfig_libs"
10853 # Filter out duplicates - this happens with badly-designed ".pc" files...
10854 for cf_add_1lib in $LIBS
10855 do
10856         for cf_add_2lib in $cf_add_libs
10857         do
10858                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
10859                 then
10860                         cf_add_1lib=
10861                         break
10862                 fi
10863         done
10864         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
10865 done
10866 LIBS="$cf_add_libs"
10867
10868                                                         LIBS="$cf_save_xmu"
10869
10870 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
10871
10872 echo "${as_me:-configure}:10872: testing ...before $LIBS ..." 1>&5
10873
10874 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib $cf_pkgconfig_libs %" -e 's%  % %g'`
10875 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
10876
10877 echo "${as_me:-configure}:10877: testing ...after  $LIBS ..." 1>&5
10878
10879 else
10880         cf_pkgconfig_incs=
10881         cf_pkgconfig_libs=
10882
10883 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
10884
10885 echo "${as_me:-configure}:10885: testing ...before $LIBS ..." 1>&5
10886
10887 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib -lXmu %" -e 's%  % %g'`
10888 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
10889
10890 echo "${as_me:-configure}:10890: testing ...after  $LIBS ..." 1>&5
10891
10892 fi
10893
10894         for cf_trim_lib in Xmu Xt X11
10895         do
10896                 case "$LIBS" in
10897                 (*-l$cf_trim_lib\ *-l$cf_trim_lib*)
10898                         LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
10899                         test -n "$verbose" && echo "    ..trimmed $LIBS" 1>&6
10900
10901 echo "${as_me:-configure}:10901: testing ..trimmed $LIBS ..." 1>&5
10902
10903                         ;;
10904                 esac
10905         done
10906
10907                                         ;;
10908                                 esac
10909                         fi
10910
10911                         break
10912 else
10913         cf_pkgconfig_incs=
10914         cf_pkgconfig_libs=
10915         :
10916 fi
10917
10918         done
10919 fi
10920
10921 if test -z "$cf_x_athena_lib" ; then
10922
10923 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists Xext; then
10924         test -n "$verbose" && echo "    found package Xext" 1>&6
10925
10926 echo "${as_me:-configure}:10926: testing found package Xext ..." 1>&5
10927
10928         cf_pkgconfig_incs="`$PKG_CONFIG --cflags Xext 2>/dev/null`"
10929         cf_pkgconfig_libs="`$PKG_CONFIG --libs   Xext 2>/dev/null`"
10930         test -n "$verbose" && echo "    package Xext CFLAGS: $cf_pkgconfig_incs" 1>&6
10931
10932 echo "${as_me:-configure}:10932: testing package Xext CFLAGS: $cf_pkgconfig_incs ..." 1>&5
10933
10934         test -n "$verbose" && echo "    package Xext LIBS: $cf_pkgconfig_libs" 1>&6
10935
10936 echo "${as_me:-configure}:10936: testing package Xext LIBS: $cf_pkgconfig_libs ..." 1>&5
10937
10938 cf_fix_cppflags=no
10939 cf_new_cflags=
10940 cf_new_cppflags=
10941 cf_new_extra_cppflags=
10942
10943 for cf_add_cflags in $cf_pkgconfig_incs
10944 do
10945 case $cf_fix_cppflags in
10946 (no)
10947         case $cf_add_cflags in
10948         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10949                 case $cf_add_cflags in
10950                 (-D*)
10951                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10952
10953                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10954                                 && test -z "${cf_tst_cflags}" \
10955                                 && cf_fix_cppflags=yes
10956
10957                         if test $cf_fix_cppflags = yes ; then
10958                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10959                                 continue
10960                         elif test "${cf_tst_cflags}" = "\"'" ; then
10961                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10962                                 continue
10963                         fi
10964                         ;;
10965                 esac
10966                 case "$CPPFLAGS" in
10967                 (*$cf_add_cflags)
10968                         ;;
10969                 (*)
10970                         case $cf_add_cflags in
10971                         (-D*)
10972                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10973
10974 CPPFLAGS=`echo "$CPPFLAGS" | \
10975         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10976                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10977
10978                                 ;;
10979                         esac
10980                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10981                         ;;
10982                 esac
10983                 ;;
10984         (*)
10985                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10986                 ;;
10987         esac
10988         ;;
10989 (yes)
10990         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10991
10992         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10993
10994         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10995                 && test -z "${cf_tst_cflags}" \
10996                 && cf_fix_cppflags=no
10997         ;;
10998 esac
10999 done
11000
11001 if test -n "$cf_new_cflags" ; then
11002
11003         CFLAGS="$CFLAGS $cf_new_cflags"
11004 fi
11005
11006 if test -n "$cf_new_cppflags" ; then
11007
11008         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11009 fi
11010
11011 if test -n "$cf_new_extra_cppflags" ; then
11012
11013         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11014 fi
11015
11016 cf_add_libs="$cf_pkgconfig_libs"
11017 # Filter out duplicates - this happens with badly-designed ".pc" files...
11018 for cf_add_1lib in $LIBS
11019 do
11020         for cf_add_2lib in $cf_add_libs
11021         do
11022                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11023                 then
11024                         cf_add_1lib=
11025                         break
11026                 fi
11027         done
11028         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11029 done
11030 LIBS="$cf_add_libs"
11031
11032         :
11033 else
11034         cf_pkgconfig_incs=
11035         cf_pkgconfig_libs=
11036
11037         echo "$as_me:11037: checking for XextCreateExtension in -lXext" >&5
11038 echo $ECHO_N "checking for XextCreateExtension in -lXext... $ECHO_C" >&6
11039 if test "${ac_cv_lib_Xext_XextCreateExtension+set}" = set; then
11040   echo $ECHO_N "(cached) $ECHO_C" >&6
11041 else
11042   ac_check_lib_save_LIBS=$LIBS
11043 LIBS="-lXext  $LIBS"
11044 cat >conftest.$ac_ext <<_ACEOF
11045 #line 11045 "configure"
11046 #include "confdefs.h"
11047
11048 /* Override any gcc2 internal prototype to avoid an error.  */
11049 #ifdef __cplusplus
11050 extern "C"
11051 #endif
11052 /* We use char because int might match the return type of a gcc2
11053    builtin and then its argument prototype would still apply.  */
11054 char XextCreateExtension ();
11055 int
11056 main ()
11057 {
11058 XextCreateExtension ();
11059   ;
11060   return 0;
11061 }
11062 _ACEOF
11063 rm -f conftest.$ac_objext conftest$ac_exeext
11064 if { (eval echo "$as_me:11064: \"$ac_link\"") >&5
11065   (eval $ac_link) 2>&5
11066   ac_status=$?
11067   echo "$as_me:11067: \$? = $ac_status" >&5
11068   (exit $ac_status); } &&
11069          { ac_try='test -s conftest$ac_exeext'
11070   { (eval echo "$as_me:11070: \"$ac_try\"") >&5
11071   (eval $ac_try) 2>&5
11072   ac_status=$?
11073   echo "$as_me:11073: \$? = $ac_status" >&5
11074   (exit $ac_status); }; }; then
11075   ac_cv_lib_Xext_XextCreateExtension=yes
11076 else
11077   echo "$as_me: failed program was:" >&5
11078 cat conftest.$ac_ext >&5
11079 ac_cv_lib_Xext_XextCreateExtension=no
11080 fi
11081 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11082 LIBS=$ac_check_lib_save_LIBS
11083 fi
11084 echo "$as_me:11084: result: $ac_cv_lib_Xext_XextCreateExtension" >&5
11085 echo "${ECHO_T}$ac_cv_lib_Xext_XextCreateExtension" >&6
11086 if test $ac_cv_lib_Xext_XextCreateExtension = yes; then
11087
11088 cf_add_libs="-lXext"
11089 # Filter out duplicates - this happens with badly-designed ".pc" files...
11090 for cf_add_1lib in $LIBS
11091 do
11092         for cf_add_2lib in $cf_add_libs
11093         do
11094                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11095                 then
11096                         cf_add_1lib=
11097                         break
11098                 fi
11099         done
11100         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11101 done
11102 LIBS="$cf_add_libs"
11103
11104 fi
11105
11106 fi
11107
11108 # OSX is schizoid about who owns /usr/X11 (old) versus /opt/X11 (new), and (and
11109 # in some cases has installed dummy files in the former, other cases replaced
11110 # it with a link to the new location).  This complicates the configure script.
11111 # Check for that pitfall, and recover using pkg-config
11112 #
11113 # If none of these are set, the configuration is almost certainly broken.
11114 if test -z "${X_CFLAGS}${X_PRE_LIBS}${X_LIBS}${X_EXTRA_LIBS}"
11115 then
11116
11117 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists x11; then
11118         test -n "$verbose" && echo "    found package x11" 1>&6
11119
11120 echo "${as_me:-configure}:11120: testing found package x11 ..." 1>&5
11121
11122         cf_pkgconfig_incs="`$PKG_CONFIG --cflags x11 2>/dev/null`"
11123         cf_pkgconfig_libs="`$PKG_CONFIG --libs   x11 2>/dev/null`"
11124         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
11125
11126 echo "${as_me:-configure}:11126: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11127
11128         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
11129
11130 echo "${as_me:-configure}:11130: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
11131
11132 cf_fix_cppflags=no
11133 cf_new_cflags=
11134 cf_new_cppflags=
11135 cf_new_extra_cppflags=
11136
11137 for cf_add_cflags in $cf_pkgconfig_incs
11138 do
11139 case $cf_fix_cppflags in
11140 (no)
11141         case $cf_add_cflags in
11142         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11143                 case $cf_add_cflags in
11144                 (-D*)
11145                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11146
11147                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11148                                 && test -z "${cf_tst_cflags}" \
11149                                 && cf_fix_cppflags=yes
11150
11151                         if test $cf_fix_cppflags = yes ; then
11152                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11153                                 continue
11154                         elif test "${cf_tst_cflags}" = "\"'" ; then
11155                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11156                                 continue
11157                         fi
11158                         ;;
11159                 esac
11160                 case "$CPPFLAGS" in
11161                 (*$cf_add_cflags)
11162                         ;;
11163                 (*)
11164                         case $cf_add_cflags in
11165                         (-D*)
11166                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11167
11168 CPPFLAGS=`echo "$CPPFLAGS" | \
11169         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11170                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11171
11172                                 ;;
11173                         esac
11174                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11175                         ;;
11176                 esac
11177                 ;;
11178         (*)
11179                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11180                 ;;
11181         esac
11182         ;;
11183 (yes)
11184         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11185
11186         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11187
11188         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11189                 && test -z "${cf_tst_cflags}" \
11190                 && cf_fix_cppflags=no
11191         ;;
11192 esac
11193 done
11194
11195 if test -n "$cf_new_cflags" ; then
11196
11197         CFLAGS="$CFLAGS $cf_new_cflags"
11198 fi
11199
11200 if test -n "$cf_new_cppflags" ; then
11201
11202         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11203 fi
11204
11205 if test -n "$cf_new_extra_cppflags" ; then
11206
11207         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11208 fi
11209
11210 cf_add_libs="$cf_pkgconfig_libs"
11211 # Filter out duplicates - this happens with badly-designed ".pc" files...
11212 for cf_add_1lib in $LIBS
11213 do
11214         for cf_add_2lib in $cf_add_libs
11215         do
11216                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11217                 then
11218                         cf_add_1lib=
11219                         break
11220                 fi
11221         done
11222         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11223 done
11224 LIBS="$cf_add_libs"
11225
11226         :
11227 else
11228         cf_pkgconfig_incs=
11229         cf_pkgconfig_libs=
11230         { echo "$as_me:11230: WARNING: unable to find X11 library" >&5
11231 echo "$as_me: WARNING: unable to find X11 library" >&2;}
11232 fi
11233
11234 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists ice; then
11235         test -n "$verbose" && echo "    found package ice" 1>&6
11236
11237 echo "${as_me:-configure}:11237: testing found package ice ..." 1>&5
11238
11239         cf_pkgconfig_incs="`$PKG_CONFIG --cflags ice 2>/dev/null`"
11240         cf_pkgconfig_libs="`$PKG_CONFIG --libs   ice 2>/dev/null`"
11241         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
11242
11243 echo "${as_me:-configure}:11243: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11244
11245         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
11246
11247 echo "${as_me:-configure}:11247: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
11248
11249 cf_fix_cppflags=no
11250 cf_new_cflags=
11251 cf_new_cppflags=
11252 cf_new_extra_cppflags=
11253
11254 for cf_add_cflags in $cf_pkgconfig_incs
11255 do
11256 case $cf_fix_cppflags in
11257 (no)
11258         case $cf_add_cflags in
11259         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11260                 case $cf_add_cflags in
11261                 (-D*)
11262                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11263
11264                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11265                                 && test -z "${cf_tst_cflags}" \
11266                                 && cf_fix_cppflags=yes
11267
11268                         if test $cf_fix_cppflags = yes ; then
11269                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11270                                 continue
11271                         elif test "${cf_tst_cflags}" = "\"'" ; then
11272                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11273                                 continue
11274                         fi
11275                         ;;
11276                 esac
11277                 case "$CPPFLAGS" in
11278                 (*$cf_add_cflags)
11279                         ;;
11280                 (*)
11281                         case $cf_add_cflags in
11282                         (-D*)
11283                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11284
11285 CPPFLAGS=`echo "$CPPFLAGS" | \
11286         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11287                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11288
11289                                 ;;
11290                         esac
11291                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11292                         ;;
11293                 esac
11294                 ;;
11295         (*)
11296                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11297                 ;;
11298         esac
11299         ;;
11300 (yes)
11301         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11302
11303         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11304
11305         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11306                 && test -z "${cf_tst_cflags}" \
11307                 && cf_fix_cppflags=no
11308         ;;
11309 esac
11310 done
11311
11312 if test -n "$cf_new_cflags" ; then
11313
11314         CFLAGS="$CFLAGS $cf_new_cflags"
11315 fi
11316
11317 if test -n "$cf_new_cppflags" ; then
11318
11319         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11320 fi
11321
11322 if test -n "$cf_new_extra_cppflags" ; then
11323
11324         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11325 fi
11326
11327 cf_add_libs="$cf_pkgconfig_libs"
11328 # Filter out duplicates - this happens with badly-designed ".pc" files...
11329 for cf_add_1lib in $LIBS
11330 do
11331         for cf_add_2lib in $cf_add_libs
11332         do
11333                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11334                 then
11335                         cf_add_1lib=
11336                         break
11337                 fi
11338         done
11339         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11340 done
11341 LIBS="$cf_add_libs"
11342
11343         :
11344 else
11345         cf_pkgconfig_incs=
11346         cf_pkgconfig_libs=
11347         { echo "$as_me:11347: WARNING: unable to find ICE library" >&5
11348 echo "$as_me: WARNING: unable to find ICE library" >&2;}
11349 fi
11350
11351 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists sm; then
11352         test -n "$verbose" && echo "    found package sm" 1>&6
11353
11354 echo "${as_me:-configure}:11354: testing found package sm ..." 1>&5
11355
11356         cf_pkgconfig_incs="`$PKG_CONFIG --cflags sm 2>/dev/null`"
11357         cf_pkgconfig_libs="`$PKG_CONFIG --libs   sm 2>/dev/null`"
11358         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
11359
11360 echo "${as_me:-configure}:11360: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11361
11362         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
11363
11364 echo "${as_me:-configure}:11364: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
11365
11366 cf_fix_cppflags=no
11367 cf_new_cflags=
11368 cf_new_cppflags=
11369 cf_new_extra_cppflags=
11370
11371 for cf_add_cflags in $cf_pkgconfig_incs
11372 do
11373 case $cf_fix_cppflags in
11374 (no)
11375         case $cf_add_cflags in
11376         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11377                 case $cf_add_cflags in
11378                 (-D*)
11379                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11380
11381                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11382                                 && test -z "${cf_tst_cflags}" \
11383                                 && cf_fix_cppflags=yes
11384
11385                         if test $cf_fix_cppflags = yes ; then
11386                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11387                                 continue
11388                         elif test "${cf_tst_cflags}" = "\"'" ; then
11389                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11390                                 continue
11391                         fi
11392                         ;;
11393                 esac
11394                 case "$CPPFLAGS" in
11395                 (*$cf_add_cflags)
11396                         ;;
11397                 (*)
11398                         case $cf_add_cflags in
11399                         (-D*)
11400                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11401
11402 CPPFLAGS=`echo "$CPPFLAGS" | \
11403         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11404                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11405
11406                                 ;;
11407                         esac
11408                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11409                         ;;
11410                 esac
11411                 ;;
11412         (*)
11413                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11414                 ;;
11415         esac
11416         ;;
11417 (yes)
11418         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11419
11420         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11421
11422         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11423                 && test -z "${cf_tst_cflags}" \
11424                 && cf_fix_cppflags=no
11425         ;;
11426 esac
11427 done
11428
11429 if test -n "$cf_new_cflags" ; then
11430
11431         CFLAGS="$CFLAGS $cf_new_cflags"
11432 fi
11433
11434 if test -n "$cf_new_cppflags" ; then
11435
11436         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11437 fi
11438
11439 if test -n "$cf_new_extra_cppflags" ; then
11440
11441         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11442 fi
11443
11444 cf_add_libs="$cf_pkgconfig_libs"
11445 # Filter out duplicates - this happens with badly-designed ".pc" files...
11446 for cf_add_1lib in $LIBS
11447 do
11448         for cf_add_2lib in $cf_add_libs
11449         do
11450                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11451                 then
11452                         cf_add_1lib=
11453                         break
11454                 fi
11455         done
11456         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11457 done
11458 LIBS="$cf_add_libs"
11459
11460         :
11461 else
11462         cf_pkgconfig_incs=
11463         cf_pkgconfig_libs=
11464         { echo "$as_me:11464: WARNING: unable to find SM library" >&5
11465 echo "$as_me: WARNING: unable to find SM library" >&2;}
11466 fi
11467
11468 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xt; then
11469         test -n "$verbose" && echo "    found package xt" 1>&6
11470
11471 echo "${as_me:-configure}:11471: testing found package xt ..." 1>&5
11472
11473         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xt 2>/dev/null`"
11474         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xt 2>/dev/null`"
11475         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
11476
11477 echo "${as_me:-configure}:11477: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11478
11479         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
11480
11481 echo "${as_me:-configure}:11481: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
11482
11483 cf_fix_cppflags=no
11484 cf_new_cflags=
11485 cf_new_cppflags=
11486 cf_new_extra_cppflags=
11487
11488 for cf_add_cflags in $cf_pkgconfig_incs
11489 do
11490 case $cf_fix_cppflags in
11491 (no)
11492         case $cf_add_cflags in
11493         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11494                 case $cf_add_cflags in
11495                 (-D*)
11496                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11497
11498                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11499                                 && test -z "${cf_tst_cflags}" \
11500                                 && cf_fix_cppflags=yes
11501
11502                         if test $cf_fix_cppflags = yes ; then
11503                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11504                                 continue
11505                         elif test "${cf_tst_cflags}" = "\"'" ; then
11506                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11507                                 continue
11508                         fi
11509                         ;;
11510                 esac
11511                 case "$CPPFLAGS" in
11512                 (*$cf_add_cflags)
11513                         ;;
11514                 (*)
11515                         case $cf_add_cflags in
11516                         (-D*)
11517                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11518
11519 CPPFLAGS=`echo "$CPPFLAGS" | \
11520         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11521                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11522
11523                                 ;;
11524                         esac
11525                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11526                         ;;
11527                 esac
11528                 ;;
11529         (*)
11530                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11531                 ;;
11532         esac
11533         ;;
11534 (yes)
11535         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11536
11537         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11538
11539         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11540                 && test -z "${cf_tst_cflags}" \
11541                 && cf_fix_cppflags=no
11542         ;;
11543 esac
11544 done
11545
11546 if test -n "$cf_new_cflags" ; then
11547
11548         CFLAGS="$CFLAGS $cf_new_cflags"
11549 fi
11550
11551 if test -n "$cf_new_cppflags" ; then
11552
11553         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11554 fi
11555
11556 if test -n "$cf_new_extra_cppflags" ; then
11557
11558         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11559 fi
11560
11561 cf_add_libs="$cf_pkgconfig_libs"
11562 # Filter out duplicates - this happens with badly-designed ".pc" files...
11563 for cf_add_1lib in $LIBS
11564 do
11565         for cf_add_2lib in $cf_add_libs
11566         do
11567                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11568                 then
11569                         cf_add_1lib=
11570                         break
11571                 fi
11572         done
11573         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11574 done
11575 LIBS="$cf_add_libs"
11576
11577         :
11578 else
11579         cf_pkgconfig_incs=
11580         cf_pkgconfig_libs=
11581         { echo "$as_me:11581: WARNING: unable to find Xt library" >&5
11582 echo "$as_me: WARNING: unable to find Xt library" >&2;}
11583 fi
11584
11585 fi
11586
11587 cf_have_X_LIBS=no
11588
11589 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xt; then
11590         test -n "$verbose" && echo "    found package xt" 1>&6
11591
11592 echo "${as_me:-configure}:11592: testing found package xt ..." 1>&5
11593
11594         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xt 2>/dev/null`"
11595         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xt 2>/dev/null`"
11596         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
11597
11598 echo "${as_me:-configure}:11598: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11599
11600         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
11601
11602 echo "${as_me:-configure}:11602: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
11603
11604 cf_fix_cppflags=no
11605 cf_new_cflags=
11606 cf_new_cppflags=
11607 cf_new_extra_cppflags=
11608
11609 for cf_add_cflags in $cf_pkgconfig_incs
11610 do
11611 case $cf_fix_cppflags in
11612 (no)
11613         case $cf_add_cflags in
11614         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11615                 case $cf_add_cflags in
11616                 (-D*)
11617                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11618
11619                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11620                                 && test -z "${cf_tst_cflags}" \
11621                                 && cf_fix_cppflags=yes
11622
11623                         if test $cf_fix_cppflags = yes ; then
11624                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11625                                 continue
11626                         elif test "${cf_tst_cflags}" = "\"'" ; then
11627                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11628                                 continue
11629                         fi
11630                         ;;
11631                 esac
11632                 case "$CPPFLAGS" in
11633                 (*$cf_add_cflags)
11634                         ;;
11635                 (*)
11636                         case $cf_add_cflags in
11637                         (-D*)
11638                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11639
11640 CPPFLAGS=`echo "$CPPFLAGS" | \
11641         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11642                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11643
11644                                 ;;
11645                         esac
11646                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11647                         ;;
11648                 esac
11649                 ;;
11650         (*)
11651                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11652                 ;;
11653         esac
11654         ;;
11655 (yes)
11656         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11657
11658         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11659
11660         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11661                 && test -z "${cf_tst_cflags}" \
11662                 && cf_fix_cppflags=no
11663         ;;
11664 esac
11665 done
11666
11667 if test -n "$cf_new_cflags" ; then
11668
11669         CFLAGS="$CFLAGS $cf_new_cflags"
11670 fi
11671
11672 if test -n "$cf_new_cppflags" ; then
11673
11674         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11675 fi
11676
11677 if test -n "$cf_new_extra_cppflags" ; then
11678
11679         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11680 fi
11681
11682 cf_add_libs="$cf_pkgconfig_libs"
11683 # Filter out duplicates - this happens with badly-designed ".pc" files...
11684 for cf_add_1lib in $LIBS
11685 do
11686         for cf_add_2lib in $cf_add_libs
11687         do
11688                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11689                 then
11690                         cf_add_1lib=
11691                         break
11692                 fi
11693         done
11694         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11695 done
11696 LIBS="$cf_add_libs"
11697
11698         case "x$LIBS" in
11699         (*-lX11*)
11700                 ;;
11701         (*)
11702 # we have an "xt" package, but it may omit Xt's dependency on X11
11703 echo "$as_me:11703: checking for usable X dependency" >&5
11704 echo $ECHO_N "checking for usable X dependency... $ECHO_C" >&6
11705 if test "${cf_cv_xt_x11_compat+set}" = set; then
11706   echo $ECHO_N "(cached) $ECHO_C" >&6
11707 else
11708
11709 cat >conftest.$ac_ext <<_ACEOF
11710 #line 11710 "configure"
11711 #include "confdefs.h"
11712
11713 #include <X11/Xlib.h>
11714
11715 int
11716 main ()
11717 {
11718
11719         int rc1 = XDrawLine((Display*) 0, (Drawable) 0, (GC) 0, 0, 0, 0, 0);
11720         int rc2 = XClearWindow((Display*) 0, (Window) 0);
11721         int rc3 = XMoveWindow((Display*) 0, (Window) 0, 0, 0);
11722         int rc4 = XMoveResizeWindow((Display*)0, (Window)0, 0, 0, 0, 0);
11723
11724   ;
11725   return 0;
11726 }
11727 _ACEOF
11728 rm -f conftest.$ac_objext conftest$ac_exeext
11729 if { (eval echo "$as_me:11729: \"$ac_link\"") >&5
11730   (eval $ac_link) 2>&5
11731   ac_status=$?
11732   echo "$as_me:11732: \$? = $ac_status" >&5
11733   (exit $ac_status); } &&
11734          { ac_try='test -s conftest$ac_exeext'
11735   { (eval echo "$as_me:11735: \"$ac_try\"") >&5
11736   (eval $ac_try) 2>&5
11737   ac_status=$?
11738   echo "$as_me:11738: \$? = $ac_status" >&5
11739   (exit $ac_status); }; }; then
11740   cf_cv_xt_x11_compat=yes
11741 else
11742   echo "$as_me: failed program was:" >&5
11743 cat conftest.$ac_ext >&5
11744 cf_cv_xt_x11_compat=no
11745 fi
11746 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11747 fi
11748 echo "$as_me:11748: result: $cf_cv_xt_x11_compat" >&5
11749 echo "${ECHO_T}$cf_cv_xt_x11_compat" >&6
11750                 if test "$cf_cv_xt_x11_compat" = no
11751                 then
11752                         test -n "$verbose" && echo "    work around broken X11 dependency" 1>&6
11753
11754 echo "${as_me:-configure}:11754: testing work around broken X11 dependency ..." 1>&5
11755
11756                         # 2010/11/19 - good enough until a working Xt on Xcb is delivered.
11757
11758 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists x11; then
11759         test -n "$verbose" && echo "    found package x11" 1>&6
11760
11761 echo "${as_me:-configure}:11761: testing found package x11 ..." 1>&5
11762
11763         cf_pkgconfig_incs="`$PKG_CONFIG --cflags x11 2>/dev/null`"
11764         cf_pkgconfig_libs="`$PKG_CONFIG --libs   x11 2>/dev/null`"
11765         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
11766
11767 echo "${as_me:-configure}:11767: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11768
11769         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
11770
11771 echo "${as_me:-configure}:11771: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
11772
11773 cf_fix_cppflags=no
11774 cf_new_cflags=
11775 cf_new_cppflags=
11776 cf_new_extra_cppflags=
11777
11778 for cf_add_cflags in $cf_pkgconfig_incs
11779 do
11780 case $cf_fix_cppflags in
11781 (no)
11782         case $cf_add_cflags in
11783         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11784                 case $cf_add_cflags in
11785                 (-D*)
11786                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11787
11788                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11789                                 && test -z "${cf_tst_cflags}" \
11790                                 && cf_fix_cppflags=yes
11791
11792                         if test $cf_fix_cppflags = yes ; then
11793                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11794                                 continue
11795                         elif test "${cf_tst_cflags}" = "\"'" ; then
11796                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11797                                 continue
11798                         fi
11799                         ;;
11800                 esac
11801                 case "$CPPFLAGS" in
11802                 (*$cf_add_cflags)
11803                         ;;
11804                 (*)
11805                         case $cf_add_cflags in
11806                         (-D*)
11807                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11808
11809 CPPFLAGS=`echo "$CPPFLAGS" | \
11810         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11811                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11812
11813                                 ;;
11814                         esac
11815                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11816                         ;;
11817                 esac
11818                 ;;
11819         (*)
11820                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11821                 ;;
11822         esac
11823         ;;
11824 (yes)
11825         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11826
11827         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11828
11829         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11830                 && test -z "${cf_tst_cflags}" \
11831                 && cf_fix_cppflags=no
11832         ;;
11833 esac
11834 done
11835
11836 if test -n "$cf_new_cflags" ; then
11837
11838         CFLAGS="$CFLAGS $cf_new_cflags"
11839 fi
11840
11841 if test -n "$cf_new_cppflags" ; then
11842
11843         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11844 fi
11845
11846 if test -n "$cf_new_extra_cppflags" ; then
11847
11848         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11849 fi
11850
11851 cf_add_libs="$cf_pkgconfig_libs"
11852 # Filter out duplicates - this happens with badly-designed ".pc" files...
11853 for cf_add_1lib in $LIBS
11854 do
11855         for cf_add_2lib in $cf_add_libs
11856         do
11857                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11858                 then
11859                         cf_add_1lib=
11860                         break
11861                 fi
11862         done
11863         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11864 done
11865 LIBS="$cf_add_libs"
11866
11867         :
11868 else
11869         cf_pkgconfig_incs=
11870         cf_pkgconfig_libs=
11871
11872 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
11873
11874 echo "${as_me:-configure}:11874: testing ...before $LIBS ..." 1>&5
11875
11876 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%-lXt %-lXt -lX11 %" -e 's%  % %g'`
11877 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
11878
11879 echo "${as_me:-configure}:11879: testing ...after  $LIBS ..." 1>&5
11880
11881 fi
11882
11883                 fi
11884                 ;;
11885         esac
11886
11887 echo "$as_me:11887: checking for usable X Toolkit package" >&5
11888 echo $ECHO_N "checking for usable X Toolkit package... $ECHO_C" >&6
11889 if test "${cf_cv_xt_ice_compat+set}" = set; then
11890   echo $ECHO_N "(cached) $ECHO_C" >&6
11891 else
11892
11893 cat >conftest.$ac_ext <<_ACEOF
11894 #line 11894 "configure"
11895 #include "confdefs.h"
11896
11897 #include <X11/Shell.h>
11898
11899 int
11900 main ()
11901 {
11902 int num = IceConnectionNumber(0)
11903
11904   ;
11905   return 0;
11906 }
11907 _ACEOF
11908 rm -f conftest.$ac_objext conftest$ac_exeext
11909 if { (eval echo "$as_me:11909: \"$ac_link\"") >&5
11910   (eval $ac_link) 2>&5
11911   ac_status=$?
11912   echo "$as_me:11912: \$? = $ac_status" >&5
11913   (exit $ac_status); } &&
11914          { ac_try='test -s conftest$ac_exeext'
11915   { (eval echo "$as_me:11915: \"$ac_try\"") >&5
11916   (eval $ac_try) 2>&5
11917   ac_status=$?
11918   echo "$as_me:11918: \$? = $ac_status" >&5
11919   (exit $ac_status); }; }; then
11920   cf_cv_xt_ice_compat=yes
11921 else
11922   echo "$as_me: failed program was:" >&5
11923 cat conftest.$ac_ext >&5
11924 cf_cv_xt_ice_compat=no
11925 fi
11926 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11927 fi
11928 echo "$as_me:11928: result: $cf_cv_xt_ice_compat" >&5
11929 echo "${ECHO_T}$cf_cv_xt_ice_compat" >&6
11930
11931         if test "$cf_cv_xt_ice_compat" = no
11932         then
11933                 # workaround for broken ".pc" files used for X Toolkit.
11934                 case "x$X_PRE_LIBS" in
11935                 (*-lICE*)
11936                         case "x$LIBS" in
11937                         (*-lICE*)
11938                                 ;;
11939                         (*)
11940                                 test -n "$verbose" && echo "    work around broken ICE dependency" 1>&6
11941
11942 echo "${as_me:-configure}:11942: testing work around broken ICE dependency ..." 1>&5
11943
11944 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists ice; then
11945         test -n "$verbose" && echo "    found package ice" 1>&6
11946
11947 echo "${as_me:-configure}:11947: testing found package ice ..." 1>&5
11948
11949         cf_pkgconfig_incs="`$PKG_CONFIG --cflags ice 2>/dev/null`"
11950         cf_pkgconfig_libs="`$PKG_CONFIG --libs   ice 2>/dev/null`"
11951         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
11952
11953 echo "${as_me:-configure}:11953: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11954
11955         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
11956
11957 echo "${as_me:-configure}:11957: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
11958
11959 cf_fix_cppflags=no
11960 cf_new_cflags=
11961 cf_new_cppflags=
11962 cf_new_extra_cppflags=
11963
11964 for cf_add_cflags in $cf_pkgconfig_incs
11965 do
11966 case $cf_fix_cppflags in
11967 (no)
11968         case $cf_add_cflags in
11969         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11970                 case $cf_add_cflags in
11971                 (-D*)
11972                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11973
11974                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11975                                 && test -z "${cf_tst_cflags}" \
11976                                 && cf_fix_cppflags=yes
11977
11978                         if test $cf_fix_cppflags = yes ; then
11979                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11980                                 continue
11981                         elif test "${cf_tst_cflags}" = "\"'" ; then
11982                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11983                                 continue
11984                         fi
11985                         ;;
11986                 esac
11987                 case "$CPPFLAGS" in
11988                 (*$cf_add_cflags)
11989                         ;;
11990                 (*)
11991                         case $cf_add_cflags in
11992                         (-D*)
11993                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11994
11995 CPPFLAGS=`echo "$CPPFLAGS" | \
11996         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11997                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11998
11999                                 ;;
12000                         esac
12001                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
12002                         ;;
12003                 esac
12004                 ;;
12005         (*)
12006                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
12007                 ;;
12008         esac
12009         ;;
12010 (yes)
12011         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12012
12013         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12014
12015         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12016                 && test -z "${cf_tst_cflags}" \
12017                 && cf_fix_cppflags=no
12018         ;;
12019 esac
12020 done
12021
12022 if test -n "$cf_new_cflags" ; then
12023
12024         CFLAGS="$CFLAGS $cf_new_cflags"
12025 fi
12026
12027 if test -n "$cf_new_cppflags" ; then
12028
12029         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
12030 fi
12031
12032 if test -n "$cf_new_extra_cppflags" ; then
12033
12034         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
12035 fi
12036
12037 cf_add_libs="$cf_pkgconfig_libs"
12038 # Filter out duplicates - this happens with badly-designed ".pc" files...
12039 for cf_add_1lib in $LIBS
12040 do
12041         for cf_add_2lib in $cf_add_libs
12042         do
12043                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12044                 then
12045                         cf_add_1lib=
12046                         break
12047                 fi
12048         done
12049         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12050 done
12051 LIBS="$cf_add_libs"
12052
12053 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists sm; then
12054         test -n "$verbose" && echo "    found package sm" 1>&6
12055
12056 echo "${as_me:-configure}:12056: testing found package sm ..." 1>&5
12057
12058         cf_pkgconfig_incs="`$PKG_CONFIG --cflags sm 2>/dev/null`"
12059         cf_pkgconfig_libs="`$PKG_CONFIG --libs   sm 2>/dev/null`"
12060         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
12061
12062 echo "${as_me:-configure}:12062: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12063
12064         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
12065
12066 echo "${as_me:-configure}:12066: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
12067
12068 cf_fix_cppflags=no
12069 cf_new_cflags=
12070 cf_new_cppflags=
12071 cf_new_extra_cppflags=
12072
12073 for cf_add_cflags in $cf_pkgconfig_incs
12074 do
12075 case $cf_fix_cppflags in
12076 (no)
12077         case $cf_add_cflags in
12078         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12079                 case $cf_add_cflags in
12080                 (-D*)
12081                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12082
12083                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12084                                 && test -z "${cf_tst_cflags}" \
12085                                 && cf_fix_cppflags=yes
12086
12087                         if test $cf_fix_cppflags = yes ; then
12088                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12089                                 continue
12090                         elif test "${cf_tst_cflags}" = "\"'" ; then
12091                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12092                                 continue
12093                         fi
12094                         ;;
12095                 esac
12096                 case "$CPPFLAGS" in
12097                 (*$cf_add_cflags)
12098                         ;;
12099                 (*)
12100                         case $cf_add_cflags in
12101                         (-D*)
12102                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12103
12104 CPPFLAGS=`echo "$CPPFLAGS" | \
12105         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12106                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12107
12108                                 ;;
12109                         esac
12110                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
12111                         ;;
12112                 esac
12113                 ;;
12114         (*)
12115                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
12116                 ;;
12117         esac
12118         ;;
12119 (yes)
12120         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12121
12122         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12123
12124         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12125                 && test -z "${cf_tst_cflags}" \
12126                 && cf_fix_cppflags=no
12127         ;;
12128 esac
12129 done
12130
12131 if test -n "$cf_new_cflags" ; then
12132
12133         CFLAGS="$CFLAGS $cf_new_cflags"
12134 fi
12135
12136 if test -n "$cf_new_cppflags" ; then
12137
12138         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
12139 fi
12140
12141 if test -n "$cf_new_extra_cppflags" ; then
12142
12143         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
12144 fi
12145
12146 cf_add_libs="$cf_pkgconfig_libs"
12147 # Filter out duplicates - this happens with badly-designed ".pc" files...
12148 for cf_add_1lib in $LIBS
12149 do
12150         for cf_add_2lib in $cf_add_libs
12151         do
12152                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12153                 then
12154                         cf_add_1lib=
12155                         break
12156                 fi
12157         done
12158         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12159 done
12160 LIBS="$cf_add_libs"
12161
12162         :
12163 else
12164         cf_pkgconfig_incs=
12165         cf_pkgconfig_libs=
12166         :
12167 fi
12168
12169 else
12170         cf_pkgconfig_incs=
12171         cf_pkgconfig_libs=
12172
12173 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
12174
12175 echo "${as_me:-configure}:12175: testing ...before $LIBS ..." 1>&5
12176
12177 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%-lXt %-lXt $X_PRE_LIBS %" -e 's%  % %g'`
12178 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
12179
12180 echo "${as_me:-configure}:12180: testing ...after  $LIBS ..." 1>&5
12181
12182 fi
12183
12184                                 ;;
12185                         esac
12186                         ;;
12187                 esac
12188         fi
12189
12190         cf_have_X_LIBS=yes
12191
12192 else
12193         cf_pkgconfig_incs=
12194         cf_pkgconfig_libs=
12195
12196         LDFLAGS="$X_LIBS $LDFLAGS"
12197
12198 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
12199
12200 echo "${as_me:-configure}:12200: testing checking additions to CFLAGS ..." 1>&5
12201
12202 cf_check_cflags="$CFLAGS"
12203 cf_check_cppflags="$CPPFLAGS"
12204
12205 cf_fix_cppflags=no
12206 cf_new_cflags=
12207 cf_new_cppflags=
12208 cf_new_extra_cppflags=
12209
12210 for cf_add_cflags in $X_CFLAGS
12211 do
12212 case $cf_fix_cppflags in
12213 (no)
12214         case $cf_add_cflags in
12215         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12216                 case $cf_add_cflags in
12217                 (-D*)
12218                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12219
12220                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12221                                 && test -z "${cf_tst_cflags}" \
12222                                 && cf_fix_cppflags=yes
12223
12224                         if test $cf_fix_cppflags = yes ; then
12225                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12226                                 continue
12227                         elif test "${cf_tst_cflags}" = "\"'" ; then
12228                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12229                                 continue
12230                         fi
12231                         ;;
12232                 esac
12233                 case "$CPPFLAGS" in
12234                 (*$cf_add_cflags)
12235                         ;;
12236                 (*)
12237                         case $cf_add_cflags in
12238                         (-D*)
12239                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12240
12241 CPPFLAGS=`echo "$CPPFLAGS" | \
12242         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12243                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12244
12245                                 ;;
12246                         esac
12247                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
12248                         ;;
12249                 esac
12250                 ;;
12251         (*)
12252                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
12253                 ;;
12254         esac
12255         ;;
12256 (yes)
12257         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12258
12259         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12260
12261         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12262                 && test -z "${cf_tst_cflags}" \
12263                 && cf_fix_cppflags=no
12264         ;;
12265 esac
12266 done
12267
12268 if test -n "$cf_new_cflags" ; then
12269         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
12270
12271 echo "${as_me:-configure}:12271: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
12272
12273         CFLAGS="$CFLAGS $cf_new_cflags"
12274 fi
12275
12276 if test -n "$cf_new_cppflags" ; then
12277         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
12278
12279 echo "${as_me:-configure}:12279: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
12280
12281         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
12282 fi
12283
12284 if test -n "$cf_new_extra_cppflags" ; then
12285         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
12286
12287 echo "${as_me:-configure}:12287: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
12288
12289         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
12290 fi
12291
12292 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
12293 cat >conftest.$ac_ext <<_ACEOF
12294 #line 12294 "configure"
12295 #include "confdefs.h"
12296 #include <stdio.h>
12297 int
12298 main ()
12299 {
12300 printf("Hello world");
12301   ;
12302   return 0;
12303 }
12304 _ACEOF
12305 rm -f conftest.$ac_objext conftest$ac_exeext
12306 if { (eval echo "$as_me:12306: \"$ac_link\"") >&5
12307   (eval $ac_link) 2>&5
12308   ac_status=$?
12309   echo "$as_me:12309: \$? = $ac_status" >&5
12310   (exit $ac_status); } &&
12311          { ac_try='test -s conftest$ac_exeext'
12312   { (eval echo "$as_me:12312: \"$ac_try\"") >&5
12313   (eval $ac_try) 2>&5
12314   ac_status=$?
12315   echo "$as_me:12315: \$? = $ac_status" >&5
12316   (exit $ac_status); }; }; then
12317   :
12318 else
12319   echo "$as_me: failed program was:" >&5
12320 cat conftest.$ac_ext >&5
12321 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
12322
12323 echo "${as_me:-configure}:12323: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
12324
12325          if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
12326                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
12327
12328 echo "${as_me:-configure}:12328: testing but keeping change to \$CPPFLAGS ..." 1>&5
12329
12330          fi
12331          CFLAGS="$cf_check_flags"
12332 fi
12333 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12334 fi
12335
12336         echo "$as_me:12336: checking for XOpenDisplay" >&5
12337 echo $ECHO_N "checking for XOpenDisplay... $ECHO_C" >&6
12338 if test "${ac_cv_func_XOpenDisplay+set}" = set; then
12339   echo $ECHO_N "(cached) $ECHO_C" >&6
12340 else
12341   cat >conftest.$ac_ext <<_ACEOF
12342 #line 12342 "configure"
12343 #include "confdefs.h"
12344 /* System header to define __stub macros and hopefully few prototypes,
12345     which can conflict with char XOpenDisplay (); below.  */
12346 #include <assert.h>
12347 /* Override any gcc2 internal prototype to avoid an error.  */
12348 #ifdef __cplusplus
12349 extern "C"
12350 #endif
12351 /* We use char because int might match the return type of a gcc2
12352    builtin and then its argument prototype would still apply.  */
12353 char XOpenDisplay ();
12354 char (*f) ();
12355
12356 int
12357 main ()
12358 {
12359 /* The GNU C library defines this for functions which it implements
12360     to always fail with ENOSYS.  Some functions are actually named
12361     something starting with __ and the normal name is an alias.  */
12362 #if defined (__stub_XOpenDisplay) || defined (__stub___XOpenDisplay)
12363 choke me
12364 #else
12365 f = XOpenDisplay; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
12366 #endif
12367
12368   ;
12369   return 0;
12370 }
12371 _ACEOF
12372 rm -f conftest.$ac_objext conftest$ac_exeext
12373 if { (eval echo "$as_me:12373: \"$ac_link\"") >&5
12374   (eval $ac_link) 2>&5
12375   ac_status=$?
12376   echo "$as_me:12376: \$? = $ac_status" >&5
12377   (exit $ac_status); } &&
12378          { ac_try='test -s conftest$ac_exeext'
12379   { (eval echo "$as_me:12379: \"$ac_try\"") >&5
12380   (eval $ac_try) 2>&5
12381   ac_status=$?
12382   echo "$as_me:12382: \$? = $ac_status" >&5
12383   (exit $ac_status); }; }; then
12384   ac_cv_func_XOpenDisplay=yes
12385 else
12386   echo "$as_me: failed program was:" >&5
12387 cat conftest.$ac_ext >&5
12388 ac_cv_func_XOpenDisplay=no
12389 fi
12390 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12391 fi
12392 echo "$as_me:12392: result: $ac_cv_func_XOpenDisplay" >&5
12393 echo "${ECHO_T}$ac_cv_func_XOpenDisplay" >&6
12394 if test $ac_cv_func_XOpenDisplay = yes; then
12395   :
12396 else
12397
12398         echo "$as_me:12398: checking for XOpenDisplay in -lX11" >&5
12399 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
12400 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
12401   echo $ECHO_N "(cached) $ECHO_C" >&6
12402 else
12403   ac_check_lib_save_LIBS=$LIBS
12404 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
12405 cat >conftest.$ac_ext <<_ACEOF
12406 #line 12406 "configure"
12407 #include "confdefs.h"
12408
12409 /* Override any gcc2 internal prototype to avoid an error.  */
12410 #ifdef __cplusplus
12411 extern "C"
12412 #endif
12413 /* We use char because int might match the return type of a gcc2
12414    builtin and then its argument prototype would still apply.  */
12415 char XOpenDisplay ();
12416 int
12417 main ()
12418 {
12419 XOpenDisplay ();
12420   ;
12421   return 0;
12422 }
12423 _ACEOF
12424 rm -f conftest.$ac_objext conftest$ac_exeext
12425 if { (eval echo "$as_me:12425: \"$ac_link\"") >&5
12426   (eval $ac_link) 2>&5
12427   ac_status=$?
12428   echo "$as_me:12428: \$? = $ac_status" >&5
12429   (exit $ac_status); } &&
12430          { ac_try='test -s conftest$ac_exeext'
12431   { (eval echo "$as_me:12431: \"$ac_try\"") >&5
12432   (eval $ac_try) 2>&5
12433   ac_status=$?
12434   echo "$as_me:12434: \$? = $ac_status" >&5
12435   (exit $ac_status); }; }; then
12436   ac_cv_lib_X11_XOpenDisplay=yes
12437 else
12438   echo "$as_me: failed program was:" >&5
12439 cat conftest.$ac_ext >&5
12440 ac_cv_lib_X11_XOpenDisplay=no
12441 fi
12442 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12443 LIBS=$ac_check_lib_save_LIBS
12444 fi
12445 echo "$as_me:12445: result: $ac_cv_lib_X11_XOpenDisplay" >&5
12446 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
12447 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
12448
12449 cf_add_libs="-lX11"
12450 # Filter out duplicates - this happens with badly-designed ".pc" files...
12451 for cf_add_1lib in $LIBS
12452 do
12453         for cf_add_2lib in $cf_add_libs
12454         do
12455                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12456                 then
12457                         cf_add_1lib=
12458                         break
12459                 fi
12460         done
12461         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12462 done
12463 LIBS="$cf_add_libs"
12464
12465 fi
12466
12467 fi
12468
12469         echo "$as_me:12469: checking for XtAppInitialize" >&5
12470 echo $ECHO_N "checking for XtAppInitialize... $ECHO_C" >&6
12471 if test "${ac_cv_func_XtAppInitialize+set}" = set; then
12472   echo $ECHO_N "(cached) $ECHO_C" >&6
12473 else
12474   cat >conftest.$ac_ext <<_ACEOF
12475 #line 12475 "configure"
12476 #include "confdefs.h"
12477 /* System header to define __stub macros and hopefully few prototypes,
12478     which can conflict with char XtAppInitialize (); below.  */
12479 #include <assert.h>
12480 /* Override any gcc2 internal prototype to avoid an error.  */
12481 #ifdef __cplusplus
12482 extern "C"
12483 #endif
12484 /* We use char because int might match the return type of a gcc2
12485    builtin and then its argument prototype would still apply.  */
12486 char XtAppInitialize ();
12487 char (*f) ();
12488
12489 int
12490 main ()
12491 {
12492 /* The GNU C library defines this for functions which it implements
12493     to always fail with ENOSYS.  Some functions are actually named
12494     something starting with __ and the normal name is an alias.  */
12495 #if defined (__stub_XtAppInitialize) || defined (__stub___XtAppInitialize)
12496 choke me
12497 #else
12498 f = XtAppInitialize; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
12499 #endif
12500
12501   ;
12502   return 0;
12503 }
12504 _ACEOF
12505 rm -f conftest.$ac_objext conftest$ac_exeext
12506 if { (eval echo "$as_me:12506: \"$ac_link\"") >&5
12507   (eval $ac_link) 2>&5
12508   ac_status=$?
12509   echo "$as_me:12509: \$? = $ac_status" >&5
12510   (exit $ac_status); } &&
12511          { ac_try='test -s conftest$ac_exeext'
12512   { (eval echo "$as_me:12512: \"$ac_try\"") >&5
12513   (eval $ac_try) 2>&5
12514   ac_status=$?
12515   echo "$as_me:12515: \$? = $ac_status" >&5
12516   (exit $ac_status); }; }; then
12517   ac_cv_func_XtAppInitialize=yes
12518 else
12519   echo "$as_me: failed program was:" >&5
12520 cat conftest.$ac_ext >&5
12521 ac_cv_func_XtAppInitialize=no
12522 fi
12523 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12524 fi
12525 echo "$as_me:12525: result: $ac_cv_func_XtAppInitialize" >&5
12526 echo "${ECHO_T}$ac_cv_func_XtAppInitialize" >&6
12527 if test $ac_cv_func_XtAppInitialize = yes; then
12528   :
12529 else
12530
12531         echo "$as_me:12531: checking for XtAppInitialize in -lXt" >&5
12532 echo $ECHO_N "checking for XtAppInitialize in -lXt... $ECHO_C" >&6
12533 if test "${ac_cv_lib_Xt_XtAppInitialize+set}" = set; then
12534   echo $ECHO_N "(cached) $ECHO_C" >&6
12535 else
12536   ac_check_lib_save_LIBS=$LIBS
12537 LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
12538 cat >conftest.$ac_ext <<_ACEOF
12539 #line 12539 "configure"
12540 #include "confdefs.h"
12541
12542 /* Override any gcc2 internal prototype to avoid an error.  */
12543 #ifdef __cplusplus
12544 extern "C"
12545 #endif
12546 /* We use char because int might match the return type of a gcc2
12547    builtin and then its argument prototype would still apply.  */
12548 char XtAppInitialize ();
12549 int
12550 main ()
12551 {
12552 XtAppInitialize ();
12553   ;
12554   return 0;
12555 }
12556 _ACEOF
12557 rm -f conftest.$ac_objext conftest$ac_exeext
12558 if { (eval echo "$as_me:12558: \"$ac_link\"") >&5
12559   (eval $ac_link) 2>&5
12560   ac_status=$?
12561   echo "$as_me:12561: \$? = $ac_status" >&5
12562   (exit $ac_status); } &&
12563          { ac_try='test -s conftest$ac_exeext'
12564   { (eval echo "$as_me:12564: \"$ac_try\"") >&5
12565   (eval $ac_try) 2>&5
12566   ac_status=$?
12567   echo "$as_me:12567: \$? = $ac_status" >&5
12568   (exit $ac_status); }; }; then
12569   ac_cv_lib_Xt_XtAppInitialize=yes
12570 else
12571   echo "$as_me: failed program was:" >&5
12572 cat conftest.$ac_ext >&5
12573 ac_cv_lib_Xt_XtAppInitialize=no
12574 fi
12575 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12576 LIBS=$ac_check_lib_save_LIBS
12577 fi
12578 echo "$as_me:12578: result: $ac_cv_lib_Xt_XtAppInitialize" >&5
12579 echo "${ECHO_T}$ac_cv_lib_Xt_XtAppInitialize" >&6
12580 if test $ac_cv_lib_Xt_XtAppInitialize = yes; then
12581
12582 cat >>confdefs.h <<\EOF
12583 #define HAVE_LIBXT 1
12584 EOF
12585
12586                  cf_have_X_LIBS=Xt
12587                  LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS"
12588 fi
12589
12590 fi
12591
12592 fi
12593
12594 if test $cf_have_X_LIBS = no ; then
12595         { echo "$as_me:12595: WARNING: Unable to successfully link X Toolkit library (-lXt) with
12596 test program.  You will have to check and add the proper libraries by hand
12597 to makefile." >&5
12598 echo "$as_me: WARNING: Unable to successfully link X Toolkit library (-lXt) with
12599 test program.  You will have to check and add the proper libraries by hand
12600 to makefile." >&2;}
12601 fi
12602
12603 cf_x_athena_root=$cf_x_athena
12604 cf_x_athena_inc=""
12605
12606 for cf_path in default \
12607         /usr/contrib/X11R6 \
12608         /usr/contrib/X11R5 \
12609         /usr/lib/X11R5 \
12610         /usr/local
12611 do
12612         if test -z "$cf_x_athena_inc" ; then
12613                 cf_save="$CPPFLAGS"
12614                 cf_test=X11/$cf_x_athena_root/SimpleMenu.h
12615                 if test $cf_path != default ; then
12616                         CPPFLAGS="$cf_save -I$cf_path/include"
12617                         echo "$as_me:12617: checking for $cf_test in $cf_path" >&5
12618 echo $ECHO_N "checking for $cf_test in $cf_path... $ECHO_C" >&6
12619                 else
12620                         echo "$as_me:12620: checking for $cf_test" >&5
12621 echo $ECHO_N "checking for $cf_test... $ECHO_C" >&6
12622                 fi
12623                 cat >conftest.$ac_ext <<_ACEOF
12624 #line 12624 "configure"
12625 #include "confdefs.h"
12626
12627 #include <X11/Intrinsic.h>
12628 #include <$cf_test>
12629 int
12630 main ()
12631 {
12632
12633   ;
12634   return 0;
12635 }
12636 _ACEOF
12637 rm -f conftest.$ac_objext
12638 if { (eval echo "$as_me:12638: \"$ac_compile\"") >&5
12639   (eval $ac_compile) 2>&5
12640   ac_status=$?
12641   echo "$as_me:12641: \$? = $ac_status" >&5
12642   (exit $ac_status); } &&
12643          { ac_try='test -s conftest.$ac_objext'
12644   { (eval echo "$as_me:12644: \"$ac_try\"") >&5
12645   (eval $ac_try) 2>&5
12646   ac_status=$?
12647   echo "$as_me:12647: \$? = $ac_status" >&5
12648   (exit $ac_status); }; }; then
12649   cf_result=yes
12650 else
12651   echo "$as_me: failed program was:" >&5
12652 cat conftest.$ac_ext >&5
12653 cf_result=no
12654 fi
12655 rm -f conftest.$ac_objext conftest.$ac_ext
12656                 echo "$as_me:12656: result: $cf_result" >&5
12657 echo "${ECHO_T}$cf_result" >&6
12658                 if test "$cf_result" = yes ; then
12659                         cf_x_athena_inc=$cf_path
12660                         break
12661                 else
12662                         CPPFLAGS="$cf_save"
12663                 fi
12664         fi
12665 done
12666
12667 if test -z "$cf_x_athena_inc" ; then
12668         { echo "$as_me:12668: WARNING: Unable to successfully find Athena header files with test program" >&5
12669 echo "$as_me: WARNING: Unable to successfully find Athena header files with test program" >&2;}
12670 elif test "$cf_x_athena_inc" != default ; then
12671         CPPFLAGS="$CPPFLAGS -I$cf_x_athena_inc"
12672 fi
12673
12674 cf_x_athena_root=$cf_x_athena
12675 cf_x_athena_lib=""
12676
12677 for cf_path in default \
12678         /usr/contrib/X11R6 \
12679         /usr/contrib/X11R5 \
12680         /usr/lib/X11R5 \
12681         /usr/local
12682 do
12683         for cf_lib in \
12684                 ${cf_x_athena_root} \
12685                 ${cf_x_athena_root}7 \
12686                 ${cf_x_athena_root}6
12687         do
12688         for cf_libs in \
12689                 "-l$cf_lib -lXmu" \
12690                 "-l$cf_lib -lXpm -lXmu" \
12691                 "-l${cf_lib}_s -lXmu_s"
12692         do
12693                 if test -z "$cf_x_athena_lib" ; then
12694                         cf_save="$LIBS"
12695                         cf_test=XawSimpleMenuAddGlobalActions
12696                         if test $cf_path != default ; then
12697
12698 cf_add_libs="-L$cf_path/lib $cf_libs"
12699 # Filter out duplicates - this happens with badly-designed ".pc" files...
12700 for cf_add_1lib in $LIBS
12701 do
12702         for cf_add_2lib in $cf_add_libs
12703         do
12704                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12705                 then
12706                         cf_add_1lib=
12707                         break
12708                 fi
12709         done
12710         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12711 done
12712 LIBS="$cf_add_libs"
12713
12714                                 echo "$as_me:12714: checking for $cf_libs in $cf_path" >&5
12715 echo $ECHO_N "checking for $cf_libs in $cf_path... $ECHO_C" >&6
12716                         else
12717
12718 cf_add_libs="$cf_libs"
12719 # Filter out duplicates - this happens with badly-designed ".pc" files...
12720 for cf_add_1lib in $LIBS
12721 do
12722         for cf_add_2lib in $cf_add_libs
12723         do
12724                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12725                 then
12726                         cf_add_1lib=
12727                         break
12728                 fi
12729         done
12730         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12731 done
12732 LIBS="$cf_add_libs"
12733
12734                                 echo "$as_me:12734: checking for $cf_test in $cf_libs" >&5
12735 echo $ECHO_N "checking for $cf_test in $cf_libs... $ECHO_C" >&6
12736                         fi
12737                         cat >conftest.$ac_ext <<_ACEOF
12738 #line 12738 "configure"
12739 #include "confdefs.h"
12740
12741 #include <X11/Intrinsic.h>
12742 #include <X11/$cf_x_athena_root/SimpleMenu.h>
12743
12744 int
12745 main ()
12746 {
12747
12748 $cf_test((XtAppContext) 0)
12749   ;
12750   return 0;
12751 }
12752 _ACEOF
12753 rm -f conftest.$ac_objext conftest$ac_exeext
12754 if { (eval echo "$as_me:12754: \"$ac_link\"") >&5
12755   (eval $ac_link) 2>&5
12756   ac_status=$?
12757   echo "$as_me:12757: \$? = $ac_status" >&5
12758   (exit $ac_status); } &&
12759          { ac_try='test -s conftest$ac_exeext'
12760   { (eval echo "$as_me:12760: \"$ac_try\"") >&5
12761   (eval $ac_try) 2>&5
12762   ac_status=$?
12763   echo "$as_me:12763: \$? = $ac_status" >&5
12764   (exit $ac_status); }; }; then
12765   cf_result=yes
12766 else
12767   echo "$as_me: failed program was:" >&5
12768 cat conftest.$ac_ext >&5
12769 cf_result=no
12770 fi
12771 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12772                         echo "$as_me:12772: result: $cf_result" >&5
12773 echo "${ECHO_T}$cf_result" >&6
12774                         if test "$cf_result" = yes ; then
12775                                 cf_x_athena_lib="$cf_libs"
12776                                 break
12777                         fi
12778                         LIBS="$cf_save"
12779                 fi
12780         done # cf_libs
12781                 test -n "$cf_x_athena_lib" && break
12782         done # cf_lib
12783 done
12784
12785 if test -z "$cf_x_athena_lib" ; then
12786         { { echo "$as_me:12786: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&5
12787 echo "$as_me: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&2;}
12788    { (exit 1); exit 1; }; }
12789 fi
12790
12791 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
12792
12793 cat >>confdefs.h <<EOF
12794 #define $cf_x_athena_LIBS 1
12795 EOF
12796
12797 fi
12798
12799 if test -n "$ac_tool_prefix"; then
12800   for ac_prog in xcurses-config
12801   do
12802     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
12803 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
12804 echo "$as_me:12804: checking for $ac_word" >&5
12805 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
12806 if test "${ac_cv_prog_XCURSES_CONFIG+set}" = set; then
12807   echo $ECHO_N "(cached) $ECHO_C" >&6
12808 else
12809   if test -n "$XCURSES_CONFIG"; then
12810   ac_cv_prog_XCURSES_CONFIG="$XCURSES_CONFIG" # Let the user override the test.
12811 else
12812   ac_save_IFS=$IFS; IFS=$ac_path_separator
12813 ac_dummy="$PATH"
12814 for ac_dir in $ac_dummy; do
12815   IFS=$ac_save_IFS
12816   test -z "$ac_dir" && ac_dir=.
12817   $as_executable_p "$ac_dir/$ac_word" || continue
12818 ac_cv_prog_XCURSES_CONFIG="$ac_tool_prefix$ac_prog"
12819 echo "$as_me:12819: found $ac_dir/$ac_word" >&5
12820 break
12821 done
12822
12823 fi
12824 fi
12825 XCURSES_CONFIG=$ac_cv_prog_XCURSES_CONFIG
12826 if test -n "$XCURSES_CONFIG"; then
12827   echo "$as_me:12827: result: $XCURSES_CONFIG" >&5
12828 echo "${ECHO_T}$XCURSES_CONFIG" >&6
12829 else
12830   echo "$as_me:12830: result: no" >&5
12831 echo "${ECHO_T}no" >&6
12832 fi
12833
12834     test -n "$XCURSES_CONFIG" && break
12835   done
12836 fi
12837 if test -z "$XCURSES_CONFIG"; then
12838   ac_ct_XCURSES_CONFIG=$XCURSES_CONFIG
12839   for ac_prog in xcurses-config
12840 do
12841   # Extract the first word of "$ac_prog", so it can be a program name with args.
12842 set dummy $ac_prog; ac_word=$2
12843 echo "$as_me:12843: checking for $ac_word" >&5
12844 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
12845 if test "${ac_cv_prog_ac_ct_XCURSES_CONFIG+set}" = set; then
12846   echo $ECHO_N "(cached) $ECHO_C" >&6
12847 else
12848   if test -n "$ac_ct_XCURSES_CONFIG"; then
12849   ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_ct_XCURSES_CONFIG" # Let the user override the test.
12850 else
12851   ac_save_IFS=$IFS; IFS=$ac_path_separator
12852 ac_dummy="$PATH"
12853 for ac_dir in $ac_dummy; do
12854   IFS=$ac_save_IFS
12855   test -z "$ac_dir" && ac_dir=.
12856   $as_executable_p "$ac_dir/$ac_word" || continue
12857 ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_prog"
12858 echo "$as_me:12858: found $ac_dir/$ac_word" >&5
12859 break
12860 done
12861
12862 fi
12863 fi
12864 ac_ct_XCURSES_CONFIG=$ac_cv_prog_ac_ct_XCURSES_CONFIG
12865 if test -n "$ac_ct_XCURSES_CONFIG"; then
12866   echo "$as_me:12866: result: $ac_ct_XCURSES_CONFIG" >&5
12867 echo "${ECHO_T}$ac_ct_XCURSES_CONFIG" >&6
12868 else
12869   echo "$as_me:12869: result: no" >&5
12870 echo "${ECHO_T}no" >&6
12871 fi
12872
12873   test -n "$ac_ct_XCURSES_CONFIG" && break
12874 done
12875 test -n "$ac_ct_XCURSES_CONFIG" || ac_ct_XCURSES_CONFIG="none"
12876
12877   XCURSES_CONFIG=$ac_ct_XCURSES_CONFIG
12878 fi
12879
12880 if test "$XCURSES_CONFIG" != none ; then
12881
12882 CPPFLAGS="$CPPFLAGS `$XCURSES_CONFIG --cflags`"
12883
12884 cf_add_libs="`$XCURSES_CONFIG --libs`"
12885 # Filter out duplicates - this happens with badly-designed ".pc" files...
12886 for cf_add_1lib in $LIBS
12887 do
12888         for cf_add_2lib in $cf_add_libs
12889         do
12890                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12891                 then
12892                         cf_add_1lib=
12893                         break
12894                 fi
12895         done
12896         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12897 done
12898 LIBS="$cf_add_libs"
12899
12900 cf_cv_lib_XCurses=yes
12901
12902 else
12903
12904 LDFLAGS="$LDFLAGS $X_LIBS"
12905
12906 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
12907
12908 echo "${as_me:-configure}:12908: testing checking additions to CFLAGS ..." 1>&5
12909
12910 cf_check_cflags="$CFLAGS"
12911 cf_check_cppflags="$CPPFLAGS"
12912
12913 cf_fix_cppflags=no
12914 cf_new_cflags=
12915 cf_new_cppflags=
12916 cf_new_extra_cppflags=
12917
12918 for cf_add_cflags in $X_CFLAGS
12919 do
12920 case $cf_fix_cppflags in
12921 (no)
12922         case $cf_add_cflags in
12923         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12924                 case $cf_add_cflags in
12925                 (-D*)
12926                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12927
12928                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12929                                 && test -z "${cf_tst_cflags}" \
12930                                 && cf_fix_cppflags=yes
12931
12932                         if test $cf_fix_cppflags = yes ; then
12933                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12934                                 continue
12935                         elif test "${cf_tst_cflags}" = "\"'" ; then
12936                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12937                                 continue
12938                         fi
12939                         ;;
12940                 esac
12941                 case "$CPPFLAGS" in
12942                 (*$cf_add_cflags)
12943                         ;;
12944                 (*)
12945                         case $cf_add_cflags in
12946                         (-D*)
12947                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12948
12949 CPPFLAGS=`echo "$CPPFLAGS" | \
12950         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12951                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12952
12953                                 ;;
12954                         esac
12955                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
12956                         ;;
12957                 esac
12958                 ;;
12959         (*)
12960                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
12961                 ;;
12962         esac
12963         ;;
12964 (yes)
12965         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12966
12967         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12968
12969         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12970                 && test -z "${cf_tst_cflags}" \
12971                 && cf_fix_cppflags=no
12972         ;;
12973 esac
12974 done
12975
12976 if test -n "$cf_new_cflags" ; then
12977         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
12978
12979 echo "${as_me:-configure}:12979: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
12980
12981         CFLAGS="$CFLAGS $cf_new_cflags"
12982 fi
12983
12984 if test -n "$cf_new_cppflags" ; then
12985         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
12986
12987 echo "${as_me:-configure}:12987: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
12988
12989         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
12990 fi
12991
12992 if test -n "$cf_new_extra_cppflags" ; then
12993         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
12994
12995 echo "${as_me:-configure}:12995: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
12996
12997         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
12998 fi
12999
13000 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
13001 cat >conftest.$ac_ext <<_ACEOF
13002 #line 13002 "configure"
13003 #include "confdefs.h"
13004 #include <stdio.h>
13005 int
13006 main ()
13007 {
13008 printf("Hello world");
13009   ;
13010   return 0;
13011 }
13012 _ACEOF
13013 rm -f conftest.$ac_objext conftest$ac_exeext
13014 if { (eval echo "$as_me:13014: \"$ac_link\"") >&5
13015   (eval $ac_link) 2>&5
13016   ac_status=$?
13017   echo "$as_me:13017: \$? = $ac_status" >&5
13018   (exit $ac_status); } &&
13019          { ac_try='test -s conftest$ac_exeext'
13020   { (eval echo "$as_me:13020: \"$ac_try\"") >&5
13021   (eval $ac_try) 2>&5
13022   ac_status=$?
13023   echo "$as_me:13023: \$? = $ac_status" >&5
13024   (exit $ac_status); }; }; then
13025   :
13026 else
13027   echo "$as_me: failed program was:" >&5
13028 cat conftest.$ac_ext >&5
13029 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
13030
13031 echo "${as_me:-configure}:13031: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
13032
13033          if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
13034                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
13035
13036 echo "${as_me:-configure}:13036: testing but keeping change to \$CPPFLAGS ..." 1>&5
13037
13038          fi
13039          CFLAGS="$cf_check_flags"
13040 fi
13041 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13042 fi
13043
13044 echo "$as_me:13044: checking for XOpenDisplay in -lX11" >&5
13045 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
13046 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
13047   echo $ECHO_N "(cached) $ECHO_C" >&6
13048 else
13049   ac_check_lib_save_LIBS=$LIBS
13050 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
13051 cat >conftest.$ac_ext <<_ACEOF
13052 #line 13052 "configure"
13053 #include "confdefs.h"
13054
13055 /* Override any gcc2 internal prototype to avoid an error.  */
13056 #ifdef __cplusplus
13057 extern "C"
13058 #endif
13059 /* We use char because int might match the return type of a gcc2
13060    builtin and then its argument prototype would still apply.  */
13061 char XOpenDisplay ();
13062 int
13063 main ()
13064 {
13065 XOpenDisplay ();
13066   ;
13067   return 0;
13068 }
13069 _ACEOF
13070 rm -f conftest.$ac_objext conftest$ac_exeext
13071 if { (eval echo "$as_me:13071: \"$ac_link\"") >&5
13072   (eval $ac_link) 2>&5
13073   ac_status=$?
13074   echo "$as_me:13074: \$? = $ac_status" >&5
13075   (exit $ac_status); } &&
13076          { ac_try='test -s conftest$ac_exeext'
13077   { (eval echo "$as_me:13077: \"$ac_try\"") >&5
13078   (eval $ac_try) 2>&5
13079   ac_status=$?
13080   echo "$as_me:13080: \$? = $ac_status" >&5
13081   (exit $ac_status); }; }; then
13082   ac_cv_lib_X11_XOpenDisplay=yes
13083 else
13084   echo "$as_me: failed program was:" >&5
13085 cat conftest.$ac_ext >&5
13086 ac_cv_lib_X11_XOpenDisplay=no
13087 fi
13088 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13089 LIBS=$ac_check_lib_save_LIBS
13090 fi
13091 echo "$as_me:13091: result: $ac_cv_lib_X11_XOpenDisplay" >&5
13092 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
13093 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
13094
13095 cf_add_libs="-lX11"
13096 # Filter out duplicates - this happens with badly-designed ".pc" files...
13097 for cf_add_1lib in $LIBS
13098 do
13099         for cf_add_2lib in $cf_add_libs
13100         do
13101                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13102                 then
13103                         cf_add_1lib=
13104                         break
13105                 fi
13106         done
13107         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13108 done
13109 LIBS="$cf_add_libs"
13110
13111 fi
13112
13113 echo "$as_me:13113: checking for XCurses library" >&5
13114 echo $ECHO_N "checking for XCurses library... $ECHO_C" >&6
13115 if test "${cf_cv_lib_XCurses+set}" = set; then
13116   echo $ECHO_N "(cached) $ECHO_C" >&6
13117 else
13118
13119 cf_add_libs="-lXCurses"
13120 # Filter out duplicates - this happens with badly-designed ".pc" files...
13121 for cf_add_1lib in $LIBS
13122 do
13123         for cf_add_2lib in $cf_add_libs
13124         do
13125                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13126                 then
13127                         cf_add_1lib=
13128                         break
13129                 fi
13130         done
13131         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13132 done
13133 LIBS="$cf_add_libs"
13134
13135 cat >conftest.$ac_ext <<_ACEOF
13136 #line 13136 "configure"
13137 #include "confdefs.h"
13138
13139 #include <xcurses.h>
13140 char *XCursesProgramName = "test";
13141
13142 int
13143 main ()
13144 {
13145 XCursesExit();
13146   ;
13147   return 0;
13148 }
13149 _ACEOF
13150 rm -f conftest.$ac_objext conftest$ac_exeext
13151 if { (eval echo "$as_me:13151: \"$ac_link\"") >&5
13152   (eval $ac_link) 2>&5
13153   ac_status=$?
13154   echo "$as_me:13154: \$? = $ac_status" >&5
13155   (exit $ac_status); } &&
13156          { ac_try='test -s conftest$ac_exeext'
13157   { (eval echo "$as_me:13157: \"$ac_try\"") >&5
13158   (eval $ac_try) 2>&5
13159   ac_status=$?
13160   echo "$as_me:13160: \$? = $ac_status" >&5
13161   (exit $ac_status); }; }; then
13162   cf_cv_lib_XCurses=yes
13163 else
13164   echo "$as_me: failed program was:" >&5
13165 cat conftest.$ac_ext >&5
13166 cf_cv_lib_XCurses=no
13167 fi
13168 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13169
13170 fi
13171 echo "$as_me:13171: result: $cf_cv_lib_XCurses" >&5
13172 echo "${ECHO_T}$cf_cv_lib_XCurses" >&6
13173
13174 fi
13175
13176 if test $cf_cv_lib_XCurses = yes ; then
13177
13178 cat >>confdefs.h <<\EOF
13179 #define UNIX 1
13180 EOF
13181
13182 cat >>confdefs.h <<\EOF
13183 #define XCURSES 1
13184 EOF
13185
13186         echo "$as_me:13186: checking for xcurses.h" >&5
13187 echo $ECHO_N "checking for xcurses.h... $ECHO_C" >&6
13188 if test "${ac_cv_header_xcurses_h+set}" = set; then
13189   echo $ECHO_N "(cached) $ECHO_C" >&6
13190 else
13191   cat >conftest.$ac_ext <<_ACEOF
13192 #line 13192 "configure"
13193 #include "confdefs.h"
13194 #include <xcurses.h>
13195 _ACEOF
13196 if { (eval echo "$as_me:13196: \"$ac_cpp conftest.$ac_ext\"") >&5
13197   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13198   ac_status=$?
13199   egrep -v '^ *\+' conftest.er1 >conftest.err
13200   rm -f conftest.er1
13201   cat conftest.err >&5
13202   echo "$as_me:13202: \$? = $ac_status" >&5
13203   (exit $ac_status); } >/dev/null; then
13204   if test -s conftest.err; then
13205     ac_cpp_err=$ac_c_preproc_warn_flag
13206   else
13207     ac_cpp_err=
13208   fi
13209 else
13210   ac_cpp_err=yes
13211 fi
13212 if test -z "$ac_cpp_err"; then
13213   ac_cv_header_xcurses_h=yes
13214 else
13215   echo "$as_me: failed program was:" >&5
13216   cat conftest.$ac_ext >&5
13217   ac_cv_header_xcurses_h=no
13218 fi
13219 rm -f conftest.err conftest.$ac_ext
13220 fi
13221 echo "$as_me:13221: result: $ac_cv_header_xcurses_h" >&5
13222 echo "${ECHO_T}$ac_cv_header_xcurses_h" >&6
13223 if test $ac_cv_header_xcurses_h = yes; then
13224
13225 cat >>confdefs.h <<\EOF
13226 #define HAVE_XCURSES 1
13227 EOF
13228
13229 fi
13230
13231 else
13232         { { echo "$as_me:13232: error: Cannot link with XCurses" >&5
13233 echo "$as_me: error: Cannot link with XCurses" >&2;}
13234    { (exit 1); exit 1; }; }
13235 fi
13236
13237         ;;
13238 (*)
13239         { { echo "$as_me:13239: error: unexpected screen-value: $cf_cv_screen" >&5
13240 echo "$as_me: error: unexpected screen-value: $cf_cv_screen" >&2;}
13241    { (exit 1); exit 1; }; }
13242         ;;
13243 esac
13244
13245 : ${cf_nculib_root:=$cf_cv_screen}
13246 as_ac_Lib=`echo "ac_cv_lib_$cf_nculib_root''__nc_init_pthreads" | $as_tr_sh`
13247 echo "$as_me:13247: checking for _nc_init_pthreads in -l$cf_nculib_root" >&5
13248 echo $ECHO_N "checking for _nc_init_pthreads in -l$cf_nculib_root... $ECHO_C" >&6
13249 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
13250   echo $ECHO_N "(cached) $ECHO_C" >&6
13251 else
13252   ac_check_lib_save_LIBS=$LIBS
13253 LIBS="-l$cf_nculib_root  $LIBS"
13254 cat >conftest.$ac_ext <<_ACEOF
13255 #line 13255 "configure"
13256 #include "confdefs.h"
13257
13258 /* Override any gcc2 internal prototype to avoid an error.  */
13259 #ifdef __cplusplus
13260 extern "C"
13261 #endif
13262 /* We use char because int might match the return type of a gcc2
13263    builtin and then its argument prototype would still apply.  */
13264 char _nc_init_pthreads ();
13265 int
13266 main ()
13267 {
13268 _nc_init_pthreads ();
13269   ;
13270   return 0;
13271 }
13272 _ACEOF
13273 rm -f conftest.$ac_objext conftest$ac_exeext
13274 if { (eval echo "$as_me:13274: \"$ac_link\"") >&5
13275   (eval $ac_link) 2>&5
13276   ac_status=$?
13277   echo "$as_me:13277: \$? = $ac_status" >&5
13278   (exit $ac_status); } &&
13279          { ac_try='test -s conftest$ac_exeext'
13280   { (eval echo "$as_me:13280: \"$ac_try\"") >&5
13281   (eval $ac_try) 2>&5
13282   ac_status=$?
13283   echo "$as_me:13283: \$? = $ac_status" >&5
13284   (exit $ac_status); }; }; then
13285   eval "$as_ac_Lib=yes"
13286 else
13287   echo "$as_me: failed program was:" >&5
13288 cat conftest.$ac_ext >&5
13289 eval "$as_ac_Lib=no"
13290 fi
13291 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13292 LIBS=$ac_check_lib_save_LIBS
13293 fi
13294 echo "$as_me:13294: result: `eval echo '${'$as_ac_Lib'}'`" >&5
13295 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
13296 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
13297   cf_cv_ncurses_pthreads=yes
13298 else
13299   cf_cv_ncurses_pthreads=no
13300 fi
13301
13302 if test "$cf_cv_ncurses_pthreads" = yes
13303 then
13304
13305 cf_add_libs="-lpthread"
13306 # Filter out duplicates - this happens with badly-designed ".pc" files...
13307 for cf_add_1lib in $LIBS
13308 do
13309         for cf_add_2lib in $cf_add_libs
13310         do
13311                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13312                 then
13313                         cf_add_1lib=
13314                         break
13315                 fi
13316         done
13317         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13318 done
13319 LIBS="$cf_add_libs"
13320
13321 fi
13322
13323 case $cf_cv_screen in
13324 (ncurses*)
13325         cf_cv_libtype=`echo "$cf_cv_screen" | sed -e 's/^ncurses//'`
13326         ;;
13327 (curses|curses_*)
13328
13329 echo "$as_me:13329: checking for NetBSD form.h" >&5
13330 echo $ECHO_N "checking for NetBSD form.h... $ECHO_C" >&6
13331 if test "${cf_cv_netbsd_form_h+set}" = set; then
13332   echo $ECHO_N "(cached) $ECHO_C" >&6
13333 else
13334
13335 cat >conftest.$ac_ext <<_ACEOF
13336 #line 13336 "configure"
13337 #include "confdefs.h"
13338
13339 #include <${cf_cv_ncurses_header:-curses.h}>
13340 #include <form.h>
13341
13342 int
13343 main ()
13344 {
13345
13346         FORM *form;
13347         int y = current_field(form)->cursor_ypos;
13348         int x = current_field(form)->cursor_xpos;
13349
13350   ;
13351   return 0;
13352 }
13353 _ACEOF
13354 rm -f conftest.$ac_objext
13355 if { (eval echo "$as_me:13355: \"$ac_compile\"") >&5
13356   (eval $ac_compile) 2>&5
13357   ac_status=$?
13358   echo "$as_me:13358: \$? = $ac_status" >&5
13359   (exit $ac_status); } &&
13360          { ac_try='test -s conftest.$ac_objext'
13361   { (eval echo "$as_me:13361: \"$ac_try\"") >&5
13362   (eval $ac_try) 2>&5
13363   ac_status=$?
13364   echo "$as_me:13364: \$? = $ac_status" >&5
13365   (exit $ac_status); }; }; then
13366   cf_cv_netbsd_form_h=yes
13367
13368 else
13369   echo "$as_me: failed program was:" >&5
13370 cat conftest.$ac_ext >&5
13371 cf_cv_netbsd_form_h=no
13372 fi
13373 rm -f conftest.$ac_objext conftest.$ac_ext
13374
13375 fi
13376 echo "$as_me:13376: result: $cf_cv_netbsd_form_h" >&5
13377 echo "${ECHO_T}$cf_cv_netbsd_form_h" >&6
13378
13379 test "$cf_cv_netbsd_form_h" = yes &&
13380 cat >>confdefs.h <<\EOF
13381 #define HAVE_NETBSD_FORM_H 1
13382 EOF
13383
13384 echo "$as_me:13384: checking for NetBSD menu.h" >&5
13385 echo $ECHO_N "checking for NetBSD menu.h... $ECHO_C" >&6
13386 if test "${cf_cv_netbsd_menu_h+set}" = set; then
13387   echo $ECHO_N "(cached) $ECHO_C" >&6
13388 else
13389
13390 cat >conftest.$ac_ext <<_ACEOF
13391 #line 13391 "configure"
13392 #include "confdefs.h"
13393
13394 #include <${cf_cv_ncurses_header:-curses.h}>
13395 #include <menu.h>
13396
13397 int
13398 main ()
13399 {
13400
13401         MENU *menu;
13402         int y = menu->max_item_width;
13403
13404   ;
13405   return 0;
13406 }
13407 _ACEOF
13408 rm -f conftest.$ac_objext
13409 if { (eval echo "$as_me:13409: \"$ac_compile\"") >&5
13410   (eval $ac_compile) 2>&5
13411   ac_status=$?
13412   echo "$as_me:13412: \$? = $ac_status" >&5
13413   (exit $ac_status); } &&
13414          { ac_try='test -s conftest.$ac_objext'
13415   { (eval echo "$as_me:13415: \"$ac_try\"") >&5
13416   (eval $ac_try) 2>&5
13417   ac_status=$?
13418   echo "$as_me:13418: \$? = $ac_status" >&5
13419   (exit $ac_status); }; }; then
13420   cf_cv_netbsd_menu_h=yes
13421
13422 else
13423   echo "$as_me: failed program was:" >&5
13424 cat conftest.$ac_ext >&5
13425 cf_cv_netbsd_menu_h=no
13426 fi
13427 rm -f conftest.$ac_objext conftest.$ac_ext
13428
13429 fi
13430 echo "$as_me:13430: result: $cf_cv_netbsd_menu_h" >&5
13431 echo "${ECHO_T}$cf_cv_netbsd_menu_h" >&6
13432
13433 test "$cf_cv_netbsd_menu_h" = yes &&
13434 cat >>confdefs.h <<\EOF
13435 #define HAVE_NETBSD_MENU_H 1
13436 EOF
13437
13438         ;;
13439 esac
13440
13441 case $cf_cv_screen in
13442 (pdcurses)
13443         ;;
13444 (*)
13445         # look for curses-related libraries
13446
13447 as_ac_Lib=`echo "ac_cv_lib_panel$cf_cv_libtype''_new_panel" | $as_tr_sh`
13448 echo "$as_me:13448: checking for new_panel in -lpanel$cf_cv_libtype" >&5
13449 echo $ECHO_N "checking for new_panel in -lpanel$cf_cv_libtype... $ECHO_C" >&6
13450 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
13451   echo $ECHO_N "(cached) $ECHO_C" >&6
13452 else
13453   ac_check_lib_save_LIBS=$LIBS
13454 LIBS="-lpanel$cf_cv_libtype  $LIBS"
13455 cat >conftest.$ac_ext <<_ACEOF
13456 #line 13456 "configure"
13457 #include "confdefs.h"
13458
13459 /* Override any gcc2 internal prototype to avoid an error.  */
13460 #ifdef __cplusplus
13461 extern "C"
13462 #endif
13463 /* We use char because int might match the return type of a gcc2
13464    builtin and then its argument prototype would still apply.  */
13465 char new_panel ();
13466 int
13467 main ()
13468 {
13469 new_panel ();
13470   ;
13471   return 0;
13472 }
13473 _ACEOF
13474 rm -f conftest.$ac_objext conftest$ac_exeext
13475 if { (eval echo "$as_me:13475: \"$ac_link\"") >&5
13476   (eval $ac_link) 2>&5
13477   ac_status=$?
13478   echo "$as_me:13478: \$? = $ac_status" >&5
13479   (exit $ac_status); } &&
13480          { ac_try='test -s conftest$ac_exeext'
13481   { (eval echo "$as_me:13481: \"$ac_try\"") >&5
13482   (eval $ac_try) 2>&5
13483   ac_status=$?
13484   echo "$as_me:13484: \$? = $ac_status" >&5
13485   (exit $ac_status); }; }; then
13486   eval "$as_ac_Lib=yes"
13487 else
13488   echo "$as_me: failed program was:" >&5
13489 cat conftest.$ac_ext >&5
13490 eval "$as_ac_Lib=no"
13491 fi
13492 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13493 LIBS=$ac_check_lib_save_LIBS
13494 fi
13495 echo "$as_me:13495: result: `eval echo '${'$as_ac_Lib'}'`" >&5
13496 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
13497 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
13498
13499 cf_upper=`echo "have_libpanel" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
13500
13501 cf_add_libs="-lpanel$cf_cv_libtype"
13502 # Filter out duplicates - this happens with badly-designed ".pc" files...
13503 for cf_add_1lib in $LIBS
13504 do
13505         for cf_add_2lib in $cf_add_libs
13506         do
13507                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13508                 then
13509                         cf_add_1lib=
13510                         break
13511                 fi
13512         done
13513         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13514 done
13515 LIBS="$cf_add_libs"
13516
13517 cat >>confdefs.h <<EOF
13518 #define $cf_upper 1
13519 EOF
13520
13521 fi
13522
13523 as_ac_Lib=`echo "ac_cv_lib_menu$cf_cv_libtype''_menu_driver" | $as_tr_sh`
13524 echo "$as_me:13524: checking for menu_driver in -lmenu$cf_cv_libtype" >&5
13525 echo $ECHO_N "checking for menu_driver in -lmenu$cf_cv_libtype... $ECHO_C" >&6
13526 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
13527   echo $ECHO_N "(cached) $ECHO_C" >&6
13528 else
13529   ac_check_lib_save_LIBS=$LIBS
13530 LIBS="-lmenu$cf_cv_libtype  $LIBS"
13531 cat >conftest.$ac_ext <<_ACEOF
13532 #line 13532 "configure"
13533 #include "confdefs.h"
13534
13535 /* Override any gcc2 internal prototype to avoid an error.  */
13536 #ifdef __cplusplus
13537 extern "C"
13538 #endif
13539 /* We use char because int might match the return type of a gcc2
13540    builtin and then its argument prototype would still apply.  */
13541 char menu_driver ();
13542 int
13543 main ()
13544 {
13545 menu_driver ();
13546   ;
13547   return 0;
13548 }
13549 _ACEOF
13550 rm -f conftest.$ac_objext conftest$ac_exeext
13551 if { (eval echo "$as_me:13551: \"$ac_link\"") >&5
13552   (eval $ac_link) 2>&5
13553   ac_status=$?
13554   echo "$as_me:13554: \$? = $ac_status" >&5
13555   (exit $ac_status); } &&
13556          { ac_try='test -s conftest$ac_exeext'
13557   { (eval echo "$as_me:13557: \"$ac_try\"") >&5
13558   (eval $ac_try) 2>&5
13559   ac_status=$?
13560   echo "$as_me:13560: \$? = $ac_status" >&5
13561   (exit $ac_status); }; }; then
13562   eval "$as_ac_Lib=yes"
13563 else
13564   echo "$as_me: failed program was:" >&5
13565 cat conftest.$ac_ext >&5
13566 eval "$as_ac_Lib=no"
13567 fi
13568 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13569 LIBS=$ac_check_lib_save_LIBS
13570 fi
13571 echo "$as_me:13571: result: `eval echo '${'$as_ac_Lib'}'`" >&5
13572 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
13573 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
13574
13575 cf_upper=`echo "have_libmenu" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
13576
13577 cf_add_libs="-lmenu$cf_cv_libtype"
13578 # Filter out duplicates - this happens with badly-designed ".pc" files...
13579 for cf_add_1lib in $LIBS
13580 do
13581         for cf_add_2lib in $cf_add_libs
13582         do
13583                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13584                 then
13585                         cf_add_1lib=
13586                         break
13587                 fi
13588         done
13589         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13590 done
13591 LIBS="$cf_add_libs"
13592
13593 cat >>confdefs.h <<EOF
13594 #define $cf_upper 1
13595 EOF
13596
13597 fi
13598
13599 as_ac_Lib=`echo "ac_cv_lib_form$cf_cv_libtype''_form_driver" | $as_tr_sh`
13600 echo "$as_me:13600: checking for form_driver in -lform$cf_cv_libtype" >&5
13601 echo $ECHO_N "checking for form_driver in -lform$cf_cv_libtype... $ECHO_C" >&6
13602 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
13603   echo $ECHO_N "(cached) $ECHO_C" >&6
13604 else
13605   ac_check_lib_save_LIBS=$LIBS
13606 LIBS="-lform$cf_cv_libtype  $LIBS"
13607 cat >conftest.$ac_ext <<_ACEOF
13608 #line 13608 "configure"
13609 #include "confdefs.h"
13610
13611 /* Override any gcc2 internal prototype to avoid an error.  */
13612 #ifdef __cplusplus
13613 extern "C"
13614 #endif
13615 /* We use char because int might match the return type of a gcc2
13616    builtin and then its argument prototype would still apply.  */
13617 char form_driver ();
13618 int
13619 main ()
13620 {
13621 form_driver ();
13622   ;
13623   return 0;
13624 }
13625 _ACEOF
13626 rm -f conftest.$ac_objext conftest$ac_exeext
13627 if { (eval echo "$as_me:13627: \"$ac_link\"") >&5
13628   (eval $ac_link) 2>&5
13629   ac_status=$?
13630   echo "$as_me:13630: \$? = $ac_status" >&5
13631   (exit $ac_status); } &&
13632          { ac_try='test -s conftest$ac_exeext'
13633   { (eval echo "$as_me:13633: \"$ac_try\"") >&5
13634   (eval $ac_try) 2>&5
13635   ac_status=$?
13636   echo "$as_me:13636: \$? = $ac_status" >&5
13637   (exit $ac_status); }; }; then
13638   eval "$as_ac_Lib=yes"
13639 else
13640   echo "$as_me: failed program was:" >&5
13641 cat conftest.$ac_ext >&5
13642 eval "$as_ac_Lib=no"
13643 fi
13644 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13645 LIBS=$ac_check_lib_save_LIBS
13646 fi
13647 echo "$as_me:13647: result: `eval echo '${'$as_ac_Lib'}'`" >&5
13648 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
13649 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
13650
13651 cf_upper=`echo "have_libform" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
13652
13653 cf_add_libs="-lform$cf_cv_libtype"
13654 # Filter out duplicates - this happens with badly-designed ".pc" files...
13655 for cf_add_1lib in $LIBS
13656 do
13657         for cf_add_2lib in $cf_add_libs
13658         do
13659                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13660                 then
13661                         cf_add_1lib=
13662                         break
13663                 fi
13664         done
13665         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13666 done
13667 LIBS="$cf_add_libs"
13668
13669 cat >>confdefs.h <<EOF
13670 #define $cf_upper 1
13671 EOF
13672
13673 fi
13674
13675         # look for curses-related headers
13676
13677 for ac_header in \
13678                 nc_alloc.h \
13679                 nomacros.h \
13680                 form.h \
13681                 menu.h \
13682                 panel.h \
13683                 term_entry.h \
13684
13685 do
13686 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
13687 echo "$as_me:13687: checking for $ac_header" >&5
13688 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
13689 if eval "test \"\${$as_ac_Header+set}\" = set"; then
13690   echo $ECHO_N "(cached) $ECHO_C" >&6
13691 else
13692   cat >conftest.$ac_ext <<_ACEOF
13693 #line 13693 "configure"
13694 #include "confdefs.h"
13695 #include <$ac_header>
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   eval "$as_ac_Header=yes"
13715 else
13716   echo "$as_me: failed program was:" >&5
13717   cat conftest.$ac_ext >&5
13718   eval "$as_ac_Header=no"
13719 fi
13720 rm -f conftest.err conftest.$ac_ext
13721 fi
13722 echo "$as_me:13722: result: `eval echo '${'$as_ac_Header'}'`" >&5
13723 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
13724 if test `eval echo '${'$as_ac_Header'}'` = yes; then
13725   cat >>confdefs.h <<EOF
13726 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
13727 EOF
13728
13729 fi
13730 done
13731
13732         ;;
13733 esac
13734
13735 echo "$as_me:13735: checking for ANSI C header files" >&5
13736 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
13737 if test "${ac_cv_header_stdc+set}" = set; then
13738   echo $ECHO_N "(cached) $ECHO_C" >&6
13739 else
13740   cat >conftest.$ac_ext <<_ACEOF
13741 #line 13741 "configure"
13742 #include "confdefs.h"
13743 #include <stdlib.h>
13744 #include <stdarg.h>
13745 #include <string.h>
13746 #include <float.h>
13747
13748 _ACEOF
13749 if { (eval echo "$as_me:13749: \"$ac_cpp conftest.$ac_ext\"") >&5
13750   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13751   ac_status=$?
13752   egrep -v '^ *\+' conftest.er1 >conftest.err
13753   rm -f conftest.er1
13754   cat conftest.err >&5
13755   echo "$as_me:13755: \$? = $ac_status" >&5
13756   (exit $ac_status); } >/dev/null; then
13757   if test -s conftest.err; then
13758     ac_cpp_err=$ac_c_preproc_warn_flag
13759   else
13760     ac_cpp_err=
13761   fi
13762 else
13763   ac_cpp_err=yes
13764 fi
13765 if test -z "$ac_cpp_err"; then
13766   ac_cv_header_stdc=yes
13767 else
13768   echo "$as_me: failed program was:" >&5
13769   cat conftest.$ac_ext >&5
13770   ac_cv_header_stdc=no
13771 fi
13772 rm -f conftest.err conftest.$ac_ext
13773
13774 if test $ac_cv_header_stdc = yes; then
13775   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
13776   cat >conftest.$ac_ext <<_ACEOF
13777 #line 13777 "configure"
13778 #include "confdefs.h"
13779 #include <string.h>
13780
13781 _ACEOF
13782 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13783   egrep "memchr" >/dev/null 2>&1; then
13784   :
13785 else
13786   ac_cv_header_stdc=no
13787 fi
13788 rm -rf conftest*
13789
13790 fi
13791
13792 if test $ac_cv_header_stdc = yes; then
13793   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
13794   cat >conftest.$ac_ext <<_ACEOF
13795 #line 13795 "configure"
13796 #include "confdefs.h"
13797 #include <stdlib.h>
13798
13799 _ACEOF
13800 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13801   egrep "free" >/dev/null 2>&1; then
13802   :
13803 else
13804   ac_cv_header_stdc=no
13805 fi
13806 rm -rf conftest*
13807
13808 fi
13809
13810 if test $ac_cv_header_stdc = yes; then
13811   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
13812   if test "$cross_compiling" = yes; then
13813   :
13814 else
13815   cat >conftest.$ac_ext <<_ACEOF
13816 #line 13816 "configure"
13817 #include "confdefs.h"
13818 #include <ctype.h>
13819 #if ((' ' & 0x0FF) == 0x020)
13820 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
13821 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
13822 #else
13823 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
13824                      || ('j' <= (c) && (c) <= 'r') \
13825                      || ('s' <= (c) && (c) <= 'z'))
13826 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
13827 #endif
13828
13829 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
13830 int
13831 main ()
13832 {
13833   int i;
13834   for (i = 0; i < 256; i++)
13835     if (XOR (islower (i), ISLOWER (i))
13836         || toupper (i) != TOUPPER (i))
13837       $ac_main_return(2);
13838   $ac_main_return (0);
13839 }
13840 _ACEOF
13841 rm -f conftest$ac_exeext
13842 if { (eval echo "$as_me:13842: \"$ac_link\"") >&5
13843   (eval $ac_link) 2>&5
13844   ac_status=$?
13845   echo "$as_me:13845: \$? = $ac_status" >&5
13846   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
13847   { (eval echo "$as_me:13847: \"$ac_try\"") >&5
13848   (eval $ac_try) 2>&5
13849   ac_status=$?
13850   echo "$as_me:13850: \$? = $ac_status" >&5
13851   (exit $ac_status); }; }; then
13852   :
13853 else
13854   echo "$as_me: program exited with status $ac_status" >&5
13855 echo "$as_me: failed program was:" >&5
13856 cat conftest.$ac_ext >&5
13857 ac_cv_header_stdc=no
13858 fi
13859 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
13860 fi
13861 fi
13862 fi
13863 echo "$as_me:13863: result: $ac_cv_header_stdc" >&5
13864 echo "${ECHO_T}$ac_cv_header_stdc" >&6
13865 if test $ac_cv_header_stdc = yes; then
13866
13867 cat >>confdefs.h <<\EOF
13868 #define STDC_HEADERS 1
13869 EOF
13870
13871 fi
13872
13873 echo "$as_me:13873: checking whether time.h and sys/time.h may both be included" >&5
13874 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
13875 if test "${ac_cv_header_time+set}" = set; then
13876   echo $ECHO_N "(cached) $ECHO_C" >&6
13877 else
13878   cat >conftest.$ac_ext <<_ACEOF
13879 #line 13879 "configure"
13880 #include "confdefs.h"
13881 #include <sys/types.h>
13882 #include <sys/time.h>
13883 #include <time.h>
13884
13885 int
13886 main ()
13887 {
13888 if ((struct tm *) 0)
13889 return 0;
13890   ;
13891   return 0;
13892 }
13893 _ACEOF
13894 rm -f conftest.$ac_objext
13895 if { (eval echo "$as_me:13895: \"$ac_compile\"") >&5
13896   (eval $ac_compile) 2>&5
13897   ac_status=$?
13898   echo "$as_me:13898: \$? = $ac_status" >&5
13899   (exit $ac_status); } &&
13900          { ac_try='test -s conftest.$ac_objext'
13901   { (eval echo "$as_me:13901: \"$ac_try\"") >&5
13902   (eval $ac_try) 2>&5
13903   ac_status=$?
13904   echo "$as_me:13904: \$? = $ac_status" >&5
13905   (exit $ac_status); }; }; then
13906   ac_cv_header_time=yes
13907 else
13908   echo "$as_me: failed program was:" >&5
13909 cat conftest.$ac_ext >&5
13910 ac_cv_header_time=no
13911 fi
13912 rm -f conftest.$ac_objext conftest.$ac_ext
13913 fi
13914 echo "$as_me:13914: result: $ac_cv_header_time" >&5
13915 echo "${ECHO_T}$ac_cv_header_time" >&6
13916 if test $ac_cv_header_time = yes; then
13917
13918 cat >>confdefs.h <<\EOF
13919 #define TIME_WITH_SYS_TIME 1
13920 EOF
13921
13922 fi
13923
13924 for ac_header in \
13925 getopt.h \
13926 locale.h \
13927 math.h \
13928 stdarg.h \
13929 sys/ioctl.h \
13930 sys/select.h \
13931 sys/time.h \
13932 termios.h \
13933 unistd.h \
13934
13935 do
13936 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
13937 echo "$as_me:13937: checking for $ac_header" >&5
13938 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
13939 if eval "test \"\${$as_ac_Header+set}\" = set"; then
13940   echo $ECHO_N "(cached) $ECHO_C" >&6
13941 else
13942   cat >conftest.$ac_ext <<_ACEOF
13943 #line 13943 "configure"
13944 #include "confdefs.h"
13945 #include <$ac_header>
13946 _ACEOF
13947 if { (eval echo "$as_me:13947: \"$ac_cpp conftest.$ac_ext\"") >&5
13948   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13949   ac_status=$?
13950   egrep -v '^ *\+' conftest.er1 >conftest.err
13951   rm -f conftest.er1
13952   cat conftest.err >&5
13953   echo "$as_me:13953: \$? = $ac_status" >&5
13954   (exit $ac_status); } >/dev/null; then
13955   if test -s conftest.err; then
13956     ac_cpp_err=$ac_c_preproc_warn_flag
13957   else
13958     ac_cpp_err=
13959   fi
13960 else
13961   ac_cpp_err=yes
13962 fi
13963 if test -z "$ac_cpp_err"; then
13964   eval "$as_ac_Header=yes"
13965 else
13966   echo "$as_me: failed program was:" >&5
13967   cat conftest.$ac_ext >&5
13968   eval "$as_ac_Header=no"
13969 fi
13970 rm -f conftest.err conftest.$ac_ext
13971 fi
13972 echo "$as_me:13972: result: `eval echo '${'$as_ac_Header'}'`" >&5
13973 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
13974 if test `eval echo '${'$as_ac_Header'}'` = yes; then
13975   cat >>confdefs.h <<EOF
13976 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
13977 EOF
13978
13979 fi
13980 done
13981
13982 for ac_header in unistd.h getopt.h
13983 do
13984 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
13985 echo "$as_me:13985: checking for $ac_header" >&5
13986 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
13987 if eval "test \"\${$as_ac_Header+set}\" = set"; then
13988   echo $ECHO_N "(cached) $ECHO_C" >&6
13989 else
13990   cat >conftest.$ac_ext <<_ACEOF
13991 #line 13991 "configure"
13992 #include "confdefs.h"
13993 #include <$ac_header>
13994 _ACEOF
13995 if { (eval echo "$as_me:13995: \"$ac_cpp conftest.$ac_ext\"") >&5
13996   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13997   ac_status=$?
13998   egrep -v '^ *\+' conftest.er1 >conftest.err
13999   rm -f conftest.er1
14000   cat conftest.err >&5
14001   echo "$as_me:14001: \$? = $ac_status" >&5
14002   (exit $ac_status); } >/dev/null; then
14003   if test -s conftest.err; then
14004     ac_cpp_err=$ac_c_preproc_warn_flag
14005   else
14006     ac_cpp_err=
14007   fi
14008 else
14009   ac_cpp_err=yes
14010 fi
14011 if test -z "$ac_cpp_err"; then
14012   eval "$as_ac_Header=yes"
14013 else
14014   echo "$as_me: failed program was:" >&5
14015   cat conftest.$ac_ext >&5
14016   eval "$as_ac_Header=no"
14017 fi
14018 rm -f conftest.err conftest.$ac_ext
14019 fi
14020 echo "$as_me:14020: result: `eval echo '${'$as_ac_Header'}'`" >&5
14021 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
14022 if test `eval echo '${'$as_ac_Header'}'` = yes; then
14023   cat >>confdefs.h <<EOF
14024 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
14025 EOF
14026
14027 fi
14028 done
14029
14030 echo "$as_me:14030: checking for header declaring getopt variables" >&5
14031 echo $ECHO_N "checking for header declaring getopt variables... $ECHO_C" >&6
14032 if test "${cf_cv_getopt_header+set}" = set; then
14033   echo $ECHO_N "(cached) $ECHO_C" >&6
14034 else
14035
14036 cf_cv_getopt_header=none
14037 for cf_header in stdio.h stdlib.h unistd.h getopt.h
14038 do
14039 cat >conftest.$ac_ext <<_ACEOF
14040 #line 14040 "configure"
14041 #include "confdefs.h"
14042
14043 #include <$cf_header>
14044 int
14045 main ()
14046 {
14047 int x = optind; char *y = optarg
14048   ;
14049   return 0;
14050 }
14051 _ACEOF
14052 rm -f conftest.$ac_objext
14053 if { (eval echo "$as_me:14053: \"$ac_compile\"") >&5
14054   (eval $ac_compile) 2>&5
14055   ac_status=$?
14056   echo "$as_me:14056: \$? = $ac_status" >&5
14057   (exit $ac_status); } &&
14058          { ac_try='test -s conftest.$ac_objext'
14059   { (eval echo "$as_me:14059: \"$ac_try\"") >&5
14060   (eval $ac_try) 2>&5
14061   ac_status=$?
14062   echo "$as_me:14062: \$? = $ac_status" >&5
14063   (exit $ac_status); }; }; then
14064   cf_cv_getopt_header=$cf_header
14065  break
14066 else
14067   echo "$as_me: failed program was:" >&5
14068 cat conftest.$ac_ext >&5
14069 fi
14070 rm -f conftest.$ac_objext conftest.$ac_ext
14071 done
14072
14073 fi
14074 echo "$as_me:14074: result: $cf_cv_getopt_header" >&5
14075 echo "${ECHO_T}$cf_cv_getopt_header" >&6
14076 if test $cf_cv_getopt_header != none ; then
14077
14078 cat >>confdefs.h <<\EOF
14079 #define HAVE_GETOPT_HEADER 1
14080 EOF
14081
14082 fi
14083 if test $cf_cv_getopt_header = getopt.h ; then
14084
14085 cat >>confdefs.h <<\EOF
14086 #define NEED_GETOPT_H 1
14087 EOF
14088
14089 fi
14090
14091 for ac_func in \
14092 getopt \
14093 gettimeofday \
14094
14095 do
14096 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
14097 echo "$as_me:14097: checking for $ac_func" >&5
14098 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
14099 if eval "test \"\${$as_ac_var+set}\" = set"; then
14100   echo $ECHO_N "(cached) $ECHO_C" >&6
14101 else
14102   cat >conftest.$ac_ext <<_ACEOF
14103 #line 14103 "configure"
14104 #include "confdefs.h"
14105 /* System header to define __stub macros and hopefully few prototypes,
14106     which can conflict with char $ac_func (); below.  */
14107 #include <assert.h>
14108 /* Override any gcc2 internal prototype to avoid an error.  */
14109 #ifdef __cplusplus
14110 extern "C"
14111 #endif
14112 /* We use char because int might match the return type of a gcc2
14113    builtin and then its argument prototype would still apply.  */
14114 char $ac_func ();
14115 char (*f) ();
14116
14117 int
14118 main ()
14119 {
14120 /* The GNU C library defines this for functions which it implements
14121     to always fail with ENOSYS.  Some functions are actually named
14122     something starting with __ and the normal name is an alias.  */
14123 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
14124 choke me
14125 #else
14126 f = $ac_func; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
14127 #endif
14128
14129   ;
14130   return 0;
14131 }
14132 _ACEOF
14133 rm -f conftest.$ac_objext conftest$ac_exeext
14134 if { (eval echo "$as_me:14134: \"$ac_link\"") >&5
14135   (eval $ac_link) 2>&5
14136   ac_status=$?
14137   echo "$as_me:14137: \$? = $ac_status" >&5
14138   (exit $ac_status); } &&
14139          { ac_try='test -s conftest$ac_exeext'
14140   { (eval echo "$as_me:14140: \"$ac_try\"") >&5
14141   (eval $ac_try) 2>&5
14142   ac_status=$?
14143   echo "$as_me:14143: \$? = $ac_status" >&5
14144   (exit $ac_status); }; }; then
14145   eval "$as_ac_var=yes"
14146 else
14147   echo "$as_me: failed program was:" >&5
14148 cat conftest.$ac_ext >&5
14149 eval "$as_ac_var=no"
14150 fi
14151 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14152 fi
14153 echo "$as_me:14153: result: `eval echo '${'$as_ac_var'}'`" >&5
14154 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
14155 if test `eval echo '${'$as_ac_var'}'` = yes; then
14156   cat >>confdefs.h <<EOF
14157 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
14158 EOF
14159
14160 fi
14161 done
14162
14163 if test "x$ac_cv_func_getopt" = xno; then
14164         { { echo "$as_me:14164: error: getopt is required for building programs" >&5
14165 echo "$as_me: error: getopt is required for building programs" >&2;}
14166    { (exit 1); exit 1; }; }
14167 fi
14168
14169 if test "$cf_enable_widec" = yes; then
14170
14171 for ac_func in \
14172 mblen \
14173 mbrlen \
14174 mbrtowc \
14175 mbsrtowcs \
14176 mbstowcs \
14177 mbtowc \
14178 wcsrtombs \
14179 wcstombs \
14180
14181 do
14182 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
14183 echo "$as_me:14183: checking for $ac_func" >&5
14184 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
14185 if eval "test \"\${$as_ac_var+set}\" = set"; then
14186   echo $ECHO_N "(cached) $ECHO_C" >&6
14187 else
14188   cat >conftest.$ac_ext <<_ACEOF
14189 #line 14189 "configure"
14190 #include "confdefs.h"
14191 /* System header to define __stub macros and hopefully few prototypes,
14192     which can conflict with char $ac_func (); below.  */
14193 #include <assert.h>
14194 /* Override any gcc2 internal prototype to avoid an error.  */
14195 #ifdef __cplusplus
14196 extern "C"
14197 #endif
14198 /* We use char because int might match the return type of a gcc2
14199    builtin and then its argument prototype would still apply.  */
14200 char $ac_func ();
14201 char (*f) ();
14202
14203 int
14204 main ()
14205 {
14206 /* The GNU C library defines this for functions which it implements
14207     to always fail with ENOSYS.  Some functions are actually named
14208     something starting with __ and the normal name is an alias.  */
14209 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
14210 choke me
14211 #else
14212 f = $ac_func; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
14213 #endif
14214
14215   ;
14216   return 0;
14217 }
14218 _ACEOF
14219 rm -f conftest.$ac_objext conftest$ac_exeext
14220 if { (eval echo "$as_me:14220: \"$ac_link\"") >&5
14221   (eval $ac_link) 2>&5
14222   ac_status=$?
14223   echo "$as_me:14223: \$? = $ac_status" >&5
14224   (exit $ac_status); } &&
14225          { ac_try='test -s conftest$ac_exeext'
14226   { (eval echo "$as_me:14226: \"$ac_try\"") >&5
14227   (eval $ac_try) 2>&5
14228   ac_status=$?
14229   echo "$as_me:14229: \$? = $ac_status" >&5
14230   (exit $ac_status); }; }; then
14231   eval "$as_ac_var=yes"
14232 else
14233   echo "$as_me: failed program was:" >&5
14234 cat conftest.$ac_ext >&5
14235 eval "$as_ac_var=no"
14236 fi
14237 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14238 fi
14239 echo "$as_me:14239: result: `eval echo '${'$as_ac_var'}'`" >&5
14240 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
14241 if test `eval echo '${'$as_ac_var'}'` = yes; then
14242   cat >>confdefs.h <<EOF
14243 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
14244 EOF
14245
14246 fi
14247 done
14248
14249 fi
14250
14251 echo "$as_me:14251: checking definition to turn on extended curses functions" >&5
14252 echo $ECHO_N "checking definition to turn on extended curses functions... $ECHO_C" >&6
14253 if test "${cf_cv_need_xopen_extension+set}" = set; then
14254   echo $ECHO_N "(cached) $ECHO_C" >&6
14255 else
14256
14257 cf_cv_need_xopen_extension=unknown
14258 cat >conftest.$ac_ext <<_ACEOF
14259 #line 14259 "configure"
14260 #include "confdefs.h"
14261
14262 #include <stdlib.h>
14263 #include <${cf_cv_ncurses_header:-curses.h}>
14264 int
14265 main ()
14266 {
14267
14268 #if defined(NCURSES_VERSION_PATCH)
14269 #if (NCURSES_VERSION_PATCH < 20100501) && (NCURSES_VERSION_PATCH >= 20100403)
14270         make an error
14271 #endif
14272 #endif
14273 #ifdef NCURSES_VERSION
14274         cchar_t check;
14275         int check2 = curs_set((int)sizeof(check));
14276 #endif
14277         long x = winnstr(stdscr, "", 0);
14278         int x1, y1;
14279         getbegyx(stdscr, y1, x1)
14280   ;
14281   return 0;
14282 }
14283 _ACEOF
14284 rm -f conftest.$ac_objext conftest$ac_exeext
14285 if { (eval echo "$as_me:14285: \"$ac_link\"") >&5
14286   (eval $ac_link) 2>&5
14287   ac_status=$?
14288   echo "$as_me:14288: \$? = $ac_status" >&5
14289   (exit $ac_status); } &&
14290          { ac_try='test -s conftest$ac_exeext'
14291   { (eval echo "$as_me:14291: \"$ac_try\"") >&5
14292   (eval $ac_try) 2>&5
14293   ac_status=$?
14294   echo "$as_me:14294: \$? = $ac_status" >&5
14295   (exit $ac_status); }; }; then
14296   cf_cv_need_xopen_extension=none
14297 else
14298   echo "$as_me: failed program was:" >&5
14299 cat conftest.$ac_ext >&5
14300
14301         for cf_try_xopen_extension in _XOPEN_SOURCE_EXTENDED NCURSES_WIDECHAR
14302         do
14303                 cat >conftest.$ac_ext <<_ACEOF
14304 #line 14304 "configure"
14305 #include "confdefs.h"
14306
14307 #define $cf_try_xopen_extension 1
14308 #include <stdlib.h>
14309 #include <${cf_cv_ncurses_header:-curses.h}>
14310 int
14311 main ()
14312 {
14313
14314 #ifdef NCURSES_VERSION
14315                 cchar_t check;
14316                 int check2 = curs_set((int)sizeof(check));
14317 #endif
14318                 long x = winnstr(stdscr, "", 0);
14319                 int x1, y1;
14320                 getbegyx(stdscr, y1, x1)
14321   ;
14322   return 0;
14323 }
14324 _ACEOF
14325 rm -f conftest.$ac_objext conftest$ac_exeext
14326 if { (eval echo "$as_me:14326: \"$ac_link\"") >&5
14327   (eval $ac_link) 2>&5
14328   ac_status=$?
14329   echo "$as_me:14329: \$? = $ac_status" >&5
14330   (exit $ac_status); } &&
14331          { ac_try='test -s conftest$ac_exeext'
14332   { (eval echo "$as_me:14332: \"$ac_try\"") >&5
14333   (eval $ac_try) 2>&5
14334   ac_status=$?
14335   echo "$as_me:14335: \$? = $ac_status" >&5
14336   (exit $ac_status); }; }; then
14337   cf_cv_need_xopen_extension=$cf_try_xopen_extension; break
14338 else
14339   echo "$as_me: failed program was:" >&5
14340 cat conftest.$ac_ext >&5
14341 fi
14342 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14343         done
14344
14345 fi
14346 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14347
14348 fi
14349 echo "$as_me:14349: result: $cf_cv_need_xopen_extension" >&5
14350 echo "${ECHO_T}$cf_cv_need_xopen_extension" >&6
14351
14352 case $cf_cv_need_xopen_extension in
14353 (*_*)
14354         CPPFLAGS="$CPPFLAGS -D$cf_cv_need_xopen_extension"
14355         ;;
14356 esac
14357
14358 echo "$as_me:14358: checking for term.h" >&5
14359 echo $ECHO_N "checking for term.h... $ECHO_C" >&6
14360 if test "${cf_cv_term_header+set}" = set; then
14361   echo $ECHO_N "(cached) $ECHO_C" >&6
14362 else
14363
14364 # If we found <ncurses/curses.h>, look for <ncurses/term.h>, but always look
14365 # for <term.h> if we do not find the variant.
14366
14367 cf_header_list="term.h ncurses/term.h ncursesw/term.h"
14368
14369 case ${cf_cv_ncurses_header:-curses.h} in
14370 (*/*)
14371         cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`term.h
14372         cf_header_list="$cf_header_item $cf_header_list"
14373         ;;
14374 esac
14375
14376 for cf_header in $cf_header_list
14377 do
14378         cat >conftest.$ac_ext <<_ACEOF
14379 #line 14379 "configure"
14380 #include "confdefs.h"
14381
14382 #include <${cf_cv_ncurses_header:-curses.h}>
14383 #include <${cf_header}>
14384 int
14385 main ()
14386 {
14387 WINDOW *x
14388   ;
14389   return 0;
14390 }
14391 _ACEOF
14392 rm -f conftest.$ac_objext
14393 if { (eval echo "$as_me:14393: \"$ac_compile\"") >&5
14394   (eval $ac_compile) 2>&5
14395   ac_status=$?
14396   echo "$as_me:14396: \$? = $ac_status" >&5
14397   (exit $ac_status); } &&
14398          { ac_try='test -s conftest.$ac_objext'
14399   { (eval echo "$as_me:14399: \"$ac_try\"") >&5
14400   (eval $ac_try) 2>&5
14401   ac_status=$?
14402   echo "$as_me:14402: \$? = $ac_status" >&5
14403   (exit $ac_status); }; }; then
14404   cf_cv_term_header=$cf_header
14405          break
14406 else
14407   echo "$as_me: failed program was:" >&5
14408 cat conftest.$ac_ext >&5
14409 cf_cv_term_header=no
14410 fi
14411 rm -f conftest.$ac_objext conftest.$ac_ext
14412 done
14413
14414 case $cf_cv_term_header in
14415 (no)
14416         # If curses is ncurses, some packagers still mess it up by trying to make
14417         # us use GNU termcap.  This handles the most common case.
14418         for cf_header in ncurses/term.h ncursesw/term.h
14419         do
14420                 cat >conftest.$ac_ext <<_ACEOF
14421 #line 14421 "configure"
14422 #include "confdefs.h"
14423
14424 #include <${cf_cv_ncurses_header:-curses.h}>
14425 #ifdef NCURSES_VERSION
14426 #include <${cf_header}>
14427 #else
14428 make an error
14429 #endif
14430 int
14431 main ()
14432 {
14433 WINDOW *x
14434   ;
14435   return 0;
14436 }
14437 _ACEOF
14438 rm -f conftest.$ac_objext
14439 if { (eval echo "$as_me:14439: \"$ac_compile\"") >&5
14440   (eval $ac_compile) 2>&5
14441   ac_status=$?
14442   echo "$as_me:14442: \$? = $ac_status" >&5
14443   (exit $ac_status); } &&
14444          { ac_try='test -s conftest.$ac_objext'
14445   { (eval echo "$as_me:14445: \"$ac_try\"") >&5
14446   (eval $ac_try) 2>&5
14447   ac_status=$?
14448   echo "$as_me:14448: \$? = $ac_status" >&5
14449   (exit $ac_status); }; }; then
14450   cf_cv_term_header=$cf_header
14451                          break
14452 else
14453   echo "$as_me: failed program was:" >&5
14454 cat conftest.$ac_ext >&5
14455 cf_cv_term_header=no
14456 fi
14457 rm -f conftest.$ac_objext conftest.$ac_ext
14458         done
14459         ;;
14460 esac
14461
14462 fi
14463 echo "$as_me:14463: result: $cf_cv_term_header" >&5
14464 echo "${ECHO_T}$cf_cv_term_header" >&6
14465
14466 case $cf_cv_term_header in
14467 (term.h)
14468
14469 cat >>confdefs.h <<\EOF
14470 #define HAVE_TERM_H 1
14471 EOF
14472
14473         ;;
14474 (ncurses/term.h)
14475
14476 cat >>confdefs.h <<\EOF
14477 #define HAVE_NCURSES_TERM_H 1
14478 EOF
14479
14480         ;;
14481 (ncursesw/term.h)
14482
14483 cat >>confdefs.h <<\EOF
14484 #define HAVE_NCURSESW_TERM_H 1
14485 EOF
14486
14487         ;;
14488 esac
14489
14490 echo "$as_me:14490: checking for unctrl.h" >&5
14491 echo $ECHO_N "checking for unctrl.h... $ECHO_C" >&6
14492 if test "${cf_cv_unctrl_header+set}" = set; then
14493   echo $ECHO_N "(cached) $ECHO_C" >&6
14494 else
14495
14496 # If we found <ncurses/curses.h>, look for <ncurses/unctrl.h>, but always look
14497 # for <unctrl.h> if we do not find the variant.
14498
14499 cf_header_list="unctrl.h ncurses/unctrl.h ncursesw/unctrl.h"
14500
14501 case ${cf_cv_ncurses_header:-curses.h} in
14502 (*/*)
14503         cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`unctrl.h
14504         cf_header_list="$cf_header_item $cf_header_list"
14505         ;;
14506 esac
14507
14508 for cf_header in $cf_header_list
14509 do
14510         cat >conftest.$ac_ext <<_ACEOF
14511 #line 14511 "configure"
14512 #include "confdefs.h"
14513
14514 #include <${cf_cv_ncurses_header:-curses.h}>
14515 #include <${cf_header}>
14516 int
14517 main ()
14518 {
14519 WINDOW *x
14520   ;
14521   return 0;
14522 }
14523 _ACEOF
14524 rm -f conftest.$ac_objext
14525 if { (eval echo "$as_me:14525: \"$ac_compile\"") >&5
14526   (eval $ac_compile) 2>&5
14527   ac_status=$?
14528   echo "$as_me:14528: \$? = $ac_status" >&5
14529   (exit $ac_status); } &&
14530          { ac_try='test -s conftest.$ac_objext'
14531   { (eval echo "$as_me:14531: \"$ac_try\"") >&5
14532   (eval $ac_try) 2>&5
14533   ac_status=$?
14534   echo "$as_me:14534: \$? = $ac_status" >&5
14535   (exit $ac_status); }; }; then
14536   cf_cv_unctrl_header=$cf_header
14537          break
14538 else
14539   echo "$as_me: failed program was:" >&5
14540 cat conftest.$ac_ext >&5
14541 cf_cv_unctrl_header=no
14542 fi
14543 rm -f conftest.$ac_objext conftest.$ac_ext
14544 done
14545
14546 fi
14547 echo "$as_me:14547: result: $cf_cv_unctrl_header" >&5
14548 echo "${ECHO_T}$cf_cv_unctrl_header" >&6
14549
14550 case $cf_cv_unctrl_header in
14551 (no)
14552         { echo "$as_me:14552: WARNING: unctrl.h header not found" >&5
14553 echo "$as_me: WARNING: unctrl.h header not found" >&2;}
14554         ;;
14555 esac
14556
14557 case $cf_cv_unctrl_header in
14558 (unctrl.h)
14559
14560 cat >>confdefs.h <<\EOF
14561 #define HAVE_UNCTRL_H 1
14562 EOF
14563
14564         ;;
14565 (ncurses/unctrl.h)
14566
14567 cat >>confdefs.h <<\EOF
14568 #define HAVE_NCURSES_UNCTRL_H 1
14569 EOF
14570
14571         ;;
14572 (ncursesw/unctrl.h)
14573
14574 cat >>confdefs.h <<\EOF
14575 #define HAVE_NCURSESW_UNCTRL_H 1
14576 EOF
14577
14578         ;;
14579 esac
14580
14581 for cf_func in \
14582 assume_default_colors \
14583 chgat \
14584 color_set \
14585 filter \
14586 getbegx \
14587 getcurx \
14588 getmaxx \
14589 getnstr \
14590 getparx \
14591 getwin \
14592 mvvline \
14593 mvwvline \
14594 napms \
14595 putwin \
14596 resize_term \
14597 resizeterm \
14598 restartterm \
14599 ripoffline \
14600 scr_dump \
14601 setupterm \
14602 slk_color \
14603 slk_init \
14604 termattrs \
14605 tgetent \
14606 tigetnum \
14607 tigetstr \
14608 typeahead \
14609 use_default_colors \
14610 use_env \
14611 use_extended_names \
14612 use_screen \
14613 use_window \
14614 vid_puts \
14615 vidputs \
14616 vsscanf \
14617 vw_printw \
14618 wchgat \
14619 winsstr \
14620 wresize \
14621 wsyncdown \
14622
14623 do
14624
14625 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14626
14627         echo "$as_me:14627: checking for ${cf_func}" >&5
14628 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
14629
14630 echo "${as_me:-configure}:14630: testing ${cf_func} ..." 1>&5
14631
14632         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
14633   echo $ECHO_N "(cached) $ECHO_C" >&6
14634 else
14635
14636                 eval cf_result='$ac_cv_func_'$cf_func
14637                 if test ".$cf_result" != ".no"; then
14638                         cat >conftest.$ac_ext <<_ACEOF
14639 #line 14639 "configure"
14640 #include "confdefs.h"
14641
14642 #ifdef HAVE_XCURSES
14643 #include <xcurses.h>
14644 char * XCursesProgramName = "test";
14645 #else
14646 #include <${cf_cv_ncurses_header:-curses.h}>
14647 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
14648 #include <ncursesw/term.h>
14649 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
14650 #include <ncurses/term.h>
14651 #elif defined(HAVE_TERM_H)
14652 #include <term.h>
14653 #endif
14654 #endif
14655
14656 int
14657 main ()
14658 {
14659
14660 #ifndef ${cf_func}
14661 long foo = (long)(&${cf_func});
14662 fprintf(stderr, "testing linkage of $cf_func:%p\n", foo);
14663 if (foo + 1234 > 5678)
14664         ${cf_cv_main_return:-return}(foo);
14665 #endif
14666
14667   ;
14668   return 0;
14669 }
14670 _ACEOF
14671 rm -f conftest.$ac_objext conftest$ac_exeext
14672 if { (eval echo "$as_me:14672: \"$ac_link\"") >&5
14673   (eval $ac_link) 2>&5
14674   ac_status=$?
14675   echo "$as_me:14675: \$? = $ac_status" >&5
14676   (exit $ac_status); } &&
14677          { ac_try='test -s conftest$ac_exeext'
14678   { (eval echo "$as_me:14678: \"$ac_try\"") >&5
14679   (eval $ac_try) 2>&5
14680   ac_status=$?
14681   echo "$as_me:14681: \$? = $ac_status" >&5
14682   (exit $ac_status); }; }; then
14683   cf_result=yes
14684 else
14685   echo "$as_me: failed program was:" >&5
14686 cat conftest.$ac_ext >&5
14687 cf_result=no
14688 fi
14689 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14690                 fi
14691                 eval 'cf_cv_func_'$cf_func'=$cf_result'
14692
14693 fi
14694
14695         # use the computed/retrieved cache-value:
14696         eval 'cf_result=$cf_cv_func_'$cf_func
14697         echo "$as_me:14697: result: $cf_result" >&5
14698 echo "${ECHO_T}$cf_result" >&6
14699         if test $cf_result != no; then
14700                 cat >>confdefs.h <<EOF
14701 #define HAVE_${cf_tr_func} 1
14702 EOF
14703
14704         fi
14705 done
14706
14707 for cf_func in tputs
14708 do
14709
14710 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14711
14712         echo "$as_me:14712: checking for ${cf_func}" >&5
14713 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
14714
14715 echo "${as_me:-configure}:14715: testing ${cf_func} ..." 1>&5
14716
14717         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
14718   echo $ECHO_N "(cached) $ECHO_C" >&6
14719 else
14720
14721                 eval cf_result='$ac_cv_func_'$cf_func
14722                 if test ".$cf_result" != ".no"; then
14723                         cat >conftest.$ac_ext <<_ACEOF
14724 #line 14724 "configure"
14725 #include "confdefs.h"
14726
14727 #ifdef HAVE_XCURSES
14728 #include <xcurses.h>
14729 char * XCursesProgramName = "test";
14730 #else
14731 #include <${cf_cv_ncurses_header:-curses.h}>
14732 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
14733 #include <ncursesw/term.h>
14734 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
14735 #include <ncurses/term.h>
14736 #elif defined(HAVE_TERM_H)
14737 #include <term.h>
14738 #endif
14739 #endif
14740
14741 int
14742 main ()
14743 {
14744
14745 #ifndef ${cf_func}
14746 long foo = (long)(&${cf_func});
14747 fprintf(stderr, "testing linkage of $cf_func:%p\n", foo);
14748 if (foo + 1234 > 5678)
14749         ${cf_cv_main_return:-return}(foo);
14750 #endif
14751
14752   ;
14753   return 0;
14754 }
14755 _ACEOF
14756 rm -f conftest.$ac_objext conftest$ac_exeext
14757 if { (eval echo "$as_me:14757: \"$ac_link\"") >&5
14758   (eval $ac_link) 2>&5
14759   ac_status=$?
14760   echo "$as_me:14760: \$? = $ac_status" >&5
14761   (exit $ac_status); } &&
14762          { ac_try='test -s conftest$ac_exeext'
14763   { (eval echo "$as_me:14763: \"$ac_try\"") >&5
14764   (eval $ac_try) 2>&5
14765   ac_status=$?
14766   echo "$as_me:14766: \$? = $ac_status" >&5
14767   (exit $ac_status); }; }; then
14768   cf_result=yes
14769 else
14770   echo "$as_me: failed program was:" >&5
14771 cat conftest.$ac_ext >&5
14772 cf_result=no
14773 fi
14774 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14775                 fi
14776                 eval 'cf_cv_func_'$cf_func'=$cf_result'
14777
14778 fi
14779
14780         # use the computed/retrieved cache-value:
14781         eval 'cf_result=$cf_cv_func_'$cf_func
14782         echo "$as_me:14782: result: $cf_result" >&5
14783 echo "${ECHO_T}$cf_result" >&6
14784         if test $cf_result != no; then
14785                 cat >>confdefs.h <<EOF
14786 #define HAVE_${cf_tr_func} 1
14787 EOF
14788
14789         fi
14790 done
14791
14792 if test x$cf_cv_func_tputs = xyes
14793 then
14794         cf_done=no
14795         for cf_arg in int char
14796         do
14797                 for cf_ret in int void
14798                 do
14799                         if test $cf_ret = void
14800                         then
14801                                 cf_return="/* nothing */"
14802                         else
14803                                 cf_return="return value"
14804                         fi
14805                         cat >conftest.$ac_ext <<_ACEOF
14806 #line 14806 "configure"
14807 #include "confdefs.h"
14808
14809 #include <${cf_cv_ncurses_header:-curses.h}>
14810 #include <$cf_cv_term_header>
14811
14812 static $cf_ret outc($cf_arg value) { $cf_return; }
14813
14814 int
14815 main ()
14816 {
14817
14818         tputs("hello", 0, outc);
14819         ${cf_cv_main_return:-return}(0);
14820
14821   ;
14822   return 0;
14823 }
14824 _ACEOF
14825 rm -f conftest.$ac_objext
14826 if { (eval echo "$as_me:14826: \"$ac_compile\"") >&5
14827   (eval $ac_compile) 2>&5
14828   ac_status=$?
14829   echo "$as_me:14829: \$? = $ac_status" >&5
14830   (exit $ac_status); } &&
14831          { ac_try='test -s conftest.$ac_objext'
14832   { (eval echo "$as_me:14832: \"$ac_try\"") >&5
14833   (eval $ac_try) 2>&5
14834   ac_status=$?
14835   echo "$as_me:14835: \$? = $ac_status" >&5
14836   (exit $ac_status); }; }; then
14837
14838                 test -n "$verbose" && echo "    prototype $cf_ret func($cf_arg value)" 1>&6
14839
14840 echo "${as_me:-configure}:14840: testing prototype $cf_ret func($cf_arg value) ..." 1>&5
14841
14842                 cat >>confdefs.h <<EOF
14843 #define TPUTS_ARG               $cf_arg
14844 #define TPUTS_PROTO(func,value) $cf_ret func(TPUTS_ARG value)
14845 #define TPUTS_RETURN(value)     $cf_return
14846 EOF
14847                 cf_done=yes
14848                 break
14849
14850 else
14851   echo "$as_me: failed program was:" >&5
14852 cat conftest.$ac_ext >&5
14853 fi
14854 rm -f conftest.$ac_objext conftest.$ac_ext
14855                 done
14856                 test $cf_done = yes && break
14857         done
14858 fi
14859
14860 echo "$as_me:14860: checking for ncurses extended functions" >&5
14861 echo $ECHO_N "checking for ncurses extended functions... $ECHO_C" >&6
14862 if test "${cf_cv_ncurses_ext_funcs+set}" = set; then
14863   echo $ECHO_N "(cached) $ECHO_C" >&6
14864 else
14865
14866 cat >conftest.$ac_ext <<_ACEOF
14867 #line 14867 "configure"
14868 #include "confdefs.h"
14869
14870 #include <${cf_cv_ncurses_header:-curses.h}>
14871 int
14872 main ()
14873 {
14874
14875 int x = NCURSES_EXT_FUNCS
14876
14877   ;
14878   return 0;
14879 }
14880 _ACEOF
14881 rm -f conftest.$ac_objext
14882 if { (eval echo "$as_me:14882: \"$ac_compile\"") >&5
14883   (eval $ac_compile) 2>&5
14884   ac_status=$?
14885   echo "$as_me:14885: \$? = $ac_status" >&5
14886   (exit $ac_status); } &&
14887          { ac_try='test -s conftest.$ac_objext'
14888   { (eval echo "$as_me:14888: \"$ac_try\"") >&5
14889   (eval $ac_try) 2>&5
14890   ac_status=$?
14891   echo "$as_me:14891: \$? = $ac_status" >&5
14892   (exit $ac_status); }; }; then
14893   cf_cv_ncurses_ext_funcs=defined
14894 else
14895   echo "$as_me: failed program was:" >&5
14896 cat conftest.$ac_ext >&5
14897
14898 cat >conftest.$ac_ext <<_ACEOF
14899 #line 14899 "configure"
14900 #include "confdefs.h"
14901
14902 #include <${cf_cv_ncurses_header:-curses.h}>
14903 int
14904 main ()
14905 {
14906
14907         (void) assume_default_colors (0, 0);
14908         (void) curses_version ();
14909         (void) define_key (0, 0);
14910         (void) is_term_resized (0, 0);
14911         (void) key_defined (0);
14912         (void) keybound (0, 0);
14913         (void) keyok (0, 0);
14914         (void) resize_term (0, 0);
14915         (void) resizeterm (0, 0);
14916         (void) use_default_colors ();
14917         (void) use_extended_names (0);
14918         (void) wresize (0, 0, 0);
14919   ;
14920   return 0;
14921 }
14922 _ACEOF
14923 rm -f conftest.$ac_objext conftest$ac_exeext
14924 if { (eval echo "$as_me:14924: \"$ac_link\"") >&5
14925   (eval $ac_link) 2>&5
14926   ac_status=$?
14927   echo "$as_me:14927: \$? = $ac_status" >&5
14928   (exit $ac_status); } &&
14929          { ac_try='test -s conftest$ac_exeext'
14930   { (eval echo "$as_me:14930: \"$ac_try\"") >&5
14931   (eval $ac_try) 2>&5
14932   ac_status=$?
14933   echo "$as_me:14933: \$? = $ac_status" >&5
14934   (exit $ac_status); }; }; then
14935   cf_cv_ncurses_ext_funcs=yes
14936 else
14937   echo "$as_me: failed program was:" >&5
14938 cat conftest.$ac_ext >&5
14939 cf_cv_ncurses_ext_funcs=no
14940 fi
14941 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14942
14943 fi
14944 rm -f conftest.$ac_objext conftest.$ac_ext
14945
14946 fi
14947 echo "$as_me:14947: result: $cf_cv_ncurses_ext_funcs" >&5
14948 echo "${ECHO_T}$cf_cv_ncurses_ext_funcs" >&6
14949 test "$cf_cv_ncurses_ext_funcs" = yes &&
14950 cat >>confdefs.h <<\EOF
14951 #define NCURSES_EXT_FUNCS 1
14952 EOF
14953
14954 if test "$cf_enable_widec" = yes
14955 then
14956         # workaround for systems with ncurses before 20111029, due to change of
14957         # feature test macro from _XPG5 to _XOPEN_SOURCE
14958         if test -n "$cf_cv_ncurses_version" && test "x$cf_cv_ncurses_version" != xno
14959         then
14960                 cf_define_xpg5=no
14961                 echo "$as_me:14961: checking if _XPG5 should be defined to enable wide-characters" >&5
14962 echo $ECHO_N "checking if _XPG5 should be defined to enable wide-characters... $ECHO_C" >&6
14963
14964                 cat >conftest.$ac_ext <<_ACEOF
14965 #line 14965 "configure"
14966 #include "confdefs.h"
14967
14968 #include <${cf_cv_ncurses_header:-curses.h}>
14969 int
14970 main ()
14971 {
14972 int x = _XPG5
14973   ;
14974   return 0;
14975 }
14976 _ACEOF
14977 rm -f conftest.$ac_objext
14978 if { (eval echo "$as_me:14978: \"$ac_compile\"") >&5
14979   (eval $ac_compile) 2>&5
14980   ac_status=$?
14981   echo "$as_me:14981: \$? = $ac_status" >&5
14982   (exit $ac_status); } &&
14983          { ac_try='test -s conftest.$ac_objext'
14984   { (eval echo "$as_me:14984: \"$ac_try\"") >&5
14985   (eval $ac_try) 2>&5
14986   ac_status=$?
14987   echo "$as_me:14987: \$? = $ac_status" >&5
14988   (exit $ac_status); }; }; then
14989   :
14990 else
14991   echo "$as_me: failed program was:" >&5
14992 cat conftest.$ac_ext >&5
14993 cf_save_cppflags="$CPPFLAGS"
14994                          CPPFLAGS="$CPPFLAGS -D_XPG5"
14995                          cat >conftest.$ac_ext <<_ACEOF
14996 #line 14996 "configure"
14997 #include "confdefs.h"
14998
14999 #include <${cf_cv_ncurses_header:-curses.h}>
15000 int
15001 main ()
15002 {
15003 int x = _XPG5
15004   ;
15005   return 0;
15006 }
15007 _ACEOF
15008 rm -f conftest.$ac_objext
15009 if { (eval echo "$as_me:15009: \"$ac_compile\"") >&5
15010   (eval $ac_compile) 2>&5
15011   ac_status=$?
15012   echo "$as_me:15012: \$? = $ac_status" >&5
15013   (exit $ac_status); } &&
15014          { ac_try='test -s conftest.$ac_objext'
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_define_xpg5=yes
15021 else
15022   echo "$as_me: failed program was:" >&5
15023 cat conftest.$ac_ext >&5
15024 fi
15025 rm -f conftest.$ac_objext conftest.$ac_ext
15026                          CPPFLAGS="$cf_save_cppflags"
15027 fi
15028 rm -f conftest.$ac_objext conftest.$ac_ext
15029                 echo "$as_me:15029: result: $cf_define_xpg5" >&5
15030 echo "${ECHO_T}$cf_define_xpg5" >&6
15031
15032                 if test "$cf_define_xpg5" = yes
15033                 then
15034                         CPPFLAGS="$CPPFLAGS -D_XPG5"
15035                 fi
15036         fi
15037
15038         echo "$as_me:15038: checking for wide-character functions" >&5
15039 echo $ECHO_N "checking for wide-character functions... $ECHO_C" >&6
15040 if test "${cf_cv_widechar_funcs+set}" = set; then
15041   echo $ECHO_N "(cached) $ECHO_C" >&6
15042 else
15043
15044         cat >conftest.$ac_ext <<_ACEOF
15045 #line 15045 "configure"
15046 #include "confdefs.h"
15047
15048 #include <${cf_cv_ncurses_header:-curses.h}>
15049 int
15050 main ()
15051 {
15052
15053                 static wchar_t src_wchar[2];
15054                 static cchar_t dst_cchar;
15055                 setcchar(&dst_cchar, src_wchar, A_NORMAL, 0, (void *) 0);
15056
15057   ;
15058   return 0;
15059 }
15060 _ACEOF
15061 rm -f conftest.$ac_objext conftest$ac_exeext
15062 if { (eval echo "$as_me:15062: \"$ac_link\"") >&5
15063   (eval $ac_link) 2>&5
15064   ac_status=$?
15065   echo "$as_me:15065: \$? = $ac_status" >&5
15066   (exit $ac_status); } &&
15067          { ac_try='test -s conftest$ac_exeext'
15068   { (eval echo "$as_me:15068: \"$ac_try\"") >&5
15069   (eval $ac_try) 2>&5
15070   ac_status=$?
15071   echo "$as_me:15071: \$? = $ac_status" >&5
15072   (exit $ac_status); }; }; then
15073   cf_cv_widechar_funcs=yes
15074 else
15075   echo "$as_me: failed program was:" >&5
15076 cat conftest.$ac_ext >&5
15077 cf_cv_widechar_funcs=no
15078 fi
15079 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15080
15081 fi
15082 echo "$as_me:15082: result: $cf_cv_widechar_funcs" >&5
15083 echo "${ECHO_T}$cf_cv_widechar_funcs" >&6
15084         if test "$cf_cv_widechar_funcs" != no ; then
15085
15086 cat >>confdefs.h <<\EOF
15087 #define USE_WIDEC_SUPPORT 1
15088 EOF
15089
15090         else
15091                 cat >>confdefs.h <<\EOF
15092 #define USE_WIDEC_SUPPORT 0
15093 EOF
15094
15095         fi
15096 else
15097         cat >>confdefs.h <<\EOF
15098 #define USE_WIDEC_SUPPORT 0
15099 EOF
15100
15101 fi
15102
15103 echo "$as_me:15103: checking if $cf_cv_screen library uses pthreads" >&5
15104 echo $ECHO_N "checking if $cf_cv_screen library uses pthreads... $ECHO_C" >&6
15105 if test "${cf_cv_use_pthreads+set}" = set; then
15106   echo $ECHO_N "(cached) $ECHO_C" >&6
15107 else
15108
15109 cat >conftest.$ac_ext <<_ACEOF
15110 #line 15110 "configure"
15111 #include "confdefs.h"
15112
15113 #include <${cf_cv_ncurses_header:-curses.h}>
15114 extern void _nc_init_pthreads(void);
15115
15116 int
15117 main ()
15118 {
15119
15120         initscr();
15121         _nc_init_pthreads();
15122
15123   ;
15124   return 0;
15125 }
15126 _ACEOF
15127 rm -f conftest.$ac_objext conftest$ac_exeext
15128 if { (eval echo "$as_me:15128: \"$ac_link\"") >&5
15129   (eval $ac_link) 2>&5
15130   ac_status=$?
15131   echo "$as_me:15131: \$? = $ac_status" >&5
15132   (exit $ac_status); } &&
15133          { ac_try='test -s conftest$ac_exeext'
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_use_pthreads=yes
15140 else
15141   echo "$as_me: failed program was:" >&5
15142 cat conftest.$ac_ext >&5
15143 cf_cv_use_pthreads=no
15144 fi
15145 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15146
15147 fi
15148 echo "$as_me:15148: result: $cf_cv_use_pthreads" >&5
15149 echo "${ECHO_T}$cf_cv_use_pthreads" >&6
15150 test $cf_cv_use_pthreads = yes && cat >>confdefs.h <<\EOF
15151 #define USE_PTHREADS 1
15152 EOF
15153
15154 echo "$as_me:15154: checking if sys/time.h works with sys/select.h" >&5
15155 echo $ECHO_N "checking if sys/time.h works with sys/select.h... $ECHO_C" >&6
15156 if test "${cf_cv_sys_time_select+set}" = set; then
15157   echo $ECHO_N "(cached) $ECHO_C" >&6
15158 else
15159
15160 cat >conftest.$ac_ext <<_ACEOF
15161 #line 15161 "configure"
15162 #include "confdefs.h"
15163
15164 #include <sys/types.h>
15165 #ifdef HAVE_SYS_TIME_H
15166 #include <sys/time.h>
15167 #endif
15168 #ifdef HAVE_SYS_SELECT_H
15169 #include <sys/select.h>
15170 #endif
15171
15172 int
15173 main ()
15174 {
15175
15176   ;
15177   return 0;
15178 }
15179 _ACEOF
15180 rm -f conftest.$ac_objext
15181 if { (eval echo "$as_me:15181: \"$ac_compile\"") >&5
15182   (eval $ac_compile) 2>&5
15183   ac_status=$?
15184   echo "$as_me:15184: \$? = $ac_status" >&5
15185   (exit $ac_status); } &&
15186          { ac_try='test -s conftest.$ac_objext'
15187   { (eval echo "$as_me:15187: \"$ac_try\"") >&5
15188   (eval $ac_try) 2>&5
15189   ac_status=$?
15190   echo "$as_me:15190: \$? = $ac_status" >&5
15191   (exit $ac_status); }; }; then
15192   cf_cv_sys_time_select=yes
15193 else
15194   echo "$as_me: failed program was:" >&5
15195 cat conftest.$ac_ext >&5
15196 cf_cv_sys_time_select=no
15197 fi
15198 rm -f conftest.$ac_objext conftest.$ac_ext
15199
15200 fi
15201
15202 echo "$as_me:15202: result: $cf_cv_sys_time_select" >&5
15203 echo "${ECHO_T}$cf_cv_sys_time_select" >&6
15204 test "$cf_cv_sys_time_select" = yes &&
15205 cat >>confdefs.h <<\EOF
15206 #define HAVE_SYS_TIME_SELECT 1
15207 EOF
15208
15209 # special check for test/ditto.c
15210
15211 echo "$as_me:15211: checking for openpty in -lutil" >&5
15212 echo $ECHO_N "checking for openpty in -lutil... $ECHO_C" >&6
15213 if test "${ac_cv_lib_util_openpty+set}" = set; then
15214   echo $ECHO_N "(cached) $ECHO_C" >&6
15215 else
15216   ac_check_lib_save_LIBS=$LIBS
15217 LIBS="-lutil  $LIBS"
15218 cat >conftest.$ac_ext <<_ACEOF
15219 #line 15219 "configure"
15220 #include "confdefs.h"
15221
15222 /* Override any gcc2 internal prototype to avoid an error.  */
15223 #ifdef __cplusplus
15224 extern "C"
15225 #endif
15226 /* We use char because int might match the return type of a gcc2
15227    builtin and then its argument prototype would still apply.  */
15228 char openpty ();
15229 int
15230 main ()
15231 {
15232 openpty ();
15233   ;
15234   return 0;
15235 }
15236 _ACEOF
15237 rm -f conftest.$ac_objext conftest$ac_exeext
15238 if { (eval echo "$as_me:15238: \"$ac_link\"") >&5
15239   (eval $ac_link) 2>&5
15240   ac_status=$?
15241   echo "$as_me:15241: \$? = $ac_status" >&5
15242   (exit $ac_status); } &&
15243          { ac_try='test -s conftest$ac_exeext'
15244   { (eval echo "$as_me:15244: \"$ac_try\"") >&5
15245   (eval $ac_try) 2>&5
15246   ac_status=$?
15247   echo "$as_me:15247: \$? = $ac_status" >&5
15248   (exit $ac_status); }; }; then
15249   ac_cv_lib_util_openpty=yes
15250 else
15251   echo "$as_me: failed program was:" >&5
15252 cat conftest.$ac_ext >&5
15253 ac_cv_lib_util_openpty=no
15254 fi
15255 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15256 LIBS=$ac_check_lib_save_LIBS
15257 fi
15258 echo "$as_me:15258: result: $ac_cv_lib_util_openpty" >&5
15259 echo "${ECHO_T}$ac_cv_lib_util_openpty" >&6
15260 if test $ac_cv_lib_util_openpty = yes; then
15261   cf_cv_lib_util=yes
15262 else
15263   cf_cv_lib_util=no
15264 fi
15265
15266 echo "$as_me:15266: checking for openpty header" >&5
15267 echo $ECHO_N "checking for openpty header... $ECHO_C" >&6
15268 if test "${cf_cv_func_openpty+set}" = set; then
15269   echo $ECHO_N "(cached) $ECHO_C" >&6
15270 else
15271
15272         cf_save_LIBS="$LIBS"
15273         test $cf_cv_lib_util = yes && {
15274 cf_add_libs="-lutil"
15275 # Filter out duplicates - this happens with badly-designed ".pc" files...
15276 for cf_add_1lib in $LIBS
15277 do
15278         for cf_add_2lib in $cf_add_libs
15279         do
15280                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
15281                 then
15282                         cf_add_1lib=
15283                         break
15284                 fi
15285         done
15286         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
15287 done
15288 LIBS="$cf_add_libs"
15289  }
15290         for cf_header in pty.h libutil.h util.h
15291         do
15292         cat >conftest.$ac_ext <<_ACEOF
15293 #line 15293 "configure"
15294 #include "confdefs.h"
15295
15296 #include <$cf_header>
15297
15298 int
15299 main ()
15300 {
15301
15302         int x = openpty((int *)0, (int *)0, (char *)0,
15303                                    (struct termios *)0, (struct winsize *)0);
15304
15305   ;
15306   return 0;
15307 }
15308 _ACEOF
15309 rm -f conftest.$ac_objext conftest$ac_exeext
15310 if { (eval echo "$as_me:15310: \"$ac_link\"") >&5
15311   (eval $ac_link) 2>&5
15312   ac_status=$?
15313   echo "$as_me:15313: \$? = $ac_status" >&5
15314   (exit $ac_status); } &&
15315          { ac_try='test -s conftest$ac_exeext'
15316   { (eval echo "$as_me:15316: \"$ac_try\"") >&5
15317   (eval $ac_try) 2>&5
15318   ac_status=$?
15319   echo "$as_me:15319: \$? = $ac_status" >&5
15320   (exit $ac_status); }; }; then
15321
15322                 cf_cv_func_openpty=$cf_header
15323                 break
15324
15325 else
15326   echo "$as_me: failed program was:" >&5
15327 cat conftest.$ac_ext >&5
15328
15329                 cf_cv_func_openpty=no
15330
15331 fi
15332 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15333         done
15334         LIBS="$cf_save_LIBS"
15335
15336 fi
15337 echo "$as_me:15337: result: $cf_cv_func_openpty" >&5
15338 echo "${ECHO_T}$cf_cv_func_openpty" >&6
15339
15340 if test "$cf_cv_func_openpty" != no ; then
15341
15342 cat >>confdefs.h <<EOF
15343 #define USE_OPENPTY_HEADER <$cf_cv_func_openpty>
15344 EOF
15345
15346 cat >>confdefs.h <<\EOF
15347 #define USE_XTERM_PTY 1
15348 EOF
15349
15350         if test "x$cf_cv_lib_util" = xyes ; then
15351
15352 cf_add_libs="-lutil"
15353 # Filter out duplicates - this happens with badly-designed ".pc" files...
15354 for cf_add_1lib in $TEST_LIBS
15355 do
15356         for cf_add_2lib in $cf_add_libs
15357         do
15358                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
15359                 then
15360                         cf_add_1lib=
15361                         break
15362                 fi
15363         done
15364         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
15365 done
15366 TEST_LIBS="$cf_add_libs"
15367
15368         fi
15369 fi
15370
15371 echo "$as_me:15371: checking for function curses_version" >&5
15372 echo $ECHO_N "checking for function curses_version... $ECHO_C" >&6
15373 if test "${cf_cv_func_curses_version+set}" = set; then
15374   echo $ECHO_N "(cached) $ECHO_C" >&6
15375 else
15376
15377 if test "$cross_compiling" = yes; then
15378   cf_cv_func_curses_version=unknown
15379 else
15380   cat >conftest.$ac_ext <<_ACEOF
15381 #line 15381 "configure"
15382 #include "confdefs.h"
15383
15384 #include <${cf_cv_ncurses_header:-curses.h}>
15385 int main()
15386 {
15387         char temp[1024];
15388         sprintf(temp, "%s\n", curses_version());
15389         ${cf_cv_main_return:-return}(0);
15390 }
15391
15392 _ACEOF
15393 rm -f conftest$ac_exeext
15394 if { (eval echo "$as_me:15394: \"$ac_link\"") >&5
15395   (eval $ac_link) 2>&5
15396   ac_status=$?
15397   echo "$as_me:15397: \$? = $ac_status" >&5
15398   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
15399   { (eval echo "$as_me:15399: \"$ac_try\"") >&5
15400   (eval $ac_try) 2>&5
15401   ac_status=$?
15402   echo "$as_me:15402: \$? = $ac_status" >&5
15403   (exit $ac_status); }; }; then
15404   cf_cv_func_curses_version=yes
15405
15406 else
15407   echo "$as_me: program exited with status $ac_status" >&5
15408 echo "$as_me: failed program was:" >&5
15409 cat conftest.$ac_ext >&5
15410 cf_cv_func_curses_version=no
15411
15412 fi
15413 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
15414 fi
15415 rm -f core
15416 fi
15417 echo "$as_me:15417: result: $cf_cv_func_curses_version" >&5
15418 echo "${ECHO_T}$cf_cv_func_curses_version" >&6
15419 test "$cf_cv_func_curses_version" = yes &&
15420 cat >>confdefs.h <<\EOF
15421 #define HAVE_CURSES_VERSION 1
15422 EOF
15423
15424 echo "$as_me:15424: checking for alternate character set array" >&5
15425 echo $ECHO_N "checking for alternate character set array... $ECHO_C" >&6
15426 if test "${cf_cv_curses_acs_map+set}" = set; then
15427   echo $ECHO_N "(cached) $ECHO_C" >&6
15428 else
15429
15430 cf_cv_curses_acs_map=unknown
15431 for name in acs_map _acs_map __acs_map ${NCURSES_WRAP_PREFIX}acs_map
15432 do
15433 cat >conftest.$ac_ext <<_ACEOF
15434 #line 15434 "configure"
15435 #include "confdefs.h"
15436
15437 #include <${cf_cv_ncurses_header:-curses.h}>
15438
15439 int
15440 main ()
15441 {
15442
15443 $name['k'] = ACS_PLUS
15444
15445   ;
15446   return 0;
15447 }
15448 _ACEOF
15449 rm -f conftest.$ac_objext conftest$ac_exeext
15450 if { (eval echo "$as_me:15450: \"$ac_link\"") >&5
15451   (eval $ac_link) 2>&5
15452   ac_status=$?
15453   echo "$as_me:15453: \$? = $ac_status" >&5
15454   (exit $ac_status); } &&
15455          { ac_try='test -s conftest$ac_exeext'
15456   { (eval echo "$as_me:15456: \"$ac_try\"") >&5
15457   (eval $ac_try) 2>&5
15458   ac_status=$?
15459   echo "$as_me:15459: \$? = $ac_status" >&5
15460   (exit $ac_status); }; }; then
15461   cf_cv_curses_acs_map=$name; break
15462 else
15463   echo "$as_me: failed program was:" >&5
15464 cat conftest.$ac_ext >&5
15465 fi
15466 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15467 done
15468
15469 fi
15470 echo "$as_me:15470: result: $cf_cv_curses_acs_map" >&5
15471 echo "${ECHO_T}$cf_cv_curses_acs_map" >&6
15472
15473 test "$cf_cv_curses_acs_map" != unknown &&
15474 cat >>confdefs.h <<EOF
15475 #define CURSES_ACS_ARRAY $cf_cv_curses_acs_map
15476 EOF
15477
15478 if test "$cf_enable_widec" = yes; then
15479
15480 echo "$as_me:15480: checking for wide alternate character set array" >&5
15481 echo $ECHO_N "checking for wide alternate character set array... $ECHO_C" >&6
15482 if test "${cf_cv_curses_wacs_map+set}" = set; then
15483   echo $ECHO_N "(cached) $ECHO_C" >&6
15484 else
15485
15486         cf_cv_curses_wacs_map=unknown
15487         for name in wacs_map _wacs_map __wacs_map _nc_wacs _wacs_char
15488         do
15489         cat >conftest.$ac_ext <<_ACEOF
15490 #line 15490 "configure"
15491 #include "confdefs.h"
15492
15493 #ifndef _XOPEN_SOURCE_EXTENDED
15494 #define _XOPEN_SOURCE_EXTENDED
15495 #endif
15496 #include <${cf_cv_ncurses_header:-curses.h}>
15497 int
15498 main ()
15499 {
15500 void *foo = &($name['k'])
15501   ;
15502   return 0;
15503 }
15504 _ACEOF
15505 rm -f conftest.$ac_objext conftest$ac_exeext
15506 if { (eval echo "$as_me:15506: \"$ac_link\"") >&5
15507   (eval $ac_link) 2>&5
15508   ac_status=$?
15509   echo "$as_me:15509: \$? = $ac_status" >&5
15510   (exit $ac_status); } &&
15511          { ac_try='test -s conftest$ac_exeext'
15512   { (eval echo "$as_me:15512: \"$ac_try\"") >&5
15513   (eval $ac_try) 2>&5
15514   ac_status=$?
15515   echo "$as_me:15515: \$? = $ac_status" >&5
15516   (exit $ac_status); }; }; then
15517   cf_cv_curses_wacs_map=$name
15518          break
15519 else
15520   echo "$as_me: failed program was:" >&5
15521 cat conftest.$ac_ext >&5
15522 fi
15523 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15524         done
15525 fi
15526 echo "$as_me:15526: result: $cf_cv_curses_wacs_map" >&5
15527 echo "${ECHO_T}$cf_cv_curses_wacs_map" >&6
15528
15529 test "$cf_cv_curses_wacs_map" != unknown &&
15530 cat >>confdefs.h <<EOF
15531 #define CURSES_WACS_ARRAY $cf_cv_curses_wacs_map
15532 EOF
15533
15534 echo "$as_me:15534: checking for wide alternate character constants" >&5
15535 echo $ECHO_N "checking for wide alternate character constants... $ECHO_C" >&6
15536 if test "${cf_cv_curses_wacs_symbols+set}" = set; then
15537   echo $ECHO_N "(cached) $ECHO_C" >&6
15538 else
15539
15540 cf_cv_curses_wacs_symbols=no
15541 if test "$cf_cv_curses_wacs_map" != unknown
15542 then
15543         cat >conftest.$ac_ext <<_ACEOF
15544 #line 15544 "configure"
15545 #include "confdefs.h"
15546
15547 #ifndef _XOPEN_SOURCE_EXTENDED
15548 #define _XOPEN_SOURCE_EXTENDED
15549 #endif
15550 #include <${cf_cv_ncurses_header:-curses.h}>
15551 int
15552 main ()
15553 {
15554 cchar_t *foo = WACS_PLUS;
15555          $cf_cv_curses_wacs_map['k'] = *WACS_PLUS
15556   ;
15557   return 0;
15558 }
15559 _ACEOF
15560 rm -f conftest.$ac_objext conftest$ac_exeext
15561 if { (eval echo "$as_me:15561: \"$ac_link\"") >&5
15562   (eval $ac_link) 2>&5
15563   ac_status=$?
15564   echo "$as_me:15564: \$? = $ac_status" >&5
15565   (exit $ac_status); } &&
15566          { ac_try='test -s conftest$ac_exeext'
15567   { (eval echo "$as_me:15567: \"$ac_try\"") >&5
15568   (eval $ac_try) 2>&5
15569   ac_status=$?
15570   echo "$as_me:15570: \$? = $ac_status" >&5
15571   (exit $ac_status); }; }; then
15572   cf_cv_curses_wacs_symbols=yes
15573 else
15574   echo "$as_me: failed program was:" >&5
15575 cat conftest.$ac_ext >&5
15576 fi
15577 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15578 else
15579         cat >conftest.$ac_ext <<_ACEOF
15580 #line 15580 "configure"
15581 #include "confdefs.h"
15582
15583 #ifndef _XOPEN_SOURCE_EXTENDED
15584 #define _XOPEN_SOURCE_EXTENDED
15585 #endif
15586 #include <${cf_cv_ncurses_header:-curses.h}>
15587 int
15588 main ()
15589 {
15590 cchar_t *foo = WACS_PLUS
15591   ;
15592   return 0;
15593 }
15594 _ACEOF
15595 rm -f conftest.$ac_objext conftest$ac_exeext
15596 if { (eval echo "$as_me:15596: \"$ac_link\"") >&5
15597   (eval $ac_link) 2>&5
15598   ac_status=$?
15599   echo "$as_me:15599: \$? = $ac_status" >&5
15600   (exit $ac_status); } &&
15601          { ac_try='test -s conftest$ac_exeext'
15602   { (eval echo "$as_me:15602: \"$ac_try\"") >&5
15603   (eval $ac_try) 2>&5
15604   ac_status=$?
15605   echo "$as_me:15605: \$? = $ac_status" >&5
15606   (exit $ac_status); }; }; then
15607   cf_cv_curses_wacs_symbols=yes
15608 else
15609   echo "$as_me: failed program was:" >&5
15610 cat conftest.$ac_ext >&5
15611 fi
15612 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15613 fi
15614
15615 fi
15616 echo "$as_me:15616: result: $cf_cv_curses_wacs_symbols" >&5
15617 echo "${ECHO_T}$cf_cv_curses_wacs_symbols" >&6
15618
15619 test "$cf_cv_curses_wacs_symbols" != no &&
15620 cat >>confdefs.h <<\EOF
15621 #define CURSES_WACS_SYMBOLS 1
15622 EOF
15623
15624 fi
15625
15626 echo "$as_me:15626: checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}" >&5
15627 echo $ECHO_N "checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
15628 cat >conftest.$ac_ext <<_ACEOF
15629 #line 15629 "configure"
15630 #include "confdefs.h"
15631
15632 #ifndef _XOPEN_SOURCE_EXTENDED
15633 #define _XOPEN_SOURCE_EXTENDED
15634 #endif
15635 #include <${cf_cv_ncurses_header:-curses.h}>
15636 int
15637 main ()
15638 {
15639
15640 attr_t foo
15641
15642   ;
15643   return 0;
15644 }
15645 _ACEOF
15646 rm -f conftest.$ac_objext
15647 if { (eval echo "$as_me:15647: \"$ac_compile\"") >&5
15648   (eval $ac_compile) 2>&5
15649   ac_status=$?
15650   echo "$as_me:15650: \$? = $ac_status" >&5
15651   (exit $ac_status); } &&
15652          { ac_try='test -s conftest.$ac_objext'
15653   { (eval echo "$as_me:15653: \"$ac_try\"") >&5
15654   (eval $ac_try) 2>&5
15655   ac_status=$?
15656   echo "$as_me:15656: \$? = $ac_status" >&5
15657   (exit $ac_status); }; }; then
15658   cf_result=yes
15659 else
15660   echo "$as_me: failed program was:" >&5
15661 cat conftest.$ac_ext >&5
15662 cf_result=no
15663 fi
15664 rm -f conftest.$ac_objext conftest.$ac_ext
15665 echo "$as_me:15665: result: $cf_result" >&5
15666 echo "${ECHO_T}$cf_result" >&6
15667 if test $cf_result = yes ; then
15668
15669 cf_result=`echo "have_type_attr_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15670
15671 cat >>confdefs.h <<EOF
15672 #define $cf_result 1
15673 EOF
15674
15675 else
15676
15677 cat >>confdefs.h <<EOF
15678 #define attr_t long
15679 EOF
15680
15681 fi
15682
15683 if test "$cf_enable_widec" = yes; then
15684
15685 # This is needed on Tru64 5.0 to declare mbstate_t
15686 echo "$as_me:15686: checking if we must include wchar.h to declare mbstate_t" >&5
15687 echo $ECHO_N "checking if we must include wchar.h to declare mbstate_t... $ECHO_C" >&6
15688 if test "${cf_cv_mbstate_t+set}" = set; then
15689   echo $ECHO_N "(cached) $ECHO_C" >&6
15690 else
15691
15692 cat >conftest.$ac_ext <<_ACEOF
15693 #line 15693 "configure"
15694 #include "confdefs.h"
15695
15696 #include <stdlib.h>
15697 #include <stdarg.h>
15698 #include <stdio.h>
15699 #ifdef HAVE_LIBUTF8_H
15700 #include <libutf8.h>
15701 #endif
15702 int
15703 main ()
15704 {
15705 mbstate_t state
15706   ;
15707   return 0;
15708 }
15709 _ACEOF
15710 rm -f conftest.$ac_objext
15711 if { (eval echo "$as_me:15711: \"$ac_compile\"") >&5
15712   (eval $ac_compile) 2>&5
15713   ac_status=$?
15714   echo "$as_me:15714: \$? = $ac_status" >&5
15715   (exit $ac_status); } &&
15716          { ac_try='test -s conftest.$ac_objext'
15717   { (eval echo "$as_me:15717: \"$ac_try\"") >&5
15718   (eval $ac_try) 2>&5
15719   ac_status=$?
15720   echo "$as_me:15720: \$? = $ac_status" >&5
15721   (exit $ac_status); }; }; then
15722   cf_cv_mbstate_t=no
15723 else
15724   echo "$as_me: failed program was:" >&5
15725 cat conftest.$ac_ext >&5
15726 cat >conftest.$ac_ext <<_ACEOF
15727 #line 15727 "configure"
15728 #include "confdefs.h"
15729
15730 #include <stdlib.h>
15731 #include <stdarg.h>
15732 #include <stdio.h>
15733 #include <wchar.h>
15734 #ifdef HAVE_LIBUTF8_H
15735 #include <libutf8.h>
15736 #endif
15737 int
15738 main ()
15739 {
15740 mbstate_t value
15741   ;
15742   return 0;
15743 }
15744 _ACEOF
15745 rm -f conftest.$ac_objext
15746 if { (eval echo "$as_me:15746: \"$ac_compile\"") >&5
15747   (eval $ac_compile) 2>&5
15748   ac_status=$?
15749   echo "$as_me:15749: \$? = $ac_status" >&5
15750   (exit $ac_status); } &&
15751          { ac_try='test -s conftest.$ac_objext'
15752   { (eval echo "$as_me:15752: \"$ac_try\"") >&5
15753   (eval $ac_try) 2>&5
15754   ac_status=$?
15755   echo "$as_me:15755: \$? = $ac_status" >&5
15756   (exit $ac_status); }; }; then
15757   cf_cv_mbstate_t=yes
15758 else
15759   echo "$as_me: failed program was:" >&5
15760 cat conftest.$ac_ext >&5
15761 cf_cv_mbstate_t=unknown
15762 fi
15763 rm -f conftest.$ac_objext conftest.$ac_ext
15764 fi
15765 rm -f conftest.$ac_objext conftest.$ac_ext
15766 fi
15767 echo "$as_me:15767: result: $cf_cv_mbstate_t" >&5
15768 echo "${ECHO_T}$cf_cv_mbstate_t" >&6
15769
15770 if test "$cf_cv_mbstate_t" = yes ; then
15771
15772 cat >>confdefs.h <<\EOF
15773 #define NEED_WCHAR_H 1
15774 EOF
15775
15776         NEED_WCHAR_H=1
15777 fi
15778
15779 # if we do not find mbstate_t in either place, use substitution to provide a fallback.
15780 if test "$cf_cv_mbstate_t" = unknown ; then
15781         NCURSES_MBSTATE_T=1
15782 fi
15783
15784 # if we find mbstate_t in either place, use substitution to provide a fallback.
15785 if test "$cf_cv_mbstate_t" != unknown ; then
15786         NCURSES_OK_MBSTATE_T=1
15787 fi
15788
15789 # This is needed on Tru64 5.0 to declare wchar_t
15790 echo "$as_me:15790: checking if we must include wchar.h to declare wchar_t" >&5
15791 echo $ECHO_N "checking if we must include wchar.h to declare wchar_t... $ECHO_C" >&6
15792 if test "${cf_cv_wchar_t+set}" = set; then
15793   echo $ECHO_N "(cached) $ECHO_C" >&6
15794 else
15795
15796 cat >conftest.$ac_ext <<_ACEOF
15797 #line 15797 "configure"
15798 #include "confdefs.h"
15799
15800 #include <stdlib.h>
15801 #include <stdarg.h>
15802 #include <stdio.h>
15803 #ifdef HAVE_LIBUTF8_H
15804 #include <libutf8.h>
15805 #endif
15806 int
15807 main ()
15808 {
15809 wchar_t state
15810   ;
15811   return 0;
15812 }
15813 _ACEOF
15814 rm -f conftest.$ac_objext
15815 if { (eval echo "$as_me:15815: \"$ac_compile\"") >&5
15816   (eval $ac_compile) 2>&5
15817   ac_status=$?
15818   echo "$as_me:15818: \$? = $ac_status" >&5
15819   (exit $ac_status); } &&
15820          { ac_try='test -s conftest.$ac_objext'
15821   { (eval echo "$as_me:15821: \"$ac_try\"") >&5
15822   (eval $ac_try) 2>&5
15823   ac_status=$?
15824   echo "$as_me:15824: \$? = $ac_status" >&5
15825   (exit $ac_status); }; }; then
15826   cf_cv_wchar_t=no
15827 else
15828   echo "$as_me: failed program was:" >&5
15829 cat conftest.$ac_ext >&5
15830 cat >conftest.$ac_ext <<_ACEOF
15831 #line 15831 "configure"
15832 #include "confdefs.h"
15833
15834 #include <stdlib.h>
15835 #include <stdarg.h>
15836 #include <stdio.h>
15837 #include <wchar.h>
15838 #ifdef HAVE_LIBUTF8_H
15839 #include <libutf8.h>
15840 #endif
15841 int
15842 main ()
15843 {
15844 wchar_t value
15845   ;
15846   return 0;
15847 }
15848 _ACEOF
15849 rm -f conftest.$ac_objext
15850 if { (eval echo "$as_me:15850: \"$ac_compile\"") >&5
15851   (eval $ac_compile) 2>&5
15852   ac_status=$?
15853   echo "$as_me:15853: \$? = $ac_status" >&5
15854   (exit $ac_status); } &&
15855          { ac_try='test -s conftest.$ac_objext'
15856   { (eval echo "$as_me:15856: \"$ac_try\"") >&5
15857   (eval $ac_try) 2>&5
15858   ac_status=$?
15859   echo "$as_me:15859: \$? = $ac_status" >&5
15860   (exit $ac_status); }; }; then
15861   cf_cv_wchar_t=yes
15862 else
15863   echo "$as_me: failed program was:" >&5
15864 cat conftest.$ac_ext >&5
15865 cf_cv_wchar_t=unknown
15866 fi
15867 rm -f conftest.$ac_objext conftest.$ac_ext
15868 fi
15869 rm -f conftest.$ac_objext conftest.$ac_ext
15870 fi
15871 echo "$as_me:15871: result: $cf_cv_wchar_t" >&5
15872 echo "${ECHO_T}$cf_cv_wchar_t" >&6
15873
15874 if test "$cf_cv_wchar_t" = yes ; then
15875
15876 cat >>confdefs.h <<\EOF
15877 #define NEED_WCHAR_H 1
15878 EOF
15879
15880         NEED_WCHAR_H=1
15881 fi
15882
15883 # if we do not find wchar_t in either place, use substitution to provide a fallback.
15884 if test "$cf_cv_wchar_t" = unknown ; then
15885         NCURSES_WCHAR_T=1
15886 fi
15887
15888 # if we find wchar_t in either place, use substitution to provide a fallback.
15889 if test "$cf_cv_wchar_t" != unknown ; then
15890         NCURSES_OK_WCHAR_T=1
15891 fi
15892
15893 # This is needed on Tru64 5.0 to declare wint_t
15894 echo "$as_me:15894: checking if we must include wchar.h to declare wint_t" >&5
15895 echo $ECHO_N "checking if we must include wchar.h to declare wint_t... $ECHO_C" >&6
15896 if test "${cf_cv_wint_t+set}" = set; then
15897   echo $ECHO_N "(cached) $ECHO_C" >&6
15898 else
15899
15900 cat >conftest.$ac_ext <<_ACEOF
15901 #line 15901 "configure"
15902 #include "confdefs.h"
15903
15904 #include <stdlib.h>
15905 #include <stdarg.h>
15906 #include <stdio.h>
15907 #ifdef HAVE_LIBUTF8_H
15908 #include <libutf8.h>
15909 #endif
15910 int
15911 main ()
15912 {
15913 wint_t state
15914   ;
15915   return 0;
15916 }
15917 _ACEOF
15918 rm -f conftest.$ac_objext
15919 if { (eval echo "$as_me:15919: \"$ac_compile\"") >&5
15920   (eval $ac_compile) 2>&5
15921   ac_status=$?
15922   echo "$as_me:15922: \$? = $ac_status" >&5
15923   (exit $ac_status); } &&
15924          { ac_try='test -s conftest.$ac_objext'
15925   { (eval echo "$as_me:15925: \"$ac_try\"") >&5
15926   (eval $ac_try) 2>&5
15927   ac_status=$?
15928   echo "$as_me:15928: \$? = $ac_status" >&5
15929   (exit $ac_status); }; }; then
15930   cf_cv_wint_t=no
15931 else
15932   echo "$as_me: failed program was:" >&5
15933 cat conftest.$ac_ext >&5
15934 cat >conftest.$ac_ext <<_ACEOF
15935 #line 15935 "configure"
15936 #include "confdefs.h"
15937
15938 #include <stdlib.h>
15939 #include <stdarg.h>
15940 #include <stdio.h>
15941 #include <wchar.h>
15942 #ifdef HAVE_LIBUTF8_H
15943 #include <libutf8.h>
15944 #endif
15945 int
15946 main ()
15947 {
15948 wint_t value
15949   ;
15950   return 0;
15951 }
15952 _ACEOF
15953 rm -f conftest.$ac_objext
15954 if { (eval echo "$as_me:15954: \"$ac_compile\"") >&5
15955   (eval $ac_compile) 2>&5
15956   ac_status=$?
15957   echo "$as_me:15957: \$? = $ac_status" >&5
15958   (exit $ac_status); } &&
15959          { ac_try='test -s conftest.$ac_objext'
15960   { (eval echo "$as_me:15960: \"$ac_try\"") >&5
15961   (eval $ac_try) 2>&5
15962   ac_status=$?
15963   echo "$as_me:15963: \$? = $ac_status" >&5
15964   (exit $ac_status); }; }; then
15965   cf_cv_wint_t=yes
15966 else
15967   echo "$as_me: failed program was:" >&5
15968 cat conftest.$ac_ext >&5
15969 cf_cv_wint_t=unknown
15970 fi
15971 rm -f conftest.$ac_objext conftest.$ac_ext
15972 fi
15973 rm -f conftest.$ac_objext conftest.$ac_ext
15974 fi
15975 echo "$as_me:15975: result: $cf_cv_wint_t" >&5
15976 echo "${ECHO_T}$cf_cv_wint_t" >&6
15977
15978 if test "$cf_cv_wint_t" = yes ; then
15979
15980 cat >>confdefs.h <<\EOF
15981 #define NEED_WCHAR_H 1
15982 EOF
15983
15984         NEED_WCHAR_H=1
15985 fi
15986
15987 # if we do not find wint_t in either place, use substitution to provide a fallback.
15988 if test "$cf_cv_wint_t" = unknown ; then
15989         NCURSES_WINT_T=1
15990 fi
15991
15992 # if we find wint_t in either place, use substitution to provide a fallback.
15993 if test "$cf_cv_wint_t" != unknown ; then
15994         NCURSES_OK_WINT_T=1
15995 fi
15996
15997         if test "$NCURSES_OK_MBSTATE_T" = 0 ; then
15998
15999 echo "$as_me:15999: checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}" >&5
16000 echo $ECHO_N "checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
16001 cat >conftest.$ac_ext <<_ACEOF
16002 #line 16002 "configure"
16003 #include "confdefs.h"
16004
16005 #ifndef _XOPEN_SOURCE_EXTENDED
16006 #define _XOPEN_SOURCE_EXTENDED
16007 #endif
16008 #include <${cf_cv_ncurses_header:-curses.h}>
16009 int
16010 main ()
16011 {
16012
16013 mbstate_t foo
16014
16015   ;
16016   return 0;
16017 }
16018 _ACEOF
16019 rm -f conftest.$ac_objext
16020 if { (eval echo "$as_me:16020: \"$ac_compile\"") >&5
16021   (eval $ac_compile) 2>&5
16022   ac_status=$?
16023   echo "$as_me:16023: \$? = $ac_status" >&5
16024   (exit $ac_status); } &&
16025          { ac_try='test -s conftest.$ac_objext'
16026   { (eval echo "$as_me:16026: \"$ac_try\"") >&5
16027   (eval $ac_try) 2>&5
16028   ac_status=$?
16029   echo "$as_me:16029: \$? = $ac_status" >&5
16030   (exit $ac_status); }; }; then
16031   cf_result=yes
16032 else
16033   echo "$as_me: failed program was:" >&5
16034 cat conftest.$ac_ext >&5
16035 cf_result=no
16036 fi
16037 rm -f conftest.$ac_objext conftest.$ac_ext
16038 echo "$as_me:16038: result: $cf_result" >&5
16039 echo "${ECHO_T}$cf_result" >&6
16040 if test $cf_result = yes ; then
16041
16042 cf_result=`echo "have_type_mbstate_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16043
16044 cat >>confdefs.h <<EOF
16045 #define $cf_result 1
16046 EOF
16047
16048 else
16049
16050 cat >>confdefs.h <<EOF
16051 #define mbstate_t long
16052 EOF
16053
16054 fi
16055
16056         fi
16057
16058         if test "$NCURSES_OK_WCHAR_T" = 0 ; then
16059
16060 echo "$as_me:16060: checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}" >&5
16061 echo $ECHO_N "checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
16062 cat >conftest.$ac_ext <<_ACEOF
16063 #line 16063 "configure"
16064 #include "confdefs.h"
16065
16066 #ifndef _XOPEN_SOURCE_EXTENDED
16067 #define _XOPEN_SOURCE_EXTENDED
16068 #endif
16069 #include <${cf_cv_ncurses_header:-curses.h}>
16070 int
16071 main ()
16072 {
16073
16074 wchar_t foo
16075
16076   ;
16077   return 0;
16078 }
16079 _ACEOF
16080 rm -f conftest.$ac_objext
16081 if { (eval echo "$as_me:16081: \"$ac_compile\"") >&5
16082   (eval $ac_compile) 2>&5
16083   ac_status=$?
16084   echo "$as_me:16084: \$? = $ac_status" >&5
16085   (exit $ac_status); } &&
16086          { ac_try='test -s conftest.$ac_objext'
16087   { (eval echo "$as_me:16087: \"$ac_try\"") >&5
16088   (eval $ac_try) 2>&5
16089   ac_status=$?
16090   echo "$as_me:16090: \$? = $ac_status" >&5
16091   (exit $ac_status); }; }; then
16092   cf_result=yes
16093 else
16094   echo "$as_me: failed program was:" >&5
16095 cat conftest.$ac_ext >&5
16096 cf_result=no
16097 fi
16098 rm -f conftest.$ac_objext conftest.$ac_ext
16099 echo "$as_me:16099: result: $cf_result" >&5
16100 echo "${ECHO_T}$cf_result" >&6
16101 if test $cf_result = yes ; then
16102
16103 cf_result=`echo "have_type_wchar_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16104
16105 cat >>confdefs.h <<EOF
16106 #define $cf_result 1
16107 EOF
16108
16109 else
16110
16111 cat >>confdefs.h <<EOF
16112 #define wchar_t long
16113 EOF
16114
16115 fi
16116
16117         fi
16118
16119         if test "$NCURSES_OK_WINT_T" = 0 ; then
16120
16121 echo "$as_me:16121: checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}" >&5
16122 echo $ECHO_N "checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
16123 cat >conftest.$ac_ext <<_ACEOF
16124 #line 16124 "configure"
16125 #include "confdefs.h"
16126
16127 #ifndef _XOPEN_SOURCE_EXTENDED
16128 #define _XOPEN_SOURCE_EXTENDED
16129 #endif
16130 #include <${cf_cv_ncurses_header:-curses.h}>
16131 int
16132 main ()
16133 {
16134
16135 wint_t foo
16136
16137   ;
16138   return 0;
16139 }
16140 _ACEOF
16141 rm -f conftest.$ac_objext
16142 if { (eval echo "$as_me:16142: \"$ac_compile\"") >&5
16143   (eval $ac_compile) 2>&5
16144   ac_status=$?
16145   echo "$as_me:16145: \$? = $ac_status" >&5
16146   (exit $ac_status); } &&
16147          { ac_try='test -s conftest.$ac_objext'
16148   { (eval echo "$as_me:16148: \"$ac_try\"") >&5
16149   (eval $ac_try) 2>&5
16150   ac_status=$?
16151   echo "$as_me:16151: \$? = $ac_status" >&5
16152   (exit $ac_status); }; }; then
16153   cf_result=yes
16154 else
16155   echo "$as_me: failed program was:" >&5
16156 cat conftest.$ac_ext >&5
16157 cf_result=no
16158 fi
16159 rm -f conftest.$ac_objext conftest.$ac_ext
16160 echo "$as_me:16160: result: $cf_result" >&5
16161 echo "${ECHO_T}$cf_result" >&6
16162 if test $cf_result = yes ; then
16163
16164 cf_result=`echo "have_type_wint_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16165
16166 cat >>confdefs.h <<EOF
16167 #define $cf_result 1
16168 EOF
16169
16170 else
16171
16172 cat >>confdefs.h <<EOF
16173 #define wint_t long
16174 EOF
16175
16176 fi
16177
16178         fi
16179 fi
16180
16181 echo "$as_me:16181: checking for data ospeed declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
16182 echo $ECHO_N "checking for data ospeed declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
16183
16184 cat >conftest.$ac_ext <<_ACEOF
16185 #line 16185 "configure"
16186 #include "confdefs.h"
16187
16188 #ifdef HAVE_XCURSES
16189 #include <xcurses.h>
16190 char * XCursesProgramName = "test";
16191 #else
16192 #include <${cf_cv_ncurses_header:-curses.h}>
16193 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16194 #include <ncursesw/term.h>
16195 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16196 #include <ncurses/term.h>
16197 #elif defined(HAVE_TERM_H)
16198 #include <term.h>
16199 #endif
16200 #endif
16201
16202 int
16203 main ()
16204 {
16205
16206 void *foo = &(ospeed)
16207
16208   ;
16209   return 0;
16210 }
16211 _ACEOF
16212 rm -f conftest.$ac_objext
16213 if { (eval echo "$as_me:16213: \"$ac_compile\"") >&5
16214   (eval $ac_compile) 2>&5
16215   ac_status=$?
16216   echo "$as_me:16216: \$? = $ac_status" >&5
16217   (exit $ac_status); } &&
16218          { ac_try='test -s conftest.$ac_objext'
16219   { (eval echo "$as_me:16219: \"$ac_try\"") >&5
16220   (eval $ac_try) 2>&5
16221   ac_status=$?
16222   echo "$as_me:16222: \$? = $ac_status" >&5
16223   (exit $ac_status); }; }; then
16224   cf_result=yes
16225 else
16226   echo "$as_me: failed program was:" >&5
16227 cat conftest.$ac_ext >&5
16228 cf_result=no
16229 fi
16230 rm -f conftest.$ac_objext conftest.$ac_ext
16231 echo "$as_me:16231: result: $cf_result" >&5
16232 echo "${ECHO_T}$cf_result" >&6
16233
16234 if test $cf_result = yes ; then
16235
16236 cf_result=`echo "have_curses_data_ospeed" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16237
16238         cat >>confdefs.h <<EOF
16239 #define $cf_result 1
16240 EOF
16241
16242 else
16243         echo "$as_me:16243: checking for data ospeed in library" >&5
16244 echo $ECHO_N "checking for data ospeed in library... $ECHO_C" >&6
16245         # BSD linkers insist on making weak linkage, but resolve at runtime.
16246         if test "$cross_compiling" = yes; then
16247
16248         # cross-compiling
16249         cat >conftest.$ac_ext <<_ACEOF
16250 #line 16250 "configure"
16251 #include "confdefs.h"
16252
16253 #ifdef HAVE_XCURSES
16254 #include <xcurses.h>
16255 char * XCursesProgramName = "test";
16256 #else
16257 #include <${cf_cv_ncurses_header:-curses.h}>
16258 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16259 #include <ncursesw/term.h>
16260 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16261 #include <ncurses/term.h>
16262 #elif defined(HAVE_TERM_H)
16263 #include <term.h>
16264 #endif
16265 #endif
16266
16267 extern char ospeed;
16268 int
16269 main ()
16270 {
16271
16272         do {
16273                 void *foo = &(ospeed);
16274                 fprintf(stderr, "testing linkage of ospeed:%p\n", foo);
16275                 ${cf_cv_main_return:-return}(foo == 0);
16276         } while (0)
16277
16278   ;
16279   return 0;
16280 }
16281 _ACEOF
16282 rm -f conftest.$ac_objext conftest$ac_exeext
16283 if { (eval echo "$as_me:16283: \"$ac_link\"") >&5
16284   (eval $ac_link) 2>&5
16285   ac_status=$?
16286   echo "$as_me:16286: \$? = $ac_status" >&5
16287   (exit $ac_status); } &&
16288          { ac_try='test -s conftest$ac_exeext'
16289   { (eval echo "$as_me:16289: \"$ac_try\"") >&5
16290   (eval $ac_try) 2>&5
16291   ac_status=$?
16292   echo "$as_me:16292: \$? = $ac_status" >&5
16293   (exit $ac_status); }; }; then
16294   cf_result=yes
16295 else
16296   echo "$as_me: failed program was:" >&5
16297 cat conftest.$ac_ext >&5
16298 cf_result=no
16299 fi
16300 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16301
16302 else
16303   cat >conftest.$ac_ext <<_ACEOF
16304 #line 16304 "configure"
16305 #include "confdefs.h"
16306
16307 #ifdef HAVE_XCURSES
16308 #include <xcurses.h>
16309 char * XCursesProgramName = "test";
16310 #else
16311 #include <${cf_cv_ncurses_header:-curses.h}>
16312 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16313 #include <ncursesw/term.h>
16314 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16315 #include <ncurses/term.h>
16316 #elif defined(HAVE_TERM_H)
16317 #include <term.h>
16318 #endif
16319 #endif
16320
16321 extern char ospeed;
16322 int main(void)
16323 {
16324         void *foo = &(ospeed);
16325         fprintf(stderr, "testing linkage of ospeed:%p\n", foo);
16326         ${cf_cv_main_return:-return}(foo == 0);
16327 }
16328 _ACEOF
16329 rm -f conftest$ac_exeext
16330 if { (eval echo "$as_me:16330: \"$ac_link\"") >&5
16331   (eval $ac_link) 2>&5
16332   ac_status=$?
16333   echo "$as_me:16333: \$? = $ac_status" >&5
16334   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
16335   { (eval echo "$as_me:16335: \"$ac_try\"") >&5
16336   (eval $ac_try) 2>&5
16337   ac_status=$?
16338   echo "$as_me:16338: \$? = $ac_status" >&5
16339   (exit $ac_status); }; }; then
16340   cf_result=yes
16341 else
16342   echo "$as_me: program exited with status $ac_status" >&5
16343 echo "$as_me: failed program was:" >&5
16344 cat conftest.$ac_ext >&5
16345 cf_result=no
16346 fi
16347 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
16348 fi
16349         echo "$as_me:16349: result: $cf_result" >&5
16350 echo "${ECHO_T}$cf_result" >&6
16351         if test $cf_result = yes ; then
16352
16353 cf_result=`echo "decl_curses_data_ospeed" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16354
16355                 cat >>confdefs.h <<EOF
16356 #define $cf_result 1
16357 EOF
16358
16359         fi
16360 fi
16361
16362 echo "$as_me:16362: checking for data boolnames declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
16363 echo $ECHO_N "checking for data boolnames declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
16364
16365 cat >conftest.$ac_ext <<_ACEOF
16366 #line 16366 "configure"
16367 #include "confdefs.h"
16368
16369 #ifdef HAVE_XCURSES
16370 #include <xcurses.h>
16371 char * XCursesProgramName = "test";
16372 #else
16373 #include <${cf_cv_ncurses_header:-curses.h}>
16374 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16375 #include <ncursesw/term.h>
16376 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16377 #include <ncurses/term.h>
16378 #elif defined(HAVE_TERM_H)
16379 #include <term.h>
16380 #endif
16381 #endif
16382
16383 int
16384 main ()
16385 {
16386
16387 void *foo = &(boolnames)
16388
16389   ;
16390   return 0;
16391 }
16392 _ACEOF
16393 rm -f conftest.$ac_objext
16394 if { (eval echo "$as_me:16394: \"$ac_compile\"") >&5
16395   (eval $ac_compile) 2>&5
16396   ac_status=$?
16397   echo "$as_me:16397: \$? = $ac_status" >&5
16398   (exit $ac_status); } &&
16399          { ac_try='test -s conftest.$ac_objext'
16400   { (eval echo "$as_me:16400: \"$ac_try\"") >&5
16401   (eval $ac_try) 2>&5
16402   ac_status=$?
16403   echo "$as_me:16403: \$? = $ac_status" >&5
16404   (exit $ac_status); }; }; then
16405   cf_result=yes
16406 else
16407   echo "$as_me: failed program was:" >&5
16408 cat conftest.$ac_ext >&5
16409 cf_result=no
16410 fi
16411 rm -f conftest.$ac_objext conftest.$ac_ext
16412 echo "$as_me:16412: result: $cf_result" >&5
16413 echo "${ECHO_T}$cf_result" >&6
16414
16415 if test $cf_result = yes ; then
16416
16417 cf_result=`echo "have_curses_data_boolnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16418
16419         cat >>confdefs.h <<EOF
16420 #define $cf_result 1
16421 EOF
16422
16423 else
16424         echo "$as_me:16424: checking for data boolnames in library" >&5
16425 echo $ECHO_N "checking for data boolnames in library... $ECHO_C" >&6
16426         # BSD linkers insist on making weak linkage, but resolve at runtime.
16427         if test "$cross_compiling" = yes; then
16428
16429         # cross-compiling
16430         cat >conftest.$ac_ext <<_ACEOF
16431 #line 16431 "configure"
16432 #include "confdefs.h"
16433
16434 #ifdef HAVE_XCURSES
16435 #include <xcurses.h>
16436 char * XCursesProgramName = "test";
16437 #else
16438 #include <${cf_cv_ncurses_header:-curses.h}>
16439 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16440 #include <ncursesw/term.h>
16441 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16442 #include <ncurses/term.h>
16443 #elif defined(HAVE_TERM_H)
16444 #include <term.h>
16445 #endif
16446 #endif
16447
16448 extern char boolnames;
16449 int
16450 main ()
16451 {
16452
16453         do {
16454                 void *foo = &(boolnames);
16455                 fprintf(stderr, "testing linkage of boolnames:%p\n", foo);
16456                 ${cf_cv_main_return:-return}(foo == 0);
16457         } while (0)
16458
16459   ;
16460   return 0;
16461 }
16462 _ACEOF
16463 rm -f conftest.$ac_objext conftest$ac_exeext
16464 if { (eval echo "$as_me:16464: \"$ac_link\"") >&5
16465   (eval $ac_link) 2>&5
16466   ac_status=$?
16467   echo "$as_me:16467: \$? = $ac_status" >&5
16468   (exit $ac_status); } &&
16469          { ac_try='test -s conftest$ac_exeext'
16470   { (eval echo "$as_me:16470: \"$ac_try\"") >&5
16471   (eval $ac_try) 2>&5
16472   ac_status=$?
16473   echo "$as_me:16473: \$? = $ac_status" >&5
16474   (exit $ac_status); }; }; then
16475   cf_result=yes
16476 else
16477   echo "$as_me: failed program was:" >&5
16478 cat conftest.$ac_ext >&5
16479 cf_result=no
16480 fi
16481 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16482
16483 else
16484   cat >conftest.$ac_ext <<_ACEOF
16485 #line 16485 "configure"
16486 #include "confdefs.h"
16487
16488 #ifdef HAVE_XCURSES
16489 #include <xcurses.h>
16490 char * XCursesProgramName = "test";
16491 #else
16492 #include <${cf_cv_ncurses_header:-curses.h}>
16493 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16494 #include <ncursesw/term.h>
16495 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16496 #include <ncurses/term.h>
16497 #elif defined(HAVE_TERM_H)
16498 #include <term.h>
16499 #endif
16500 #endif
16501
16502 extern char boolnames;
16503 int main(void)
16504 {
16505         void *foo = &(boolnames);
16506         fprintf(stderr, "testing linkage of boolnames:%p\n", foo);
16507         ${cf_cv_main_return:-return}(foo == 0);
16508 }
16509 _ACEOF
16510 rm -f conftest$ac_exeext
16511 if { (eval echo "$as_me:16511: \"$ac_link\"") >&5
16512   (eval $ac_link) 2>&5
16513   ac_status=$?
16514   echo "$as_me:16514: \$? = $ac_status" >&5
16515   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
16516   { (eval echo "$as_me:16516: \"$ac_try\"") >&5
16517   (eval $ac_try) 2>&5
16518   ac_status=$?
16519   echo "$as_me:16519: \$? = $ac_status" >&5
16520   (exit $ac_status); }; }; then
16521   cf_result=yes
16522 else
16523   echo "$as_me: program exited with status $ac_status" >&5
16524 echo "$as_me: failed program was:" >&5
16525 cat conftest.$ac_ext >&5
16526 cf_result=no
16527 fi
16528 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
16529 fi
16530         echo "$as_me:16530: result: $cf_result" >&5
16531 echo "${ECHO_T}$cf_result" >&6
16532         if test $cf_result = yes ; then
16533
16534 cf_result=`echo "decl_curses_data_boolnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16535
16536                 cat >>confdefs.h <<EOF
16537 #define $cf_result 1
16538 EOF
16539
16540         fi
16541 fi
16542
16543 echo "$as_me:16543: checking for data boolfnames declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
16544 echo $ECHO_N "checking for data boolfnames declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
16545
16546 cat >conftest.$ac_ext <<_ACEOF
16547 #line 16547 "configure"
16548 #include "confdefs.h"
16549
16550 #ifdef HAVE_XCURSES
16551 #include <xcurses.h>
16552 char * XCursesProgramName = "test";
16553 #else
16554 #include <${cf_cv_ncurses_header:-curses.h}>
16555 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16556 #include <ncursesw/term.h>
16557 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16558 #include <ncurses/term.h>
16559 #elif defined(HAVE_TERM_H)
16560 #include <term.h>
16561 #endif
16562 #endif
16563
16564 int
16565 main ()
16566 {
16567
16568 void *foo = &(boolfnames)
16569
16570   ;
16571   return 0;
16572 }
16573 _ACEOF
16574 rm -f conftest.$ac_objext
16575 if { (eval echo "$as_me:16575: \"$ac_compile\"") >&5
16576   (eval $ac_compile) 2>&5
16577   ac_status=$?
16578   echo "$as_me:16578: \$? = $ac_status" >&5
16579   (exit $ac_status); } &&
16580          { ac_try='test -s conftest.$ac_objext'
16581   { (eval echo "$as_me:16581: \"$ac_try\"") >&5
16582   (eval $ac_try) 2>&5
16583   ac_status=$?
16584   echo "$as_me:16584: \$? = $ac_status" >&5
16585   (exit $ac_status); }; }; then
16586   cf_result=yes
16587 else
16588   echo "$as_me: failed program was:" >&5
16589 cat conftest.$ac_ext >&5
16590 cf_result=no
16591 fi
16592 rm -f conftest.$ac_objext conftest.$ac_ext
16593 echo "$as_me:16593: result: $cf_result" >&5
16594 echo "${ECHO_T}$cf_result" >&6
16595
16596 if test $cf_result = yes ; then
16597
16598 cf_result=`echo "have_curses_data_boolfnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16599
16600         cat >>confdefs.h <<EOF
16601 #define $cf_result 1
16602 EOF
16603
16604 else
16605         echo "$as_me:16605: checking for data boolfnames in library" >&5
16606 echo $ECHO_N "checking for data boolfnames in library... $ECHO_C" >&6
16607         # BSD linkers insist on making weak linkage, but resolve at runtime.
16608         if test "$cross_compiling" = yes; then
16609
16610         # cross-compiling
16611         cat >conftest.$ac_ext <<_ACEOF
16612 #line 16612 "configure"
16613 #include "confdefs.h"
16614
16615 #ifdef HAVE_XCURSES
16616 #include <xcurses.h>
16617 char * XCursesProgramName = "test";
16618 #else
16619 #include <${cf_cv_ncurses_header:-curses.h}>
16620 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16621 #include <ncursesw/term.h>
16622 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16623 #include <ncurses/term.h>
16624 #elif defined(HAVE_TERM_H)
16625 #include <term.h>
16626 #endif
16627 #endif
16628
16629 extern char boolfnames;
16630 int
16631 main ()
16632 {
16633
16634         do {
16635                 void *foo = &(boolfnames);
16636                 fprintf(stderr, "testing linkage of boolfnames:%p\n", foo);
16637                 ${cf_cv_main_return:-return}(foo == 0);
16638         } while (0)
16639
16640   ;
16641   return 0;
16642 }
16643 _ACEOF
16644 rm -f conftest.$ac_objext conftest$ac_exeext
16645 if { (eval echo "$as_me:16645: \"$ac_link\"") >&5
16646   (eval $ac_link) 2>&5
16647   ac_status=$?
16648   echo "$as_me:16648: \$? = $ac_status" >&5
16649   (exit $ac_status); } &&
16650          { ac_try='test -s conftest$ac_exeext'
16651   { (eval echo "$as_me:16651: \"$ac_try\"") >&5
16652   (eval $ac_try) 2>&5
16653   ac_status=$?
16654   echo "$as_me:16654: \$? = $ac_status" >&5
16655   (exit $ac_status); }; }; then
16656   cf_result=yes
16657 else
16658   echo "$as_me: failed program was:" >&5
16659 cat conftest.$ac_ext >&5
16660 cf_result=no
16661 fi
16662 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16663
16664 else
16665   cat >conftest.$ac_ext <<_ACEOF
16666 #line 16666 "configure"
16667 #include "confdefs.h"
16668
16669 #ifdef HAVE_XCURSES
16670 #include <xcurses.h>
16671 char * XCursesProgramName = "test";
16672 #else
16673 #include <${cf_cv_ncurses_header:-curses.h}>
16674 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16675 #include <ncursesw/term.h>
16676 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16677 #include <ncurses/term.h>
16678 #elif defined(HAVE_TERM_H)
16679 #include <term.h>
16680 #endif
16681 #endif
16682
16683 extern char boolfnames;
16684 int main(void)
16685 {
16686         void *foo = &(boolfnames);
16687         fprintf(stderr, "testing linkage of boolfnames:%p\n", foo);
16688         ${cf_cv_main_return:-return}(foo == 0);
16689 }
16690 _ACEOF
16691 rm -f conftest$ac_exeext
16692 if { (eval echo "$as_me:16692: \"$ac_link\"") >&5
16693   (eval $ac_link) 2>&5
16694   ac_status=$?
16695   echo "$as_me:16695: \$? = $ac_status" >&5
16696   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
16697   { (eval echo "$as_me:16697: \"$ac_try\"") >&5
16698   (eval $ac_try) 2>&5
16699   ac_status=$?
16700   echo "$as_me:16700: \$? = $ac_status" >&5
16701   (exit $ac_status); }; }; then
16702   cf_result=yes
16703 else
16704   echo "$as_me: program exited with status $ac_status" >&5
16705 echo "$as_me: failed program was:" >&5
16706 cat conftest.$ac_ext >&5
16707 cf_result=no
16708 fi
16709 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
16710 fi
16711         echo "$as_me:16711: result: $cf_result" >&5
16712 echo "${ECHO_T}$cf_result" >&6
16713         if test $cf_result = yes ; then
16714
16715 cf_result=`echo "decl_curses_data_boolfnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16716
16717                 cat >>confdefs.h <<EOF
16718 #define $cf_result 1
16719 EOF
16720
16721         fi
16722 fi
16723
16724 echo "$as_me:16724: checking for data ttytype declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
16725 echo $ECHO_N "checking for data ttytype declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
16726
16727 cat >conftest.$ac_ext <<_ACEOF
16728 #line 16728 "configure"
16729 #include "confdefs.h"
16730
16731 #ifdef HAVE_XCURSES
16732 #include <xcurses.h>
16733 char * XCursesProgramName = "test";
16734 #else
16735 #include <${cf_cv_ncurses_header:-curses.h}>
16736 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16737 #include <ncursesw/term.h>
16738 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16739 #include <ncurses/term.h>
16740 #elif defined(HAVE_TERM_H)
16741 #include <term.h>
16742 #endif
16743 #endif
16744
16745 int
16746 main ()
16747 {
16748
16749 void *foo = &(ttytype)
16750
16751   ;
16752   return 0;
16753 }
16754 _ACEOF
16755 rm -f conftest.$ac_objext
16756 if { (eval echo "$as_me:16756: \"$ac_compile\"") >&5
16757   (eval $ac_compile) 2>&5
16758   ac_status=$?
16759   echo "$as_me:16759: \$? = $ac_status" >&5
16760   (exit $ac_status); } &&
16761          { ac_try='test -s conftest.$ac_objext'
16762   { (eval echo "$as_me:16762: \"$ac_try\"") >&5
16763   (eval $ac_try) 2>&5
16764   ac_status=$?
16765   echo "$as_me:16765: \$? = $ac_status" >&5
16766   (exit $ac_status); }; }; then
16767   cf_result=yes
16768 else
16769   echo "$as_me: failed program was:" >&5
16770 cat conftest.$ac_ext >&5
16771 cf_result=no
16772 fi
16773 rm -f conftest.$ac_objext conftest.$ac_ext
16774 echo "$as_me:16774: result: $cf_result" >&5
16775 echo "${ECHO_T}$cf_result" >&6
16776
16777 if test $cf_result = yes ; then
16778
16779 cf_result=`echo "have_curses_data_ttytype" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16780
16781         cat >>confdefs.h <<EOF
16782 #define $cf_result 1
16783 EOF
16784
16785 else
16786         echo "$as_me:16786: checking for data ttytype in library" >&5
16787 echo $ECHO_N "checking for data ttytype in library... $ECHO_C" >&6
16788         # BSD linkers insist on making weak linkage, but resolve at runtime.
16789         if test "$cross_compiling" = yes; then
16790
16791         # cross-compiling
16792         cat >conftest.$ac_ext <<_ACEOF
16793 #line 16793 "configure"
16794 #include "confdefs.h"
16795
16796 #ifdef HAVE_XCURSES
16797 #include <xcurses.h>
16798 char * XCursesProgramName = "test";
16799 #else
16800 #include <${cf_cv_ncurses_header:-curses.h}>
16801 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16802 #include <ncursesw/term.h>
16803 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16804 #include <ncurses/term.h>
16805 #elif defined(HAVE_TERM_H)
16806 #include <term.h>
16807 #endif
16808 #endif
16809
16810 extern char ttytype;
16811 int
16812 main ()
16813 {
16814
16815         do {
16816                 void *foo = &(ttytype);
16817                 fprintf(stderr, "testing linkage of ttytype:%p\n", foo);
16818                 ${cf_cv_main_return:-return}(foo == 0);
16819         } while (0)
16820
16821   ;
16822   return 0;
16823 }
16824 _ACEOF
16825 rm -f conftest.$ac_objext conftest$ac_exeext
16826 if { (eval echo "$as_me:16826: \"$ac_link\"") >&5
16827   (eval $ac_link) 2>&5
16828   ac_status=$?
16829   echo "$as_me:16829: \$? = $ac_status" >&5
16830   (exit $ac_status); } &&
16831          { ac_try='test -s conftest$ac_exeext'
16832   { (eval echo "$as_me:16832: \"$ac_try\"") >&5
16833   (eval $ac_try) 2>&5
16834   ac_status=$?
16835   echo "$as_me:16835: \$? = $ac_status" >&5
16836   (exit $ac_status); }; }; then
16837   cf_result=yes
16838 else
16839   echo "$as_me: failed program was:" >&5
16840 cat conftest.$ac_ext >&5
16841 cf_result=no
16842 fi
16843 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16844
16845 else
16846   cat >conftest.$ac_ext <<_ACEOF
16847 #line 16847 "configure"
16848 #include "confdefs.h"
16849
16850 #ifdef HAVE_XCURSES
16851 #include <xcurses.h>
16852 char * XCursesProgramName = "test";
16853 #else
16854 #include <${cf_cv_ncurses_header:-curses.h}>
16855 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16856 #include <ncursesw/term.h>
16857 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16858 #include <ncurses/term.h>
16859 #elif defined(HAVE_TERM_H)
16860 #include <term.h>
16861 #endif
16862 #endif
16863
16864 extern char ttytype;
16865 int main(void)
16866 {
16867         void *foo = &(ttytype);
16868         fprintf(stderr, "testing linkage of ttytype:%p\n", foo);
16869         ${cf_cv_main_return:-return}(foo == 0);
16870 }
16871 _ACEOF
16872 rm -f conftest$ac_exeext
16873 if { (eval echo "$as_me:16873: \"$ac_link\"") >&5
16874   (eval $ac_link) 2>&5
16875   ac_status=$?
16876   echo "$as_me:16876: \$? = $ac_status" >&5
16877   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
16878   { (eval echo "$as_me:16878: \"$ac_try\"") >&5
16879   (eval $ac_try) 2>&5
16880   ac_status=$?
16881   echo "$as_me:16881: \$? = $ac_status" >&5
16882   (exit $ac_status); }; }; then
16883   cf_result=yes
16884 else
16885   echo "$as_me: program exited with status $ac_status" >&5
16886 echo "$as_me: failed program was:" >&5
16887 cat conftest.$ac_ext >&5
16888 cf_result=no
16889 fi
16890 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
16891 fi
16892         echo "$as_me:16892: result: $cf_result" >&5
16893 echo "${ECHO_T}$cf_result" >&6
16894         if test $cf_result = yes ; then
16895
16896 cf_result=`echo "decl_curses_data_ttytype" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16897
16898                 cat >>confdefs.h <<EOF
16899 #define $cf_result 1
16900 EOF
16901
16902         fi
16903 fi
16904
16905 if ( test "$GCC" = yes || test "$GXX" = yes )
16906 then
16907 echo "$as_me:16907: checking if you want to turn on gcc warnings" >&5
16908 echo $ECHO_N "checking if you want to turn on gcc warnings... $ECHO_C" >&6
16909
16910 # Check whether --enable-warnings or --disable-warnings was given.
16911 if test "${enable_warnings+set}" = set; then
16912   enableval="$enable_warnings"
16913   test "$enableval" != yes && enableval=no
16914         if test "$enableval" != "no" ; then
16915     with_warnings=yes
16916         else
16917                 with_warnings=no
16918         fi
16919 else
16920   enableval=no
16921         with_warnings=no
16922
16923 fi;
16924 echo "$as_me:16924: result: $with_warnings" >&5
16925 echo "${ECHO_T}$with_warnings" >&6
16926 if test "$with_warnings" = "yes"
16927 then
16928
16929 if test "$GCC" = yes
16930 then
16931 cat > conftest.i <<EOF
16932 #ifndef GCC_PRINTF
16933 #define GCC_PRINTF 0
16934 #endif
16935 #ifndef GCC_SCANF
16936 #define GCC_SCANF 0
16937 #endif
16938 #ifndef GCC_NORETURN
16939 #define GCC_NORETURN /* nothing */
16940 #endif
16941 #ifndef GCC_UNUSED
16942 #define GCC_UNUSED /* nothing */
16943 #endif
16944 EOF
16945 if test "$GCC" = yes
16946 then
16947         { echo "$as_me:16947: checking for $CC __attribute__ directives..." >&5
16948 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
16949 cat > conftest.$ac_ext <<EOF
16950 #line 16950 "${as_me:-configure}"
16951 #include "confdefs.h"
16952 #include "conftest.h"
16953 #include "conftest.i"
16954 #if     GCC_PRINTF
16955 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
16956 #else
16957 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
16958 #endif
16959 #if     GCC_SCANF
16960 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
16961 #else
16962 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
16963 #endif
16964 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
16965 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
16966 extern void foo(void) GCC_NORETURN;
16967 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
16968 EOF
16969         cf_printf_attribute=no
16970         cf_scanf_attribute=no
16971         for cf_attribute in scanf printf unused noreturn
16972         do
16973
16974 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16975
16976                 cf_directive="__attribute__(($cf_attribute))"
16977                 echo "checking for $CC $cf_directive" 1>&5
16978
16979                 case $cf_attribute in
16980                 (printf)
16981                         cf_printf_attribute=yes
16982                         cat >conftest.h <<EOF
16983 #define GCC_$cf_ATTRIBUTE 1
16984 EOF
16985                         ;;
16986                 (scanf)
16987                         cf_scanf_attribute=yes
16988                         cat >conftest.h <<EOF
16989 #define GCC_$cf_ATTRIBUTE 1
16990 EOF
16991                         ;;
16992                 (*)
16993                         cat >conftest.h <<EOF
16994 #define GCC_$cf_ATTRIBUTE $cf_directive
16995 EOF
16996                         ;;
16997                 esac
16998
16999                 if { (eval echo "$as_me:16999: \"$ac_compile\"") >&5
17000   (eval $ac_compile) 2>&5
17001   ac_status=$?
17002   echo "$as_me:17002: \$? = $ac_status" >&5
17003   (exit $ac_status); }; then
17004                         test -n "$verbose" && echo "$as_me:17004: result: ... $cf_attribute" >&5
17005 echo "${ECHO_T}... $cf_attribute" >&6
17006                         cat conftest.h >>confdefs.h
17007                         case $cf_attribute in
17008                         (noreturn)
17009
17010 cat >>confdefs.h <<EOF
17011 #define GCC_NORETURN $cf_directive
17012 EOF
17013
17014                                 ;;
17015                         (printf)
17016                                 cf_value='/* nothing */'
17017                                 if test "$cf_printf_attribute" != no ; then
17018                                         cf_value='__attribute__((format(printf,fmt,var)))'
17019
17020 cat >>confdefs.h <<\EOF
17021 #define GCC_PRINTF 1
17022 EOF
17023
17024                                 fi
17025
17026 cat >>confdefs.h <<EOF
17027 #define GCC_PRINTFLIKE(fmt,var) $cf_value
17028 EOF
17029
17030                                 ;;
17031                         (scanf)
17032                                 cf_value='/* nothing */'
17033                                 if test "$cf_scanf_attribute" != no ; then
17034                                         cf_value='__attribute__((format(scanf,fmt,var)))'
17035
17036 cat >>confdefs.h <<\EOF
17037 #define GCC_SCANF 1
17038 EOF
17039
17040                                 fi
17041
17042 cat >>confdefs.h <<EOF
17043 #define GCC_SCANFLIKE(fmt,var) $cf_value
17044 EOF
17045
17046                                 ;;
17047                         (unused)
17048
17049 cat >>confdefs.h <<EOF
17050 #define GCC_UNUSED $cf_directive
17051 EOF
17052
17053                                 ;;
17054                         esac
17055                 fi
17056         done
17057 else
17058         fgrep define conftest.i >>confdefs.h
17059 fi
17060 rm -rf conftest*
17061 fi
17062
17063 INTEL_COMPILER=no
17064
17065 if test "$GCC" = yes ; then
17066         case $host_os in
17067         (linux*|gnu*)
17068                 echo "$as_me:17068: checking if this is really Intel C compiler" >&5
17069 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
17070                 cf_save_CFLAGS="$CFLAGS"
17071                 CFLAGS="$CFLAGS -no-gcc"
17072                 cat >conftest.$ac_ext <<_ACEOF
17073 #line 17073 "configure"
17074 #include "confdefs.h"
17075
17076 int
17077 main ()
17078 {
17079
17080 #ifdef __INTEL_COMPILER
17081 #else
17082 make an error
17083 #endif
17084
17085   ;
17086   return 0;
17087 }
17088 _ACEOF
17089 rm -f conftest.$ac_objext
17090 if { (eval echo "$as_me:17090: \"$ac_compile\"") >&5
17091   (eval $ac_compile) 2>&5
17092   ac_status=$?
17093   echo "$as_me:17093: \$? = $ac_status" >&5
17094   (exit $ac_status); } &&
17095          { ac_try='test -s conftest.$ac_objext'
17096   { (eval echo "$as_me:17096: \"$ac_try\"") >&5
17097   (eval $ac_try) 2>&5
17098   ac_status=$?
17099   echo "$as_me:17099: \$? = $ac_status" >&5
17100   (exit $ac_status); }; }; then
17101   INTEL_COMPILER=yes
17102 cf_save_CFLAGS="$cf_save_CFLAGS -we147"
17103
17104 else
17105   echo "$as_me: failed program was:" >&5
17106 cat conftest.$ac_ext >&5
17107 fi
17108 rm -f conftest.$ac_objext conftest.$ac_ext
17109                 CFLAGS="$cf_save_CFLAGS"
17110                 echo "$as_me:17110: result: $INTEL_COMPILER" >&5
17111 echo "${ECHO_T}$INTEL_COMPILER" >&6
17112                 ;;
17113         esac
17114 fi
17115
17116 CLANG_COMPILER=no
17117
17118 if test "$GCC" = yes ; then
17119         echo "$as_me:17119: checking if this is really Clang C compiler" >&5
17120 echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6
17121         cf_save_CFLAGS="$CFLAGS"
17122         CFLAGS="$CFLAGS -Qunused-arguments"
17123         cat >conftest.$ac_ext <<_ACEOF
17124 #line 17124 "configure"
17125 #include "confdefs.h"
17126
17127 int
17128 main ()
17129 {
17130
17131 #ifdef __clang__
17132 #else
17133 make an error
17134 #endif
17135
17136   ;
17137   return 0;
17138 }
17139 _ACEOF
17140 rm -f conftest.$ac_objext
17141 if { (eval echo "$as_me:17141: \"$ac_compile\"") >&5
17142   (eval $ac_compile) 2>&5
17143   ac_status=$?
17144   echo "$as_me:17144: \$? = $ac_status" >&5
17145   (exit $ac_status); } &&
17146          { ac_try='test -s conftest.$ac_objext'
17147   { (eval echo "$as_me:17147: \"$ac_try\"") >&5
17148   (eval $ac_try) 2>&5
17149   ac_status=$?
17150   echo "$as_me:17150: \$? = $ac_status" >&5
17151   (exit $ac_status); }; }; then
17152   CLANG_COMPILER=yes
17153 cf_save_CFLAGS="$cf_save_CFLAGS -Qunused-arguments"
17154
17155 else
17156   echo "$as_me: failed program was:" >&5
17157 cat conftest.$ac_ext >&5
17158 fi
17159 rm -f conftest.$ac_objext conftest.$ac_ext
17160         CFLAGS="$cf_save_CFLAGS"
17161         echo "$as_me:17161: result: $CLANG_COMPILER" >&5
17162 echo "${ECHO_T}$CLANG_COMPILER" >&6
17163 fi
17164
17165 cat > conftest.$ac_ext <<EOF
17166 #line 17166 "${as_me:-configure}"
17167 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
17168 EOF
17169
17170 if test "$INTEL_COMPILER" = yes
17171 then
17172 # The "-wdXXX" options suppress warnings:
17173 # remark #1419: external declaration in primary source file
17174 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
17175 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
17176 # remark #193: zero used for undefined preprocessing identifier
17177 # remark #593: variable "curs_sb_left_arrow" was set but never used
17178 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
17179 # remark #869: parameter "tw" was never referenced
17180 # remark #981: operands are evaluated in unspecified order
17181 # warning #279: controlling expression is constant
17182
17183         { echo "$as_me:17183: checking for $CC warning options..." >&5
17184 echo "$as_me: checking for $CC warning options..." >&6;}
17185         cf_save_CFLAGS="$CFLAGS"
17186         EXTRA_CFLAGS="-Wall"
17187         for cf_opt in \
17188                 wd1419 \
17189                 wd1683 \
17190                 wd1684 \
17191                 wd193 \
17192                 wd593 \
17193                 wd279 \
17194                 wd810 \
17195                 wd869 \
17196                 wd981
17197         do
17198                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
17199                 if { (eval echo "$as_me:17199: \"$ac_compile\"") >&5
17200   (eval $ac_compile) 2>&5
17201   ac_status=$?
17202   echo "$as_me:17202: \$? = $ac_status" >&5
17203   (exit $ac_status); }; then
17204                         test -n "$verbose" && echo "$as_me:17204: result: ... -$cf_opt" >&5
17205 echo "${ECHO_T}... -$cf_opt" >&6
17206                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
17207                 fi
17208         done
17209         CFLAGS="$cf_save_CFLAGS"
17210
17211 elif test "$GCC" = yes
17212 then
17213         { echo "$as_me:17213: checking for $CC warning options..." >&5
17214 echo "$as_me: checking for $CC warning options..." >&6;}
17215         cf_save_CFLAGS="$CFLAGS"
17216         EXTRA_CFLAGS=
17217         cf_warn_CONST=""
17218         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
17219         cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
17220         test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
17221         for cf_opt in W Wall \
17222                 Wbad-function-cast \
17223                 Wcast-align \
17224                 Wcast-qual \
17225                 Wdeclaration-after-statement \
17226                 Wextra \
17227                 Winline \
17228                 Wmissing-declarations \
17229                 Wmissing-prototypes \
17230                 Wnested-externs \
17231                 Wpointer-arith \
17232                 Wshadow \
17233                 Wstrict-prototypes \
17234                 Wundef $cf_gcc_warnings $cf_warn_CONST
17235         do
17236                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
17237                 if { (eval echo "$as_me:17237: \"$ac_compile\"") >&5
17238   (eval $ac_compile) 2>&5
17239   ac_status=$?
17240   echo "$as_me:17240: \$? = $ac_status" >&5
17241   (exit $ac_status); }; then
17242                         test -n "$verbose" && echo "$as_me:17242: result: ... -$cf_opt" >&5
17243 echo "${ECHO_T}... -$cf_opt" >&6
17244                         case $cf_opt in
17245                         (Wcast-qual)
17246                                 CPPFLAGS="$CPPFLAGS -DXTSTRINGDEFINES"
17247                                 ;;
17248                         (Winline)
17249                                 case $GCC_VERSION in
17250                                 ([34].*)
17251                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
17252
17253 echo "${as_me:-configure}:17253: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
17254
17255                                         continue;;
17256                                 esac
17257                                 ;;
17258                         (Wpointer-arith)
17259                                 case $GCC_VERSION in
17260                                 ([12].*)
17261                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
17262
17263 echo "${as_me:-configure}:17263: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
17264
17265                                         continue;;
17266                                 esac
17267                                 ;;
17268                         esac
17269                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
17270                 fi
17271         done
17272         CFLAGS="$cf_save_CFLAGS"
17273 fi
17274 rm -rf conftest*
17275
17276 fi
17277 fi
17278
17279 echo "$as_me:17279: checking if you want to use dmalloc for testing" >&5
17280 echo $ECHO_N "checking if you want to use dmalloc for testing... $ECHO_C" >&6
17281
17282 # Check whether --with-dmalloc or --without-dmalloc was given.
17283 if test "${with_dmalloc+set}" = set; then
17284   withval="$with_dmalloc"
17285
17286 cat >>confdefs.h <<EOF
17287 #define USE_DMALLOC 1
17288 EOF
17289
17290         : ${with_cflags:=-g}
17291         : ${with_no_leaks:=yes}
17292          with_dmalloc=yes
17293 else
17294   with_dmalloc=
17295 fi;
17296 echo "$as_me:17296: result: ${with_dmalloc:-no}" >&5
17297 echo "${ECHO_T}${with_dmalloc:-no}" >&6
17298
17299 case .$with_cflags in
17300 (.*-g*)
17301         case .$CFLAGS in
17302         (.*-g*)
17303                 ;;
17304         (*)
17305
17306 cf_fix_cppflags=no
17307 cf_new_cflags=
17308 cf_new_cppflags=
17309 cf_new_extra_cppflags=
17310
17311 for cf_add_cflags in -g
17312 do
17313 case $cf_fix_cppflags in
17314 (no)
17315         case $cf_add_cflags in
17316         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
17317                 case $cf_add_cflags in
17318                 (-D*)
17319                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
17320
17321                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17322                                 && test -z "${cf_tst_cflags}" \
17323                                 && cf_fix_cppflags=yes
17324
17325                         if test $cf_fix_cppflags = yes ; then
17326                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
17327                                 continue
17328                         elif test "${cf_tst_cflags}" = "\"'" ; then
17329                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
17330                                 continue
17331                         fi
17332                         ;;
17333                 esac
17334                 case "$CPPFLAGS" in
17335                 (*$cf_add_cflags)
17336                         ;;
17337                 (*)
17338                         case $cf_add_cflags in
17339                         (-D*)
17340                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
17341
17342 CPPFLAGS=`echo "$CPPFLAGS" | \
17343         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
17344                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
17345
17346                                 ;;
17347                         esac
17348                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
17349                         ;;
17350                 esac
17351                 ;;
17352         (*)
17353                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
17354                 ;;
17355         esac
17356         ;;
17357 (yes)
17358         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
17359
17360         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
17361
17362         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17363                 && test -z "${cf_tst_cflags}" \
17364                 && cf_fix_cppflags=no
17365         ;;
17366 esac
17367 done
17368
17369 if test -n "$cf_new_cflags" ; then
17370
17371         CFLAGS="$CFLAGS $cf_new_cflags"
17372 fi
17373
17374 if test -n "$cf_new_cppflags" ; then
17375
17376         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
17377 fi
17378
17379 if test -n "$cf_new_extra_cppflags" ; then
17380
17381         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
17382 fi
17383
17384                 ;;
17385         esac
17386         ;;
17387 esac
17388
17389 if test "$with_dmalloc" = yes ; then
17390         echo "$as_me:17390: checking for dmalloc.h" >&5
17391 echo $ECHO_N "checking for dmalloc.h... $ECHO_C" >&6
17392 if test "${ac_cv_header_dmalloc_h+set}" = set; then
17393   echo $ECHO_N "(cached) $ECHO_C" >&6
17394 else
17395   cat >conftest.$ac_ext <<_ACEOF
17396 #line 17396 "configure"
17397 #include "confdefs.h"
17398 #include <dmalloc.h>
17399 _ACEOF
17400 if { (eval echo "$as_me:17400: \"$ac_cpp conftest.$ac_ext\"") >&5
17401   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
17402   ac_status=$?
17403   egrep -v '^ *\+' conftest.er1 >conftest.err
17404   rm -f conftest.er1
17405   cat conftest.err >&5
17406   echo "$as_me:17406: \$? = $ac_status" >&5
17407   (exit $ac_status); } >/dev/null; then
17408   if test -s conftest.err; then
17409     ac_cpp_err=$ac_c_preproc_warn_flag
17410   else
17411     ac_cpp_err=
17412   fi
17413 else
17414   ac_cpp_err=yes
17415 fi
17416 if test -z "$ac_cpp_err"; then
17417   ac_cv_header_dmalloc_h=yes
17418 else
17419   echo "$as_me: failed program was:" >&5
17420   cat conftest.$ac_ext >&5
17421   ac_cv_header_dmalloc_h=no
17422 fi
17423 rm -f conftest.err conftest.$ac_ext
17424 fi
17425 echo "$as_me:17425: result: $ac_cv_header_dmalloc_h" >&5
17426 echo "${ECHO_T}$ac_cv_header_dmalloc_h" >&6
17427 if test $ac_cv_header_dmalloc_h = yes; then
17428
17429 echo "$as_me:17429: checking for dmalloc_debug in -ldmalloc" >&5
17430 echo $ECHO_N "checking for dmalloc_debug in -ldmalloc... $ECHO_C" >&6
17431 if test "${ac_cv_lib_dmalloc_dmalloc_debug+set}" = set; then
17432   echo $ECHO_N "(cached) $ECHO_C" >&6
17433 else
17434   ac_check_lib_save_LIBS=$LIBS
17435 LIBS="-ldmalloc  $LIBS"
17436 cat >conftest.$ac_ext <<_ACEOF
17437 #line 17437 "configure"
17438 #include "confdefs.h"
17439
17440 /* Override any gcc2 internal prototype to avoid an error.  */
17441 #ifdef __cplusplus
17442 extern "C"
17443 #endif
17444 /* We use char because int might match the return type of a gcc2
17445    builtin and then its argument prototype would still apply.  */
17446 char dmalloc_debug ();
17447 int
17448 main ()
17449 {
17450 dmalloc_debug ();
17451   ;
17452   return 0;
17453 }
17454 _ACEOF
17455 rm -f conftest.$ac_objext conftest$ac_exeext
17456 if { (eval echo "$as_me:17456: \"$ac_link\"") >&5
17457   (eval $ac_link) 2>&5
17458   ac_status=$?
17459   echo "$as_me:17459: \$? = $ac_status" >&5
17460   (exit $ac_status); } &&
17461          { ac_try='test -s conftest$ac_exeext'
17462   { (eval echo "$as_me:17462: \"$ac_try\"") >&5
17463   (eval $ac_try) 2>&5
17464   ac_status=$?
17465   echo "$as_me:17465: \$? = $ac_status" >&5
17466   (exit $ac_status); }; }; then
17467   ac_cv_lib_dmalloc_dmalloc_debug=yes
17468 else
17469   echo "$as_me: failed program was:" >&5
17470 cat conftest.$ac_ext >&5
17471 ac_cv_lib_dmalloc_dmalloc_debug=no
17472 fi
17473 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17474 LIBS=$ac_check_lib_save_LIBS
17475 fi
17476 echo "$as_me:17476: result: $ac_cv_lib_dmalloc_dmalloc_debug" >&5
17477 echo "${ECHO_T}$ac_cv_lib_dmalloc_dmalloc_debug" >&6
17478 if test $ac_cv_lib_dmalloc_dmalloc_debug = yes; then
17479   cat >>confdefs.h <<EOF
17480 #define HAVE_LIBDMALLOC 1
17481 EOF
17482
17483   LIBS="-ldmalloc $LIBS"
17484
17485 fi
17486
17487 fi
17488
17489 fi
17490
17491 echo "$as_me:17491: checking if you want to use dbmalloc for testing" >&5
17492 echo $ECHO_N "checking if you want to use dbmalloc for testing... $ECHO_C" >&6
17493
17494 # Check whether --with-dbmalloc or --without-dbmalloc was given.
17495 if test "${with_dbmalloc+set}" = set; then
17496   withval="$with_dbmalloc"
17497
17498 cat >>confdefs.h <<EOF
17499 #define USE_DBMALLOC 1
17500 EOF
17501
17502         : ${with_cflags:=-g}
17503         : ${with_no_leaks:=yes}
17504          with_dbmalloc=yes
17505 else
17506   with_dbmalloc=
17507 fi;
17508 echo "$as_me:17508: result: ${with_dbmalloc:-no}" >&5
17509 echo "${ECHO_T}${with_dbmalloc:-no}" >&6
17510
17511 case .$with_cflags in
17512 (.*-g*)
17513         case .$CFLAGS in
17514         (.*-g*)
17515                 ;;
17516         (*)
17517
17518 cf_fix_cppflags=no
17519 cf_new_cflags=
17520 cf_new_cppflags=
17521 cf_new_extra_cppflags=
17522
17523 for cf_add_cflags in -g
17524 do
17525 case $cf_fix_cppflags in
17526 (no)
17527         case $cf_add_cflags in
17528         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
17529                 case $cf_add_cflags in
17530                 (-D*)
17531                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
17532
17533                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17534                                 && test -z "${cf_tst_cflags}" \
17535                                 && cf_fix_cppflags=yes
17536
17537                         if test $cf_fix_cppflags = yes ; then
17538                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
17539                                 continue
17540                         elif test "${cf_tst_cflags}" = "\"'" ; then
17541                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
17542                                 continue
17543                         fi
17544                         ;;
17545                 esac
17546                 case "$CPPFLAGS" in
17547                 (*$cf_add_cflags)
17548                         ;;
17549                 (*)
17550                         case $cf_add_cflags in
17551                         (-D*)
17552                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
17553
17554 CPPFLAGS=`echo "$CPPFLAGS" | \
17555         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
17556                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
17557
17558                                 ;;
17559                         esac
17560                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
17561                         ;;
17562                 esac
17563                 ;;
17564         (*)
17565                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
17566                 ;;
17567         esac
17568         ;;
17569 (yes)
17570         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
17571
17572         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
17573
17574         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17575                 && test -z "${cf_tst_cflags}" \
17576                 && cf_fix_cppflags=no
17577         ;;
17578 esac
17579 done
17580
17581 if test -n "$cf_new_cflags" ; then
17582
17583         CFLAGS="$CFLAGS $cf_new_cflags"
17584 fi
17585
17586 if test -n "$cf_new_cppflags" ; then
17587
17588         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
17589 fi
17590
17591 if test -n "$cf_new_extra_cppflags" ; then
17592
17593         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
17594 fi
17595
17596                 ;;
17597         esac
17598         ;;
17599 esac
17600
17601 if test "$with_dbmalloc" = yes ; then
17602         echo "$as_me:17602: checking for dbmalloc.h" >&5
17603 echo $ECHO_N "checking for dbmalloc.h... $ECHO_C" >&6
17604 if test "${ac_cv_header_dbmalloc_h+set}" = set; then
17605   echo $ECHO_N "(cached) $ECHO_C" >&6
17606 else
17607   cat >conftest.$ac_ext <<_ACEOF
17608 #line 17608 "configure"
17609 #include "confdefs.h"
17610 #include <dbmalloc.h>
17611 _ACEOF
17612 if { (eval echo "$as_me:17612: \"$ac_cpp conftest.$ac_ext\"") >&5
17613   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
17614   ac_status=$?
17615   egrep -v '^ *\+' conftest.er1 >conftest.err
17616   rm -f conftest.er1
17617   cat conftest.err >&5
17618   echo "$as_me:17618: \$? = $ac_status" >&5
17619   (exit $ac_status); } >/dev/null; then
17620   if test -s conftest.err; then
17621     ac_cpp_err=$ac_c_preproc_warn_flag
17622   else
17623     ac_cpp_err=
17624   fi
17625 else
17626   ac_cpp_err=yes
17627 fi
17628 if test -z "$ac_cpp_err"; then
17629   ac_cv_header_dbmalloc_h=yes
17630 else
17631   echo "$as_me: failed program was:" >&5
17632   cat conftest.$ac_ext >&5
17633   ac_cv_header_dbmalloc_h=no
17634 fi
17635 rm -f conftest.err conftest.$ac_ext
17636 fi
17637 echo "$as_me:17637: result: $ac_cv_header_dbmalloc_h" >&5
17638 echo "${ECHO_T}$ac_cv_header_dbmalloc_h" >&6
17639 if test $ac_cv_header_dbmalloc_h = yes; then
17640
17641 echo "$as_me:17641: checking for debug_malloc in -ldbmalloc" >&5
17642 echo $ECHO_N "checking for debug_malloc in -ldbmalloc... $ECHO_C" >&6
17643 if test "${ac_cv_lib_dbmalloc_debug_malloc+set}" = set; then
17644   echo $ECHO_N "(cached) $ECHO_C" >&6
17645 else
17646   ac_check_lib_save_LIBS=$LIBS
17647 LIBS="-ldbmalloc  $LIBS"
17648 cat >conftest.$ac_ext <<_ACEOF
17649 #line 17649 "configure"
17650 #include "confdefs.h"
17651
17652 /* Override any gcc2 internal prototype to avoid an error.  */
17653 #ifdef __cplusplus
17654 extern "C"
17655 #endif
17656 /* We use char because int might match the return type of a gcc2
17657    builtin and then its argument prototype would still apply.  */
17658 char debug_malloc ();
17659 int
17660 main ()
17661 {
17662 debug_malloc ();
17663   ;
17664   return 0;
17665 }
17666 _ACEOF
17667 rm -f conftest.$ac_objext conftest$ac_exeext
17668 if { (eval echo "$as_me:17668: \"$ac_link\"") >&5
17669   (eval $ac_link) 2>&5
17670   ac_status=$?
17671   echo "$as_me:17671: \$? = $ac_status" >&5
17672   (exit $ac_status); } &&
17673          { ac_try='test -s conftest$ac_exeext'
17674   { (eval echo "$as_me:17674: \"$ac_try\"") >&5
17675   (eval $ac_try) 2>&5
17676   ac_status=$?
17677   echo "$as_me:17677: \$? = $ac_status" >&5
17678   (exit $ac_status); }; }; then
17679   ac_cv_lib_dbmalloc_debug_malloc=yes
17680 else
17681   echo "$as_me: failed program was:" >&5
17682 cat conftest.$ac_ext >&5
17683 ac_cv_lib_dbmalloc_debug_malloc=no
17684 fi
17685 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17686 LIBS=$ac_check_lib_save_LIBS
17687 fi
17688 echo "$as_me:17688: result: $ac_cv_lib_dbmalloc_debug_malloc" >&5
17689 echo "${ECHO_T}$ac_cv_lib_dbmalloc_debug_malloc" >&6
17690 if test $ac_cv_lib_dbmalloc_debug_malloc = yes; then
17691   cat >>confdefs.h <<EOF
17692 #define HAVE_LIBDBMALLOC 1
17693 EOF
17694
17695   LIBS="-ldbmalloc $LIBS"
17696
17697 fi
17698
17699 fi
17700
17701 fi
17702
17703 echo "$as_me:17703: checking if you want to use valgrind for testing" >&5
17704 echo $ECHO_N "checking if you want to use valgrind for testing... $ECHO_C" >&6
17705
17706 # Check whether --with-valgrind or --without-valgrind was given.
17707 if test "${with_valgrind+set}" = set; then
17708   withval="$with_valgrind"
17709
17710 cat >>confdefs.h <<EOF
17711 #define USE_VALGRIND 1
17712 EOF
17713
17714         : ${with_cflags:=-g}
17715         : ${with_no_leaks:=yes}
17716          with_valgrind=yes
17717 else
17718   with_valgrind=
17719 fi;
17720 echo "$as_me:17720: result: ${with_valgrind:-no}" >&5
17721 echo "${ECHO_T}${with_valgrind:-no}" >&6
17722
17723 case .$with_cflags in
17724 (.*-g*)
17725         case .$CFLAGS in
17726         (.*-g*)
17727                 ;;
17728         (*)
17729
17730 cf_fix_cppflags=no
17731 cf_new_cflags=
17732 cf_new_cppflags=
17733 cf_new_extra_cppflags=
17734
17735 for cf_add_cflags in -g
17736 do
17737 case $cf_fix_cppflags in
17738 (no)
17739         case $cf_add_cflags in
17740         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
17741                 case $cf_add_cflags in
17742                 (-D*)
17743                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
17744
17745                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17746                                 && test -z "${cf_tst_cflags}" \
17747                                 && cf_fix_cppflags=yes
17748
17749                         if test $cf_fix_cppflags = yes ; then
17750                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
17751                                 continue
17752                         elif test "${cf_tst_cflags}" = "\"'" ; then
17753                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
17754                                 continue
17755                         fi
17756                         ;;
17757                 esac
17758                 case "$CPPFLAGS" in
17759                 (*$cf_add_cflags)
17760                         ;;
17761                 (*)
17762                         case $cf_add_cflags in
17763                         (-D*)
17764                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
17765
17766 CPPFLAGS=`echo "$CPPFLAGS" | \
17767         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
17768                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
17769
17770                                 ;;
17771                         esac
17772                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
17773                         ;;
17774                 esac
17775                 ;;
17776         (*)
17777                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
17778                 ;;
17779         esac
17780         ;;
17781 (yes)
17782         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
17783
17784         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
17785
17786         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17787                 && test -z "${cf_tst_cflags}" \
17788                 && cf_fix_cppflags=no
17789         ;;
17790 esac
17791 done
17792
17793 if test -n "$cf_new_cflags" ; then
17794
17795         CFLAGS="$CFLAGS $cf_new_cflags"
17796 fi
17797
17798 if test -n "$cf_new_cppflags" ; then
17799
17800         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
17801 fi
17802
17803 if test -n "$cf_new_extra_cppflags" ; then
17804
17805         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
17806 fi
17807
17808                 ;;
17809         esac
17810         ;;
17811 esac
17812
17813 echo "$as_me:17813: checking if you want to perform memory-leak testing" >&5
17814 echo $ECHO_N "checking if you want to perform memory-leak testing... $ECHO_C" >&6
17815
17816 # Check whether --enable-leaks or --disable-leaks was given.
17817 if test "${enable_leaks+set}" = set; then
17818   enableval="$enable_leaks"
17819   if test "x$enableval" = xno; then with_no_leaks=yes; else with_no_leaks=no; fi
17820 else
17821   : ${with_no_leaks:=no}
17822 fi;
17823 echo "$as_me:17823: result: $with_no_leaks" >&5
17824 echo "${ECHO_T}$with_no_leaks" >&6
17825
17826 if test "$with_no_leaks" = yes ; then
17827
17828 cat >>confdefs.h <<\EOF
17829 #define NO_LEAKS 1
17830 EOF
17831
17832 cat >>confdefs.h <<\EOF
17833 #define YY_NO_LEAKS 1
17834 EOF
17835
17836 fi
17837
17838 LD_RPATH_OPT=
17839 echo "$as_me:17839: checking for an rpath option" >&5
17840 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
17841 case $cf_cv_system_name in
17842 (irix*)
17843         if test "$GCC" = yes; then
17844                 LD_RPATH_OPT="-Wl,-rpath,"
17845         else
17846                 LD_RPATH_OPT="-rpath "
17847         fi
17848         ;;
17849 (linux*|gnu*|k*bsd*-gnu|freebsd*)
17850         LD_RPATH_OPT="-Wl,-rpath,"
17851         ;;
17852 (openbsd[2-9].*|mirbsd*)
17853         LD_RPATH_OPT="-Wl,-rpath,"
17854         ;;
17855 (dragonfly*)
17856         LD_RPATH_OPT="-rpath "
17857         ;;
17858 (netbsd*)
17859         LD_RPATH_OPT="-Wl,-rpath,"
17860         ;;
17861 (osf*|mls+*)
17862         LD_RPATH_OPT="-rpath "
17863         ;;
17864 (solaris2*)
17865         LD_RPATH_OPT="-R"
17866         ;;
17867 (*)
17868         ;;
17869 esac
17870 echo "$as_me:17870: result: $LD_RPATH_OPT" >&5
17871 echo "${ECHO_T}$LD_RPATH_OPT" >&6
17872
17873 case "x$LD_RPATH_OPT" in
17874 (x-R*)
17875         echo "$as_me:17875: checking if we need a space after rpath option" >&5
17876 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
17877         cf_save_LIBS="$LIBS"
17878
17879 cf_add_libs="${LD_RPATH_OPT}$libdir"
17880 # Filter out duplicates - this happens with badly-designed ".pc" files...
17881 for cf_add_1lib in $LIBS
17882 do
17883         for cf_add_2lib in $cf_add_libs
17884         do
17885                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
17886                 then
17887                         cf_add_1lib=
17888                         break
17889                 fi
17890         done
17891         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
17892 done
17893 LIBS="$cf_add_libs"
17894
17895         cat >conftest.$ac_ext <<_ACEOF
17896 #line 17896 "configure"
17897 #include "confdefs.h"
17898
17899 int
17900 main ()
17901 {
17902
17903   ;
17904   return 0;
17905 }
17906 _ACEOF
17907 rm -f conftest.$ac_objext conftest$ac_exeext
17908 if { (eval echo "$as_me:17908: \"$ac_link\"") >&5
17909   (eval $ac_link) 2>&5
17910   ac_status=$?
17911   echo "$as_me:17911: \$? = $ac_status" >&5
17912   (exit $ac_status); } &&
17913          { ac_try='test -s conftest$ac_exeext'
17914   { (eval echo "$as_me:17914: \"$ac_try\"") >&5
17915   (eval $ac_try) 2>&5
17916   ac_status=$?
17917   echo "$as_me:17917: \$? = $ac_status" >&5
17918   (exit $ac_status); }; }; then
17919   cf_rpath_space=no
17920 else
17921   echo "$as_me: failed program was:" >&5
17922 cat conftest.$ac_ext >&5
17923 cf_rpath_space=yes
17924 fi
17925 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17926         LIBS="$cf_save_LIBS"
17927         echo "$as_me:17927: result: $cf_rpath_space" >&5
17928 echo "${ECHO_T}$cf_rpath_space" >&6
17929         test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
17930         ;;
17931 esac
17932
17933 echo "$as_me:17933: checking if rpath-hack should be disabled" >&5
17934 echo $ECHO_N "checking if rpath-hack should be disabled... $ECHO_C" >&6
17935
17936 # Check whether --enable-rpath-hack or --disable-rpath-hack was given.
17937 if test "${enable_rpath_hack+set}" = set; then
17938   enableval="$enable_rpath_hack"
17939   test "$enableval" != no && enableval=yes
17940         if test "$enableval" != "yes" ; then
17941     cf_disable_rpath_hack=yes
17942         else
17943                 cf_disable_rpath_hack=no
17944         fi
17945 else
17946   enableval=yes
17947         cf_disable_rpath_hack=no
17948
17949 fi;
17950 echo "$as_me:17950: result: $cf_disable_rpath_hack" >&5
17951 echo "${ECHO_T}$cf_disable_rpath_hack" >&6
17952 if test "$cf_disable_rpath_hack" = no ; then
17953
17954 echo "$as_me:17954: checking for updated LDFLAGS" >&5
17955 echo $ECHO_N "checking for updated LDFLAGS... $ECHO_C" >&6
17956 if test -n "$LD_RPATH_OPT" ; then
17957         echo "$as_me:17957: result: maybe" >&5
17958 echo "${ECHO_T}maybe" >&6
17959
17960         for ac_prog in ldd
17961 do
17962   # Extract the first word of "$ac_prog", so it can be a program name with args.
17963 set dummy $ac_prog; ac_word=$2
17964 echo "$as_me:17964: checking for $ac_word" >&5
17965 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
17966 if test "${ac_cv_prog_cf_ldd_prog+set}" = set; then
17967   echo $ECHO_N "(cached) $ECHO_C" >&6
17968 else
17969   if test -n "$cf_ldd_prog"; then
17970   ac_cv_prog_cf_ldd_prog="$cf_ldd_prog" # Let the user override the test.
17971 else
17972   ac_save_IFS=$IFS; IFS=$ac_path_separator
17973 ac_dummy="$PATH"
17974 for ac_dir in $ac_dummy; do
17975   IFS=$ac_save_IFS
17976   test -z "$ac_dir" && ac_dir=.
17977   $as_executable_p "$ac_dir/$ac_word" || continue
17978 ac_cv_prog_cf_ldd_prog="$ac_prog"
17979 echo "$as_me:17979: found $ac_dir/$ac_word" >&5
17980 break
17981 done
17982
17983 fi
17984 fi
17985 cf_ldd_prog=$ac_cv_prog_cf_ldd_prog
17986 if test -n "$cf_ldd_prog"; then
17987   echo "$as_me:17987: result: $cf_ldd_prog" >&5
17988 echo "${ECHO_T}$cf_ldd_prog" >&6
17989 else
17990   echo "$as_me:17990: result: no" >&5
17991 echo "${ECHO_T}no" >&6
17992 fi
17993
17994   test -n "$cf_ldd_prog" && break
17995 done
17996 test -n "$cf_ldd_prog" || cf_ldd_prog="no"
17997
17998         cf_rpath_list="/usr/lib /lib"
17999         if test "$cf_ldd_prog" != no
18000         then
18001                 cf_rpath_oops=
18002
18003 cat >conftest.$ac_ext <<_ACEOF
18004 #line 18004 "configure"
18005 #include "confdefs.h"
18006 #include <stdio.h>
18007 int
18008 main ()
18009 {
18010 printf("Hello");
18011   ;
18012   return 0;
18013 }
18014 _ACEOF
18015 rm -f conftest.$ac_objext conftest$ac_exeext
18016 if { (eval echo "$as_me:18016: \"$ac_link\"") >&5
18017   (eval $ac_link) 2>&5
18018   ac_status=$?
18019   echo "$as_me:18019: \$? = $ac_status" >&5
18020   (exit $ac_status); } &&
18021          { ac_try='test -s conftest$ac_exeext'
18022   { (eval echo "$as_me:18022: \"$ac_try\"") >&5
18023   (eval $ac_try) 2>&5
18024   ac_status=$?
18025   echo "$as_me:18025: \$? = $ac_status" >&5
18026   (exit $ac_status); }; }; then
18027   cf_rpath_oops=`$cf_ldd_prog conftest$ac_exeext | fgrep ' not found' | sed -e 's% =>.*$%%' |sort | uniq`
18028                  cf_rpath_list=`$cf_ldd_prog conftest$ac_exeext | fgrep / | sed -e 's%^.*[      ]/%/%' -e 's%/[^/][^/]*$%%' |sort | uniq`
18029 else
18030   echo "$as_me: failed program was:" >&5
18031 cat conftest.$ac_ext >&5
18032 fi
18033 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18034
18035                 # If we passed the link-test, but get a "not found" on a given library,
18036                 # this could be due to inept reconfiguration of gcc to make it only
18037                 # partly honor /usr/local/lib (or whatever).  Sometimes this behavior
18038                 # is intentional, e.g., installing gcc in /usr/bin and suppressing the
18039                 # /usr/local libraries.
18040                 if test -n "$cf_rpath_oops"
18041                 then
18042                         for cf_rpath_src in $cf_rpath_oops
18043                         do
18044                                 for cf_rpath_dir in \
18045                                         /usr/local \
18046                                         /usr/pkg \
18047                                         /opt/sfw
18048                                 do
18049                                         if test -f $cf_rpath_dir/lib/$cf_rpath_src
18050                                         then
18051                                                 test -n "$verbose" && echo "    ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src" 1>&6
18052
18053 echo "${as_me:-configure}:18053: testing ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src ..." 1>&5
18054
18055                                                 LDFLAGS="$LDFLAGS -L$cf_rpath_dir/lib"
18056                                                 break
18057                                         fi
18058                                 done
18059                         done
18060                 fi
18061         fi
18062
18063         test -n "$verbose" && echo "    ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
18064
18065 echo "${as_me:-configure}:18065: testing ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
18066
18067 test -n "$verbose" && echo "    ...checking LDFLAGS $LDFLAGS" 1>&6
18068
18069 echo "${as_me:-configure}:18069: testing ...checking LDFLAGS $LDFLAGS ..." 1>&5
18070
18071 cf_rpath_dst=
18072 for cf_rpath_src in $LDFLAGS
18073 do
18074         case $cf_rpath_src in
18075         (-L*)
18076
18077                 # check if this refers to a directory which we will ignore
18078                 cf_rpath_skip=no
18079                 if test -n "$cf_rpath_list"
18080                 then
18081                         for cf_rpath_item in $cf_rpath_list
18082                         do
18083                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
18084                                 then
18085                                         cf_rpath_skip=yes
18086                                         break
18087                                 fi
18088                         done
18089                 fi
18090
18091                 if test "$cf_rpath_skip" = no
18092                 then
18093                         # transform the option
18094                         if test "$LD_RPATH_OPT" = "-R " ; then
18095                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
18096                         else
18097                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
18098                         fi
18099
18100                         # if we have not already added this, add it now
18101                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
18102                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
18103                         then
18104                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
18105
18106 echo "${as_me:-configure}:18106: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
18107
18108                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
18109                         fi
18110                 fi
18111                 ;;
18112         esac
18113         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
18114 done
18115 LDFLAGS=$cf_rpath_dst
18116
18117 test -n "$verbose" && echo "    ...checked LDFLAGS $LDFLAGS" 1>&6
18118
18119 echo "${as_me:-configure}:18119: testing ...checked LDFLAGS $LDFLAGS ..." 1>&5
18120
18121 test -n "$verbose" && echo "    ...checking LIBS $LIBS" 1>&6
18122
18123 echo "${as_me:-configure}:18123: testing ...checking LIBS $LIBS ..." 1>&5
18124
18125 cf_rpath_dst=
18126 for cf_rpath_src in $LIBS
18127 do
18128         case $cf_rpath_src in
18129         (-L*)
18130
18131                 # check if this refers to a directory which we will ignore
18132                 cf_rpath_skip=no
18133                 if test -n "$cf_rpath_list"
18134                 then
18135                         for cf_rpath_item in $cf_rpath_list
18136                         do
18137                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
18138                                 then
18139                                         cf_rpath_skip=yes
18140                                         break
18141                                 fi
18142                         done
18143                 fi
18144
18145                 if test "$cf_rpath_skip" = no
18146                 then
18147                         # transform the option
18148                         if test "$LD_RPATH_OPT" = "-R " ; then
18149                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
18150                         else
18151                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
18152                         fi
18153
18154                         # if we have not already added this, add it now
18155                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
18156                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
18157                         then
18158                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
18159
18160 echo "${as_me:-configure}:18160: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
18161
18162                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
18163                         fi
18164                 fi
18165                 ;;
18166         esac
18167         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
18168 done
18169 LIBS=$cf_rpath_dst
18170
18171 test -n "$verbose" && echo "    ...checked LIBS $LIBS" 1>&6
18172
18173 echo "${as_me:-configure}:18173: testing ...checked LIBS $LIBS ..." 1>&5
18174
18175         test -n "$verbose" && echo "    ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
18176
18177 echo "${as_me:-configure}:18177: testing ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
18178
18179 else
18180         echo "$as_me:18180: result: no" >&5
18181 echo "${ECHO_T}no" >&6
18182 fi
18183
18184 fi
18185
18186 TEST_ARGS="$LIBS"
18187 LIBS=
18188
18189 ac_config_files="$ac_config_files Makefile"
18190 ac_config_commands="$ac_config_commands default"
18191 cat >confcache <<\_ACEOF
18192 # This file is a shell script that caches the results of configure
18193 # tests run on this system so they can be shared between configure
18194 # scripts and configure runs, see configure's option --config-cache.
18195 # It is not useful on other systems.  If it contains results you don't
18196 # want to keep, you may remove or edit it.
18197 #
18198 # config.status only pays attention to the cache file if you give it
18199 # the --recheck option to rerun configure.
18200 #
18201 # `ac_cv_env_foo' variables (set or unset) will be overriden when
18202 # loading this file, other *unset* `ac_cv_foo' will be assigned the
18203 # following values.
18204
18205 _ACEOF
18206
18207 # The following way of writing the cache mishandles newlines in values,
18208 # but we know of no workaround that is simple, portable, and efficient.
18209 # So, don't put newlines in cache variables' values.
18210 # Ultrix sh set writes to stderr and can't be redirected directly,
18211 # and sets the high bit in the cache file unless we assign to the vars.
18212 {
18213   (set) 2>&1 |
18214     case `(ac_space=' '; set | grep ac_space) 2>&1` in
18215     *ac_space=\ *)
18216       # `set' does not quote correctly, so add quotes (double-quote
18217       # substitution turns \\\\ into \\, and sed turns \\ into \).
18218       sed -n \
18219         "s/'/'\\\\''/g;
18220           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
18221       ;;
18222     *)
18223       # `set' quotes correctly as required by POSIX, so do not add quotes.
18224       sed -n \
18225         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
18226       ;;
18227     esac;
18228 } |
18229   sed '
18230      t clear
18231      : clear
18232      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
18233      t end
18234      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
18235      : end' >>confcache
18236 if cmp -s $cache_file confcache; then :; else
18237   if test -w $cache_file; then
18238     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
18239     cat confcache >$cache_file
18240   else
18241     echo "not updating unwritable cache $cache_file"
18242   fi
18243 fi
18244 rm -f confcache
18245
18246 test "x$prefix" = xNONE && prefix=$ac_default_prefix
18247 # Let make expand exec_prefix.
18248 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
18249
18250 # VPATH may cause trouble with some makes, so we remove $(srcdir),
18251 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
18252 # trailing colons and then remove the whole line if VPATH becomes empty
18253 # (actually we leave an empty line to preserve line numbers).
18254 if test "x$srcdir" = x.; then
18255   ac_vpsub='/^[         ]*VPATH[        ]*=/{
18256 s/:*\$(srcdir):*/:/;
18257 s/:*\${srcdir}:*/:/;
18258 s/:*@srcdir@:*/:/;
18259 s/^\([^=]*=[    ]*\):*/\1/;
18260 s/:*$//;
18261 s/^[^=]*=[      ]*$//;
18262 }'
18263 fi
18264
18265 DEFS=-DHAVE_CONFIG_H
18266
18267 : ${CONFIG_STATUS=./config.status}
18268 ac_clean_files_save=$ac_clean_files
18269 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
18270 { echo "$as_me:18270: creating $CONFIG_STATUS" >&5
18271 echo "$as_me: creating $CONFIG_STATUS" >&6;}
18272 cat >$CONFIG_STATUS <<_ACEOF
18273 #! $SHELL
18274 # Generated automatically by configure.
18275 # Run this file to recreate the current configuration.
18276 # Compiler output produced by configure, useful for debugging
18277 # configure, is in config.log if it exists.
18278
18279 debug=false
18280 SHELL=\${CONFIG_SHELL-$SHELL}
18281 ac_cs_invocation="\$0 \$@"
18282
18283 _ACEOF
18284
18285 cat >>$CONFIG_STATUS <<\_ACEOF
18286 # Be Bourne compatible
18287 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
18288   emulate sh
18289   NULLCMD=:
18290 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
18291   set -o posix
18292 fi
18293
18294 # Name of the executable.
18295 as_me=`echo "$0" |sed 's,.*[\\/],,'`
18296
18297 if expr a : '\(a\)' >/dev/null 2>&1; then
18298   as_expr=expr
18299 else
18300   as_expr=false
18301 fi
18302
18303 rm -f conf$$ conf$$.exe conf$$.file
18304 echo >conf$$.file
18305 if ln -s conf$$.file conf$$ 2>/dev/null; then
18306   # We could just check for DJGPP; but this test a) works b) is more generic
18307   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
18308   if test -f conf$$.exe; then
18309     # Don't use ln at all; we don't have any links
18310     as_ln_s='cp -p'
18311   else
18312     as_ln_s='ln -s'
18313   fi
18314 elif ln conf$$.file conf$$ 2>/dev/null; then
18315   as_ln_s=ln
18316 else
18317   as_ln_s='cp -p'
18318 fi
18319 rm -f conf$$ conf$$.exe conf$$.file
18320
18321 as_executable_p="test -f"
18322
18323 # Support unset when possible.
18324 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
18325   as_unset=unset
18326 else
18327   as_unset=false
18328 fi
18329
18330 # NLS nuisances.
18331 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
18332 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
18333 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
18334 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
18335 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
18336 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
18337 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
18338 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
18339
18340 # IFS
18341 # We need space, tab and new line, in precisely that order.
18342 as_nl='
18343 '
18344 IFS="   $as_nl"
18345
18346 # CDPATH.
18347 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
18348
18349 exec 6>&1
18350
18351 _ACEOF
18352
18353 # Files that config.status was made for.
18354 if test -n "$ac_config_files"; then
18355   echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
18356 fi
18357
18358 if test -n "$ac_config_headers"; then
18359   echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
18360 fi
18361
18362 if test -n "$ac_config_links"; then
18363   echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
18364 fi
18365
18366 if test -n "$ac_config_commands"; then
18367   echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
18368 fi
18369
18370 cat >>$CONFIG_STATUS <<\EOF
18371
18372 ac_cs_usage="\
18373 \`$as_me' instantiates files from templates according to the
18374 current configuration.
18375
18376 Usage: $0 [OPTIONS] [FILE]...
18377
18378   -h, --help       print this help, then exit
18379   -V, --version    print version number, then exit
18380   -d, --debug      don't remove temporary files
18381       --recheck    update $as_me by reconfiguring in the same conditions
18382   --file=FILE[:TEMPLATE]
18383                    instantiate the configuration file FILE
18384   --header=FILE[:TEMPLATE]
18385                    instantiate the configuration header FILE
18386
18387 Configuration files:
18388 $config_files
18389
18390 Configuration headers:
18391 $config_headers
18392
18393 Configuration commands:
18394 $config_commands
18395
18396 Report bugs to <dickey@invisible-island.net>."
18397 EOF
18398
18399 cat >>$CONFIG_STATUS <<EOF
18400 ac_cs_version="\\
18401 config.status
18402 configured by $0, generated by GNU Autoconf 2.52.20150926,
18403   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
18404
18405 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
18406 Free Software Foundation, Inc.
18407 This config.status script is free software; the Free Software Foundation
18408 gives unlimited permission to copy, distribute and modify it."
18409 srcdir=$srcdir
18410 INSTALL="$INSTALL"
18411 EOF
18412
18413 cat >>$CONFIG_STATUS <<\EOF
18414 # If no file are specified by the user, then we need to provide default
18415 # value.  By we need to know if files were specified by the user.
18416 ac_need_defaults=:
18417 while test $# != 0
18418 do
18419   case $1 in
18420   --*=*)
18421     ac_option=`expr "x$1" : 'x\([^=]*\)='`
18422     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
18423     shift
18424     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
18425     shift
18426     ;;
18427   -*);;
18428   *) # This is not an option, so the user has probably given explicit
18429      # arguments.
18430      ac_need_defaults=false;;
18431   esac
18432
18433   case $1 in
18434   # Handling of the options.
18435 EOF
18436 cat >>$CONFIG_STATUS <<EOF
18437   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
18438     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
18439     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
18440 EOF
18441 cat >>$CONFIG_STATUS <<\EOF
18442   --version | --vers* | -V )
18443     echo "$ac_cs_version"; exit 0 ;;
18444   --he | --h)
18445     # Conflict between --help and --header
18446     { { echo "$as_me:18446: error: ambiguous option: $1
18447 Try \`$0 --help' for more information." >&5
18448 echo "$as_me: error: ambiguous option: $1
18449 Try \`$0 --help' for more information." >&2;}
18450    { (exit 1); exit 1; }; };;
18451   --help | --hel | -h )
18452     echo "$ac_cs_usage"; exit 0 ;;
18453   --debug | --d* | -d )
18454     debug=: ;;
18455   --file | --fil | --fi | --f )
18456     shift
18457     CONFIG_FILES="$CONFIG_FILES $1"
18458     ac_need_defaults=false;;
18459   --header | --heade | --head | --hea )
18460     shift
18461     CONFIG_HEADERS="$CONFIG_HEADERS $1"
18462     ac_need_defaults=false;;
18463
18464   # This is an error.
18465   -*) { { echo "$as_me:18465: error: unrecognized option: $1
18466 Try \`$0 --help' for more information." >&5
18467 echo "$as_me: error: unrecognized option: $1
18468 Try \`$0 --help' for more information." >&2;}
18469    { (exit 1); exit 1; }; } ;;
18470
18471   *) ac_config_targets="$ac_config_targets $1" ;;
18472
18473   esac
18474   shift
18475 done
18476
18477 exec 5>>config.log
18478 cat >&5 << _ACEOF
18479
18480 ## ----------------------- ##
18481 ## Running config.status.  ##
18482 ## ----------------------- ##
18483
18484 This file was extended by $as_me 2.52.20150926, executed with
18485   CONFIG_FILES    = $CONFIG_FILES
18486   CONFIG_HEADERS  = $CONFIG_HEADERS
18487   CONFIG_LINKS    = $CONFIG_LINKS
18488   CONFIG_COMMANDS = $CONFIG_COMMANDS
18489   > $ac_cs_invocation
18490 on `(hostname || uname -n) 2>/dev/null | sed 1q`
18491
18492 _ACEOF
18493 EOF
18494
18495 cat >>$CONFIG_STATUS <<EOF
18496 #
18497 # INIT-COMMANDS section.
18498 #
18499
18500 AWK="$AWK"
18501 ECHO_CC="$ECHO_CC"
18502 ECHO_LD="$ECHO_LD"
18503 SHOW_CC="$SHOW_LD"
18504
18505 EOF
18506
18507 cat >>$CONFIG_STATUS <<\EOF
18508 for ac_config_target in $ac_config_targets
18509 do
18510   case "$ac_config_target" in
18511   # Handling of arguments.
18512   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
18513   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
18514   "ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS ncurses_cfg.h:ncurses_tst.hin" ;;
18515   *) { { echo "$as_me:18515: error: invalid argument: $ac_config_target" >&5
18516 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
18517    { (exit 1); exit 1; }; };;
18518   esac
18519 done
18520
18521 # If the user did not use the arguments to specify the items to instantiate,
18522 # then the envvar interface is used.  Set only those that are not.
18523 # We use the long form for the default assignment because of an extremely
18524 # bizarre bug on SunOS 4.1.3.
18525 if $ac_need_defaults; then
18526   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
18527   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
18528   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
18529 fi
18530
18531 # Create a temporary directory, and hook for its removal unless debugging.
18532 $debug ||
18533 {
18534   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
18535   trap '{ (exit 1); exit 1; }' 1 2 13 15
18536 }
18537
18538 # Create a (secure) tmp directory for tmp files.
18539 : ${TMPDIR=/tmp}
18540 {
18541   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
18542   test -n "$tmp" && test -d "$tmp"
18543 }  ||
18544 {
18545   tmp=$TMPDIR/cs$$-$RANDOM
18546   (umask 077 && mkdir $tmp)
18547 } ||
18548 {
18549    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
18550    { (exit 1); exit 1; }
18551 }
18552
18553 EOF
18554
18555 cat >>$CONFIG_STATUS <<EOF
18556
18557 #
18558 # CONFIG_FILES section.
18559 #
18560
18561 # No need to generate the scripts if there are no CONFIG_FILES.
18562 # This happens for instance when ./config.status config.h
18563 if test -n "\$CONFIG_FILES"; then
18564   # Protect against being on the right side of a sed subst in config.status.
18565   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
18566    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
18567 s,@SHELL@,$SHELL,;t t
18568 s,@exec_prefix@,$exec_prefix,;t t
18569 s,@prefix@,$prefix,;t t
18570 s,@program_transform_name@,$program_transform_name,;t t
18571 s,@bindir@,$bindir,;t t
18572 s,@sbindir@,$sbindir,;t t
18573 s,@libexecdir@,$libexecdir,;t t
18574 s,@datarootdir@,$datarootdir,;t t
18575 s,@datadir@,$datadir,;t t
18576 s,@sysconfdir@,$sysconfdir,;t t
18577 s,@sharedstatedir@,$sharedstatedir,;t t
18578 s,@localstatedir@,$localstatedir,;t t
18579 s,@libdir@,$libdir,;t t
18580 s,@includedir@,$includedir,;t t
18581 s,@oldincludedir@,$oldincludedir,;t t
18582 s,@infodir@,$infodir,;t t
18583 s,@mandir@,$mandir,;t t
18584 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
18585 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
18586 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
18587 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
18588 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
18589 s,@build_alias@,$build_alias,;t t
18590 s,@host_alias@,$host_alias,;t t
18591 s,@target_alias@,$target_alias,;t t
18592 s,@ECHO_C@,$ECHO_C,;t t
18593 s,@ECHO_N@,$ECHO_N,;t t
18594 s,@ECHO_T@,$ECHO_T,;t t
18595 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
18596 s,@DEFS@,$DEFS,;t t
18597 s,@LIBS@,$LIBS,;t t
18598 s,@build@,$build,;t t
18599 s,@build_cpu@,$build_cpu,;t t
18600 s,@build_vendor@,$build_vendor,;t t
18601 s,@build_os@,$build_os,;t t
18602 s,@host@,$host,;t t
18603 s,@host_cpu@,$host_cpu,;t t
18604 s,@host_vendor@,$host_vendor,;t t
18605 s,@host_os@,$host_os,;t t
18606 s,@SET_MAKE@,$SET_MAKE,;t t
18607 s,@CC@,$CC,;t t
18608 s,@CFLAGS@,$CFLAGS,;t t
18609 s,@LDFLAGS@,$LDFLAGS,;t t
18610 s,@CPPFLAGS@,$CPPFLAGS,;t t
18611 s,@ac_ct_CC@,$ac_ct_CC,;t t
18612 s,@EXEEXT@,$EXEEXT,;t t
18613 s,@OBJEXT@,$OBJEXT,;t t
18614 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
18615 s,@CPP@,$CPP,;t t
18616 s,@AWK@,$AWK,;t t
18617 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
18618 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
18619 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
18620 s,@LINT@,$LINT,;t t
18621 s,@LINT_OPTS@,$LINT_OPTS,;t t
18622 s,@CTAGS@,$CTAGS,;t t
18623 s,@ETAGS@,$ETAGS,;t t
18624 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
18625 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
18626 s,@MATH_LIB@,$MATH_LIB,;t t
18627 s,@top_builddir@,$top_builddir,;t t
18628 s,@CC_G_OPT@,$CC_G_OPT,;t t
18629 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
18630 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
18631 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
18632 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
18633 s,@LD@,$LD,;t t
18634 s,@LDFLAGS_SHARED@,$LDFLAGS_SHARED,;t t
18635 s,@LDFLAGS_STATIC@,$LDFLAGS_STATIC,;t t
18636 s,@LD_MODEL@,$LD_MODEL,;t t
18637 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
18638 s,@LIBTOOL@,$LIBTOOL,;t t
18639 s,@LIBTOOL_OPTS@,$LIBTOOL_OPTS,;t t
18640 s,@LIB_CLEAN@,$LIB_CLEAN,;t t
18641 s,@LIB_COMPILE@,$LIB_COMPILE,;t t
18642 s,@LIB_LINK@,$LIB_LINK,;t t
18643 s,@LINK_TESTS@,$LINK_TESTS,;t t
18644 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
18645 s,@PACKAGE@,$PACKAGE,;t t
18646 s,@PTHREAD@,$PTHREAD,;t t
18647 s,@TEST_ARGS@,$TEST_ARGS,;t t
18648 s,@TEST_DEPS@,$TEST_DEPS,;t t
18649 s,@TEST_LIBS@,$TEST_LIBS,;t t
18650 s,@TINFO_LDFLAGS@,$TINFO_LDFLAGS,;t t
18651 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
18652 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
18653 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
18654 s,@includesubdir@,$includesubdir,;t t
18655 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
18656 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
18657 s,@ECHO_LT@,$ECHO_LT,;t t
18658 s,@ECHO_LD@,$ECHO_LD,;t t
18659 s,@RULE_CC@,$RULE_CC,;t t
18660 s,@SHOW_CC@,$SHOW_CC,;t t
18661 s,@ECHO_CC@,$ECHO_CC,;t t
18662 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
18663 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
18664 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
18665 s,@X_CFLAGS@,$X_CFLAGS,;t t
18666 s,@X_PRE_LIBS@,$X_PRE_LIBS,;t t
18667 s,@X_LIBS@,$X_LIBS,;t t
18668 s,@X_EXTRA_LIBS@,$X_EXTRA_LIBS,;t t
18669 s,@XCURSES_CONFIG@,$XCURSES_CONFIG,;t t
18670 s,@ac_ct_XCURSES_CONFIG@,$ac_ct_XCURSES_CONFIG,;t t
18671 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
18672 s,@cf_ldd_prog@,$cf_ldd_prog,;t t
18673 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
18674 CEOF
18675
18676 EOF
18677
18678   cat >>$CONFIG_STATUS <<\EOF
18679   # Split the substitutions into bite-sized pieces for seds with
18680   # small command number limits, like on Digital OSF/1 and HP-UX.
18681   ac_max_sed_lines=48
18682   ac_sed_frag=1 # Number of current file.
18683   ac_beg=1 # First line for current file.
18684   ac_end=$ac_max_sed_lines # Line after last line for current file.
18685   ac_more_lines=:
18686   ac_sed_cmds=
18687   while $ac_more_lines; do
18688     if test $ac_beg -gt 1; then
18689       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
18690     else
18691       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
18692     fi
18693     if test ! -s $tmp/subs.frag; then
18694       ac_more_lines=false
18695     else
18696       # The purpose of the label and of the branching condition is to
18697       # speed up the sed processing (if there are no `@' at all, there
18698       # is no need to browse any of the substitutions).
18699       # These are the two extra sed commands mentioned above.
18700       (echo ':t
18701   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
18702       # It is possible to make a multiline substitution using escaped newlines.
18703       # Ensure that we do not split the substitution between script fragments.
18704       ac_BEG=$ac_end
18705       ac_END=`expr $ac_end + $ac_max_sed_lines`
18706       sed "1,${ac_BEG}d; ${ac_END}p; q" $tmp/subs.sed >$tmp/subs.next
18707       if test -s $tmp/subs.next; then
18708         grep '^s,@[^@,][^@,]*@,.*\\$' $tmp/subs.next >$tmp/subs.edit
18709         if test ! -s $tmp/subs.edit; then
18710           grep "^s,@[^@,][^@,]*@,.*,;t t$" $tmp/subs.next >$tmp/subs.edit
18711           if test ! -s $tmp/subs.edit; then
18712             if test $ac_beg -gt 1; then
18713               ac_end=`expr $ac_end - 1`
18714               continue
18715             fi
18716           fi
18717         fi
18718       fi
18719
18720       if test -z "$ac_sed_cmds"; then
18721         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
18722       else
18723         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
18724       fi
18725       ac_sed_frag=`expr $ac_sed_frag + 1`
18726       ac_beg=$ac_end
18727       ac_end=`expr $ac_end + $ac_max_sed_lines`
18728     fi
18729   done
18730   if test -z "$ac_sed_cmds"; then
18731     ac_sed_cmds=cat
18732   fi
18733 fi # test -n "$CONFIG_FILES"
18734
18735 EOF
18736 cat >>$CONFIG_STATUS <<\EOF
18737 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
18738   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
18739   case $ac_file in
18740   - | *:- | *:-:* ) # input from stdin
18741         cat >$tmp/stdin
18742         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
18743         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
18744   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
18745         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
18746   * )   ac_file_in=$ac_file.in ;;
18747   esac
18748
18749   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
18750   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
18751          X"$ac_file" : 'X\(//\)[^/]' \| \
18752          X"$ac_file" : 'X\(//\)$' \| \
18753          X"$ac_file" : 'X\(/\)' \| \
18754          .     : '\(.\)' 2>/dev/null ||
18755 echo X"$ac_file" |
18756     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
18757           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
18758           /^X\(\/\/\)$/{ s//\1/; q; }
18759           /^X\(\/\).*/{ s//\1/; q; }
18760           s/.*/./; q'`
18761   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
18762     { case "$ac_dir" in
18763   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
18764   *)                      as_incr_dir=.;;
18765 esac
18766 as_dummy="$ac_dir"
18767 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
18768   case $as_mkdir_dir in
18769     # Skip DOS drivespec
18770     ?:) as_incr_dir=$as_mkdir_dir ;;
18771     *)
18772       as_incr_dir=$as_incr_dir/$as_mkdir_dir
18773       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
18774     ;;
18775   esac
18776 done; }
18777
18778     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
18779     # A "../" for each directory in $ac_dir_suffix.
18780     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
18781   else
18782     ac_dir_suffix= ac_dots=
18783   fi
18784
18785   case $srcdir in
18786   .)  ac_srcdir=.
18787       if test -z "$ac_dots"; then
18788          ac_top_srcdir=.
18789       else
18790          ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'`
18791       fi ;;
18792   [\\/]* | ?:[\\/]* )
18793       ac_srcdir=$srcdir$ac_dir_suffix;
18794       ac_top_srcdir=$srcdir ;;
18795   *) # Relative path.
18796     ac_srcdir=$ac_dots$srcdir$ac_dir_suffix
18797     ac_top_srcdir=$ac_dots$srcdir ;;
18798   esac
18799
18800   case $INSTALL in
18801   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
18802   *) ac_INSTALL=$ac_dots$INSTALL ;;
18803   esac
18804
18805   if test x"$ac_file" != x-; then
18806     { echo "$as_me:18806: creating $ac_file" >&5
18807 echo "$as_me: creating $ac_file" >&6;}
18808     rm -f "$ac_file"
18809   fi
18810   # Let's still pretend it is `configure' which instantiates (i.e., don't
18811   # use $as_me), people would be surprised to read:
18812   #    /* config.h.  Generated automatically by config.status.  */
18813   configure_input="Generated automatically from `echo $ac_file_in |
18814                                                  sed 's,.*/,,'` by configure."
18815
18816   # First look for the input files in the build tree, otherwise in the
18817   # src tree.
18818   ac_file_inputs=`IFS=:
18819     for f in $ac_file_in; do
18820       case $f in
18821       -) echo $tmp/stdin ;;
18822       [\\/$]*)
18823          # Absolute (can't be DOS-style, as IFS=:)
18824          test -f "$f" || { { echo "$as_me:18824: error: cannot find input file: $f" >&5
18825 echo "$as_me: error: cannot find input file: $f" >&2;}
18826    { (exit 1); exit 1; }; }
18827          echo $f;;
18828       *) # Relative
18829          if test -f "$f"; then
18830            # Build tree
18831            echo $f
18832          elif test -f "$srcdir/$f"; then
18833            # Source tree
18834            echo $srcdir/$f
18835          else
18836            # /dev/null tree
18837            { { echo "$as_me:18837: error: cannot find input file: $f" >&5
18838 echo "$as_me: error: cannot find input file: $f" >&2;}
18839    { (exit 1); exit 1; }; }
18840          fi;;
18841       esac
18842     done` || { (exit 1); exit 1; }
18843 EOF
18844 cat >>$CONFIG_STATUS <<\EOF
18845   ac_warn_datarootdir=no
18846   if test x"$ac_file" != x-; then
18847     for ac_item in $ac_file_inputs
18848     do
18849       ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' $ac_item`
18850       if test -n "$ac_seen"; then
18851         ac_used=`grep '@datarootdir@' $ac_item`
18852         if test -z "$ac_used"; then
18853           { echo "$as_me:18853: WARNING: datarootdir was used implicitly but not set:
18854 $ac_seen" >&5
18855 echo "$as_me: WARNING: datarootdir was used implicitly but not set:
18856 $ac_seen" >&2;}
18857           ac_warn_datarootdir=yes
18858         fi
18859       fi
18860       ac_seen=`grep '${datarootdir}' $ac_item`
18861       if test -n "$ac_seen"; then
18862         { echo "$as_me:18862: WARNING: datarootdir was used explicitly but not set:
18863 $ac_seen" >&5
18864 echo "$as_me: WARNING: datarootdir was used explicitly but not set:
18865 $ac_seen" >&2;}
18866         ac_warn_datarootdir=yes
18867       fi
18868     done
18869   fi
18870
18871 if test "x$ac_warn_datarootdir" = xyes; then
18872   ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
18873 fi
18874
18875 EOF
18876 cat >>$CONFIG_STATUS <<EOF
18877   sed "$ac_vpsub
18878 $extrasub
18879 EOF
18880 cat >>$CONFIG_STATUS <<\EOF
18881 :t
18882 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
18883 s,@configure_input@,$configure_input,;t t
18884 s,@srcdir@,$ac_srcdir,;t t
18885 s,@top_srcdir@,$ac_top_srcdir,;t t
18886 s,@INSTALL@,$ac_INSTALL,;t t
18887 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
18888   rm -f $tmp/stdin
18889   if test x"$ac_file" != x-; then
18890     cp $tmp/out $ac_file
18891
18892     for ac_name in prefix exec_prefix datarootdir
18893     do
18894         ac_seen=`fgrep -n '${'$ac_name'[:=].*}' $ac_file`
18895         if test -n "$ac_seen"; then
18896             ac_init=`egrep '[   ]*'$ac_name'[   ]*=' $ac_file`
18897             if test -z "$ac_init"; then
18898               ac_seen=`echo "$ac_seen" |sed -e 's,^,'$ac_file':,'`
18899               { echo "$as_me:18899: WARNING: Variable $ac_name is used but was not set:
18900 $ac_seen" >&5
18901 echo "$as_me: WARNING: Variable $ac_name is used but was not set:
18902 $ac_seen" >&2;}
18903             fi
18904         fi
18905     done
18906     egrep -n '@[a-z_][a-z_0-9]+@' $ac_file >$tmp/out
18907     egrep -n '@[A-Z_][A-Z_0-9]+@' $ac_file >>$tmp/out
18908     if test -s $tmp/out; then
18909       ac_seen=`sed -e 's,^,'$ac_file':,' < $tmp/out`
18910       { echo "$as_me:18910: WARNING: Some variables may not be substituted:
18911 $ac_seen" >&5
18912 echo "$as_me: WARNING: Some variables may not be substituted:
18913 $ac_seen" >&2;}
18914     fi
18915   else
18916     cat $tmp/out
18917   fi
18918   rm -f $tmp/out
18919
18920 done
18921 EOF
18922 cat >>$CONFIG_STATUS <<\EOF
18923
18924 #
18925 # CONFIG_HEADER section.
18926 #
18927
18928 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
18929 # NAME is the cpp macro being defined and VALUE is the value it is being given.
18930 #
18931 # ac_d sets the value in "#define NAME VALUE" lines.
18932 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
18933 ac_dB='[        ].*$,\1#\2'
18934 ac_dC=' '
18935 ac_dD=',;t'
18936 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
18937 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
18938 ac_iB='\([      ]\),\1#\2define\3'
18939 ac_iC=' '
18940 ac_iD='\4,;t'
18941 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
18942 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
18943 ac_uB='$,\1#\2define\3'
18944 ac_uC=' '
18945 ac_uD=',;t'
18946
18947 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
18948   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
18949   case $ac_file in
18950   - | *:- | *:-:* ) # input from stdin
18951         cat >$tmp/stdin
18952         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
18953         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
18954   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
18955         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
18956   * )   ac_file_in=$ac_file.in ;;
18957   esac
18958
18959   test x"$ac_file" != x- && { echo "$as_me:18959: creating $ac_file" >&5
18960 echo "$as_me: creating $ac_file" >&6;}
18961
18962   # First look for the input files in the build tree, otherwise in the
18963   # src tree.
18964   ac_file_inputs=`IFS=:
18965     for f in $ac_file_in; do
18966       case $f in
18967       -) echo $tmp/stdin ;;
18968       [\\/$]*)
18969          # Absolute (can't be DOS-style, as IFS=:)
18970          test -f "$f" || { { echo "$as_me:18970: error: cannot find input file: $f" >&5
18971 echo "$as_me: error: cannot find input file: $f" >&2;}
18972    { (exit 1); exit 1; }; }
18973          echo $f;;
18974       *) # Relative
18975          if test -f "$f"; then
18976            # Build tree
18977            echo $f
18978          elif test -f "$srcdir/$f"; then
18979            # Source tree
18980            echo $srcdir/$f
18981          else
18982            # /dev/null tree
18983            { { echo "$as_me:18983: error: cannot find input file: $f" >&5
18984 echo "$as_me: error: cannot find input file: $f" >&2;}
18985    { (exit 1); exit 1; }; }
18986          fi;;
18987       esac
18988     done` || { (exit 1); exit 1; }
18989   # Remove the trailing spaces.
18990   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
18991
18992 EOF
18993
18994 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
18995 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
18996 # be either 'cat' or 'sort'.
18997 cat confdefs.h | uniq >conftest.vals
18998
18999 # Break up conftest.vals because some shells have a limit on
19000 # the size of here documents, and old seds have small limits too.
19001
19002 rm -f conftest.tail
19003 echo '  rm -f conftest.frag' >> $CONFIG_STATUS
19004 while grep . conftest.vals >/dev/null
19005 do
19006   # Write chunks of a limited-size here document to conftest.frag.
19007   echo '  cat >> conftest.frag <<CEOF' >> $CONFIG_STATUS
19008   sed ${ac_max_here_lines}q conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> $CONFIG_STATUS
19009   echo 'CEOF' >> $CONFIG_STATUS
19010   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
19011   rm -f conftest.vals
19012   mv conftest.tail conftest.vals
19013 done
19014 rm -f conftest.vals
19015
19016 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
19017 # marker @DEFS@.
19018 echo '  cat >> conftest.edit <<CEOF
19019 /@DEFS@/r conftest.frag
19020 /@DEFS@/d
19021 CEOF
19022 sed -f conftest.edit $tmp/in > $tmp/out
19023 rm -f $tmp/in
19024 mv $tmp/out $tmp/in
19025 rm -f conftest.edit conftest.frag
19026 ' >> $CONFIG_STATUS
19027
19028 cat >>$CONFIG_STATUS <<\EOF
19029   # Let's still pretend it is `configure' which instantiates (i.e., don't
19030   # use $as_me), people would be surprised to read:
19031   #    /* config.h.  Generated automatically by config.status.  */
19032   if test x"$ac_file" = x-; then
19033     echo "/* Generated automatically by configure.  */" >$tmp/config.h
19034   else
19035     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
19036   fi
19037   cat $tmp/in >>$tmp/config.h
19038   rm -f $tmp/in
19039   if test x"$ac_file" != x-; then
19040     if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
19041       { echo "$as_me:19041: $ac_file is unchanged" >&5
19042 echo "$as_me: $ac_file is unchanged" >&6;}
19043     else
19044       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
19045          X"$ac_file" : 'X\(//\)[^/]' \| \
19046          X"$ac_file" : 'X\(//\)$' \| \
19047          X"$ac_file" : 'X\(/\)' \| \
19048          .     : '\(.\)' 2>/dev/null ||
19049 echo X"$ac_file" |
19050     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
19051           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
19052           /^X\(\/\/\)$/{ s//\1/; q; }
19053           /^X\(\/\).*/{ s//\1/; q; }
19054           s/.*/./; q'`
19055       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
19056         { case "$ac_dir" in
19057   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
19058   *)                      as_incr_dir=.;;
19059 esac
19060 as_dummy="$ac_dir"
19061 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
19062   case $as_mkdir_dir in
19063     # Skip DOS drivespec
19064     ?:) as_incr_dir=$as_mkdir_dir ;;
19065     *)
19066       as_incr_dir=$as_incr_dir/$as_mkdir_dir
19067       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
19068     ;;
19069   esac
19070 done; }
19071
19072       fi
19073       rm -f $ac_file
19074       mv $tmp/config.h $ac_file
19075     fi
19076   else
19077     cat $tmp/config.h
19078     rm -f $tmp/config.h
19079   fi
19080 done
19081 EOF
19082 cat >>$CONFIG_STATUS <<\EOF
19083 #
19084 # CONFIG_COMMANDS section.
19085 #
19086 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
19087   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
19088   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
19089
19090   case $ac_dest in
19091     default )
19092
19093 for cf_dir in .
19094 do
19095         if test ! -d $srcdir/$cf_dir; then
19096                 continue
19097         elif test -f $srcdir/$cf_dir/programs; then
19098                 $AWK -f $srcdir/mk-test.awk INSTALL=yes ECHO_LINK="$ECHO_LD" $srcdir/$cf_dir/programs >>$cf_dir/Makefile
19099         fi
19100 done
19101
19102         cat >>Makefile <<TEST_EOF
19103
19104 # These rules are generated so we do not rely on suffix rules, which do not
19105 # work consistently for different make-programs (the '\$(MODEL)/' confuses
19106 # some, and the '\$x' confuses others).
19107 TEST_EOF
19108
19109 LIST=`sed -e 's/[       ].*//' -e '/^[#@]/d' $srcdir/modules`
19110 for N in $LIST
19111 do
19112         cat >>Makefile <<TEST_EOF
19113
19114 \$(MODEL)/$N.o : \$(srcdir)/$N.c \\
19115         \$(srcdir)/test.priv.h \\
19116         ncurses_cfg.h
19117         $SHOW_CC
19118         $ECHO_CC\$(CC) -c \$(CFLAGS_DEFAULT) \$(srcdir)/$N.c
19119 TEST_EOF
19120 done
19121
19122 if test -f ../config.guess && test -f ../config.sub
19123 then
19124         cat >>Makefile <<TEST_EOF
19125
19126 # if we used CF_INHERIT for getting these files, we can remove them
19127 distclean::
19128         rm -f config.guess config.sub
19129 TEST_EOF
19130 fi
19131  ;;
19132   esac
19133 done
19134 EOF
19135
19136 cat >>$CONFIG_STATUS <<\EOF
19137
19138 { (exit 0); exit 0; }
19139 EOF
19140 chmod +x $CONFIG_STATUS
19141 ac_clean_files=$ac_clean_files_save
19142
19143 # configure is writing to config.log, and then calls config.status.
19144 # config.status does its own redirection, appending to config.log.
19145 # Unfortunately, on DOS this fails, as config.log is still kept open
19146 # by configure, so config.status won't be able to write to it; its
19147 # output is simply discarded.  So we exec the FD to /dev/null,
19148 # effectively closing config.log, so it can be properly (re)opened and
19149 # appended to by config.status.  When coming back to configure, we
19150 # need to make the FD available again.
19151 if test "$no_create" != yes; then
19152   ac_cs_success=:
19153   exec 5>/dev/null
19154   $SHELL $CONFIG_STATUS || ac_cs_success=false
19155   exec 5>>config.log
19156   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
19157   # would make configure fail if this is the last instruction.
19158   $ac_cs_success || { (exit 1); exit 1; }
19159 fi
19160