]> ncurses.scripts.mit.edu Git - ncurses.git/blob - test/configure
ncurses 6.0 - patch 20160827
[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/^.*[   ]\(-[^  ]\)/\1/'`
1946         CC=`echo "$CC " | sed -e 's/[   ]-[^    ].*$//' -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 (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|cygwin)
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 (osf[45]*)
3238         cf_xopen_source="-D_OSF_SOURCE"
3239         ;;
3240 (nto-qnx*)
3241         cf_xopen_source="-D_QNX_SOURCE"
3242         ;;
3243 (sco*)
3244         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
3245         ;;
3246 (solaris2.*)
3247         cf_xopen_source="-D__EXTENSIONS__"
3248         cf_cv_xopen_source=broken
3249         ;;
3250 (sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
3251         cf_XOPEN_SOURCE=
3252         cf_POSIX_C_SOURCE=
3253         ;;
3254 (*)
3255
3256 echo "$as_me:3256: checking if we should define _XOPEN_SOURCE" >&5
3257 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
3258 if test "${cf_cv_xopen_source+set}" = set; then
3259   echo $ECHO_N "(cached) $ECHO_C" >&6
3260 else
3261
3262         cat >conftest.$ac_ext <<_ACEOF
3263 #line 3263 "configure"
3264 #include "confdefs.h"
3265
3266 #include <stdlib.h>
3267 #include <string.h>
3268 #include <sys/types.h>
3269
3270 int
3271 main ()
3272 {
3273
3274 #ifndef _XOPEN_SOURCE
3275 make an error
3276 #endif
3277   ;
3278   return 0;
3279 }
3280 _ACEOF
3281 rm -f conftest.$ac_objext
3282 if { (eval echo "$as_me:3282: \"$ac_compile\"") >&5
3283   (eval $ac_compile) 2>&5
3284   ac_status=$?
3285   echo "$as_me:3285: \$? = $ac_status" >&5
3286   (exit $ac_status); } &&
3287          { ac_try='test -s conftest.$ac_objext'
3288   { (eval echo "$as_me:3288: \"$ac_try\"") >&5
3289   (eval $ac_try) 2>&5
3290   ac_status=$?
3291   echo "$as_me:3291: \$? = $ac_status" >&5
3292   (exit $ac_status); }; }; then
3293   cf_cv_xopen_source=no
3294 else
3295   echo "$as_me: failed program was:" >&5
3296 cat conftest.$ac_ext >&5
3297 cf_save="$CPPFLAGS"
3298          CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
3299          cat >conftest.$ac_ext <<_ACEOF
3300 #line 3300 "configure"
3301 #include "confdefs.h"
3302
3303 #include <stdlib.h>
3304 #include <string.h>
3305 #include <sys/types.h>
3306
3307 int
3308 main ()
3309 {
3310
3311 #ifdef _XOPEN_SOURCE
3312 make an error
3313 #endif
3314   ;
3315   return 0;
3316 }
3317 _ACEOF
3318 rm -f conftest.$ac_objext
3319 if { (eval echo "$as_me:3319: \"$ac_compile\"") >&5
3320   (eval $ac_compile) 2>&5
3321   ac_status=$?
3322   echo "$as_me:3322: \$? = $ac_status" >&5
3323   (exit $ac_status); } &&
3324          { ac_try='test -s conftest.$ac_objext'
3325   { (eval echo "$as_me:3325: \"$ac_try\"") >&5
3326   (eval $ac_try) 2>&5
3327   ac_status=$?
3328   echo "$as_me:3328: \$? = $ac_status" >&5
3329   (exit $ac_status); }; }; then
3330   cf_cv_xopen_source=no
3331 else
3332   echo "$as_me: failed program was:" >&5
3333 cat conftest.$ac_ext >&5
3334 cf_cv_xopen_source=$cf_XOPEN_SOURCE
3335 fi
3336 rm -f conftest.$ac_objext conftest.$ac_ext
3337         CPPFLAGS="$cf_save"
3338
3339 fi
3340 rm -f conftest.$ac_objext conftest.$ac_ext
3341
3342 fi
3343 echo "$as_me:3343: result: $cf_cv_xopen_source" >&5
3344 echo "${ECHO_T}$cf_cv_xopen_source" >&6
3345
3346 if test "$cf_cv_xopen_source" != no ; then
3347
3348 CFLAGS=`echo "$CFLAGS" | \
3349         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
3350                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
3351
3352 CPPFLAGS=`echo "$CPPFLAGS" | \
3353         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
3354                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
3355
3356         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
3357
3358 cf_fix_cppflags=no
3359 cf_new_cflags=
3360 cf_new_cppflags=
3361 cf_new_extra_cppflags=
3362
3363 for cf_add_cflags in $cf_temp_xopen_source
3364 do
3365 case $cf_fix_cppflags in
3366 (no)
3367         case $cf_add_cflags in
3368         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
3369                 case $cf_add_cflags in
3370                 (-D*)
3371                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3372
3373                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3374                                 && test -z "${cf_tst_cflags}" \
3375                                 && cf_fix_cppflags=yes
3376
3377                         if test $cf_fix_cppflags = yes ; then
3378                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3379                                 continue
3380                         elif test "${cf_tst_cflags}" = "\"'" ; then
3381                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3382                                 continue
3383                         fi
3384                         ;;
3385                 esac
3386                 case "$CPPFLAGS" in
3387                 (*$cf_add_cflags)
3388                         ;;
3389                 (*)
3390                         case $cf_add_cflags in
3391                         (-D*)
3392                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3393
3394 CPPFLAGS=`echo "$CPPFLAGS" | \
3395         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3396                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3397
3398                                 ;;
3399                         esac
3400                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3401                         ;;
3402                 esac
3403                 ;;
3404         (*)
3405                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
3406                 ;;
3407         esac
3408         ;;
3409 (yes)
3410         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3411
3412         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3413
3414         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3415                 && test -z "${cf_tst_cflags}" \
3416                 && cf_fix_cppflags=no
3417         ;;
3418 esac
3419 done
3420
3421 if test -n "$cf_new_cflags" ; then
3422
3423         CFLAGS="$CFLAGS $cf_new_cflags"
3424 fi
3425
3426 if test -n "$cf_new_cppflags" ; then
3427
3428         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
3429 fi
3430
3431 if test -n "$cf_new_extra_cppflags" ; then
3432
3433         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
3434 fi
3435
3436 fi
3437
3438 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
3439
3440 cf_save_CFLAGS="$CFLAGS"
3441 cf_save_CPPFLAGS="$CPPFLAGS"
3442
3443 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
3444         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
3445                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
3446
3447 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
3448         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
3449                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
3450
3451 echo "$as_me:3451: checking if we should define _POSIX_C_SOURCE" >&5
3452 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
3453 if test "${cf_cv_posix_c_source+set}" = set; then
3454   echo $ECHO_N "(cached) $ECHO_C" >&6
3455 else
3456
3457 echo "${as_me:-configure}:3457: testing if the symbol is already defined go no further ..." 1>&5
3458
3459         cat >conftest.$ac_ext <<_ACEOF
3460 #line 3460 "configure"
3461 #include "confdefs.h"
3462 #include <sys/types.h>
3463 int
3464 main ()
3465 {
3466
3467 #ifndef _POSIX_C_SOURCE
3468 make an error
3469 #endif
3470   ;
3471   return 0;
3472 }
3473 _ACEOF
3474 rm -f conftest.$ac_objext
3475 if { (eval echo "$as_me:3475: \"$ac_compile\"") >&5
3476   (eval $ac_compile) 2>&5
3477   ac_status=$?
3478   echo "$as_me:3478: \$? = $ac_status" >&5
3479   (exit $ac_status); } &&
3480          { ac_try='test -s conftest.$ac_objext'
3481   { (eval echo "$as_me:3481: \"$ac_try\"") >&5
3482   (eval $ac_try) 2>&5
3483   ac_status=$?
3484   echo "$as_me:3484: \$? = $ac_status" >&5
3485   (exit $ac_status); }; }; then
3486   cf_cv_posix_c_source=no
3487 else
3488   echo "$as_me: failed program was:" >&5
3489 cat conftest.$ac_ext >&5
3490 cf_want_posix_source=no
3491          case .$cf_POSIX_C_SOURCE in
3492          (.[12]??*)
3493                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
3494                 ;;
3495          (.2)
3496                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
3497                 cf_want_posix_source=yes
3498                 ;;
3499          (.*)
3500                 cf_want_posix_source=yes
3501                 ;;
3502          esac
3503          if test "$cf_want_posix_source" = yes ; then
3504                 cat >conftest.$ac_ext <<_ACEOF
3505 #line 3505 "configure"
3506 #include "confdefs.h"
3507 #include <sys/types.h>
3508 int
3509 main ()
3510 {
3511
3512 #ifdef _POSIX_SOURCE
3513 make an error
3514 #endif
3515   ;
3516   return 0;
3517 }
3518 _ACEOF
3519 rm -f conftest.$ac_objext
3520 if { (eval echo "$as_me:3520: \"$ac_compile\"") >&5
3521   (eval $ac_compile) 2>&5
3522   ac_status=$?
3523   echo "$as_me:3523: \$? = $ac_status" >&5
3524   (exit $ac_status); } &&
3525          { ac_try='test -s conftest.$ac_objext'
3526   { (eval echo "$as_me:3526: \"$ac_try\"") >&5
3527   (eval $ac_try) 2>&5
3528   ac_status=$?
3529   echo "$as_me:3529: \$? = $ac_status" >&5
3530   (exit $ac_status); }; }; then
3531   :
3532 else
3533   echo "$as_me: failed program was:" >&5
3534 cat conftest.$ac_ext >&5
3535 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
3536 fi
3537 rm -f conftest.$ac_objext conftest.$ac_ext
3538          fi
3539
3540 echo "${as_me:-configure}:3540: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
3541
3542          CFLAGS="$cf_trim_CFLAGS"
3543          CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
3544
3545 echo "${as_me:-configure}:3545: testing if the second compile does not leave our definition intact error ..." 1>&5
3546
3547          cat >conftest.$ac_ext <<_ACEOF
3548 #line 3548 "configure"
3549 #include "confdefs.h"
3550 #include <sys/types.h>
3551 int
3552 main ()
3553 {
3554
3555 #ifndef _POSIX_C_SOURCE
3556 make an error
3557 #endif
3558   ;
3559   return 0;
3560 }
3561 _ACEOF
3562 rm -f conftest.$ac_objext
3563 if { (eval echo "$as_me:3563: \"$ac_compile\"") >&5
3564   (eval $ac_compile) 2>&5
3565   ac_status=$?
3566   echo "$as_me:3566: \$? = $ac_status" >&5
3567   (exit $ac_status); } &&
3568          { ac_try='test -s conftest.$ac_objext'
3569   { (eval echo "$as_me:3569: \"$ac_try\"") >&5
3570   (eval $ac_try) 2>&5
3571   ac_status=$?
3572   echo "$as_me:3572: \$? = $ac_status" >&5
3573   (exit $ac_status); }; }; then
3574   :
3575 else
3576   echo "$as_me: failed program was:" >&5
3577 cat conftest.$ac_ext >&5
3578 cf_cv_posix_c_source=no
3579 fi
3580 rm -f conftest.$ac_objext conftest.$ac_ext
3581          CFLAGS="$cf_save_CFLAGS"
3582          CPPFLAGS="$cf_save_CPPFLAGS"
3583
3584 fi
3585 rm -f conftest.$ac_objext conftest.$ac_ext
3586
3587 fi
3588 echo "$as_me:3588: result: $cf_cv_posix_c_source" >&5
3589 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
3590
3591 if test "$cf_cv_posix_c_source" != no ; then
3592         CFLAGS="$cf_trim_CFLAGS"
3593         CPPFLAGS="$cf_trim_CPPFLAGS"
3594
3595 cf_fix_cppflags=no
3596 cf_new_cflags=
3597 cf_new_cppflags=
3598 cf_new_extra_cppflags=
3599
3600 for cf_add_cflags in $cf_cv_posix_c_source
3601 do
3602 case $cf_fix_cppflags in
3603 (no)
3604         case $cf_add_cflags in
3605         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
3606                 case $cf_add_cflags in
3607                 (-D*)
3608                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3609
3610                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3611                                 && test -z "${cf_tst_cflags}" \
3612                                 && cf_fix_cppflags=yes
3613
3614                         if test $cf_fix_cppflags = yes ; then
3615                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3616                                 continue
3617                         elif test "${cf_tst_cflags}" = "\"'" ; then
3618                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3619                                 continue
3620                         fi
3621                         ;;
3622                 esac
3623                 case "$CPPFLAGS" in
3624                 (*$cf_add_cflags)
3625                         ;;
3626                 (*)
3627                         case $cf_add_cflags in
3628                         (-D*)
3629                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3630
3631 CPPFLAGS=`echo "$CPPFLAGS" | \
3632         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3633                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3634
3635                                 ;;
3636                         esac
3637                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3638                         ;;
3639                 esac
3640                 ;;
3641         (*)
3642                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
3643                 ;;
3644         esac
3645         ;;
3646 (yes)
3647         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3648
3649         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3650
3651         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3652                 && test -z "${cf_tst_cflags}" \
3653                 && cf_fix_cppflags=no
3654         ;;
3655 esac
3656 done
3657
3658 if test -n "$cf_new_cflags" ; then
3659
3660         CFLAGS="$CFLAGS $cf_new_cflags"
3661 fi
3662
3663 if test -n "$cf_new_cppflags" ; then
3664
3665         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
3666 fi
3667
3668 if test -n "$cf_new_extra_cppflags" ; then
3669
3670         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
3671 fi
3672
3673 fi
3674
3675         ;;
3676 esac
3677
3678 if test -n "$cf_xopen_source" ; then
3679
3680 cf_fix_cppflags=no
3681 cf_new_cflags=
3682 cf_new_cppflags=
3683 cf_new_extra_cppflags=
3684
3685 for cf_add_cflags in $cf_xopen_source
3686 do
3687 case $cf_fix_cppflags in
3688 (no)
3689         case $cf_add_cflags in
3690         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
3691                 case $cf_add_cflags in
3692                 (-D*)
3693                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3694
3695                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3696                                 && test -z "${cf_tst_cflags}" \
3697                                 && cf_fix_cppflags=yes
3698
3699                         if test $cf_fix_cppflags = yes ; then
3700                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3701                                 continue
3702                         elif test "${cf_tst_cflags}" = "\"'" ; then
3703                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3704                                 continue
3705                         fi
3706                         ;;
3707                 esac
3708                 case "$CPPFLAGS" in
3709                 (*$cf_add_cflags)
3710                         ;;
3711                 (*)
3712                         case $cf_add_cflags in
3713                         (-D*)
3714                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3715
3716 CPPFLAGS=`echo "$CPPFLAGS" | \
3717         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3718                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3719
3720                                 ;;
3721                         esac
3722                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3723                         ;;
3724                 esac
3725                 ;;
3726         (*)
3727                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
3728                 ;;
3729         esac
3730         ;;
3731 (yes)
3732         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3733
3734         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3735
3736         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3737                 && test -z "${cf_tst_cflags}" \
3738                 && cf_fix_cppflags=no
3739         ;;
3740 esac
3741 done
3742
3743 if test -n "$cf_new_cflags" ; then
3744         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
3745
3746 echo "${as_me:-configure}:3746: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
3747
3748         CFLAGS="$CFLAGS $cf_new_cflags"
3749 fi
3750
3751 if test -n "$cf_new_cppflags" ; then
3752         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
3753
3754 echo "${as_me:-configure}:3754: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
3755
3756         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
3757 fi
3758
3759 if test -n "$cf_new_extra_cppflags" ; then
3760         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
3761
3762 echo "${as_me:-configure}:3762: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
3763
3764         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
3765 fi
3766
3767 fi
3768
3769 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
3770         echo "$as_me:3770: checking if _XOPEN_SOURCE really is set" >&5
3771 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
3772         cat >conftest.$ac_ext <<_ACEOF
3773 #line 3773 "configure"
3774 #include "confdefs.h"
3775 #include <stdlib.h>
3776 int
3777 main ()
3778 {
3779
3780 #ifndef _XOPEN_SOURCE
3781 make an error
3782 #endif
3783   ;
3784   return 0;
3785 }
3786 _ACEOF
3787 rm -f conftest.$ac_objext
3788 if { (eval echo "$as_me:3788: \"$ac_compile\"") >&5
3789   (eval $ac_compile) 2>&5
3790   ac_status=$?
3791   echo "$as_me:3791: \$? = $ac_status" >&5
3792   (exit $ac_status); } &&
3793          { ac_try='test -s conftest.$ac_objext'
3794   { (eval echo "$as_me:3794: \"$ac_try\"") >&5
3795   (eval $ac_try) 2>&5
3796   ac_status=$?
3797   echo "$as_me:3797: \$? = $ac_status" >&5
3798   (exit $ac_status); }; }; then
3799   cf_XOPEN_SOURCE_set=yes
3800 else
3801   echo "$as_me: failed program was:" >&5
3802 cat conftest.$ac_ext >&5
3803 cf_XOPEN_SOURCE_set=no
3804 fi
3805 rm -f conftest.$ac_objext conftest.$ac_ext
3806         echo "$as_me:3806: result: $cf_XOPEN_SOURCE_set" >&5
3807 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
3808         if test $cf_XOPEN_SOURCE_set = yes
3809         then
3810                 cat >conftest.$ac_ext <<_ACEOF
3811 #line 3811 "configure"
3812 #include "confdefs.h"
3813 #include <stdlib.h>
3814 int
3815 main ()
3816 {
3817
3818 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
3819 make an error
3820 #endif
3821   ;
3822   return 0;
3823 }
3824 _ACEOF
3825 rm -f conftest.$ac_objext
3826 if { (eval echo "$as_me:3826: \"$ac_compile\"") >&5
3827   (eval $ac_compile) 2>&5
3828   ac_status=$?
3829   echo "$as_me:3829: \$? = $ac_status" >&5
3830   (exit $ac_status); } &&
3831          { ac_try='test -s conftest.$ac_objext'
3832   { (eval echo "$as_me:3832: \"$ac_try\"") >&5
3833   (eval $ac_try) 2>&5
3834   ac_status=$?
3835   echo "$as_me:3835: \$? = $ac_status" >&5
3836   (exit $ac_status); }; }; then
3837   cf_XOPEN_SOURCE_set_ok=yes
3838 else
3839   echo "$as_me: failed program was:" >&5
3840 cat conftest.$ac_ext >&5
3841 cf_XOPEN_SOURCE_set_ok=no
3842 fi
3843 rm -f conftest.$ac_objext conftest.$ac_ext
3844                 if test $cf_XOPEN_SOURCE_set_ok = no
3845                 then
3846                         { echo "$as_me:3846: WARNING: _XOPEN_SOURCE is lower than requested" >&5
3847 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
3848                 fi
3849         else
3850
3851 echo "$as_me:3851: checking if we should define _XOPEN_SOURCE" >&5
3852 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
3853 if test "${cf_cv_xopen_source+set}" = set; then
3854   echo $ECHO_N "(cached) $ECHO_C" >&6
3855 else
3856
3857         cat >conftest.$ac_ext <<_ACEOF
3858 #line 3858 "configure"
3859 #include "confdefs.h"
3860
3861 #include <stdlib.h>
3862 #include <string.h>
3863 #include <sys/types.h>
3864
3865 int
3866 main ()
3867 {
3868
3869 #ifndef _XOPEN_SOURCE
3870 make an error
3871 #endif
3872   ;
3873   return 0;
3874 }
3875 _ACEOF
3876 rm -f conftest.$ac_objext
3877 if { (eval echo "$as_me:3877: \"$ac_compile\"") >&5
3878   (eval $ac_compile) 2>&5
3879   ac_status=$?
3880   echo "$as_me:3880: \$? = $ac_status" >&5
3881   (exit $ac_status); } &&
3882          { ac_try='test -s conftest.$ac_objext'
3883   { (eval echo "$as_me:3883: \"$ac_try\"") >&5
3884   (eval $ac_try) 2>&5
3885   ac_status=$?
3886   echo "$as_me:3886: \$? = $ac_status" >&5
3887   (exit $ac_status); }; }; then
3888   cf_cv_xopen_source=no
3889 else
3890   echo "$as_me: failed program was:" >&5
3891 cat conftest.$ac_ext >&5
3892 cf_save="$CPPFLAGS"
3893          CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
3894          cat >conftest.$ac_ext <<_ACEOF
3895 #line 3895 "configure"
3896 #include "confdefs.h"
3897
3898 #include <stdlib.h>
3899 #include <string.h>
3900 #include <sys/types.h>
3901
3902 int
3903 main ()
3904 {
3905
3906 #ifdef _XOPEN_SOURCE
3907 make an error
3908 #endif
3909   ;
3910   return 0;
3911 }
3912 _ACEOF
3913 rm -f conftest.$ac_objext
3914 if { (eval echo "$as_me:3914: \"$ac_compile\"") >&5
3915   (eval $ac_compile) 2>&5
3916   ac_status=$?
3917   echo "$as_me:3917: \$? = $ac_status" >&5
3918   (exit $ac_status); } &&
3919          { ac_try='test -s conftest.$ac_objext'
3920   { (eval echo "$as_me:3920: \"$ac_try\"") >&5
3921   (eval $ac_try) 2>&5
3922   ac_status=$?
3923   echo "$as_me:3923: \$? = $ac_status" >&5
3924   (exit $ac_status); }; }; then
3925   cf_cv_xopen_source=no
3926 else
3927   echo "$as_me: failed program was:" >&5
3928 cat conftest.$ac_ext >&5
3929 cf_cv_xopen_source=$cf_XOPEN_SOURCE
3930 fi
3931 rm -f conftest.$ac_objext conftest.$ac_ext
3932         CPPFLAGS="$cf_save"
3933
3934 fi
3935 rm -f conftest.$ac_objext conftest.$ac_ext
3936
3937 fi
3938 echo "$as_me:3938: result: $cf_cv_xopen_source" >&5
3939 echo "${ECHO_T}$cf_cv_xopen_source" >&6
3940
3941 if test "$cf_cv_xopen_source" != no ; then
3942
3943 CFLAGS=`echo "$CFLAGS" | \
3944         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
3945                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
3946
3947 CPPFLAGS=`echo "$CPPFLAGS" | \
3948         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
3949                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
3950
3951         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
3952
3953 cf_fix_cppflags=no
3954 cf_new_cflags=
3955 cf_new_cppflags=
3956 cf_new_extra_cppflags=
3957
3958 for cf_add_cflags in $cf_temp_xopen_source
3959 do
3960 case $cf_fix_cppflags in
3961 (no)
3962         case $cf_add_cflags in
3963         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
3964                 case $cf_add_cflags in
3965                 (-D*)
3966                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3967
3968                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3969                                 && test -z "${cf_tst_cflags}" \
3970                                 && cf_fix_cppflags=yes
3971
3972                         if test $cf_fix_cppflags = yes ; then
3973                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3974                                 continue
3975                         elif test "${cf_tst_cflags}" = "\"'" ; then
3976                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3977                                 continue
3978                         fi
3979                         ;;
3980                 esac
3981                 case "$CPPFLAGS" in
3982                 (*$cf_add_cflags)
3983                         ;;
3984                 (*)
3985                         case $cf_add_cflags in
3986                         (-D*)
3987                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3988
3989 CPPFLAGS=`echo "$CPPFLAGS" | \
3990         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3991                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3992
3993                                 ;;
3994                         esac
3995                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3996                         ;;
3997                 esac
3998                 ;;
3999         (*)
4000                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
4001                 ;;
4002         esac
4003         ;;
4004 (yes)
4005         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
4006
4007         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4008
4009         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4010                 && test -z "${cf_tst_cflags}" \
4011                 && cf_fix_cppflags=no
4012         ;;
4013 esac
4014 done
4015
4016 if test -n "$cf_new_cflags" ; then
4017
4018         CFLAGS="$CFLAGS $cf_new_cflags"
4019 fi
4020
4021 if test -n "$cf_new_cppflags" ; then
4022
4023         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
4024 fi
4025
4026 if test -n "$cf_new_extra_cppflags" ; then
4027
4028         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
4029 fi
4030
4031 fi
4032
4033         fi
4034 fi
4035
4036 echo "$as_me:4036: checking for signal global datatype" >&5
4037 echo $ECHO_N "checking for signal global datatype... $ECHO_C" >&6
4038 if test "${cf_cv_sig_atomic_t+set}" = set; then
4039   echo $ECHO_N "(cached) $ECHO_C" >&6
4040 else
4041
4042         for cf_type in \
4043                 "volatile sig_atomic_t" \
4044                 "sig_atomic_t" \
4045                 "int"
4046         do
4047         cat >conftest.$ac_ext <<_ACEOF
4048 #line 4048 "configure"
4049 #include "confdefs.h"
4050
4051 #include <sys/types.h>
4052 #include <signal.h>
4053 #include <stdio.h>
4054
4055 extern $cf_type x;
4056 $cf_type x;
4057 static void handler(int sig)
4058 {
4059         x = 5;
4060 }
4061 int
4062 main ()
4063 {
4064 signal(SIGINT, handler);
4065                  x = 1
4066   ;
4067   return 0;
4068 }
4069 _ACEOF
4070 rm -f conftest.$ac_objext
4071 if { (eval echo "$as_me:4071: \"$ac_compile\"") >&5
4072   (eval $ac_compile) 2>&5
4073   ac_status=$?
4074   echo "$as_me:4074: \$? = $ac_status" >&5
4075   (exit $ac_status); } &&
4076          { ac_try='test -s conftest.$ac_objext'
4077   { (eval echo "$as_me:4077: \"$ac_try\"") >&5
4078   (eval $ac_try) 2>&5
4079   ac_status=$?
4080   echo "$as_me:4080: \$? = $ac_status" >&5
4081   (exit $ac_status); }; }; then
4082   cf_cv_sig_atomic_t=$cf_type
4083 else
4084   echo "$as_me: failed program was:" >&5
4085 cat conftest.$ac_ext >&5
4086 cf_cv_sig_atomic_t=no
4087 fi
4088 rm -f conftest.$ac_objext conftest.$ac_ext
4089                 test "$cf_cv_sig_atomic_t" != no && break
4090         done
4091
4092 fi
4093
4094 echo "$as_me:4094: result: $cf_cv_sig_atomic_t" >&5
4095 echo "${ECHO_T}$cf_cv_sig_atomic_t" >&6
4096 test "$cf_cv_sig_atomic_t" != no &&
4097 cat >>confdefs.h <<EOF
4098 #define SIG_ATOMIC_T $cf_cv_sig_atomic_t
4099 EOF
4100
4101 # Work around breakage on OS X
4102
4103 echo "$as_me:4103: checking if SIGWINCH is defined" >&5
4104 echo $ECHO_N "checking if SIGWINCH is defined... $ECHO_C" >&6
4105 if test "${cf_cv_define_sigwinch+set}" = set; then
4106   echo $ECHO_N "(cached) $ECHO_C" >&6
4107 else
4108
4109         cat >conftest.$ac_ext <<_ACEOF
4110 #line 4110 "configure"
4111 #include "confdefs.h"
4112
4113 #include <sys/types.h>
4114 #include <sys/signal.h>
4115
4116 int
4117 main ()
4118 {
4119 int x = SIGWINCH
4120   ;
4121   return 0;
4122 }
4123 _ACEOF
4124 rm -f conftest.$ac_objext
4125 if { (eval echo "$as_me:4125: \"$ac_compile\"") >&5
4126   (eval $ac_compile) 2>&5
4127   ac_status=$?
4128   echo "$as_me:4128: \$? = $ac_status" >&5
4129   (exit $ac_status); } &&
4130          { ac_try='test -s conftest.$ac_objext'
4131   { (eval echo "$as_me:4131: \"$ac_try\"") >&5
4132   (eval $ac_try) 2>&5
4133   ac_status=$?
4134   echo "$as_me:4134: \$? = $ac_status" >&5
4135   (exit $ac_status); }; }; then
4136   cf_cv_define_sigwinch=yes
4137 else
4138   echo "$as_me: failed program was:" >&5
4139 cat conftest.$ac_ext >&5
4140 cat >conftest.$ac_ext <<_ACEOF
4141 #line 4141 "configure"
4142 #include "confdefs.h"
4143
4144 #undef _XOPEN_SOURCE
4145 #undef _POSIX_SOURCE
4146 #undef _POSIX_C_SOURCE
4147 #include <sys/types.h>
4148 #include <sys/signal.h>
4149
4150 int
4151 main ()
4152 {
4153 int x = SIGWINCH
4154   ;
4155   return 0;
4156 }
4157 _ACEOF
4158 rm -f conftest.$ac_objext
4159 if { (eval echo "$as_me:4159: \"$ac_compile\"") >&5
4160   (eval $ac_compile) 2>&5
4161   ac_status=$?
4162   echo "$as_me:4162: \$? = $ac_status" >&5
4163   (exit $ac_status); } &&
4164          { ac_try='test -s conftest.$ac_objext'
4165   { (eval echo "$as_me:4165: \"$ac_try\"") >&5
4166   (eval $ac_try) 2>&5
4167   ac_status=$?
4168   echo "$as_me:4168: \$? = $ac_status" >&5
4169   (exit $ac_status); }; }; then
4170   cf_cv_define_sigwinch=maybe
4171 else
4172   echo "$as_me: failed program was:" >&5
4173 cat conftest.$ac_ext >&5
4174 cf_cv_define_sigwinch=no
4175 fi
4176 rm -f conftest.$ac_objext conftest.$ac_ext
4177
4178 fi
4179 rm -f conftest.$ac_objext conftest.$ac_ext
4180
4181 fi
4182 echo "$as_me:4182: result: $cf_cv_define_sigwinch" >&5
4183 echo "${ECHO_T}$cf_cv_define_sigwinch" >&6
4184
4185 if test "$cf_cv_define_sigwinch" = maybe ; then
4186 echo "$as_me:4186: checking for actual SIGWINCH definition" >&5
4187 echo $ECHO_N "checking for actual SIGWINCH definition... $ECHO_C" >&6
4188 if test "${cf_cv_fixup_sigwinch+set}" = set; then
4189   echo $ECHO_N "(cached) $ECHO_C" >&6
4190 else
4191
4192 cf_cv_fixup_sigwinch=unknown
4193 cf_sigwinch=32
4194 while test $cf_sigwinch != 1
4195 do
4196         cat >conftest.$ac_ext <<_ACEOF
4197 #line 4197 "configure"
4198 #include "confdefs.h"
4199
4200 #undef _XOPEN_SOURCE
4201 #undef _POSIX_SOURCE
4202 #undef _POSIX_C_SOURCE
4203 #include <sys/types.h>
4204 #include <sys/signal.h>
4205
4206 int
4207 main ()
4208 {
4209
4210 #if SIGWINCH != $cf_sigwinch
4211 make an error
4212 #endif
4213 int x = SIGWINCH
4214   ;
4215   return 0;
4216 }
4217 _ACEOF
4218 rm -f conftest.$ac_objext
4219 if { (eval echo "$as_me:4219: \"$ac_compile\"") >&5
4220   (eval $ac_compile) 2>&5
4221   ac_status=$?
4222   echo "$as_me:4222: \$? = $ac_status" >&5
4223   (exit $ac_status); } &&
4224          { ac_try='test -s conftest.$ac_objext'
4225   { (eval echo "$as_me:4225: \"$ac_try\"") >&5
4226   (eval $ac_try) 2>&5
4227   ac_status=$?
4228   echo "$as_me:4228: \$? = $ac_status" >&5
4229   (exit $ac_status); }; }; then
4230   cf_cv_fixup_sigwinch=$cf_sigwinch
4231          break
4232 else
4233   echo "$as_me: failed program was:" >&5
4234 cat conftest.$ac_ext >&5
4235 fi
4236 rm -f conftest.$ac_objext conftest.$ac_ext
4237
4238 cf_sigwinch=`expr $cf_sigwinch - 1`
4239 done
4240
4241 fi
4242 echo "$as_me:4242: result: $cf_cv_fixup_sigwinch" >&5
4243 echo "${ECHO_T}$cf_cv_fixup_sigwinch" >&6
4244
4245         if test "$cf_cv_fixup_sigwinch" != unknown ; then
4246                 CPPFLAGS="$CPPFLAGS -DSIGWINCH=$cf_cv_fixup_sigwinch"
4247         fi
4248 fi
4249
4250 # Checks for CODESET support.
4251
4252 echo "$as_me:4252: checking for nl_langinfo and CODESET" >&5
4253 echo $ECHO_N "checking for nl_langinfo and CODESET... $ECHO_C" >&6
4254 if test "${am_cv_langinfo_codeset+set}" = set; then
4255   echo $ECHO_N "(cached) $ECHO_C" >&6
4256 else
4257   cat >conftest.$ac_ext <<_ACEOF
4258 #line 4258 "configure"
4259 #include "confdefs.h"
4260 #include <langinfo.h>
4261 int
4262 main ()
4263 {
4264 char* cs = nl_langinfo(CODESET);
4265   ;
4266   return 0;
4267 }
4268 _ACEOF
4269 rm -f conftest.$ac_objext conftest$ac_exeext
4270 if { (eval echo "$as_me:4270: \"$ac_link\"") >&5
4271   (eval $ac_link) 2>&5
4272   ac_status=$?
4273   echo "$as_me:4273: \$? = $ac_status" >&5
4274   (exit $ac_status); } &&
4275          { ac_try='test -s conftest$ac_exeext'
4276   { (eval echo "$as_me:4276: \"$ac_try\"") >&5
4277   (eval $ac_try) 2>&5
4278   ac_status=$?
4279   echo "$as_me:4279: \$? = $ac_status" >&5
4280   (exit $ac_status); }; }; then
4281   am_cv_langinfo_codeset=yes
4282 else
4283   echo "$as_me: failed program was:" >&5
4284 cat conftest.$ac_ext >&5
4285 am_cv_langinfo_codeset=no
4286 fi
4287 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4288
4289 fi
4290 echo "$as_me:4290: result: $am_cv_langinfo_codeset" >&5
4291 echo "${ECHO_T}$am_cv_langinfo_codeset" >&6
4292         if test $am_cv_langinfo_codeset = yes; then
4293
4294 cat >>confdefs.h <<\EOF
4295 #define HAVE_LANGINFO_CODESET 1
4296 EOF
4297
4298         fi
4299
4300 echo "$as_me:4300: checking if you want to use pkg-config" >&5
4301 echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6
4302
4303 # Check whether --with-pkg-config or --without-pkg-config was given.
4304 if test "${with_pkg_config+set}" = set; then
4305   withval="$with_pkg_config"
4306   cf_pkg_config=$withval
4307 else
4308   cf_pkg_config=yes
4309 fi;
4310 echo "$as_me:4310: result: $cf_pkg_config" >&5
4311 echo "${ECHO_T}$cf_pkg_config" >&6
4312
4313 case $cf_pkg_config in
4314 (no)
4315         PKG_CONFIG=none
4316         ;;
4317 (yes)
4318
4319 if test -n "$ac_tool_prefix"; then
4320   # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
4321 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
4322 echo "$as_me:4322: checking for $ac_word" >&5
4323 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4324 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
4325   echo $ECHO_N "(cached) $ECHO_C" >&6
4326 else
4327   case $PKG_CONFIG in
4328   [\\/]* | ?:[\\/]*)
4329   ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
4330   ;;
4331   *)
4332   ac_save_IFS=$IFS; IFS=$ac_path_separator
4333 ac_dummy="$PATH"
4334 for ac_dir in $ac_dummy; do
4335   IFS=$ac_save_IFS
4336   test -z "$ac_dir" && ac_dir=.
4337   if $as_executable_p "$ac_dir/$ac_word"; then
4338    ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
4339    echo "$as_me:4339: found $ac_dir/$ac_word" >&5
4340    break
4341 fi
4342 done
4343
4344   ;;
4345 esac
4346 fi
4347 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
4348
4349 if test -n "$PKG_CONFIG"; then
4350   echo "$as_me:4350: result: $PKG_CONFIG" >&5
4351 echo "${ECHO_T}$PKG_CONFIG" >&6
4352 else
4353   echo "$as_me:4353: result: no" >&5
4354 echo "${ECHO_T}no" >&6
4355 fi
4356
4357 fi
4358 if test -z "$ac_cv_path_PKG_CONFIG"; then
4359   ac_pt_PKG_CONFIG=$PKG_CONFIG
4360   # Extract the first word of "pkg-config", so it can be a program name with args.
4361 set dummy pkg-config; ac_word=$2
4362 echo "$as_me:4362: checking for $ac_word" >&5
4363 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4364 if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
4365   echo $ECHO_N "(cached) $ECHO_C" >&6
4366 else
4367   case $ac_pt_PKG_CONFIG in
4368   [\\/]* | ?:[\\/]*)
4369   ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
4370   ;;
4371   *)
4372   ac_save_IFS=$IFS; IFS=$ac_path_separator
4373 ac_dummy="$PATH"
4374 for ac_dir in $ac_dummy; do
4375   IFS=$ac_save_IFS
4376   test -z "$ac_dir" && ac_dir=.
4377   if $as_executable_p "$ac_dir/$ac_word"; then
4378    ac_cv_path_ac_pt_PKG_CONFIG="$ac_dir/$ac_word"
4379    echo "$as_me:4379: found $ac_dir/$ac_word" >&5
4380    break
4381 fi
4382 done
4383
4384   test -z "$ac_cv_path_ac_pt_PKG_CONFIG" && ac_cv_path_ac_pt_PKG_CONFIG="none"
4385   ;;
4386 esac
4387 fi
4388 ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
4389
4390 if test -n "$ac_pt_PKG_CONFIG"; then
4391   echo "$as_me:4391: result: $ac_pt_PKG_CONFIG" >&5
4392 echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
4393 else
4394   echo "$as_me:4394: result: no" >&5
4395 echo "${ECHO_T}no" >&6
4396 fi
4397
4398   PKG_CONFIG=$ac_pt_PKG_CONFIG
4399 else
4400   PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
4401 fi
4402
4403         ;;
4404 (*)
4405         PKG_CONFIG=$withval
4406         ;;
4407 esac
4408
4409 test -z "$PKG_CONFIG" && PKG_CONFIG=none
4410 if test "$PKG_CONFIG" != none ; then
4411
4412 if test "x$prefix" != xNONE; then
4413         cf_path_syntax="$prefix"
4414 else
4415         cf_path_syntax="$ac_default_prefix"
4416 fi
4417
4418 case ".$PKG_CONFIG" in
4419 (.\$\(*\)*|.\'*\'*)
4420         ;;
4421 (..|./*|.\\*)
4422         ;;
4423 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
4424         ;;
4425 (.\${*prefix}*|.\${*dir}*)
4426         eval PKG_CONFIG="$PKG_CONFIG"
4427         case ".$PKG_CONFIG" in
4428         (.NONE/*)
4429                 PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
4430                 ;;
4431         esac
4432         ;;
4433 (.no|.NONE/*)
4434         PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
4435         ;;
4436 (*)
4437         { { echo "$as_me:4437: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
4438 echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
4439    { (exit 1); exit 1; }; }
4440         ;;
4441 esac
4442
4443 elif test "x$cf_pkg_config" != xno ; then
4444         { echo "$as_me:4444: WARNING: pkg-config is not installed" >&5
4445 echo "$as_me: WARNING: pkg-config is not installed" >&2;}
4446 fi
4447
4448 echo "$as_me:4448: checking if you want to see long compiling messages" >&5
4449 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
4450
4451 # Check whether --enable-echo or --disable-echo was given.
4452 if test "${enable_echo+set}" = set; then
4453   enableval="$enable_echo"
4454   test "$enableval" != no && enableval=yes
4455         if test "$enableval" != "yes" ; then
4456
4457         ECHO_LT='--silent'
4458         ECHO_LD='@echo linking $@;'
4459         RULE_CC='@echo compiling $<'
4460         SHOW_CC='@echo compiling $@'
4461         ECHO_CC='@'
4462
4463         else
4464
4465         ECHO_LT=''
4466         ECHO_LD=''
4467         RULE_CC=''
4468         SHOW_CC=''
4469         ECHO_CC=''
4470
4471         fi
4472 else
4473   enableval=yes
4474
4475         ECHO_LT=''
4476         ECHO_LD=''
4477         RULE_CC=''
4478         SHOW_CC=''
4479         ECHO_CC=''
4480
4481 fi;
4482 echo "$as_me:4482: result: $enableval" >&5
4483 echo "${ECHO_T}$enableval" >&6
4484
4485 echo "$as_me:4485: checking for ncurses wrap-prefix" >&5
4486 echo $ECHO_N "checking for ncurses wrap-prefix... $ECHO_C" >&6
4487
4488 # Check whether --with-ncurses-wrap-prefix or --without-ncurses-wrap-prefix was given.
4489 if test "${with_ncurses_wrap_prefix+set}" = set; then
4490   withval="$with_ncurses_wrap_prefix"
4491   NCURSES_WRAP_PREFIX=$withval
4492 else
4493   NCURSES_WRAP_PREFIX=_nc_
4494 fi;
4495 echo "$as_me:4495: result: $NCURSES_WRAP_PREFIX" >&5
4496 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
4497
4498 echo "$as_me:4498: checking if you want to check for wide-character functions" >&5
4499 echo $ECHO_N "checking if you want to check for wide-character functions... $ECHO_C" >&6
4500
4501 # Check whether --enable-widec or --disable-widec was given.
4502 if test "${enable_widec+set}" = set; then
4503   enableval="$enable_widec"
4504   test "$enableval" != no && enableval=yes
4505         if test "$enableval" != "yes" ; then
4506     cf_enable_widec=no
4507         else
4508                 cf_enable_widec=yes
4509         fi
4510 else
4511   enableval=yes
4512         cf_enable_widec=yes
4513
4514 fi;
4515 echo "$as_me:4515: result: $cf_enable_widec" >&5
4516 echo "${ECHO_T}$cf_enable_widec" >&6
4517
4518 echo "$as_me:4518: checking for specific curses-directory" >&5
4519 echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
4520
4521 # Check whether --with-curses-dir or --without-curses-dir was given.
4522 if test "${with_curses_dir+set}" = set; then
4523   withval="$with_curses_dir"
4524   cf_cv_curses_dir=$withval
4525 else
4526   cf_cv_curses_dir=no
4527 fi;
4528 echo "$as_me:4528: result: $cf_cv_curses_dir" >&5
4529 echo "${ECHO_T}$cf_cv_curses_dir" >&6
4530
4531 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
4532 then
4533
4534 if test "x$prefix" != xNONE; then
4535         cf_path_syntax="$prefix"
4536 else
4537         cf_path_syntax="$ac_default_prefix"
4538 fi
4539
4540 case ".$withval" in
4541 (.\$\(*\)*|.\'*\'*)
4542         ;;
4543 (..|./*|.\\*)
4544         ;;
4545 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
4546         ;;
4547 (.\${*prefix}*|.\${*dir}*)
4548         eval withval="$withval"
4549         case ".$withval" in
4550         (.NONE/*)
4551                 withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
4552                 ;;
4553         esac
4554         ;;
4555 (.no|.NONE/*)
4556         withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
4557         ;;
4558 (*)
4559         { { echo "$as_me:4559: error: expected a pathname, not \"$withval\"" >&5
4560 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
4561    { (exit 1); exit 1; }; }
4562         ;;
4563 esac
4564
4565         if test -d "$cf_cv_curses_dir"
4566         then
4567
4568 if test -n "$cf_cv_curses_dir/include" ; then
4569   for cf_add_incdir in $cf_cv_curses_dir/include
4570   do
4571         while test $cf_add_incdir != /usr/include
4572         do
4573           if test -d $cf_add_incdir
4574           then
4575                 cf_have_incdir=no
4576                 if test -n "$CFLAGS$CPPFLAGS" ; then
4577                   # a loop is needed to ensure we can add subdirs of existing dirs
4578                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
4579                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
4580                           cf_have_incdir=yes; break
4581                         fi
4582                   done
4583                 fi
4584
4585                 if test "$cf_have_incdir" = no ; then
4586                   if test "$cf_add_incdir" = /usr/local/include ; then
4587                         if test "$GCC" = yes
4588                         then
4589                           cf_save_CPPFLAGS=$CPPFLAGS
4590                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4591                           cat >conftest.$ac_ext <<_ACEOF
4592 #line 4592 "configure"
4593 #include "confdefs.h"
4594 #include <stdio.h>
4595 int
4596 main ()
4597 {
4598 printf("Hello")
4599   ;
4600   return 0;
4601 }
4602 _ACEOF
4603 rm -f conftest.$ac_objext
4604 if { (eval echo "$as_me:4604: \"$ac_compile\"") >&5
4605   (eval $ac_compile) 2>&5
4606   ac_status=$?
4607   echo "$as_me:4607: \$? = $ac_status" >&5
4608   (exit $ac_status); } &&
4609          { ac_try='test -s conftest.$ac_objext'
4610   { (eval echo "$as_me:4610: \"$ac_try\"") >&5
4611   (eval $ac_try) 2>&5
4612   ac_status=$?
4613   echo "$as_me:4613: \$? = $ac_status" >&5
4614   (exit $ac_status); }; }; then
4615   :
4616 else
4617   echo "$as_me: failed program was:" >&5
4618 cat conftest.$ac_ext >&5
4619 cf_have_incdir=yes
4620 fi
4621 rm -f conftest.$ac_objext conftest.$ac_ext
4622                           CPPFLAGS=$cf_save_CPPFLAGS
4623                         fi
4624                   fi
4625                 fi
4626
4627                 if test "$cf_have_incdir" = no ; then
4628                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
4629
4630 echo "${as_me:-configure}:4630: testing adding $cf_add_incdir to include-path ..." 1>&5
4631
4632                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
4633
4634                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
4635                   test "$cf_top_incdir" = "$cf_add_incdir" && break
4636                   cf_add_incdir="$cf_top_incdir"
4637                 else
4638                   break
4639                 fi
4640           else
4641                 break
4642           fi
4643         done
4644   done
4645 fi
4646
4647 if test -n "$cf_cv_curses_dir/lib" ; then
4648         for cf_add_libdir in $cf_cv_curses_dir/lib
4649         do
4650                 if test $cf_add_libdir = /usr/lib ; then
4651                         :
4652                 elif test -d $cf_add_libdir
4653                 then
4654                         cf_have_libdir=no
4655                         if test -n "$LDFLAGS$LIBS" ; then
4656                                 # a loop is needed to ensure we can add subdirs of existing dirs
4657                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
4658                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
4659                                                 cf_have_libdir=yes; break
4660                                         fi
4661                                 done
4662                         fi
4663                         if test "$cf_have_libdir" = no ; then
4664                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
4665
4666 echo "${as_me:-configure}:4666: testing adding $cf_add_libdir to library-path ..." 1>&5
4667
4668                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
4669                         fi
4670                 fi
4671         done
4672 fi
4673
4674         fi
4675 fi
4676
4677 cf_cv_screen=curses
4678
4679 echo "$as_me:4679: checking for specified curses library type" >&5
4680 echo $ECHO_N "checking for specified curses library type... $ECHO_C" >&6
4681
4682 # Check whether --with-screen or --without-screen was given.
4683 if test "${with_screen+set}" = set; then
4684   withval="$with_screen"
4685   cf_cv_screen=$withval
4686 else
4687
4688 # Check whether --with-ncursesw or --without-ncursesw was given.
4689 if test "${with_ncursesw+set}" = set; then
4690   withval="$with_ncursesw"
4691   cf_cv_screen=ncursesw
4692 else
4693
4694 # Check whether --with-ncurses or --without-ncurses was given.
4695 if test "${with_ncurses+set}" = set; then
4696   withval="$with_ncurses"
4697   cf_cv_screen=ncurses
4698 else
4699
4700 # Check whether --with-pdcurses or --without-pdcurses was given.
4701 if test "${with_pdcurses+set}" = set; then
4702   withval="$with_pdcurses"
4703   cf_cv_screen=pdcurses
4704 else
4705
4706 # Check whether --with-curses-colr or --without-curses-colr was given.
4707 if test "${with_curses_colr+set}" = set; then
4708   withval="$with_curses_colr"
4709   cf_cv_screen=curses_colr
4710 else
4711
4712 # Check whether --with-curses-5lib or --without-curses-5lib was given.
4713 if test "${with_curses_5lib+set}" = set; then
4714   withval="$with_curses_5lib"
4715   cf_cv_screen=curses_5lib
4716 fi;
4717 fi;
4718 fi;
4719 fi;
4720 fi;
4721 fi;
4722
4723 echo "$as_me:4723: result: $cf_cv_screen" >&5
4724 echo "${ECHO_T}$cf_cv_screen" >&6
4725
4726 case $cf_cv_screen in
4727 (curses|curses_*)
4728
4729 echo "$as_me:4729: checking for extra include directories" >&5
4730 echo $ECHO_N "checking for extra include directories... $ECHO_C" >&6
4731 if test "${cf_cv_curses_incdir+set}" = set; then
4732   echo $ECHO_N "(cached) $ECHO_C" >&6
4733 else
4734
4735 cf_cv_curses_incdir=no
4736 case $host_os in
4737 (hpux10.*)
4738         if test "x$cf_cv_screen" = "xcurses_colr"
4739         then
4740                 test -d /usr/include/curses_colr && \
4741                 cf_cv_curses_incdir="-I/usr/include/curses_colr"
4742         fi
4743         ;;
4744 (sunos3*|sunos4*)
4745         if test "x$cf_cv_screen" = "xcurses_5lib"
4746         then
4747                 test -d /usr/5lib && \
4748                 test -d /usr/5include && \
4749                 cf_cv_curses_incdir="-I/usr/5include"
4750         fi
4751         ;;
4752 esac
4753
4754 fi
4755 echo "$as_me:4755: result: $cf_cv_curses_incdir" >&5
4756 echo "${ECHO_T}$cf_cv_curses_incdir" >&6
4757 test "$cf_cv_curses_incdir" != no && CPPFLAGS="$CPPFLAGS $cf_cv_curses_incdir"
4758
4759 echo "$as_me:4759: checking if we have identified curses headers" >&5
4760 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
4761 if test "${cf_cv_ncurses_header+set}" = set; then
4762   echo $ECHO_N "(cached) $ECHO_C" >&6
4763 else
4764
4765 cf_cv_ncurses_header=none
4766 for cf_header in \
4767         ncurses.h  \
4768         curses.h  ncurses/ncurses.h ncurses/curses.h
4769 do
4770 cat >conftest.$ac_ext <<_ACEOF
4771 #line 4771 "configure"
4772 #include "confdefs.h"
4773 #include <${cf_header}>
4774 int
4775 main ()
4776 {
4777 initscr(); tgoto("?", 0,0)
4778   ;
4779   return 0;
4780 }
4781 _ACEOF
4782 rm -f conftest.$ac_objext
4783 if { (eval echo "$as_me:4783: \"$ac_compile\"") >&5
4784   (eval $ac_compile) 2>&5
4785   ac_status=$?
4786   echo "$as_me:4786: \$? = $ac_status" >&5
4787   (exit $ac_status); } &&
4788          { ac_try='test -s conftest.$ac_objext'
4789   { (eval echo "$as_me:4789: \"$ac_try\"") >&5
4790   (eval $ac_try) 2>&5
4791   ac_status=$?
4792   echo "$as_me:4792: \$? = $ac_status" >&5
4793   (exit $ac_status); }; }; then
4794   cf_cv_ncurses_header=$cf_header; break
4795 else
4796   echo "$as_me: failed program was:" >&5
4797 cat conftest.$ac_ext >&5
4798 fi
4799 rm -f conftest.$ac_objext conftest.$ac_ext
4800 done
4801
4802 fi
4803 echo "$as_me:4803: result: $cf_cv_ncurses_header" >&5
4804 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
4805
4806 if test "$cf_cv_ncurses_header" = none ; then
4807         { { echo "$as_me:4807: error: No curses header-files found" >&5
4808 echo "$as_me: error: No curses header-files found" >&2;}
4809    { (exit 1); exit 1; }; }
4810 fi
4811
4812 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
4813
4814 for ac_header in $cf_cv_ncurses_header
4815 do
4816 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
4817 echo "$as_me:4817: checking for $ac_header" >&5
4818 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
4819 if eval "test \"\${$as_ac_Header+set}\" = set"; then
4820   echo $ECHO_N "(cached) $ECHO_C" >&6
4821 else
4822   cat >conftest.$ac_ext <<_ACEOF
4823 #line 4823 "configure"
4824 #include "confdefs.h"
4825 #include <$ac_header>
4826 _ACEOF
4827 if { (eval echo "$as_me:4827: \"$ac_cpp conftest.$ac_ext\"") >&5
4828   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
4829   ac_status=$?
4830   egrep -v '^ *\+' conftest.er1 >conftest.err
4831   rm -f conftest.er1
4832   cat conftest.err >&5
4833   echo "$as_me:4833: \$? = $ac_status" >&5
4834   (exit $ac_status); } >/dev/null; then
4835   if test -s conftest.err; then
4836     ac_cpp_err=$ac_c_preproc_warn_flag
4837   else
4838     ac_cpp_err=
4839   fi
4840 else
4841   ac_cpp_err=yes
4842 fi
4843 if test -z "$ac_cpp_err"; then
4844   eval "$as_ac_Header=yes"
4845 else
4846   echo "$as_me: failed program was:" >&5
4847   cat conftest.$ac_ext >&5
4848   eval "$as_ac_Header=no"
4849 fi
4850 rm -f conftest.err conftest.$ac_ext
4851 fi
4852 echo "$as_me:4852: result: `eval echo '${'$as_ac_Header'}'`" >&5
4853 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
4854 if test `eval echo '${'$as_ac_Header'}'` = yes; then
4855   cat >>confdefs.h <<EOF
4856 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
4857 EOF
4858
4859 fi
4860 done
4861
4862 echo "$as_me:4862: checking for terminfo header" >&5
4863 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
4864 if test "${cf_cv_term_header+set}" = set; then
4865   echo $ECHO_N "(cached) $ECHO_C" >&6
4866 else
4867
4868 case ${cf_cv_ncurses_header} in
4869 (*/ncurses.h|*/ncursesw.h)
4870         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
4871         ;;
4872 (*)
4873         cf_term_header=term.h
4874         ;;
4875 esac
4876
4877 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
4878 do
4879 cat >conftest.$ac_ext <<_ACEOF
4880 #line 4880 "configure"
4881 #include "confdefs.h"
4882 #include <stdio.h>
4883 #include <${cf_cv_ncurses_header:-curses.h}>
4884 #include <$cf_test>
4885
4886 int
4887 main ()
4888 {
4889 int x = auto_left_margin
4890   ;
4891   return 0;
4892 }
4893 _ACEOF
4894 rm -f conftest.$ac_objext
4895 if { (eval echo "$as_me:4895: \"$ac_compile\"") >&5
4896   (eval $ac_compile) 2>&5
4897   ac_status=$?
4898   echo "$as_me:4898: \$? = $ac_status" >&5
4899   (exit $ac_status); } &&
4900          { ac_try='test -s conftest.$ac_objext'
4901   { (eval echo "$as_me:4901: \"$ac_try\"") >&5
4902   (eval $ac_try) 2>&5
4903   ac_status=$?
4904   echo "$as_me:4904: \$? = $ac_status" >&5
4905   (exit $ac_status); }; }; then
4906
4907         cf_cv_term_header="$cf_test"
4908 else
4909   echo "$as_me: failed program was:" >&5
4910 cat conftest.$ac_ext >&5
4911
4912         cf_cv_term_header=unknown
4913
4914 fi
4915 rm -f conftest.$ac_objext conftest.$ac_ext
4916         test "$cf_cv_term_header" != unknown && break
4917 done
4918
4919 fi
4920 echo "$as_me:4920: result: $cf_cv_term_header" >&5
4921 echo "${ECHO_T}$cf_cv_term_header" >&6
4922
4923 # Set definitions to allow ifdef'ing to accommodate subdirectories
4924
4925 case $cf_cv_term_header in
4926 (*term.h)
4927
4928 cat >>confdefs.h <<\EOF
4929 #define HAVE_TERM_H 1
4930 EOF
4931
4932         ;;
4933 esac
4934
4935 case $cf_cv_term_header in
4936 (ncurses/term.h)
4937
4938 cat >>confdefs.h <<\EOF
4939 #define HAVE_NCURSES_TERM_H 1
4940 EOF
4941
4942         ;;
4943 (ncursesw/term.h)
4944
4945 cat >>confdefs.h <<\EOF
4946 #define HAVE_NCURSESW_TERM_H 1
4947 EOF
4948
4949         ;;
4950 esac
4951
4952 echo "$as_me:4952: checking for ncurses version" >&5
4953 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
4954 if test "${cf_cv_ncurses_version+set}" = set; then
4955   echo $ECHO_N "(cached) $ECHO_C" >&6
4956 else
4957
4958         cf_cv_ncurses_version=no
4959         cf_tempfile=out$$
4960         rm -f $cf_tempfile
4961         if test "$cross_compiling" = yes; then
4962
4963         # This will not work if the preprocessor splits the line after the
4964         # Autoconf token.  The 'unproto' program does that.
4965         cat > conftest.$ac_ext <<EOF
4966 #include <${cf_cv_ncurses_header:-curses.h}>
4967 #undef Autoconf
4968 #ifdef NCURSES_VERSION
4969 Autoconf NCURSES_VERSION
4970 #else
4971 #ifdef __NCURSES_H
4972 Autoconf "old"
4973 #endif
4974 ;
4975 #endif
4976 EOF
4977         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
4978         { (eval echo "$as_me:4978: \"$cf_try\"") >&5
4979   (eval $cf_try) 2>&5
4980   ac_status=$?
4981   echo "$as_me:4981: \$? = $ac_status" >&5
4982   (exit $ac_status); }
4983         if test -f conftest.out ; then
4984                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
4985                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
4986                 rm -f conftest.out
4987         fi
4988
4989 else
4990   cat >conftest.$ac_ext <<_ACEOF
4991 #line 4991 "configure"
4992 #include "confdefs.h"
4993
4994 #include <${cf_cv_ncurses_header:-curses.h}>
4995 #include <stdio.h>
4996 int main()
4997 {
4998         FILE *fp = fopen("$cf_tempfile", "w");
4999 #ifdef NCURSES_VERSION
5000 # ifdef NCURSES_VERSION_PATCH
5001         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
5002 # else
5003         fprintf(fp, "%s\n", NCURSES_VERSION);
5004 # endif
5005 #else
5006 # ifdef __NCURSES_H
5007         fprintf(fp, "old\n");
5008 # else
5009         make an error
5010 # endif
5011 #endif
5012         ${cf_cv_main_return:-return}(0);
5013 }
5014 _ACEOF
5015 rm -f conftest$ac_exeext
5016 if { (eval echo "$as_me:5016: \"$ac_link\"") >&5
5017   (eval $ac_link) 2>&5
5018   ac_status=$?
5019   echo "$as_me:5019: \$? = $ac_status" >&5
5020   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
5021   { (eval echo "$as_me:5021: \"$ac_try\"") >&5
5022   (eval $ac_try) 2>&5
5023   ac_status=$?
5024   echo "$as_me:5024: \$? = $ac_status" >&5
5025   (exit $ac_status); }; }; then
5026
5027         cf_cv_ncurses_version=`cat $cf_tempfile`
5028 else
5029   echo "$as_me: program exited with status $ac_status" >&5
5030 echo "$as_me: failed program was:" >&5
5031 cat conftest.$ac_ext >&5
5032 fi
5033 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
5034 fi
5035         rm -f $cf_tempfile
5036
5037 fi
5038 echo "$as_me:5038: result: $cf_cv_ncurses_version" >&5
5039 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
5040 test "$cf_cv_ncurses_version" = no ||
5041 cat >>confdefs.h <<\EOF
5042 #define NCURSES 1
5043 EOF
5044
5045 echo "$as_me:5045: checking if we have identified curses libraries" >&5
5046 echo $ECHO_N "checking if we have identified curses libraries... $ECHO_C" >&6
5047 cat >conftest.$ac_ext <<_ACEOF
5048 #line 5048 "configure"
5049 #include "confdefs.h"
5050 #include <${cf_cv_ncurses_header:-curses.h}>
5051 int
5052 main ()
5053 {
5054 initscr(); tgoto("?", 0,0)
5055   ;
5056   return 0;
5057 }
5058 _ACEOF
5059 rm -f conftest.$ac_objext conftest$ac_exeext
5060 if { (eval echo "$as_me:5060: \"$ac_link\"") >&5
5061   (eval $ac_link) 2>&5
5062   ac_status=$?
5063   echo "$as_me:5063: \$? = $ac_status" >&5
5064   (exit $ac_status); } &&
5065          { ac_try='test -s conftest$ac_exeext'
5066   { (eval echo "$as_me:5066: \"$ac_try\"") >&5
5067   (eval $ac_try) 2>&5
5068   ac_status=$?
5069   echo "$as_me:5069: \$? = $ac_status" >&5
5070   (exit $ac_status); }; }; then
5071   cf_result=yes
5072 else
5073   echo "$as_me: failed program was:" >&5
5074 cat conftest.$ac_ext >&5
5075 cf_result=no
5076 fi
5077 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5078 echo "$as_me:5078: result: $cf_result" >&5
5079 echo "${ECHO_T}$cf_result" >&6
5080
5081 if test "$cf_result" = no ; then
5082 case $host_os in
5083 (freebsd*)
5084         echo "$as_me:5084: checking for tgoto in -lmytinfo" >&5
5085 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
5086 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
5087   echo $ECHO_N "(cached) $ECHO_C" >&6
5088 else
5089   ac_check_lib_save_LIBS=$LIBS
5090 LIBS="-lmytinfo  $LIBS"
5091 cat >conftest.$ac_ext <<_ACEOF
5092 #line 5092 "configure"
5093 #include "confdefs.h"
5094
5095 /* Override any gcc2 internal prototype to avoid an error.  */
5096 #ifdef __cplusplus
5097 extern "C"
5098 #endif
5099 /* We use char because int might match the return type of a gcc2
5100    builtin and then its argument prototype would still apply.  */
5101 char tgoto ();
5102 int
5103 main ()
5104 {
5105 tgoto ();
5106   ;
5107   return 0;
5108 }
5109 _ACEOF
5110 rm -f conftest.$ac_objext conftest$ac_exeext
5111 if { (eval echo "$as_me:5111: \"$ac_link\"") >&5
5112   (eval $ac_link) 2>&5
5113   ac_status=$?
5114   echo "$as_me:5114: \$? = $ac_status" >&5
5115   (exit $ac_status); } &&
5116          { ac_try='test -s conftest$ac_exeext'
5117   { (eval echo "$as_me:5117: \"$ac_try\"") >&5
5118   (eval $ac_try) 2>&5
5119   ac_status=$?
5120   echo "$as_me:5120: \$? = $ac_status" >&5
5121   (exit $ac_status); }; }; then
5122   ac_cv_lib_mytinfo_tgoto=yes
5123 else
5124   echo "$as_me: failed program was:" >&5
5125 cat conftest.$ac_ext >&5
5126 ac_cv_lib_mytinfo_tgoto=no
5127 fi
5128 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5129 LIBS=$ac_check_lib_save_LIBS
5130 fi
5131 echo "$as_me:5131: result: $ac_cv_lib_mytinfo_tgoto" >&5
5132 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
5133 if test $ac_cv_lib_mytinfo_tgoto = yes; then
5134
5135 cf_add_libs="-lmytinfo"
5136 # Filter out duplicates - this happens with badly-designed ".pc" files...
5137 for cf_add_1lib in $LIBS
5138 do
5139         for cf_add_2lib in $cf_add_libs
5140         do
5141                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5142                 then
5143                         cf_add_1lib=
5144                         break
5145                 fi
5146         done
5147         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5148 done
5149 LIBS="$cf_add_libs"
5150
5151 fi
5152
5153         ;;
5154 (hpux10.*)
5155         # Looking at HPUX 10.20, the Hcurses library is the oldest (1997), cur_colr
5156         # next (1998), and xcurses "newer" (2000).  There is no header file for
5157         # Hcurses; the subdirectory curses_colr has the headers (curses.h and
5158         # term.h) for cur_colr
5159         if test "x$cf_cv_screen" = "xcurses_colr"
5160         then
5161                 echo "$as_me:5161: checking for initscr in -lcur_colr" >&5
5162 echo $ECHO_N "checking for initscr in -lcur_colr... $ECHO_C" >&6
5163 if test "${ac_cv_lib_cur_colr_initscr+set}" = set; then
5164   echo $ECHO_N "(cached) $ECHO_C" >&6
5165 else
5166   ac_check_lib_save_LIBS=$LIBS
5167 LIBS="-lcur_colr  $LIBS"
5168 cat >conftest.$ac_ext <<_ACEOF
5169 #line 5169 "configure"
5170 #include "confdefs.h"
5171
5172 /* Override any gcc2 internal prototype to avoid an error.  */
5173 #ifdef __cplusplus
5174 extern "C"
5175 #endif
5176 /* We use char because int might match the return type of a gcc2
5177    builtin and then its argument prototype would still apply.  */
5178 char initscr ();
5179 int
5180 main ()
5181 {
5182 initscr ();
5183   ;
5184   return 0;
5185 }
5186 _ACEOF
5187 rm -f conftest.$ac_objext conftest$ac_exeext
5188 if { (eval echo "$as_me:5188: \"$ac_link\"") >&5
5189   (eval $ac_link) 2>&5
5190   ac_status=$?
5191   echo "$as_me:5191: \$? = $ac_status" >&5
5192   (exit $ac_status); } &&
5193          { ac_try='test -s conftest$ac_exeext'
5194   { (eval echo "$as_me:5194: \"$ac_try\"") >&5
5195   (eval $ac_try) 2>&5
5196   ac_status=$?
5197   echo "$as_me:5197: \$? = $ac_status" >&5
5198   (exit $ac_status); }; }; then
5199   ac_cv_lib_cur_colr_initscr=yes
5200 else
5201   echo "$as_me: failed program was:" >&5
5202 cat conftest.$ac_ext >&5
5203 ac_cv_lib_cur_colr_initscr=no
5204 fi
5205 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5206 LIBS=$ac_check_lib_save_LIBS
5207 fi
5208 echo "$as_me:5208: result: $ac_cv_lib_cur_colr_initscr" >&5
5209 echo "${ECHO_T}$ac_cv_lib_cur_colr_initscr" >&6
5210 if test $ac_cv_lib_cur_colr_initscr = yes; then
5211
5212 cf_add_libs="-lcur_colr"
5213 # Filter out duplicates - this happens with badly-designed ".pc" files...
5214 for cf_add_1lib in $LIBS
5215 do
5216         for cf_add_2lib in $cf_add_libs
5217         do
5218                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5219                 then
5220                         cf_add_1lib=
5221                         break
5222                 fi
5223         done
5224         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5225 done
5226 LIBS="$cf_add_libs"
5227
5228                         ac_cv_func_initscr=yes
5229
5230 else
5231
5232                 echo "$as_me:5232: checking for initscr in -lHcurses" >&5
5233 echo $ECHO_N "checking for initscr in -lHcurses... $ECHO_C" >&6
5234 if test "${ac_cv_lib_Hcurses_initscr+set}" = set; then
5235   echo $ECHO_N "(cached) $ECHO_C" >&6
5236 else
5237   ac_check_lib_save_LIBS=$LIBS
5238 LIBS="-lHcurses  $LIBS"
5239 cat >conftest.$ac_ext <<_ACEOF
5240 #line 5240 "configure"
5241 #include "confdefs.h"
5242
5243 /* Override any gcc2 internal prototype to avoid an error.  */
5244 #ifdef __cplusplus
5245 extern "C"
5246 #endif
5247 /* We use char because int might match the return type of a gcc2
5248    builtin and then its argument prototype would still apply.  */
5249 char initscr ();
5250 int
5251 main ()
5252 {
5253 initscr ();
5254   ;
5255   return 0;
5256 }
5257 _ACEOF
5258 rm -f conftest.$ac_objext conftest$ac_exeext
5259 if { (eval echo "$as_me:5259: \"$ac_link\"") >&5
5260   (eval $ac_link) 2>&5
5261   ac_status=$?
5262   echo "$as_me:5262: \$? = $ac_status" >&5
5263   (exit $ac_status); } &&
5264          { ac_try='test -s conftest$ac_exeext'
5265   { (eval echo "$as_me:5265: \"$ac_try\"") >&5
5266   (eval $ac_try) 2>&5
5267   ac_status=$?
5268   echo "$as_me:5268: \$? = $ac_status" >&5
5269   (exit $ac_status); }; }; then
5270   ac_cv_lib_Hcurses_initscr=yes
5271 else
5272   echo "$as_me: failed program was:" >&5
5273 cat conftest.$ac_ext >&5
5274 ac_cv_lib_Hcurses_initscr=no
5275 fi
5276 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5277 LIBS=$ac_check_lib_save_LIBS
5278 fi
5279 echo "$as_me:5279: result: $ac_cv_lib_Hcurses_initscr" >&5
5280 echo "${ECHO_T}$ac_cv_lib_Hcurses_initscr" >&6
5281 if test $ac_cv_lib_Hcurses_initscr = yes; then
5282
5283                         # HP's header uses __HP_CURSES, but user claims _HP_CURSES.
5284
5285 cf_add_libs="-lHcurses"
5286 # Filter out duplicates - this happens with badly-designed ".pc" files...
5287 for cf_add_1lib in $LIBS
5288 do
5289         for cf_add_2lib in $cf_add_libs
5290         do
5291                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5292                 then
5293                         cf_add_1lib=
5294                         break
5295                 fi
5296         done
5297         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5298 done
5299 LIBS="$cf_add_libs"
5300
5301                         CPPFLAGS="$CPPFLAGS -D__HP_CURSES -D_HP_CURSES"
5302                         ac_cv_func_initscr=yes
5303
5304 fi
5305
5306 fi
5307
5308         fi
5309         ;;
5310 (linux*)
5311         case `arch 2>/dev/null` in
5312         (x86_64)
5313                 if test -d /lib64
5314                 then
5315
5316 if test -n "/lib64" ; then
5317         for cf_add_libdir in /lib64
5318         do
5319                 if test $cf_add_libdir = /usr/lib ; then
5320                         :
5321                 elif test -d $cf_add_libdir
5322                 then
5323                         cf_have_libdir=no
5324                         if test -n "$LDFLAGS$LIBS" ; then
5325                                 # a loop is needed to ensure we can add subdirs of existing dirs
5326                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
5327                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5328                                                 cf_have_libdir=yes; break
5329                                         fi
5330                                 done
5331                         fi
5332                         if test "$cf_have_libdir" = no ; then
5333                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5334
5335 echo "${as_me:-configure}:5335: testing adding $cf_add_libdir to library-path ..." 1>&5
5336
5337                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5338                         fi
5339                 fi
5340         done
5341 fi
5342
5343                 else
5344
5345 if test -n "/lib" ; then
5346         for cf_add_libdir in /lib
5347         do
5348                 if test $cf_add_libdir = /usr/lib ; then
5349                         :
5350                 elif test -d $cf_add_libdir
5351                 then
5352                         cf_have_libdir=no
5353                         if test -n "$LDFLAGS$LIBS" ; then
5354                                 # a loop is needed to ensure we can add subdirs of existing dirs
5355                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
5356                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5357                                                 cf_have_libdir=yes; break
5358                                         fi
5359                                 done
5360                         fi
5361                         if test "$cf_have_libdir" = no ; then
5362                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5363
5364 echo "${as_me:-configure}:5364: testing adding $cf_add_libdir to library-path ..." 1>&5
5365
5366                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5367                         fi
5368                 fi
5369         done
5370 fi
5371
5372                 fi
5373                 ;;
5374         (*)
5375
5376 if test -n "/lib" ; then
5377         for cf_add_libdir in /lib
5378         do
5379                 if test $cf_add_libdir = /usr/lib ; then
5380                         :
5381                 elif test -d $cf_add_libdir
5382                 then
5383                         cf_have_libdir=no
5384                         if test -n "$LDFLAGS$LIBS" ; then
5385                                 # a loop is needed to ensure we can add subdirs of existing dirs
5386                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
5387                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5388                                                 cf_have_libdir=yes; break
5389                                         fi
5390                                 done
5391                         fi
5392                         if test "$cf_have_libdir" = no ; then
5393                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5394
5395 echo "${as_me:-configure}:5395: testing adding $cf_add_libdir to library-path ..." 1>&5
5396
5397                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5398                         fi
5399                 fi
5400         done
5401 fi
5402
5403                 ;;
5404         esac
5405         ;;
5406 (sunos3*|sunos4*)
5407         if test "x$cf_cv_screen" = "xcurses_5lib"
5408         then
5409                 if test -d /usr/5lib ; then
5410
5411 if test -n "/usr/5lib" ; then
5412         for cf_add_libdir in /usr/5lib
5413         do
5414                 if test $cf_add_libdir = /usr/lib ; then
5415                         :
5416                 elif test -d $cf_add_libdir
5417                 then
5418                         cf_have_libdir=no
5419                         if test -n "$LDFLAGS$LIBS" ; then
5420                                 # a loop is needed to ensure we can add subdirs of existing dirs
5421                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
5422                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5423                                                 cf_have_libdir=yes; break
5424                                         fi
5425                                 done
5426                         fi
5427                         if test "$cf_have_libdir" = no ; then
5428                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5429
5430 echo "${as_me:-configure}:5430: testing adding $cf_add_libdir to library-path ..." 1>&5
5431
5432                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5433                         fi
5434                 fi
5435         done
5436 fi
5437
5438 cf_add_libs="-lcurses -ltermcap"
5439 # Filter out duplicates - this happens with badly-designed ".pc" files...
5440 for cf_add_1lib in $LIBS
5441 do
5442         for cf_add_2lib in $cf_add_libs
5443         do
5444                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5445                 then
5446                         cf_add_1lib=
5447                         break
5448                 fi
5449         done
5450         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5451 done
5452 LIBS="$cf_add_libs"
5453
5454                 fi
5455         fi
5456         ac_cv_func_initscr=yes
5457         ;;
5458 esac
5459
5460 if test ".$ac_cv_func_initscr" != .yes ; then
5461         cf_save_LIBS="$LIBS"
5462
5463         if test ".${cf_cv_ncurses_version:-no}" != .no
5464         then
5465                 cf_check_list="ncurses curses cursesX"
5466         else
5467                 cf_check_list="cursesX curses ncurses"
5468         fi
5469
5470         # Check for library containing tgoto.  Do this before curses library
5471         # because it may be needed to link the test-case for initscr.
5472         if test "x$cf_term_lib" = x
5473         then
5474                 echo "$as_me:5474: checking for tgoto" >&5
5475 echo $ECHO_N "checking for tgoto... $ECHO_C" >&6
5476 if test "${ac_cv_func_tgoto+set}" = set; then
5477   echo $ECHO_N "(cached) $ECHO_C" >&6
5478 else
5479   cat >conftest.$ac_ext <<_ACEOF
5480 #line 5480 "configure"
5481 #include "confdefs.h"
5482 /* System header to define __stub macros and hopefully few prototypes,
5483     which can conflict with char tgoto (); below.  */
5484 #include <assert.h>
5485 /* Override any gcc2 internal prototype to avoid an error.  */
5486 #ifdef __cplusplus
5487 extern "C"
5488 #endif
5489 /* We use char because int might match the return type of a gcc2
5490    builtin and then its argument prototype would still apply.  */
5491 char tgoto ();
5492 char (*f) ();
5493
5494 int
5495 main ()
5496 {
5497 /* The GNU C library defines this for functions which it implements
5498     to always fail with ENOSYS.  Some functions are actually named
5499     something starting with __ and the normal name is an alias.  */
5500 #if defined (__stub_tgoto) || defined (__stub___tgoto)
5501 choke me
5502 #else
5503 f = tgoto; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
5504 #endif
5505
5506   ;
5507   return 0;
5508 }
5509 _ACEOF
5510 rm -f conftest.$ac_objext conftest$ac_exeext
5511 if { (eval echo "$as_me:5511: \"$ac_link\"") >&5
5512   (eval $ac_link) 2>&5
5513   ac_status=$?
5514   echo "$as_me:5514: \$? = $ac_status" >&5
5515   (exit $ac_status); } &&
5516          { ac_try='test -s conftest$ac_exeext'
5517   { (eval echo "$as_me:5517: \"$ac_try\"") >&5
5518   (eval $ac_try) 2>&5
5519   ac_status=$?
5520   echo "$as_me:5520: \$? = $ac_status" >&5
5521   (exit $ac_status); }; }; then
5522   ac_cv_func_tgoto=yes
5523 else
5524   echo "$as_me: failed program was:" >&5
5525 cat conftest.$ac_ext >&5
5526 ac_cv_func_tgoto=no
5527 fi
5528 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5529 fi
5530 echo "$as_me:5530: result: $ac_cv_func_tgoto" >&5
5531 echo "${ECHO_T}$ac_cv_func_tgoto" >&6
5532 if test $ac_cv_func_tgoto = yes; then
5533   cf_term_lib=predefined
5534 else
5535
5536                         for cf_term_lib in $cf_check_list otermcap termcap tinfo termlib unknown
5537                         do
5538                                 as_ac_Lib=`echo "ac_cv_lib_$cf_term_lib''_tgoto" | $as_tr_sh`
5539 echo "$as_me:5539: checking for tgoto in -l$cf_term_lib" >&5
5540 echo $ECHO_N "checking for tgoto in -l$cf_term_lib... $ECHO_C" >&6
5541 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
5542   echo $ECHO_N "(cached) $ECHO_C" >&6
5543 else
5544   ac_check_lib_save_LIBS=$LIBS
5545 LIBS="-l$cf_term_lib  $LIBS"
5546 cat >conftest.$ac_ext <<_ACEOF
5547 #line 5547 "configure"
5548 #include "confdefs.h"
5549
5550 /* Override any gcc2 internal prototype to avoid an error.  */
5551 #ifdef __cplusplus
5552 extern "C"
5553 #endif
5554 /* We use char because int might match the return type of a gcc2
5555    builtin and then its argument prototype would still apply.  */
5556 char tgoto ();
5557 int
5558 main ()
5559 {
5560 tgoto ();
5561   ;
5562   return 0;
5563 }
5564 _ACEOF
5565 rm -f conftest.$ac_objext conftest$ac_exeext
5566 if { (eval echo "$as_me:5566: \"$ac_link\"") >&5
5567   (eval $ac_link) 2>&5
5568   ac_status=$?
5569   echo "$as_me:5569: \$? = $ac_status" >&5
5570   (exit $ac_status); } &&
5571          { ac_try='test -s conftest$ac_exeext'
5572   { (eval echo "$as_me:5572: \"$ac_try\"") >&5
5573   (eval $ac_try) 2>&5
5574   ac_status=$?
5575   echo "$as_me:5575: \$? = $ac_status" >&5
5576   (exit $ac_status); }; }; then
5577   eval "$as_ac_Lib=yes"
5578 else
5579   echo "$as_me: failed program was:" >&5
5580 cat conftest.$ac_ext >&5
5581 eval "$as_ac_Lib=no"
5582 fi
5583 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5584 LIBS=$ac_check_lib_save_LIBS
5585 fi
5586 echo "$as_me:5586: result: `eval echo '${'$as_ac_Lib'}'`" >&5
5587 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
5588 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
5589   break
5590 fi
5591
5592                         done
5593
5594 fi
5595
5596         fi
5597
5598         # Check for library containing initscr
5599         test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS"
5600         if test "x$cf_curs_lib" = x
5601         then
5602                 for cf_curs_lib in $cf_check_list xcurses jcurses pdcurses unknown
5603                 do
5604                         as_ac_Lib=`echo "ac_cv_lib_$cf_curs_lib''_initscr" | $as_tr_sh`
5605 echo "$as_me:5605: checking for initscr in -l$cf_curs_lib" >&5
5606 echo $ECHO_N "checking for initscr in -l$cf_curs_lib... $ECHO_C" >&6
5607 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
5608   echo $ECHO_N "(cached) $ECHO_C" >&6
5609 else
5610   ac_check_lib_save_LIBS=$LIBS
5611 LIBS="-l$cf_curs_lib  $LIBS"
5612 cat >conftest.$ac_ext <<_ACEOF
5613 #line 5613 "configure"
5614 #include "confdefs.h"
5615
5616 /* Override any gcc2 internal prototype to avoid an error.  */
5617 #ifdef __cplusplus
5618 extern "C"
5619 #endif
5620 /* We use char because int might match the return type of a gcc2
5621    builtin and then its argument prototype would still apply.  */
5622 char initscr ();
5623 int
5624 main ()
5625 {
5626 initscr ();
5627   ;
5628   return 0;
5629 }
5630 _ACEOF
5631 rm -f conftest.$ac_objext conftest$ac_exeext
5632 if { (eval echo "$as_me:5632: \"$ac_link\"") >&5
5633   (eval $ac_link) 2>&5
5634   ac_status=$?
5635   echo "$as_me:5635: \$? = $ac_status" >&5
5636   (exit $ac_status); } &&
5637          { ac_try='test -s conftest$ac_exeext'
5638   { (eval echo "$as_me:5638: \"$ac_try\"") >&5
5639   (eval $ac_try) 2>&5
5640   ac_status=$?
5641   echo "$as_me:5641: \$? = $ac_status" >&5
5642   (exit $ac_status); }; }; then
5643   eval "$as_ac_Lib=yes"
5644 else
5645   echo "$as_me: failed program was:" >&5
5646 cat conftest.$ac_ext >&5
5647 eval "$as_ac_Lib=no"
5648 fi
5649 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5650 LIBS=$ac_check_lib_save_LIBS
5651 fi
5652 echo "$as_me:5652: result: `eval echo '${'$as_ac_Lib'}'`" >&5
5653 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
5654 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
5655   break
5656 fi
5657
5658                 done
5659         fi
5660         test $cf_curs_lib = unknown && { { echo "$as_me:5660: error: no curses library found" >&5
5661 echo "$as_me: error: no curses library found" >&2;}
5662    { (exit 1); exit 1; }; }
5663
5664         LIBS="-l$cf_curs_lib $cf_save_LIBS"
5665         if test "$cf_term_lib" = unknown ; then
5666                 echo "$as_me:5666: checking if we can link with $cf_curs_lib library" >&5
5667 echo $ECHO_N "checking if we can link with $cf_curs_lib library... $ECHO_C" >&6
5668                 cat >conftest.$ac_ext <<_ACEOF
5669 #line 5669 "configure"
5670 #include "confdefs.h"
5671 #include <${cf_cv_ncurses_header:-curses.h}>
5672 int
5673 main ()
5674 {
5675 initscr()
5676   ;
5677   return 0;
5678 }
5679 _ACEOF
5680 rm -f conftest.$ac_objext conftest$ac_exeext
5681 if { (eval echo "$as_me:5681: \"$ac_link\"") >&5
5682   (eval $ac_link) 2>&5
5683   ac_status=$?
5684   echo "$as_me:5684: \$? = $ac_status" >&5
5685   (exit $ac_status); } &&
5686          { ac_try='test -s conftest$ac_exeext'
5687   { (eval echo "$as_me:5687: \"$ac_try\"") >&5
5688   (eval $ac_try) 2>&5
5689   ac_status=$?
5690   echo "$as_me:5690: \$? = $ac_status" >&5
5691   (exit $ac_status); }; }; then
5692   cf_result=yes
5693 else
5694   echo "$as_me: failed program was:" >&5
5695 cat conftest.$ac_ext >&5
5696 cf_result=no
5697 fi
5698 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5699                 echo "$as_me:5699: result: $cf_result" >&5
5700 echo "${ECHO_T}$cf_result" >&6
5701                 test $cf_result = no && { { echo "$as_me:5701: error: Cannot link curses library" >&5
5702 echo "$as_me: error: Cannot link curses library" >&2;}
5703    { (exit 1); exit 1; }; }
5704         elif test "$cf_curs_lib" = "$cf_term_lib" ; then
5705                 :
5706         elif test "$cf_term_lib" != predefined ; then
5707                 echo "$as_me:5707: checking if we need both $cf_curs_lib and $cf_term_lib libraries" >&5
5708 echo $ECHO_N "checking if we need both $cf_curs_lib and $cf_term_lib libraries... $ECHO_C" >&6
5709                 cat >conftest.$ac_ext <<_ACEOF
5710 #line 5710 "configure"
5711 #include "confdefs.h"
5712 #include <${cf_cv_ncurses_header:-curses.h}>
5713 int
5714 main ()
5715 {
5716 initscr(); tgoto((char *)0, 0, 0);
5717   ;
5718   return 0;
5719 }
5720 _ACEOF
5721 rm -f conftest.$ac_objext conftest$ac_exeext
5722 if { (eval echo "$as_me:5722: \"$ac_link\"") >&5
5723   (eval $ac_link) 2>&5
5724   ac_status=$?
5725   echo "$as_me:5725: \$? = $ac_status" >&5
5726   (exit $ac_status); } &&
5727          { ac_try='test -s conftest$ac_exeext'
5728   { (eval echo "$as_me:5728: \"$ac_try\"") >&5
5729   (eval $ac_try) 2>&5
5730   ac_status=$?
5731   echo "$as_me:5731: \$? = $ac_status" >&5
5732   (exit $ac_status); }; }; then
5733   cf_result=no
5734 else
5735   echo "$as_me: failed program was:" >&5
5736 cat conftest.$ac_ext >&5
5737
5738                         LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
5739                         cat >conftest.$ac_ext <<_ACEOF
5740 #line 5740 "configure"
5741 #include "confdefs.h"
5742 #include <${cf_cv_ncurses_header:-curses.h}>
5743 int
5744 main ()
5745 {
5746 initscr()
5747   ;
5748   return 0;
5749 }
5750 _ACEOF
5751 rm -f conftest.$ac_objext conftest$ac_exeext
5752 if { (eval echo "$as_me:5752: \"$ac_link\"") >&5
5753   (eval $ac_link) 2>&5
5754   ac_status=$?
5755   echo "$as_me:5755: \$? = $ac_status" >&5
5756   (exit $ac_status); } &&
5757          { ac_try='test -s conftest$ac_exeext'
5758   { (eval echo "$as_me:5758: \"$ac_try\"") >&5
5759   (eval $ac_try) 2>&5
5760   ac_status=$?
5761   echo "$as_me:5761: \$? = $ac_status" >&5
5762   (exit $ac_status); }; }; then
5763   cf_result=yes
5764 else
5765   echo "$as_me: failed program was:" >&5
5766 cat conftest.$ac_ext >&5
5767 cf_result=error
5768 fi
5769 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5770
5771 fi
5772 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5773                 echo "$as_me:5773: result: $cf_result" >&5
5774 echo "${ECHO_T}$cf_result" >&6
5775         fi
5776 fi
5777 fi
5778
5779         ;;
5780 (ncursesw*)
5781
5782 echo "$as_me:5782: checking for multibyte character support" >&5
5783 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
5784 if test "${cf_cv_utf8_lib+set}" = set; then
5785   echo $ECHO_N "(cached) $ECHO_C" >&6
5786 else
5787
5788         cf_save_LIBS="$LIBS"
5789         cat >conftest.$ac_ext <<_ACEOF
5790 #line 5790 "configure"
5791 #include "confdefs.h"
5792
5793 #include <stdlib.h>
5794 int
5795 main ()
5796 {
5797 putwc(0,0);
5798   ;
5799   return 0;
5800 }
5801 _ACEOF
5802 rm -f conftest.$ac_objext conftest$ac_exeext
5803 if { (eval echo "$as_me:5803: \"$ac_link\"") >&5
5804   (eval $ac_link) 2>&5
5805   ac_status=$?
5806   echo "$as_me:5806: \$? = $ac_status" >&5
5807   (exit $ac_status); } &&
5808          { ac_try='test -s conftest$ac_exeext'
5809   { (eval echo "$as_me:5809: \"$ac_try\"") >&5
5810   (eval $ac_try) 2>&5
5811   ac_status=$?
5812   echo "$as_me:5812: \$? = $ac_status" >&5
5813   (exit $ac_status); }; }; then
5814   cf_cv_utf8_lib=yes
5815 else
5816   echo "$as_me: failed program was:" >&5
5817 cat conftest.$ac_ext >&5
5818
5819 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
5820 # will be set on completion of the AC_TRY_LINK below.
5821 cf_cv_header_path_utf8=
5822 cf_cv_library_path_utf8=
5823
5824 echo "${as_me:-configure}:5824: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
5825
5826 cf_save_LIBS="$LIBS"
5827
5828 cat >conftest.$ac_ext <<_ACEOF
5829 #line 5829 "configure"
5830 #include "confdefs.h"
5831
5832 #include <libutf8.h>
5833 int
5834 main ()
5835 {
5836 putwc(0,0);
5837   ;
5838   return 0;
5839 }
5840 _ACEOF
5841 rm -f conftest.$ac_objext conftest$ac_exeext
5842 if { (eval echo "$as_me:5842: \"$ac_link\"") >&5
5843   (eval $ac_link) 2>&5
5844   ac_status=$?
5845   echo "$as_me:5845: \$? = $ac_status" >&5
5846   (exit $ac_status); } &&
5847          { ac_try='test -s conftest$ac_exeext'
5848   { (eval echo "$as_me:5848: \"$ac_try\"") >&5
5849   (eval $ac_try) 2>&5
5850   ac_status=$?
5851   echo "$as_me:5851: \$? = $ac_status" >&5
5852   (exit $ac_status); }; }; then
5853
5854         cf_cv_find_linkage_utf8=yes
5855         cf_cv_header_path_utf8=/usr/include
5856         cf_cv_library_path_utf8=/usr/lib
5857
5858 else
5859   echo "$as_me: failed program was:" >&5
5860 cat conftest.$ac_ext >&5
5861
5862 LIBS="-lutf8  $cf_save_LIBS"
5863
5864 cat >conftest.$ac_ext <<_ACEOF
5865 #line 5865 "configure"
5866 #include "confdefs.h"
5867
5868 #include <libutf8.h>
5869 int
5870 main ()
5871 {
5872 putwc(0,0);
5873   ;
5874   return 0;
5875 }
5876 _ACEOF
5877 rm -f conftest.$ac_objext conftest$ac_exeext
5878 if { (eval echo "$as_me:5878: \"$ac_link\"") >&5
5879   (eval $ac_link) 2>&5
5880   ac_status=$?
5881   echo "$as_me:5881: \$? = $ac_status" >&5
5882   (exit $ac_status); } &&
5883          { ac_try='test -s conftest$ac_exeext'
5884   { (eval echo "$as_me:5884: \"$ac_try\"") >&5
5885   (eval $ac_try) 2>&5
5886   ac_status=$?
5887   echo "$as_me:5887: \$? = $ac_status" >&5
5888   (exit $ac_status); }; }; then
5889
5890         cf_cv_find_linkage_utf8=yes
5891         cf_cv_header_path_utf8=/usr/include
5892         cf_cv_library_path_utf8=/usr/lib
5893         cf_cv_library_file_utf8="-lutf8"
5894
5895 else
5896   echo "$as_me: failed program was:" >&5
5897 cat conftest.$ac_ext >&5
5898
5899         cf_cv_find_linkage_utf8=no
5900         LIBS="$cf_save_LIBS"
5901
5902         test -n "$verbose" && echo "    find linkage for utf8 library" 1>&6
5903
5904 echo "${as_me:-configure}:5904: testing find linkage for utf8 library ..." 1>&5
5905
5906 echo "${as_me:-configure}:5906: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
5907
5908         cf_save_CPPFLAGS="$CPPFLAGS"
5909         cf_test_CPPFLAGS="$CPPFLAGS"
5910
5911 cf_search=
5912
5913 # collect the current set of include-directories from compiler flags
5914 cf_header_path_list=""
5915 if test -n "${CFLAGS}${CPPFLAGS}" ; then
5916         for cf_header_path in $CPPFLAGS $CFLAGS
5917         do
5918                 case $cf_header_path in
5919                 (-I*)
5920                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
5921
5922 test "x$cf_header_path" != "xNONE" && \
5923 test -d "$cf_header_path" && \
5924  {
5925         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
5926         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
5927         test -d $cf_header_path/include/utf8 &&       cf_search="$cf_search $cf_header_path/include/utf8"
5928         test -d $cf_header_path/include/utf8/include &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
5929         test -d $cf_header_path/utf8/include &&       cf_search="$cf_search $cf_header_path/utf8/include"
5930         test -d $cf_header_path/utf8/include/utf8 &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
5931 }
5932
5933                         cf_header_path_list="$cf_header_path_list $cf_search"
5934                         ;;
5935                 esac
5936         done
5937 fi
5938
5939 # add the variations for the package we are looking for
5940
5941 cf_search=
5942
5943 test "x$prefix" != "xNONE" && \
5944 test -d "$prefix" && \
5945  {
5946         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
5947         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
5948         test -d $prefix/include/utf8 &&       cf_search="$cf_search $prefix/include/utf8"
5949         test -d $prefix/include/utf8/include &&    cf_search="$cf_search $prefix/include/utf8/include"
5950         test -d $prefix/utf8/include &&       cf_search="$cf_search $prefix/utf8/include"
5951         test -d $prefix/utf8/include/utf8 &&    cf_search="$cf_search $prefix/utf8/include/utf8"
5952 }
5953
5954 for cf_subdir_prefix in \
5955         /usr \
5956         /usr/local \
5957         /usr/pkg \
5958         /opt \
5959         /opt/local \
5960         $HOME
5961 do
5962
5963 test "x$cf_subdir_prefix" != "x$prefix" && \
5964 test -d "$cf_subdir_prefix" && \
5965 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
5966         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
5967         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
5968         test -d $cf_subdir_prefix/include/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/include/utf8"
5969         test -d $cf_subdir_prefix/include/utf8/include &&    cf_search="$cf_search $cf_subdir_prefix/include/utf8/include"
5970         test -d $cf_subdir_prefix/utf8/include &&       cf_search="$cf_search $cf_subdir_prefix/utf8/include"
5971         test -d $cf_subdir_prefix/utf8/include/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/include/utf8"
5972 }
5973
5974 done
5975
5976 test "$includedir" != NONE && \
5977 test "$includedir" != "/usr/include" && \
5978 test -d "$includedir" && {
5979         test -d $includedir &&    cf_search="$cf_search $includedir"
5980         test -d $includedir/utf8 && cf_search="$cf_search $includedir/utf8"
5981 }
5982
5983 test "$oldincludedir" != NONE && \
5984 test "$oldincludedir" != "/usr/include" && \
5985 test -d "$oldincludedir" && {
5986         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
5987         test -d $oldincludedir/utf8 && cf_search="$cf_search $oldincludedir/utf8"
5988 }
5989
5990 cf_search="$cf_search $cf_header_path_list"
5991
5992         for cf_cv_header_path_utf8 in $cf_search
5993         do
5994                 if test -d $cf_cv_header_path_utf8 ; then
5995                         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
5996
5997 echo "${as_me:-configure}:5997: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
5998
5999                         CPPFLAGS="$cf_save_CPPFLAGS -I$cf_cv_header_path_utf8"
6000                         cat >conftest.$ac_ext <<_ACEOF
6001 #line 6001 "configure"
6002 #include "confdefs.h"
6003
6004 #include <libutf8.h>
6005 int
6006 main ()
6007 {
6008 putwc(0,0);
6009   ;
6010   return 0;
6011 }
6012 _ACEOF
6013 rm -f conftest.$ac_objext
6014 if { (eval echo "$as_me:6014: \"$ac_compile\"") >&5
6015   (eval $ac_compile) 2>&5
6016   ac_status=$?
6017   echo "$as_me:6017: \$? = $ac_status" >&5
6018   (exit $ac_status); } &&
6019          { ac_try='test -s conftest.$ac_objext'
6020   { (eval echo "$as_me:6020: \"$ac_try\"") >&5
6021   (eval $ac_try) 2>&5
6022   ac_status=$?
6023   echo "$as_me:6023: \$? = $ac_status" >&5
6024   (exit $ac_status); }; }; then
6025
6026                                 test -n "$verbose" && echo "    ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
6027
6028 echo "${as_me:-configure}:6028: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
6029
6030                                 cf_cv_find_linkage_utf8=maybe
6031                                 cf_test_CPPFLAGS="$CPPFLAGS"
6032                                 break
6033 else
6034   echo "$as_me: failed program was:" >&5
6035 cat conftest.$ac_ext >&5
6036
6037                                 CPPFLAGS="$cf_save_CPPFLAGS"
6038
6039 fi
6040 rm -f conftest.$ac_objext conftest.$ac_ext
6041                 fi
6042         done
6043
6044         if test "$cf_cv_find_linkage_utf8" = maybe ; then
6045
6046 echo "${as_me:-configure}:6046: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
6047
6048                 cf_save_LIBS="$LIBS"
6049                 cf_save_LDFLAGS="$LDFLAGS"
6050
6051                 if test "$cf_cv_find_linkage_utf8" != yes ; then
6052
6053 cf_search=
6054 cf_library_path_list=""
6055 if test -n "${LDFLAGS}${LIBS}" ; then
6056         for cf_library_path in $LDFLAGS $LIBS
6057         do
6058                 case $cf_library_path in
6059                 (-L*)
6060                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
6061
6062 test "x$cf_library_path" != "xNONE" && \
6063 test -d "$cf_library_path" && \
6064  {
6065         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
6066         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
6067         test -d $cf_library_path/lib/utf8 &&       cf_search="$cf_search $cf_library_path/lib/utf8"
6068         test -d $cf_library_path/lib/utf8/lib &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
6069         test -d $cf_library_path/utf8/lib &&       cf_search="$cf_search $cf_library_path/utf8/lib"
6070         test -d $cf_library_path/utf8/lib/utf8 &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
6071 }
6072
6073                         cf_library_path_list="$cf_library_path_list $cf_search"
6074                         ;;
6075                 esac
6076         done
6077 fi
6078
6079 cf_search=
6080
6081 test "x$prefix" != "xNONE" && \
6082 test -d "$prefix" && \
6083  {
6084         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
6085         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
6086         test -d $prefix/lib/utf8 &&       cf_search="$cf_search $prefix/lib/utf8"
6087         test -d $prefix/lib/utf8/lib &&    cf_search="$cf_search $prefix/lib/utf8/lib"
6088         test -d $prefix/utf8/lib &&       cf_search="$cf_search $prefix/utf8/lib"
6089         test -d $prefix/utf8/lib/utf8 &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
6090 }
6091
6092 for cf_subdir_prefix in \
6093         /usr \
6094         /usr/local \
6095         /usr/pkg \
6096         /opt \
6097         /opt/local \
6098         $HOME
6099 do
6100
6101 test "x$cf_subdir_prefix" != "x$prefix" && \
6102 test -d "$cf_subdir_prefix" && \
6103 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
6104         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
6105         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
6106         test -d $cf_subdir_prefix/lib/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/lib/utf8"
6107         test -d $cf_subdir_prefix/lib/utf8/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/utf8/lib"
6108         test -d $cf_subdir_prefix/utf8/lib &&       cf_search="$cf_search $cf_subdir_prefix/utf8/lib"
6109         test -d $cf_subdir_prefix/utf8/lib/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/lib/utf8"
6110 }
6111
6112 done
6113
6114 cf_search="$cf_library_path_list $cf_search"
6115
6116                         for cf_cv_library_path_utf8 in $cf_search
6117                         do
6118                                 if test -d $cf_cv_library_path_utf8 ; then
6119                                         test -n "$verbose" && echo "    ... testing $cf_cv_library_path_utf8" 1>&6
6120
6121 echo "${as_me:-configure}:6121: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
6122
6123                                         CPPFLAGS="$cf_test_CPPFLAGS"
6124                                         LIBS="-lutf8  $cf_save_LIBS"
6125                                         LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
6126                                         cat >conftest.$ac_ext <<_ACEOF
6127 #line 6127 "configure"
6128 #include "confdefs.h"
6129
6130 #include <libutf8.h>
6131 int
6132 main ()
6133 {
6134 putwc(0,0);
6135   ;
6136   return 0;
6137 }
6138 _ACEOF
6139 rm -f conftest.$ac_objext conftest$ac_exeext
6140 if { (eval echo "$as_me:6140: \"$ac_link\"") >&5
6141   (eval $ac_link) 2>&5
6142   ac_status=$?
6143   echo "$as_me:6143: \$? = $ac_status" >&5
6144   (exit $ac_status); } &&
6145          { ac_try='test -s conftest$ac_exeext'
6146   { (eval echo "$as_me:6146: \"$ac_try\"") >&5
6147   (eval $ac_try) 2>&5
6148   ac_status=$?
6149   echo "$as_me:6149: \$? = $ac_status" >&5
6150   (exit $ac_status); }; }; then
6151
6152                                         test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
6153
6154 echo "${as_me:-configure}:6154: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
6155
6156                                         cf_cv_find_linkage_utf8=yes
6157                                         cf_cv_library_file_utf8="-lutf8"
6158                                         break
6159 else
6160   echo "$as_me: failed program was:" >&5
6161 cat conftest.$ac_ext >&5
6162
6163                                         CPPFLAGS="$cf_save_CPPFLAGS"
6164                                         LIBS="$cf_save_LIBS"
6165                                         LDFLAGS="$cf_save_LDFLAGS"
6166
6167 fi
6168 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6169                                 fi
6170                         done
6171                         CPPFLAGS="$cf_save_CPPFLAGS"
6172                         LDFLAGS="$cf_save_LDFLAGS"
6173                 fi
6174
6175         else
6176                 cf_cv_find_linkage_utf8=no
6177         fi
6178
6179 fi
6180 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6181
6182 fi
6183 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6184
6185 LIBS="$cf_save_LIBS"
6186
6187 if test "$cf_cv_find_linkage_utf8" = yes ; then
6188 cf_cv_utf8_lib=add-on
6189 else
6190 cf_cv_utf8_lib=no
6191 fi
6192
6193 fi
6194 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6195 fi
6196 echo "$as_me:6196: result: $cf_cv_utf8_lib" >&5
6197 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
6198
6199 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
6200 # ncurses/ncursesw:
6201 if test "$cf_cv_utf8_lib" = "add-on" ; then
6202
6203 cat >>confdefs.h <<\EOF
6204 #define HAVE_LIBUTF8_H 1
6205 EOF
6206
6207 if test -n "$cf_cv_header_path_utf8" ; then
6208   for cf_add_incdir in $cf_cv_header_path_utf8
6209   do
6210         while test $cf_add_incdir != /usr/include
6211         do
6212           if test -d $cf_add_incdir
6213           then
6214                 cf_have_incdir=no
6215                 if test -n "$CFLAGS$CPPFLAGS" ; then
6216                   # a loop is needed to ensure we can add subdirs of existing dirs
6217                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6218                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6219                           cf_have_incdir=yes; break
6220                         fi
6221                   done
6222                 fi
6223
6224                 if test "$cf_have_incdir" = no ; then
6225                   if test "$cf_add_incdir" = /usr/local/include ; then
6226                         if test "$GCC" = yes
6227                         then
6228                           cf_save_CPPFLAGS=$CPPFLAGS
6229                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6230                           cat >conftest.$ac_ext <<_ACEOF
6231 #line 6231 "configure"
6232 #include "confdefs.h"
6233 #include <stdio.h>
6234 int
6235 main ()
6236 {
6237 printf("Hello")
6238   ;
6239   return 0;
6240 }
6241 _ACEOF
6242 rm -f conftest.$ac_objext
6243 if { (eval echo "$as_me:6243: \"$ac_compile\"") >&5
6244   (eval $ac_compile) 2>&5
6245   ac_status=$?
6246   echo "$as_me:6246: \$? = $ac_status" >&5
6247   (exit $ac_status); } &&
6248          { ac_try='test -s conftest.$ac_objext'
6249   { (eval echo "$as_me:6249: \"$ac_try\"") >&5
6250   (eval $ac_try) 2>&5
6251   ac_status=$?
6252   echo "$as_me:6252: \$? = $ac_status" >&5
6253   (exit $ac_status); }; }; then
6254   :
6255 else
6256   echo "$as_me: failed program was:" >&5
6257 cat conftest.$ac_ext >&5
6258 cf_have_incdir=yes
6259 fi
6260 rm -f conftest.$ac_objext conftest.$ac_ext
6261                           CPPFLAGS=$cf_save_CPPFLAGS
6262                         fi
6263                   fi
6264                 fi
6265
6266                 if test "$cf_have_incdir" = no ; then
6267                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6268
6269 echo "${as_me:-configure}:6269: testing adding $cf_add_incdir to include-path ..." 1>&5
6270
6271                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6272
6273                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6274                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6275                   cf_add_incdir="$cf_top_incdir"
6276                 else
6277                   break
6278                 fi
6279           else
6280                 break
6281           fi
6282         done
6283   done
6284 fi
6285
6286 if test -n "$cf_cv_library_path_utf8" ; then
6287         for cf_add_libdir in $cf_cv_library_path_utf8
6288         do
6289                 if test $cf_add_libdir = /usr/lib ; then
6290                         :
6291                 elif test -d $cf_add_libdir
6292                 then
6293                         cf_have_libdir=no
6294                         if test -n "$LDFLAGS$LIBS" ; then
6295                                 # a loop is needed to ensure we can add subdirs of existing dirs
6296                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6297                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6298                                                 cf_have_libdir=yes; break
6299                                         fi
6300                                 done
6301                         fi
6302                         if test "$cf_have_libdir" = no ; then
6303                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6304
6305 echo "${as_me:-configure}:6305: testing adding $cf_add_libdir to library-path ..." 1>&5
6306
6307                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6308                         fi
6309                 fi
6310         done
6311 fi
6312
6313 cf_add_libs="$cf_cv_library_file_utf8"
6314 # Filter out duplicates - this happens with badly-designed ".pc" files...
6315 for cf_add_1lib in $LIBS
6316 do
6317         for cf_add_2lib in $cf_add_libs
6318         do
6319                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6320                 then
6321                         cf_add_1lib=
6322                         break
6323                 fi
6324         done
6325         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6326 done
6327 LIBS="$cf_add_libs"
6328
6329 fi
6330
6331 cf_ncuconfig_root=$cf_cv_screen
6332 cf_have_ncuconfig=no
6333
6334 if test "x${PKG_CONFIG:=none}" != xnone; then
6335         echo "$as_me:6335: checking pkg-config for $cf_ncuconfig_root" >&5
6336 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
6337         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
6338                 echo "$as_me:6338: result: yes" >&5
6339 echo "${ECHO_T}yes" >&6
6340
6341                 echo "$as_me:6341: checking if the $cf_ncuconfig_root package files work" >&5
6342 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
6343                 cf_have_ncuconfig=unknown
6344
6345                 cf_save_CPPFLAGS="$CPPFLAGS"
6346                 cf_save_LIBS="$LIBS"
6347
6348                 CPPFLAGS="$CPPFLAGS `$PKG_CONFIG --cflags $cf_ncuconfig_root`"
6349
6350 cf_add_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
6351 # Filter out duplicates - this happens with badly-designed ".pc" files...
6352 for cf_add_1lib in $LIBS
6353 do
6354         for cf_add_2lib in $cf_add_libs
6355         do
6356                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6357                 then
6358                         cf_add_1lib=
6359                         break
6360                 fi
6361         done
6362         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6363 done
6364 LIBS="$cf_add_libs"
6365
6366                 cat >conftest.$ac_ext <<_ACEOF
6367 #line 6367 "configure"
6368 #include "confdefs.h"
6369 #include <${cf_cv_ncurses_header:-curses.h}>
6370 int
6371 main ()
6372 {
6373 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
6374   ;
6375   return 0;
6376 }
6377 _ACEOF
6378 rm -f conftest.$ac_objext conftest$ac_exeext
6379 if { (eval echo "$as_me:6379: \"$ac_link\"") >&5
6380   (eval $ac_link) 2>&5
6381   ac_status=$?
6382   echo "$as_me:6382: \$? = $ac_status" >&5
6383   (exit $ac_status); } &&
6384          { ac_try='test -s conftest$ac_exeext'
6385   { (eval echo "$as_me:6385: \"$ac_try\"") >&5
6386   (eval $ac_try) 2>&5
6387   ac_status=$?
6388   echo "$as_me:6388: \$? = $ac_status" >&5
6389   (exit $ac_status); }; }; then
6390   if test "$cross_compiling" = yes; then
6391   cf_have_ncuconfig=maybe
6392 else
6393   cat >conftest.$ac_ext <<_ACEOF
6394 #line 6394 "configure"
6395 #include "confdefs.h"
6396 #include <${cf_cv_ncurses_header:-curses.h}>
6397                                 int main(void)
6398                                 { char *xx = curses_version(); return (xx == 0); }
6399 _ACEOF
6400 rm -f conftest$ac_exeext
6401 if { (eval echo "$as_me:6401: \"$ac_link\"") >&5
6402   (eval $ac_link) 2>&5
6403   ac_status=$?
6404   echo "$as_me:6404: \$? = $ac_status" >&5
6405   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
6406   { (eval echo "$as_me:6406: \"$ac_try\"") >&5
6407   (eval $ac_try) 2>&5
6408   ac_status=$?
6409   echo "$as_me:6409: \$? = $ac_status" >&5
6410   (exit $ac_status); }; }; then
6411   cf_have_ncuconfig=yes
6412 else
6413   echo "$as_me: program exited with status $ac_status" >&5
6414 echo "$as_me: failed program was:" >&5
6415 cat conftest.$ac_ext >&5
6416 cf_have_ncuconfig=no
6417 fi
6418 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
6419 fi
6420 else
6421   echo "$as_me: failed program was:" >&5
6422 cat conftest.$ac_ext >&5
6423 cf_have_ncuconfig=no
6424 fi
6425 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6426                 echo "$as_me:6426: result: $cf_have_ncuconfig" >&5
6427 echo "${ECHO_T}$cf_have_ncuconfig" >&6
6428                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
6429                 if test "$cf_have_ncuconfig" != "yes"
6430                 then
6431                         CPPFLAGS="$cf_save_CPPFLAGS"
6432                         LIBS="$cf_save_LIBS"
6433                         NCURSES_CONFIG_PKG=none
6434                 else
6435
6436 cat >>confdefs.h <<\EOF
6437 #define NCURSES 1
6438 EOF
6439
6440                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
6441                 fi
6442
6443         else
6444                 echo "$as_me:6444: result: no" >&5
6445 echo "${ECHO_T}no" >&6
6446                 NCURSES_CONFIG_PKG=none
6447         fi
6448 else
6449         NCURSES_CONFIG_PKG=none
6450 fi
6451
6452 if test "x$cf_have_ncuconfig" = "xno"; then
6453         echo "Looking for ${cf_ncuconfig_root}-config"
6454
6455 if test -n "$ac_tool_prefix"; then
6456   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
6457   do
6458     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
6459 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
6460 echo "$as_me:6460: checking for $ac_word" >&5
6461 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
6462 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
6463   echo $ECHO_N "(cached) $ECHO_C" >&6
6464 else
6465   if test -n "$NCURSES_CONFIG"; then
6466   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
6467 else
6468   ac_save_IFS=$IFS; IFS=$ac_path_separator
6469 ac_dummy="$PATH"
6470 for ac_dir in $ac_dummy; do
6471   IFS=$ac_save_IFS
6472   test -z "$ac_dir" && ac_dir=.
6473   $as_executable_p "$ac_dir/$ac_word" || continue
6474 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
6475 echo "$as_me:6475: found $ac_dir/$ac_word" >&5
6476 break
6477 done
6478
6479 fi
6480 fi
6481 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
6482 if test -n "$NCURSES_CONFIG"; then
6483   echo "$as_me:6483: result: $NCURSES_CONFIG" >&5
6484 echo "${ECHO_T}$NCURSES_CONFIG" >&6
6485 else
6486   echo "$as_me:6486: result: no" >&5
6487 echo "${ECHO_T}no" >&6
6488 fi
6489
6490     test -n "$NCURSES_CONFIG" && break
6491   done
6492 fi
6493 if test -z "$NCURSES_CONFIG"; then
6494   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
6495   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
6496 do
6497   # Extract the first word of "$ac_prog", so it can be a program name with args.
6498 set dummy $ac_prog; ac_word=$2
6499 echo "$as_me:6499: checking for $ac_word" >&5
6500 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
6501 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
6502   echo $ECHO_N "(cached) $ECHO_C" >&6
6503 else
6504   if test -n "$ac_ct_NCURSES_CONFIG"; then
6505   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
6506 else
6507   ac_save_IFS=$IFS; IFS=$ac_path_separator
6508 ac_dummy="$PATH"
6509 for ac_dir in $ac_dummy; do
6510   IFS=$ac_save_IFS
6511   test -z "$ac_dir" && ac_dir=.
6512   $as_executable_p "$ac_dir/$ac_word" || continue
6513 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
6514 echo "$as_me:6514: found $ac_dir/$ac_word" >&5
6515 break
6516 done
6517
6518 fi
6519 fi
6520 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
6521 if test -n "$ac_ct_NCURSES_CONFIG"; then
6522   echo "$as_me:6522: result: $ac_ct_NCURSES_CONFIG" >&5
6523 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
6524 else
6525   echo "$as_me:6525: result: no" >&5
6526 echo "${ECHO_T}no" >&6
6527 fi
6528
6529   test -n "$ac_ct_NCURSES_CONFIG" && break
6530 done
6531 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
6532
6533   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
6534 fi
6535
6536         if test "$NCURSES_CONFIG" != none ; then
6537
6538                 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
6539
6540 cf_add_libs="`$NCURSES_CONFIG --libs`"
6541 # Filter out duplicates - this happens with badly-designed ".pc" files...
6542 for cf_add_1lib in $LIBS
6543 do
6544         for cf_add_2lib in $cf_add_libs
6545         do
6546                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6547                 then
6548                         cf_add_1lib=
6549                         break
6550                 fi
6551         done
6552         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6553 done
6554 LIBS="$cf_add_libs"
6555
6556                 # even with config script, some packages use no-override for curses.h
6557
6558 echo "$as_me:6558: checking if we have identified curses headers" >&5
6559 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
6560 if test "${cf_cv_ncurses_header+set}" = set; then
6561   echo $ECHO_N "(cached) $ECHO_C" >&6
6562 else
6563
6564 cf_cv_ncurses_header=none
6565 for cf_header in \
6566         ncurses.h $cf_cv_screen/ncurses.h \
6567         curses.h $cf_cv_screen/curses.h
6568 do
6569 cat >conftest.$ac_ext <<_ACEOF
6570 #line 6570 "configure"
6571 #include "confdefs.h"
6572 #include <${cf_header}>
6573 int
6574 main ()
6575 {
6576 initscr(); tgoto("?", 0,0)
6577   ;
6578   return 0;
6579 }
6580 _ACEOF
6581 rm -f conftest.$ac_objext
6582 if { (eval echo "$as_me:6582: \"$ac_compile\"") >&5
6583   (eval $ac_compile) 2>&5
6584   ac_status=$?
6585   echo "$as_me:6585: \$? = $ac_status" >&5
6586   (exit $ac_status); } &&
6587          { ac_try='test -s conftest.$ac_objext'
6588   { (eval echo "$as_me:6588: \"$ac_try\"") >&5
6589   (eval $ac_try) 2>&5
6590   ac_status=$?
6591   echo "$as_me:6591: \$? = $ac_status" >&5
6592   (exit $ac_status); }; }; then
6593   cf_cv_ncurses_header=$cf_header; break
6594 else
6595   echo "$as_me: failed program was:" >&5
6596 cat conftest.$ac_ext >&5
6597 fi
6598 rm -f conftest.$ac_objext conftest.$ac_ext
6599 done
6600
6601 fi
6602 echo "$as_me:6602: result: $cf_cv_ncurses_header" >&5
6603 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
6604
6605 if test "$cf_cv_ncurses_header" = none ; then
6606         { { echo "$as_me:6606: error: No curses header-files found" >&5
6607 echo "$as_me: error: No curses header-files found" >&2;}
6608    { (exit 1); exit 1; }; }
6609 fi
6610
6611 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
6612
6613 for ac_header in $cf_cv_ncurses_header
6614 do
6615 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
6616 echo "$as_me:6616: checking for $ac_header" >&5
6617 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
6618 if eval "test \"\${$as_ac_Header+set}\" = set"; then
6619   echo $ECHO_N "(cached) $ECHO_C" >&6
6620 else
6621   cat >conftest.$ac_ext <<_ACEOF
6622 #line 6622 "configure"
6623 #include "confdefs.h"
6624 #include <$ac_header>
6625 _ACEOF
6626 if { (eval echo "$as_me:6626: \"$ac_cpp conftest.$ac_ext\"") >&5
6627   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
6628   ac_status=$?
6629   egrep -v '^ *\+' conftest.er1 >conftest.err
6630   rm -f conftest.er1
6631   cat conftest.err >&5
6632   echo "$as_me:6632: \$? = $ac_status" >&5
6633   (exit $ac_status); } >/dev/null; then
6634   if test -s conftest.err; then
6635     ac_cpp_err=$ac_c_preproc_warn_flag
6636   else
6637     ac_cpp_err=
6638   fi
6639 else
6640   ac_cpp_err=yes
6641 fi
6642 if test -z "$ac_cpp_err"; then
6643   eval "$as_ac_Header=yes"
6644 else
6645   echo "$as_me: failed program was:" >&5
6646   cat conftest.$ac_ext >&5
6647   eval "$as_ac_Header=no"
6648 fi
6649 rm -f conftest.err conftest.$ac_ext
6650 fi
6651 echo "$as_me:6651: result: `eval echo '${'$as_ac_Header'}'`" >&5
6652 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
6653 if test `eval echo '${'$as_ac_Header'}'` = yes; then
6654   cat >>confdefs.h <<EOF
6655 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
6656 EOF
6657
6658 fi
6659 done
6660
6661 cat >>confdefs.h <<\EOF
6662 #define NCURSES 1
6663 EOF
6664
6665 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
6666
6667                 cat >>confdefs.h <<EOF
6668 #define $cf_nculib_ROOT 1
6669 EOF
6670
6671                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
6672
6673         else
6674
6675 cf_ncuhdr_root=$cf_cv_screen
6676
6677 test -n "$cf_cv_curses_dir" && \
6678 test "$cf_cv_curses_dir" != "no" && { \
6679
6680 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
6681   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
6682   do
6683         while test $cf_add_incdir != /usr/include
6684         do
6685           if test -d $cf_add_incdir
6686           then
6687                 cf_have_incdir=no
6688                 if test -n "$CFLAGS$CPPFLAGS" ; then
6689                   # a loop is needed to ensure we can add subdirs of existing dirs
6690                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6691                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6692                           cf_have_incdir=yes; break
6693                         fi
6694                   done
6695                 fi
6696
6697                 if test "$cf_have_incdir" = no ; then
6698                   if test "$cf_add_incdir" = /usr/local/include ; then
6699                         if test "$GCC" = yes
6700                         then
6701                           cf_save_CPPFLAGS=$CPPFLAGS
6702                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6703                           cat >conftest.$ac_ext <<_ACEOF
6704 #line 6704 "configure"
6705 #include "confdefs.h"
6706 #include <stdio.h>
6707 int
6708 main ()
6709 {
6710 printf("Hello")
6711   ;
6712   return 0;
6713 }
6714 _ACEOF
6715 rm -f conftest.$ac_objext
6716 if { (eval echo "$as_me:6716: \"$ac_compile\"") >&5
6717   (eval $ac_compile) 2>&5
6718   ac_status=$?
6719   echo "$as_me:6719: \$? = $ac_status" >&5
6720   (exit $ac_status); } &&
6721          { ac_try='test -s conftest.$ac_objext'
6722   { (eval echo "$as_me:6722: \"$ac_try\"") >&5
6723   (eval $ac_try) 2>&5
6724   ac_status=$?
6725   echo "$as_me:6725: \$? = $ac_status" >&5
6726   (exit $ac_status); }; }; then
6727   :
6728 else
6729   echo "$as_me: failed program was:" >&5
6730 cat conftest.$ac_ext >&5
6731 cf_have_incdir=yes
6732 fi
6733 rm -f conftest.$ac_objext conftest.$ac_ext
6734                           CPPFLAGS=$cf_save_CPPFLAGS
6735                         fi
6736                   fi
6737                 fi
6738
6739                 if test "$cf_have_incdir" = no ; then
6740                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6741
6742 echo "${as_me:-configure}:6742: testing adding $cf_add_incdir to include-path ..." 1>&5
6743
6744                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6745
6746                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6747                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6748                   cf_add_incdir="$cf_top_incdir"
6749                 else
6750                   break
6751                 fi
6752           else
6753                 break
6754           fi
6755         done
6756   done
6757 fi
6758
6759 }
6760
6761 echo "$as_me:6761: checking for $cf_ncuhdr_root header in include-path" >&5
6762 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
6763 if test "${cf_cv_ncurses_h+set}" = set; then
6764   echo $ECHO_N "(cached) $ECHO_C" >&6
6765 else
6766
6767         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
6768         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
6769         for cf_header in $cf_header_list
6770         do
6771
6772         cat >conftest.$ac_ext <<_ACEOF
6773 #line 6773 "configure"
6774 #include "confdefs.h"
6775
6776 #include <$cf_header>
6777 int
6778 main ()
6779 {
6780
6781 #ifdef NCURSES_VERSION
6782
6783 printf("%s\n", NCURSES_VERSION);
6784 #else
6785 #ifdef __NCURSES_H
6786 printf("old\n");
6787 #else
6788         make an error
6789 #endif
6790 #endif
6791
6792   ;
6793   return 0;
6794 }
6795 _ACEOF
6796 rm -f conftest.$ac_objext
6797 if { (eval echo "$as_me:6797: \"$ac_compile\"") >&5
6798   (eval $ac_compile) 2>&5
6799   ac_status=$?
6800   echo "$as_me:6800: \$? = $ac_status" >&5
6801   (exit $ac_status); } &&
6802          { ac_try='test -s conftest.$ac_objext'
6803   { (eval echo "$as_me:6803: \"$ac_try\"") >&5
6804   (eval $ac_try) 2>&5
6805   ac_status=$?
6806   echo "$as_me:6806: \$? = $ac_status" >&5
6807   (exit $ac_status); }; }; then
6808   cf_cv_ncurses_h=$cf_header
6809
6810 else
6811   echo "$as_me: failed program was:" >&5
6812 cat conftest.$ac_ext >&5
6813 cf_cv_ncurses_h=no
6814 fi
6815 rm -f conftest.$ac_objext conftest.$ac_ext
6816
6817                 test "$cf_cv_ncurses_h" != no && break
6818         done
6819
6820 fi
6821 echo "$as_me:6821: result: $cf_cv_ncurses_h" >&5
6822 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
6823
6824 if test "$cf_cv_ncurses_h" != no ; then
6825         cf_cv_ncurses_header=$cf_cv_ncurses_h
6826 else
6827
6828 echo "$as_me:6828: checking for $cf_ncuhdr_root include-path" >&5
6829 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
6830 if test "${cf_cv_ncurses_h2+set}" = set; then
6831   echo $ECHO_N "(cached) $ECHO_C" >&6
6832 else
6833
6834         test -n "$verbose" && echo
6835
6836 cf_search=
6837
6838 # collect the current set of include-directories from compiler flags
6839 cf_header_path_list=""
6840 if test -n "${CFLAGS}${CPPFLAGS}" ; then
6841         for cf_header_path in $CPPFLAGS $CFLAGS
6842         do
6843                 case $cf_header_path in
6844                 (-I*)
6845                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
6846
6847 test "x$cf_header_path" != "xNONE" && \
6848 test -d "$cf_header_path" && \
6849  {
6850         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
6851         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
6852         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
6853         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
6854         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
6855         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"
6856 }
6857
6858                         cf_header_path_list="$cf_header_path_list $cf_search"
6859                         ;;
6860                 esac
6861         done
6862 fi
6863
6864 # add the variations for the package we are looking for
6865
6866 cf_search=
6867
6868 test "x$prefix" != "xNONE" && \
6869 test -d "$prefix" && \
6870  {
6871         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
6872         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
6873         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
6874         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
6875         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
6876         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
6877 }
6878
6879 for cf_subdir_prefix in \
6880         /usr \
6881         /usr/local \
6882         /usr/pkg \
6883         /opt \
6884         /opt/local \
6885         $HOME
6886 do
6887
6888 test "x$cf_subdir_prefix" != "x$prefix" && \
6889 test -d "$cf_subdir_prefix" && \
6890 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
6891         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
6892         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
6893         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
6894         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
6895         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
6896         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"
6897 }
6898
6899 done
6900
6901 test "$includedir" != NONE && \
6902 test "$includedir" != "/usr/include" && \
6903 test -d "$includedir" && {
6904         test -d $includedir &&    cf_search="$cf_search $includedir"
6905         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
6906 }
6907
6908 test "$oldincludedir" != NONE && \
6909 test "$oldincludedir" != "/usr/include" && \
6910 test -d "$oldincludedir" && {
6911         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
6912         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
6913 }
6914
6915 cf_search="$cf_search $cf_header_path_list"
6916
6917         test -n "$verbose" && echo search path $cf_search
6918         cf_save2_CPPFLAGS="$CPPFLAGS"
6919         for cf_incdir in $cf_search
6920         do
6921
6922 if test -n "$cf_incdir" ; then
6923   for cf_add_incdir in $cf_incdir
6924   do
6925         while test $cf_add_incdir != /usr/include
6926         do
6927           if test -d $cf_add_incdir
6928           then
6929                 cf_have_incdir=no
6930                 if test -n "$CFLAGS$CPPFLAGS" ; then
6931                   # a loop is needed to ensure we can add subdirs of existing dirs
6932                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6933                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6934                           cf_have_incdir=yes; break
6935                         fi
6936                   done
6937                 fi
6938
6939                 if test "$cf_have_incdir" = no ; then
6940                   if test "$cf_add_incdir" = /usr/local/include ; then
6941                         if test "$GCC" = yes
6942                         then
6943                           cf_save_CPPFLAGS=$CPPFLAGS
6944                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6945                           cat >conftest.$ac_ext <<_ACEOF
6946 #line 6946 "configure"
6947 #include "confdefs.h"
6948 #include <stdio.h>
6949 int
6950 main ()
6951 {
6952 printf("Hello")
6953   ;
6954   return 0;
6955 }
6956 _ACEOF
6957 rm -f conftest.$ac_objext
6958 if { (eval echo "$as_me:6958: \"$ac_compile\"") >&5
6959   (eval $ac_compile) 2>&5
6960   ac_status=$?
6961   echo "$as_me:6961: \$? = $ac_status" >&5
6962   (exit $ac_status); } &&
6963          { ac_try='test -s conftest.$ac_objext'
6964   { (eval echo "$as_me:6964: \"$ac_try\"") >&5
6965   (eval $ac_try) 2>&5
6966   ac_status=$?
6967   echo "$as_me:6967: \$? = $ac_status" >&5
6968   (exit $ac_status); }; }; then
6969   :
6970 else
6971   echo "$as_me: failed program was:" >&5
6972 cat conftest.$ac_ext >&5
6973 cf_have_incdir=yes
6974 fi
6975 rm -f conftest.$ac_objext conftest.$ac_ext
6976                           CPPFLAGS=$cf_save_CPPFLAGS
6977                         fi
6978                   fi
6979                 fi
6980
6981                 if test "$cf_have_incdir" = no ; then
6982                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6983
6984 echo "${as_me:-configure}:6984: testing adding $cf_add_incdir to include-path ..." 1>&5
6985
6986                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6987
6988                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6989                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6990                   cf_add_incdir="$cf_top_incdir"
6991                 else
6992                   break
6993                 fi
6994           else
6995                 break
6996           fi
6997         done
6998   done
6999 fi
7000
7001                 for cf_header in \
7002                         ncurses.h \
7003                         curses.h
7004                 do
7005
7006         cat >conftest.$ac_ext <<_ACEOF
7007 #line 7007 "configure"
7008 #include "confdefs.h"
7009
7010 #include <$cf_header>
7011 int
7012 main ()
7013 {
7014
7015 #ifdef NCURSES_VERSION
7016
7017 printf("%s\n", NCURSES_VERSION);
7018 #else
7019 #ifdef __NCURSES_H
7020 printf("old\n");
7021 #else
7022         make an error
7023 #endif
7024 #endif
7025
7026   ;
7027   return 0;
7028 }
7029 _ACEOF
7030 rm -f conftest.$ac_objext
7031 if { (eval echo "$as_me:7031: \"$ac_compile\"") >&5
7032   (eval $ac_compile) 2>&5
7033   ac_status=$?
7034   echo "$as_me:7034: \$? = $ac_status" >&5
7035   (exit $ac_status); } &&
7036          { ac_try='test -s conftest.$ac_objext'
7037   { (eval echo "$as_me:7037: \"$ac_try\"") >&5
7038   (eval $ac_try) 2>&5
7039   ac_status=$?
7040   echo "$as_me:7040: \$? = $ac_status" >&5
7041   (exit $ac_status); }; }; then
7042   cf_cv_ncurses_h2=$cf_header
7043
7044 else
7045   echo "$as_me: failed program was:" >&5
7046 cat conftest.$ac_ext >&5
7047 cf_cv_ncurses_h2=no
7048 fi
7049 rm -f conftest.$ac_objext conftest.$ac_ext
7050
7051                         if test "$cf_cv_ncurses_h2" != no ; then
7052                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
7053                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
7054                                 break
7055                         fi
7056                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
7057                 done
7058                 CPPFLAGS="$cf_save2_CPPFLAGS"
7059                 test "$cf_cv_ncurses_h2" != no && break
7060         done
7061         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:7061: error: not found" >&5
7062 echo "$as_me: error: not found" >&2;}
7063    { (exit 1); exit 1; }; }
7064
7065 fi
7066 echo "$as_me:7066: result: $cf_cv_ncurses_h2" >&5
7067 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
7068
7069         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
7070         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
7071         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
7072                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
7073         fi
7074
7075 if test -n "$cf_1st_incdir" ; then
7076   for cf_add_incdir in $cf_1st_incdir
7077   do
7078         while test $cf_add_incdir != /usr/include
7079         do
7080           if test -d $cf_add_incdir
7081           then
7082                 cf_have_incdir=no
7083                 if test -n "$CFLAGS$CPPFLAGS" ; then
7084                   # a loop is needed to ensure we can add subdirs of existing dirs
7085                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7086                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7087                           cf_have_incdir=yes; break
7088                         fi
7089                   done
7090                 fi
7091
7092                 if test "$cf_have_incdir" = no ; then
7093                   if test "$cf_add_incdir" = /usr/local/include ; then
7094                         if test "$GCC" = yes
7095                         then
7096                           cf_save_CPPFLAGS=$CPPFLAGS
7097                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7098                           cat >conftest.$ac_ext <<_ACEOF
7099 #line 7099 "configure"
7100 #include "confdefs.h"
7101 #include <stdio.h>
7102 int
7103 main ()
7104 {
7105 printf("Hello")
7106   ;
7107   return 0;
7108 }
7109 _ACEOF
7110 rm -f conftest.$ac_objext
7111 if { (eval echo "$as_me:7111: \"$ac_compile\"") >&5
7112   (eval $ac_compile) 2>&5
7113   ac_status=$?
7114   echo "$as_me:7114: \$? = $ac_status" >&5
7115   (exit $ac_status); } &&
7116          { ac_try='test -s conftest.$ac_objext'
7117   { (eval echo "$as_me:7117: \"$ac_try\"") >&5
7118   (eval $ac_try) 2>&5
7119   ac_status=$?
7120   echo "$as_me:7120: \$? = $ac_status" >&5
7121   (exit $ac_status); }; }; then
7122   :
7123 else
7124   echo "$as_me: failed program was:" >&5
7125 cat conftest.$ac_ext >&5
7126 cf_have_incdir=yes
7127 fi
7128 rm -f conftest.$ac_objext conftest.$ac_ext
7129                           CPPFLAGS=$cf_save_CPPFLAGS
7130                         fi
7131                   fi
7132                 fi
7133
7134                 if test "$cf_have_incdir" = no ; then
7135                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7136
7137 echo "${as_me:-configure}:7137: testing adding $cf_add_incdir to include-path ..." 1>&5
7138
7139                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7140
7141                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7142                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7143                   cf_add_incdir="$cf_top_incdir"
7144                 else
7145                   break
7146                 fi
7147           else
7148                 break
7149           fi
7150         done
7151   done
7152 fi
7153
7154 fi
7155
7156 # Set definitions to allow ifdef'ing for ncurses.h
7157
7158 case $cf_cv_ncurses_header in
7159 (*ncurses.h)
7160
7161 cat >>confdefs.h <<\EOF
7162 #define HAVE_NCURSES_H 1
7163 EOF
7164
7165         ;;
7166 esac
7167
7168 case $cf_cv_ncurses_header in
7169 (ncurses/curses.h|ncurses/ncurses.h)
7170
7171 cat >>confdefs.h <<\EOF
7172 #define HAVE_NCURSES_NCURSES_H 1
7173 EOF
7174
7175         ;;
7176 (ncursesw/curses.h|ncursesw/ncurses.h)
7177
7178 cat >>confdefs.h <<\EOF
7179 #define HAVE_NCURSESW_NCURSES_H 1
7180 EOF
7181
7182         ;;
7183 esac
7184
7185 echo "$as_me:7185: checking for terminfo header" >&5
7186 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
7187 if test "${cf_cv_term_header+set}" = set; then
7188   echo $ECHO_N "(cached) $ECHO_C" >&6
7189 else
7190
7191 case ${cf_cv_ncurses_header} in
7192 (*/ncurses.h|*/ncursesw.h)
7193         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
7194         ;;
7195 (*)
7196         cf_term_header=term.h
7197         ;;
7198 esac
7199
7200 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
7201 do
7202 cat >conftest.$ac_ext <<_ACEOF
7203 #line 7203 "configure"
7204 #include "confdefs.h"
7205 #include <stdio.h>
7206 #include <${cf_cv_ncurses_header:-curses.h}>
7207 #include <$cf_test>
7208
7209 int
7210 main ()
7211 {
7212 int x = auto_left_margin
7213   ;
7214   return 0;
7215 }
7216 _ACEOF
7217 rm -f conftest.$ac_objext
7218 if { (eval echo "$as_me:7218: \"$ac_compile\"") >&5
7219   (eval $ac_compile) 2>&5
7220   ac_status=$?
7221   echo "$as_me:7221: \$? = $ac_status" >&5
7222   (exit $ac_status); } &&
7223          { ac_try='test -s conftest.$ac_objext'
7224   { (eval echo "$as_me:7224: \"$ac_try\"") >&5
7225   (eval $ac_try) 2>&5
7226   ac_status=$?
7227   echo "$as_me:7227: \$? = $ac_status" >&5
7228   (exit $ac_status); }; }; then
7229
7230         cf_cv_term_header="$cf_test"
7231 else
7232   echo "$as_me: failed program was:" >&5
7233 cat conftest.$ac_ext >&5
7234
7235         cf_cv_term_header=unknown
7236
7237 fi
7238 rm -f conftest.$ac_objext conftest.$ac_ext
7239         test "$cf_cv_term_header" != unknown && break
7240 done
7241
7242 fi
7243 echo "$as_me:7243: result: $cf_cv_term_header" >&5
7244 echo "${ECHO_T}$cf_cv_term_header" >&6
7245
7246 # Set definitions to allow ifdef'ing to accommodate subdirectories
7247
7248 case $cf_cv_term_header in
7249 (*term.h)
7250
7251 cat >>confdefs.h <<\EOF
7252 #define HAVE_TERM_H 1
7253 EOF
7254
7255         ;;
7256 esac
7257
7258 case $cf_cv_term_header in
7259 (ncurses/term.h)
7260
7261 cat >>confdefs.h <<\EOF
7262 #define HAVE_NCURSES_TERM_H 1
7263 EOF
7264
7265         ;;
7266 (ncursesw/term.h)
7267
7268 cat >>confdefs.h <<\EOF
7269 #define HAVE_NCURSESW_TERM_H 1
7270 EOF
7271
7272         ;;
7273 esac
7274
7275 # some applications need this, but should check for NCURSES_VERSION
7276
7277 cat >>confdefs.h <<\EOF
7278 #define NCURSES 1
7279 EOF
7280
7281 echo "$as_me:7281: checking for ncurses version" >&5
7282 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
7283 if test "${cf_cv_ncurses_version+set}" = set; then
7284   echo $ECHO_N "(cached) $ECHO_C" >&6
7285 else
7286
7287         cf_cv_ncurses_version=no
7288         cf_tempfile=out$$
7289         rm -f $cf_tempfile
7290         if test "$cross_compiling" = yes; then
7291
7292         # This will not work if the preprocessor splits the line after the
7293         # Autoconf token.  The 'unproto' program does that.
7294         cat > conftest.$ac_ext <<EOF
7295 #include <${cf_cv_ncurses_header:-curses.h}>
7296 #undef Autoconf
7297 #ifdef NCURSES_VERSION
7298 Autoconf NCURSES_VERSION
7299 #else
7300 #ifdef __NCURSES_H
7301 Autoconf "old"
7302 #endif
7303 ;
7304 #endif
7305 EOF
7306         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
7307         { (eval echo "$as_me:7307: \"$cf_try\"") >&5
7308   (eval $cf_try) 2>&5
7309   ac_status=$?
7310   echo "$as_me:7310: \$? = $ac_status" >&5
7311   (exit $ac_status); }
7312         if test -f conftest.out ; then
7313                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
7314                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
7315                 rm -f conftest.out
7316         fi
7317
7318 else
7319   cat >conftest.$ac_ext <<_ACEOF
7320 #line 7320 "configure"
7321 #include "confdefs.h"
7322
7323 #include <${cf_cv_ncurses_header:-curses.h}>
7324 #include <stdio.h>
7325 int main()
7326 {
7327         FILE *fp = fopen("$cf_tempfile", "w");
7328 #ifdef NCURSES_VERSION
7329 # ifdef NCURSES_VERSION_PATCH
7330         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
7331 # else
7332         fprintf(fp, "%s\n", NCURSES_VERSION);
7333 # endif
7334 #else
7335 # ifdef __NCURSES_H
7336         fprintf(fp, "old\n");
7337 # else
7338         make an error
7339 # endif
7340 #endif
7341         ${cf_cv_main_return:-return}(0);
7342 }
7343 _ACEOF
7344 rm -f conftest$ac_exeext
7345 if { (eval echo "$as_me:7345: \"$ac_link\"") >&5
7346   (eval $ac_link) 2>&5
7347   ac_status=$?
7348   echo "$as_me:7348: \$? = $ac_status" >&5
7349   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
7350   { (eval echo "$as_me:7350: \"$ac_try\"") >&5
7351   (eval $ac_try) 2>&5
7352   ac_status=$?
7353   echo "$as_me:7353: \$? = $ac_status" >&5
7354   (exit $ac_status); }; }; then
7355
7356         cf_cv_ncurses_version=`cat $cf_tempfile`
7357 else
7358   echo "$as_me: program exited with status $ac_status" >&5
7359 echo "$as_me: failed program was:" >&5
7360 cat conftest.$ac_ext >&5
7361 fi
7362 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
7363 fi
7364         rm -f $cf_tempfile
7365
7366 fi
7367 echo "$as_me:7367: result: $cf_cv_ncurses_version" >&5
7368 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
7369 test "$cf_cv_ncurses_version" = no ||
7370 cat >>confdefs.h <<\EOF
7371 #define NCURSES 1
7372 EOF
7373
7374 cf_nculib_root=$cf_cv_screen
7375         # This works, except for the special case where we find gpm, but
7376         # ncurses is in a nonstandard location via $LIBS, and we really want
7377         # to link gpm.
7378 cf_ncurses_LIBS=""
7379 cf_ncurses_SAVE="$LIBS"
7380 echo "$as_me:7380: checking for Gpm_Open in -lgpm" >&5
7381 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
7382 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
7383   echo $ECHO_N "(cached) $ECHO_C" >&6
7384 else
7385   ac_check_lib_save_LIBS=$LIBS
7386 LIBS="-lgpm  $LIBS"
7387 cat >conftest.$ac_ext <<_ACEOF
7388 #line 7388 "configure"
7389 #include "confdefs.h"
7390
7391 /* Override any gcc2 internal prototype to avoid an error.  */
7392 #ifdef __cplusplus
7393 extern "C"
7394 #endif
7395 /* We use char because int might match the return type of a gcc2
7396    builtin and then its argument prototype would still apply.  */
7397 char Gpm_Open ();
7398 int
7399 main ()
7400 {
7401 Gpm_Open ();
7402   ;
7403   return 0;
7404 }
7405 _ACEOF
7406 rm -f conftest.$ac_objext conftest$ac_exeext
7407 if { (eval echo "$as_me:7407: \"$ac_link\"") >&5
7408   (eval $ac_link) 2>&5
7409   ac_status=$?
7410   echo "$as_me:7410: \$? = $ac_status" >&5
7411   (exit $ac_status); } &&
7412          { ac_try='test -s conftest$ac_exeext'
7413   { (eval echo "$as_me:7413: \"$ac_try\"") >&5
7414   (eval $ac_try) 2>&5
7415   ac_status=$?
7416   echo "$as_me:7416: \$? = $ac_status" >&5
7417   (exit $ac_status); }; }; then
7418   ac_cv_lib_gpm_Gpm_Open=yes
7419 else
7420   echo "$as_me: failed program was:" >&5
7421 cat conftest.$ac_ext >&5
7422 ac_cv_lib_gpm_Gpm_Open=no
7423 fi
7424 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7425 LIBS=$ac_check_lib_save_LIBS
7426 fi
7427 echo "$as_me:7427: result: $ac_cv_lib_gpm_Gpm_Open" >&5
7428 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
7429 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
7430   echo "$as_me:7430: checking for initscr in -lgpm" >&5
7431 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
7432 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
7433   echo $ECHO_N "(cached) $ECHO_C" >&6
7434 else
7435   ac_check_lib_save_LIBS=$LIBS
7436 LIBS="-lgpm  $LIBS"
7437 cat >conftest.$ac_ext <<_ACEOF
7438 #line 7438 "configure"
7439 #include "confdefs.h"
7440
7441 /* Override any gcc2 internal prototype to avoid an error.  */
7442 #ifdef __cplusplus
7443 extern "C"
7444 #endif
7445 /* We use char because int might match the return type of a gcc2
7446    builtin and then its argument prototype would still apply.  */
7447 char initscr ();
7448 int
7449 main ()
7450 {
7451 initscr ();
7452   ;
7453   return 0;
7454 }
7455 _ACEOF
7456 rm -f conftest.$ac_objext conftest$ac_exeext
7457 if { (eval echo "$as_me:7457: \"$ac_link\"") >&5
7458   (eval $ac_link) 2>&5
7459   ac_status=$?
7460   echo "$as_me:7460: \$? = $ac_status" >&5
7461   (exit $ac_status); } &&
7462          { ac_try='test -s conftest$ac_exeext'
7463   { (eval echo "$as_me:7463: \"$ac_try\"") >&5
7464   (eval $ac_try) 2>&5
7465   ac_status=$?
7466   echo "$as_me:7466: \$? = $ac_status" >&5
7467   (exit $ac_status); }; }; then
7468   ac_cv_lib_gpm_initscr=yes
7469 else
7470   echo "$as_me: failed program was:" >&5
7471 cat conftest.$ac_ext >&5
7472 ac_cv_lib_gpm_initscr=no
7473 fi
7474 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7475 LIBS=$ac_check_lib_save_LIBS
7476 fi
7477 echo "$as_me:7477: result: $ac_cv_lib_gpm_initscr" >&5
7478 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
7479 if test $ac_cv_lib_gpm_initscr = yes; then
7480   LIBS="$cf_ncurses_SAVE"
7481 else
7482   cf_ncurses_LIBS="-lgpm"
7483 fi
7484
7485 fi
7486
7487 case $host_os in
7488 (freebsd*)
7489         # This is only necessary if you are linking against an obsolete
7490         # version of ncurses (but it should do no harm, since it's static).
7491         if test "$cf_nculib_root" = ncurses ; then
7492                 echo "$as_me:7492: checking for tgoto in -lmytinfo" >&5
7493 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
7494 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
7495   echo $ECHO_N "(cached) $ECHO_C" >&6
7496 else
7497   ac_check_lib_save_LIBS=$LIBS
7498 LIBS="-lmytinfo  $LIBS"
7499 cat >conftest.$ac_ext <<_ACEOF
7500 #line 7500 "configure"
7501 #include "confdefs.h"
7502
7503 /* Override any gcc2 internal prototype to avoid an error.  */
7504 #ifdef __cplusplus
7505 extern "C"
7506 #endif
7507 /* We use char because int might match the return type of a gcc2
7508    builtin and then its argument prototype would still apply.  */
7509 char tgoto ();
7510 int
7511 main ()
7512 {
7513 tgoto ();
7514   ;
7515   return 0;
7516 }
7517 _ACEOF
7518 rm -f conftest.$ac_objext conftest$ac_exeext
7519 if { (eval echo "$as_me:7519: \"$ac_link\"") >&5
7520   (eval $ac_link) 2>&5
7521   ac_status=$?
7522   echo "$as_me:7522: \$? = $ac_status" >&5
7523   (exit $ac_status); } &&
7524          { ac_try='test -s conftest$ac_exeext'
7525   { (eval echo "$as_me:7525: \"$ac_try\"") >&5
7526   (eval $ac_try) 2>&5
7527   ac_status=$?
7528   echo "$as_me:7528: \$? = $ac_status" >&5
7529   (exit $ac_status); }; }; then
7530   ac_cv_lib_mytinfo_tgoto=yes
7531 else
7532   echo "$as_me: failed program was:" >&5
7533 cat conftest.$ac_ext >&5
7534 ac_cv_lib_mytinfo_tgoto=no
7535 fi
7536 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7537 LIBS=$ac_check_lib_save_LIBS
7538 fi
7539 echo "$as_me:7539: result: $ac_cv_lib_mytinfo_tgoto" >&5
7540 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
7541 if test $ac_cv_lib_mytinfo_tgoto = yes; then
7542   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
7543 fi
7544
7545         fi
7546         ;;
7547 esac
7548
7549 cf_add_libs="$cf_ncurses_LIBS"
7550 # Filter out duplicates - this happens with badly-designed ".pc" files...
7551 for cf_add_1lib in $LIBS
7552 do
7553         for cf_add_2lib in $cf_add_libs
7554         do
7555                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7556                 then
7557                         cf_add_1lib=
7558                         break
7559                 fi
7560         done
7561         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7562 done
7563 LIBS="$cf_add_libs"
7564
7565 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
7566 then
7567
7568 cf_add_libs="-l$cf_nculib_root"
7569 # Filter out duplicates - this happens with badly-designed ".pc" files...
7570 for cf_add_1lib in $LIBS
7571 do
7572         for cf_add_2lib in $cf_add_libs
7573         do
7574                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7575                 then
7576                         cf_add_1lib=
7577                         break
7578                 fi
7579         done
7580         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7581 done
7582 LIBS="$cf_add_libs"
7583
7584 else
7585
7586         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
7587         cf_libdir=""
7588         echo "$as_me:7588: checking for initscr" >&5
7589 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
7590 if test "${ac_cv_func_initscr+set}" = set; then
7591   echo $ECHO_N "(cached) $ECHO_C" >&6
7592 else
7593   cat >conftest.$ac_ext <<_ACEOF
7594 #line 7594 "configure"
7595 #include "confdefs.h"
7596 /* System header to define __stub macros and hopefully few prototypes,
7597     which can conflict with char initscr (); below.  */
7598 #include <assert.h>
7599 /* Override any gcc2 internal prototype to avoid an error.  */
7600 #ifdef __cplusplus
7601 extern "C"
7602 #endif
7603 /* We use char because int might match the return type of a gcc2
7604    builtin and then its argument prototype would still apply.  */
7605 char initscr ();
7606 char (*f) ();
7607
7608 int
7609 main ()
7610 {
7611 /* The GNU C library defines this for functions which it implements
7612     to always fail with ENOSYS.  Some functions are actually named
7613     something starting with __ and the normal name is an alias.  */
7614 #if defined (__stub_initscr) || defined (__stub___initscr)
7615 choke me
7616 #else
7617 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
7618 #endif
7619
7620   ;
7621   return 0;
7622 }
7623 _ACEOF
7624 rm -f conftest.$ac_objext conftest$ac_exeext
7625 if { (eval echo "$as_me:7625: \"$ac_link\"") >&5
7626   (eval $ac_link) 2>&5
7627   ac_status=$?
7628   echo "$as_me:7628: \$? = $ac_status" >&5
7629   (exit $ac_status); } &&
7630          { ac_try='test -s conftest$ac_exeext'
7631   { (eval echo "$as_me:7631: \"$ac_try\"") >&5
7632   (eval $ac_try) 2>&5
7633   ac_status=$?
7634   echo "$as_me:7634: \$? = $ac_status" >&5
7635   (exit $ac_status); }; }; then
7636   ac_cv_func_initscr=yes
7637 else
7638   echo "$as_me: failed program was:" >&5
7639 cat conftest.$ac_ext >&5
7640 ac_cv_func_initscr=no
7641 fi
7642 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7643 fi
7644 echo "$as_me:7644: result: $ac_cv_func_initscr" >&5
7645 echo "${ECHO_T}$ac_cv_func_initscr" >&6
7646 if test $ac_cv_func_initscr = yes; then
7647   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
7648 else
7649
7650                 cf_save_LIBS="$LIBS"
7651                 echo "$as_me:7651: checking for initscr in -l$cf_nculib_root" >&5
7652 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
7653                 LIBS="-l$cf_nculib_root $LIBS"
7654                 cat >conftest.$ac_ext <<_ACEOF
7655 #line 7655 "configure"
7656 #include "confdefs.h"
7657 #include <${cf_cv_ncurses_header:-curses.h}>
7658 int
7659 main ()
7660 {
7661 initscr()
7662   ;
7663   return 0;
7664 }
7665 _ACEOF
7666 rm -f conftest.$ac_objext conftest$ac_exeext
7667 if { (eval echo "$as_me:7667: \"$ac_link\"") >&5
7668   (eval $ac_link) 2>&5
7669   ac_status=$?
7670   echo "$as_me:7670: \$? = $ac_status" >&5
7671   (exit $ac_status); } &&
7672          { ac_try='test -s conftest$ac_exeext'
7673   { (eval echo "$as_me:7673: \"$ac_try\"") >&5
7674   (eval $ac_try) 2>&5
7675   ac_status=$?
7676   echo "$as_me:7676: \$? = $ac_status" >&5
7677   (exit $ac_status); }; }; then
7678   echo "$as_me:7678: result: yes" >&5
7679 echo "${ECHO_T}yes" >&6
7680                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
7681
7682 else
7683   echo "$as_me: failed program was:" >&5
7684 cat conftest.$ac_ext >&5
7685 echo "$as_me:7685: result: no" >&5
7686 echo "${ECHO_T}no" >&6
7687
7688 cf_search=
7689 cf_library_path_list=""
7690 if test -n "${LDFLAGS}${LIBS}" ; then
7691         for cf_library_path in $LDFLAGS $LIBS
7692         do
7693                 case $cf_library_path in
7694                 (-L*)
7695                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
7696
7697 test "x$cf_library_path" != "xNONE" && \
7698 test -d "$cf_library_path" && \
7699  {
7700         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
7701         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
7702         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
7703         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
7704         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
7705         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"
7706 }
7707
7708                         cf_library_path_list="$cf_library_path_list $cf_search"
7709                         ;;
7710                 esac
7711         done
7712 fi
7713
7714 cf_search=
7715
7716 test "x$prefix" != "xNONE" && \
7717 test -d "$prefix" && \
7718  {
7719         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
7720         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
7721         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
7722         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
7723         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
7724         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
7725 }
7726
7727 for cf_subdir_prefix in \
7728         /usr \
7729         /usr/local \
7730         /usr/pkg \
7731         /opt \
7732         /opt/local \
7733         $HOME
7734 do
7735
7736 test "x$cf_subdir_prefix" != "x$prefix" && \
7737 test -d "$cf_subdir_prefix" && \
7738 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
7739         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
7740         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
7741         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
7742         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
7743         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
7744         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"
7745 }
7746
7747 done
7748
7749 cf_search="$cf_library_path_list $cf_search"
7750
7751                         for cf_libdir in $cf_search
7752                         do
7753                                 echo "$as_me:7753: checking for -l$cf_nculib_root in $cf_libdir" >&5
7754 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
7755                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
7756                                 cat >conftest.$ac_ext <<_ACEOF
7757 #line 7757 "configure"
7758 #include "confdefs.h"
7759 #include <${cf_cv_ncurses_header:-curses.h}>
7760 int
7761 main ()
7762 {
7763 initscr()
7764   ;
7765   return 0;
7766 }
7767 _ACEOF
7768 rm -f conftest.$ac_objext conftest$ac_exeext
7769 if { (eval echo "$as_me:7769: \"$ac_link\"") >&5
7770   (eval $ac_link) 2>&5
7771   ac_status=$?
7772   echo "$as_me:7772: \$? = $ac_status" >&5
7773   (exit $ac_status); } &&
7774          { ac_try='test -s conftest$ac_exeext'
7775   { (eval echo "$as_me:7775: \"$ac_try\"") >&5
7776   (eval $ac_try) 2>&5
7777   ac_status=$?
7778   echo "$as_me:7778: \$? = $ac_status" >&5
7779   (exit $ac_status); }; }; then
7780   echo "$as_me:7780: result: yes" >&5
7781 echo "${ECHO_T}yes" >&6
7782                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
7783                                          break
7784 else
7785   echo "$as_me: failed program was:" >&5
7786 cat conftest.$ac_ext >&5
7787 echo "$as_me:7787: result: no" >&5
7788 echo "${ECHO_T}no" >&6
7789                                          LIBS="$cf_save_LIBS"
7790 fi
7791 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7792                         done
7793
7794 fi
7795 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7796
7797 fi
7798
7799 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
7800
7801 if test $cf_found_library = no ; then
7802         { { echo "$as_me:7802: error: Cannot link $cf_nculib_root library" >&5
7803 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
7804    { (exit 1); exit 1; }; }
7805 fi
7806
7807 fi
7808
7809 if test -n "$cf_ncurses_LIBS" ; then
7810         echo "$as_me:7810: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
7811 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
7812         cf_ncurses_SAVE="$LIBS"
7813         for p in $cf_ncurses_LIBS ; do
7814                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
7815                 if test "$q" != "$LIBS" ; then
7816                         LIBS="$q"
7817                 fi
7818         done
7819         cat >conftest.$ac_ext <<_ACEOF
7820 #line 7820 "configure"
7821 #include "confdefs.h"
7822 #include <${cf_cv_ncurses_header:-curses.h}>
7823 int
7824 main ()
7825 {
7826 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
7827   ;
7828   return 0;
7829 }
7830 _ACEOF
7831 rm -f conftest.$ac_objext conftest$ac_exeext
7832 if { (eval echo "$as_me:7832: \"$ac_link\"") >&5
7833   (eval $ac_link) 2>&5
7834   ac_status=$?
7835   echo "$as_me:7835: \$? = $ac_status" >&5
7836   (exit $ac_status); } &&
7837          { ac_try='test -s conftest$ac_exeext'
7838   { (eval echo "$as_me:7838: \"$ac_try\"") >&5
7839   (eval $ac_try) 2>&5
7840   ac_status=$?
7841   echo "$as_me:7841: \$? = $ac_status" >&5
7842   (exit $ac_status); }; }; then
7843   echo "$as_me:7843: result: yes" >&5
7844 echo "${ECHO_T}yes" >&6
7845 else
7846   echo "$as_me: failed program was:" >&5
7847 cat conftest.$ac_ext >&5
7848 echo "$as_me:7848: result: no" >&5
7849 echo "${ECHO_T}no" >&6
7850                  LIBS="$cf_ncurses_SAVE"
7851 fi
7852 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7853 fi
7854
7855 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
7856
7857 cat >>confdefs.h <<EOF
7858 #define $cf_nculib_ROOT 1
7859 EOF
7860
7861         fi
7862 else
7863         NCURSES_CONFIG=none
7864 fi
7865
7866         ;;
7867 (ncurses*)
7868
7869 cf_ncuconfig_root=$cf_cv_screen
7870 cf_have_ncuconfig=no
7871
7872 if test "x${PKG_CONFIG:=none}" != xnone; then
7873         echo "$as_me:7873: checking pkg-config for $cf_ncuconfig_root" >&5
7874 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
7875         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
7876                 echo "$as_me:7876: result: yes" >&5
7877 echo "${ECHO_T}yes" >&6
7878
7879                 echo "$as_me:7879: checking if the $cf_ncuconfig_root package files work" >&5
7880 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
7881                 cf_have_ncuconfig=unknown
7882
7883                 cf_save_CPPFLAGS="$CPPFLAGS"
7884                 cf_save_LIBS="$LIBS"
7885
7886                 CPPFLAGS="$CPPFLAGS `$PKG_CONFIG --cflags $cf_ncuconfig_root`"
7887
7888 cf_add_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
7889 # Filter out duplicates - this happens with badly-designed ".pc" files...
7890 for cf_add_1lib in $LIBS
7891 do
7892         for cf_add_2lib in $cf_add_libs
7893         do
7894                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7895                 then
7896                         cf_add_1lib=
7897                         break
7898                 fi
7899         done
7900         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7901 done
7902 LIBS="$cf_add_libs"
7903
7904                 cat >conftest.$ac_ext <<_ACEOF
7905 #line 7905 "configure"
7906 #include "confdefs.h"
7907 #include <${cf_cv_ncurses_header:-curses.h}>
7908 int
7909 main ()
7910 {
7911 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
7912   ;
7913   return 0;
7914 }
7915 _ACEOF
7916 rm -f conftest.$ac_objext conftest$ac_exeext
7917 if { (eval echo "$as_me:7917: \"$ac_link\"") >&5
7918   (eval $ac_link) 2>&5
7919   ac_status=$?
7920   echo "$as_me:7920: \$? = $ac_status" >&5
7921   (exit $ac_status); } &&
7922          { ac_try='test -s conftest$ac_exeext'
7923   { (eval echo "$as_me:7923: \"$ac_try\"") >&5
7924   (eval $ac_try) 2>&5
7925   ac_status=$?
7926   echo "$as_me:7926: \$? = $ac_status" >&5
7927   (exit $ac_status); }; }; then
7928   if test "$cross_compiling" = yes; then
7929   cf_have_ncuconfig=maybe
7930 else
7931   cat >conftest.$ac_ext <<_ACEOF
7932 #line 7932 "configure"
7933 #include "confdefs.h"
7934 #include <${cf_cv_ncurses_header:-curses.h}>
7935                                 int main(void)
7936                                 { char *xx = curses_version(); return (xx == 0); }
7937 _ACEOF
7938 rm -f conftest$ac_exeext
7939 if { (eval echo "$as_me:7939: \"$ac_link\"") >&5
7940   (eval $ac_link) 2>&5
7941   ac_status=$?
7942   echo "$as_me:7942: \$? = $ac_status" >&5
7943   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
7944   { (eval echo "$as_me:7944: \"$ac_try\"") >&5
7945   (eval $ac_try) 2>&5
7946   ac_status=$?
7947   echo "$as_me:7947: \$? = $ac_status" >&5
7948   (exit $ac_status); }; }; then
7949   cf_have_ncuconfig=yes
7950 else
7951   echo "$as_me: program exited with status $ac_status" >&5
7952 echo "$as_me: failed program was:" >&5
7953 cat conftest.$ac_ext >&5
7954 cf_have_ncuconfig=no
7955 fi
7956 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
7957 fi
7958 else
7959   echo "$as_me: failed program was:" >&5
7960 cat conftest.$ac_ext >&5
7961 cf_have_ncuconfig=no
7962 fi
7963 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7964                 echo "$as_me:7964: result: $cf_have_ncuconfig" >&5
7965 echo "${ECHO_T}$cf_have_ncuconfig" >&6
7966                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
7967                 if test "$cf_have_ncuconfig" != "yes"
7968                 then
7969                         CPPFLAGS="$cf_save_CPPFLAGS"
7970                         LIBS="$cf_save_LIBS"
7971                         NCURSES_CONFIG_PKG=none
7972                 else
7973
7974 cat >>confdefs.h <<\EOF
7975 #define NCURSES 1
7976 EOF
7977
7978                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
7979                 fi
7980
7981         else
7982                 echo "$as_me:7982: result: no" >&5
7983 echo "${ECHO_T}no" >&6
7984                 NCURSES_CONFIG_PKG=none
7985         fi
7986 else
7987         NCURSES_CONFIG_PKG=none
7988 fi
7989
7990 if test "x$cf_have_ncuconfig" = "xno"; then
7991         echo "Looking for ${cf_ncuconfig_root}-config"
7992
7993 if test -n "$ac_tool_prefix"; then
7994   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7995   do
7996     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
7997 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
7998 echo "$as_me:7998: checking for $ac_word" >&5
7999 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
8000 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
8001   echo $ECHO_N "(cached) $ECHO_C" >&6
8002 else
8003   if test -n "$NCURSES_CONFIG"; then
8004   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
8005 else
8006   ac_save_IFS=$IFS; IFS=$ac_path_separator
8007 ac_dummy="$PATH"
8008 for ac_dir in $ac_dummy; do
8009   IFS=$ac_save_IFS
8010   test -z "$ac_dir" && ac_dir=.
8011   $as_executable_p "$ac_dir/$ac_word" || continue
8012 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
8013 echo "$as_me:8013: found $ac_dir/$ac_word" >&5
8014 break
8015 done
8016
8017 fi
8018 fi
8019 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
8020 if test -n "$NCURSES_CONFIG"; then
8021   echo "$as_me:8021: result: $NCURSES_CONFIG" >&5
8022 echo "${ECHO_T}$NCURSES_CONFIG" >&6
8023 else
8024   echo "$as_me:8024: result: no" >&5
8025 echo "${ECHO_T}no" >&6
8026 fi
8027
8028     test -n "$NCURSES_CONFIG" && break
8029   done
8030 fi
8031 if test -z "$NCURSES_CONFIG"; then
8032   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
8033   for ac_prog in ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
8034 do
8035   # Extract the first word of "$ac_prog", so it can be a program name with args.
8036 set dummy $ac_prog; ac_word=$2
8037 echo "$as_me:8037: checking for $ac_word" >&5
8038 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
8039 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
8040   echo $ECHO_N "(cached) $ECHO_C" >&6
8041 else
8042   if test -n "$ac_ct_NCURSES_CONFIG"; then
8043   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
8044 else
8045   ac_save_IFS=$IFS; IFS=$ac_path_separator
8046 ac_dummy="$PATH"
8047 for ac_dir in $ac_dummy; do
8048   IFS=$ac_save_IFS
8049   test -z "$ac_dir" && ac_dir=.
8050   $as_executable_p "$ac_dir/$ac_word" || continue
8051 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
8052 echo "$as_me:8052: found $ac_dir/$ac_word" >&5
8053 break
8054 done
8055
8056 fi
8057 fi
8058 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
8059 if test -n "$ac_ct_NCURSES_CONFIG"; then
8060   echo "$as_me:8060: result: $ac_ct_NCURSES_CONFIG" >&5
8061 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
8062 else
8063   echo "$as_me:8063: result: no" >&5
8064 echo "${ECHO_T}no" >&6
8065 fi
8066
8067   test -n "$ac_ct_NCURSES_CONFIG" && break
8068 done
8069 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
8070
8071   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
8072 fi
8073
8074         if test "$NCURSES_CONFIG" != none ; then
8075
8076                 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
8077
8078 cf_add_libs="`$NCURSES_CONFIG --libs`"
8079 # Filter out duplicates - this happens with badly-designed ".pc" files...
8080 for cf_add_1lib in $LIBS
8081 do
8082         for cf_add_2lib in $cf_add_libs
8083         do
8084                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
8085                 then
8086                         cf_add_1lib=
8087                         break
8088                 fi
8089         done
8090         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
8091 done
8092 LIBS="$cf_add_libs"
8093
8094                 # even with config script, some packages use no-override for curses.h
8095
8096 echo "$as_me:8096: checking if we have identified curses headers" >&5
8097 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
8098 if test "${cf_cv_ncurses_header+set}" = set; then
8099   echo $ECHO_N "(cached) $ECHO_C" >&6
8100 else
8101
8102 cf_cv_ncurses_header=none
8103 for cf_header in \
8104         ncurses.h $cf_cv_screen/ncurses.h \
8105         curses.h $cf_cv_screen/curses.h
8106 do
8107 cat >conftest.$ac_ext <<_ACEOF
8108 #line 8108 "configure"
8109 #include "confdefs.h"
8110 #include <${cf_header}>
8111 int
8112 main ()
8113 {
8114 initscr(); tgoto("?", 0,0)
8115   ;
8116   return 0;
8117 }
8118 _ACEOF
8119 rm -f conftest.$ac_objext
8120 if { (eval echo "$as_me:8120: \"$ac_compile\"") >&5
8121   (eval $ac_compile) 2>&5
8122   ac_status=$?
8123   echo "$as_me:8123: \$? = $ac_status" >&5
8124   (exit $ac_status); } &&
8125          { ac_try='test -s conftest.$ac_objext'
8126   { (eval echo "$as_me:8126: \"$ac_try\"") >&5
8127   (eval $ac_try) 2>&5
8128   ac_status=$?
8129   echo "$as_me:8129: \$? = $ac_status" >&5
8130   (exit $ac_status); }; }; then
8131   cf_cv_ncurses_header=$cf_header; break
8132 else
8133   echo "$as_me: failed program was:" >&5
8134 cat conftest.$ac_ext >&5
8135 fi
8136 rm -f conftest.$ac_objext conftest.$ac_ext
8137 done
8138
8139 fi
8140 echo "$as_me:8140: result: $cf_cv_ncurses_header" >&5
8141 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
8142
8143 if test "$cf_cv_ncurses_header" = none ; then
8144         { { echo "$as_me:8144: error: No curses header-files found" >&5
8145 echo "$as_me: error: No curses header-files found" >&2;}
8146    { (exit 1); exit 1; }; }
8147 fi
8148
8149 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
8150
8151 for ac_header in $cf_cv_ncurses_header
8152 do
8153 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
8154 echo "$as_me:8154: checking for $ac_header" >&5
8155 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
8156 if eval "test \"\${$as_ac_Header+set}\" = set"; then
8157   echo $ECHO_N "(cached) $ECHO_C" >&6
8158 else
8159   cat >conftest.$ac_ext <<_ACEOF
8160 #line 8160 "configure"
8161 #include "confdefs.h"
8162 #include <$ac_header>
8163 _ACEOF
8164 if { (eval echo "$as_me:8164: \"$ac_cpp conftest.$ac_ext\"") >&5
8165   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
8166   ac_status=$?
8167   egrep -v '^ *\+' conftest.er1 >conftest.err
8168   rm -f conftest.er1
8169   cat conftest.err >&5
8170   echo "$as_me:8170: \$? = $ac_status" >&5
8171   (exit $ac_status); } >/dev/null; then
8172   if test -s conftest.err; then
8173     ac_cpp_err=$ac_c_preproc_warn_flag
8174   else
8175     ac_cpp_err=
8176   fi
8177 else
8178   ac_cpp_err=yes
8179 fi
8180 if test -z "$ac_cpp_err"; then
8181   eval "$as_ac_Header=yes"
8182 else
8183   echo "$as_me: failed program was:" >&5
8184   cat conftest.$ac_ext >&5
8185   eval "$as_ac_Header=no"
8186 fi
8187 rm -f conftest.err conftest.$ac_ext
8188 fi
8189 echo "$as_me:8189: result: `eval echo '${'$as_ac_Header'}'`" >&5
8190 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
8191 if test `eval echo '${'$as_ac_Header'}'` = yes; then
8192   cat >>confdefs.h <<EOF
8193 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
8194 EOF
8195
8196 fi
8197 done
8198
8199 cat >>confdefs.h <<\EOF
8200 #define NCURSES 1
8201 EOF
8202
8203 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
8204
8205                 cat >>confdefs.h <<EOF
8206 #define $cf_nculib_ROOT 1
8207 EOF
8208
8209                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
8210
8211         else
8212
8213 cf_ncuhdr_root=$cf_cv_screen
8214
8215 test -n "$cf_cv_curses_dir" && \
8216 test "$cf_cv_curses_dir" != "no" && { \
8217
8218 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
8219   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
8220   do
8221         while test $cf_add_incdir != /usr/include
8222         do
8223           if test -d $cf_add_incdir
8224           then
8225                 cf_have_incdir=no
8226                 if test -n "$CFLAGS$CPPFLAGS" ; then
8227                   # a loop is needed to ensure we can add subdirs of existing dirs
8228                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8229                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8230                           cf_have_incdir=yes; break
8231                         fi
8232                   done
8233                 fi
8234
8235                 if test "$cf_have_incdir" = no ; then
8236                   if test "$cf_add_incdir" = /usr/local/include ; then
8237                         if test "$GCC" = yes
8238                         then
8239                           cf_save_CPPFLAGS=$CPPFLAGS
8240                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8241                           cat >conftest.$ac_ext <<_ACEOF
8242 #line 8242 "configure"
8243 #include "confdefs.h"
8244 #include <stdio.h>
8245 int
8246 main ()
8247 {
8248 printf("Hello")
8249   ;
8250   return 0;
8251 }
8252 _ACEOF
8253 rm -f conftest.$ac_objext
8254 if { (eval echo "$as_me:8254: \"$ac_compile\"") >&5
8255   (eval $ac_compile) 2>&5
8256   ac_status=$?
8257   echo "$as_me:8257: \$? = $ac_status" >&5
8258   (exit $ac_status); } &&
8259          { ac_try='test -s conftest.$ac_objext'
8260   { (eval echo "$as_me:8260: \"$ac_try\"") >&5
8261   (eval $ac_try) 2>&5
8262   ac_status=$?
8263   echo "$as_me:8263: \$? = $ac_status" >&5
8264   (exit $ac_status); }; }; then
8265   :
8266 else
8267   echo "$as_me: failed program was:" >&5
8268 cat conftest.$ac_ext >&5
8269 cf_have_incdir=yes
8270 fi
8271 rm -f conftest.$ac_objext conftest.$ac_ext
8272                           CPPFLAGS=$cf_save_CPPFLAGS
8273                         fi
8274                   fi
8275                 fi
8276
8277                 if test "$cf_have_incdir" = no ; then
8278                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8279
8280 echo "${as_me:-configure}:8280: testing adding $cf_add_incdir to include-path ..." 1>&5
8281
8282                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8283
8284                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8285                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8286                   cf_add_incdir="$cf_top_incdir"
8287                 else
8288                   break
8289                 fi
8290           else
8291                 break
8292           fi
8293         done
8294   done
8295 fi
8296
8297 }
8298
8299 echo "$as_me:8299: checking for $cf_ncuhdr_root header in include-path" >&5
8300 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
8301 if test "${cf_cv_ncurses_h+set}" = set; then
8302   echo $ECHO_N "(cached) $ECHO_C" >&6
8303 else
8304
8305         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
8306         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
8307         for cf_header in $cf_header_list
8308         do
8309
8310         cat >conftest.$ac_ext <<_ACEOF
8311 #line 8311 "configure"
8312 #include "confdefs.h"
8313
8314 #include <$cf_header>
8315 int
8316 main ()
8317 {
8318
8319 #ifdef NCURSES_VERSION
8320
8321 printf("%s\n", NCURSES_VERSION);
8322 #else
8323 #ifdef __NCURSES_H
8324 printf("old\n");
8325 #else
8326         make an error
8327 #endif
8328 #endif
8329
8330   ;
8331   return 0;
8332 }
8333 _ACEOF
8334 rm -f conftest.$ac_objext
8335 if { (eval echo "$as_me:8335: \"$ac_compile\"") >&5
8336   (eval $ac_compile) 2>&5
8337   ac_status=$?
8338   echo "$as_me:8338: \$? = $ac_status" >&5
8339   (exit $ac_status); } &&
8340          { ac_try='test -s conftest.$ac_objext'
8341   { (eval echo "$as_me:8341: \"$ac_try\"") >&5
8342   (eval $ac_try) 2>&5
8343   ac_status=$?
8344   echo "$as_me:8344: \$? = $ac_status" >&5
8345   (exit $ac_status); }; }; then
8346   cf_cv_ncurses_h=$cf_header
8347
8348 else
8349   echo "$as_me: failed program was:" >&5
8350 cat conftest.$ac_ext >&5
8351 cf_cv_ncurses_h=no
8352 fi
8353 rm -f conftest.$ac_objext conftest.$ac_ext
8354
8355                 test "$cf_cv_ncurses_h" != no && break
8356         done
8357
8358 fi
8359 echo "$as_me:8359: result: $cf_cv_ncurses_h" >&5
8360 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
8361
8362 if test "$cf_cv_ncurses_h" != no ; then
8363         cf_cv_ncurses_header=$cf_cv_ncurses_h
8364 else
8365
8366 echo "$as_me:8366: checking for $cf_ncuhdr_root include-path" >&5
8367 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
8368 if test "${cf_cv_ncurses_h2+set}" = set; then
8369   echo $ECHO_N "(cached) $ECHO_C" >&6
8370 else
8371
8372         test -n "$verbose" && echo
8373
8374 cf_search=
8375
8376 # collect the current set of include-directories from compiler flags
8377 cf_header_path_list=""
8378 if test -n "${CFLAGS}${CPPFLAGS}" ; then
8379         for cf_header_path in $CPPFLAGS $CFLAGS
8380         do
8381                 case $cf_header_path in
8382                 (-I*)
8383                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
8384
8385 test "x$cf_header_path" != "xNONE" && \
8386 test -d "$cf_header_path" && \
8387  {
8388         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
8389         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
8390         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
8391         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
8392         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
8393         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"
8394 }
8395
8396                         cf_header_path_list="$cf_header_path_list $cf_search"
8397                         ;;
8398                 esac
8399         done
8400 fi
8401
8402 # add the variations for the package we are looking for
8403
8404 cf_search=
8405
8406 test "x$prefix" != "xNONE" && \
8407 test -d "$prefix" && \
8408  {
8409         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
8410         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
8411         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
8412         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
8413         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
8414         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8415 }
8416
8417 for cf_subdir_prefix in \
8418         /usr \
8419         /usr/local \
8420         /usr/pkg \
8421         /opt \
8422         /opt/local \
8423         $HOME
8424 do
8425
8426 test "x$cf_subdir_prefix" != "x$prefix" && \
8427 test -d "$cf_subdir_prefix" && \
8428 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
8429         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
8430         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
8431         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
8432         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
8433         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
8434         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"
8435 }
8436
8437 done
8438
8439 test "$includedir" != NONE && \
8440 test "$includedir" != "/usr/include" && \
8441 test -d "$includedir" && {
8442         test -d $includedir &&    cf_search="$cf_search $includedir"
8443         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
8444 }
8445
8446 test "$oldincludedir" != NONE && \
8447 test "$oldincludedir" != "/usr/include" && \
8448 test -d "$oldincludedir" && {
8449         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
8450         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
8451 }
8452
8453 cf_search="$cf_search $cf_header_path_list"
8454
8455         test -n "$verbose" && echo search path $cf_search
8456         cf_save2_CPPFLAGS="$CPPFLAGS"
8457         for cf_incdir in $cf_search
8458         do
8459
8460 if test -n "$cf_incdir" ; then
8461   for cf_add_incdir in $cf_incdir
8462   do
8463         while test $cf_add_incdir != /usr/include
8464         do
8465           if test -d $cf_add_incdir
8466           then
8467                 cf_have_incdir=no
8468                 if test -n "$CFLAGS$CPPFLAGS" ; then
8469                   # a loop is needed to ensure we can add subdirs of existing dirs
8470                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8471                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8472                           cf_have_incdir=yes; break
8473                         fi
8474                   done
8475                 fi
8476
8477                 if test "$cf_have_incdir" = no ; then
8478                   if test "$cf_add_incdir" = /usr/local/include ; then
8479                         if test "$GCC" = yes
8480                         then
8481                           cf_save_CPPFLAGS=$CPPFLAGS
8482                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8483                           cat >conftest.$ac_ext <<_ACEOF
8484 #line 8484 "configure"
8485 #include "confdefs.h"
8486 #include <stdio.h>
8487 int
8488 main ()
8489 {
8490 printf("Hello")
8491   ;
8492   return 0;
8493 }
8494 _ACEOF
8495 rm -f conftest.$ac_objext
8496 if { (eval echo "$as_me:8496: \"$ac_compile\"") >&5
8497   (eval $ac_compile) 2>&5
8498   ac_status=$?
8499   echo "$as_me:8499: \$? = $ac_status" >&5
8500   (exit $ac_status); } &&
8501          { ac_try='test -s conftest.$ac_objext'
8502   { (eval echo "$as_me:8502: \"$ac_try\"") >&5
8503   (eval $ac_try) 2>&5
8504   ac_status=$?
8505   echo "$as_me:8505: \$? = $ac_status" >&5
8506   (exit $ac_status); }; }; then
8507   :
8508 else
8509   echo "$as_me: failed program was:" >&5
8510 cat conftest.$ac_ext >&5
8511 cf_have_incdir=yes
8512 fi
8513 rm -f conftest.$ac_objext conftest.$ac_ext
8514                           CPPFLAGS=$cf_save_CPPFLAGS
8515                         fi
8516                   fi
8517                 fi
8518
8519                 if test "$cf_have_incdir" = no ; then
8520                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8521
8522 echo "${as_me:-configure}:8522: testing adding $cf_add_incdir to include-path ..." 1>&5
8523
8524                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8525
8526                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8527                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8528                   cf_add_incdir="$cf_top_incdir"
8529                 else
8530                   break
8531                 fi
8532           else
8533                 break
8534           fi
8535         done
8536   done
8537 fi
8538
8539                 for cf_header in \
8540                         ncurses.h \
8541                         curses.h
8542                 do
8543
8544         cat >conftest.$ac_ext <<_ACEOF
8545 #line 8545 "configure"
8546 #include "confdefs.h"
8547
8548 #include <$cf_header>
8549 int
8550 main ()
8551 {
8552
8553 #ifdef NCURSES_VERSION
8554
8555 printf("%s\n", NCURSES_VERSION);
8556 #else
8557 #ifdef __NCURSES_H
8558 printf("old\n");
8559 #else
8560         make an error
8561 #endif
8562 #endif
8563
8564   ;
8565   return 0;
8566 }
8567 _ACEOF
8568 rm -f conftest.$ac_objext
8569 if { (eval echo "$as_me:8569: \"$ac_compile\"") >&5
8570   (eval $ac_compile) 2>&5
8571   ac_status=$?
8572   echo "$as_me:8572: \$? = $ac_status" >&5
8573   (exit $ac_status); } &&
8574          { ac_try='test -s conftest.$ac_objext'
8575   { (eval echo "$as_me:8575: \"$ac_try\"") >&5
8576   (eval $ac_try) 2>&5
8577   ac_status=$?
8578   echo "$as_me:8578: \$? = $ac_status" >&5
8579   (exit $ac_status); }; }; then
8580   cf_cv_ncurses_h2=$cf_header
8581
8582 else
8583   echo "$as_me: failed program was:" >&5
8584 cat conftest.$ac_ext >&5
8585 cf_cv_ncurses_h2=no
8586 fi
8587 rm -f conftest.$ac_objext conftest.$ac_ext
8588
8589                         if test "$cf_cv_ncurses_h2" != no ; then
8590                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
8591                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
8592                                 break
8593                         fi
8594                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
8595                 done
8596                 CPPFLAGS="$cf_save2_CPPFLAGS"
8597                 test "$cf_cv_ncurses_h2" != no && break
8598         done
8599         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:8599: error: not found" >&5
8600 echo "$as_me: error: not found" >&2;}
8601    { (exit 1); exit 1; }; }
8602
8603 fi
8604 echo "$as_me:8604: result: $cf_cv_ncurses_h2" >&5
8605 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
8606
8607         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
8608         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
8609         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
8610                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
8611         fi
8612
8613 if test -n "$cf_1st_incdir" ; then
8614   for cf_add_incdir in $cf_1st_incdir
8615   do
8616         while test $cf_add_incdir != /usr/include
8617         do
8618           if test -d $cf_add_incdir
8619           then
8620                 cf_have_incdir=no
8621                 if test -n "$CFLAGS$CPPFLAGS" ; then
8622                   # a loop is needed to ensure we can add subdirs of existing dirs
8623                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8624                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8625                           cf_have_incdir=yes; break
8626                         fi
8627                   done
8628                 fi
8629
8630                 if test "$cf_have_incdir" = no ; then
8631                   if test "$cf_add_incdir" = /usr/local/include ; then
8632                         if test "$GCC" = yes
8633                         then
8634                           cf_save_CPPFLAGS=$CPPFLAGS
8635                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8636                           cat >conftest.$ac_ext <<_ACEOF
8637 #line 8637 "configure"
8638 #include "confdefs.h"
8639 #include <stdio.h>
8640 int
8641 main ()
8642 {
8643 printf("Hello")
8644   ;
8645   return 0;
8646 }
8647 _ACEOF
8648 rm -f conftest.$ac_objext
8649 if { (eval echo "$as_me:8649: \"$ac_compile\"") >&5
8650   (eval $ac_compile) 2>&5
8651   ac_status=$?
8652   echo "$as_me:8652: \$? = $ac_status" >&5
8653   (exit $ac_status); } &&
8654          { ac_try='test -s conftest.$ac_objext'
8655   { (eval echo "$as_me:8655: \"$ac_try\"") >&5
8656   (eval $ac_try) 2>&5
8657   ac_status=$?
8658   echo "$as_me:8658: \$? = $ac_status" >&5
8659   (exit $ac_status); }; }; then
8660   :
8661 else
8662   echo "$as_me: failed program was:" >&5
8663 cat conftest.$ac_ext >&5
8664 cf_have_incdir=yes
8665 fi
8666 rm -f conftest.$ac_objext conftest.$ac_ext
8667                           CPPFLAGS=$cf_save_CPPFLAGS
8668                         fi
8669                   fi
8670                 fi
8671
8672                 if test "$cf_have_incdir" = no ; then
8673                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8674
8675 echo "${as_me:-configure}:8675: testing adding $cf_add_incdir to include-path ..." 1>&5
8676
8677                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8678
8679                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8680                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8681                   cf_add_incdir="$cf_top_incdir"
8682                 else
8683                   break
8684                 fi
8685           else
8686                 break
8687           fi
8688         done
8689   done
8690 fi
8691
8692 fi
8693
8694 # Set definitions to allow ifdef'ing for ncurses.h
8695
8696 case $cf_cv_ncurses_header in
8697 (*ncurses.h)
8698
8699 cat >>confdefs.h <<\EOF
8700 #define HAVE_NCURSES_H 1
8701 EOF
8702
8703         ;;
8704 esac
8705
8706 case $cf_cv_ncurses_header in
8707 (ncurses/curses.h|ncurses/ncurses.h)
8708
8709 cat >>confdefs.h <<\EOF
8710 #define HAVE_NCURSES_NCURSES_H 1
8711 EOF
8712
8713         ;;
8714 (ncursesw/curses.h|ncursesw/ncurses.h)
8715
8716 cat >>confdefs.h <<\EOF
8717 #define HAVE_NCURSESW_NCURSES_H 1
8718 EOF
8719
8720         ;;
8721 esac
8722
8723 echo "$as_me:8723: checking for terminfo header" >&5
8724 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
8725 if test "${cf_cv_term_header+set}" = set; then
8726   echo $ECHO_N "(cached) $ECHO_C" >&6
8727 else
8728
8729 case ${cf_cv_ncurses_header} in
8730 (*/ncurses.h|*/ncursesw.h)
8731         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
8732         ;;
8733 (*)
8734         cf_term_header=term.h
8735         ;;
8736 esac
8737
8738 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
8739 do
8740 cat >conftest.$ac_ext <<_ACEOF
8741 #line 8741 "configure"
8742 #include "confdefs.h"
8743 #include <stdio.h>
8744 #include <${cf_cv_ncurses_header:-curses.h}>
8745 #include <$cf_test>
8746
8747 int
8748 main ()
8749 {
8750 int x = auto_left_margin
8751   ;
8752   return 0;
8753 }
8754 _ACEOF
8755 rm -f conftest.$ac_objext
8756 if { (eval echo "$as_me:8756: \"$ac_compile\"") >&5
8757   (eval $ac_compile) 2>&5
8758   ac_status=$?
8759   echo "$as_me:8759: \$? = $ac_status" >&5
8760   (exit $ac_status); } &&
8761          { ac_try='test -s conftest.$ac_objext'
8762   { (eval echo "$as_me:8762: \"$ac_try\"") >&5
8763   (eval $ac_try) 2>&5
8764   ac_status=$?
8765   echo "$as_me:8765: \$? = $ac_status" >&5
8766   (exit $ac_status); }; }; then
8767
8768         cf_cv_term_header="$cf_test"
8769 else
8770   echo "$as_me: failed program was:" >&5
8771 cat conftest.$ac_ext >&5
8772
8773         cf_cv_term_header=unknown
8774
8775 fi
8776 rm -f conftest.$ac_objext conftest.$ac_ext
8777         test "$cf_cv_term_header" != unknown && break
8778 done
8779
8780 fi
8781 echo "$as_me:8781: result: $cf_cv_term_header" >&5
8782 echo "${ECHO_T}$cf_cv_term_header" >&6
8783
8784 # Set definitions to allow ifdef'ing to accommodate subdirectories
8785
8786 case $cf_cv_term_header in
8787 (*term.h)
8788
8789 cat >>confdefs.h <<\EOF
8790 #define HAVE_TERM_H 1
8791 EOF
8792
8793         ;;
8794 esac
8795
8796 case $cf_cv_term_header in
8797 (ncurses/term.h)
8798
8799 cat >>confdefs.h <<\EOF
8800 #define HAVE_NCURSES_TERM_H 1
8801 EOF
8802
8803         ;;
8804 (ncursesw/term.h)
8805
8806 cat >>confdefs.h <<\EOF
8807 #define HAVE_NCURSESW_TERM_H 1
8808 EOF
8809
8810         ;;
8811 esac
8812
8813 # some applications need this, but should check for NCURSES_VERSION
8814
8815 cat >>confdefs.h <<\EOF
8816 #define NCURSES 1
8817 EOF
8818
8819 echo "$as_me:8819: checking for ncurses version" >&5
8820 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
8821 if test "${cf_cv_ncurses_version+set}" = set; then
8822   echo $ECHO_N "(cached) $ECHO_C" >&6
8823 else
8824
8825         cf_cv_ncurses_version=no
8826         cf_tempfile=out$$
8827         rm -f $cf_tempfile
8828         if test "$cross_compiling" = yes; then
8829
8830         # This will not work if the preprocessor splits the line after the
8831         # Autoconf token.  The 'unproto' program does that.
8832         cat > conftest.$ac_ext <<EOF
8833 #include <${cf_cv_ncurses_header:-curses.h}>
8834 #undef Autoconf
8835 #ifdef NCURSES_VERSION
8836 Autoconf NCURSES_VERSION
8837 #else
8838 #ifdef __NCURSES_H
8839 Autoconf "old"
8840 #endif
8841 ;
8842 #endif
8843 EOF
8844         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
8845         { (eval echo "$as_me:8845: \"$cf_try\"") >&5
8846   (eval $cf_try) 2>&5
8847   ac_status=$?
8848   echo "$as_me:8848: \$? = $ac_status" >&5
8849   (exit $ac_status); }
8850         if test -f conftest.out ; then
8851                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
8852                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
8853                 rm -f conftest.out
8854         fi
8855
8856 else
8857   cat >conftest.$ac_ext <<_ACEOF
8858 #line 8858 "configure"
8859 #include "confdefs.h"
8860
8861 #include <${cf_cv_ncurses_header:-curses.h}>
8862 #include <stdio.h>
8863 int main()
8864 {
8865         FILE *fp = fopen("$cf_tempfile", "w");
8866 #ifdef NCURSES_VERSION
8867 # ifdef NCURSES_VERSION_PATCH
8868         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
8869 # else
8870         fprintf(fp, "%s\n", NCURSES_VERSION);
8871 # endif
8872 #else
8873 # ifdef __NCURSES_H
8874         fprintf(fp, "old\n");
8875 # else
8876         make an error
8877 # endif
8878 #endif
8879         ${cf_cv_main_return:-return}(0);
8880 }
8881 _ACEOF
8882 rm -f conftest$ac_exeext
8883 if { (eval echo "$as_me:8883: \"$ac_link\"") >&5
8884   (eval $ac_link) 2>&5
8885   ac_status=$?
8886   echo "$as_me:8886: \$? = $ac_status" >&5
8887   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
8888   { (eval echo "$as_me:8888: \"$ac_try\"") >&5
8889   (eval $ac_try) 2>&5
8890   ac_status=$?
8891   echo "$as_me:8891: \$? = $ac_status" >&5
8892   (exit $ac_status); }; }; then
8893
8894         cf_cv_ncurses_version=`cat $cf_tempfile`
8895 else
8896   echo "$as_me: program exited with status $ac_status" >&5
8897 echo "$as_me: failed program was:" >&5
8898 cat conftest.$ac_ext >&5
8899 fi
8900 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
8901 fi
8902         rm -f $cf_tempfile
8903
8904 fi
8905 echo "$as_me:8905: result: $cf_cv_ncurses_version" >&5
8906 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
8907 test "$cf_cv_ncurses_version" = no ||
8908 cat >>confdefs.h <<\EOF
8909 #define NCURSES 1
8910 EOF
8911
8912 cf_nculib_root=$cf_cv_screen
8913         # This works, except for the special case where we find gpm, but
8914         # ncurses is in a nonstandard location via $LIBS, and we really want
8915         # to link gpm.
8916 cf_ncurses_LIBS=""
8917 cf_ncurses_SAVE="$LIBS"
8918 echo "$as_me:8918: checking for Gpm_Open in -lgpm" >&5
8919 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
8920 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
8921   echo $ECHO_N "(cached) $ECHO_C" >&6
8922 else
8923   ac_check_lib_save_LIBS=$LIBS
8924 LIBS="-lgpm  $LIBS"
8925 cat >conftest.$ac_ext <<_ACEOF
8926 #line 8926 "configure"
8927 #include "confdefs.h"
8928
8929 /* Override any gcc2 internal prototype to avoid an error.  */
8930 #ifdef __cplusplus
8931 extern "C"
8932 #endif
8933 /* We use char because int might match the return type of a gcc2
8934    builtin and then its argument prototype would still apply.  */
8935 char Gpm_Open ();
8936 int
8937 main ()
8938 {
8939 Gpm_Open ();
8940   ;
8941   return 0;
8942 }
8943 _ACEOF
8944 rm -f conftest.$ac_objext conftest$ac_exeext
8945 if { (eval echo "$as_me:8945: \"$ac_link\"") >&5
8946   (eval $ac_link) 2>&5
8947   ac_status=$?
8948   echo "$as_me:8948: \$? = $ac_status" >&5
8949   (exit $ac_status); } &&
8950          { ac_try='test -s conftest$ac_exeext'
8951   { (eval echo "$as_me:8951: \"$ac_try\"") >&5
8952   (eval $ac_try) 2>&5
8953   ac_status=$?
8954   echo "$as_me:8954: \$? = $ac_status" >&5
8955   (exit $ac_status); }; }; then
8956   ac_cv_lib_gpm_Gpm_Open=yes
8957 else
8958   echo "$as_me: failed program was:" >&5
8959 cat conftest.$ac_ext >&5
8960 ac_cv_lib_gpm_Gpm_Open=no
8961 fi
8962 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8963 LIBS=$ac_check_lib_save_LIBS
8964 fi
8965 echo "$as_me:8965: result: $ac_cv_lib_gpm_Gpm_Open" >&5
8966 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
8967 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
8968   echo "$as_me:8968: checking for initscr in -lgpm" >&5
8969 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
8970 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
8971   echo $ECHO_N "(cached) $ECHO_C" >&6
8972 else
8973   ac_check_lib_save_LIBS=$LIBS
8974 LIBS="-lgpm  $LIBS"
8975 cat >conftest.$ac_ext <<_ACEOF
8976 #line 8976 "configure"
8977 #include "confdefs.h"
8978
8979 /* Override any gcc2 internal prototype to avoid an error.  */
8980 #ifdef __cplusplus
8981 extern "C"
8982 #endif
8983 /* We use char because int might match the return type of a gcc2
8984    builtin and then its argument prototype would still apply.  */
8985 char initscr ();
8986 int
8987 main ()
8988 {
8989 initscr ();
8990   ;
8991   return 0;
8992 }
8993 _ACEOF
8994 rm -f conftest.$ac_objext conftest$ac_exeext
8995 if { (eval echo "$as_me:8995: \"$ac_link\"") >&5
8996   (eval $ac_link) 2>&5
8997   ac_status=$?
8998   echo "$as_me:8998: \$? = $ac_status" >&5
8999   (exit $ac_status); } &&
9000          { ac_try='test -s conftest$ac_exeext'
9001   { (eval echo "$as_me:9001: \"$ac_try\"") >&5
9002   (eval $ac_try) 2>&5
9003   ac_status=$?
9004   echo "$as_me:9004: \$? = $ac_status" >&5
9005   (exit $ac_status); }; }; then
9006   ac_cv_lib_gpm_initscr=yes
9007 else
9008   echo "$as_me: failed program was:" >&5
9009 cat conftest.$ac_ext >&5
9010 ac_cv_lib_gpm_initscr=no
9011 fi
9012 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9013 LIBS=$ac_check_lib_save_LIBS
9014 fi
9015 echo "$as_me:9015: result: $ac_cv_lib_gpm_initscr" >&5
9016 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
9017 if test $ac_cv_lib_gpm_initscr = yes; then
9018   LIBS="$cf_ncurses_SAVE"
9019 else
9020   cf_ncurses_LIBS="-lgpm"
9021 fi
9022
9023 fi
9024
9025 case $host_os in
9026 (freebsd*)
9027         # This is only necessary if you are linking against an obsolete
9028         # version of ncurses (but it should do no harm, since it's static).
9029         if test "$cf_nculib_root" = ncurses ; then
9030                 echo "$as_me:9030: checking for tgoto in -lmytinfo" >&5
9031 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
9032 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
9033   echo $ECHO_N "(cached) $ECHO_C" >&6
9034 else
9035   ac_check_lib_save_LIBS=$LIBS
9036 LIBS="-lmytinfo  $LIBS"
9037 cat >conftest.$ac_ext <<_ACEOF
9038 #line 9038 "configure"
9039 #include "confdefs.h"
9040
9041 /* Override any gcc2 internal prototype to avoid an error.  */
9042 #ifdef __cplusplus
9043 extern "C"
9044 #endif
9045 /* We use char because int might match the return type of a gcc2
9046    builtin and then its argument prototype would still apply.  */
9047 char tgoto ();
9048 int
9049 main ()
9050 {
9051 tgoto ();
9052   ;
9053   return 0;
9054 }
9055 _ACEOF
9056 rm -f conftest.$ac_objext conftest$ac_exeext
9057 if { (eval echo "$as_me:9057: \"$ac_link\"") >&5
9058   (eval $ac_link) 2>&5
9059   ac_status=$?
9060   echo "$as_me:9060: \$? = $ac_status" >&5
9061   (exit $ac_status); } &&
9062          { ac_try='test -s conftest$ac_exeext'
9063   { (eval echo "$as_me:9063: \"$ac_try\"") >&5
9064   (eval $ac_try) 2>&5
9065   ac_status=$?
9066   echo "$as_me:9066: \$? = $ac_status" >&5
9067   (exit $ac_status); }; }; then
9068   ac_cv_lib_mytinfo_tgoto=yes
9069 else
9070   echo "$as_me: failed program was:" >&5
9071 cat conftest.$ac_ext >&5
9072 ac_cv_lib_mytinfo_tgoto=no
9073 fi
9074 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9075 LIBS=$ac_check_lib_save_LIBS
9076 fi
9077 echo "$as_me:9077: result: $ac_cv_lib_mytinfo_tgoto" >&5
9078 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
9079 if test $ac_cv_lib_mytinfo_tgoto = yes; then
9080   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
9081 fi
9082
9083         fi
9084         ;;
9085 esac
9086
9087 cf_add_libs="$cf_ncurses_LIBS"
9088 # Filter out duplicates - this happens with badly-designed ".pc" files...
9089 for cf_add_1lib in $LIBS
9090 do
9091         for cf_add_2lib in $cf_add_libs
9092         do
9093                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
9094                 then
9095                         cf_add_1lib=
9096                         break
9097                 fi
9098         done
9099         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
9100 done
9101 LIBS="$cf_add_libs"
9102
9103 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
9104 then
9105
9106 cf_add_libs="-l$cf_nculib_root"
9107 # Filter out duplicates - this happens with badly-designed ".pc" files...
9108 for cf_add_1lib in $LIBS
9109 do
9110         for cf_add_2lib in $cf_add_libs
9111         do
9112                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
9113                 then
9114                         cf_add_1lib=
9115                         break
9116                 fi
9117         done
9118         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
9119 done
9120 LIBS="$cf_add_libs"
9121
9122 else
9123
9124         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
9125         cf_libdir=""
9126         echo "$as_me:9126: checking for initscr" >&5
9127 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
9128 if test "${ac_cv_func_initscr+set}" = set; then
9129   echo $ECHO_N "(cached) $ECHO_C" >&6
9130 else
9131   cat >conftest.$ac_ext <<_ACEOF
9132 #line 9132 "configure"
9133 #include "confdefs.h"
9134 /* System header to define __stub macros and hopefully few prototypes,
9135     which can conflict with char initscr (); below.  */
9136 #include <assert.h>
9137 /* Override any gcc2 internal prototype to avoid an error.  */
9138 #ifdef __cplusplus
9139 extern "C"
9140 #endif
9141 /* We use char because int might match the return type of a gcc2
9142    builtin and then its argument prototype would still apply.  */
9143 char initscr ();
9144 char (*f) ();
9145
9146 int
9147 main ()
9148 {
9149 /* The GNU C library defines this for functions which it implements
9150     to always fail with ENOSYS.  Some functions are actually named
9151     something starting with __ and the normal name is an alias.  */
9152 #if defined (__stub_initscr) || defined (__stub___initscr)
9153 choke me
9154 #else
9155 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
9156 #endif
9157
9158   ;
9159   return 0;
9160 }
9161 _ACEOF
9162 rm -f conftest.$ac_objext conftest$ac_exeext
9163 if { (eval echo "$as_me:9163: \"$ac_link\"") >&5
9164   (eval $ac_link) 2>&5
9165   ac_status=$?
9166   echo "$as_me:9166: \$? = $ac_status" >&5
9167   (exit $ac_status); } &&
9168          { ac_try='test -s conftest$ac_exeext'
9169   { (eval echo "$as_me:9169: \"$ac_try\"") >&5
9170   (eval $ac_try) 2>&5
9171   ac_status=$?
9172   echo "$as_me:9172: \$? = $ac_status" >&5
9173   (exit $ac_status); }; }; then
9174   ac_cv_func_initscr=yes
9175 else
9176   echo "$as_me: failed program was:" >&5
9177 cat conftest.$ac_ext >&5
9178 ac_cv_func_initscr=no
9179 fi
9180 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9181 fi
9182 echo "$as_me:9182: result: $ac_cv_func_initscr" >&5
9183 echo "${ECHO_T}$ac_cv_func_initscr" >&6
9184 if test $ac_cv_func_initscr = yes; then
9185   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9186 else
9187
9188                 cf_save_LIBS="$LIBS"
9189                 echo "$as_me:9189: checking for initscr in -l$cf_nculib_root" >&5
9190 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
9191                 LIBS="-l$cf_nculib_root $LIBS"
9192                 cat >conftest.$ac_ext <<_ACEOF
9193 #line 9193 "configure"
9194 #include "confdefs.h"
9195 #include <${cf_cv_ncurses_header:-curses.h}>
9196 int
9197 main ()
9198 {
9199 initscr()
9200   ;
9201   return 0;
9202 }
9203 _ACEOF
9204 rm -f conftest.$ac_objext conftest$ac_exeext
9205 if { (eval echo "$as_me:9205: \"$ac_link\"") >&5
9206   (eval $ac_link) 2>&5
9207   ac_status=$?
9208   echo "$as_me:9208: \$? = $ac_status" >&5
9209   (exit $ac_status); } &&
9210          { ac_try='test -s conftest$ac_exeext'
9211   { (eval echo "$as_me:9211: \"$ac_try\"") >&5
9212   (eval $ac_try) 2>&5
9213   ac_status=$?
9214   echo "$as_me:9214: \$? = $ac_status" >&5
9215   (exit $ac_status); }; }; then
9216   echo "$as_me:9216: result: yes" >&5
9217 echo "${ECHO_T}yes" >&6
9218                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9219
9220 else
9221   echo "$as_me: failed program was:" >&5
9222 cat conftest.$ac_ext >&5
9223 echo "$as_me:9223: result: no" >&5
9224 echo "${ECHO_T}no" >&6
9225
9226 cf_search=
9227 cf_library_path_list=""
9228 if test -n "${LDFLAGS}${LIBS}" ; then
9229         for cf_library_path in $LDFLAGS $LIBS
9230         do
9231                 case $cf_library_path in
9232                 (-L*)
9233                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
9234
9235 test "x$cf_library_path" != "xNONE" && \
9236 test -d "$cf_library_path" && \
9237  {
9238         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
9239         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
9240         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
9241         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
9242         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
9243         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"
9244 }
9245
9246                         cf_library_path_list="$cf_library_path_list $cf_search"
9247                         ;;
9248                 esac
9249         done
9250 fi
9251
9252 cf_search=
9253
9254 test "x$prefix" != "xNONE" && \
9255 test -d "$prefix" && \
9256  {
9257         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
9258         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
9259         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
9260         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
9261         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
9262         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
9263 }
9264
9265 for cf_subdir_prefix in \
9266         /usr \
9267         /usr/local \
9268         /usr/pkg \
9269         /opt \
9270         /opt/local \
9271         $HOME
9272 do
9273
9274 test "x$cf_subdir_prefix" != "x$prefix" && \
9275 test -d "$cf_subdir_prefix" && \
9276 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
9277         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
9278         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
9279         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
9280         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
9281         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
9282         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"
9283 }
9284
9285 done
9286
9287 cf_search="$cf_library_path_list $cf_search"
9288
9289                         for cf_libdir in $cf_search
9290                         do
9291                                 echo "$as_me:9291: checking for -l$cf_nculib_root in $cf_libdir" >&5
9292 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
9293                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
9294                                 cat >conftest.$ac_ext <<_ACEOF
9295 #line 9295 "configure"
9296 #include "confdefs.h"
9297 #include <${cf_cv_ncurses_header:-curses.h}>
9298 int
9299 main ()
9300 {
9301 initscr()
9302   ;
9303   return 0;
9304 }
9305 _ACEOF
9306 rm -f conftest.$ac_objext conftest$ac_exeext
9307 if { (eval echo "$as_me:9307: \"$ac_link\"") >&5
9308   (eval $ac_link) 2>&5
9309   ac_status=$?
9310   echo "$as_me:9310: \$? = $ac_status" >&5
9311   (exit $ac_status); } &&
9312          { ac_try='test -s conftest$ac_exeext'
9313   { (eval echo "$as_me:9313: \"$ac_try\"") >&5
9314   (eval $ac_try) 2>&5
9315   ac_status=$?
9316   echo "$as_me:9316: \$? = $ac_status" >&5
9317   (exit $ac_status); }; }; then
9318   echo "$as_me:9318: result: yes" >&5
9319 echo "${ECHO_T}yes" >&6
9320                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9321                                          break
9322 else
9323   echo "$as_me: failed program was:" >&5
9324 cat conftest.$ac_ext >&5
9325 echo "$as_me:9325: result: no" >&5
9326 echo "${ECHO_T}no" >&6
9327                                          LIBS="$cf_save_LIBS"
9328 fi
9329 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9330                         done
9331
9332 fi
9333 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9334
9335 fi
9336
9337 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
9338
9339 if test $cf_found_library = no ; then
9340         { { echo "$as_me:9340: error: Cannot link $cf_nculib_root library" >&5
9341 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
9342    { (exit 1); exit 1; }; }
9343 fi
9344
9345 fi
9346
9347 if test -n "$cf_ncurses_LIBS" ; then
9348         echo "$as_me:9348: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
9349 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
9350         cf_ncurses_SAVE="$LIBS"
9351         for p in $cf_ncurses_LIBS ; do
9352                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
9353                 if test "$q" != "$LIBS" ; then
9354                         LIBS="$q"
9355                 fi
9356         done
9357         cat >conftest.$ac_ext <<_ACEOF
9358 #line 9358 "configure"
9359 #include "confdefs.h"
9360 #include <${cf_cv_ncurses_header:-curses.h}>
9361 int
9362 main ()
9363 {
9364 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
9365   ;
9366   return 0;
9367 }
9368 _ACEOF
9369 rm -f conftest.$ac_objext conftest$ac_exeext
9370 if { (eval echo "$as_me:9370: \"$ac_link\"") >&5
9371   (eval $ac_link) 2>&5
9372   ac_status=$?
9373   echo "$as_me:9373: \$? = $ac_status" >&5
9374   (exit $ac_status); } &&
9375          { ac_try='test -s conftest$ac_exeext'
9376   { (eval echo "$as_me:9376: \"$ac_try\"") >&5
9377   (eval $ac_try) 2>&5
9378   ac_status=$?
9379   echo "$as_me:9379: \$? = $ac_status" >&5
9380   (exit $ac_status); }; }; then
9381   echo "$as_me:9381: result: yes" >&5
9382 echo "${ECHO_T}yes" >&6
9383 else
9384   echo "$as_me: failed program was:" >&5
9385 cat conftest.$ac_ext >&5
9386 echo "$as_me:9386: result: no" >&5
9387 echo "${ECHO_T}no" >&6
9388                  LIBS="$cf_ncurses_SAVE"
9389 fi
9390 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9391 fi
9392
9393 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9394
9395 cat >>confdefs.h <<EOF
9396 #define $cf_nculib_ROOT 1
9397 EOF
9398
9399         fi
9400 else
9401         NCURSES_CONFIG=none
9402 fi
9403
9404         ;;
9405 (pdcurses)
9406         echo "$as_me:9406: checking for X" >&5
9407 echo $ECHO_N "checking for X... $ECHO_C" >&6
9408
9409 # Check whether --with-x or --without-x was given.
9410 if test "${with_x+set}" = set; then
9411   withval="$with_x"
9412
9413 fi;
9414 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
9415 if test "x$with_x" = xno; then
9416   # The user explicitly disabled X.
9417   have_x=disabled
9418 else
9419   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
9420     # Both variables are already set.
9421     have_x=yes
9422   else
9423     if test "${ac_cv_have_x+set}" = set; then
9424   echo $ECHO_N "(cached) $ECHO_C" >&6
9425 else
9426   # One or both of the vars are not set, and there is no cached value.
9427 ac_x_includes=no ac_x_libraries=no
9428 rm -fr conftest.dir
9429 if mkdir conftest.dir; then
9430   cd conftest.dir
9431   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
9432   cat >Imakefile <<'EOF'
9433 acfindx:
9434         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
9435 EOF
9436   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
9437     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
9438     eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
9439     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
9440     for ac_extension in a so sl dylib dll; do
9441       if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
9442          test -f $ac_im_libdir/libX11.$ac_extension; then
9443         ac_im_usrlibdir=$ac_im_libdir; break
9444       fi
9445     done
9446     # Screen out bogus values from the imake configuration.  They are
9447     # bogus both because they are the default anyway, and because
9448     # using them would break gcc on systems where it needs fixed includes.
9449     case $ac_im_incroot in
9450         /usr/include) ;;
9451         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
9452     esac
9453     case $ac_im_usrlibdir in
9454         /usr/lib | /lib) ;;
9455         *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
9456     esac
9457   fi
9458   cd ..
9459   rm -fr conftest.dir
9460 fi
9461
9462 # Standard set of common directories for X headers.
9463 # Check X11 before X11Rn because it is often a symlink to the current release.
9464 ac_x_header_dirs='
9465 /usr/X11/include
9466 /usr/X11R6/include
9467 /usr/X11R5/include
9468 /usr/X11R4/include
9469
9470 /usr/include/X11
9471 /usr/include/X11R6
9472 /usr/include/X11R5
9473 /usr/include/X11R4
9474
9475 /usr/local/X11/include
9476 /usr/local/X11R6/include
9477 /usr/local/X11R5/include
9478 /usr/local/X11R4/include
9479
9480 /usr/local/include/X11
9481 /usr/local/include/X11R6
9482 /usr/local/include/X11R5
9483 /usr/local/include/X11R4
9484
9485 /usr/X386/include
9486 /usr/x386/include
9487 /usr/XFree86/include/X11
9488
9489 /usr/include
9490 /usr/local/include
9491 /usr/unsupported/include
9492 /usr/athena/include
9493 /usr/local/x11r5/include
9494 /usr/lpp/Xamples/include
9495
9496 /usr/openwin/include
9497 /usr/openwin/share/include'
9498
9499 if test "$ac_x_includes" = no; then
9500   # Guess where to find include files, by looking for Intrinsic.h.
9501   # First, try using that file with no special directory specified.
9502   cat >conftest.$ac_ext <<_ACEOF
9503 #line 9503 "configure"
9504 #include "confdefs.h"
9505 #include <X11/Intrinsic.h>
9506 _ACEOF
9507 if { (eval echo "$as_me:9507: \"$ac_cpp conftest.$ac_ext\"") >&5
9508   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
9509   ac_status=$?
9510   egrep -v '^ *\+' conftest.er1 >conftest.err
9511   rm -f conftest.er1
9512   cat conftest.err >&5
9513   echo "$as_me:9513: \$? = $ac_status" >&5
9514   (exit $ac_status); } >/dev/null; then
9515   if test -s conftest.err; then
9516     ac_cpp_err=$ac_c_preproc_warn_flag
9517   else
9518     ac_cpp_err=
9519   fi
9520 else
9521   ac_cpp_err=yes
9522 fi
9523 if test -z "$ac_cpp_err"; then
9524   # We can compile using X headers with no special include directory.
9525 ac_x_includes=
9526 else
9527   echo "$as_me: failed program was:" >&5
9528   cat conftest.$ac_ext >&5
9529   for ac_dir in $ac_x_header_dirs; do
9530   if test -r "$ac_dir/X11/Intrinsic.h"; then
9531     ac_x_includes=$ac_dir
9532     break
9533   fi
9534 done
9535 fi
9536 rm -f conftest.err conftest.$ac_ext
9537 fi # $ac_x_includes = no
9538
9539 if test "$ac_x_libraries" = no; then
9540   # Check for the libraries.
9541   # See if we find them without any special options.
9542   # Don't add to $LIBS permanently.
9543   ac_save_LIBS=$LIBS
9544   LIBS="-lXt $LIBS"
9545   cat >conftest.$ac_ext <<_ACEOF
9546 #line 9546 "configure"
9547 #include "confdefs.h"
9548 #include <X11/Intrinsic.h>
9549 int
9550 main ()
9551 {
9552 XtMalloc (0)
9553   ;
9554   return 0;
9555 }
9556 _ACEOF
9557 rm -f conftest.$ac_objext conftest$ac_exeext
9558 if { (eval echo "$as_me:9558: \"$ac_link\"") >&5
9559   (eval $ac_link) 2>&5
9560   ac_status=$?
9561   echo "$as_me:9561: \$? = $ac_status" >&5
9562   (exit $ac_status); } &&
9563          { ac_try='test -s conftest$ac_exeext'
9564   { (eval echo "$as_me:9564: \"$ac_try\"") >&5
9565   (eval $ac_try) 2>&5
9566   ac_status=$?
9567   echo "$as_me:9567: \$? = $ac_status" >&5
9568   (exit $ac_status); }; }; then
9569   LIBS=$ac_save_LIBS
9570 # We can link X programs with no special library path.
9571 ac_x_libraries=
9572 else
9573   echo "$as_me: failed program was:" >&5
9574 cat conftest.$ac_ext >&5
9575 LIBS=$ac_save_LIBS
9576 for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
9577 do
9578   # Don't even attempt the hair of trying to link an X program!
9579   for ac_extension in a so sl dylib dll; do
9580     if test -r $ac_dir/libXt.$ac_extension; then
9581       ac_x_libraries=$ac_dir
9582       break 2
9583     fi
9584   done
9585 done
9586 fi
9587 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9588 fi # $ac_x_libraries = no
9589
9590 if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then
9591   # Didn't find X anywhere.  Cache the known absence of X.
9592   ac_cv_have_x="have_x=no"
9593 else
9594   # Record where we found X for the cache.
9595   ac_cv_have_x="have_x=yes \
9596                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
9597 fi
9598 fi
9599
9600   fi
9601   eval "$ac_cv_have_x"
9602 fi # $with_x != no
9603
9604 if test "$have_x" != yes; then
9605   echo "$as_me:9605: result: $have_x" >&5
9606 echo "${ECHO_T}$have_x" >&6
9607   no_x=yes
9608 else
9609   # If each of the values was on the command line, it overrides each guess.
9610   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
9611   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
9612   # Update the cache value to reflect the command line values.
9613   ac_cv_have_x="have_x=yes \
9614                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
9615   echo "$as_me:9615: result: libraries $x_libraries, headers $x_includes" >&5
9616 echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6
9617 fi
9618
9619 if test "$no_x" = yes; then
9620   # Not all programs may use this symbol, but it does not hurt to define it.
9621
9622 cat >>confdefs.h <<\EOF
9623 #define X_DISPLAY_MISSING 1
9624 EOF
9625
9626   X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
9627 else
9628   if test -n "$x_includes"; then
9629     X_CFLAGS="$X_CFLAGS -I$x_includes"
9630   fi
9631
9632   # It would also be nice to do this for all -L options, not just this one.
9633   if test -n "$x_libraries"; then
9634     X_LIBS="$X_LIBS -L$x_libraries"
9635     # For Solaris; some versions of Sun CC require a space after -R and
9636     # others require no space.  Words are not sufficient . . . .
9637     case `(uname -sr) 2>/dev/null` in
9638     "SunOS 5"*)
9639       echo "$as_me:9639: checking whether -R must be followed by a space" >&5
9640 echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6
9641       ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
9642       cat >conftest.$ac_ext <<_ACEOF
9643 #line 9643 "configure"
9644 #include "confdefs.h"
9645
9646 int
9647 main ()
9648 {
9649
9650   ;
9651   return 0;
9652 }
9653 _ACEOF
9654 rm -f conftest.$ac_objext conftest$ac_exeext
9655 if { (eval echo "$as_me:9655: \"$ac_link\"") >&5
9656   (eval $ac_link) 2>&5
9657   ac_status=$?
9658   echo "$as_me:9658: \$? = $ac_status" >&5
9659   (exit $ac_status); } &&
9660          { ac_try='test -s conftest$ac_exeext'
9661   { (eval echo "$as_me:9661: \"$ac_try\"") >&5
9662   (eval $ac_try) 2>&5
9663   ac_status=$?
9664   echo "$as_me:9664: \$? = $ac_status" >&5
9665   (exit $ac_status); }; }; then
9666   ac_R_nospace=yes
9667 else
9668   echo "$as_me: failed program was:" >&5
9669 cat conftest.$ac_ext >&5
9670 ac_R_nospace=no
9671 fi
9672 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9673       if test $ac_R_nospace = yes; then
9674         echo "$as_me:9674: result: no" >&5
9675 echo "${ECHO_T}no" >&6
9676         X_LIBS="$X_LIBS -R$x_libraries"
9677       else
9678         LIBS="$ac_xsave_LIBS -R $x_libraries"
9679         cat >conftest.$ac_ext <<_ACEOF
9680 #line 9680 "configure"
9681 #include "confdefs.h"
9682
9683 int
9684 main ()
9685 {
9686
9687   ;
9688   return 0;
9689 }
9690 _ACEOF
9691 rm -f conftest.$ac_objext conftest$ac_exeext
9692 if { (eval echo "$as_me:9692: \"$ac_link\"") >&5
9693   (eval $ac_link) 2>&5
9694   ac_status=$?
9695   echo "$as_me:9695: \$? = $ac_status" >&5
9696   (exit $ac_status); } &&
9697          { ac_try='test -s conftest$ac_exeext'
9698   { (eval echo "$as_me:9698: \"$ac_try\"") >&5
9699   (eval $ac_try) 2>&5
9700   ac_status=$?
9701   echo "$as_me:9701: \$? = $ac_status" >&5
9702   (exit $ac_status); }; }; then
9703   ac_R_space=yes
9704 else
9705   echo "$as_me: failed program was:" >&5
9706 cat conftest.$ac_ext >&5
9707 ac_R_space=no
9708 fi
9709 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9710         if test $ac_R_space = yes; then
9711           echo "$as_me:9711: result: yes" >&5
9712 echo "${ECHO_T}yes" >&6
9713           X_LIBS="$X_LIBS -R $x_libraries"
9714         else
9715           echo "$as_me:9715: result: neither works" >&5
9716 echo "${ECHO_T}neither works" >&6
9717         fi
9718       fi
9719       LIBS=$ac_xsave_LIBS
9720     esac
9721   fi
9722
9723   # Check for system-dependent libraries X programs must link with.
9724   # Do this before checking for the system-independent R6 libraries
9725   # (-lICE), since we may need -lsocket or whatever for X linking.
9726
9727   if test "$ISC" = yes; then
9728     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
9729   else
9730     # Martyn Johnson says this is needed for Ultrix, if the X
9731     # libraries were built with DECnet support.  And Karl Berry says
9732     # the Alpha needs dnet_stub (dnet does not exist).
9733     ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
9734     cat >conftest.$ac_ext <<_ACEOF
9735 #line 9735 "configure"
9736 #include "confdefs.h"
9737
9738 /* Override any gcc2 internal prototype to avoid an error.  */
9739 #ifdef __cplusplus
9740 extern "C"
9741 #endif
9742 /* We use char because int might match the return type of a gcc2
9743    builtin and then its argument prototype would still apply.  */
9744 char XOpenDisplay ();
9745 int
9746 main ()
9747 {
9748 XOpenDisplay ();
9749   ;
9750   return 0;
9751 }
9752 _ACEOF
9753 rm -f conftest.$ac_objext conftest$ac_exeext
9754 if { (eval echo "$as_me:9754: \"$ac_link\"") >&5
9755   (eval $ac_link) 2>&5
9756   ac_status=$?
9757   echo "$as_me:9757: \$? = $ac_status" >&5
9758   (exit $ac_status); } &&
9759          { ac_try='test -s conftest$ac_exeext'
9760   { (eval echo "$as_me:9760: \"$ac_try\"") >&5
9761   (eval $ac_try) 2>&5
9762   ac_status=$?
9763   echo "$as_me:9763: \$? = $ac_status" >&5
9764   (exit $ac_status); }; }; then
9765   :
9766 else
9767   echo "$as_me: failed program was:" >&5
9768 cat conftest.$ac_ext >&5
9769 echo "$as_me:9769: checking for dnet_ntoa in -ldnet" >&5
9770 echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6
9771 if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then
9772   echo $ECHO_N "(cached) $ECHO_C" >&6
9773 else
9774   ac_check_lib_save_LIBS=$LIBS
9775 LIBS="-ldnet  $LIBS"
9776 cat >conftest.$ac_ext <<_ACEOF
9777 #line 9777 "configure"
9778 #include "confdefs.h"
9779
9780 /* Override any gcc2 internal prototype to avoid an error.  */
9781 #ifdef __cplusplus
9782 extern "C"
9783 #endif
9784 /* We use char because int might match the return type of a gcc2
9785    builtin and then its argument prototype would still apply.  */
9786 char dnet_ntoa ();
9787 int
9788 main ()
9789 {
9790 dnet_ntoa ();
9791   ;
9792   return 0;
9793 }
9794 _ACEOF
9795 rm -f conftest.$ac_objext conftest$ac_exeext
9796 if { (eval echo "$as_me:9796: \"$ac_link\"") >&5
9797   (eval $ac_link) 2>&5
9798   ac_status=$?
9799   echo "$as_me:9799: \$? = $ac_status" >&5
9800   (exit $ac_status); } &&
9801          { ac_try='test -s conftest$ac_exeext'
9802   { (eval echo "$as_me:9802: \"$ac_try\"") >&5
9803   (eval $ac_try) 2>&5
9804   ac_status=$?
9805   echo "$as_me:9805: \$? = $ac_status" >&5
9806   (exit $ac_status); }; }; then
9807   ac_cv_lib_dnet_dnet_ntoa=yes
9808 else
9809   echo "$as_me: failed program was:" >&5
9810 cat conftest.$ac_ext >&5
9811 ac_cv_lib_dnet_dnet_ntoa=no
9812 fi
9813 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9814 LIBS=$ac_check_lib_save_LIBS
9815 fi
9816 echo "$as_me:9816: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
9817 echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6
9818 if test $ac_cv_lib_dnet_dnet_ntoa = yes; then
9819   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
9820 fi
9821
9822     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
9823       echo "$as_me:9823: checking for dnet_ntoa in -ldnet_stub" >&5
9824 echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6
9825 if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then
9826   echo $ECHO_N "(cached) $ECHO_C" >&6
9827 else
9828   ac_check_lib_save_LIBS=$LIBS
9829 LIBS="-ldnet_stub  $LIBS"
9830 cat >conftest.$ac_ext <<_ACEOF
9831 #line 9831 "configure"
9832 #include "confdefs.h"
9833
9834 /* Override any gcc2 internal prototype to avoid an error.  */
9835 #ifdef __cplusplus
9836 extern "C"
9837 #endif
9838 /* We use char because int might match the return type of a gcc2
9839    builtin and then its argument prototype would still apply.  */
9840 char dnet_ntoa ();
9841 int
9842 main ()
9843 {
9844 dnet_ntoa ();
9845   ;
9846   return 0;
9847 }
9848 _ACEOF
9849 rm -f conftest.$ac_objext conftest$ac_exeext
9850 if { (eval echo "$as_me:9850: \"$ac_link\"") >&5
9851   (eval $ac_link) 2>&5
9852   ac_status=$?
9853   echo "$as_me:9853: \$? = $ac_status" >&5
9854   (exit $ac_status); } &&
9855          { ac_try='test -s conftest$ac_exeext'
9856   { (eval echo "$as_me:9856: \"$ac_try\"") >&5
9857   (eval $ac_try) 2>&5
9858   ac_status=$?
9859   echo "$as_me:9859: \$? = $ac_status" >&5
9860   (exit $ac_status); }; }; then
9861   ac_cv_lib_dnet_stub_dnet_ntoa=yes
9862 else
9863   echo "$as_me: failed program was:" >&5
9864 cat conftest.$ac_ext >&5
9865 ac_cv_lib_dnet_stub_dnet_ntoa=no
9866 fi
9867 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9868 LIBS=$ac_check_lib_save_LIBS
9869 fi
9870 echo "$as_me:9870: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
9871 echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6
9872 if test $ac_cv_lib_dnet_stub_dnet_ntoa = yes; then
9873   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
9874 fi
9875
9876     fi
9877 fi
9878 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9879     LIBS="$ac_xsave_LIBS"
9880
9881     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
9882     # to get the SysV transport functions.
9883     # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4)
9884     # needs -lnsl.
9885     # The nsl library prevents programs from opening the X display
9886     # on Irix 5.2, according to T.E. Dickey.
9887     # The functions gethostbyname, getservbyname, and inet_addr are
9888     # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
9889     echo "$as_me:9889: checking for gethostbyname" >&5
9890 echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6
9891 if test "${ac_cv_func_gethostbyname+set}" = set; then
9892   echo $ECHO_N "(cached) $ECHO_C" >&6
9893 else
9894   cat >conftest.$ac_ext <<_ACEOF
9895 #line 9895 "configure"
9896 #include "confdefs.h"
9897 /* System header to define __stub macros and hopefully few prototypes,
9898     which can conflict with char gethostbyname (); below.  */
9899 #include <assert.h>
9900 /* Override any gcc2 internal prototype to avoid an error.  */
9901 #ifdef __cplusplus
9902 extern "C"
9903 #endif
9904 /* We use char because int might match the return type of a gcc2
9905    builtin and then its argument prototype would still apply.  */
9906 char gethostbyname ();
9907 char (*f) ();
9908
9909 int
9910 main ()
9911 {
9912 /* The GNU C library defines this for functions which it implements
9913     to always fail with ENOSYS.  Some functions are actually named
9914     something starting with __ and the normal name is an alias.  */
9915 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
9916 choke me
9917 #else
9918 f = gethostbyname; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
9919 #endif
9920
9921   ;
9922   return 0;
9923 }
9924 _ACEOF
9925 rm -f conftest.$ac_objext conftest$ac_exeext
9926 if { (eval echo "$as_me:9926: \"$ac_link\"") >&5
9927   (eval $ac_link) 2>&5
9928   ac_status=$?
9929   echo "$as_me:9929: \$? = $ac_status" >&5
9930   (exit $ac_status); } &&
9931          { ac_try='test -s conftest$ac_exeext'
9932   { (eval echo "$as_me:9932: \"$ac_try\"") >&5
9933   (eval $ac_try) 2>&5
9934   ac_status=$?
9935   echo "$as_me:9935: \$? = $ac_status" >&5
9936   (exit $ac_status); }; }; then
9937   ac_cv_func_gethostbyname=yes
9938 else
9939   echo "$as_me: failed program was:" >&5
9940 cat conftest.$ac_ext >&5
9941 ac_cv_func_gethostbyname=no
9942 fi
9943 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9944 fi
9945 echo "$as_me:9945: result: $ac_cv_func_gethostbyname" >&5
9946 echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6
9947
9948     if test $ac_cv_func_gethostbyname = no; then
9949       echo "$as_me:9949: checking for gethostbyname in -lnsl" >&5
9950 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6
9951 if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
9952   echo $ECHO_N "(cached) $ECHO_C" >&6
9953 else
9954   ac_check_lib_save_LIBS=$LIBS
9955 LIBS="-lnsl  $LIBS"
9956 cat >conftest.$ac_ext <<_ACEOF
9957 #line 9957 "configure"
9958 #include "confdefs.h"
9959
9960 /* Override any gcc2 internal prototype to avoid an error.  */
9961 #ifdef __cplusplus
9962 extern "C"
9963 #endif
9964 /* We use char because int might match the return type of a gcc2
9965    builtin and then its argument prototype would still apply.  */
9966 char gethostbyname ();
9967 int
9968 main ()
9969 {
9970 gethostbyname ();
9971   ;
9972   return 0;
9973 }
9974 _ACEOF
9975 rm -f conftest.$ac_objext conftest$ac_exeext
9976 if { (eval echo "$as_me:9976: \"$ac_link\"") >&5
9977   (eval $ac_link) 2>&5
9978   ac_status=$?
9979   echo "$as_me:9979: \$? = $ac_status" >&5
9980   (exit $ac_status); } &&
9981          { ac_try='test -s conftest$ac_exeext'
9982   { (eval echo "$as_me:9982: \"$ac_try\"") >&5
9983   (eval $ac_try) 2>&5
9984   ac_status=$?
9985   echo "$as_me:9985: \$? = $ac_status" >&5
9986   (exit $ac_status); }; }; then
9987   ac_cv_lib_nsl_gethostbyname=yes
9988 else
9989   echo "$as_me: failed program was:" >&5
9990 cat conftest.$ac_ext >&5
9991 ac_cv_lib_nsl_gethostbyname=no
9992 fi
9993 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9994 LIBS=$ac_check_lib_save_LIBS
9995 fi
9996 echo "$as_me:9996: result: $ac_cv_lib_nsl_gethostbyname" >&5
9997 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6
9998 if test $ac_cv_lib_nsl_gethostbyname = yes; then
9999   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
10000 fi
10001
10002       if test $ac_cv_lib_nsl_gethostbyname = no; then
10003         echo "$as_me:10003: checking for gethostbyname in -lbsd" >&5
10004 echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6
10005 if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then
10006   echo $ECHO_N "(cached) $ECHO_C" >&6
10007 else
10008   ac_check_lib_save_LIBS=$LIBS
10009 LIBS="-lbsd  $LIBS"
10010 cat >conftest.$ac_ext <<_ACEOF
10011 #line 10011 "configure"
10012 #include "confdefs.h"
10013
10014 /* Override any gcc2 internal prototype to avoid an error.  */
10015 #ifdef __cplusplus
10016 extern "C"
10017 #endif
10018 /* We use char because int might match the return type of a gcc2
10019    builtin and then its argument prototype would still apply.  */
10020 char gethostbyname ();
10021 int
10022 main ()
10023 {
10024 gethostbyname ();
10025   ;
10026   return 0;
10027 }
10028 _ACEOF
10029 rm -f conftest.$ac_objext conftest$ac_exeext
10030 if { (eval echo "$as_me:10030: \"$ac_link\"") >&5
10031   (eval $ac_link) 2>&5
10032   ac_status=$?
10033   echo "$as_me:10033: \$? = $ac_status" >&5
10034   (exit $ac_status); } &&
10035          { ac_try='test -s conftest$ac_exeext'
10036   { (eval echo "$as_me:10036: \"$ac_try\"") >&5
10037   (eval $ac_try) 2>&5
10038   ac_status=$?
10039   echo "$as_me:10039: \$? = $ac_status" >&5
10040   (exit $ac_status); }; }; then
10041   ac_cv_lib_bsd_gethostbyname=yes
10042 else
10043   echo "$as_me: failed program was:" >&5
10044 cat conftest.$ac_ext >&5
10045 ac_cv_lib_bsd_gethostbyname=no
10046 fi
10047 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10048 LIBS=$ac_check_lib_save_LIBS
10049 fi
10050 echo "$as_me:10050: result: $ac_cv_lib_bsd_gethostbyname" >&5
10051 echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6
10052 if test $ac_cv_lib_bsd_gethostbyname = yes; then
10053   X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
10054 fi
10055
10056       fi
10057     fi
10058
10059     # lieder@skyler.mavd.honeywell.com says without -lsocket,
10060     # socket/setsockopt and other routines are undefined under SCO ODT
10061     # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
10062     # on later versions), says Simon Leinen: it contains gethostby*
10063     # variants that don't use the nameserver (or something).  -lsocket
10064     # must be given before -lnsl if both are needed.  We assume that
10065     # if connect needs -lnsl, so does gethostbyname.
10066     echo "$as_me:10066: checking for connect" >&5
10067 echo $ECHO_N "checking for connect... $ECHO_C" >&6
10068 if test "${ac_cv_func_connect+set}" = set; then
10069   echo $ECHO_N "(cached) $ECHO_C" >&6
10070 else
10071   cat >conftest.$ac_ext <<_ACEOF
10072 #line 10072 "configure"
10073 #include "confdefs.h"
10074 /* System header to define __stub macros and hopefully few prototypes,
10075     which can conflict with char connect (); below.  */
10076 #include <assert.h>
10077 /* Override any gcc2 internal prototype to avoid an error.  */
10078 #ifdef __cplusplus
10079 extern "C"
10080 #endif
10081 /* We use char because int might match the return type of a gcc2
10082    builtin and then its argument prototype would still apply.  */
10083 char connect ();
10084 char (*f) ();
10085
10086 int
10087 main ()
10088 {
10089 /* The GNU C library defines this for functions which it implements
10090     to always fail with ENOSYS.  Some functions are actually named
10091     something starting with __ and the normal name is an alias.  */
10092 #if defined (__stub_connect) || defined (__stub___connect)
10093 choke me
10094 #else
10095 f = connect; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
10096 #endif
10097
10098   ;
10099   return 0;
10100 }
10101 _ACEOF
10102 rm -f conftest.$ac_objext conftest$ac_exeext
10103 if { (eval echo "$as_me:10103: \"$ac_link\"") >&5
10104   (eval $ac_link) 2>&5
10105   ac_status=$?
10106   echo "$as_me:10106: \$? = $ac_status" >&5
10107   (exit $ac_status); } &&
10108          { ac_try='test -s conftest$ac_exeext'
10109   { (eval echo "$as_me:10109: \"$ac_try\"") >&5
10110   (eval $ac_try) 2>&5
10111   ac_status=$?
10112   echo "$as_me:10112: \$? = $ac_status" >&5
10113   (exit $ac_status); }; }; then
10114   ac_cv_func_connect=yes
10115 else
10116   echo "$as_me: failed program was:" >&5
10117 cat conftest.$ac_ext >&5
10118 ac_cv_func_connect=no
10119 fi
10120 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10121 fi
10122 echo "$as_me:10122: result: $ac_cv_func_connect" >&5
10123 echo "${ECHO_T}$ac_cv_func_connect" >&6
10124
10125     if test $ac_cv_func_connect = no; then
10126       echo "$as_me:10126: checking for connect in -lsocket" >&5
10127 echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6
10128 if test "${ac_cv_lib_socket_connect+set}" = set; then
10129   echo $ECHO_N "(cached) $ECHO_C" >&6
10130 else
10131   ac_check_lib_save_LIBS=$LIBS
10132 LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
10133 cat >conftest.$ac_ext <<_ACEOF
10134 #line 10134 "configure"
10135 #include "confdefs.h"
10136
10137 /* Override any gcc2 internal prototype to avoid an error.  */
10138 #ifdef __cplusplus
10139 extern "C"
10140 #endif
10141 /* We use char because int might match the return type of a gcc2
10142    builtin and then its argument prototype would still apply.  */
10143 char connect ();
10144 int
10145 main ()
10146 {
10147 connect ();
10148   ;
10149   return 0;
10150 }
10151 _ACEOF
10152 rm -f conftest.$ac_objext conftest$ac_exeext
10153 if { (eval echo "$as_me:10153: \"$ac_link\"") >&5
10154   (eval $ac_link) 2>&5
10155   ac_status=$?
10156   echo "$as_me:10156: \$? = $ac_status" >&5
10157   (exit $ac_status); } &&
10158          { ac_try='test -s conftest$ac_exeext'
10159   { (eval echo "$as_me:10159: \"$ac_try\"") >&5
10160   (eval $ac_try) 2>&5
10161   ac_status=$?
10162   echo "$as_me:10162: \$? = $ac_status" >&5
10163   (exit $ac_status); }; }; then
10164   ac_cv_lib_socket_connect=yes
10165 else
10166   echo "$as_me: failed program was:" >&5
10167 cat conftest.$ac_ext >&5
10168 ac_cv_lib_socket_connect=no
10169 fi
10170 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10171 LIBS=$ac_check_lib_save_LIBS
10172 fi
10173 echo "$as_me:10173: result: $ac_cv_lib_socket_connect" >&5
10174 echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6
10175 if test $ac_cv_lib_socket_connect = yes; then
10176   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
10177 fi
10178
10179     fi
10180
10181     # Guillermo Gomez says -lposix is necessary on A/UX.
10182     echo "$as_me:10182: checking for remove" >&5
10183 echo $ECHO_N "checking for remove... $ECHO_C" >&6
10184 if test "${ac_cv_func_remove+set}" = set; then
10185   echo $ECHO_N "(cached) $ECHO_C" >&6
10186 else
10187   cat >conftest.$ac_ext <<_ACEOF
10188 #line 10188 "configure"
10189 #include "confdefs.h"
10190 /* System header to define __stub macros and hopefully few prototypes,
10191     which can conflict with char remove (); below.  */
10192 #include <assert.h>
10193 /* Override any gcc2 internal prototype to avoid an error.  */
10194 #ifdef __cplusplus
10195 extern "C"
10196 #endif
10197 /* We use char because int might match the return type of a gcc2
10198    builtin and then its argument prototype would still apply.  */
10199 char remove ();
10200 char (*f) ();
10201
10202 int
10203 main ()
10204 {
10205 /* The GNU C library defines this for functions which it implements
10206     to always fail with ENOSYS.  Some functions are actually named
10207     something starting with __ and the normal name is an alias.  */
10208 #if defined (__stub_remove) || defined (__stub___remove)
10209 choke me
10210 #else
10211 f = remove; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
10212 #endif
10213
10214   ;
10215   return 0;
10216 }
10217 _ACEOF
10218 rm -f conftest.$ac_objext conftest$ac_exeext
10219 if { (eval echo "$as_me:10219: \"$ac_link\"") >&5
10220   (eval $ac_link) 2>&5
10221   ac_status=$?
10222   echo "$as_me:10222: \$? = $ac_status" >&5
10223   (exit $ac_status); } &&
10224          { ac_try='test -s conftest$ac_exeext'
10225   { (eval echo "$as_me:10225: \"$ac_try\"") >&5
10226   (eval $ac_try) 2>&5
10227   ac_status=$?
10228   echo "$as_me:10228: \$? = $ac_status" >&5
10229   (exit $ac_status); }; }; then
10230   ac_cv_func_remove=yes
10231 else
10232   echo "$as_me: failed program was:" >&5
10233 cat conftest.$ac_ext >&5
10234 ac_cv_func_remove=no
10235 fi
10236 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10237 fi
10238 echo "$as_me:10238: result: $ac_cv_func_remove" >&5
10239 echo "${ECHO_T}$ac_cv_func_remove" >&6
10240
10241     if test $ac_cv_func_remove = no; then
10242       echo "$as_me:10242: checking for remove in -lposix" >&5
10243 echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6
10244 if test "${ac_cv_lib_posix_remove+set}" = set; then
10245   echo $ECHO_N "(cached) $ECHO_C" >&6
10246 else
10247   ac_check_lib_save_LIBS=$LIBS
10248 LIBS="-lposix  $LIBS"
10249 cat >conftest.$ac_ext <<_ACEOF
10250 #line 10250 "configure"
10251 #include "confdefs.h"
10252
10253 /* Override any gcc2 internal prototype to avoid an error.  */
10254 #ifdef __cplusplus
10255 extern "C"
10256 #endif
10257 /* We use char because int might match the return type of a gcc2
10258    builtin and then its argument prototype would still apply.  */
10259 char remove ();
10260 int
10261 main ()
10262 {
10263 remove ();
10264   ;
10265   return 0;
10266 }
10267 _ACEOF
10268 rm -f conftest.$ac_objext conftest$ac_exeext
10269 if { (eval echo "$as_me:10269: \"$ac_link\"") >&5
10270   (eval $ac_link) 2>&5
10271   ac_status=$?
10272   echo "$as_me:10272: \$? = $ac_status" >&5
10273   (exit $ac_status); } &&
10274          { ac_try='test -s conftest$ac_exeext'
10275   { (eval echo "$as_me:10275: \"$ac_try\"") >&5
10276   (eval $ac_try) 2>&5
10277   ac_status=$?
10278   echo "$as_me:10278: \$? = $ac_status" >&5
10279   (exit $ac_status); }; }; then
10280   ac_cv_lib_posix_remove=yes
10281 else
10282   echo "$as_me: failed program was:" >&5
10283 cat conftest.$ac_ext >&5
10284 ac_cv_lib_posix_remove=no
10285 fi
10286 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10287 LIBS=$ac_check_lib_save_LIBS
10288 fi
10289 echo "$as_me:10289: result: $ac_cv_lib_posix_remove" >&5
10290 echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6
10291 if test $ac_cv_lib_posix_remove = yes; then
10292   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
10293 fi
10294
10295     fi
10296
10297     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
10298     echo "$as_me:10298: checking for shmat" >&5
10299 echo $ECHO_N "checking for shmat... $ECHO_C" >&6
10300 if test "${ac_cv_func_shmat+set}" = set; then
10301   echo $ECHO_N "(cached) $ECHO_C" >&6
10302 else
10303   cat >conftest.$ac_ext <<_ACEOF
10304 #line 10304 "configure"
10305 #include "confdefs.h"
10306 /* System header to define __stub macros and hopefully few prototypes,
10307     which can conflict with char shmat (); below.  */
10308 #include <assert.h>
10309 /* Override any gcc2 internal prototype to avoid an error.  */
10310 #ifdef __cplusplus
10311 extern "C"
10312 #endif
10313 /* We use char because int might match the return type of a gcc2
10314    builtin and then its argument prototype would still apply.  */
10315 char shmat ();
10316 char (*f) ();
10317
10318 int
10319 main ()
10320 {
10321 /* The GNU C library defines this for functions which it implements
10322     to always fail with ENOSYS.  Some functions are actually named
10323     something starting with __ and the normal name is an alias.  */
10324 #if defined (__stub_shmat) || defined (__stub___shmat)
10325 choke me
10326 #else
10327 f = shmat; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
10328 #endif
10329
10330   ;
10331   return 0;
10332 }
10333 _ACEOF
10334 rm -f conftest.$ac_objext conftest$ac_exeext
10335 if { (eval echo "$as_me:10335: \"$ac_link\"") >&5
10336   (eval $ac_link) 2>&5
10337   ac_status=$?
10338   echo "$as_me:10338: \$? = $ac_status" >&5
10339   (exit $ac_status); } &&
10340          { ac_try='test -s conftest$ac_exeext'
10341   { (eval echo "$as_me:10341: \"$ac_try\"") >&5
10342   (eval $ac_try) 2>&5
10343   ac_status=$?
10344   echo "$as_me:10344: \$? = $ac_status" >&5
10345   (exit $ac_status); }; }; then
10346   ac_cv_func_shmat=yes
10347 else
10348   echo "$as_me: failed program was:" >&5
10349 cat conftest.$ac_ext >&5
10350 ac_cv_func_shmat=no
10351 fi
10352 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10353 fi
10354 echo "$as_me:10354: result: $ac_cv_func_shmat" >&5
10355 echo "${ECHO_T}$ac_cv_func_shmat" >&6
10356
10357     if test $ac_cv_func_shmat = no; then
10358       echo "$as_me:10358: checking for shmat in -lipc" >&5
10359 echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6
10360 if test "${ac_cv_lib_ipc_shmat+set}" = set; then
10361   echo $ECHO_N "(cached) $ECHO_C" >&6
10362 else
10363   ac_check_lib_save_LIBS=$LIBS
10364 LIBS="-lipc  $LIBS"
10365 cat >conftest.$ac_ext <<_ACEOF
10366 #line 10366 "configure"
10367 #include "confdefs.h"
10368
10369 /* Override any gcc2 internal prototype to avoid an error.  */
10370 #ifdef __cplusplus
10371 extern "C"
10372 #endif
10373 /* We use char because int might match the return type of a gcc2
10374    builtin and then its argument prototype would still apply.  */
10375 char shmat ();
10376 int
10377 main ()
10378 {
10379 shmat ();
10380   ;
10381   return 0;
10382 }
10383 _ACEOF
10384 rm -f conftest.$ac_objext conftest$ac_exeext
10385 if { (eval echo "$as_me:10385: \"$ac_link\"") >&5
10386   (eval $ac_link) 2>&5
10387   ac_status=$?
10388   echo "$as_me:10388: \$? = $ac_status" >&5
10389   (exit $ac_status); } &&
10390          { ac_try='test -s conftest$ac_exeext'
10391   { (eval echo "$as_me:10391: \"$ac_try\"") >&5
10392   (eval $ac_try) 2>&5
10393   ac_status=$?
10394   echo "$as_me:10394: \$? = $ac_status" >&5
10395   (exit $ac_status); }; }; then
10396   ac_cv_lib_ipc_shmat=yes
10397 else
10398   echo "$as_me: failed program was:" >&5
10399 cat conftest.$ac_ext >&5
10400 ac_cv_lib_ipc_shmat=no
10401 fi
10402 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10403 LIBS=$ac_check_lib_save_LIBS
10404 fi
10405 echo "$as_me:10405: result: $ac_cv_lib_ipc_shmat" >&5
10406 echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6
10407 if test $ac_cv_lib_ipc_shmat = yes; then
10408   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
10409 fi
10410
10411     fi
10412   fi
10413
10414   # Check for libraries that X11R6 Xt/Xaw programs need.
10415   ac_save_LDFLAGS=$LDFLAGS
10416   test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
10417   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
10418   # check for ICE first), but we must link in the order -lSM -lICE or
10419   # we get undefined symbols.  So assume we have SM if we have ICE.
10420   # These have to be linked with before -lX11, unlike the other
10421   # libraries we check for below, so use a different variable.
10422   # John Interrante, Karl Berry
10423   echo "$as_me:10423: checking for IceConnectionNumber in -lICE" >&5
10424 echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6
10425 if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then
10426   echo $ECHO_N "(cached) $ECHO_C" >&6
10427 else
10428   ac_check_lib_save_LIBS=$LIBS
10429 LIBS="-lICE $X_EXTRA_LIBS $LIBS"
10430 cat >conftest.$ac_ext <<_ACEOF
10431 #line 10431 "configure"
10432 #include "confdefs.h"
10433
10434 /* Override any gcc2 internal prototype to avoid an error.  */
10435 #ifdef __cplusplus
10436 extern "C"
10437 #endif
10438 /* We use char because int might match the return type of a gcc2
10439    builtin and then its argument prototype would still apply.  */
10440 char IceConnectionNumber ();
10441 int
10442 main ()
10443 {
10444 IceConnectionNumber ();
10445   ;
10446   return 0;
10447 }
10448 _ACEOF
10449 rm -f conftest.$ac_objext conftest$ac_exeext
10450 if { (eval echo "$as_me:10450: \"$ac_link\"") >&5
10451   (eval $ac_link) 2>&5
10452   ac_status=$?
10453   echo "$as_me:10453: \$? = $ac_status" >&5
10454   (exit $ac_status); } &&
10455          { ac_try='test -s conftest$ac_exeext'
10456   { (eval echo "$as_me:10456: \"$ac_try\"") >&5
10457   (eval $ac_try) 2>&5
10458   ac_status=$?
10459   echo "$as_me:10459: \$? = $ac_status" >&5
10460   (exit $ac_status); }; }; then
10461   ac_cv_lib_ICE_IceConnectionNumber=yes
10462 else
10463   echo "$as_me: failed program was:" >&5
10464 cat conftest.$ac_ext >&5
10465 ac_cv_lib_ICE_IceConnectionNumber=no
10466 fi
10467 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10468 LIBS=$ac_check_lib_save_LIBS
10469 fi
10470 echo "$as_me:10470: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
10471 echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6
10472 if test $ac_cv_lib_ICE_IceConnectionNumber = yes; then
10473   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
10474 fi
10475
10476   LDFLAGS=$ac_save_LDFLAGS
10477
10478 fi
10479
10480 cf_x_athena=${cf_x_athena:-Xaw}
10481
10482 echo "$as_me:10482: checking if you want to link with Xaw 3d library" >&5
10483 echo $ECHO_N "checking if you want to link with Xaw 3d library... $ECHO_C" >&6
10484 withval=
10485
10486 # Check whether --with-Xaw3d or --without-Xaw3d was given.
10487 if test "${with_Xaw3d+set}" = set; then
10488   withval="$with_Xaw3d"
10489
10490 fi;
10491 if test "$withval" = yes ; then
10492         cf_x_athena=Xaw3d
10493         echo "$as_me:10493: result: yes" >&5
10494 echo "${ECHO_T}yes" >&6
10495 else
10496         echo "$as_me:10496: result: no" >&5
10497 echo "${ECHO_T}no" >&6
10498 fi
10499
10500 echo "$as_me:10500: checking if you want to link with Xaw 3d xft library" >&5
10501 echo $ECHO_N "checking if you want to link with Xaw 3d xft library... $ECHO_C" >&6
10502 withval=
10503
10504 # Check whether --with-Xaw3dxft or --without-Xaw3dxft was given.
10505 if test "${with_Xaw3dxft+set}" = set; then
10506   withval="$with_Xaw3dxft"
10507
10508 fi;
10509 if test "$withval" = yes ; then
10510         cf_x_athena=Xaw3dxft
10511         echo "$as_me:10511: result: yes" >&5
10512 echo "${ECHO_T}yes" >&6
10513 else
10514         echo "$as_me:10514: result: no" >&5
10515 echo "${ECHO_T}no" >&6
10516 fi
10517
10518 echo "$as_me:10518: checking if you want to link with neXT Athena library" >&5
10519 echo $ECHO_N "checking if you want to link with neXT Athena library... $ECHO_C" >&6
10520 withval=
10521
10522 # Check whether --with-neXtaw or --without-neXtaw was given.
10523 if test "${with_neXtaw+set}" = set; then
10524   withval="$with_neXtaw"
10525
10526 fi;
10527 if test "$withval" = yes ; then
10528         cf_x_athena=neXtaw
10529         echo "$as_me:10529: result: yes" >&5
10530 echo "${ECHO_T}yes" >&6
10531 else
10532         echo "$as_me:10532: result: no" >&5
10533 echo "${ECHO_T}no" >&6
10534 fi
10535
10536 echo "$as_me:10536: checking if you want to link with Athena-Plus library" >&5
10537 echo $ECHO_N "checking if you want to link with Athena-Plus library... $ECHO_C" >&6
10538 withval=
10539
10540 # Check whether --with-XawPlus or --without-XawPlus was given.
10541 if test "${with_XawPlus+set}" = set; then
10542   withval="$with_XawPlus"
10543
10544 fi;
10545 if test "$withval" = yes ; then
10546         cf_x_athena=XawPlus
10547         echo "$as_me:10547: result: yes" >&5
10548 echo "${ECHO_T}yes" >&6
10549 else
10550         echo "$as_me:10550: result: no" >&5
10551 echo "${ECHO_T}no" >&6
10552 fi
10553
10554 cf_x_athena_lib=""
10555
10556 if test "$PKG_CONFIG" != none ; then
10557         cf_athena_list=
10558         test "$cf_x_athena" = Xaw && cf_athena_list="xaw8 xaw7 xaw6"
10559         for cf_athena_pkg in \
10560                 $cf_athena_list \
10561                 ${cf_x_athena} \
10562                 ${cf_x_athena}-devel \
10563                 lib${cf_x_athena} \
10564                 lib${cf_x_athena}-devel
10565         do
10566
10567 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists $cf_athena_pkg; then
10568         test -n "$verbose" && echo "    found package $cf_athena_pkg" 1>&6
10569
10570 echo "${as_me:-configure}:10570: testing found package $cf_athena_pkg ..." 1>&5
10571
10572         cf_pkgconfig_incs="`$PKG_CONFIG --cflags $cf_athena_pkg 2>/dev/null`"
10573         cf_pkgconfig_libs="`$PKG_CONFIG --libs   $cf_athena_pkg 2>/dev/null`"
10574         test -n "$verbose" && echo "    package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs" 1>&6
10575
10576 echo "${as_me:-configure}:10576: testing package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs ..." 1>&5
10577
10578         test -n "$verbose" && echo "    package $cf_athena_pkg LIBS: $cf_pkgconfig_libs" 1>&6
10579
10580 echo "${as_me:-configure}:10580: testing package $cf_athena_pkg LIBS: $cf_pkgconfig_libs ..." 1>&5
10581
10582 cf_fix_cppflags=no
10583 cf_new_cflags=
10584 cf_new_cppflags=
10585 cf_new_extra_cppflags=
10586
10587 for cf_add_cflags in $cf_pkgconfig_incs
10588 do
10589 case $cf_fix_cppflags in
10590 (no)
10591         case $cf_add_cflags in
10592         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10593                 case $cf_add_cflags in
10594                 (-D*)
10595                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10596
10597                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10598                                 && test -z "${cf_tst_cflags}" \
10599                                 && cf_fix_cppflags=yes
10600
10601                         if test $cf_fix_cppflags = yes ; then
10602                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10603                                 continue
10604                         elif test "${cf_tst_cflags}" = "\"'" ; then
10605                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10606                                 continue
10607                         fi
10608                         ;;
10609                 esac
10610                 case "$CPPFLAGS" in
10611                 (*$cf_add_cflags)
10612                         ;;
10613                 (*)
10614                         case $cf_add_cflags in
10615                         (-D*)
10616                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10617
10618 CPPFLAGS=`echo "$CPPFLAGS" | \
10619         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10620                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10621
10622                                 ;;
10623                         esac
10624                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10625                         ;;
10626                 esac
10627                 ;;
10628         (*)
10629                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10630                 ;;
10631         esac
10632         ;;
10633 (yes)
10634         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10635
10636         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10637
10638         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10639                 && test -z "${cf_tst_cflags}" \
10640                 && cf_fix_cppflags=no
10641         ;;
10642 esac
10643 done
10644
10645 if test -n "$cf_new_cflags" ; then
10646
10647         CFLAGS="$CFLAGS $cf_new_cflags"
10648 fi
10649
10650 if test -n "$cf_new_cppflags" ; then
10651
10652         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10653 fi
10654
10655 if test -n "$cf_new_extra_cppflags" ; then
10656
10657         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10658 fi
10659
10660 cf_add_libs="$cf_pkgconfig_libs"
10661 # Filter out duplicates - this happens with badly-designed ".pc" files...
10662 for cf_add_1lib in $LIBS
10663 do
10664         for cf_add_2lib in $cf_add_libs
10665         do
10666                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
10667                 then
10668                         cf_add_1lib=
10669                         break
10670                 fi
10671         done
10672         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
10673 done
10674 LIBS="$cf_add_libs"
10675
10676                         cf_x_athena_lib="$cf_pkgconfig_libs"
10677
10678 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
10679
10680                         cat >>confdefs.h <<EOF
10681 #define $cf_x_athena_LIBS 1
10682 EOF
10683
10684         for cf_trim_lib in Xmu Xt X11
10685         do
10686                 case "$LIBS" in
10687                 (*-l$cf_trim_lib\ *-l$cf_trim_lib*)
10688                         LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
10689                         test -n "$verbose" && echo "    ..trimmed $LIBS" 1>&6
10690
10691 echo "${as_me:-configure}:10691: testing ..trimmed $LIBS ..." 1>&5
10692
10693                         ;;
10694                 esac
10695         done
10696
10697 echo "$as_me:10697: checking for usable $cf_x_athena/Xmu package" >&5
10698 echo $ECHO_N "checking for usable $cf_x_athena/Xmu package... $ECHO_C" >&6
10699 if test "${cf_cv_xaw_compat+set}" = set; then
10700   echo $ECHO_N "(cached) $ECHO_C" >&6
10701 else
10702
10703 cat >conftest.$ac_ext <<_ACEOF
10704 #line 10704 "configure"
10705 #include "confdefs.h"
10706
10707 #include <X11/Xmu/CharSet.h>
10708
10709 int
10710 main ()
10711 {
10712
10713 int check = XmuCompareISOLatin1("big", "small")
10714
10715   ;
10716   return 0;
10717 }
10718 _ACEOF
10719 rm -f conftest.$ac_objext conftest$ac_exeext
10720 if { (eval echo "$as_me:10720: \"$ac_link\"") >&5
10721   (eval $ac_link) 2>&5
10722   ac_status=$?
10723   echo "$as_me:10723: \$? = $ac_status" >&5
10724   (exit $ac_status); } &&
10725          { ac_try='test -s conftest$ac_exeext'
10726   { (eval echo "$as_me:10726: \"$ac_try\"") >&5
10727   (eval $ac_try) 2>&5
10728   ac_status=$?
10729   echo "$as_me:10729: \$? = $ac_status" >&5
10730   (exit $ac_status); }; }; then
10731   cf_cv_xaw_compat=yes
10732 else
10733   echo "$as_me: failed program was:" >&5
10734 cat conftest.$ac_ext >&5
10735 cf_cv_xaw_compat=no
10736 fi
10737 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10738 fi
10739 echo "$as_me:10739: result: $cf_cv_xaw_compat" >&5
10740 echo "${ECHO_T}$cf_cv_xaw_compat" >&6
10741
10742                         if test "$cf_cv_xaw_compat" = no
10743                         then
10744                                 # workaround for broken ".pc" files...
10745                                 case "$cf_x_athena_lib" in
10746                                 (*-lXmu*)
10747                                         ;;
10748                                 (*)
10749                                         test -n "$verbose" && echo "    work around broken package" 1>&6
10750
10751 echo "${as_me:-configure}:10751: testing work around broken package ..." 1>&5
10752
10753                                         cf_save_xmu="$LIBS"
10754                                         cf_first_lib=`echo "$cf_save_xmu" | sed -e 's/^  *//' -e 's/ .*//'`
10755
10756 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xmu; then
10757         test -n "$verbose" && echo "    found package xmu" 1>&6
10758
10759 echo "${as_me:-configure}:10759: testing found package xmu ..." 1>&5
10760
10761         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xmu 2>/dev/null`"
10762         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xmu 2>/dev/null`"
10763         test -n "$verbose" && echo "    package xmu CFLAGS: $cf_pkgconfig_incs" 1>&6
10764
10765 echo "${as_me:-configure}:10765: testing package xmu CFLAGS: $cf_pkgconfig_incs ..." 1>&5
10766
10767         test -n "$verbose" && echo "    package xmu LIBS: $cf_pkgconfig_libs" 1>&6
10768
10769 echo "${as_me:-configure}:10769: testing package xmu LIBS: $cf_pkgconfig_libs ..." 1>&5
10770
10771 cf_fix_cppflags=no
10772 cf_new_cflags=
10773 cf_new_cppflags=
10774 cf_new_extra_cppflags=
10775
10776 for cf_add_cflags in $cf_pkgconfig_incs
10777 do
10778 case $cf_fix_cppflags in
10779 (no)
10780         case $cf_add_cflags in
10781         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10782                 case $cf_add_cflags in
10783                 (-D*)
10784                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10785
10786                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10787                                 && test -z "${cf_tst_cflags}" \
10788                                 && cf_fix_cppflags=yes
10789
10790                         if test $cf_fix_cppflags = yes ; then
10791                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10792                                 continue
10793                         elif test "${cf_tst_cflags}" = "\"'" ; then
10794                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10795                                 continue
10796                         fi
10797                         ;;
10798                 esac
10799                 case "$CPPFLAGS" in
10800                 (*$cf_add_cflags)
10801                         ;;
10802                 (*)
10803                         case $cf_add_cflags in
10804                         (-D*)
10805                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10806
10807 CPPFLAGS=`echo "$CPPFLAGS" | \
10808         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10809                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10810
10811                                 ;;
10812                         esac
10813                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10814                         ;;
10815                 esac
10816                 ;;
10817         (*)
10818                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10819                 ;;
10820         esac
10821         ;;
10822 (yes)
10823         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10824
10825         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10826
10827         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10828                 && test -z "${cf_tst_cflags}" \
10829                 && cf_fix_cppflags=no
10830         ;;
10831 esac
10832 done
10833
10834 if test -n "$cf_new_cflags" ; then
10835
10836         CFLAGS="$CFLAGS $cf_new_cflags"
10837 fi
10838
10839 if test -n "$cf_new_cppflags" ; then
10840
10841         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
10842 fi
10843
10844 if test -n "$cf_new_extra_cppflags" ; then
10845
10846         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
10847 fi
10848
10849 cf_add_libs="$cf_pkgconfig_libs"
10850 # Filter out duplicates - this happens with badly-designed ".pc" files...
10851 for cf_add_1lib in $LIBS
10852 do
10853         for cf_add_2lib in $cf_add_libs
10854         do
10855                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
10856                 then
10857                         cf_add_1lib=
10858                         break
10859                 fi
10860         done
10861         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
10862 done
10863 LIBS="$cf_add_libs"
10864
10865                                                         LIBS="$cf_save_xmu"
10866
10867 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
10868
10869 echo "${as_me:-configure}:10869: testing ...before $LIBS ..." 1>&5
10870
10871 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib $cf_pkgconfig_libs %" -e 's%  % %g'`
10872 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
10873
10874 echo "${as_me:-configure}:10874: testing ...after  $LIBS ..." 1>&5
10875
10876 else
10877         cf_pkgconfig_incs=
10878         cf_pkgconfig_libs=
10879
10880 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
10881
10882 echo "${as_me:-configure}:10882: testing ...before $LIBS ..." 1>&5
10883
10884 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib -lXmu %" -e 's%  % %g'`
10885 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
10886
10887 echo "${as_me:-configure}:10887: testing ...after  $LIBS ..." 1>&5
10888
10889 fi
10890
10891         for cf_trim_lib in Xmu Xt X11
10892         do
10893                 case "$LIBS" in
10894                 (*-l$cf_trim_lib\ *-l$cf_trim_lib*)
10895                         LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
10896                         test -n "$verbose" && echo "    ..trimmed $LIBS" 1>&6
10897
10898 echo "${as_me:-configure}:10898: testing ..trimmed $LIBS ..." 1>&5
10899
10900                         ;;
10901                 esac
10902         done
10903
10904                                         ;;
10905                                 esac
10906                         fi
10907
10908                         break
10909 else
10910         cf_pkgconfig_incs=
10911         cf_pkgconfig_libs=
10912         :
10913 fi
10914
10915         done
10916 fi
10917
10918 if test -z "$cf_x_athena_lib" ; then
10919
10920 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists Xext; then
10921         test -n "$verbose" && echo "    found package Xext" 1>&6
10922
10923 echo "${as_me:-configure}:10923: testing found package Xext ..." 1>&5
10924
10925         cf_pkgconfig_incs="`$PKG_CONFIG --cflags Xext 2>/dev/null`"
10926         cf_pkgconfig_libs="`$PKG_CONFIG --libs   Xext 2>/dev/null`"
10927         test -n "$verbose" && echo "    package Xext CFLAGS: $cf_pkgconfig_incs" 1>&6
10928
10929 echo "${as_me:-configure}:10929: testing package Xext CFLAGS: $cf_pkgconfig_incs ..." 1>&5
10930
10931         test -n "$verbose" && echo "    package Xext LIBS: $cf_pkgconfig_libs" 1>&6
10932
10933 echo "${as_me:-configure}:10933: testing package Xext LIBS: $cf_pkgconfig_libs ..." 1>&5
10934
10935 cf_fix_cppflags=no
10936 cf_new_cflags=
10937 cf_new_cppflags=
10938 cf_new_extra_cppflags=
10939
10940 for cf_add_cflags in $cf_pkgconfig_incs
10941 do
10942 case $cf_fix_cppflags in
10943 (no)
10944         case $cf_add_cflags in
10945         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10946                 case $cf_add_cflags in
10947                 (-D*)
10948                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10949
10950                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10951                                 && test -z "${cf_tst_cflags}" \
10952                                 && cf_fix_cppflags=yes
10953
10954                         if test $cf_fix_cppflags = yes ; then
10955                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10956                                 continue
10957                         elif test "${cf_tst_cflags}" = "\"'" ; then
10958                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10959                                 continue
10960                         fi
10961                         ;;
10962                 esac
10963                 case "$CPPFLAGS" in
10964                 (*$cf_add_cflags)
10965                         ;;
10966                 (*)
10967                         case $cf_add_cflags in
10968                         (-D*)
10969                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10970
10971 CPPFLAGS=`echo "$CPPFLAGS" | \
10972         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10973                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10974
10975                                 ;;
10976                         esac
10977                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
10978                         ;;
10979                 esac
10980                 ;;
10981         (*)
10982                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
10983                 ;;
10984         esac
10985         ;;
10986 (yes)
10987         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
10988
10989         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10990
10991         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10992                 && test -z "${cf_tst_cflags}" \
10993                 && cf_fix_cppflags=no
10994         ;;
10995 esac
10996 done
10997
10998 if test -n "$cf_new_cflags" ; then
10999
11000         CFLAGS="$CFLAGS $cf_new_cflags"
11001 fi
11002
11003 if test -n "$cf_new_cppflags" ; then
11004
11005         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11006 fi
11007
11008 if test -n "$cf_new_extra_cppflags" ; then
11009
11010         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11011 fi
11012
11013 cf_add_libs="$cf_pkgconfig_libs"
11014 # Filter out duplicates - this happens with badly-designed ".pc" files...
11015 for cf_add_1lib in $LIBS
11016 do
11017         for cf_add_2lib in $cf_add_libs
11018         do
11019                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11020                 then
11021                         cf_add_1lib=
11022                         break
11023                 fi
11024         done
11025         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11026 done
11027 LIBS="$cf_add_libs"
11028
11029         :
11030 else
11031         cf_pkgconfig_incs=
11032         cf_pkgconfig_libs=
11033
11034         echo "$as_me:11034: checking for XextCreateExtension in -lXext" >&5
11035 echo $ECHO_N "checking for XextCreateExtension in -lXext... $ECHO_C" >&6
11036 if test "${ac_cv_lib_Xext_XextCreateExtension+set}" = set; then
11037   echo $ECHO_N "(cached) $ECHO_C" >&6
11038 else
11039   ac_check_lib_save_LIBS=$LIBS
11040 LIBS="-lXext  $LIBS"
11041 cat >conftest.$ac_ext <<_ACEOF
11042 #line 11042 "configure"
11043 #include "confdefs.h"
11044
11045 /* Override any gcc2 internal prototype to avoid an error.  */
11046 #ifdef __cplusplus
11047 extern "C"
11048 #endif
11049 /* We use char because int might match the return type of a gcc2
11050    builtin and then its argument prototype would still apply.  */
11051 char XextCreateExtension ();
11052 int
11053 main ()
11054 {
11055 XextCreateExtension ();
11056   ;
11057   return 0;
11058 }
11059 _ACEOF
11060 rm -f conftest.$ac_objext conftest$ac_exeext
11061 if { (eval echo "$as_me:11061: \"$ac_link\"") >&5
11062   (eval $ac_link) 2>&5
11063   ac_status=$?
11064   echo "$as_me:11064: \$? = $ac_status" >&5
11065   (exit $ac_status); } &&
11066          { ac_try='test -s conftest$ac_exeext'
11067   { (eval echo "$as_me:11067: \"$ac_try\"") >&5
11068   (eval $ac_try) 2>&5
11069   ac_status=$?
11070   echo "$as_me:11070: \$? = $ac_status" >&5
11071   (exit $ac_status); }; }; then
11072   ac_cv_lib_Xext_XextCreateExtension=yes
11073 else
11074   echo "$as_me: failed program was:" >&5
11075 cat conftest.$ac_ext >&5
11076 ac_cv_lib_Xext_XextCreateExtension=no
11077 fi
11078 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11079 LIBS=$ac_check_lib_save_LIBS
11080 fi
11081 echo "$as_me:11081: result: $ac_cv_lib_Xext_XextCreateExtension" >&5
11082 echo "${ECHO_T}$ac_cv_lib_Xext_XextCreateExtension" >&6
11083 if test $ac_cv_lib_Xext_XextCreateExtension = yes; then
11084
11085 cf_add_libs="-lXext"
11086 # Filter out duplicates - this happens with badly-designed ".pc" files...
11087 for cf_add_1lib in $LIBS
11088 do
11089         for cf_add_2lib in $cf_add_libs
11090         do
11091                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11092                 then
11093                         cf_add_1lib=
11094                         break
11095                 fi
11096         done
11097         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11098 done
11099 LIBS="$cf_add_libs"
11100
11101 fi
11102
11103 fi
11104
11105 # OSX is schizoid about who owns /usr/X11 (old) versus /opt/X11 (new), and (and
11106 # in some cases has installed dummy files in the former, other cases replaced
11107 # it with a link to the new location).  This complicates the configure script.
11108 # Check for that pitfall, and recover using pkg-config
11109 #
11110 # If none of these are set, the configuration is almost certainly broken.
11111 if test -z "${X_CFLAGS}${X_PRE_LIBS}${X_LIBS}${X_EXTRA_LIBS}"
11112 then
11113
11114 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists x11; then
11115         test -n "$verbose" && echo "    found package x11" 1>&6
11116
11117 echo "${as_me:-configure}:11117: testing found package x11 ..." 1>&5
11118
11119         cf_pkgconfig_incs="`$PKG_CONFIG --cflags x11 2>/dev/null`"
11120         cf_pkgconfig_libs="`$PKG_CONFIG --libs   x11 2>/dev/null`"
11121         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
11122
11123 echo "${as_me:-configure}:11123: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11124
11125         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
11126
11127 echo "${as_me:-configure}:11127: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
11128
11129 cf_fix_cppflags=no
11130 cf_new_cflags=
11131 cf_new_cppflags=
11132 cf_new_extra_cppflags=
11133
11134 for cf_add_cflags in $cf_pkgconfig_incs
11135 do
11136 case $cf_fix_cppflags in
11137 (no)
11138         case $cf_add_cflags in
11139         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11140                 case $cf_add_cflags in
11141                 (-D*)
11142                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11143
11144                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11145                                 && test -z "${cf_tst_cflags}" \
11146                                 && cf_fix_cppflags=yes
11147
11148                         if test $cf_fix_cppflags = yes ; then
11149                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11150                                 continue
11151                         elif test "${cf_tst_cflags}" = "\"'" ; then
11152                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11153                                 continue
11154                         fi
11155                         ;;
11156                 esac
11157                 case "$CPPFLAGS" in
11158                 (*$cf_add_cflags)
11159                         ;;
11160                 (*)
11161                         case $cf_add_cflags in
11162                         (-D*)
11163                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11164
11165 CPPFLAGS=`echo "$CPPFLAGS" | \
11166         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11167                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11168
11169                                 ;;
11170                         esac
11171                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11172                         ;;
11173                 esac
11174                 ;;
11175         (*)
11176                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11177                 ;;
11178         esac
11179         ;;
11180 (yes)
11181         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11182
11183         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11184
11185         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11186                 && test -z "${cf_tst_cflags}" \
11187                 && cf_fix_cppflags=no
11188         ;;
11189 esac
11190 done
11191
11192 if test -n "$cf_new_cflags" ; then
11193
11194         CFLAGS="$CFLAGS $cf_new_cflags"
11195 fi
11196
11197 if test -n "$cf_new_cppflags" ; then
11198
11199         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11200 fi
11201
11202 if test -n "$cf_new_extra_cppflags" ; then
11203
11204         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11205 fi
11206
11207 cf_add_libs="$cf_pkgconfig_libs"
11208 # Filter out duplicates - this happens with badly-designed ".pc" files...
11209 for cf_add_1lib in $LIBS
11210 do
11211         for cf_add_2lib in $cf_add_libs
11212         do
11213                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11214                 then
11215                         cf_add_1lib=
11216                         break
11217                 fi
11218         done
11219         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11220 done
11221 LIBS="$cf_add_libs"
11222
11223         :
11224 else
11225         cf_pkgconfig_incs=
11226         cf_pkgconfig_libs=
11227         { echo "$as_me:11227: WARNING: unable to find X11 library" >&5
11228 echo "$as_me: WARNING: unable to find X11 library" >&2;}
11229 fi
11230
11231 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists ice; then
11232         test -n "$verbose" && echo "    found package ice" 1>&6
11233
11234 echo "${as_me:-configure}:11234: testing found package ice ..." 1>&5
11235
11236         cf_pkgconfig_incs="`$PKG_CONFIG --cflags ice 2>/dev/null`"
11237         cf_pkgconfig_libs="`$PKG_CONFIG --libs   ice 2>/dev/null`"
11238         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
11239
11240 echo "${as_me:-configure}:11240: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11241
11242         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
11243
11244 echo "${as_me:-configure}:11244: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
11245
11246 cf_fix_cppflags=no
11247 cf_new_cflags=
11248 cf_new_cppflags=
11249 cf_new_extra_cppflags=
11250
11251 for cf_add_cflags in $cf_pkgconfig_incs
11252 do
11253 case $cf_fix_cppflags in
11254 (no)
11255         case $cf_add_cflags in
11256         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11257                 case $cf_add_cflags in
11258                 (-D*)
11259                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11260
11261                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11262                                 && test -z "${cf_tst_cflags}" \
11263                                 && cf_fix_cppflags=yes
11264
11265                         if test $cf_fix_cppflags = yes ; then
11266                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11267                                 continue
11268                         elif test "${cf_tst_cflags}" = "\"'" ; then
11269                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11270                                 continue
11271                         fi
11272                         ;;
11273                 esac
11274                 case "$CPPFLAGS" in
11275                 (*$cf_add_cflags)
11276                         ;;
11277                 (*)
11278                         case $cf_add_cflags in
11279                         (-D*)
11280                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11281
11282 CPPFLAGS=`echo "$CPPFLAGS" | \
11283         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11284                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11285
11286                                 ;;
11287                         esac
11288                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11289                         ;;
11290                 esac
11291                 ;;
11292         (*)
11293                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11294                 ;;
11295         esac
11296         ;;
11297 (yes)
11298         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11299
11300         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11301
11302         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11303                 && test -z "${cf_tst_cflags}" \
11304                 && cf_fix_cppflags=no
11305         ;;
11306 esac
11307 done
11308
11309 if test -n "$cf_new_cflags" ; then
11310
11311         CFLAGS="$CFLAGS $cf_new_cflags"
11312 fi
11313
11314 if test -n "$cf_new_cppflags" ; then
11315
11316         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11317 fi
11318
11319 if test -n "$cf_new_extra_cppflags" ; then
11320
11321         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11322 fi
11323
11324 cf_add_libs="$cf_pkgconfig_libs"
11325 # Filter out duplicates - this happens with badly-designed ".pc" files...
11326 for cf_add_1lib in $LIBS
11327 do
11328         for cf_add_2lib in $cf_add_libs
11329         do
11330                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11331                 then
11332                         cf_add_1lib=
11333                         break
11334                 fi
11335         done
11336         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11337 done
11338 LIBS="$cf_add_libs"
11339
11340         :
11341 else
11342         cf_pkgconfig_incs=
11343         cf_pkgconfig_libs=
11344         { echo "$as_me:11344: WARNING: unable to find ICE library" >&5
11345 echo "$as_me: WARNING: unable to find ICE library" >&2;}
11346 fi
11347
11348 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists sm; then
11349         test -n "$verbose" && echo "    found package sm" 1>&6
11350
11351 echo "${as_me:-configure}:11351: testing found package sm ..." 1>&5
11352
11353         cf_pkgconfig_incs="`$PKG_CONFIG --cflags sm 2>/dev/null`"
11354         cf_pkgconfig_libs="`$PKG_CONFIG --libs   sm 2>/dev/null`"
11355         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
11356
11357 echo "${as_me:-configure}:11357: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11358
11359         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
11360
11361 echo "${as_me:-configure}:11361: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
11362
11363 cf_fix_cppflags=no
11364 cf_new_cflags=
11365 cf_new_cppflags=
11366 cf_new_extra_cppflags=
11367
11368 for cf_add_cflags in $cf_pkgconfig_incs
11369 do
11370 case $cf_fix_cppflags in
11371 (no)
11372         case $cf_add_cflags in
11373         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11374                 case $cf_add_cflags in
11375                 (-D*)
11376                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11377
11378                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11379                                 && test -z "${cf_tst_cflags}" \
11380                                 && cf_fix_cppflags=yes
11381
11382                         if test $cf_fix_cppflags = yes ; then
11383                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11384                                 continue
11385                         elif test "${cf_tst_cflags}" = "\"'" ; then
11386                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11387                                 continue
11388                         fi
11389                         ;;
11390                 esac
11391                 case "$CPPFLAGS" in
11392                 (*$cf_add_cflags)
11393                         ;;
11394                 (*)
11395                         case $cf_add_cflags in
11396                         (-D*)
11397                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11398
11399 CPPFLAGS=`echo "$CPPFLAGS" | \
11400         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11401                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11402
11403                                 ;;
11404                         esac
11405                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11406                         ;;
11407                 esac
11408                 ;;
11409         (*)
11410                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11411                 ;;
11412         esac
11413         ;;
11414 (yes)
11415         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11416
11417         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11418
11419         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11420                 && test -z "${cf_tst_cflags}" \
11421                 && cf_fix_cppflags=no
11422         ;;
11423 esac
11424 done
11425
11426 if test -n "$cf_new_cflags" ; then
11427
11428         CFLAGS="$CFLAGS $cf_new_cflags"
11429 fi
11430
11431 if test -n "$cf_new_cppflags" ; then
11432
11433         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11434 fi
11435
11436 if test -n "$cf_new_extra_cppflags" ; then
11437
11438         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11439 fi
11440
11441 cf_add_libs="$cf_pkgconfig_libs"
11442 # Filter out duplicates - this happens with badly-designed ".pc" files...
11443 for cf_add_1lib in $LIBS
11444 do
11445         for cf_add_2lib in $cf_add_libs
11446         do
11447                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11448                 then
11449                         cf_add_1lib=
11450                         break
11451                 fi
11452         done
11453         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11454 done
11455 LIBS="$cf_add_libs"
11456
11457         :
11458 else
11459         cf_pkgconfig_incs=
11460         cf_pkgconfig_libs=
11461         { echo "$as_me:11461: WARNING: unable to find SM library" >&5
11462 echo "$as_me: WARNING: unable to find SM library" >&2;}
11463 fi
11464
11465 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xt; then
11466         test -n "$verbose" && echo "    found package xt" 1>&6
11467
11468 echo "${as_me:-configure}:11468: testing found package xt ..." 1>&5
11469
11470         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xt 2>/dev/null`"
11471         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xt 2>/dev/null`"
11472         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
11473
11474 echo "${as_me:-configure}:11474: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11475
11476         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
11477
11478 echo "${as_me:-configure}:11478: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
11479
11480 cf_fix_cppflags=no
11481 cf_new_cflags=
11482 cf_new_cppflags=
11483 cf_new_extra_cppflags=
11484
11485 for cf_add_cflags in $cf_pkgconfig_incs
11486 do
11487 case $cf_fix_cppflags in
11488 (no)
11489         case $cf_add_cflags in
11490         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11491                 case $cf_add_cflags in
11492                 (-D*)
11493                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11494
11495                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11496                                 && test -z "${cf_tst_cflags}" \
11497                                 && cf_fix_cppflags=yes
11498
11499                         if test $cf_fix_cppflags = yes ; then
11500                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11501                                 continue
11502                         elif test "${cf_tst_cflags}" = "\"'" ; then
11503                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11504                                 continue
11505                         fi
11506                         ;;
11507                 esac
11508                 case "$CPPFLAGS" in
11509                 (*$cf_add_cflags)
11510                         ;;
11511                 (*)
11512                         case $cf_add_cflags in
11513                         (-D*)
11514                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11515
11516 CPPFLAGS=`echo "$CPPFLAGS" | \
11517         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11518                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11519
11520                                 ;;
11521                         esac
11522                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11523                         ;;
11524                 esac
11525                 ;;
11526         (*)
11527                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11528                 ;;
11529         esac
11530         ;;
11531 (yes)
11532         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11533
11534         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11535
11536         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11537                 && test -z "${cf_tst_cflags}" \
11538                 && cf_fix_cppflags=no
11539         ;;
11540 esac
11541 done
11542
11543 if test -n "$cf_new_cflags" ; then
11544
11545         CFLAGS="$CFLAGS $cf_new_cflags"
11546 fi
11547
11548 if test -n "$cf_new_cppflags" ; then
11549
11550         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11551 fi
11552
11553 if test -n "$cf_new_extra_cppflags" ; then
11554
11555         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11556 fi
11557
11558 cf_add_libs="$cf_pkgconfig_libs"
11559 # Filter out duplicates - this happens with badly-designed ".pc" files...
11560 for cf_add_1lib in $LIBS
11561 do
11562         for cf_add_2lib in $cf_add_libs
11563         do
11564                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11565                 then
11566                         cf_add_1lib=
11567                         break
11568                 fi
11569         done
11570         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11571 done
11572 LIBS="$cf_add_libs"
11573
11574         :
11575 else
11576         cf_pkgconfig_incs=
11577         cf_pkgconfig_libs=
11578         { echo "$as_me:11578: WARNING: unable to find Xt library" >&5
11579 echo "$as_me: WARNING: unable to find Xt library" >&2;}
11580 fi
11581
11582 fi
11583
11584 cf_have_X_LIBS=no
11585
11586 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xt; then
11587         test -n "$verbose" && echo "    found package xt" 1>&6
11588
11589 echo "${as_me:-configure}:11589: testing found package xt ..." 1>&5
11590
11591         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xt 2>/dev/null`"
11592         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xt 2>/dev/null`"
11593         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
11594
11595 echo "${as_me:-configure}:11595: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11596
11597         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
11598
11599 echo "${as_me:-configure}:11599: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
11600
11601 cf_fix_cppflags=no
11602 cf_new_cflags=
11603 cf_new_cppflags=
11604 cf_new_extra_cppflags=
11605
11606 for cf_add_cflags in $cf_pkgconfig_incs
11607 do
11608 case $cf_fix_cppflags in
11609 (no)
11610         case $cf_add_cflags in
11611         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11612                 case $cf_add_cflags in
11613                 (-D*)
11614                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11615
11616                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11617                                 && test -z "${cf_tst_cflags}" \
11618                                 && cf_fix_cppflags=yes
11619
11620                         if test $cf_fix_cppflags = yes ; then
11621                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11622                                 continue
11623                         elif test "${cf_tst_cflags}" = "\"'" ; then
11624                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11625                                 continue
11626                         fi
11627                         ;;
11628                 esac
11629                 case "$CPPFLAGS" in
11630                 (*$cf_add_cflags)
11631                         ;;
11632                 (*)
11633                         case $cf_add_cflags in
11634                         (-D*)
11635                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11636
11637 CPPFLAGS=`echo "$CPPFLAGS" | \
11638         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11639                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11640
11641                                 ;;
11642                         esac
11643                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11644                         ;;
11645                 esac
11646                 ;;
11647         (*)
11648                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11649                 ;;
11650         esac
11651         ;;
11652 (yes)
11653         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11654
11655         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11656
11657         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11658                 && test -z "${cf_tst_cflags}" \
11659                 && cf_fix_cppflags=no
11660         ;;
11661 esac
11662 done
11663
11664 if test -n "$cf_new_cflags" ; then
11665
11666         CFLAGS="$CFLAGS $cf_new_cflags"
11667 fi
11668
11669 if test -n "$cf_new_cppflags" ; then
11670
11671         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11672 fi
11673
11674 if test -n "$cf_new_extra_cppflags" ; then
11675
11676         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11677 fi
11678
11679 cf_add_libs="$cf_pkgconfig_libs"
11680 # Filter out duplicates - this happens with badly-designed ".pc" files...
11681 for cf_add_1lib in $LIBS
11682 do
11683         for cf_add_2lib in $cf_add_libs
11684         do
11685                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11686                 then
11687                         cf_add_1lib=
11688                         break
11689                 fi
11690         done
11691         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11692 done
11693 LIBS="$cf_add_libs"
11694
11695         case "x$LIBS" in
11696         (*-lX11*)
11697                 ;;
11698         (*)
11699 # we have an "xt" package, but it may omit Xt's dependency on X11
11700 echo "$as_me:11700: checking for usable X dependency" >&5
11701 echo $ECHO_N "checking for usable X dependency... $ECHO_C" >&6
11702 if test "${cf_cv_xt_x11_compat+set}" = set; then
11703   echo $ECHO_N "(cached) $ECHO_C" >&6
11704 else
11705
11706 cat >conftest.$ac_ext <<_ACEOF
11707 #line 11707 "configure"
11708 #include "confdefs.h"
11709
11710 #include <X11/Xlib.h>
11711
11712 int
11713 main ()
11714 {
11715
11716         int rc1 = XDrawLine((Display*) 0, (Drawable) 0, (GC) 0, 0, 0, 0, 0);
11717         int rc2 = XClearWindow((Display*) 0, (Window) 0);
11718         int rc3 = XMoveWindow((Display*) 0, (Window) 0, 0, 0);
11719         int rc4 = XMoveResizeWindow((Display*)0, (Window)0, 0, 0, 0, 0);
11720
11721   ;
11722   return 0;
11723 }
11724 _ACEOF
11725 rm -f conftest.$ac_objext conftest$ac_exeext
11726 if { (eval echo "$as_me:11726: \"$ac_link\"") >&5
11727   (eval $ac_link) 2>&5
11728   ac_status=$?
11729   echo "$as_me:11729: \$? = $ac_status" >&5
11730   (exit $ac_status); } &&
11731          { ac_try='test -s conftest$ac_exeext'
11732   { (eval echo "$as_me:11732: \"$ac_try\"") >&5
11733   (eval $ac_try) 2>&5
11734   ac_status=$?
11735   echo "$as_me:11735: \$? = $ac_status" >&5
11736   (exit $ac_status); }; }; then
11737   cf_cv_xt_x11_compat=yes
11738 else
11739   echo "$as_me: failed program was:" >&5
11740 cat conftest.$ac_ext >&5
11741 cf_cv_xt_x11_compat=no
11742 fi
11743 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11744 fi
11745 echo "$as_me:11745: result: $cf_cv_xt_x11_compat" >&5
11746 echo "${ECHO_T}$cf_cv_xt_x11_compat" >&6
11747                 if test "$cf_cv_xt_x11_compat" = no
11748                 then
11749                         test -n "$verbose" && echo "    work around broken X11 dependency" 1>&6
11750
11751 echo "${as_me:-configure}:11751: testing work around broken X11 dependency ..." 1>&5
11752
11753                         # 2010/11/19 - good enough until a working Xt on Xcb is delivered.
11754
11755 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists x11; then
11756         test -n "$verbose" && echo "    found package x11" 1>&6
11757
11758 echo "${as_me:-configure}:11758: testing found package x11 ..." 1>&5
11759
11760         cf_pkgconfig_incs="`$PKG_CONFIG --cflags x11 2>/dev/null`"
11761         cf_pkgconfig_libs="`$PKG_CONFIG --libs   x11 2>/dev/null`"
11762         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
11763
11764 echo "${as_me:-configure}:11764: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11765
11766         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
11767
11768 echo "${as_me:-configure}:11768: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
11769
11770 cf_fix_cppflags=no
11771 cf_new_cflags=
11772 cf_new_cppflags=
11773 cf_new_extra_cppflags=
11774
11775 for cf_add_cflags in $cf_pkgconfig_incs
11776 do
11777 case $cf_fix_cppflags in
11778 (no)
11779         case $cf_add_cflags in
11780         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11781                 case $cf_add_cflags in
11782                 (-D*)
11783                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11784
11785                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11786                                 && test -z "${cf_tst_cflags}" \
11787                                 && cf_fix_cppflags=yes
11788
11789                         if test $cf_fix_cppflags = yes ; then
11790                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11791                                 continue
11792                         elif test "${cf_tst_cflags}" = "\"'" ; then
11793                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11794                                 continue
11795                         fi
11796                         ;;
11797                 esac
11798                 case "$CPPFLAGS" in
11799                 (*$cf_add_cflags)
11800                         ;;
11801                 (*)
11802                         case $cf_add_cflags in
11803                         (-D*)
11804                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11805
11806 CPPFLAGS=`echo "$CPPFLAGS" | \
11807         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11808                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11809
11810                                 ;;
11811                         esac
11812                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11813                         ;;
11814                 esac
11815                 ;;
11816         (*)
11817                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11818                 ;;
11819         esac
11820         ;;
11821 (yes)
11822         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11823
11824         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11825
11826         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11827                 && test -z "${cf_tst_cflags}" \
11828                 && cf_fix_cppflags=no
11829         ;;
11830 esac
11831 done
11832
11833 if test -n "$cf_new_cflags" ; then
11834
11835         CFLAGS="$CFLAGS $cf_new_cflags"
11836 fi
11837
11838 if test -n "$cf_new_cppflags" ; then
11839
11840         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11841 fi
11842
11843 if test -n "$cf_new_extra_cppflags" ; then
11844
11845         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11846 fi
11847
11848 cf_add_libs="$cf_pkgconfig_libs"
11849 # Filter out duplicates - this happens with badly-designed ".pc" files...
11850 for cf_add_1lib in $LIBS
11851 do
11852         for cf_add_2lib in $cf_add_libs
11853         do
11854                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11855                 then
11856                         cf_add_1lib=
11857                         break
11858                 fi
11859         done
11860         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11861 done
11862 LIBS="$cf_add_libs"
11863
11864         :
11865 else
11866         cf_pkgconfig_incs=
11867         cf_pkgconfig_libs=
11868
11869 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
11870
11871 echo "${as_me:-configure}:11871: testing ...before $LIBS ..." 1>&5
11872
11873 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%-lXt %-lXt -lX11 %" -e 's%  % %g'`
11874 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
11875
11876 echo "${as_me:-configure}:11876: testing ...after  $LIBS ..." 1>&5
11877
11878 fi
11879
11880                 fi
11881                 ;;
11882         esac
11883
11884 echo "$as_me:11884: checking for usable X Toolkit package" >&5
11885 echo $ECHO_N "checking for usable X Toolkit package... $ECHO_C" >&6
11886 if test "${cf_cv_xt_ice_compat+set}" = set; then
11887   echo $ECHO_N "(cached) $ECHO_C" >&6
11888 else
11889
11890 cat >conftest.$ac_ext <<_ACEOF
11891 #line 11891 "configure"
11892 #include "confdefs.h"
11893
11894 #include <X11/Shell.h>
11895
11896 int
11897 main ()
11898 {
11899 int num = IceConnectionNumber(0)
11900
11901   ;
11902   return 0;
11903 }
11904 _ACEOF
11905 rm -f conftest.$ac_objext conftest$ac_exeext
11906 if { (eval echo "$as_me:11906: \"$ac_link\"") >&5
11907   (eval $ac_link) 2>&5
11908   ac_status=$?
11909   echo "$as_me:11909: \$? = $ac_status" >&5
11910   (exit $ac_status); } &&
11911          { ac_try='test -s conftest$ac_exeext'
11912   { (eval echo "$as_me:11912: \"$ac_try\"") >&5
11913   (eval $ac_try) 2>&5
11914   ac_status=$?
11915   echo "$as_me:11915: \$? = $ac_status" >&5
11916   (exit $ac_status); }; }; then
11917   cf_cv_xt_ice_compat=yes
11918 else
11919   echo "$as_me: failed program was:" >&5
11920 cat conftest.$ac_ext >&5
11921 cf_cv_xt_ice_compat=no
11922 fi
11923 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11924 fi
11925 echo "$as_me:11925: result: $cf_cv_xt_ice_compat" >&5
11926 echo "${ECHO_T}$cf_cv_xt_ice_compat" >&6
11927
11928         if test "$cf_cv_xt_ice_compat" = no
11929         then
11930                 # workaround for broken ".pc" files used for X Toolkit.
11931                 case "x$X_PRE_LIBS" in
11932                 (*-lICE*)
11933                         case "x$LIBS" in
11934                         (*-lICE*)
11935                                 ;;
11936                         (*)
11937                                 test -n "$verbose" && echo "    work around broken ICE dependency" 1>&6
11938
11939 echo "${as_me:-configure}:11939: testing work around broken ICE dependency ..." 1>&5
11940
11941 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists ice; then
11942         test -n "$verbose" && echo "    found package ice" 1>&6
11943
11944 echo "${as_me:-configure}:11944: testing found package ice ..." 1>&5
11945
11946         cf_pkgconfig_incs="`$PKG_CONFIG --cflags ice 2>/dev/null`"
11947         cf_pkgconfig_libs="`$PKG_CONFIG --libs   ice 2>/dev/null`"
11948         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
11949
11950 echo "${as_me:-configure}:11950: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11951
11952         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
11953
11954 echo "${as_me:-configure}:11954: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
11955
11956 cf_fix_cppflags=no
11957 cf_new_cflags=
11958 cf_new_cppflags=
11959 cf_new_extra_cppflags=
11960
11961 for cf_add_cflags in $cf_pkgconfig_incs
11962 do
11963 case $cf_fix_cppflags in
11964 (no)
11965         case $cf_add_cflags in
11966         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11967                 case $cf_add_cflags in
11968                 (-D*)
11969                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11970
11971                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11972                                 && test -z "${cf_tst_cflags}" \
11973                                 && cf_fix_cppflags=yes
11974
11975                         if test $cf_fix_cppflags = yes ; then
11976                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11977                                 continue
11978                         elif test "${cf_tst_cflags}" = "\"'" ; then
11979                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11980                                 continue
11981                         fi
11982                         ;;
11983                 esac
11984                 case "$CPPFLAGS" in
11985                 (*$cf_add_cflags)
11986                         ;;
11987                 (*)
11988                         case $cf_add_cflags in
11989                         (-D*)
11990                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11991
11992 CPPFLAGS=`echo "$CPPFLAGS" | \
11993         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11994                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11995
11996                                 ;;
11997                         esac
11998                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11999                         ;;
12000                 esac
12001                 ;;
12002         (*)
12003                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
12004                 ;;
12005         esac
12006         ;;
12007 (yes)
12008         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12009
12010         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12011
12012         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12013                 && test -z "${cf_tst_cflags}" \
12014                 && cf_fix_cppflags=no
12015         ;;
12016 esac
12017 done
12018
12019 if test -n "$cf_new_cflags" ; then
12020
12021         CFLAGS="$CFLAGS $cf_new_cflags"
12022 fi
12023
12024 if test -n "$cf_new_cppflags" ; then
12025
12026         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
12027 fi
12028
12029 if test -n "$cf_new_extra_cppflags" ; then
12030
12031         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
12032 fi
12033
12034 cf_add_libs="$cf_pkgconfig_libs"
12035 # Filter out duplicates - this happens with badly-designed ".pc" files...
12036 for cf_add_1lib in $LIBS
12037 do
12038         for cf_add_2lib in $cf_add_libs
12039         do
12040                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12041                 then
12042                         cf_add_1lib=
12043                         break
12044                 fi
12045         done
12046         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12047 done
12048 LIBS="$cf_add_libs"
12049
12050 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists sm; then
12051         test -n "$verbose" && echo "    found package sm" 1>&6
12052
12053 echo "${as_me:-configure}:12053: testing found package sm ..." 1>&5
12054
12055         cf_pkgconfig_incs="`$PKG_CONFIG --cflags sm 2>/dev/null`"
12056         cf_pkgconfig_libs="`$PKG_CONFIG --libs   sm 2>/dev/null`"
12057         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
12058
12059 echo "${as_me:-configure}:12059: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12060
12061         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
12062
12063 echo "${as_me:-configure}:12063: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
12064
12065 cf_fix_cppflags=no
12066 cf_new_cflags=
12067 cf_new_cppflags=
12068 cf_new_extra_cppflags=
12069
12070 for cf_add_cflags in $cf_pkgconfig_incs
12071 do
12072 case $cf_fix_cppflags in
12073 (no)
12074         case $cf_add_cflags in
12075         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12076                 case $cf_add_cflags in
12077                 (-D*)
12078                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12079
12080                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12081                                 && test -z "${cf_tst_cflags}" \
12082                                 && cf_fix_cppflags=yes
12083
12084                         if test $cf_fix_cppflags = yes ; then
12085                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12086                                 continue
12087                         elif test "${cf_tst_cflags}" = "\"'" ; then
12088                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12089                                 continue
12090                         fi
12091                         ;;
12092                 esac
12093                 case "$CPPFLAGS" in
12094                 (*$cf_add_cflags)
12095                         ;;
12096                 (*)
12097                         case $cf_add_cflags in
12098                         (-D*)
12099                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12100
12101 CPPFLAGS=`echo "$CPPFLAGS" | \
12102         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12103                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12104
12105                                 ;;
12106                         esac
12107                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
12108                         ;;
12109                 esac
12110                 ;;
12111         (*)
12112                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
12113                 ;;
12114         esac
12115         ;;
12116 (yes)
12117         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12118
12119         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12120
12121         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12122                 && test -z "${cf_tst_cflags}" \
12123                 && cf_fix_cppflags=no
12124         ;;
12125 esac
12126 done
12127
12128 if test -n "$cf_new_cflags" ; then
12129
12130         CFLAGS="$CFLAGS $cf_new_cflags"
12131 fi
12132
12133 if test -n "$cf_new_cppflags" ; then
12134
12135         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
12136 fi
12137
12138 if test -n "$cf_new_extra_cppflags" ; then
12139
12140         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
12141 fi
12142
12143 cf_add_libs="$cf_pkgconfig_libs"
12144 # Filter out duplicates - this happens with badly-designed ".pc" files...
12145 for cf_add_1lib in $LIBS
12146 do
12147         for cf_add_2lib in $cf_add_libs
12148         do
12149                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12150                 then
12151                         cf_add_1lib=
12152                         break
12153                 fi
12154         done
12155         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12156 done
12157 LIBS="$cf_add_libs"
12158
12159         :
12160 else
12161         cf_pkgconfig_incs=
12162         cf_pkgconfig_libs=
12163         :
12164 fi
12165
12166 else
12167         cf_pkgconfig_incs=
12168         cf_pkgconfig_libs=
12169
12170 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
12171
12172 echo "${as_me:-configure}:12172: testing ...before $LIBS ..." 1>&5
12173
12174 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%-lXt %-lXt $X_PRE_LIBS %" -e 's%  % %g'`
12175 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
12176
12177 echo "${as_me:-configure}:12177: testing ...after  $LIBS ..." 1>&5
12178
12179 fi
12180
12181                                 ;;
12182                         esac
12183                         ;;
12184                 esac
12185         fi
12186
12187         cf_have_X_LIBS=yes
12188
12189 else
12190         cf_pkgconfig_incs=
12191         cf_pkgconfig_libs=
12192
12193         LDFLAGS="$X_LIBS $LDFLAGS"
12194
12195 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
12196
12197 echo "${as_me:-configure}:12197: testing checking additions to CFLAGS ..." 1>&5
12198
12199 cf_check_cflags="$CFLAGS"
12200 cf_check_cppflags="$CPPFLAGS"
12201
12202 cf_fix_cppflags=no
12203 cf_new_cflags=
12204 cf_new_cppflags=
12205 cf_new_extra_cppflags=
12206
12207 for cf_add_cflags in $X_CFLAGS
12208 do
12209 case $cf_fix_cppflags in
12210 (no)
12211         case $cf_add_cflags in
12212         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12213                 case $cf_add_cflags in
12214                 (-D*)
12215                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12216
12217                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12218                                 && test -z "${cf_tst_cflags}" \
12219                                 && cf_fix_cppflags=yes
12220
12221                         if test $cf_fix_cppflags = yes ; then
12222                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12223                                 continue
12224                         elif test "${cf_tst_cflags}" = "\"'" ; then
12225                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12226                                 continue
12227                         fi
12228                         ;;
12229                 esac
12230                 case "$CPPFLAGS" in
12231                 (*$cf_add_cflags)
12232                         ;;
12233                 (*)
12234                         case $cf_add_cflags in
12235                         (-D*)
12236                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12237
12238 CPPFLAGS=`echo "$CPPFLAGS" | \
12239         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12240                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12241
12242                                 ;;
12243                         esac
12244                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
12245                         ;;
12246                 esac
12247                 ;;
12248         (*)
12249                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
12250                 ;;
12251         esac
12252         ;;
12253 (yes)
12254         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12255
12256         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12257
12258         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12259                 && test -z "${cf_tst_cflags}" \
12260                 && cf_fix_cppflags=no
12261         ;;
12262 esac
12263 done
12264
12265 if test -n "$cf_new_cflags" ; then
12266         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
12267
12268 echo "${as_me:-configure}:12268: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
12269
12270         CFLAGS="$CFLAGS $cf_new_cflags"
12271 fi
12272
12273 if test -n "$cf_new_cppflags" ; then
12274         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
12275
12276 echo "${as_me:-configure}:12276: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
12277
12278         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
12279 fi
12280
12281 if test -n "$cf_new_extra_cppflags" ; then
12282         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
12283
12284 echo "${as_me:-configure}:12284: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
12285
12286         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
12287 fi
12288
12289 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
12290 cat >conftest.$ac_ext <<_ACEOF
12291 #line 12291 "configure"
12292 #include "confdefs.h"
12293 #include <stdio.h>
12294 int
12295 main ()
12296 {
12297 printf("Hello world");
12298   ;
12299   return 0;
12300 }
12301 _ACEOF
12302 rm -f conftest.$ac_objext conftest$ac_exeext
12303 if { (eval echo "$as_me:12303: \"$ac_link\"") >&5
12304   (eval $ac_link) 2>&5
12305   ac_status=$?
12306   echo "$as_me:12306: \$? = $ac_status" >&5
12307   (exit $ac_status); } &&
12308          { ac_try='test -s conftest$ac_exeext'
12309   { (eval echo "$as_me:12309: \"$ac_try\"") >&5
12310   (eval $ac_try) 2>&5
12311   ac_status=$?
12312   echo "$as_me:12312: \$? = $ac_status" >&5
12313   (exit $ac_status); }; }; then
12314   :
12315 else
12316   echo "$as_me: failed program was:" >&5
12317 cat conftest.$ac_ext >&5
12318 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
12319
12320 echo "${as_me:-configure}:12320: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
12321
12322          if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
12323                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
12324
12325 echo "${as_me:-configure}:12325: testing but keeping change to \$CPPFLAGS ..." 1>&5
12326
12327          fi
12328          CFLAGS="$cf_check_flags"
12329 fi
12330 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12331 fi
12332
12333         echo "$as_me:12333: checking for XOpenDisplay" >&5
12334 echo $ECHO_N "checking for XOpenDisplay... $ECHO_C" >&6
12335 if test "${ac_cv_func_XOpenDisplay+set}" = set; then
12336   echo $ECHO_N "(cached) $ECHO_C" >&6
12337 else
12338   cat >conftest.$ac_ext <<_ACEOF
12339 #line 12339 "configure"
12340 #include "confdefs.h"
12341 /* System header to define __stub macros and hopefully few prototypes,
12342     which can conflict with char XOpenDisplay (); below.  */
12343 #include <assert.h>
12344 /* Override any gcc2 internal prototype to avoid an error.  */
12345 #ifdef __cplusplus
12346 extern "C"
12347 #endif
12348 /* We use char because int might match the return type of a gcc2
12349    builtin and then its argument prototype would still apply.  */
12350 char XOpenDisplay ();
12351 char (*f) ();
12352
12353 int
12354 main ()
12355 {
12356 /* The GNU C library defines this for functions which it implements
12357     to always fail with ENOSYS.  Some functions are actually named
12358     something starting with __ and the normal name is an alias.  */
12359 #if defined (__stub_XOpenDisplay) || defined (__stub___XOpenDisplay)
12360 choke me
12361 #else
12362 f = XOpenDisplay; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
12363 #endif
12364
12365   ;
12366   return 0;
12367 }
12368 _ACEOF
12369 rm -f conftest.$ac_objext conftest$ac_exeext
12370 if { (eval echo "$as_me:12370: \"$ac_link\"") >&5
12371   (eval $ac_link) 2>&5
12372   ac_status=$?
12373   echo "$as_me:12373: \$? = $ac_status" >&5
12374   (exit $ac_status); } &&
12375          { ac_try='test -s conftest$ac_exeext'
12376   { (eval echo "$as_me:12376: \"$ac_try\"") >&5
12377   (eval $ac_try) 2>&5
12378   ac_status=$?
12379   echo "$as_me:12379: \$? = $ac_status" >&5
12380   (exit $ac_status); }; }; then
12381   ac_cv_func_XOpenDisplay=yes
12382 else
12383   echo "$as_me: failed program was:" >&5
12384 cat conftest.$ac_ext >&5
12385 ac_cv_func_XOpenDisplay=no
12386 fi
12387 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12388 fi
12389 echo "$as_me:12389: result: $ac_cv_func_XOpenDisplay" >&5
12390 echo "${ECHO_T}$ac_cv_func_XOpenDisplay" >&6
12391 if test $ac_cv_func_XOpenDisplay = yes; then
12392   :
12393 else
12394
12395         echo "$as_me:12395: checking for XOpenDisplay in -lX11" >&5
12396 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
12397 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
12398   echo $ECHO_N "(cached) $ECHO_C" >&6
12399 else
12400   ac_check_lib_save_LIBS=$LIBS
12401 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
12402 cat >conftest.$ac_ext <<_ACEOF
12403 #line 12403 "configure"
12404 #include "confdefs.h"
12405
12406 /* Override any gcc2 internal prototype to avoid an error.  */
12407 #ifdef __cplusplus
12408 extern "C"
12409 #endif
12410 /* We use char because int might match the return type of a gcc2
12411    builtin and then its argument prototype would still apply.  */
12412 char XOpenDisplay ();
12413 int
12414 main ()
12415 {
12416 XOpenDisplay ();
12417   ;
12418   return 0;
12419 }
12420 _ACEOF
12421 rm -f conftest.$ac_objext conftest$ac_exeext
12422 if { (eval echo "$as_me:12422: \"$ac_link\"") >&5
12423   (eval $ac_link) 2>&5
12424   ac_status=$?
12425   echo "$as_me:12425: \$? = $ac_status" >&5
12426   (exit $ac_status); } &&
12427          { ac_try='test -s conftest$ac_exeext'
12428   { (eval echo "$as_me:12428: \"$ac_try\"") >&5
12429   (eval $ac_try) 2>&5
12430   ac_status=$?
12431   echo "$as_me:12431: \$? = $ac_status" >&5
12432   (exit $ac_status); }; }; then
12433   ac_cv_lib_X11_XOpenDisplay=yes
12434 else
12435   echo "$as_me: failed program was:" >&5
12436 cat conftest.$ac_ext >&5
12437 ac_cv_lib_X11_XOpenDisplay=no
12438 fi
12439 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12440 LIBS=$ac_check_lib_save_LIBS
12441 fi
12442 echo "$as_me:12442: result: $ac_cv_lib_X11_XOpenDisplay" >&5
12443 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
12444 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
12445
12446 cf_add_libs="-lX11"
12447 # Filter out duplicates - this happens with badly-designed ".pc" files...
12448 for cf_add_1lib in $LIBS
12449 do
12450         for cf_add_2lib in $cf_add_libs
12451         do
12452                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12453                 then
12454                         cf_add_1lib=
12455                         break
12456                 fi
12457         done
12458         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12459 done
12460 LIBS="$cf_add_libs"
12461
12462 fi
12463
12464 fi
12465
12466         echo "$as_me:12466: checking for XtAppInitialize" >&5
12467 echo $ECHO_N "checking for XtAppInitialize... $ECHO_C" >&6
12468 if test "${ac_cv_func_XtAppInitialize+set}" = set; then
12469   echo $ECHO_N "(cached) $ECHO_C" >&6
12470 else
12471   cat >conftest.$ac_ext <<_ACEOF
12472 #line 12472 "configure"
12473 #include "confdefs.h"
12474 /* System header to define __stub macros and hopefully few prototypes,
12475     which can conflict with char XtAppInitialize (); below.  */
12476 #include <assert.h>
12477 /* Override any gcc2 internal prototype to avoid an error.  */
12478 #ifdef __cplusplus
12479 extern "C"
12480 #endif
12481 /* We use char because int might match the return type of a gcc2
12482    builtin and then its argument prototype would still apply.  */
12483 char XtAppInitialize ();
12484 char (*f) ();
12485
12486 int
12487 main ()
12488 {
12489 /* The GNU C library defines this for functions which it implements
12490     to always fail with ENOSYS.  Some functions are actually named
12491     something starting with __ and the normal name is an alias.  */
12492 #if defined (__stub_XtAppInitialize) || defined (__stub___XtAppInitialize)
12493 choke me
12494 #else
12495 f = XtAppInitialize; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
12496 #endif
12497
12498   ;
12499   return 0;
12500 }
12501 _ACEOF
12502 rm -f conftest.$ac_objext conftest$ac_exeext
12503 if { (eval echo "$as_me:12503: \"$ac_link\"") >&5
12504   (eval $ac_link) 2>&5
12505   ac_status=$?
12506   echo "$as_me:12506: \$? = $ac_status" >&5
12507   (exit $ac_status); } &&
12508          { ac_try='test -s conftest$ac_exeext'
12509   { (eval echo "$as_me:12509: \"$ac_try\"") >&5
12510   (eval $ac_try) 2>&5
12511   ac_status=$?
12512   echo "$as_me:12512: \$? = $ac_status" >&5
12513   (exit $ac_status); }; }; then
12514   ac_cv_func_XtAppInitialize=yes
12515 else
12516   echo "$as_me: failed program was:" >&5
12517 cat conftest.$ac_ext >&5
12518 ac_cv_func_XtAppInitialize=no
12519 fi
12520 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12521 fi
12522 echo "$as_me:12522: result: $ac_cv_func_XtAppInitialize" >&5
12523 echo "${ECHO_T}$ac_cv_func_XtAppInitialize" >&6
12524 if test $ac_cv_func_XtAppInitialize = yes; then
12525   :
12526 else
12527
12528         echo "$as_me:12528: checking for XtAppInitialize in -lXt" >&5
12529 echo $ECHO_N "checking for XtAppInitialize in -lXt... $ECHO_C" >&6
12530 if test "${ac_cv_lib_Xt_XtAppInitialize+set}" = set; then
12531   echo $ECHO_N "(cached) $ECHO_C" >&6
12532 else
12533   ac_check_lib_save_LIBS=$LIBS
12534 LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
12535 cat >conftest.$ac_ext <<_ACEOF
12536 #line 12536 "configure"
12537 #include "confdefs.h"
12538
12539 /* Override any gcc2 internal prototype to avoid an error.  */
12540 #ifdef __cplusplus
12541 extern "C"
12542 #endif
12543 /* We use char because int might match the return type of a gcc2
12544    builtin and then its argument prototype would still apply.  */
12545 char XtAppInitialize ();
12546 int
12547 main ()
12548 {
12549 XtAppInitialize ();
12550   ;
12551   return 0;
12552 }
12553 _ACEOF
12554 rm -f conftest.$ac_objext conftest$ac_exeext
12555 if { (eval echo "$as_me:12555: \"$ac_link\"") >&5
12556   (eval $ac_link) 2>&5
12557   ac_status=$?
12558   echo "$as_me:12558: \$? = $ac_status" >&5
12559   (exit $ac_status); } &&
12560          { ac_try='test -s conftest$ac_exeext'
12561   { (eval echo "$as_me:12561: \"$ac_try\"") >&5
12562   (eval $ac_try) 2>&5
12563   ac_status=$?
12564   echo "$as_me:12564: \$? = $ac_status" >&5
12565   (exit $ac_status); }; }; then
12566   ac_cv_lib_Xt_XtAppInitialize=yes
12567 else
12568   echo "$as_me: failed program was:" >&5
12569 cat conftest.$ac_ext >&5
12570 ac_cv_lib_Xt_XtAppInitialize=no
12571 fi
12572 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12573 LIBS=$ac_check_lib_save_LIBS
12574 fi
12575 echo "$as_me:12575: result: $ac_cv_lib_Xt_XtAppInitialize" >&5
12576 echo "${ECHO_T}$ac_cv_lib_Xt_XtAppInitialize" >&6
12577 if test $ac_cv_lib_Xt_XtAppInitialize = yes; then
12578
12579 cat >>confdefs.h <<\EOF
12580 #define HAVE_LIBXT 1
12581 EOF
12582
12583                  cf_have_X_LIBS=Xt
12584                  LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS"
12585 fi
12586
12587 fi
12588
12589 fi
12590
12591 if test $cf_have_X_LIBS = no ; then
12592         { echo "$as_me:12592: WARNING: Unable to successfully link X Toolkit library (-lXt) with
12593 test program.  You will have to check and add the proper libraries by hand
12594 to makefile." >&5
12595 echo "$as_me: 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." >&2;}
12598 fi
12599
12600 cf_x_athena_root=$cf_x_athena
12601 cf_x_athena_inc=""
12602
12603 for cf_path in default \
12604         /usr/contrib/X11R6 \
12605         /usr/contrib/X11R5 \
12606         /usr/lib/X11R5 \
12607         /usr/local
12608 do
12609         if test -z "$cf_x_athena_inc" ; then
12610                 cf_save="$CPPFLAGS"
12611                 cf_test=X11/$cf_x_athena_root/SimpleMenu.h
12612                 if test $cf_path != default ; then
12613                         CPPFLAGS="$cf_save -I$cf_path/include"
12614                         echo "$as_me:12614: checking for $cf_test in $cf_path" >&5
12615 echo $ECHO_N "checking for $cf_test in $cf_path... $ECHO_C" >&6
12616                 else
12617                         echo "$as_me:12617: checking for $cf_test" >&5
12618 echo $ECHO_N "checking for $cf_test... $ECHO_C" >&6
12619                 fi
12620                 cat >conftest.$ac_ext <<_ACEOF
12621 #line 12621 "configure"
12622 #include "confdefs.h"
12623
12624 #include <X11/Intrinsic.h>
12625 #include <$cf_test>
12626 int
12627 main ()
12628 {
12629
12630   ;
12631   return 0;
12632 }
12633 _ACEOF
12634 rm -f conftest.$ac_objext
12635 if { (eval echo "$as_me:12635: \"$ac_compile\"") >&5
12636   (eval $ac_compile) 2>&5
12637   ac_status=$?
12638   echo "$as_me:12638: \$? = $ac_status" >&5
12639   (exit $ac_status); } &&
12640          { ac_try='test -s conftest.$ac_objext'
12641   { (eval echo "$as_me:12641: \"$ac_try\"") >&5
12642   (eval $ac_try) 2>&5
12643   ac_status=$?
12644   echo "$as_me:12644: \$? = $ac_status" >&5
12645   (exit $ac_status); }; }; then
12646   cf_result=yes
12647 else
12648   echo "$as_me: failed program was:" >&5
12649 cat conftest.$ac_ext >&5
12650 cf_result=no
12651 fi
12652 rm -f conftest.$ac_objext conftest.$ac_ext
12653                 echo "$as_me:12653: result: $cf_result" >&5
12654 echo "${ECHO_T}$cf_result" >&6
12655                 if test "$cf_result" = yes ; then
12656                         cf_x_athena_inc=$cf_path
12657                         break
12658                 else
12659                         CPPFLAGS="$cf_save"
12660                 fi
12661         fi
12662 done
12663
12664 if test -z "$cf_x_athena_inc" ; then
12665         { echo "$as_me:12665: WARNING: Unable to successfully find Athena header files with test program" >&5
12666 echo "$as_me: WARNING: Unable to successfully find Athena header files with test program" >&2;}
12667 elif test "$cf_x_athena_inc" != default ; then
12668         CPPFLAGS="$CPPFLAGS -I$cf_x_athena_inc"
12669 fi
12670
12671 cf_x_athena_root=$cf_x_athena
12672 cf_x_athena_lib=""
12673
12674 for cf_path in default \
12675         /usr/contrib/X11R6 \
12676         /usr/contrib/X11R5 \
12677         /usr/lib/X11R5 \
12678         /usr/local
12679 do
12680         for cf_lib in \
12681                 ${cf_x_athena_root} \
12682                 ${cf_x_athena_root}7 \
12683                 ${cf_x_athena_root}6
12684         do
12685         for cf_libs in \
12686                 "-l$cf_lib -lXmu" \
12687                 "-l$cf_lib -lXpm -lXmu" \
12688                 "-l${cf_lib}_s -lXmu_s"
12689         do
12690                 if test -z "$cf_x_athena_lib" ; then
12691                         cf_save="$LIBS"
12692                         cf_test=XawSimpleMenuAddGlobalActions
12693                         if test $cf_path != default ; then
12694
12695 cf_add_libs="-L$cf_path/lib $cf_libs"
12696 # Filter out duplicates - this happens with badly-designed ".pc" files...
12697 for cf_add_1lib in $LIBS
12698 do
12699         for cf_add_2lib in $cf_add_libs
12700         do
12701                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12702                 then
12703                         cf_add_1lib=
12704                         break
12705                 fi
12706         done
12707         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12708 done
12709 LIBS="$cf_add_libs"
12710
12711                                 echo "$as_me:12711: checking for $cf_libs in $cf_path" >&5
12712 echo $ECHO_N "checking for $cf_libs in $cf_path... $ECHO_C" >&6
12713                         else
12714
12715 cf_add_libs="$cf_libs"
12716 # Filter out duplicates - this happens with badly-designed ".pc" files...
12717 for cf_add_1lib in $LIBS
12718 do
12719         for cf_add_2lib in $cf_add_libs
12720         do
12721                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12722                 then
12723                         cf_add_1lib=
12724                         break
12725                 fi
12726         done
12727         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12728 done
12729 LIBS="$cf_add_libs"
12730
12731                                 echo "$as_me:12731: checking for $cf_test in $cf_libs" >&5
12732 echo $ECHO_N "checking for $cf_test in $cf_libs... $ECHO_C" >&6
12733                         fi
12734                         cat >conftest.$ac_ext <<_ACEOF
12735 #line 12735 "configure"
12736 #include "confdefs.h"
12737
12738 #include <X11/Intrinsic.h>
12739 #include <X11/$cf_x_athena_root/SimpleMenu.h>
12740
12741 int
12742 main ()
12743 {
12744
12745 $cf_test((XtAppContext) 0)
12746   ;
12747   return 0;
12748 }
12749 _ACEOF
12750 rm -f conftest.$ac_objext conftest$ac_exeext
12751 if { (eval echo "$as_me:12751: \"$ac_link\"") >&5
12752   (eval $ac_link) 2>&5
12753   ac_status=$?
12754   echo "$as_me:12754: \$? = $ac_status" >&5
12755   (exit $ac_status); } &&
12756          { ac_try='test -s conftest$ac_exeext'
12757   { (eval echo "$as_me:12757: \"$ac_try\"") >&5
12758   (eval $ac_try) 2>&5
12759   ac_status=$?
12760   echo "$as_me:12760: \$? = $ac_status" >&5
12761   (exit $ac_status); }; }; then
12762   cf_result=yes
12763 else
12764   echo "$as_me: failed program was:" >&5
12765 cat conftest.$ac_ext >&5
12766 cf_result=no
12767 fi
12768 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12769                         echo "$as_me:12769: result: $cf_result" >&5
12770 echo "${ECHO_T}$cf_result" >&6
12771                         if test "$cf_result" = yes ; then
12772                                 cf_x_athena_lib="$cf_libs"
12773                                 break
12774                         fi
12775                         LIBS="$cf_save"
12776                 fi
12777         done # cf_libs
12778                 test -n "$cf_x_athena_lib" && break
12779         done # cf_lib
12780 done
12781
12782 if test -z "$cf_x_athena_lib" ; then
12783         { { echo "$as_me:12783: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&5
12784 echo "$as_me: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&2;}
12785    { (exit 1); exit 1; }; }
12786 fi
12787
12788 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
12789
12790 cat >>confdefs.h <<EOF
12791 #define $cf_x_athena_LIBS 1
12792 EOF
12793
12794 fi
12795
12796 if test -n "$ac_tool_prefix"; then
12797   for ac_prog in xcurses-config
12798   do
12799     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
12800 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
12801 echo "$as_me:12801: checking for $ac_word" >&5
12802 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
12803 if test "${ac_cv_prog_XCURSES_CONFIG+set}" = set; then
12804   echo $ECHO_N "(cached) $ECHO_C" >&6
12805 else
12806   if test -n "$XCURSES_CONFIG"; then
12807   ac_cv_prog_XCURSES_CONFIG="$XCURSES_CONFIG" # Let the user override the test.
12808 else
12809   ac_save_IFS=$IFS; IFS=$ac_path_separator
12810 ac_dummy="$PATH"
12811 for ac_dir in $ac_dummy; do
12812   IFS=$ac_save_IFS
12813   test -z "$ac_dir" && ac_dir=.
12814   $as_executable_p "$ac_dir/$ac_word" || continue
12815 ac_cv_prog_XCURSES_CONFIG="$ac_tool_prefix$ac_prog"
12816 echo "$as_me:12816: found $ac_dir/$ac_word" >&5
12817 break
12818 done
12819
12820 fi
12821 fi
12822 XCURSES_CONFIG=$ac_cv_prog_XCURSES_CONFIG
12823 if test -n "$XCURSES_CONFIG"; then
12824   echo "$as_me:12824: result: $XCURSES_CONFIG" >&5
12825 echo "${ECHO_T}$XCURSES_CONFIG" >&6
12826 else
12827   echo "$as_me:12827: result: no" >&5
12828 echo "${ECHO_T}no" >&6
12829 fi
12830
12831     test -n "$XCURSES_CONFIG" && break
12832   done
12833 fi
12834 if test -z "$XCURSES_CONFIG"; then
12835   ac_ct_XCURSES_CONFIG=$XCURSES_CONFIG
12836   for ac_prog in xcurses-config
12837 do
12838   # Extract the first word of "$ac_prog", so it can be a program name with args.
12839 set dummy $ac_prog; ac_word=$2
12840 echo "$as_me:12840: checking for $ac_word" >&5
12841 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
12842 if test "${ac_cv_prog_ac_ct_XCURSES_CONFIG+set}" = set; then
12843   echo $ECHO_N "(cached) $ECHO_C" >&6
12844 else
12845   if test -n "$ac_ct_XCURSES_CONFIG"; then
12846   ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_ct_XCURSES_CONFIG" # Let the user override the test.
12847 else
12848   ac_save_IFS=$IFS; IFS=$ac_path_separator
12849 ac_dummy="$PATH"
12850 for ac_dir in $ac_dummy; do
12851   IFS=$ac_save_IFS
12852   test -z "$ac_dir" && ac_dir=.
12853   $as_executable_p "$ac_dir/$ac_word" || continue
12854 ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_prog"
12855 echo "$as_me:12855: found $ac_dir/$ac_word" >&5
12856 break
12857 done
12858
12859 fi
12860 fi
12861 ac_ct_XCURSES_CONFIG=$ac_cv_prog_ac_ct_XCURSES_CONFIG
12862 if test -n "$ac_ct_XCURSES_CONFIG"; then
12863   echo "$as_me:12863: result: $ac_ct_XCURSES_CONFIG" >&5
12864 echo "${ECHO_T}$ac_ct_XCURSES_CONFIG" >&6
12865 else
12866   echo "$as_me:12866: result: no" >&5
12867 echo "${ECHO_T}no" >&6
12868 fi
12869
12870   test -n "$ac_ct_XCURSES_CONFIG" && break
12871 done
12872 test -n "$ac_ct_XCURSES_CONFIG" || ac_ct_XCURSES_CONFIG="none"
12873
12874   XCURSES_CONFIG=$ac_ct_XCURSES_CONFIG
12875 fi
12876
12877 if test "$XCURSES_CONFIG" != none ; then
12878
12879 CPPFLAGS="$CPPFLAGS `$XCURSES_CONFIG --cflags`"
12880
12881 cf_add_libs="`$XCURSES_CONFIG --libs`"
12882 # Filter out duplicates - this happens with badly-designed ".pc" files...
12883 for cf_add_1lib in $LIBS
12884 do
12885         for cf_add_2lib in $cf_add_libs
12886         do
12887                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12888                 then
12889                         cf_add_1lib=
12890                         break
12891                 fi
12892         done
12893         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12894 done
12895 LIBS="$cf_add_libs"
12896
12897 cf_cv_lib_XCurses=yes
12898
12899 else
12900
12901 LDFLAGS="$LDFLAGS $X_LIBS"
12902
12903 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
12904
12905 echo "${as_me:-configure}:12905: testing checking additions to CFLAGS ..." 1>&5
12906
12907 cf_check_cflags="$CFLAGS"
12908 cf_check_cppflags="$CPPFLAGS"
12909
12910 cf_fix_cppflags=no
12911 cf_new_cflags=
12912 cf_new_cppflags=
12913 cf_new_extra_cppflags=
12914
12915 for cf_add_cflags in $X_CFLAGS
12916 do
12917 case $cf_fix_cppflags in
12918 (no)
12919         case $cf_add_cflags in
12920         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12921                 case $cf_add_cflags in
12922                 (-D*)
12923                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12924
12925                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12926                                 && test -z "${cf_tst_cflags}" \
12927                                 && cf_fix_cppflags=yes
12928
12929                         if test $cf_fix_cppflags = yes ; then
12930                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12931                                 continue
12932                         elif test "${cf_tst_cflags}" = "\"'" ; then
12933                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12934                                 continue
12935                         fi
12936                         ;;
12937                 esac
12938                 case "$CPPFLAGS" in
12939                 (*$cf_add_cflags)
12940                         ;;
12941                 (*)
12942                         case $cf_add_cflags in
12943                         (-D*)
12944                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12945
12946 CPPFLAGS=`echo "$CPPFLAGS" | \
12947         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12948                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12949
12950                                 ;;
12951                         esac
12952                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
12953                         ;;
12954                 esac
12955                 ;;
12956         (*)
12957                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
12958                 ;;
12959         esac
12960         ;;
12961 (yes)
12962         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12963
12964         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12965
12966         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12967                 && test -z "${cf_tst_cflags}" \
12968                 && cf_fix_cppflags=no
12969         ;;
12970 esac
12971 done
12972
12973 if test -n "$cf_new_cflags" ; then
12974         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
12975
12976 echo "${as_me:-configure}:12976: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
12977
12978         CFLAGS="$CFLAGS $cf_new_cflags"
12979 fi
12980
12981 if test -n "$cf_new_cppflags" ; then
12982         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
12983
12984 echo "${as_me:-configure}:12984: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
12985
12986         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
12987 fi
12988
12989 if test -n "$cf_new_extra_cppflags" ; then
12990         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
12991
12992 echo "${as_me:-configure}:12992: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
12993
12994         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
12995 fi
12996
12997 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
12998 cat >conftest.$ac_ext <<_ACEOF
12999 #line 12999 "configure"
13000 #include "confdefs.h"
13001 #include <stdio.h>
13002 int
13003 main ()
13004 {
13005 printf("Hello world");
13006   ;
13007   return 0;
13008 }
13009 _ACEOF
13010 rm -f conftest.$ac_objext conftest$ac_exeext
13011 if { (eval echo "$as_me:13011: \"$ac_link\"") >&5
13012   (eval $ac_link) 2>&5
13013   ac_status=$?
13014   echo "$as_me:13014: \$? = $ac_status" >&5
13015   (exit $ac_status); } &&
13016          { ac_try='test -s conftest$ac_exeext'
13017   { (eval echo "$as_me:13017: \"$ac_try\"") >&5
13018   (eval $ac_try) 2>&5
13019   ac_status=$?
13020   echo "$as_me:13020: \$? = $ac_status" >&5
13021   (exit $ac_status); }; }; then
13022   :
13023 else
13024   echo "$as_me: failed program was:" >&5
13025 cat conftest.$ac_ext >&5
13026 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
13027
13028 echo "${as_me:-configure}:13028: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
13029
13030          if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
13031                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
13032
13033 echo "${as_me:-configure}:13033: testing but keeping change to \$CPPFLAGS ..." 1>&5
13034
13035          fi
13036          CFLAGS="$cf_check_flags"
13037 fi
13038 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13039 fi
13040
13041 echo "$as_me:13041: checking for XOpenDisplay in -lX11" >&5
13042 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
13043 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
13044   echo $ECHO_N "(cached) $ECHO_C" >&6
13045 else
13046   ac_check_lib_save_LIBS=$LIBS
13047 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
13048 cat >conftest.$ac_ext <<_ACEOF
13049 #line 13049 "configure"
13050 #include "confdefs.h"
13051
13052 /* Override any gcc2 internal prototype to avoid an error.  */
13053 #ifdef __cplusplus
13054 extern "C"
13055 #endif
13056 /* We use char because int might match the return type of a gcc2
13057    builtin and then its argument prototype would still apply.  */
13058 char XOpenDisplay ();
13059 int
13060 main ()
13061 {
13062 XOpenDisplay ();
13063   ;
13064   return 0;
13065 }
13066 _ACEOF
13067 rm -f conftest.$ac_objext conftest$ac_exeext
13068 if { (eval echo "$as_me:13068: \"$ac_link\"") >&5
13069   (eval $ac_link) 2>&5
13070   ac_status=$?
13071   echo "$as_me:13071: \$? = $ac_status" >&5
13072   (exit $ac_status); } &&
13073          { ac_try='test -s conftest$ac_exeext'
13074   { (eval echo "$as_me:13074: \"$ac_try\"") >&5
13075   (eval $ac_try) 2>&5
13076   ac_status=$?
13077   echo "$as_me:13077: \$? = $ac_status" >&5
13078   (exit $ac_status); }; }; then
13079   ac_cv_lib_X11_XOpenDisplay=yes
13080 else
13081   echo "$as_me: failed program was:" >&5
13082 cat conftest.$ac_ext >&5
13083 ac_cv_lib_X11_XOpenDisplay=no
13084 fi
13085 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13086 LIBS=$ac_check_lib_save_LIBS
13087 fi
13088 echo "$as_me:13088: result: $ac_cv_lib_X11_XOpenDisplay" >&5
13089 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
13090 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
13091
13092 cf_add_libs="-lX11"
13093 # Filter out duplicates - this happens with badly-designed ".pc" files...
13094 for cf_add_1lib in $LIBS
13095 do
13096         for cf_add_2lib in $cf_add_libs
13097         do
13098                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13099                 then
13100                         cf_add_1lib=
13101                         break
13102                 fi
13103         done
13104         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13105 done
13106 LIBS="$cf_add_libs"
13107
13108 fi
13109
13110 echo "$as_me:13110: checking for XCurses library" >&5
13111 echo $ECHO_N "checking for XCurses library... $ECHO_C" >&6
13112 if test "${cf_cv_lib_XCurses+set}" = set; then
13113   echo $ECHO_N "(cached) $ECHO_C" >&6
13114 else
13115
13116 cf_add_libs="-lXCurses"
13117 # Filter out duplicates - this happens with badly-designed ".pc" files...
13118 for cf_add_1lib in $LIBS
13119 do
13120         for cf_add_2lib in $cf_add_libs
13121         do
13122                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13123                 then
13124                         cf_add_1lib=
13125                         break
13126                 fi
13127         done
13128         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13129 done
13130 LIBS="$cf_add_libs"
13131
13132 cat >conftest.$ac_ext <<_ACEOF
13133 #line 13133 "configure"
13134 #include "confdefs.h"
13135
13136 #include <xcurses.h>
13137 char *XCursesProgramName = "test";
13138
13139 int
13140 main ()
13141 {
13142 XCursesExit();
13143   ;
13144   return 0;
13145 }
13146 _ACEOF
13147 rm -f conftest.$ac_objext conftest$ac_exeext
13148 if { (eval echo "$as_me:13148: \"$ac_link\"") >&5
13149   (eval $ac_link) 2>&5
13150   ac_status=$?
13151   echo "$as_me:13151: \$? = $ac_status" >&5
13152   (exit $ac_status); } &&
13153          { ac_try='test -s conftest$ac_exeext'
13154   { (eval echo "$as_me:13154: \"$ac_try\"") >&5
13155   (eval $ac_try) 2>&5
13156   ac_status=$?
13157   echo "$as_me:13157: \$? = $ac_status" >&5
13158   (exit $ac_status); }; }; then
13159   cf_cv_lib_XCurses=yes
13160 else
13161   echo "$as_me: failed program was:" >&5
13162 cat conftest.$ac_ext >&5
13163 cf_cv_lib_XCurses=no
13164 fi
13165 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13166
13167 fi
13168 echo "$as_me:13168: result: $cf_cv_lib_XCurses" >&5
13169 echo "${ECHO_T}$cf_cv_lib_XCurses" >&6
13170
13171 fi
13172
13173 if test $cf_cv_lib_XCurses = yes ; then
13174
13175 cat >>confdefs.h <<\EOF
13176 #define UNIX 1
13177 EOF
13178
13179 cat >>confdefs.h <<\EOF
13180 #define XCURSES 1
13181 EOF
13182
13183         echo "$as_me:13183: checking for xcurses.h" >&5
13184 echo $ECHO_N "checking for xcurses.h... $ECHO_C" >&6
13185 if test "${ac_cv_header_xcurses_h+set}" = set; then
13186   echo $ECHO_N "(cached) $ECHO_C" >&6
13187 else
13188   cat >conftest.$ac_ext <<_ACEOF
13189 #line 13189 "configure"
13190 #include "confdefs.h"
13191 #include <xcurses.h>
13192 _ACEOF
13193 if { (eval echo "$as_me:13193: \"$ac_cpp conftest.$ac_ext\"") >&5
13194   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13195   ac_status=$?
13196   egrep -v '^ *\+' conftest.er1 >conftest.err
13197   rm -f conftest.er1
13198   cat conftest.err >&5
13199   echo "$as_me:13199: \$? = $ac_status" >&5
13200   (exit $ac_status); } >/dev/null; then
13201   if test -s conftest.err; then
13202     ac_cpp_err=$ac_c_preproc_warn_flag
13203   else
13204     ac_cpp_err=
13205   fi
13206 else
13207   ac_cpp_err=yes
13208 fi
13209 if test -z "$ac_cpp_err"; then
13210   ac_cv_header_xcurses_h=yes
13211 else
13212   echo "$as_me: failed program was:" >&5
13213   cat conftest.$ac_ext >&5
13214   ac_cv_header_xcurses_h=no
13215 fi
13216 rm -f conftest.err conftest.$ac_ext
13217 fi
13218 echo "$as_me:13218: result: $ac_cv_header_xcurses_h" >&5
13219 echo "${ECHO_T}$ac_cv_header_xcurses_h" >&6
13220 if test $ac_cv_header_xcurses_h = yes; then
13221
13222 cat >>confdefs.h <<\EOF
13223 #define HAVE_XCURSES 1
13224 EOF
13225
13226 fi
13227
13228 else
13229         { { echo "$as_me:13229: error: Cannot link with XCurses" >&5
13230 echo "$as_me: error: Cannot link with XCurses" >&2;}
13231    { (exit 1); exit 1; }; }
13232 fi
13233
13234         ;;
13235 (*)
13236         { { echo "$as_me:13236: error: unexpected screen-value: $cf_cv_screen" >&5
13237 echo "$as_me: error: unexpected screen-value: $cf_cv_screen" >&2;}
13238    { (exit 1); exit 1; }; }
13239         ;;
13240 esac
13241
13242 : ${cf_nculib_root:=$cf_cv_screen}
13243 as_ac_Lib=`echo "ac_cv_lib_$cf_nculib_root''__nc_init_pthreads" | $as_tr_sh`
13244 echo "$as_me:13244: checking for _nc_init_pthreads in -l$cf_nculib_root" >&5
13245 echo $ECHO_N "checking for _nc_init_pthreads in -l$cf_nculib_root... $ECHO_C" >&6
13246 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
13247   echo $ECHO_N "(cached) $ECHO_C" >&6
13248 else
13249   ac_check_lib_save_LIBS=$LIBS
13250 LIBS="-l$cf_nculib_root  $LIBS"
13251 cat >conftest.$ac_ext <<_ACEOF
13252 #line 13252 "configure"
13253 #include "confdefs.h"
13254
13255 /* Override any gcc2 internal prototype to avoid an error.  */
13256 #ifdef __cplusplus
13257 extern "C"
13258 #endif
13259 /* We use char because int might match the return type of a gcc2
13260    builtin and then its argument prototype would still apply.  */
13261 char _nc_init_pthreads ();
13262 int
13263 main ()
13264 {
13265 _nc_init_pthreads ();
13266   ;
13267   return 0;
13268 }
13269 _ACEOF
13270 rm -f conftest.$ac_objext conftest$ac_exeext
13271 if { (eval echo "$as_me:13271: \"$ac_link\"") >&5
13272   (eval $ac_link) 2>&5
13273   ac_status=$?
13274   echo "$as_me:13274: \$? = $ac_status" >&5
13275   (exit $ac_status); } &&
13276          { ac_try='test -s conftest$ac_exeext'
13277   { (eval echo "$as_me:13277: \"$ac_try\"") >&5
13278   (eval $ac_try) 2>&5
13279   ac_status=$?
13280   echo "$as_me:13280: \$? = $ac_status" >&5
13281   (exit $ac_status); }; }; then
13282   eval "$as_ac_Lib=yes"
13283 else
13284   echo "$as_me: failed program was:" >&5
13285 cat conftest.$ac_ext >&5
13286 eval "$as_ac_Lib=no"
13287 fi
13288 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13289 LIBS=$ac_check_lib_save_LIBS
13290 fi
13291 echo "$as_me:13291: result: `eval echo '${'$as_ac_Lib'}'`" >&5
13292 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
13293 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
13294   cf_cv_ncurses_pthreads=yes
13295 else
13296   cf_cv_ncurses_pthreads=no
13297 fi
13298
13299 if test "$cf_cv_ncurses_pthreads" = yes
13300 then
13301
13302 cf_add_libs="-lpthread"
13303 # Filter out duplicates - this happens with badly-designed ".pc" files...
13304 for cf_add_1lib in $LIBS
13305 do
13306         for cf_add_2lib in $cf_add_libs
13307         do
13308                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13309                 then
13310                         cf_add_1lib=
13311                         break
13312                 fi
13313         done
13314         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13315 done
13316 LIBS="$cf_add_libs"
13317
13318 fi
13319
13320 case $cf_cv_screen in
13321 (ncurses*)
13322         cf_cv_libtype=`echo "$cf_cv_screen" | sed -e 's/^ncurses//'`
13323         ;;
13324 (curses|curses_*)
13325
13326 echo "$as_me:13326: checking for NetBSD form.h" >&5
13327 echo $ECHO_N "checking for NetBSD form.h... $ECHO_C" >&6
13328 if test "${cf_cv_netbsd_form_h+set}" = set; then
13329   echo $ECHO_N "(cached) $ECHO_C" >&6
13330 else
13331
13332 cat >conftest.$ac_ext <<_ACEOF
13333 #line 13333 "configure"
13334 #include "confdefs.h"
13335
13336 #include <${cf_cv_ncurses_header:-curses.h}>
13337 #include <form.h>
13338
13339 int
13340 main ()
13341 {
13342
13343         FORM *form;
13344         int y = current_field(form)->cursor_ypos;
13345         int x = current_field(form)->cursor_xpos;
13346
13347   ;
13348   return 0;
13349 }
13350 _ACEOF
13351 rm -f conftest.$ac_objext
13352 if { (eval echo "$as_me:13352: \"$ac_compile\"") >&5
13353   (eval $ac_compile) 2>&5
13354   ac_status=$?
13355   echo "$as_me:13355: \$? = $ac_status" >&5
13356   (exit $ac_status); } &&
13357          { ac_try='test -s conftest.$ac_objext'
13358   { (eval echo "$as_me:13358: \"$ac_try\"") >&5
13359   (eval $ac_try) 2>&5
13360   ac_status=$?
13361   echo "$as_me:13361: \$? = $ac_status" >&5
13362   (exit $ac_status); }; }; then
13363   cf_cv_netbsd_form_h=yes
13364
13365 else
13366   echo "$as_me: failed program was:" >&5
13367 cat conftest.$ac_ext >&5
13368 cf_cv_netbsd_form_h=no
13369 fi
13370 rm -f conftest.$ac_objext conftest.$ac_ext
13371
13372 fi
13373 echo "$as_me:13373: result: $cf_cv_netbsd_form_h" >&5
13374 echo "${ECHO_T}$cf_cv_netbsd_form_h" >&6
13375
13376 test "$cf_cv_netbsd_form_h" = yes &&
13377 cat >>confdefs.h <<\EOF
13378 #define HAVE_NETBSD_FORM_H 1
13379 EOF
13380
13381 echo "$as_me:13381: checking for NetBSD menu.h" >&5
13382 echo $ECHO_N "checking for NetBSD menu.h... $ECHO_C" >&6
13383 if test "${cf_cv_netbsd_menu_h+set}" = set; then
13384   echo $ECHO_N "(cached) $ECHO_C" >&6
13385 else
13386
13387 cat >conftest.$ac_ext <<_ACEOF
13388 #line 13388 "configure"
13389 #include "confdefs.h"
13390
13391 #include <${cf_cv_ncurses_header:-curses.h}>
13392 #include <menu.h>
13393
13394 int
13395 main ()
13396 {
13397
13398         MENU *menu;
13399         int y = menu->max_item_width;
13400
13401   ;
13402   return 0;
13403 }
13404 _ACEOF
13405 rm -f conftest.$ac_objext
13406 if { (eval echo "$as_me:13406: \"$ac_compile\"") >&5
13407   (eval $ac_compile) 2>&5
13408   ac_status=$?
13409   echo "$as_me:13409: \$? = $ac_status" >&5
13410   (exit $ac_status); } &&
13411          { ac_try='test -s conftest.$ac_objext'
13412   { (eval echo "$as_me:13412: \"$ac_try\"") >&5
13413   (eval $ac_try) 2>&5
13414   ac_status=$?
13415   echo "$as_me:13415: \$? = $ac_status" >&5
13416   (exit $ac_status); }; }; then
13417   cf_cv_netbsd_menu_h=yes
13418
13419 else
13420   echo "$as_me: failed program was:" >&5
13421 cat conftest.$ac_ext >&5
13422 cf_cv_netbsd_menu_h=no
13423 fi
13424 rm -f conftest.$ac_objext conftest.$ac_ext
13425
13426 fi
13427 echo "$as_me:13427: result: $cf_cv_netbsd_menu_h" >&5
13428 echo "${ECHO_T}$cf_cv_netbsd_menu_h" >&6
13429
13430 test "$cf_cv_netbsd_menu_h" = yes &&
13431 cat >>confdefs.h <<\EOF
13432 #define HAVE_NETBSD_MENU_H 1
13433 EOF
13434
13435         ;;
13436 esac
13437
13438 case $cf_cv_screen in
13439 (pdcurses)
13440         ;;
13441 (*)
13442         # look for curses-related libraries
13443
13444 as_ac_Lib=`echo "ac_cv_lib_panel$cf_cv_libtype''_new_panel" | $as_tr_sh`
13445 echo "$as_me:13445: checking for new_panel in -lpanel$cf_cv_libtype" >&5
13446 echo $ECHO_N "checking for new_panel in -lpanel$cf_cv_libtype... $ECHO_C" >&6
13447 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
13448   echo $ECHO_N "(cached) $ECHO_C" >&6
13449 else
13450   ac_check_lib_save_LIBS=$LIBS
13451 LIBS="-lpanel$cf_cv_libtype  $LIBS"
13452 cat >conftest.$ac_ext <<_ACEOF
13453 #line 13453 "configure"
13454 #include "confdefs.h"
13455
13456 /* Override any gcc2 internal prototype to avoid an error.  */
13457 #ifdef __cplusplus
13458 extern "C"
13459 #endif
13460 /* We use char because int might match the return type of a gcc2
13461    builtin and then its argument prototype would still apply.  */
13462 char new_panel ();
13463 int
13464 main ()
13465 {
13466 new_panel ();
13467   ;
13468   return 0;
13469 }
13470 _ACEOF
13471 rm -f conftest.$ac_objext conftest$ac_exeext
13472 if { (eval echo "$as_me:13472: \"$ac_link\"") >&5
13473   (eval $ac_link) 2>&5
13474   ac_status=$?
13475   echo "$as_me:13475: \$? = $ac_status" >&5
13476   (exit $ac_status); } &&
13477          { ac_try='test -s conftest$ac_exeext'
13478   { (eval echo "$as_me:13478: \"$ac_try\"") >&5
13479   (eval $ac_try) 2>&5
13480   ac_status=$?
13481   echo "$as_me:13481: \$? = $ac_status" >&5
13482   (exit $ac_status); }; }; then
13483   eval "$as_ac_Lib=yes"
13484 else
13485   echo "$as_me: failed program was:" >&5
13486 cat conftest.$ac_ext >&5
13487 eval "$as_ac_Lib=no"
13488 fi
13489 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13490 LIBS=$ac_check_lib_save_LIBS
13491 fi
13492 echo "$as_me:13492: result: `eval echo '${'$as_ac_Lib'}'`" >&5
13493 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
13494 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
13495
13496 cf_upper=`echo "have_libpanel" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
13497
13498 cf_add_libs="-lpanel$cf_cv_libtype"
13499 # Filter out duplicates - this happens with badly-designed ".pc" files...
13500 for cf_add_1lib in $LIBS
13501 do
13502         for cf_add_2lib in $cf_add_libs
13503         do
13504                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13505                 then
13506                         cf_add_1lib=
13507                         break
13508                 fi
13509         done
13510         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13511 done
13512 LIBS="$cf_add_libs"
13513
13514 cat >>confdefs.h <<EOF
13515 #define $cf_upper 1
13516 EOF
13517
13518 fi
13519
13520 as_ac_Lib=`echo "ac_cv_lib_menu$cf_cv_libtype''_menu_driver" | $as_tr_sh`
13521 echo "$as_me:13521: checking for menu_driver in -lmenu$cf_cv_libtype" >&5
13522 echo $ECHO_N "checking for menu_driver in -lmenu$cf_cv_libtype... $ECHO_C" >&6
13523 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
13524   echo $ECHO_N "(cached) $ECHO_C" >&6
13525 else
13526   ac_check_lib_save_LIBS=$LIBS
13527 LIBS="-lmenu$cf_cv_libtype  $LIBS"
13528 cat >conftest.$ac_ext <<_ACEOF
13529 #line 13529 "configure"
13530 #include "confdefs.h"
13531
13532 /* Override any gcc2 internal prototype to avoid an error.  */
13533 #ifdef __cplusplus
13534 extern "C"
13535 #endif
13536 /* We use char because int might match the return type of a gcc2
13537    builtin and then its argument prototype would still apply.  */
13538 char menu_driver ();
13539 int
13540 main ()
13541 {
13542 menu_driver ();
13543   ;
13544   return 0;
13545 }
13546 _ACEOF
13547 rm -f conftest.$ac_objext conftest$ac_exeext
13548 if { (eval echo "$as_me:13548: \"$ac_link\"") >&5
13549   (eval $ac_link) 2>&5
13550   ac_status=$?
13551   echo "$as_me:13551: \$? = $ac_status" >&5
13552   (exit $ac_status); } &&
13553          { ac_try='test -s conftest$ac_exeext'
13554   { (eval echo "$as_me:13554: \"$ac_try\"") >&5
13555   (eval $ac_try) 2>&5
13556   ac_status=$?
13557   echo "$as_me:13557: \$? = $ac_status" >&5
13558   (exit $ac_status); }; }; then
13559   eval "$as_ac_Lib=yes"
13560 else
13561   echo "$as_me: failed program was:" >&5
13562 cat conftest.$ac_ext >&5
13563 eval "$as_ac_Lib=no"
13564 fi
13565 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13566 LIBS=$ac_check_lib_save_LIBS
13567 fi
13568 echo "$as_me:13568: result: `eval echo '${'$as_ac_Lib'}'`" >&5
13569 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
13570 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
13571
13572 cf_upper=`echo "have_libmenu" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
13573
13574 cf_add_libs="-lmenu$cf_cv_libtype"
13575 # Filter out duplicates - this happens with badly-designed ".pc" files...
13576 for cf_add_1lib in $LIBS
13577 do
13578         for cf_add_2lib in $cf_add_libs
13579         do
13580                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13581                 then
13582                         cf_add_1lib=
13583                         break
13584                 fi
13585         done
13586         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13587 done
13588 LIBS="$cf_add_libs"
13589
13590 cat >>confdefs.h <<EOF
13591 #define $cf_upper 1
13592 EOF
13593
13594 fi
13595
13596 as_ac_Lib=`echo "ac_cv_lib_form$cf_cv_libtype''_form_driver" | $as_tr_sh`
13597 echo "$as_me:13597: checking for form_driver in -lform$cf_cv_libtype" >&5
13598 echo $ECHO_N "checking for form_driver in -lform$cf_cv_libtype... $ECHO_C" >&6
13599 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
13600   echo $ECHO_N "(cached) $ECHO_C" >&6
13601 else
13602   ac_check_lib_save_LIBS=$LIBS
13603 LIBS="-lform$cf_cv_libtype  $LIBS"
13604 cat >conftest.$ac_ext <<_ACEOF
13605 #line 13605 "configure"
13606 #include "confdefs.h"
13607
13608 /* Override any gcc2 internal prototype to avoid an error.  */
13609 #ifdef __cplusplus
13610 extern "C"
13611 #endif
13612 /* We use char because int might match the return type of a gcc2
13613    builtin and then its argument prototype would still apply.  */
13614 char form_driver ();
13615 int
13616 main ()
13617 {
13618 form_driver ();
13619   ;
13620   return 0;
13621 }
13622 _ACEOF
13623 rm -f conftest.$ac_objext conftest$ac_exeext
13624 if { (eval echo "$as_me:13624: \"$ac_link\"") >&5
13625   (eval $ac_link) 2>&5
13626   ac_status=$?
13627   echo "$as_me:13627: \$? = $ac_status" >&5
13628   (exit $ac_status); } &&
13629          { ac_try='test -s conftest$ac_exeext'
13630   { (eval echo "$as_me:13630: \"$ac_try\"") >&5
13631   (eval $ac_try) 2>&5
13632   ac_status=$?
13633   echo "$as_me:13633: \$? = $ac_status" >&5
13634   (exit $ac_status); }; }; then
13635   eval "$as_ac_Lib=yes"
13636 else
13637   echo "$as_me: failed program was:" >&5
13638 cat conftest.$ac_ext >&5
13639 eval "$as_ac_Lib=no"
13640 fi
13641 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13642 LIBS=$ac_check_lib_save_LIBS
13643 fi
13644 echo "$as_me:13644: result: `eval echo '${'$as_ac_Lib'}'`" >&5
13645 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
13646 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
13647
13648 cf_upper=`echo "have_libform" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
13649
13650 cf_add_libs="-lform$cf_cv_libtype"
13651 # Filter out duplicates - this happens with badly-designed ".pc" files...
13652 for cf_add_1lib in $LIBS
13653 do
13654         for cf_add_2lib in $cf_add_libs
13655         do
13656                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13657                 then
13658                         cf_add_1lib=
13659                         break
13660                 fi
13661         done
13662         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13663 done
13664 LIBS="$cf_add_libs"
13665
13666 cat >>confdefs.h <<EOF
13667 #define $cf_upper 1
13668 EOF
13669
13670 fi
13671
13672         # look for curses-related headers
13673
13674 for ac_header in \
13675                 nc_alloc.h \
13676                 nomacros.h \
13677                 form.h \
13678                 menu.h \
13679                 panel.h \
13680                 term_entry.h \
13681
13682 do
13683 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
13684 echo "$as_me:13684: checking for $ac_header" >&5
13685 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
13686 if eval "test \"\${$as_ac_Header+set}\" = set"; then
13687   echo $ECHO_N "(cached) $ECHO_C" >&6
13688 else
13689   cat >conftest.$ac_ext <<_ACEOF
13690 #line 13690 "configure"
13691 #include "confdefs.h"
13692 #include <$ac_header>
13693 _ACEOF
13694 if { (eval echo "$as_me:13694: \"$ac_cpp conftest.$ac_ext\"") >&5
13695   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13696   ac_status=$?
13697   egrep -v '^ *\+' conftest.er1 >conftest.err
13698   rm -f conftest.er1
13699   cat conftest.err >&5
13700   echo "$as_me:13700: \$? = $ac_status" >&5
13701   (exit $ac_status); } >/dev/null; then
13702   if test -s conftest.err; then
13703     ac_cpp_err=$ac_c_preproc_warn_flag
13704   else
13705     ac_cpp_err=
13706   fi
13707 else
13708   ac_cpp_err=yes
13709 fi
13710 if test -z "$ac_cpp_err"; then
13711   eval "$as_ac_Header=yes"
13712 else
13713   echo "$as_me: failed program was:" >&5
13714   cat conftest.$ac_ext >&5
13715   eval "$as_ac_Header=no"
13716 fi
13717 rm -f conftest.err conftest.$ac_ext
13718 fi
13719 echo "$as_me:13719: result: `eval echo '${'$as_ac_Header'}'`" >&5
13720 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
13721 if test `eval echo '${'$as_ac_Header'}'` = yes; then
13722   cat >>confdefs.h <<EOF
13723 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
13724 EOF
13725
13726 fi
13727 done
13728
13729         ;;
13730 esac
13731
13732 echo "$as_me:13732: checking for ANSI C header files" >&5
13733 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
13734 if test "${ac_cv_header_stdc+set}" = set; then
13735   echo $ECHO_N "(cached) $ECHO_C" >&6
13736 else
13737   cat >conftest.$ac_ext <<_ACEOF
13738 #line 13738 "configure"
13739 #include "confdefs.h"
13740 #include <stdlib.h>
13741 #include <stdarg.h>
13742 #include <string.h>
13743 #include <float.h>
13744
13745 _ACEOF
13746 if { (eval echo "$as_me:13746: \"$ac_cpp conftest.$ac_ext\"") >&5
13747   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13748   ac_status=$?
13749   egrep -v '^ *\+' conftest.er1 >conftest.err
13750   rm -f conftest.er1
13751   cat conftest.err >&5
13752   echo "$as_me:13752: \$? = $ac_status" >&5
13753   (exit $ac_status); } >/dev/null; then
13754   if test -s conftest.err; then
13755     ac_cpp_err=$ac_c_preproc_warn_flag
13756   else
13757     ac_cpp_err=
13758   fi
13759 else
13760   ac_cpp_err=yes
13761 fi
13762 if test -z "$ac_cpp_err"; then
13763   ac_cv_header_stdc=yes
13764 else
13765   echo "$as_me: failed program was:" >&5
13766   cat conftest.$ac_ext >&5
13767   ac_cv_header_stdc=no
13768 fi
13769 rm -f conftest.err conftest.$ac_ext
13770
13771 if test $ac_cv_header_stdc = yes; then
13772   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
13773   cat >conftest.$ac_ext <<_ACEOF
13774 #line 13774 "configure"
13775 #include "confdefs.h"
13776 #include <string.h>
13777
13778 _ACEOF
13779 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13780   egrep "memchr" >/dev/null 2>&1; then
13781   :
13782 else
13783   ac_cv_header_stdc=no
13784 fi
13785 rm -rf conftest*
13786
13787 fi
13788
13789 if test $ac_cv_header_stdc = yes; then
13790   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
13791   cat >conftest.$ac_ext <<_ACEOF
13792 #line 13792 "configure"
13793 #include "confdefs.h"
13794 #include <stdlib.h>
13795
13796 _ACEOF
13797 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13798   egrep "free" >/dev/null 2>&1; then
13799   :
13800 else
13801   ac_cv_header_stdc=no
13802 fi
13803 rm -rf conftest*
13804
13805 fi
13806
13807 if test $ac_cv_header_stdc = yes; then
13808   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
13809   if test "$cross_compiling" = yes; then
13810   :
13811 else
13812   cat >conftest.$ac_ext <<_ACEOF
13813 #line 13813 "configure"
13814 #include "confdefs.h"
13815 #include <ctype.h>
13816 #if ((' ' & 0x0FF) == 0x020)
13817 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
13818 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
13819 #else
13820 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
13821                      || ('j' <= (c) && (c) <= 'r') \
13822                      || ('s' <= (c) && (c) <= 'z'))
13823 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
13824 #endif
13825
13826 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
13827 int
13828 main ()
13829 {
13830   int i;
13831   for (i = 0; i < 256; i++)
13832     if (XOR (islower (i), ISLOWER (i))
13833         || toupper (i) != TOUPPER (i))
13834       $ac_main_return(2);
13835   $ac_main_return (0);
13836 }
13837 _ACEOF
13838 rm -f conftest$ac_exeext
13839 if { (eval echo "$as_me:13839: \"$ac_link\"") >&5
13840   (eval $ac_link) 2>&5
13841   ac_status=$?
13842   echo "$as_me:13842: \$? = $ac_status" >&5
13843   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
13844   { (eval echo "$as_me:13844: \"$ac_try\"") >&5
13845   (eval $ac_try) 2>&5
13846   ac_status=$?
13847   echo "$as_me:13847: \$? = $ac_status" >&5
13848   (exit $ac_status); }; }; then
13849   :
13850 else
13851   echo "$as_me: program exited with status $ac_status" >&5
13852 echo "$as_me: failed program was:" >&5
13853 cat conftest.$ac_ext >&5
13854 ac_cv_header_stdc=no
13855 fi
13856 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
13857 fi
13858 fi
13859 fi
13860 echo "$as_me:13860: result: $ac_cv_header_stdc" >&5
13861 echo "${ECHO_T}$ac_cv_header_stdc" >&6
13862 if test $ac_cv_header_stdc = yes; then
13863
13864 cat >>confdefs.h <<\EOF
13865 #define STDC_HEADERS 1
13866 EOF
13867
13868 fi
13869
13870 echo "$as_me:13870: checking whether time.h and sys/time.h may both be included" >&5
13871 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
13872 if test "${ac_cv_header_time+set}" = set; then
13873   echo $ECHO_N "(cached) $ECHO_C" >&6
13874 else
13875   cat >conftest.$ac_ext <<_ACEOF
13876 #line 13876 "configure"
13877 #include "confdefs.h"
13878 #include <sys/types.h>
13879 #include <sys/time.h>
13880 #include <time.h>
13881
13882 int
13883 main ()
13884 {
13885 if ((struct tm *) 0)
13886 return 0;
13887   ;
13888   return 0;
13889 }
13890 _ACEOF
13891 rm -f conftest.$ac_objext
13892 if { (eval echo "$as_me:13892: \"$ac_compile\"") >&5
13893   (eval $ac_compile) 2>&5
13894   ac_status=$?
13895   echo "$as_me:13895: \$? = $ac_status" >&5
13896   (exit $ac_status); } &&
13897          { ac_try='test -s conftest.$ac_objext'
13898   { (eval echo "$as_me:13898: \"$ac_try\"") >&5
13899   (eval $ac_try) 2>&5
13900   ac_status=$?
13901   echo "$as_me:13901: \$? = $ac_status" >&5
13902   (exit $ac_status); }; }; then
13903   ac_cv_header_time=yes
13904 else
13905   echo "$as_me: failed program was:" >&5
13906 cat conftest.$ac_ext >&5
13907 ac_cv_header_time=no
13908 fi
13909 rm -f conftest.$ac_objext conftest.$ac_ext
13910 fi
13911 echo "$as_me:13911: result: $ac_cv_header_time" >&5
13912 echo "${ECHO_T}$ac_cv_header_time" >&6
13913 if test $ac_cv_header_time = yes; then
13914
13915 cat >>confdefs.h <<\EOF
13916 #define TIME_WITH_SYS_TIME 1
13917 EOF
13918
13919 fi
13920
13921 for ac_header in \
13922 getopt.h \
13923 locale.h \
13924 math.h \
13925 stdarg.h \
13926 sys/ioctl.h \
13927 sys/select.h \
13928 sys/time.h \
13929 termios.h \
13930 unistd.h \
13931
13932 do
13933 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
13934 echo "$as_me:13934: checking for $ac_header" >&5
13935 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
13936 if eval "test \"\${$as_ac_Header+set}\" = set"; then
13937   echo $ECHO_N "(cached) $ECHO_C" >&6
13938 else
13939   cat >conftest.$ac_ext <<_ACEOF
13940 #line 13940 "configure"
13941 #include "confdefs.h"
13942 #include <$ac_header>
13943 _ACEOF
13944 if { (eval echo "$as_me:13944: \"$ac_cpp conftest.$ac_ext\"") >&5
13945   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13946   ac_status=$?
13947   egrep -v '^ *\+' conftest.er1 >conftest.err
13948   rm -f conftest.er1
13949   cat conftest.err >&5
13950   echo "$as_me:13950: \$? = $ac_status" >&5
13951   (exit $ac_status); } >/dev/null; then
13952   if test -s conftest.err; then
13953     ac_cpp_err=$ac_c_preproc_warn_flag
13954   else
13955     ac_cpp_err=
13956   fi
13957 else
13958   ac_cpp_err=yes
13959 fi
13960 if test -z "$ac_cpp_err"; then
13961   eval "$as_ac_Header=yes"
13962 else
13963   echo "$as_me: failed program was:" >&5
13964   cat conftest.$ac_ext >&5
13965   eval "$as_ac_Header=no"
13966 fi
13967 rm -f conftest.err conftest.$ac_ext
13968 fi
13969 echo "$as_me:13969: result: `eval echo '${'$as_ac_Header'}'`" >&5
13970 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
13971 if test `eval echo '${'$as_ac_Header'}'` = yes; then
13972   cat >>confdefs.h <<EOF
13973 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
13974 EOF
13975
13976 fi
13977 done
13978
13979 for ac_header in unistd.h getopt.h
13980 do
13981 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
13982 echo "$as_me:13982: checking for $ac_header" >&5
13983 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
13984 if eval "test \"\${$as_ac_Header+set}\" = set"; then
13985   echo $ECHO_N "(cached) $ECHO_C" >&6
13986 else
13987   cat >conftest.$ac_ext <<_ACEOF
13988 #line 13988 "configure"
13989 #include "confdefs.h"
13990 #include <$ac_header>
13991 _ACEOF
13992 if { (eval echo "$as_me:13992: \"$ac_cpp conftest.$ac_ext\"") >&5
13993   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13994   ac_status=$?
13995   egrep -v '^ *\+' conftest.er1 >conftest.err
13996   rm -f conftest.er1
13997   cat conftest.err >&5
13998   echo "$as_me:13998: \$? = $ac_status" >&5
13999   (exit $ac_status); } >/dev/null; then
14000   if test -s conftest.err; then
14001     ac_cpp_err=$ac_c_preproc_warn_flag
14002   else
14003     ac_cpp_err=
14004   fi
14005 else
14006   ac_cpp_err=yes
14007 fi
14008 if test -z "$ac_cpp_err"; then
14009   eval "$as_ac_Header=yes"
14010 else
14011   echo "$as_me: failed program was:" >&5
14012   cat conftest.$ac_ext >&5
14013   eval "$as_ac_Header=no"
14014 fi
14015 rm -f conftest.err conftest.$ac_ext
14016 fi
14017 echo "$as_me:14017: result: `eval echo '${'$as_ac_Header'}'`" >&5
14018 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
14019 if test `eval echo '${'$as_ac_Header'}'` = yes; then
14020   cat >>confdefs.h <<EOF
14021 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
14022 EOF
14023
14024 fi
14025 done
14026
14027 echo "$as_me:14027: checking for header declaring getopt variables" >&5
14028 echo $ECHO_N "checking for header declaring getopt variables... $ECHO_C" >&6
14029 if test "${cf_cv_getopt_header+set}" = set; then
14030   echo $ECHO_N "(cached) $ECHO_C" >&6
14031 else
14032
14033 cf_cv_getopt_header=none
14034 for cf_header in stdio.h stdlib.h unistd.h getopt.h
14035 do
14036 cat >conftest.$ac_ext <<_ACEOF
14037 #line 14037 "configure"
14038 #include "confdefs.h"
14039
14040 #include <$cf_header>
14041 int
14042 main ()
14043 {
14044 int x = optind; char *y = optarg
14045   ;
14046   return 0;
14047 }
14048 _ACEOF
14049 rm -f conftest.$ac_objext
14050 if { (eval echo "$as_me:14050: \"$ac_compile\"") >&5
14051   (eval $ac_compile) 2>&5
14052   ac_status=$?
14053   echo "$as_me:14053: \$? = $ac_status" >&5
14054   (exit $ac_status); } &&
14055          { ac_try='test -s conftest.$ac_objext'
14056   { (eval echo "$as_me:14056: \"$ac_try\"") >&5
14057   (eval $ac_try) 2>&5
14058   ac_status=$?
14059   echo "$as_me:14059: \$? = $ac_status" >&5
14060   (exit $ac_status); }; }; then
14061   cf_cv_getopt_header=$cf_header
14062  break
14063 else
14064   echo "$as_me: failed program was:" >&5
14065 cat conftest.$ac_ext >&5
14066 fi
14067 rm -f conftest.$ac_objext conftest.$ac_ext
14068 done
14069
14070 fi
14071 echo "$as_me:14071: result: $cf_cv_getopt_header" >&5
14072 echo "${ECHO_T}$cf_cv_getopt_header" >&6
14073 if test $cf_cv_getopt_header != none ; then
14074
14075 cat >>confdefs.h <<\EOF
14076 #define HAVE_GETOPT_HEADER 1
14077 EOF
14078
14079 fi
14080 if test $cf_cv_getopt_header = getopt.h ; then
14081
14082 cat >>confdefs.h <<\EOF
14083 #define NEED_GETOPT_H 1
14084 EOF
14085
14086 fi
14087
14088 for ac_func in \
14089 getopt \
14090 gettimeofday \
14091
14092 do
14093 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
14094 echo "$as_me:14094: checking for $ac_func" >&5
14095 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
14096 if eval "test \"\${$as_ac_var+set}\" = set"; then
14097   echo $ECHO_N "(cached) $ECHO_C" >&6
14098 else
14099   cat >conftest.$ac_ext <<_ACEOF
14100 #line 14100 "configure"
14101 #include "confdefs.h"
14102 /* System header to define __stub macros and hopefully few prototypes,
14103     which can conflict with char $ac_func (); below.  */
14104 #include <assert.h>
14105 /* Override any gcc2 internal prototype to avoid an error.  */
14106 #ifdef __cplusplus
14107 extern "C"
14108 #endif
14109 /* We use char because int might match the return type of a gcc2
14110    builtin and then its argument prototype would still apply.  */
14111 char $ac_func ();
14112 char (*f) ();
14113
14114 int
14115 main ()
14116 {
14117 /* The GNU C library defines this for functions which it implements
14118     to always fail with ENOSYS.  Some functions are actually named
14119     something starting with __ and the normal name is an alias.  */
14120 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
14121 choke me
14122 #else
14123 f = $ac_func; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
14124 #endif
14125
14126   ;
14127   return 0;
14128 }
14129 _ACEOF
14130 rm -f conftest.$ac_objext conftest$ac_exeext
14131 if { (eval echo "$as_me:14131: \"$ac_link\"") >&5
14132   (eval $ac_link) 2>&5
14133   ac_status=$?
14134   echo "$as_me:14134: \$? = $ac_status" >&5
14135   (exit $ac_status); } &&
14136          { ac_try='test -s conftest$ac_exeext'
14137   { (eval echo "$as_me:14137: \"$ac_try\"") >&5
14138   (eval $ac_try) 2>&5
14139   ac_status=$?
14140   echo "$as_me:14140: \$? = $ac_status" >&5
14141   (exit $ac_status); }; }; then
14142   eval "$as_ac_var=yes"
14143 else
14144   echo "$as_me: failed program was:" >&5
14145 cat conftest.$ac_ext >&5
14146 eval "$as_ac_var=no"
14147 fi
14148 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14149 fi
14150 echo "$as_me:14150: result: `eval echo '${'$as_ac_var'}'`" >&5
14151 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
14152 if test `eval echo '${'$as_ac_var'}'` = yes; then
14153   cat >>confdefs.h <<EOF
14154 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
14155 EOF
14156
14157 fi
14158 done
14159
14160 if test "x$ac_cv_func_getopt" = xno; then
14161         { { echo "$as_me:14161: error: getopt is required for building programs" >&5
14162 echo "$as_me: error: getopt is required for building programs" >&2;}
14163    { (exit 1); exit 1; }; }
14164 fi
14165
14166 if test "$cf_enable_widec" = yes; then
14167
14168 for ac_func in \
14169 mblen \
14170 mbrlen \
14171 mbrtowc \
14172 mbsrtowcs \
14173 mbstowcs \
14174 mbtowc \
14175 wcsrtombs \
14176 wcstombs \
14177
14178 do
14179 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
14180 echo "$as_me:14180: checking for $ac_func" >&5
14181 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
14182 if eval "test \"\${$as_ac_var+set}\" = set"; then
14183   echo $ECHO_N "(cached) $ECHO_C" >&6
14184 else
14185   cat >conftest.$ac_ext <<_ACEOF
14186 #line 14186 "configure"
14187 #include "confdefs.h"
14188 /* System header to define __stub macros and hopefully few prototypes,
14189     which can conflict with char $ac_func (); below.  */
14190 #include <assert.h>
14191 /* Override any gcc2 internal prototype to avoid an error.  */
14192 #ifdef __cplusplus
14193 extern "C"
14194 #endif
14195 /* We use char because int might match the return type of a gcc2
14196    builtin and then its argument prototype would still apply.  */
14197 char $ac_func ();
14198 char (*f) ();
14199
14200 int
14201 main ()
14202 {
14203 /* The GNU C library defines this for functions which it implements
14204     to always fail with ENOSYS.  Some functions are actually named
14205     something starting with __ and the normal name is an alias.  */
14206 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
14207 choke me
14208 #else
14209 f = $ac_func; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
14210 #endif
14211
14212   ;
14213   return 0;
14214 }
14215 _ACEOF
14216 rm -f conftest.$ac_objext conftest$ac_exeext
14217 if { (eval echo "$as_me:14217: \"$ac_link\"") >&5
14218   (eval $ac_link) 2>&5
14219   ac_status=$?
14220   echo "$as_me:14220: \$? = $ac_status" >&5
14221   (exit $ac_status); } &&
14222          { ac_try='test -s conftest$ac_exeext'
14223   { (eval echo "$as_me:14223: \"$ac_try\"") >&5
14224   (eval $ac_try) 2>&5
14225   ac_status=$?
14226   echo "$as_me:14226: \$? = $ac_status" >&5
14227   (exit $ac_status); }; }; then
14228   eval "$as_ac_var=yes"
14229 else
14230   echo "$as_me: failed program was:" >&5
14231 cat conftest.$ac_ext >&5
14232 eval "$as_ac_var=no"
14233 fi
14234 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14235 fi
14236 echo "$as_me:14236: result: `eval echo '${'$as_ac_var'}'`" >&5
14237 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
14238 if test `eval echo '${'$as_ac_var'}'` = yes; then
14239   cat >>confdefs.h <<EOF
14240 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
14241 EOF
14242
14243 fi
14244 done
14245
14246 fi
14247
14248 echo "$as_me:14248: checking definition to turn on extended curses functions" >&5
14249 echo $ECHO_N "checking definition to turn on extended curses functions... $ECHO_C" >&6
14250 if test "${cf_cv_need_xopen_extension+set}" = set; then
14251   echo $ECHO_N "(cached) $ECHO_C" >&6
14252 else
14253
14254 cf_cv_need_xopen_extension=unknown
14255 cat >conftest.$ac_ext <<_ACEOF
14256 #line 14256 "configure"
14257 #include "confdefs.h"
14258
14259 #include <stdlib.h>
14260 #include <${cf_cv_ncurses_header:-curses.h}>
14261 int
14262 main ()
14263 {
14264
14265 #if defined(NCURSES_VERSION_PATCH)
14266 #if (NCURSES_VERSION_PATCH < 20100501) && (NCURSES_VERSION_PATCH >= 20100403)
14267         make an error
14268 #endif
14269 #endif
14270 #ifdef NCURSES_VERSION
14271         cchar_t check;
14272         int check2 = curs_set((int)sizeof(check));
14273 #endif
14274         long x = winnstr(stdscr, "", 0);
14275         int x1, y1;
14276         getbegyx(stdscr, y1, x1)
14277   ;
14278   return 0;
14279 }
14280 _ACEOF
14281 rm -f conftest.$ac_objext conftest$ac_exeext
14282 if { (eval echo "$as_me:14282: \"$ac_link\"") >&5
14283   (eval $ac_link) 2>&5
14284   ac_status=$?
14285   echo "$as_me:14285: \$? = $ac_status" >&5
14286   (exit $ac_status); } &&
14287          { ac_try='test -s conftest$ac_exeext'
14288   { (eval echo "$as_me:14288: \"$ac_try\"") >&5
14289   (eval $ac_try) 2>&5
14290   ac_status=$?
14291   echo "$as_me:14291: \$? = $ac_status" >&5
14292   (exit $ac_status); }; }; then
14293   cf_cv_need_xopen_extension=none
14294 else
14295   echo "$as_me: failed program was:" >&5
14296 cat conftest.$ac_ext >&5
14297
14298         for cf_try_xopen_extension in _XOPEN_SOURCE_EXTENDED NCURSES_WIDECHAR
14299         do
14300                 cat >conftest.$ac_ext <<_ACEOF
14301 #line 14301 "configure"
14302 #include "confdefs.h"
14303
14304 #define $cf_try_xopen_extension 1
14305 #include <stdlib.h>
14306 #include <${cf_cv_ncurses_header:-curses.h}>
14307 int
14308 main ()
14309 {
14310
14311 #ifdef NCURSES_VERSION
14312                 cchar_t check;
14313                 int check2 = curs_set((int)sizeof(check));
14314 #endif
14315                 long x = winnstr(stdscr, "", 0);
14316                 int x1, y1;
14317                 getbegyx(stdscr, y1, x1)
14318   ;
14319   return 0;
14320 }
14321 _ACEOF
14322 rm -f conftest.$ac_objext conftest$ac_exeext
14323 if { (eval echo "$as_me:14323: \"$ac_link\"") >&5
14324   (eval $ac_link) 2>&5
14325   ac_status=$?
14326   echo "$as_me:14326: \$? = $ac_status" >&5
14327   (exit $ac_status); } &&
14328          { ac_try='test -s conftest$ac_exeext'
14329   { (eval echo "$as_me:14329: \"$ac_try\"") >&5
14330   (eval $ac_try) 2>&5
14331   ac_status=$?
14332   echo "$as_me:14332: \$? = $ac_status" >&5
14333   (exit $ac_status); }; }; then
14334   cf_cv_need_xopen_extension=$cf_try_xopen_extension; break
14335 else
14336   echo "$as_me: failed program was:" >&5
14337 cat conftest.$ac_ext >&5
14338 fi
14339 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14340         done
14341
14342 fi
14343 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14344
14345 fi
14346 echo "$as_me:14346: result: $cf_cv_need_xopen_extension" >&5
14347 echo "${ECHO_T}$cf_cv_need_xopen_extension" >&6
14348
14349 case $cf_cv_need_xopen_extension in
14350 (*_*)
14351         CPPFLAGS="$CPPFLAGS -D$cf_cv_need_xopen_extension"
14352         ;;
14353 esac
14354
14355 echo "$as_me:14355: checking for term.h" >&5
14356 echo $ECHO_N "checking for term.h... $ECHO_C" >&6
14357 if test "${cf_cv_term_header+set}" = set; then
14358   echo $ECHO_N "(cached) $ECHO_C" >&6
14359 else
14360
14361 # If we found <ncurses/curses.h>, look for <ncurses/term.h>, but always look
14362 # for <term.h> if we do not find the variant.
14363
14364 cf_header_list="term.h ncurses/term.h ncursesw/term.h"
14365
14366 case ${cf_cv_ncurses_header:-curses.h} in
14367 (*/*)
14368         cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`term.h
14369         cf_header_list="$cf_header_item $cf_header_list"
14370         ;;
14371 esac
14372
14373 for cf_header in $cf_header_list
14374 do
14375         cat >conftest.$ac_ext <<_ACEOF
14376 #line 14376 "configure"
14377 #include "confdefs.h"
14378
14379 #include <${cf_cv_ncurses_header:-curses.h}>
14380 #include <${cf_header}>
14381 int
14382 main ()
14383 {
14384 WINDOW *x
14385   ;
14386   return 0;
14387 }
14388 _ACEOF
14389 rm -f conftest.$ac_objext
14390 if { (eval echo "$as_me:14390: \"$ac_compile\"") >&5
14391   (eval $ac_compile) 2>&5
14392   ac_status=$?
14393   echo "$as_me:14393: \$? = $ac_status" >&5
14394   (exit $ac_status); } &&
14395          { ac_try='test -s conftest.$ac_objext'
14396   { (eval echo "$as_me:14396: \"$ac_try\"") >&5
14397   (eval $ac_try) 2>&5
14398   ac_status=$?
14399   echo "$as_me:14399: \$? = $ac_status" >&5
14400   (exit $ac_status); }; }; then
14401   cf_cv_term_header=$cf_header
14402          break
14403 else
14404   echo "$as_me: failed program was:" >&5
14405 cat conftest.$ac_ext >&5
14406 cf_cv_term_header=no
14407 fi
14408 rm -f conftest.$ac_objext conftest.$ac_ext
14409 done
14410
14411 case $cf_cv_term_header in
14412 (no)
14413         # If curses is ncurses, some packagers still mess it up by trying to make
14414         # us use GNU termcap.  This handles the most common case.
14415         for cf_header in ncurses/term.h ncursesw/term.h
14416         do
14417                 cat >conftest.$ac_ext <<_ACEOF
14418 #line 14418 "configure"
14419 #include "confdefs.h"
14420
14421 #include <${cf_cv_ncurses_header:-curses.h}>
14422 #ifdef NCURSES_VERSION
14423 #include <${cf_header}>
14424 #else
14425 make an error
14426 #endif
14427 int
14428 main ()
14429 {
14430 WINDOW *x
14431   ;
14432   return 0;
14433 }
14434 _ACEOF
14435 rm -f conftest.$ac_objext
14436 if { (eval echo "$as_me:14436: \"$ac_compile\"") >&5
14437   (eval $ac_compile) 2>&5
14438   ac_status=$?
14439   echo "$as_me:14439: \$? = $ac_status" >&5
14440   (exit $ac_status); } &&
14441          { ac_try='test -s conftest.$ac_objext'
14442   { (eval echo "$as_me:14442: \"$ac_try\"") >&5
14443   (eval $ac_try) 2>&5
14444   ac_status=$?
14445   echo "$as_me:14445: \$? = $ac_status" >&5
14446   (exit $ac_status); }; }; then
14447   cf_cv_term_header=$cf_header
14448                          break
14449 else
14450   echo "$as_me: failed program was:" >&5
14451 cat conftest.$ac_ext >&5
14452 cf_cv_term_header=no
14453 fi
14454 rm -f conftest.$ac_objext conftest.$ac_ext
14455         done
14456         ;;
14457 esac
14458
14459 fi
14460 echo "$as_me:14460: result: $cf_cv_term_header" >&5
14461 echo "${ECHO_T}$cf_cv_term_header" >&6
14462
14463 case $cf_cv_term_header in
14464 (term.h)
14465
14466 cat >>confdefs.h <<\EOF
14467 #define HAVE_TERM_H 1
14468 EOF
14469
14470         ;;
14471 (ncurses/term.h)
14472
14473 cat >>confdefs.h <<\EOF
14474 #define HAVE_NCURSES_TERM_H 1
14475 EOF
14476
14477         ;;
14478 (ncursesw/term.h)
14479
14480 cat >>confdefs.h <<\EOF
14481 #define HAVE_NCURSESW_TERM_H 1
14482 EOF
14483
14484         ;;
14485 esac
14486
14487 echo "$as_me:14487: checking for unctrl.h" >&5
14488 echo $ECHO_N "checking for unctrl.h... $ECHO_C" >&6
14489 if test "${cf_cv_unctrl_header+set}" = set; then
14490   echo $ECHO_N "(cached) $ECHO_C" >&6
14491 else
14492
14493 # If we found <ncurses/curses.h>, look for <ncurses/unctrl.h>, but always look
14494 # for <unctrl.h> if we do not find the variant.
14495
14496 cf_header_list="unctrl.h ncurses/unctrl.h ncursesw/unctrl.h"
14497
14498 case ${cf_cv_ncurses_header:-curses.h} in
14499 (*/*)
14500         cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`unctrl.h
14501         cf_header_list="$cf_header_item $cf_header_list"
14502         ;;
14503 esac
14504
14505 for cf_header in $cf_header_list
14506 do
14507         cat >conftest.$ac_ext <<_ACEOF
14508 #line 14508 "configure"
14509 #include "confdefs.h"
14510
14511 #include <${cf_cv_ncurses_header:-curses.h}>
14512 #include <${cf_header}>
14513 int
14514 main ()
14515 {
14516 WINDOW *x
14517   ;
14518   return 0;
14519 }
14520 _ACEOF
14521 rm -f conftest.$ac_objext
14522 if { (eval echo "$as_me:14522: \"$ac_compile\"") >&5
14523   (eval $ac_compile) 2>&5
14524   ac_status=$?
14525   echo "$as_me:14525: \$? = $ac_status" >&5
14526   (exit $ac_status); } &&
14527          { ac_try='test -s conftest.$ac_objext'
14528   { (eval echo "$as_me:14528: \"$ac_try\"") >&5
14529   (eval $ac_try) 2>&5
14530   ac_status=$?
14531   echo "$as_me:14531: \$? = $ac_status" >&5
14532   (exit $ac_status); }; }; then
14533   cf_cv_unctrl_header=$cf_header
14534          break
14535 else
14536   echo "$as_me: failed program was:" >&5
14537 cat conftest.$ac_ext >&5
14538 cf_cv_unctrl_header=no
14539 fi
14540 rm -f conftest.$ac_objext conftest.$ac_ext
14541 done
14542
14543 fi
14544 echo "$as_me:14544: result: $cf_cv_unctrl_header" >&5
14545 echo "${ECHO_T}$cf_cv_unctrl_header" >&6
14546
14547 case $cf_cv_unctrl_header in
14548 (no)
14549         { echo "$as_me:14549: WARNING: unctrl.h header not found" >&5
14550 echo "$as_me: WARNING: unctrl.h header not found" >&2;}
14551         ;;
14552 esac
14553
14554 case $cf_cv_unctrl_header in
14555 (unctrl.h)
14556
14557 cat >>confdefs.h <<\EOF
14558 #define HAVE_UNCTRL_H 1
14559 EOF
14560
14561         ;;
14562 (ncurses/unctrl.h)
14563
14564 cat >>confdefs.h <<\EOF
14565 #define HAVE_NCURSES_UNCTRL_H 1
14566 EOF
14567
14568         ;;
14569 (ncursesw/unctrl.h)
14570
14571 cat >>confdefs.h <<\EOF
14572 #define HAVE_NCURSESW_UNCTRL_H 1
14573 EOF
14574
14575         ;;
14576 esac
14577
14578 for cf_func in \
14579 assume_default_colors \
14580 chgat \
14581 color_set \
14582 filter \
14583 getbegx \
14584 getcurx \
14585 getmaxx \
14586 getnstr \
14587 getparx \
14588 getwin \
14589 mvvline \
14590 mvwvline \
14591 napms \
14592 putwin \
14593 resize_term \
14594 resizeterm \
14595 restartterm \
14596 ripoffline \
14597 scr_dump \
14598 setupterm \
14599 slk_color \
14600 slk_init \
14601 termattrs \
14602 tgetent \
14603 tigetnum \
14604 tigetstr \
14605 typeahead \
14606 use_default_colors \
14607 use_env \
14608 use_extended_names \
14609 use_screen \
14610 use_window \
14611 vid_puts \
14612 vidputs \
14613 vsscanf \
14614 vw_printw \
14615 wchgat \
14616 winsstr \
14617 wresize \
14618 wsyncdown \
14619
14620 do
14621
14622 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14623
14624         echo "$as_me:14624: checking for ${cf_func}" >&5
14625 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
14626
14627 echo "${as_me:-configure}:14627: testing ${cf_func} ..." 1>&5
14628
14629         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
14630   echo $ECHO_N "(cached) $ECHO_C" >&6
14631 else
14632
14633                 eval cf_result='$ac_cv_func_'$cf_func
14634                 if test ".$cf_result" != ".no"; then
14635                         cat >conftest.$ac_ext <<_ACEOF
14636 #line 14636 "configure"
14637 #include "confdefs.h"
14638
14639 #ifdef HAVE_XCURSES
14640 #include <xcurses.h>
14641 char * XCursesProgramName = "test";
14642 #else
14643 #include <${cf_cv_ncurses_header:-curses.h}>
14644 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
14645 #include <ncursesw/term.h>
14646 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
14647 #include <ncurses/term.h>
14648 #elif defined(HAVE_TERM_H)
14649 #include <term.h>
14650 #endif
14651 #endif
14652
14653 int
14654 main ()
14655 {
14656
14657 #ifndef ${cf_func}
14658 long foo = (long)(&${cf_func});
14659 fprintf(stderr, "testing linkage of $cf_func:%p\n", foo);
14660 if (foo + 1234 > 5678)
14661         ${cf_cv_main_return:-return}(foo);
14662 #endif
14663
14664   ;
14665   return 0;
14666 }
14667 _ACEOF
14668 rm -f conftest.$ac_objext conftest$ac_exeext
14669 if { (eval echo "$as_me:14669: \"$ac_link\"") >&5
14670   (eval $ac_link) 2>&5
14671   ac_status=$?
14672   echo "$as_me:14672: \$? = $ac_status" >&5
14673   (exit $ac_status); } &&
14674          { ac_try='test -s conftest$ac_exeext'
14675   { (eval echo "$as_me:14675: \"$ac_try\"") >&5
14676   (eval $ac_try) 2>&5
14677   ac_status=$?
14678   echo "$as_me:14678: \$? = $ac_status" >&5
14679   (exit $ac_status); }; }; then
14680   cf_result=yes
14681 else
14682   echo "$as_me: failed program was:" >&5
14683 cat conftest.$ac_ext >&5
14684 cf_result=no
14685 fi
14686 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14687                 fi
14688                 eval 'cf_cv_func_'$cf_func'=$cf_result'
14689
14690 fi
14691
14692         # use the computed/retrieved cache-value:
14693         eval 'cf_result=$cf_cv_func_'$cf_func
14694         echo "$as_me:14694: result: $cf_result" >&5
14695 echo "${ECHO_T}$cf_result" >&6
14696         if test $cf_result != no; then
14697                 cat >>confdefs.h <<EOF
14698 #define HAVE_${cf_tr_func} 1
14699 EOF
14700
14701         fi
14702 done
14703
14704 for cf_func in tputs
14705 do
14706
14707 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14708
14709         echo "$as_me:14709: checking for ${cf_func}" >&5
14710 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
14711
14712 echo "${as_me:-configure}:14712: testing ${cf_func} ..." 1>&5
14713
14714         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
14715   echo $ECHO_N "(cached) $ECHO_C" >&6
14716 else
14717
14718                 eval cf_result='$ac_cv_func_'$cf_func
14719                 if test ".$cf_result" != ".no"; then
14720                         cat >conftest.$ac_ext <<_ACEOF
14721 #line 14721 "configure"
14722 #include "confdefs.h"
14723
14724 #ifdef HAVE_XCURSES
14725 #include <xcurses.h>
14726 char * XCursesProgramName = "test";
14727 #else
14728 #include <${cf_cv_ncurses_header:-curses.h}>
14729 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
14730 #include <ncursesw/term.h>
14731 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
14732 #include <ncurses/term.h>
14733 #elif defined(HAVE_TERM_H)
14734 #include <term.h>
14735 #endif
14736 #endif
14737
14738 int
14739 main ()
14740 {
14741
14742 #ifndef ${cf_func}
14743 long foo = (long)(&${cf_func});
14744 fprintf(stderr, "testing linkage of $cf_func:%p\n", foo);
14745 if (foo + 1234 > 5678)
14746         ${cf_cv_main_return:-return}(foo);
14747 #endif
14748
14749   ;
14750   return 0;
14751 }
14752 _ACEOF
14753 rm -f conftest.$ac_objext conftest$ac_exeext
14754 if { (eval echo "$as_me:14754: \"$ac_link\"") >&5
14755   (eval $ac_link) 2>&5
14756   ac_status=$?
14757   echo "$as_me:14757: \$? = $ac_status" >&5
14758   (exit $ac_status); } &&
14759          { ac_try='test -s conftest$ac_exeext'
14760   { (eval echo "$as_me:14760: \"$ac_try\"") >&5
14761   (eval $ac_try) 2>&5
14762   ac_status=$?
14763   echo "$as_me:14763: \$? = $ac_status" >&5
14764   (exit $ac_status); }; }; then
14765   cf_result=yes
14766 else
14767   echo "$as_me: failed program was:" >&5
14768 cat conftest.$ac_ext >&5
14769 cf_result=no
14770 fi
14771 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14772                 fi
14773                 eval 'cf_cv_func_'$cf_func'=$cf_result'
14774
14775 fi
14776
14777         # use the computed/retrieved cache-value:
14778         eval 'cf_result=$cf_cv_func_'$cf_func
14779         echo "$as_me:14779: result: $cf_result" >&5
14780 echo "${ECHO_T}$cf_result" >&6
14781         if test $cf_result != no; then
14782                 cat >>confdefs.h <<EOF
14783 #define HAVE_${cf_tr_func} 1
14784 EOF
14785
14786         fi
14787 done
14788
14789 if test x$cf_cv_func_tputs = xyes
14790 then
14791         cf_done=no
14792         for cf_arg in int char
14793         do
14794                 for cf_ret in int void
14795                 do
14796                         if test $cf_ret = void
14797                         then
14798                                 cf_return="/* nothing */"
14799                         else
14800                                 cf_return="return value"
14801                         fi
14802                         cat >conftest.$ac_ext <<_ACEOF
14803 #line 14803 "configure"
14804 #include "confdefs.h"
14805
14806 #include <${cf_cv_ncurses_header:-curses.h}>
14807 #include <$cf_cv_term_header>
14808
14809 static $cf_ret outc($cf_arg value) { $cf_return; }
14810
14811 int
14812 main ()
14813 {
14814
14815         tputs("hello", 0, outc);
14816         ${cf_cv_main_return:-return}(0);
14817
14818   ;
14819   return 0;
14820 }
14821 _ACEOF
14822 rm -f conftest.$ac_objext
14823 if { (eval echo "$as_me:14823: \"$ac_compile\"") >&5
14824   (eval $ac_compile) 2>&5
14825   ac_status=$?
14826   echo "$as_me:14826: \$? = $ac_status" >&5
14827   (exit $ac_status); } &&
14828          { ac_try='test -s conftest.$ac_objext'
14829   { (eval echo "$as_me:14829: \"$ac_try\"") >&5
14830   (eval $ac_try) 2>&5
14831   ac_status=$?
14832   echo "$as_me:14832: \$? = $ac_status" >&5
14833   (exit $ac_status); }; }; then
14834
14835                 test -n "$verbose" && echo "    prototype $cf_ret func($cf_arg value)" 1>&6
14836
14837 echo "${as_me:-configure}:14837: testing prototype $cf_ret func($cf_arg value) ..." 1>&5
14838
14839                 cat >>confdefs.h <<EOF
14840 #define TPUTS_ARG               $cf_arg
14841 #define TPUTS_PROTO(func,value) $cf_ret func(TPUTS_ARG value)
14842 #define TPUTS_RETURN(value)     $cf_return
14843 EOF
14844                 cf_done=yes
14845                 break
14846
14847 else
14848   echo "$as_me: failed program was:" >&5
14849 cat conftest.$ac_ext >&5
14850 fi
14851 rm -f conftest.$ac_objext conftest.$ac_ext
14852                 done
14853                 test $cf_done = yes && break
14854         done
14855 fi
14856
14857 echo "$as_me:14857: checking for ncurses extended functions" >&5
14858 echo $ECHO_N "checking for ncurses extended functions... $ECHO_C" >&6
14859 if test "${cf_cv_ncurses_ext_funcs+set}" = set; then
14860   echo $ECHO_N "(cached) $ECHO_C" >&6
14861 else
14862
14863 cat >conftest.$ac_ext <<_ACEOF
14864 #line 14864 "configure"
14865 #include "confdefs.h"
14866
14867 #include <${cf_cv_ncurses_header:-curses.h}>
14868 int
14869 main ()
14870 {
14871
14872 int x = NCURSES_EXT_FUNCS
14873
14874   ;
14875   return 0;
14876 }
14877 _ACEOF
14878 rm -f conftest.$ac_objext
14879 if { (eval echo "$as_me:14879: \"$ac_compile\"") >&5
14880   (eval $ac_compile) 2>&5
14881   ac_status=$?
14882   echo "$as_me:14882: \$? = $ac_status" >&5
14883   (exit $ac_status); } &&
14884          { ac_try='test -s conftest.$ac_objext'
14885   { (eval echo "$as_me:14885: \"$ac_try\"") >&5
14886   (eval $ac_try) 2>&5
14887   ac_status=$?
14888   echo "$as_me:14888: \$? = $ac_status" >&5
14889   (exit $ac_status); }; }; then
14890   cf_cv_ncurses_ext_funcs=defined
14891 else
14892   echo "$as_me: failed program was:" >&5
14893 cat conftest.$ac_ext >&5
14894
14895 cat >conftest.$ac_ext <<_ACEOF
14896 #line 14896 "configure"
14897 #include "confdefs.h"
14898
14899 #include <${cf_cv_ncurses_header:-curses.h}>
14900 int
14901 main ()
14902 {
14903
14904         (void) assume_default_colors (0, 0);
14905         (void) curses_version ();
14906         (void) define_key (0, 0);
14907         (void) is_term_resized (0, 0);
14908         (void) key_defined (0);
14909         (void) keybound (0, 0);
14910         (void) keyok (0, 0);
14911         (void) resize_term (0, 0);
14912         (void) resizeterm (0, 0);
14913         (void) use_default_colors ();
14914         (void) use_extended_names (0);
14915         (void) wresize (0, 0, 0);
14916   ;
14917   return 0;
14918 }
14919 _ACEOF
14920 rm -f conftest.$ac_objext conftest$ac_exeext
14921 if { (eval echo "$as_me:14921: \"$ac_link\"") >&5
14922   (eval $ac_link) 2>&5
14923   ac_status=$?
14924   echo "$as_me:14924: \$? = $ac_status" >&5
14925   (exit $ac_status); } &&
14926          { ac_try='test -s conftest$ac_exeext'
14927   { (eval echo "$as_me:14927: \"$ac_try\"") >&5
14928   (eval $ac_try) 2>&5
14929   ac_status=$?
14930   echo "$as_me:14930: \$? = $ac_status" >&5
14931   (exit $ac_status); }; }; then
14932   cf_cv_ncurses_ext_funcs=yes
14933 else
14934   echo "$as_me: failed program was:" >&5
14935 cat conftest.$ac_ext >&5
14936 cf_cv_ncurses_ext_funcs=no
14937 fi
14938 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14939
14940 fi
14941 rm -f conftest.$ac_objext conftest.$ac_ext
14942
14943 fi
14944 echo "$as_me:14944: result: $cf_cv_ncurses_ext_funcs" >&5
14945 echo "${ECHO_T}$cf_cv_ncurses_ext_funcs" >&6
14946 test "$cf_cv_ncurses_ext_funcs" = yes &&
14947 cat >>confdefs.h <<\EOF
14948 #define NCURSES_EXT_FUNCS 1
14949 EOF
14950
14951 if test "$cf_enable_widec" = yes
14952 then
14953         # workaround for systems with ncurses before 20111029, due to change of
14954         # feature test macro from _XPG5 to _XOPEN_SOURCE
14955         if test -n "$cf_cv_ncurses_version" && test "x$cf_cv_ncurses_version" != xno
14956         then
14957                 cf_define_xpg5=no
14958                 echo "$as_me:14958: checking if _XPG5 should be defined to enable wide-characters" >&5
14959 echo $ECHO_N "checking if _XPG5 should be defined to enable wide-characters... $ECHO_C" >&6
14960
14961                 cat >conftest.$ac_ext <<_ACEOF
14962 #line 14962 "configure"
14963 #include "confdefs.h"
14964
14965 #include <${cf_cv_ncurses_header:-curses.h}>
14966 int
14967 main ()
14968 {
14969 int x = _XPG5
14970   ;
14971   return 0;
14972 }
14973 _ACEOF
14974 rm -f conftest.$ac_objext
14975 if { (eval echo "$as_me:14975: \"$ac_compile\"") >&5
14976   (eval $ac_compile) 2>&5
14977   ac_status=$?
14978   echo "$as_me:14978: \$? = $ac_status" >&5
14979   (exit $ac_status); } &&
14980          { ac_try='test -s conftest.$ac_objext'
14981   { (eval echo "$as_me:14981: \"$ac_try\"") >&5
14982   (eval $ac_try) 2>&5
14983   ac_status=$?
14984   echo "$as_me:14984: \$? = $ac_status" >&5
14985   (exit $ac_status); }; }; then
14986   :
14987 else
14988   echo "$as_me: failed program was:" >&5
14989 cat conftest.$ac_ext >&5
14990 cf_save_cppflags="$CPPFLAGS"
14991                          CPPFLAGS="$CPPFLAGS -D_XPG5"
14992                          cat >conftest.$ac_ext <<_ACEOF
14993 #line 14993 "configure"
14994 #include "confdefs.h"
14995
14996 #include <${cf_cv_ncurses_header:-curses.h}>
14997 int
14998 main ()
14999 {
15000 int x = _XPG5
15001   ;
15002   return 0;
15003 }
15004 _ACEOF
15005 rm -f conftest.$ac_objext
15006 if { (eval echo "$as_me:15006: \"$ac_compile\"") >&5
15007   (eval $ac_compile) 2>&5
15008   ac_status=$?
15009   echo "$as_me:15009: \$? = $ac_status" >&5
15010   (exit $ac_status); } &&
15011          { ac_try='test -s conftest.$ac_objext'
15012   { (eval echo "$as_me:15012: \"$ac_try\"") >&5
15013   (eval $ac_try) 2>&5
15014   ac_status=$?
15015   echo "$as_me:15015: \$? = $ac_status" >&5
15016   (exit $ac_status); }; }; then
15017   cf_define_xpg5=yes
15018 else
15019   echo "$as_me: failed program was:" >&5
15020 cat conftest.$ac_ext >&5
15021 fi
15022 rm -f conftest.$ac_objext conftest.$ac_ext
15023                          CPPFLAGS="$cf_save_cppflags"
15024 fi
15025 rm -f conftest.$ac_objext conftest.$ac_ext
15026                 echo "$as_me:15026: result: $cf_define_xpg5" >&5
15027 echo "${ECHO_T}$cf_define_xpg5" >&6
15028
15029                 if test "$cf_define_xpg5" = yes
15030                 then
15031                         CPPFLAGS="$CPPFLAGS -D_XPG5"
15032                 fi
15033         fi
15034
15035         echo "$as_me:15035: checking for wide-character functions" >&5
15036 echo $ECHO_N "checking for wide-character functions... $ECHO_C" >&6
15037 if test "${cf_cv_widechar_funcs+set}" = set; then
15038   echo $ECHO_N "(cached) $ECHO_C" >&6
15039 else
15040
15041         cat >conftest.$ac_ext <<_ACEOF
15042 #line 15042 "configure"
15043 #include "confdefs.h"
15044
15045 #include <${cf_cv_ncurses_header:-curses.h}>
15046 int
15047 main ()
15048 {
15049
15050                 static wchar_t src_wchar[2];
15051                 static cchar_t dst_cchar;
15052                 setcchar(&dst_cchar, src_wchar, A_NORMAL, 0, (void *) 0);
15053
15054   ;
15055   return 0;
15056 }
15057 _ACEOF
15058 rm -f conftest.$ac_objext conftest$ac_exeext
15059 if { (eval echo "$as_me:15059: \"$ac_link\"") >&5
15060   (eval $ac_link) 2>&5
15061   ac_status=$?
15062   echo "$as_me:15062: \$? = $ac_status" >&5
15063   (exit $ac_status); } &&
15064          { ac_try='test -s conftest$ac_exeext'
15065   { (eval echo "$as_me:15065: \"$ac_try\"") >&5
15066   (eval $ac_try) 2>&5
15067   ac_status=$?
15068   echo "$as_me:15068: \$? = $ac_status" >&5
15069   (exit $ac_status); }; }; then
15070   cf_cv_widechar_funcs=yes
15071 else
15072   echo "$as_me: failed program was:" >&5
15073 cat conftest.$ac_ext >&5
15074 cf_cv_widechar_funcs=no
15075 fi
15076 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15077
15078 fi
15079 echo "$as_me:15079: result: $cf_cv_widechar_funcs" >&5
15080 echo "${ECHO_T}$cf_cv_widechar_funcs" >&6
15081         if test "$cf_cv_widechar_funcs" != no ; then
15082
15083 cat >>confdefs.h <<\EOF
15084 #define USE_WIDEC_SUPPORT 1
15085 EOF
15086
15087         else
15088                 cat >>confdefs.h <<\EOF
15089 #define USE_WIDEC_SUPPORT 0
15090 EOF
15091
15092         fi
15093 else
15094         cat >>confdefs.h <<\EOF
15095 #define USE_WIDEC_SUPPORT 0
15096 EOF
15097
15098 fi
15099
15100 echo "$as_me:15100: checking if $cf_cv_screen library uses pthreads" >&5
15101 echo $ECHO_N "checking if $cf_cv_screen library uses pthreads... $ECHO_C" >&6
15102 if test "${cf_cv_use_pthreads+set}" = set; then
15103   echo $ECHO_N "(cached) $ECHO_C" >&6
15104 else
15105
15106 cat >conftest.$ac_ext <<_ACEOF
15107 #line 15107 "configure"
15108 #include "confdefs.h"
15109
15110 #include <${cf_cv_ncurses_header:-curses.h}>
15111 extern void _nc_init_pthreads(void);
15112
15113 int
15114 main ()
15115 {
15116
15117         initscr();
15118         _nc_init_pthreads();
15119
15120   ;
15121   return 0;
15122 }
15123 _ACEOF
15124 rm -f conftest.$ac_objext conftest$ac_exeext
15125 if { (eval echo "$as_me:15125: \"$ac_link\"") >&5
15126   (eval $ac_link) 2>&5
15127   ac_status=$?
15128   echo "$as_me:15128: \$? = $ac_status" >&5
15129   (exit $ac_status); } &&
15130          { ac_try='test -s conftest$ac_exeext'
15131   { (eval echo "$as_me:15131: \"$ac_try\"") >&5
15132   (eval $ac_try) 2>&5
15133   ac_status=$?
15134   echo "$as_me:15134: \$? = $ac_status" >&5
15135   (exit $ac_status); }; }; then
15136   cf_cv_use_pthreads=yes
15137 else
15138   echo "$as_me: failed program was:" >&5
15139 cat conftest.$ac_ext >&5
15140 cf_cv_use_pthreads=no
15141 fi
15142 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15143
15144 fi
15145 echo "$as_me:15145: result: $cf_cv_use_pthreads" >&5
15146 echo "${ECHO_T}$cf_cv_use_pthreads" >&6
15147 test $cf_cv_use_pthreads = yes && cat >>confdefs.h <<\EOF
15148 #define USE_PTHREADS 1
15149 EOF
15150
15151 echo "$as_me:15151: checking if sys/time.h works with sys/select.h" >&5
15152 echo $ECHO_N "checking if sys/time.h works with sys/select.h... $ECHO_C" >&6
15153 if test "${cf_cv_sys_time_select+set}" = set; then
15154   echo $ECHO_N "(cached) $ECHO_C" >&6
15155 else
15156
15157 cat >conftest.$ac_ext <<_ACEOF
15158 #line 15158 "configure"
15159 #include "confdefs.h"
15160
15161 #include <sys/types.h>
15162 #ifdef HAVE_SYS_TIME_H
15163 #include <sys/time.h>
15164 #endif
15165 #ifdef HAVE_SYS_SELECT_H
15166 #include <sys/select.h>
15167 #endif
15168
15169 int
15170 main ()
15171 {
15172
15173   ;
15174   return 0;
15175 }
15176 _ACEOF
15177 rm -f conftest.$ac_objext
15178 if { (eval echo "$as_me:15178: \"$ac_compile\"") >&5
15179   (eval $ac_compile) 2>&5
15180   ac_status=$?
15181   echo "$as_me:15181: \$? = $ac_status" >&5
15182   (exit $ac_status); } &&
15183          { ac_try='test -s conftest.$ac_objext'
15184   { (eval echo "$as_me:15184: \"$ac_try\"") >&5
15185   (eval $ac_try) 2>&5
15186   ac_status=$?
15187   echo "$as_me:15187: \$? = $ac_status" >&5
15188   (exit $ac_status); }; }; then
15189   cf_cv_sys_time_select=yes
15190 else
15191   echo "$as_me: failed program was:" >&5
15192 cat conftest.$ac_ext >&5
15193 cf_cv_sys_time_select=no
15194 fi
15195 rm -f conftest.$ac_objext conftest.$ac_ext
15196
15197 fi
15198
15199 echo "$as_me:15199: result: $cf_cv_sys_time_select" >&5
15200 echo "${ECHO_T}$cf_cv_sys_time_select" >&6
15201 test "$cf_cv_sys_time_select" = yes &&
15202 cat >>confdefs.h <<\EOF
15203 #define HAVE_SYS_TIME_SELECT 1
15204 EOF
15205
15206 # special check for test/ditto.c
15207
15208 echo "$as_me:15208: checking for openpty in -lutil" >&5
15209 echo $ECHO_N "checking for openpty in -lutil... $ECHO_C" >&6
15210 if test "${ac_cv_lib_util_openpty+set}" = set; then
15211   echo $ECHO_N "(cached) $ECHO_C" >&6
15212 else
15213   ac_check_lib_save_LIBS=$LIBS
15214 LIBS="-lutil  $LIBS"
15215 cat >conftest.$ac_ext <<_ACEOF
15216 #line 15216 "configure"
15217 #include "confdefs.h"
15218
15219 /* Override any gcc2 internal prototype to avoid an error.  */
15220 #ifdef __cplusplus
15221 extern "C"
15222 #endif
15223 /* We use char because int might match the return type of a gcc2
15224    builtin and then its argument prototype would still apply.  */
15225 char openpty ();
15226 int
15227 main ()
15228 {
15229 openpty ();
15230   ;
15231   return 0;
15232 }
15233 _ACEOF
15234 rm -f conftest.$ac_objext conftest$ac_exeext
15235 if { (eval echo "$as_me:15235: \"$ac_link\"") >&5
15236   (eval $ac_link) 2>&5
15237   ac_status=$?
15238   echo "$as_me:15238: \$? = $ac_status" >&5
15239   (exit $ac_status); } &&
15240          { ac_try='test -s conftest$ac_exeext'
15241   { (eval echo "$as_me:15241: \"$ac_try\"") >&5
15242   (eval $ac_try) 2>&5
15243   ac_status=$?
15244   echo "$as_me:15244: \$? = $ac_status" >&5
15245   (exit $ac_status); }; }; then
15246   ac_cv_lib_util_openpty=yes
15247 else
15248   echo "$as_me: failed program was:" >&5
15249 cat conftest.$ac_ext >&5
15250 ac_cv_lib_util_openpty=no
15251 fi
15252 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15253 LIBS=$ac_check_lib_save_LIBS
15254 fi
15255 echo "$as_me:15255: result: $ac_cv_lib_util_openpty" >&5
15256 echo "${ECHO_T}$ac_cv_lib_util_openpty" >&6
15257 if test $ac_cv_lib_util_openpty = yes; then
15258   cf_cv_lib_util=yes
15259 else
15260   cf_cv_lib_util=no
15261 fi
15262
15263 echo "$as_me:15263: checking for openpty header" >&5
15264 echo $ECHO_N "checking for openpty header... $ECHO_C" >&6
15265 if test "${cf_cv_func_openpty+set}" = set; then
15266   echo $ECHO_N "(cached) $ECHO_C" >&6
15267 else
15268
15269         cf_save_LIBS="$LIBS"
15270         test $cf_cv_lib_util = yes && {
15271 cf_add_libs="-lutil"
15272 # Filter out duplicates - this happens with badly-designed ".pc" files...
15273 for cf_add_1lib in $LIBS
15274 do
15275         for cf_add_2lib in $cf_add_libs
15276         do
15277                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
15278                 then
15279                         cf_add_1lib=
15280                         break
15281                 fi
15282         done
15283         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
15284 done
15285 LIBS="$cf_add_libs"
15286  }
15287         for cf_header in pty.h libutil.h util.h
15288         do
15289         cat >conftest.$ac_ext <<_ACEOF
15290 #line 15290 "configure"
15291 #include "confdefs.h"
15292
15293 #include <$cf_header>
15294
15295 int
15296 main ()
15297 {
15298
15299         int x = openpty((int *)0, (int *)0, (char *)0,
15300                                    (struct termios *)0, (struct winsize *)0);
15301
15302   ;
15303   return 0;
15304 }
15305 _ACEOF
15306 rm -f conftest.$ac_objext conftest$ac_exeext
15307 if { (eval echo "$as_me:15307: \"$ac_link\"") >&5
15308   (eval $ac_link) 2>&5
15309   ac_status=$?
15310   echo "$as_me:15310: \$? = $ac_status" >&5
15311   (exit $ac_status); } &&
15312          { ac_try='test -s conftest$ac_exeext'
15313   { (eval echo "$as_me:15313: \"$ac_try\"") >&5
15314   (eval $ac_try) 2>&5
15315   ac_status=$?
15316   echo "$as_me:15316: \$? = $ac_status" >&5
15317   (exit $ac_status); }; }; then
15318
15319                 cf_cv_func_openpty=$cf_header
15320                 break
15321
15322 else
15323   echo "$as_me: failed program was:" >&5
15324 cat conftest.$ac_ext >&5
15325
15326                 cf_cv_func_openpty=no
15327
15328 fi
15329 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15330         done
15331         LIBS="$cf_save_LIBS"
15332
15333 fi
15334 echo "$as_me:15334: result: $cf_cv_func_openpty" >&5
15335 echo "${ECHO_T}$cf_cv_func_openpty" >&6
15336
15337 if test "$cf_cv_func_openpty" != no ; then
15338
15339 cat >>confdefs.h <<EOF
15340 #define USE_OPENPTY_HEADER <$cf_cv_func_openpty>
15341 EOF
15342
15343 cat >>confdefs.h <<\EOF
15344 #define USE_XTERM_PTY 1
15345 EOF
15346
15347         if test "x$cf_cv_lib_util" = xyes ; then
15348
15349 cf_add_libs="-lutil"
15350 # Filter out duplicates - this happens with badly-designed ".pc" files...
15351 for cf_add_1lib in $TEST_LIBS
15352 do
15353         for cf_add_2lib in $cf_add_libs
15354         do
15355                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
15356                 then
15357                         cf_add_1lib=
15358                         break
15359                 fi
15360         done
15361         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
15362 done
15363 TEST_LIBS="$cf_add_libs"
15364
15365         fi
15366 fi
15367
15368 echo "$as_me:15368: checking for function curses_version" >&5
15369 echo $ECHO_N "checking for function curses_version... $ECHO_C" >&6
15370 if test "${cf_cv_func_curses_version+set}" = set; then
15371   echo $ECHO_N "(cached) $ECHO_C" >&6
15372 else
15373
15374 if test "$cross_compiling" = yes; then
15375   cf_cv_func_curses_version=unknown
15376 else
15377   cat >conftest.$ac_ext <<_ACEOF
15378 #line 15378 "configure"
15379 #include "confdefs.h"
15380
15381 #include <${cf_cv_ncurses_header:-curses.h}>
15382 int main()
15383 {
15384         char temp[1024];
15385         sprintf(temp, "%s\n", curses_version());
15386         ${cf_cv_main_return:-return}(0);
15387 }
15388
15389 _ACEOF
15390 rm -f conftest$ac_exeext
15391 if { (eval echo "$as_me:15391: \"$ac_link\"") >&5
15392   (eval $ac_link) 2>&5
15393   ac_status=$?
15394   echo "$as_me:15394: \$? = $ac_status" >&5
15395   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
15396   { (eval echo "$as_me:15396: \"$ac_try\"") >&5
15397   (eval $ac_try) 2>&5
15398   ac_status=$?
15399   echo "$as_me:15399: \$? = $ac_status" >&5
15400   (exit $ac_status); }; }; then
15401   cf_cv_func_curses_version=yes
15402
15403 else
15404   echo "$as_me: program exited with status $ac_status" >&5
15405 echo "$as_me: failed program was:" >&5
15406 cat conftest.$ac_ext >&5
15407 cf_cv_func_curses_version=no
15408
15409 fi
15410 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
15411 fi
15412 rm -f core
15413 fi
15414 echo "$as_me:15414: result: $cf_cv_func_curses_version" >&5
15415 echo "${ECHO_T}$cf_cv_func_curses_version" >&6
15416 test "$cf_cv_func_curses_version" = yes &&
15417 cat >>confdefs.h <<\EOF
15418 #define HAVE_CURSES_VERSION 1
15419 EOF
15420
15421 echo "$as_me:15421: checking for alternate character set array" >&5
15422 echo $ECHO_N "checking for alternate character set array... $ECHO_C" >&6
15423 if test "${cf_cv_curses_acs_map+set}" = set; then
15424   echo $ECHO_N "(cached) $ECHO_C" >&6
15425 else
15426
15427 cf_cv_curses_acs_map=unknown
15428 for name in acs_map _acs_map __acs_map ${NCURSES_WRAP_PREFIX}acs_map
15429 do
15430 cat >conftest.$ac_ext <<_ACEOF
15431 #line 15431 "configure"
15432 #include "confdefs.h"
15433
15434 #include <${cf_cv_ncurses_header:-curses.h}>
15435
15436 int
15437 main ()
15438 {
15439
15440 $name['k'] = ACS_PLUS
15441
15442   ;
15443   return 0;
15444 }
15445 _ACEOF
15446 rm -f conftest.$ac_objext conftest$ac_exeext
15447 if { (eval echo "$as_me:15447: \"$ac_link\"") >&5
15448   (eval $ac_link) 2>&5
15449   ac_status=$?
15450   echo "$as_me:15450: \$? = $ac_status" >&5
15451   (exit $ac_status); } &&
15452          { ac_try='test -s conftest$ac_exeext'
15453   { (eval echo "$as_me:15453: \"$ac_try\"") >&5
15454   (eval $ac_try) 2>&5
15455   ac_status=$?
15456   echo "$as_me:15456: \$? = $ac_status" >&5
15457   (exit $ac_status); }; }; then
15458   cf_cv_curses_acs_map=$name; break
15459 else
15460   echo "$as_me: failed program was:" >&5
15461 cat conftest.$ac_ext >&5
15462 fi
15463 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15464 done
15465
15466 fi
15467 echo "$as_me:15467: result: $cf_cv_curses_acs_map" >&5
15468 echo "${ECHO_T}$cf_cv_curses_acs_map" >&6
15469
15470 test "$cf_cv_curses_acs_map" != unknown &&
15471 cat >>confdefs.h <<EOF
15472 #define CURSES_ACS_ARRAY $cf_cv_curses_acs_map
15473 EOF
15474
15475 if test "$cf_enable_widec" = yes; then
15476
15477 echo "$as_me:15477: checking for wide alternate character set array" >&5
15478 echo $ECHO_N "checking for wide alternate character set array... $ECHO_C" >&6
15479 if test "${cf_cv_curses_wacs_map+set}" = set; then
15480   echo $ECHO_N "(cached) $ECHO_C" >&6
15481 else
15482
15483         cf_cv_curses_wacs_map=unknown
15484         for name in wacs_map _wacs_map __wacs_map _nc_wacs _wacs_char
15485         do
15486         cat >conftest.$ac_ext <<_ACEOF
15487 #line 15487 "configure"
15488 #include "confdefs.h"
15489
15490 #ifndef _XOPEN_SOURCE_EXTENDED
15491 #define _XOPEN_SOURCE_EXTENDED
15492 #endif
15493 #include <${cf_cv_ncurses_header:-curses.h}>
15494 int
15495 main ()
15496 {
15497 void *foo = &($name['k'])
15498   ;
15499   return 0;
15500 }
15501 _ACEOF
15502 rm -f conftest.$ac_objext conftest$ac_exeext
15503 if { (eval echo "$as_me:15503: \"$ac_link\"") >&5
15504   (eval $ac_link) 2>&5
15505   ac_status=$?
15506   echo "$as_me:15506: \$? = $ac_status" >&5
15507   (exit $ac_status); } &&
15508          { ac_try='test -s conftest$ac_exeext'
15509   { (eval echo "$as_me:15509: \"$ac_try\"") >&5
15510   (eval $ac_try) 2>&5
15511   ac_status=$?
15512   echo "$as_me:15512: \$? = $ac_status" >&5
15513   (exit $ac_status); }; }; then
15514   cf_cv_curses_wacs_map=$name
15515          break
15516 else
15517   echo "$as_me: failed program was:" >&5
15518 cat conftest.$ac_ext >&5
15519 fi
15520 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15521         done
15522 fi
15523 echo "$as_me:15523: result: $cf_cv_curses_wacs_map" >&5
15524 echo "${ECHO_T}$cf_cv_curses_wacs_map" >&6
15525
15526 test "$cf_cv_curses_wacs_map" != unknown &&
15527 cat >>confdefs.h <<EOF
15528 #define CURSES_WACS_ARRAY $cf_cv_curses_wacs_map
15529 EOF
15530
15531 echo "$as_me:15531: checking for wide alternate character constants" >&5
15532 echo $ECHO_N "checking for wide alternate character constants... $ECHO_C" >&6
15533 if test "${cf_cv_curses_wacs_symbols+set}" = set; then
15534   echo $ECHO_N "(cached) $ECHO_C" >&6
15535 else
15536
15537 cf_cv_curses_wacs_symbols=no
15538 if test "$cf_cv_curses_wacs_map" != unknown
15539 then
15540         cat >conftest.$ac_ext <<_ACEOF
15541 #line 15541 "configure"
15542 #include "confdefs.h"
15543
15544 #ifndef _XOPEN_SOURCE_EXTENDED
15545 #define _XOPEN_SOURCE_EXTENDED
15546 #endif
15547 #include <${cf_cv_ncurses_header:-curses.h}>
15548 int
15549 main ()
15550 {
15551 cchar_t *foo = WACS_PLUS;
15552          $cf_cv_curses_wacs_map['k'] = *WACS_PLUS
15553   ;
15554   return 0;
15555 }
15556 _ACEOF
15557 rm -f conftest.$ac_objext conftest$ac_exeext
15558 if { (eval echo "$as_me:15558: \"$ac_link\"") >&5
15559   (eval $ac_link) 2>&5
15560   ac_status=$?
15561   echo "$as_me:15561: \$? = $ac_status" >&5
15562   (exit $ac_status); } &&
15563          { ac_try='test -s conftest$ac_exeext'
15564   { (eval echo "$as_me:15564: \"$ac_try\"") >&5
15565   (eval $ac_try) 2>&5
15566   ac_status=$?
15567   echo "$as_me:15567: \$? = $ac_status" >&5
15568   (exit $ac_status); }; }; then
15569   cf_cv_curses_wacs_symbols=yes
15570 else
15571   echo "$as_me: failed program was:" >&5
15572 cat conftest.$ac_ext >&5
15573 fi
15574 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15575 else
15576         cat >conftest.$ac_ext <<_ACEOF
15577 #line 15577 "configure"
15578 #include "confdefs.h"
15579
15580 #ifndef _XOPEN_SOURCE_EXTENDED
15581 #define _XOPEN_SOURCE_EXTENDED
15582 #endif
15583 #include <${cf_cv_ncurses_header:-curses.h}>
15584 int
15585 main ()
15586 {
15587 cchar_t *foo = WACS_PLUS
15588   ;
15589   return 0;
15590 }
15591 _ACEOF
15592 rm -f conftest.$ac_objext conftest$ac_exeext
15593 if { (eval echo "$as_me:15593: \"$ac_link\"") >&5
15594   (eval $ac_link) 2>&5
15595   ac_status=$?
15596   echo "$as_me:15596: \$? = $ac_status" >&5
15597   (exit $ac_status); } &&
15598          { ac_try='test -s conftest$ac_exeext'
15599   { (eval echo "$as_me:15599: \"$ac_try\"") >&5
15600   (eval $ac_try) 2>&5
15601   ac_status=$?
15602   echo "$as_me:15602: \$? = $ac_status" >&5
15603   (exit $ac_status); }; }; then
15604   cf_cv_curses_wacs_symbols=yes
15605 else
15606   echo "$as_me: failed program was:" >&5
15607 cat conftest.$ac_ext >&5
15608 fi
15609 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15610 fi
15611
15612 fi
15613 echo "$as_me:15613: result: $cf_cv_curses_wacs_symbols" >&5
15614 echo "${ECHO_T}$cf_cv_curses_wacs_symbols" >&6
15615
15616 test "$cf_cv_curses_wacs_symbols" != no &&
15617 cat >>confdefs.h <<\EOF
15618 #define CURSES_WACS_SYMBOLS 1
15619 EOF
15620
15621 fi
15622
15623 echo "$as_me:15623: checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}" >&5
15624 echo $ECHO_N "checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
15625 cat >conftest.$ac_ext <<_ACEOF
15626 #line 15626 "configure"
15627 #include "confdefs.h"
15628
15629 #ifndef _XOPEN_SOURCE_EXTENDED
15630 #define _XOPEN_SOURCE_EXTENDED
15631 #endif
15632 #include <${cf_cv_ncurses_header:-curses.h}>
15633 int
15634 main ()
15635 {
15636
15637 attr_t foo
15638
15639   ;
15640   return 0;
15641 }
15642 _ACEOF
15643 rm -f conftest.$ac_objext
15644 if { (eval echo "$as_me:15644: \"$ac_compile\"") >&5
15645   (eval $ac_compile) 2>&5
15646   ac_status=$?
15647   echo "$as_me:15647: \$? = $ac_status" >&5
15648   (exit $ac_status); } &&
15649          { ac_try='test -s conftest.$ac_objext'
15650   { (eval echo "$as_me:15650: \"$ac_try\"") >&5
15651   (eval $ac_try) 2>&5
15652   ac_status=$?
15653   echo "$as_me:15653: \$? = $ac_status" >&5
15654   (exit $ac_status); }; }; then
15655   cf_result=yes
15656 else
15657   echo "$as_me: failed program was:" >&5
15658 cat conftest.$ac_ext >&5
15659 cf_result=no
15660 fi
15661 rm -f conftest.$ac_objext conftest.$ac_ext
15662 echo "$as_me:15662: result: $cf_result" >&5
15663 echo "${ECHO_T}$cf_result" >&6
15664 if test $cf_result = yes ; then
15665
15666 cf_result=`echo "have_type_attr_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15667
15668 cat >>confdefs.h <<EOF
15669 #define $cf_result 1
15670 EOF
15671
15672 else
15673
15674 cat >>confdefs.h <<EOF
15675 #define attr_t long
15676 EOF
15677
15678 fi
15679
15680 if test "$cf_enable_widec" = yes; then
15681
15682 # This is needed on Tru64 5.0 to declare mbstate_t
15683 echo "$as_me:15683: checking if we must include wchar.h to declare mbstate_t" >&5
15684 echo $ECHO_N "checking if we must include wchar.h to declare mbstate_t... $ECHO_C" >&6
15685 if test "${cf_cv_mbstate_t+set}" = set; then
15686   echo $ECHO_N "(cached) $ECHO_C" >&6
15687 else
15688
15689 cat >conftest.$ac_ext <<_ACEOF
15690 #line 15690 "configure"
15691 #include "confdefs.h"
15692
15693 #include <stdlib.h>
15694 #include <stdarg.h>
15695 #include <stdio.h>
15696 #ifdef HAVE_LIBUTF8_H
15697 #include <libutf8.h>
15698 #endif
15699 int
15700 main ()
15701 {
15702 mbstate_t state
15703   ;
15704   return 0;
15705 }
15706 _ACEOF
15707 rm -f conftest.$ac_objext
15708 if { (eval echo "$as_me:15708: \"$ac_compile\"") >&5
15709   (eval $ac_compile) 2>&5
15710   ac_status=$?
15711   echo "$as_me:15711: \$? = $ac_status" >&5
15712   (exit $ac_status); } &&
15713          { ac_try='test -s conftest.$ac_objext'
15714   { (eval echo "$as_me:15714: \"$ac_try\"") >&5
15715   (eval $ac_try) 2>&5
15716   ac_status=$?
15717   echo "$as_me:15717: \$? = $ac_status" >&5
15718   (exit $ac_status); }; }; then
15719   cf_cv_mbstate_t=no
15720 else
15721   echo "$as_me: failed program was:" >&5
15722 cat conftest.$ac_ext >&5
15723 cat >conftest.$ac_ext <<_ACEOF
15724 #line 15724 "configure"
15725 #include "confdefs.h"
15726
15727 #include <stdlib.h>
15728 #include <stdarg.h>
15729 #include <stdio.h>
15730 #include <wchar.h>
15731 #ifdef HAVE_LIBUTF8_H
15732 #include <libutf8.h>
15733 #endif
15734 int
15735 main ()
15736 {
15737 mbstate_t value
15738   ;
15739   return 0;
15740 }
15741 _ACEOF
15742 rm -f conftest.$ac_objext
15743 if { (eval echo "$as_me:15743: \"$ac_compile\"") >&5
15744   (eval $ac_compile) 2>&5
15745   ac_status=$?
15746   echo "$as_me:15746: \$? = $ac_status" >&5
15747   (exit $ac_status); } &&
15748          { ac_try='test -s conftest.$ac_objext'
15749   { (eval echo "$as_me:15749: \"$ac_try\"") >&5
15750   (eval $ac_try) 2>&5
15751   ac_status=$?
15752   echo "$as_me:15752: \$? = $ac_status" >&5
15753   (exit $ac_status); }; }; then
15754   cf_cv_mbstate_t=yes
15755 else
15756   echo "$as_me: failed program was:" >&5
15757 cat conftest.$ac_ext >&5
15758 cf_cv_mbstate_t=unknown
15759 fi
15760 rm -f conftest.$ac_objext conftest.$ac_ext
15761 fi
15762 rm -f conftest.$ac_objext conftest.$ac_ext
15763 fi
15764 echo "$as_me:15764: result: $cf_cv_mbstate_t" >&5
15765 echo "${ECHO_T}$cf_cv_mbstate_t" >&6
15766
15767 if test "$cf_cv_mbstate_t" = yes ; then
15768
15769 cat >>confdefs.h <<\EOF
15770 #define NEED_WCHAR_H 1
15771 EOF
15772
15773         NEED_WCHAR_H=1
15774 fi
15775
15776 # if we do not find mbstate_t in either place, use substitution to provide a fallback.
15777 if test "$cf_cv_mbstate_t" = unknown ; then
15778         NCURSES_MBSTATE_T=1
15779 fi
15780
15781 # if we find mbstate_t in either place, use substitution to provide a fallback.
15782 if test "$cf_cv_mbstate_t" != unknown ; then
15783         NCURSES_OK_MBSTATE_T=1
15784 fi
15785
15786 # This is needed on Tru64 5.0 to declare wchar_t
15787 echo "$as_me:15787: checking if we must include wchar.h to declare wchar_t" >&5
15788 echo $ECHO_N "checking if we must include wchar.h to declare wchar_t... $ECHO_C" >&6
15789 if test "${cf_cv_wchar_t+set}" = set; then
15790   echo $ECHO_N "(cached) $ECHO_C" >&6
15791 else
15792
15793 cat >conftest.$ac_ext <<_ACEOF
15794 #line 15794 "configure"
15795 #include "confdefs.h"
15796
15797 #include <stdlib.h>
15798 #include <stdarg.h>
15799 #include <stdio.h>
15800 #ifdef HAVE_LIBUTF8_H
15801 #include <libutf8.h>
15802 #endif
15803 int
15804 main ()
15805 {
15806 wchar_t state
15807   ;
15808   return 0;
15809 }
15810 _ACEOF
15811 rm -f conftest.$ac_objext
15812 if { (eval echo "$as_me:15812: \"$ac_compile\"") >&5
15813   (eval $ac_compile) 2>&5
15814   ac_status=$?
15815   echo "$as_me:15815: \$? = $ac_status" >&5
15816   (exit $ac_status); } &&
15817          { ac_try='test -s conftest.$ac_objext'
15818   { (eval echo "$as_me:15818: \"$ac_try\"") >&5
15819   (eval $ac_try) 2>&5
15820   ac_status=$?
15821   echo "$as_me:15821: \$? = $ac_status" >&5
15822   (exit $ac_status); }; }; then
15823   cf_cv_wchar_t=no
15824 else
15825   echo "$as_me: failed program was:" >&5
15826 cat conftest.$ac_ext >&5
15827 cat >conftest.$ac_ext <<_ACEOF
15828 #line 15828 "configure"
15829 #include "confdefs.h"
15830
15831 #include <stdlib.h>
15832 #include <stdarg.h>
15833 #include <stdio.h>
15834 #include <wchar.h>
15835 #ifdef HAVE_LIBUTF8_H
15836 #include <libutf8.h>
15837 #endif
15838 int
15839 main ()
15840 {
15841 wchar_t value
15842   ;
15843   return 0;
15844 }
15845 _ACEOF
15846 rm -f conftest.$ac_objext
15847 if { (eval echo "$as_me:15847: \"$ac_compile\"") >&5
15848   (eval $ac_compile) 2>&5
15849   ac_status=$?
15850   echo "$as_me:15850: \$? = $ac_status" >&5
15851   (exit $ac_status); } &&
15852          { ac_try='test -s conftest.$ac_objext'
15853   { (eval echo "$as_me:15853: \"$ac_try\"") >&5
15854   (eval $ac_try) 2>&5
15855   ac_status=$?
15856   echo "$as_me:15856: \$? = $ac_status" >&5
15857   (exit $ac_status); }; }; then
15858   cf_cv_wchar_t=yes
15859 else
15860   echo "$as_me: failed program was:" >&5
15861 cat conftest.$ac_ext >&5
15862 cf_cv_wchar_t=unknown
15863 fi
15864 rm -f conftest.$ac_objext conftest.$ac_ext
15865 fi
15866 rm -f conftest.$ac_objext conftest.$ac_ext
15867 fi
15868 echo "$as_me:15868: result: $cf_cv_wchar_t" >&5
15869 echo "${ECHO_T}$cf_cv_wchar_t" >&6
15870
15871 if test "$cf_cv_wchar_t" = yes ; then
15872
15873 cat >>confdefs.h <<\EOF
15874 #define NEED_WCHAR_H 1
15875 EOF
15876
15877         NEED_WCHAR_H=1
15878 fi
15879
15880 # if we do not find wchar_t in either place, use substitution to provide a fallback.
15881 if test "$cf_cv_wchar_t" = unknown ; then
15882         NCURSES_WCHAR_T=1
15883 fi
15884
15885 # if we find wchar_t in either place, use substitution to provide a fallback.
15886 if test "$cf_cv_wchar_t" != unknown ; then
15887         NCURSES_OK_WCHAR_T=1
15888 fi
15889
15890 # This is needed on Tru64 5.0 to declare wint_t
15891 echo "$as_me:15891: checking if we must include wchar.h to declare wint_t" >&5
15892 echo $ECHO_N "checking if we must include wchar.h to declare wint_t... $ECHO_C" >&6
15893 if test "${cf_cv_wint_t+set}" = set; then
15894   echo $ECHO_N "(cached) $ECHO_C" >&6
15895 else
15896
15897 cat >conftest.$ac_ext <<_ACEOF
15898 #line 15898 "configure"
15899 #include "confdefs.h"
15900
15901 #include <stdlib.h>
15902 #include <stdarg.h>
15903 #include <stdio.h>
15904 #ifdef HAVE_LIBUTF8_H
15905 #include <libutf8.h>
15906 #endif
15907 int
15908 main ()
15909 {
15910 wint_t state
15911   ;
15912   return 0;
15913 }
15914 _ACEOF
15915 rm -f conftest.$ac_objext
15916 if { (eval echo "$as_me:15916: \"$ac_compile\"") >&5
15917   (eval $ac_compile) 2>&5
15918   ac_status=$?
15919   echo "$as_me:15919: \$? = $ac_status" >&5
15920   (exit $ac_status); } &&
15921          { ac_try='test -s conftest.$ac_objext'
15922   { (eval echo "$as_me:15922: \"$ac_try\"") >&5
15923   (eval $ac_try) 2>&5
15924   ac_status=$?
15925   echo "$as_me:15925: \$? = $ac_status" >&5
15926   (exit $ac_status); }; }; then
15927   cf_cv_wint_t=no
15928 else
15929   echo "$as_me: failed program was:" >&5
15930 cat conftest.$ac_ext >&5
15931 cat >conftest.$ac_ext <<_ACEOF
15932 #line 15932 "configure"
15933 #include "confdefs.h"
15934
15935 #include <stdlib.h>
15936 #include <stdarg.h>
15937 #include <stdio.h>
15938 #include <wchar.h>
15939 #ifdef HAVE_LIBUTF8_H
15940 #include <libutf8.h>
15941 #endif
15942 int
15943 main ()
15944 {
15945 wint_t value
15946   ;
15947   return 0;
15948 }
15949 _ACEOF
15950 rm -f conftest.$ac_objext
15951 if { (eval echo "$as_me:15951: \"$ac_compile\"") >&5
15952   (eval $ac_compile) 2>&5
15953   ac_status=$?
15954   echo "$as_me:15954: \$? = $ac_status" >&5
15955   (exit $ac_status); } &&
15956          { ac_try='test -s conftest.$ac_objext'
15957   { (eval echo "$as_me:15957: \"$ac_try\"") >&5
15958   (eval $ac_try) 2>&5
15959   ac_status=$?
15960   echo "$as_me:15960: \$? = $ac_status" >&5
15961   (exit $ac_status); }; }; then
15962   cf_cv_wint_t=yes
15963 else
15964   echo "$as_me: failed program was:" >&5
15965 cat conftest.$ac_ext >&5
15966 cf_cv_wint_t=unknown
15967 fi
15968 rm -f conftest.$ac_objext conftest.$ac_ext
15969 fi
15970 rm -f conftest.$ac_objext conftest.$ac_ext
15971 fi
15972 echo "$as_me:15972: result: $cf_cv_wint_t" >&5
15973 echo "${ECHO_T}$cf_cv_wint_t" >&6
15974
15975 if test "$cf_cv_wint_t" = yes ; then
15976
15977 cat >>confdefs.h <<\EOF
15978 #define NEED_WCHAR_H 1
15979 EOF
15980
15981         NEED_WCHAR_H=1
15982 fi
15983
15984 # if we do not find wint_t in either place, use substitution to provide a fallback.
15985 if test "$cf_cv_wint_t" = unknown ; then
15986         NCURSES_WINT_T=1
15987 fi
15988
15989 # if we find wint_t in either place, use substitution to provide a fallback.
15990 if test "$cf_cv_wint_t" != unknown ; then
15991         NCURSES_OK_WINT_T=1
15992 fi
15993
15994         if test "$NCURSES_OK_MBSTATE_T" = 0 ; then
15995
15996 echo "$as_me:15996: checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}" >&5
15997 echo $ECHO_N "checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
15998 cat >conftest.$ac_ext <<_ACEOF
15999 #line 15999 "configure"
16000 #include "confdefs.h"
16001
16002 #ifndef _XOPEN_SOURCE_EXTENDED
16003 #define _XOPEN_SOURCE_EXTENDED
16004 #endif
16005 #include <${cf_cv_ncurses_header:-curses.h}>
16006 int
16007 main ()
16008 {
16009
16010 mbstate_t foo
16011
16012   ;
16013   return 0;
16014 }
16015 _ACEOF
16016 rm -f conftest.$ac_objext
16017 if { (eval echo "$as_me:16017: \"$ac_compile\"") >&5
16018   (eval $ac_compile) 2>&5
16019   ac_status=$?
16020   echo "$as_me:16020: \$? = $ac_status" >&5
16021   (exit $ac_status); } &&
16022          { ac_try='test -s conftest.$ac_objext'
16023   { (eval echo "$as_me:16023: \"$ac_try\"") >&5
16024   (eval $ac_try) 2>&5
16025   ac_status=$?
16026   echo "$as_me:16026: \$? = $ac_status" >&5
16027   (exit $ac_status); }; }; then
16028   cf_result=yes
16029 else
16030   echo "$as_me: failed program was:" >&5
16031 cat conftest.$ac_ext >&5
16032 cf_result=no
16033 fi
16034 rm -f conftest.$ac_objext conftest.$ac_ext
16035 echo "$as_me:16035: result: $cf_result" >&5
16036 echo "${ECHO_T}$cf_result" >&6
16037 if test $cf_result = yes ; then
16038
16039 cf_result=`echo "have_type_mbstate_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16040
16041 cat >>confdefs.h <<EOF
16042 #define $cf_result 1
16043 EOF
16044
16045 else
16046
16047 cat >>confdefs.h <<EOF
16048 #define mbstate_t long
16049 EOF
16050
16051 fi
16052
16053         fi
16054
16055         if test "$NCURSES_OK_WCHAR_T" = 0 ; then
16056
16057 echo "$as_me:16057: checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}" >&5
16058 echo $ECHO_N "checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
16059 cat >conftest.$ac_ext <<_ACEOF
16060 #line 16060 "configure"
16061 #include "confdefs.h"
16062
16063 #ifndef _XOPEN_SOURCE_EXTENDED
16064 #define _XOPEN_SOURCE_EXTENDED
16065 #endif
16066 #include <${cf_cv_ncurses_header:-curses.h}>
16067 int
16068 main ()
16069 {
16070
16071 wchar_t foo
16072
16073   ;
16074   return 0;
16075 }
16076 _ACEOF
16077 rm -f conftest.$ac_objext
16078 if { (eval echo "$as_me:16078: \"$ac_compile\"") >&5
16079   (eval $ac_compile) 2>&5
16080   ac_status=$?
16081   echo "$as_me:16081: \$? = $ac_status" >&5
16082   (exit $ac_status); } &&
16083          { ac_try='test -s conftest.$ac_objext'
16084   { (eval echo "$as_me:16084: \"$ac_try\"") >&5
16085   (eval $ac_try) 2>&5
16086   ac_status=$?
16087   echo "$as_me:16087: \$? = $ac_status" >&5
16088   (exit $ac_status); }; }; then
16089   cf_result=yes
16090 else
16091   echo "$as_me: failed program was:" >&5
16092 cat conftest.$ac_ext >&5
16093 cf_result=no
16094 fi
16095 rm -f conftest.$ac_objext conftest.$ac_ext
16096 echo "$as_me:16096: result: $cf_result" >&5
16097 echo "${ECHO_T}$cf_result" >&6
16098 if test $cf_result = yes ; then
16099
16100 cf_result=`echo "have_type_wchar_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16101
16102 cat >>confdefs.h <<EOF
16103 #define $cf_result 1
16104 EOF
16105
16106 else
16107
16108 cat >>confdefs.h <<EOF
16109 #define wchar_t long
16110 EOF
16111
16112 fi
16113
16114         fi
16115
16116         if test "$NCURSES_OK_WINT_T" = 0 ; then
16117
16118 echo "$as_me:16118: checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}" >&5
16119 echo $ECHO_N "checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
16120 cat >conftest.$ac_ext <<_ACEOF
16121 #line 16121 "configure"
16122 #include "confdefs.h"
16123
16124 #ifndef _XOPEN_SOURCE_EXTENDED
16125 #define _XOPEN_SOURCE_EXTENDED
16126 #endif
16127 #include <${cf_cv_ncurses_header:-curses.h}>
16128 int
16129 main ()
16130 {
16131
16132 wint_t foo
16133
16134   ;
16135   return 0;
16136 }
16137 _ACEOF
16138 rm -f conftest.$ac_objext
16139 if { (eval echo "$as_me:16139: \"$ac_compile\"") >&5
16140   (eval $ac_compile) 2>&5
16141   ac_status=$?
16142   echo "$as_me:16142: \$? = $ac_status" >&5
16143   (exit $ac_status); } &&
16144          { ac_try='test -s conftest.$ac_objext'
16145   { (eval echo "$as_me:16145: \"$ac_try\"") >&5
16146   (eval $ac_try) 2>&5
16147   ac_status=$?
16148   echo "$as_me:16148: \$? = $ac_status" >&5
16149   (exit $ac_status); }; }; then
16150   cf_result=yes
16151 else
16152   echo "$as_me: failed program was:" >&5
16153 cat conftest.$ac_ext >&5
16154 cf_result=no
16155 fi
16156 rm -f conftest.$ac_objext conftest.$ac_ext
16157 echo "$as_me:16157: result: $cf_result" >&5
16158 echo "${ECHO_T}$cf_result" >&6
16159 if test $cf_result = yes ; then
16160
16161 cf_result=`echo "have_type_wint_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16162
16163 cat >>confdefs.h <<EOF
16164 #define $cf_result 1
16165 EOF
16166
16167 else
16168
16169 cat >>confdefs.h <<EOF
16170 #define wint_t long
16171 EOF
16172
16173 fi
16174
16175         fi
16176 fi
16177
16178 echo "$as_me:16178: checking for data ospeed declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
16179 echo $ECHO_N "checking for data ospeed declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
16180
16181 cat >conftest.$ac_ext <<_ACEOF
16182 #line 16182 "configure"
16183 #include "confdefs.h"
16184
16185 #ifdef HAVE_XCURSES
16186 #include <xcurses.h>
16187 char * XCursesProgramName = "test";
16188 #else
16189 #include <${cf_cv_ncurses_header:-curses.h}>
16190 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16191 #include <ncursesw/term.h>
16192 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16193 #include <ncurses/term.h>
16194 #elif defined(HAVE_TERM_H)
16195 #include <term.h>
16196 #endif
16197 #endif
16198
16199 int
16200 main ()
16201 {
16202
16203 void *foo = &(ospeed)
16204
16205   ;
16206   return 0;
16207 }
16208 _ACEOF
16209 rm -f conftest.$ac_objext
16210 if { (eval echo "$as_me:16210: \"$ac_compile\"") >&5
16211   (eval $ac_compile) 2>&5
16212   ac_status=$?
16213   echo "$as_me:16213: \$? = $ac_status" >&5
16214   (exit $ac_status); } &&
16215          { ac_try='test -s conftest.$ac_objext'
16216   { (eval echo "$as_me:16216: \"$ac_try\"") >&5
16217   (eval $ac_try) 2>&5
16218   ac_status=$?
16219   echo "$as_me:16219: \$? = $ac_status" >&5
16220   (exit $ac_status); }; }; then
16221   cf_result=yes
16222 else
16223   echo "$as_me: failed program was:" >&5
16224 cat conftest.$ac_ext >&5
16225 cf_result=no
16226 fi
16227 rm -f conftest.$ac_objext conftest.$ac_ext
16228 echo "$as_me:16228: result: $cf_result" >&5
16229 echo "${ECHO_T}$cf_result" >&6
16230
16231 if test $cf_result = yes ; then
16232
16233 cf_result=`echo "have_curses_data_ospeed" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16234
16235         cat >>confdefs.h <<EOF
16236 #define $cf_result 1
16237 EOF
16238
16239 else
16240         echo "$as_me:16240: checking for data ospeed in library" >&5
16241 echo $ECHO_N "checking for data ospeed in library... $ECHO_C" >&6
16242         # BSD linkers insist on making weak linkage, but resolve at runtime.
16243         if test "$cross_compiling" = yes; then
16244
16245         # cross-compiling
16246         cat >conftest.$ac_ext <<_ACEOF
16247 #line 16247 "configure"
16248 #include "confdefs.h"
16249
16250 #ifdef HAVE_XCURSES
16251 #include <xcurses.h>
16252 char * XCursesProgramName = "test";
16253 #else
16254 #include <${cf_cv_ncurses_header:-curses.h}>
16255 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16256 #include <ncursesw/term.h>
16257 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16258 #include <ncurses/term.h>
16259 #elif defined(HAVE_TERM_H)
16260 #include <term.h>
16261 #endif
16262 #endif
16263
16264 extern char ospeed;
16265 int
16266 main ()
16267 {
16268
16269         do {
16270                 void *foo = &(ospeed);
16271                 fprintf(stderr, "testing linkage of ospeed:%p\n", foo);
16272                 ${cf_cv_main_return:-return}(foo == 0);
16273         } while (0)
16274
16275   ;
16276   return 0;
16277 }
16278 _ACEOF
16279 rm -f conftest.$ac_objext conftest$ac_exeext
16280 if { (eval echo "$as_me:16280: \"$ac_link\"") >&5
16281   (eval $ac_link) 2>&5
16282   ac_status=$?
16283   echo "$as_me:16283: \$? = $ac_status" >&5
16284   (exit $ac_status); } &&
16285          { ac_try='test -s conftest$ac_exeext'
16286   { (eval echo "$as_me:16286: \"$ac_try\"") >&5
16287   (eval $ac_try) 2>&5
16288   ac_status=$?
16289   echo "$as_me:16289: \$? = $ac_status" >&5
16290   (exit $ac_status); }; }; then
16291   cf_result=yes
16292 else
16293   echo "$as_me: failed program was:" >&5
16294 cat conftest.$ac_ext >&5
16295 cf_result=no
16296 fi
16297 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16298
16299 else
16300   cat >conftest.$ac_ext <<_ACEOF
16301 #line 16301 "configure"
16302 #include "confdefs.h"
16303
16304 #ifdef HAVE_XCURSES
16305 #include <xcurses.h>
16306 char * XCursesProgramName = "test";
16307 #else
16308 #include <${cf_cv_ncurses_header:-curses.h}>
16309 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16310 #include <ncursesw/term.h>
16311 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16312 #include <ncurses/term.h>
16313 #elif defined(HAVE_TERM_H)
16314 #include <term.h>
16315 #endif
16316 #endif
16317
16318 extern char ospeed;
16319 int main(void)
16320 {
16321         void *foo = &(ospeed);
16322         fprintf(stderr, "testing linkage of ospeed:%p\n", foo);
16323         ${cf_cv_main_return:-return}(foo == 0);
16324 }
16325 _ACEOF
16326 rm -f conftest$ac_exeext
16327 if { (eval echo "$as_me:16327: \"$ac_link\"") >&5
16328   (eval $ac_link) 2>&5
16329   ac_status=$?
16330   echo "$as_me:16330: \$? = $ac_status" >&5
16331   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
16332   { (eval echo "$as_me:16332: \"$ac_try\"") >&5
16333   (eval $ac_try) 2>&5
16334   ac_status=$?
16335   echo "$as_me:16335: \$? = $ac_status" >&5
16336   (exit $ac_status); }; }; then
16337   cf_result=yes
16338 else
16339   echo "$as_me: program exited with status $ac_status" >&5
16340 echo "$as_me: failed program was:" >&5
16341 cat conftest.$ac_ext >&5
16342 cf_result=no
16343 fi
16344 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
16345 fi
16346         echo "$as_me:16346: result: $cf_result" >&5
16347 echo "${ECHO_T}$cf_result" >&6
16348         if test $cf_result = yes ; then
16349
16350 cf_result=`echo "decl_curses_data_ospeed" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16351
16352                 cat >>confdefs.h <<EOF
16353 #define $cf_result 1
16354 EOF
16355
16356         fi
16357 fi
16358
16359 echo "$as_me:16359: checking for data boolnames declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
16360 echo $ECHO_N "checking for data boolnames declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
16361
16362 cat >conftest.$ac_ext <<_ACEOF
16363 #line 16363 "configure"
16364 #include "confdefs.h"
16365
16366 #ifdef HAVE_XCURSES
16367 #include <xcurses.h>
16368 char * XCursesProgramName = "test";
16369 #else
16370 #include <${cf_cv_ncurses_header:-curses.h}>
16371 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16372 #include <ncursesw/term.h>
16373 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16374 #include <ncurses/term.h>
16375 #elif defined(HAVE_TERM_H)
16376 #include <term.h>
16377 #endif
16378 #endif
16379
16380 int
16381 main ()
16382 {
16383
16384 void *foo = &(boolnames)
16385
16386   ;
16387   return 0;
16388 }
16389 _ACEOF
16390 rm -f conftest.$ac_objext
16391 if { (eval echo "$as_me:16391: \"$ac_compile\"") >&5
16392   (eval $ac_compile) 2>&5
16393   ac_status=$?
16394   echo "$as_me:16394: \$? = $ac_status" >&5
16395   (exit $ac_status); } &&
16396          { ac_try='test -s conftest.$ac_objext'
16397   { (eval echo "$as_me:16397: \"$ac_try\"") >&5
16398   (eval $ac_try) 2>&5
16399   ac_status=$?
16400   echo "$as_me:16400: \$? = $ac_status" >&5
16401   (exit $ac_status); }; }; then
16402   cf_result=yes
16403 else
16404   echo "$as_me: failed program was:" >&5
16405 cat conftest.$ac_ext >&5
16406 cf_result=no
16407 fi
16408 rm -f conftest.$ac_objext conftest.$ac_ext
16409 echo "$as_me:16409: result: $cf_result" >&5
16410 echo "${ECHO_T}$cf_result" >&6
16411
16412 if test $cf_result = yes ; then
16413
16414 cf_result=`echo "have_curses_data_boolnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16415
16416         cat >>confdefs.h <<EOF
16417 #define $cf_result 1
16418 EOF
16419
16420 else
16421         echo "$as_me:16421: checking for data boolnames in library" >&5
16422 echo $ECHO_N "checking for data boolnames in library... $ECHO_C" >&6
16423         # BSD linkers insist on making weak linkage, but resolve at runtime.
16424         if test "$cross_compiling" = yes; then
16425
16426         # cross-compiling
16427         cat >conftest.$ac_ext <<_ACEOF
16428 #line 16428 "configure"
16429 #include "confdefs.h"
16430
16431 #ifdef HAVE_XCURSES
16432 #include <xcurses.h>
16433 char * XCursesProgramName = "test";
16434 #else
16435 #include <${cf_cv_ncurses_header:-curses.h}>
16436 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16437 #include <ncursesw/term.h>
16438 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16439 #include <ncurses/term.h>
16440 #elif defined(HAVE_TERM_H)
16441 #include <term.h>
16442 #endif
16443 #endif
16444
16445 extern char boolnames;
16446 int
16447 main ()
16448 {
16449
16450         do {
16451                 void *foo = &(boolnames);
16452                 fprintf(stderr, "testing linkage of boolnames:%p\n", foo);
16453                 ${cf_cv_main_return:-return}(foo == 0);
16454         } while (0)
16455
16456   ;
16457   return 0;
16458 }
16459 _ACEOF
16460 rm -f conftest.$ac_objext conftest$ac_exeext
16461 if { (eval echo "$as_me:16461: \"$ac_link\"") >&5
16462   (eval $ac_link) 2>&5
16463   ac_status=$?
16464   echo "$as_me:16464: \$? = $ac_status" >&5
16465   (exit $ac_status); } &&
16466          { ac_try='test -s conftest$ac_exeext'
16467   { (eval echo "$as_me:16467: \"$ac_try\"") >&5
16468   (eval $ac_try) 2>&5
16469   ac_status=$?
16470   echo "$as_me:16470: \$? = $ac_status" >&5
16471   (exit $ac_status); }; }; then
16472   cf_result=yes
16473 else
16474   echo "$as_me: failed program was:" >&5
16475 cat conftest.$ac_ext >&5
16476 cf_result=no
16477 fi
16478 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16479
16480 else
16481   cat >conftest.$ac_ext <<_ACEOF
16482 #line 16482 "configure"
16483 #include "confdefs.h"
16484
16485 #ifdef HAVE_XCURSES
16486 #include <xcurses.h>
16487 char * XCursesProgramName = "test";
16488 #else
16489 #include <${cf_cv_ncurses_header:-curses.h}>
16490 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16491 #include <ncursesw/term.h>
16492 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16493 #include <ncurses/term.h>
16494 #elif defined(HAVE_TERM_H)
16495 #include <term.h>
16496 #endif
16497 #endif
16498
16499 extern char boolnames;
16500 int main(void)
16501 {
16502         void *foo = &(boolnames);
16503         fprintf(stderr, "testing linkage of boolnames:%p\n", foo);
16504         ${cf_cv_main_return:-return}(foo == 0);
16505 }
16506 _ACEOF
16507 rm -f conftest$ac_exeext
16508 if { (eval echo "$as_me:16508: \"$ac_link\"") >&5
16509   (eval $ac_link) 2>&5
16510   ac_status=$?
16511   echo "$as_me:16511: \$? = $ac_status" >&5
16512   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
16513   { (eval echo "$as_me:16513: \"$ac_try\"") >&5
16514   (eval $ac_try) 2>&5
16515   ac_status=$?
16516   echo "$as_me:16516: \$? = $ac_status" >&5
16517   (exit $ac_status); }; }; then
16518   cf_result=yes
16519 else
16520   echo "$as_me: program exited with status $ac_status" >&5
16521 echo "$as_me: failed program was:" >&5
16522 cat conftest.$ac_ext >&5
16523 cf_result=no
16524 fi
16525 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
16526 fi
16527         echo "$as_me:16527: result: $cf_result" >&5
16528 echo "${ECHO_T}$cf_result" >&6
16529         if test $cf_result = yes ; then
16530
16531 cf_result=`echo "decl_curses_data_boolnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16532
16533                 cat >>confdefs.h <<EOF
16534 #define $cf_result 1
16535 EOF
16536
16537         fi
16538 fi
16539
16540 echo "$as_me:16540: checking for data boolfnames declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
16541 echo $ECHO_N "checking for data boolfnames declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
16542
16543 cat >conftest.$ac_ext <<_ACEOF
16544 #line 16544 "configure"
16545 #include "confdefs.h"
16546
16547 #ifdef HAVE_XCURSES
16548 #include <xcurses.h>
16549 char * XCursesProgramName = "test";
16550 #else
16551 #include <${cf_cv_ncurses_header:-curses.h}>
16552 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16553 #include <ncursesw/term.h>
16554 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16555 #include <ncurses/term.h>
16556 #elif defined(HAVE_TERM_H)
16557 #include <term.h>
16558 #endif
16559 #endif
16560
16561 int
16562 main ()
16563 {
16564
16565 void *foo = &(boolfnames)
16566
16567   ;
16568   return 0;
16569 }
16570 _ACEOF
16571 rm -f conftest.$ac_objext
16572 if { (eval echo "$as_me:16572: \"$ac_compile\"") >&5
16573   (eval $ac_compile) 2>&5
16574   ac_status=$?
16575   echo "$as_me:16575: \$? = $ac_status" >&5
16576   (exit $ac_status); } &&
16577          { ac_try='test -s conftest.$ac_objext'
16578   { (eval echo "$as_me:16578: \"$ac_try\"") >&5
16579   (eval $ac_try) 2>&5
16580   ac_status=$?
16581   echo "$as_me:16581: \$? = $ac_status" >&5
16582   (exit $ac_status); }; }; then
16583   cf_result=yes
16584 else
16585   echo "$as_me: failed program was:" >&5
16586 cat conftest.$ac_ext >&5
16587 cf_result=no
16588 fi
16589 rm -f conftest.$ac_objext conftest.$ac_ext
16590 echo "$as_me:16590: result: $cf_result" >&5
16591 echo "${ECHO_T}$cf_result" >&6
16592
16593 if test $cf_result = yes ; then
16594
16595 cf_result=`echo "have_curses_data_boolfnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16596
16597         cat >>confdefs.h <<EOF
16598 #define $cf_result 1
16599 EOF
16600
16601 else
16602         echo "$as_me:16602: checking for data boolfnames in library" >&5
16603 echo $ECHO_N "checking for data boolfnames in library... $ECHO_C" >&6
16604         # BSD linkers insist on making weak linkage, but resolve at runtime.
16605         if test "$cross_compiling" = yes; then
16606
16607         # cross-compiling
16608         cat >conftest.$ac_ext <<_ACEOF
16609 #line 16609 "configure"
16610 #include "confdefs.h"
16611
16612 #ifdef HAVE_XCURSES
16613 #include <xcurses.h>
16614 char * XCursesProgramName = "test";
16615 #else
16616 #include <${cf_cv_ncurses_header:-curses.h}>
16617 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16618 #include <ncursesw/term.h>
16619 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16620 #include <ncurses/term.h>
16621 #elif defined(HAVE_TERM_H)
16622 #include <term.h>
16623 #endif
16624 #endif
16625
16626 extern char boolfnames;
16627 int
16628 main ()
16629 {
16630
16631         do {
16632                 void *foo = &(boolfnames);
16633                 fprintf(stderr, "testing linkage of boolfnames:%p\n", foo);
16634                 ${cf_cv_main_return:-return}(foo == 0);
16635         } while (0)
16636
16637   ;
16638   return 0;
16639 }
16640 _ACEOF
16641 rm -f conftest.$ac_objext conftest$ac_exeext
16642 if { (eval echo "$as_me:16642: \"$ac_link\"") >&5
16643   (eval $ac_link) 2>&5
16644   ac_status=$?
16645   echo "$as_me:16645: \$? = $ac_status" >&5
16646   (exit $ac_status); } &&
16647          { ac_try='test -s conftest$ac_exeext'
16648   { (eval echo "$as_me:16648: \"$ac_try\"") >&5
16649   (eval $ac_try) 2>&5
16650   ac_status=$?
16651   echo "$as_me:16651: \$? = $ac_status" >&5
16652   (exit $ac_status); }; }; then
16653   cf_result=yes
16654 else
16655   echo "$as_me: failed program was:" >&5
16656 cat conftest.$ac_ext >&5
16657 cf_result=no
16658 fi
16659 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16660
16661 else
16662   cat >conftest.$ac_ext <<_ACEOF
16663 #line 16663 "configure"
16664 #include "confdefs.h"
16665
16666 #ifdef HAVE_XCURSES
16667 #include <xcurses.h>
16668 char * XCursesProgramName = "test";
16669 #else
16670 #include <${cf_cv_ncurses_header:-curses.h}>
16671 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16672 #include <ncursesw/term.h>
16673 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16674 #include <ncurses/term.h>
16675 #elif defined(HAVE_TERM_H)
16676 #include <term.h>
16677 #endif
16678 #endif
16679
16680 extern char boolfnames;
16681 int main(void)
16682 {
16683         void *foo = &(boolfnames);
16684         fprintf(stderr, "testing linkage of boolfnames:%p\n", foo);
16685         ${cf_cv_main_return:-return}(foo == 0);
16686 }
16687 _ACEOF
16688 rm -f conftest$ac_exeext
16689 if { (eval echo "$as_me:16689: \"$ac_link\"") >&5
16690   (eval $ac_link) 2>&5
16691   ac_status=$?
16692   echo "$as_me:16692: \$? = $ac_status" >&5
16693   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
16694   { (eval echo "$as_me:16694: \"$ac_try\"") >&5
16695   (eval $ac_try) 2>&5
16696   ac_status=$?
16697   echo "$as_me:16697: \$? = $ac_status" >&5
16698   (exit $ac_status); }; }; then
16699   cf_result=yes
16700 else
16701   echo "$as_me: program exited with status $ac_status" >&5
16702 echo "$as_me: failed program was:" >&5
16703 cat conftest.$ac_ext >&5
16704 cf_result=no
16705 fi
16706 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
16707 fi
16708         echo "$as_me:16708: result: $cf_result" >&5
16709 echo "${ECHO_T}$cf_result" >&6
16710         if test $cf_result = yes ; then
16711
16712 cf_result=`echo "decl_curses_data_boolfnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16713
16714                 cat >>confdefs.h <<EOF
16715 #define $cf_result 1
16716 EOF
16717
16718         fi
16719 fi
16720
16721 echo "$as_me:16721: checking for data ttytype declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
16722 echo $ECHO_N "checking for data ttytype declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
16723
16724 cat >conftest.$ac_ext <<_ACEOF
16725 #line 16725 "configure"
16726 #include "confdefs.h"
16727
16728 #ifdef HAVE_XCURSES
16729 #include <xcurses.h>
16730 char * XCursesProgramName = "test";
16731 #else
16732 #include <${cf_cv_ncurses_header:-curses.h}>
16733 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16734 #include <ncursesw/term.h>
16735 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16736 #include <ncurses/term.h>
16737 #elif defined(HAVE_TERM_H)
16738 #include <term.h>
16739 #endif
16740 #endif
16741
16742 int
16743 main ()
16744 {
16745
16746 void *foo = &(ttytype)
16747
16748   ;
16749   return 0;
16750 }
16751 _ACEOF
16752 rm -f conftest.$ac_objext
16753 if { (eval echo "$as_me:16753: \"$ac_compile\"") >&5
16754   (eval $ac_compile) 2>&5
16755   ac_status=$?
16756   echo "$as_me:16756: \$? = $ac_status" >&5
16757   (exit $ac_status); } &&
16758          { ac_try='test -s conftest.$ac_objext'
16759   { (eval echo "$as_me:16759: \"$ac_try\"") >&5
16760   (eval $ac_try) 2>&5
16761   ac_status=$?
16762   echo "$as_me:16762: \$? = $ac_status" >&5
16763   (exit $ac_status); }; }; then
16764   cf_result=yes
16765 else
16766   echo "$as_me: failed program was:" >&5
16767 cat conftest.$ac_ext >&5
16768 cf_result=no
16769 fi
16770 rm -f conftest.$ac_objext conftest.$ac_ext
16771 echo "$as_me:16771: result: $cf_result" >&5
16772 echo "${ECHO_T}$cf_result" >&6
16773
16774 if test $cf_result = yes ; then
16775
16776 cf_result=`echo "have_curses_data_ttytype" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16777
16778         cat >>confdefs.h <<EOF
16779 #define $cf_result 1
16780 EOF
16781
16782 else
16783         echo "$as_me:16783: checking for data ttytype in library" >&5
16784 echo $ECHO_N "checking for data ttytype in library... $ECHO_C" >&6
16785         # BSD linkers insist on making weak linkage, but resolve at runtime.
16786         if test "$cross_compiling" = yes; then
16787
16788         # cross-compiling
16789         cat >conftest.$ac_ext <<_ACEOF
16790 #line 16790 "configure"
16791 #include "confdefs.h"
16792
16793 #ifdef HAVE_XCURSES
16794 #include <xcurses.h>
16795 char * XCursesProgramName = "test";
16796 #else
16797 #include <${cf_cv_ncurses_header:-curses.h}>
16798 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16799 #include <ncursesw/term.h>
16800 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16801 #include <ncurses/term.h>
16802 #elif defined(HAVE_TERM_H)
16803 #include <term.h>
16804 #endif
16805 #endif
16806
16807 extern char ttytype;
16808 int
16809 main ()
16810 {
16811
16812         do {
16813                 void *foo = &(ttytype);
16814                 fprintf(stderr, "testing linkage of ttytype:%p\n", foo);
16815                 ${cf_cv_main_return:-return}(foo == 0);
16816         } while (0)
16817
16818   ;
16819   return 0;
16820 }
16821 _ACEOF
16822 rm -f conftest.$ac_objext conftest$ac_exeext
16823 if { (eval echo "$as_me:16823: \"$ac_link\"") >&5
16824   (eval $ac_link) 2>&5
16825   ac_status=$?
16826   echo "$as_me:16826: \$? = $ac_status" >&5
16827   (exit $ac_status); } &&
16828          { ac_try='test -s conftest$ac_exeext'
16829   { (eval echo "$as_me:16829: \"$ac_try\"") >&5
16830   (eval $ac_try) 2>&5
16831   ac_status=$?
16832   echo "$as_me:16832: \$? = $ac_status" >&5
16833   (exit $ac_status); }; }; then
16834   cf_result=yes
16835 else
16836   echo "$as_me: failed program was:" >&5
16837 cat conftest.$ac_ext >&5
16838 cf_result=no
16839 fi
16840 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16841
16842 else
16843   cat >conftest.$ac_ext <<_ACEOF
16844 #line 16844 "configure"
16845 #include "confdefs.h"
16846
16847 #ifdef HAVE_XCURSES
16848 #include <xcurses.h>
16849 char * XCursesProgramName = "test";
16850 #else
16851 #include <${cf_cv_ncurses_header:-curses.h}>
16852 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16853 #include <ncursesw/term.h>
16854 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16855 #include <ncurses/term.h>
16856 #elif defined(HAVE_TERM_H)
16857 #include <term.h>
16858 #endif
16859 #endif
16860
16861 extern char ttytype;
16862 int main(void)
16863 {
16864         void *foo = &(ttytype);
16865         fprintf(stderr, "testing linkage of ttytype:%p\n", foo);
16866         ${cf_cv_main_return:-return}(foo == 0);
16867 }
16868 _ACEOF
16869 rm -f conftest$ac_exeext
16870 if { (eval echo "$as_me:16870: \"$ac_link\"") >&5
16871   (eval $ac_link) 2>&5
16872   ac_status=$?
16873   echo "$as_me:16873: \$? = $ac_status" >&5
16874   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
16875   { (eval echo "$as_me:16875: \"$ac_try\"") >&5
16876   (eval $ac_try) 2>&5
16877   ac_status=$?
16878   echo "$as_me:16878: \$? = $ac_status" >&5
16879   (exit $ac_status); }; }; then
16880   cf_result=yes
16881 else
16882   echo "$as_me: program exited with status $ac_status" >&5
16883 echo "$as_me: failed program was:" >&5
16884 cat conftest.$ac_ext >&5
16885 cf_result=no
16886 fi
16887 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
16888 fi
16889         echo "$as_me:16889: result: $cf_result" >&5
16890 echo "${ECHO_T}$cf_result" >&6
16891         if test $cf_result = yes ; then
16892
16893 cf_result=`echo "decl_curses_data_ttytype" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16894
16895                 cat >>confdefs.h <<EOF
16896 #define $cf_result 1
16897 EOF
16898
16899         fi
16900 fi
16901
16902 if ( test "$GCC" = yes || test "$GXX" = yes )
16903 then
16904 echo "$as_me:16904: checking if you want to turn on gcc warnings" >&5
16905 echo $ECHO_N "checking if you want to turn on gcc warnings... $ECHO_C" >&6
16906
16907 # Check whether --enable-warnings or --disable-warnings was given.
16908 if test "${enable_warnings+set}" = set; then
16909   enableval="$enable_warnings"
16910   test "$enableval" != yes && enableval=no
16911         if test "$enableval" != "no" ; then
16912     with_warnings=yes
16913         else
16914                 with_warnings=no
16915         fi
16916 else
16917   enableval=no
16918         with_warnings=no
16919
16920 fi;
16921 echo "$as_me:16921: result: $with_warnings" >&5
16922 echo "${ECHO_T}$with_warnings" >&6
16923 if test "$with_warnings" = "yes"
16924 then
16925
16926 if test "$GCC" = yes
16927 then
16928 cat > conftest.i <<EOF
16929 #ifndef GCC_PRINTF
16930 #define GCC_PRINTF 0
16931 #endif
16932 #ifndef GCC_SCANF
16933 #define GCC_SCANF 0
16934 #endif
16935 #ifndef GCC_NORETURN
16936 #define GCC_NORETURN /* nothing */
16937 #endif
16938 #ifndef GCC_UNUSED
16939 #define GCC_UNUSED /* nothing */
16940 #endif
16941 EOF
16942 if test "$GCC" = yes
16943 then
16944         { echo "$as_me:16944: checking for $CC __attribute__ directives..." >&5
16945 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
16946 cat > conftest.$ac_ext <<EOF
16947 #line 16947 "${as_me:-configure}"
16948 #include "confdefs.h"
16949 #include "conftest.h"
16950 #include "conftest.i"
16951 #if     GCC_PRINTF
16952 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
16953 #else
16954 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
16955 #endif
16956 #if     GCC_SCANF
16957 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
16958 #else
16959 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
16960 #endif
16961 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
16962 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
16963 extern void foo(void) GCC_NORETURN;
16964 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
16965 EOF
16966         cf_printf_attribute=no
16967         cf_scanf_attribute=no
16968         for cf_attribute in scanf printf unused noreturn
16969         do
16970
16971 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16972
16973                 cf_directive="__attribute__(($cf_attribute))"
16974                 echo "checking for $CC $cf_directive" 1>&5
16975
16976                 case $cf_attribute in
16977                 (printf)
16978                         cf_printf_attribute=yes
16979                         cat >conftest.h <<EOF
16980 #define GCC_$cf_ATTRIBUTE 1
16981 EOF
16982                         ;;
16983                 (scanf)
16984                         cf_scanf_attribute=yes
16985                         cat >conftest.h <<EOF
16986 #define GCC_$cf_ATTRIBUTE 1
16987 EOF
16988                         ;;
16989                 (*)
16990                         cat >conftest.h <<EOF
16991 #define GCC_$cf_ATTRIBUTE $cf_directive
16992 EOF
16993                         ;;
16994                 esac
16995
16996                 if { (eval echo "$as_me:16996: \"$ac_compile\"") >&5
16997   (eval $ac_compile) 2>&5
16998   ac_status=$?
16999   echo "$as_me:16999: \$? = $ac_status" >&5
17000   (exit $ac_status); }; then
17001                         test -n "$verbose" && echo "$as_me:17001: result: ... $cf_attribute" >&5
17002 echo "${ECHO_T}... $cf_attribute" >&6
17003                         cat conftest.h >>confdefs.h
17004                         case $cf_attribute in
17005                         (noreturn)
17006
17007 cat >>confdefs.h <<EOF
17008 #define GCC_NORETURN $cf_directive
17009 EOF
17010
17011                                 ;;
17012                         (printf)
17013                                 cf_value='/* nothing */'
17014                                 if test "$cf_printf_attribute" != no ; then
17015                                         cf_value='__attribute__((format(printf,fmt,var)))'
17016
17017 cat >>confdefs.h <<\EOF
17018 #define GCC_PRINTF 1
17019 EOF
17020
17021                                 fi
17022
17023 cat >>confdefs.h <<EOF
17024 #define GCC_PRINTFLIKE(fmt,var) $cf_value
17025 EOF
17026
17027                                 ;;
17028                         (scanf)
17029                                 cf_value='/* nothing */'
17030                                 if test "$cf_scanf_attribute" != no ; then
17031                                         cf_value='__attribute__((format(scanf,fmt,var)))'
17032
17033 cat >>confdefs.h <<\EOF
17034 #define GCC_SCANF 1
17035 EOF
17036
17037                                 fi
17038
17039 cat >>confdefs.h <<EOF
17040 #define GCC_SCANFLIKE(fmt,var) $cf_value
17041 EOF
17042
17043                                 ;;
17044                         (unused)
17045
17046 cat >>confdefs.h <<EOF
17047 #define GCC_UNUSED $cf_directive
17048 EOF
17049
17050                                 ;;
17051                         esac
17052                 fi
17053         done
17054 else
17055         fgrep define conftest.i >>confdefs.h
17056 fi
17057 rm -rf conftest*
17058 fi
17059
17060 INTEL_COMPILER=no
17061
17062 if test "$GCC" = yes ; then
17063         case $host_os in
17064         (linux*|gnu*)
17065                 echo "$as_me:17065: checking if this is really Intel C compiler" >&5
17066 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
17067                 cf_save_CFLAGS="$CFLAGS"
17068                 CFLAGS="$CFLAGS -no-gcc"
17069                 cat >conftest.$ac_ext <<_ACEOF
17070 #line 17070 "configure"
17071 #include "confdefs.h"
17072
17073 int
17074 main ()
17075 {
17076
17077 #ifdef __INTEL_COMPILER
17078 #else
17079 make an error
17080 #endif
17081
17082   ;
17083   return 0;
17084 }
17085 _ACEOF
17086 rm -f conftest.$ac_objext
17087 if { (eval echo "$as_me:17087: \"$ac_compile\"") >&5
17088   (eval $ac_compile) 2>&5
17089   ac_status=$?
17090   echo "$as_me:17090: \$? = $ac_status" >&5
17091   (exit $ac_status); } &&
17092          { ac_try='test -s conftest.$ac_objext'
17093   { (eval echo "$as_me:17093: \"$ac_try\"") >&5
17094   (eval $ac_try) 2>&5
17095   ac_status=$?
17096   echo "$as_me:17096: \$? = $ac_status" >&5
17097   (exit $ac_status); }; }; then
17098   INTEL_COMPILER=yes
17099 cf_save_CFLAGS="$cf_save_CFLAGS -we147"
17100
17101 else
17102   echo "$as_me: failed program was:" >&5
17103 cat conftest.$ac_ext >&5
17104 fi
17105 rm -f conftest.$ac_objext conftest.$ac_ext
17106                 CFLAGS="$cf_save_CFLAGS"
17107                 echo "$as_me:17107: result: $INTEL_COMPILER" >&5
17108 echo "${ECHO_T}$INTEL_COMPILER" >&6
17109                 ;;
17110         esac
17111 fi
17112
17113 CLANG_COMPILER=no
17114
17115 if test "$GCC" = yes ; then
17116         echo "$as_me:17116: checking if this is really Clang C compiler" >&5
17117 echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6
17118         cf_save_CFLAGS="$CFLAGS"
17119         CFLAGS="$CFLAGS -Qunused-arguments"
17120         cat >conftest.$ac_ext <<_ACEOF
17121 #line 17121 "configure"
17122 #include "confdefs.h"
17123
17124 int
17125 main ()
17126 {
17127
17128 #ifdef __clang__
17129 #else
17130 make an error
17131 #endif
17132
17133   ;
17134   return 0;
17135 }
17136 _ACEOF
17137 rm -f conftest.$ac_objext
17138 if { (eval echo "$as_me:17138: \"$ac_compile\"") >&5
17139   (eval $ac_compile) 2>&5
17140   ac_status=$?
17141   echo "$as_me:17141: \$? = $ac_status" >&5
17142   (exit $ac_status); } &&
17143          { ac_try='test -s conftest.$ac_objext'
17144   { (eval echo "$as_me:17144: \"$ac_try\"") >&5
17145   (eval $ac_try) 2>&5
17146   ac_status=$?
17147   echo "$as_me:17147: \$? = $ac_status" >&5
17148   (exit $ac_status); }; }; then
17149   CLANG_COMPILER=yes
17150 cf_save_CFLAGS="$cf_save_CFLAGS -Qunused-arguments"
17151
17152 else
17153   echo "$as_me: failed program was:" >&5
17154 cat conftest.$ac_ext >&5
17155 fi
17156 rm -f conftest.$ac_objext conftest.$ac_ext
17157         CFLAGS="$cf_save_CFLAGS"
17158         echo "$as_me:17158: result: $CLANG_COMPILER" >&5
17159 echo "${ECHO_T}$CLANG_COMPILER" >&6
17160 fi
17161
17162 cat > conftest.$ac_ext <<EOF
17163 #line 17163 "${as_me:-configure}"
17164 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
17165 EOF
17166
17167 if test "$INTEL_COMPILER" = yes
17168 then
17169 # The "-wdXXX" options suppress warnings:
17170 # remark #1419: external declaration in primary source file
17171 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
17172 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
17173 # remark #193: zero used for undefined preprocessing identifier
17174 # remark #593: variable "curs_sb_left_arrow" was set but never used
17175 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
17176 # remark #869: parameter "tw" was never referenced
17177 # remark #981: operands are evaluated in unspecified order
17178 # warning #279: controlling expression is constant
17179
17180         { echo "$as_me:17180: checking for $CC warning options..." >&5
17181 echo "$as_me: checking for $CC warning options..." >&6;}
17182         cf_save_CFLAGS="$CFLAGS"
17183         EXTRA_CFLAGS="-Wall"
17184         for cf_opt in \
17185                 wd1419 \
17186                 wd1683 \
17187                 wd1684 \
17188                 wd193 \
17189                 wd593 \
17190                 wd279 \
17191                 wd810 \
17192                 wd869 \
17193                 wd981
17194         do
17195                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
17196                 if { (eval echo "$as_me:17196: \"$ac_compile\"") >&5
17197   (eval $ac_compile) 2>&5
17198   ac_status=$?
17199   echo "$as_me:17199: \$? = $ac_status" >&5
17200   (exit $ac_status); }; then
17201                         test -n "$verbose" && echo "$as_me:17201: result: ... -$cf_opt" >&5
17202 echo "${ECHO_T}... -$cf_opt" >&6
17203                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
17204                 fi
17205         done
17206         CFLAGS="$cf_save_CFLAGS"
17207
17208 elif test "$GCC" = yes
17209 then
17210         { echo "$as_me:17210: checking for $CC warning options..." >&5
17211 echo "$as_me: checking for $CC warning options..." >&6;}
17212         cf_save_CFLAGS="$CFLAGS"
17213         EXTRA_CFLAGS=
17214         cf_warn_CONST=""
17215         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
17216         cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
17217         test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
17218         for cf_opt in W Wall \
17219                 Wbad-function-cast \
17220                 Wcast-align \
17221                 Wcast-qual \
17222                 Wdeclaration-after-statement \
17223                 Wextra \
17224                 Winline \
17225                 Wmissing-declarations \
17226                 Wmissing-prototypes \
17227                 Wnested-externs \
17228                 Wpointer-arith \
17229                 Wshadow \
17230                 Wstrict-prototypes \
17231                 Wundef $cf_gcc_warnings $cf_warn_CONST
17232         do
17233                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
17234                 if { (eval echo "$as_me:17234: \"$ac_compile\"") >&5
17235   (eval $ac_compile) 2>&5
17236   ac_status=$?
17237   echo "$as_me:17237: \$? = $ac_status" >&5
17238   (exit $ac_status); }; then
17239                         test -n "$verbose" && echo "$as_me:17239: result: ... -$cf_opt" >&5
17240 echo "${ECHO_T}... -$cf_opt" >&6
17241                         case $cf_opt in
17242                         (Wcast-qual)
17243                                 CPPFLAGS="$CPPFLAGS -DXTSTRINGDEFINES"
17244                                 ;;
17245                         (Winline)
17246                                 case $GCC_VERSION in
17247                                 ([34].*)
17248                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
17249
17250 echo "${as_me:-configure}:17250: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
17251
17252                                         continue;;
17253                                 esac
17254                                 ;;
17255                         (Wpointer-arith)
17256                                 case $GCC_VERSION in
17257                                 ([12].*)
17258                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
17259
17260 echo "${as_me:-configure}:17260: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
17261
17262                                         continue;;
17263                                 esac
17264                                 ;;
17265                         esac
17266                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
17267                 fi
17268         done
17269         CFLAGS="$cf_save_CFLAGS"
17270 fi
17271 rm -rf conftest*
17272
17273 fi
17274 fi
17275
17276 echo "$as_me:17276: checking if you want to use dmalloc for testing" >&5
17277 echo $ECHO_N "checking if you want to use dmalloc for testing... $ECHO_C" >&6
17278
17279 # Check whether --with-dmalloc or --without-dmalloc was given.
17280 if test "${with_dmalloc+set}" = set; then
17281   withval="$with_dmalloc"
17282
17283 cat >>confdefs.h <<EOF
17284 #define USE_DMALLOC 1
17285 EOF
17286
17287         : ${with_cflags:=-g}
17288         : ${with_no_leaks:=yes}
17289          with_dmalloc=yes
17290 else
17291   with_dmalloc=
17292 fi;
17293 echo "$as_me:17293: result: ${with_dmalloc:-no}" >&5
17294 echo "${ECHO_T}${with_dmalloc:-no}" >&6
17295
17296 case .$with_cflags in
17297 (.*-g*)
17298         case .$CFLAGS in
17299         (.*-g*)
17300                 ;;
17301         (*)
17302
17303 cf_fix_cppflags=no
17304 cf_new_cflags=
17305 cf_new_cppflags=
17306 cf_new_extra_cppflags=
17307
17308 for cf_add_cflags in -g
17309 do
17310 case $cf_fix_cppflags in
17311 (no)
17312         case $cf_add_cflags in
17313         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
17314                 case $cf_add_cflags in
17315                 (-D*)
17316                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
17317
17318                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17319                                 && test -z "${cf_tst_cflags}" \
17320                                 && cf_fix_cppflags=yes
17321
17322                         if test $cf_fix_cppflags = yes ; then
17323                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
17324                                 continue
17325                         elif test "${cf_tst_cflags}" = "\"'" ; then
17326                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
17327                                 continue
17328                         fi
17329                         ;;
17330                 esac
17331                 case "$CPPFLAGS" in
17332                 (*$cf_add_cflags)
17333                         ;;
17334                 (*)
17335                         case $cf_add_cflags in
17336                         (-D*)
17337                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
17338
17339 CPPFLAGS=`echo "$CPPFLAGS" | \
17340         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
17341                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
17342
17343                                 ;;
17344                         esac
17345                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
17346                         ;;
17347                 esac
17348                 ;;
17349         (*)
17350                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
17351                 ;;
17352         esac
17353         ;;
17354 (yes)
17355         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
17356
17357         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
17358
17359         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17360                 && test -z "${cf_tst_cflags}" \
17361                 && cf_fix_cppflags=no
17362         ;;
17363 esac
17364 done
17365
17366 if test -n "$cf_new_cflags" ; then
17367
17368         CFLAGS="$CFLAGS $cf_new_cflags"
17369 fi
17370
17371 if test -n "$cf_new_cppflags" ; then
17372
17373         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
17374 fi
17375
17376 if test -n "$cf_new_extra_cppflags" ; then
17377
17378         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
17379 fi
17380
17381                 ;;
17382         esac
17383         ;;
17384 esac
17385
17386 if test "$with_dmalloc" = yes ; then
17387         echo "$as_me:17387: checking for dmalloc.h" >&5
17388 echo $ECHO_N "checking for dmalloc.h... $ECHO_C" >&6
17389 if test "${ac_cv_header_dmalloc_h+set}" = set; then
17390   echo $ECHO_N "(cached) $ECHO_C" >&6
17391 else
17392   cat >conftest.$ac_ext <<_ACEOF
17393 #line 17393 "configure"
17394 #include "confdefs.h"
17395 #include <dmalloc.h>
17396 _ACEOF
17397 if { (eval echo "$as_me:17397: \"$ac_cpp conftest.$ac_ext\"") >&5
17398   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
17399   ac_status=$?
17400   egrep -v '^ *\+' conftest.er1 >conftest.err
17401   rm -f conftest.er1
17402   cat conftest.err >&5
17403   echo "$as_me:17403: \$? = $ac_status" >&5
17404   (exit $ac_status); } >/dev/null; then
17405   if test -s conftest.err; then
17406     ac_cpp_err=$ac_c_preproc_warn_flag
17407   else
17408     ac_cpp_err=
17409   fi
17410 else
17411   ac_cpp_err=yes
17412 fi
17413 if test -z "$ac_cpp_err"; then
17414   ac_cv_header_dmalloc_h=yes
17415 else
17416   echo "$as_me: failed program was:" >&5
17417   cat conftest.$ac_ext >&5
17418   ac_cv_header_dmalloc_h=no
17419 fi
17420 rm -f conftest.err conftest.$ac_ext
17421 fi
17422 echo "$as_me:17422: result: $ac_cv_header_dmalloc_h" >&5
17423 echo "${ECHO_T}$ac_cv_header_dmalloc_h" >&6
17424 if test $ac_cv_header_dmalloc_h = yes; then
17425
17426 echo "$as_me:17426: checking for dmalloc_debug in -ldmalloc" >&5
17427 echo $ECHO_N "checking for dmalloc_debug in -ldmalloc... $ECHO_C" >&6
17428 if test "${ac_cv_lib_dmalloc_dmalloc_debug+set}" = set; then
17429   echo $ECHO_N "(cached) $ECHO_C" >&6
17430 else
17431   ac_check_lib_save_LIBS=$LIBS
17432 LIBS="-ldmalloc  $LIBS"
17433 cat >conftest.$ac_ext <<_ACEOF
17434 #line 17434 "configure"
17435 #include "confdefs.h"
17436
17437 /* Override any gcc2 internal prototype to avoid an error.  */
17438 #ifdef __cplusplus
17439 extern "C"
17440 #endif
17441 /* We use char because int might match the return type of a gcc2
17442    builtin and then its argument prototype would still apply.  */
17443 char dmalloc_debug ();
17444 int
17445 main ()
17446 {
17447 dmalloc_debug ();
17448   ;
17449   return 0;
17450 }
17451 _ACEOF
17452 rm -f conftest.$ac_objext conftest$ac_exeext
17453 if { (eval echo "$as_me:17453: \"$ac_link\"") >&5
17454   (eval $ac_link) 2>&5
17455   ac_status=$?
17456   echo "$as_me:17456: \$? = $ac_status" >&5
17457   (exit $ac_status); } &&
17458          { ac_try='test -s conftest$ac_exeext'
17459   { (eval echo "$as_me:17459: \"$ac_try\"") >&5
17460   (eval $ac_try) 2>&5
17461   ac_status=$?
17462   echo "$as_me:17462: \$? = $ac_status" >&5
17463   (exit $ac_status); }; }; then
17464   ac_cv_lib_dmalloc_dmalloc_debug=yes
17465 else
17466   echo "$as_me: failed program was:" >&5
17467 cat conftest.$ac_ext >&5
17468 ac_cv_lib_dmalloc_dmalloc_debug=no
17469 fi
17470 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17471 LIBS=$ac_check_lib_save_LIBS
17472 fi
17473 echo "$as_me:17473: result: $ac_cv_lib_dmalloc_dmalloc_debug" >&5
17474 echo "${ECHO_T}$ac_cv_lib_dmalloc_dmalloc_debug" >&6
17475 if test $ac_cv_lib_dmalloc_dmalloc_debug = yes; then
17476   cat >>confdefs.h <<EOF
17477 #define HAVE_LIBDMALLOC 1
17478 EOF
17479
17480   LIBS="-ldmalloc $LIBS"
17481
17482 fi
17483
17484 fi
17485
17486 fi
17487
17488 echo "$as_me:17488: checking if you want to use dbmalloc for testing" >&5
17489 echo $ECHO_N "checking if you want to use dbmalloc for testing... $ECHO_C" >&6
17490
17491 # Check whether --with-dbmalloc or --without-dbmalloc was given.
17492 if test "${with_dbmalloc+set}" = set; then
17493   withval="$with_dbmalloc"
17494
17495 cat >>confdefs.h <<EOF
17496 #define USE_DBMALLOC 1
17497 EOF
17498
17499         : ${with_cflags:=-g}
17500         : ${with_no_leaks:=yes}
17501          with_dbmalloc=yes
17502 else
17503   with_dbmalloc=
17504 fi;
17505 echo "$as_me:17505: result: ${with_dbmalloc:-no}" >&5
17506 echo "${ECHO_T}${with_dbmalloc:-no}" >&6
17507
17508 case .$with_cflags in
17509 (.*-g*)
17510         case .$CFLAGS in
17511         (.*-g*)
17512                 ;;
17513         (*)
17514
17515 cf_fix_cppflags=no
17516 cf_new_cflags=
17517 cf_new_cppflags=
17518 cf_new_extra_cppflags=
17519
17520 for cf_add_cflags in -g
17521 do
17522 case $cf_fix_cppflags in
17523 (no)
17524         case $cf_add_cflags in
17525         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
17526                 case $cf_add_cflags in
17527                 (-D*)
17528                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
17529
17530                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17531                                 && test -z "${cf_tst_cflags}" \
17532                                 && cf_fix_cppflags=yes
17533
17534                         if test $cf_fix_cppflags = yes ; then
17535                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
17536                                 continue
17537                         elif test "${cf_tst_cflags}" = "\"'" ; then
17538                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
17539                                 continue
17540                         fi
17541                         ;;
17542                 esac
17543                 case "$CPPFLAGS" in
17544                 (*$cf_add_cflags)
17545                         ;;
17546                 (*)
17547                         case $cf_add_cflags in
17548                         (-D*)
17549                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
17550
17551 CPPFLAGS=`echo "$CPPFLAGS" | \
17552         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
17553                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
17554
17555                                 ;;
17556                         esac
17557                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
17558                         ;;
17559                 esac
17560                 ;;
17561         (*)
17562                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
17563                 ;;
17564         esac
17565         ;;
17566 (yes)
17567         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
17568
17569         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
17570
17571         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17572                 && test -z "${cf_tst_cflags}" \
17573                 && cf_fix_cppflags=no
17574         ;;
17575 esac
17576 done
17577
17578 if test -n "$cf_new_cflags" ; then
17579
17580         CFLAGS="$CFLAGS $cf_new_cflags"
17581 fi
17582
17583 if test -n "$cf_new_cppflags" ; then
17584
17585         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
17586 fi
17587
17588 if test -n "$cf_new_extra_cppflags" ; then
17589
17590         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
17591 fi
17592
17593                 ;;
17594         esac
17595         ;;
17596 esac
17597
17598 if test "$with_dbmalloc" = yes ; then
17599         echo "$as_me:17599: checking for dbmalloc.h" >&5
17600 echo $ECHO_N "checking for dbmalloc.h... $ECHO_C" >&6
17601 if test "${ac_cv_header_dbmalloc_h+set}" = set; then
17602   echo $ECHO_N "(cached) $ECHO_C" >&6
17603 else
17604   cat >conftest.$ac_ext <<_ACEOF
17605 #line 17605 "configure"
17606 #include "confdefs.h"
17607 #include <dbmalloc.h>
17608 _ACEOF
17609 if { (eval echo "$as_me:17609: \"$ac_cpp conftest.$ac_ext\"") >&5
17610   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
17611   ac_status=$?
17612   egrep -v '^ *\+' conftest.er1 >conftest.err
17613   rm -f conftest.er1
17614   cat conftest.err >&5
17615   echo "$as_me:17615: \$? = $ac_status" >&5
17616   (exit $ac_status); } >/dev/null; then
17617   if test -s conftest.err; then
17618     ac_cpp_err=$ac_c_preproc_warn_flag
17619   else
17620     ac_cpp_err=
17621   fi
17622 else
17623   ac_cpp_err=yes
17624 fi
17625 if test -z "$ac_cpp_err"; then
17626   ac_cv_header_dbmalloc_h=yes
17627 else
17628   echo "$as_me: failed program was:" >&5
17629   cat conftest.$ac_ext >&5
17630   ac_cv_header_dbmalloc_h=no
17631 fi
17632 rm -f conftest.err conftest.$ac_ext
17633 fi
17634 echo "$as_me:17634: result: $ac_cv_header_dbmalloc_h" >&5
17635 echo "${ECHO_T}$ac_cv_header_dbmalloc_h" >&6
17636 if test $ac_cv_header_dbmalloc_h = yes; then
17637
17638 echo "$as_me:17638: checking for debug_malloc in -ldbmalloc" >&5
17639 echo $ECHO_N "checking for debug_malloc in -ldbmalloc... $ECHO_C" >&6
17640 if test "${ac_cv_lib_dbmalloc_debug_malloc+set}" = set; then
17641   echo $ECHO_N "(cached) $ECHO_C" >&6
17642 else
17643   ac_check_lib_save_LIBS=$LIBS
17644 LIBS="-ldbmalloc  $LIBS"
17645 cat >conftest.$ac_ext <<_ACEOF
17646 #line 17646 "configure"
17647 #include "confdefs.h"
17648
17649 /* Override any gcc2 internal prototype to avoid an error.  */
17650 #ifdef __cplusplus
17651 extern "C"
17652 #endif
17653 /* We use char because int might match the return type of a gcc2
17654    builtin and then its argument prototype would still apply.  */
17655 char debug_malloc ();
17656 int
17657 main ()
17658 {
17659 debug_malloc ();
17660   ;
17661   return 0;
17662 }
17663 _ACEOF
17664 rm -f conftest.$ac_objext conftest$ac_exeext
17665 if { (eval echo "$as_me:17665: \"$ac_link\"") >&5
17666   (eval $ac_link) 2>&5
17667   ac_status=$?
17668   echo "$as_me:17668: \$? = $ac_status" >&5
17669   (exit $ac_status); } &&
17670          { ac_try='test -s conftest$ac_exeext'
17671   { (eval echo "$as_me:17671: \"$ac_try\"") >&5
17672   (eval $ac_try) 2>&5
17673   ac_status=$?
17674   echo "$as_me:17674: \$? = $ac_status" >&5
17675   (exit $ac_status); }; }; then
17676   ac_cv_lib_dbmalloc_debug_malloc=yes
17677 else
17678   echo "$as_me: failed program was:" >&5
17679 cat conftest.$ac_ext >&5
17680 ac_cv_lib_dbmalloc_debug_malloc=no
17681 fi
17682 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17683 LIBS=$ac_check_lib_save_LIBS
17684 fi
17685 echo "$as_me:17685: result: $ac_cv_lib_dbmalloc_debug_malloc" >&5
17686 echo "${ECHO_T}$ac_cv_lib_dbmalloc_debug_malloc" >&6
17687 if test $ac_cv_lib_dbmalloc_debug_malloc = yes; then
17688   cat >>confdefs.h <<EOF
17689 #define HAVE_LIBDBMALLOC 1
17690 EOF
17691
17692   LIBS="-ldbmalloc $LIBS"
17693
17694 fi
17695
17696 fi
17697
17698 fi
17699
17700 echo "$as_me:17700: checking if you want to use valgrind for testing" >&5
17701 echo $ECHO_N "checking if you want to use valgrind for testing... $ECHO_C" >&6
17702
17703 # Check whether --with-valgrind or --without-valgrind was given.
17704 if test "${with_valgrind+set}" = set; then
17705   withval="$with_valgrind"
17706
17707 cat >>confdefs.h <<EOF
17708 #define USE_VALGRIND 1
17709 EOF
17710
17711         : ${with_cflags:=-g}
17712         : ${with_no_leaks:=yes}
17713          with_valgrind=yes
17714 else
17715   with_valgrind=
17716 fi;
17717 echo "$as_me:17717: result: ${with_valgrind:-no}" >&5
17718 echo "${ECHO_T}${with_valgrind:-no}" >&6
17719
17720 case .$with_cflags in
17721 (.*-g*)
17722         case .$CFLAGS in
17723         (.*-g*)
17724                 ;;
17725         (*)
17726
17727 cf_fix_cppflags=no
17728 cf_new_cflags=
17729 cf_new_cppflags=
17730 cf_new_extra_cppflags=
17731
17732 for cf_add_cflags in -g
17733 do
17734 case $cf_fix_cppflags in
17735 (no)
17736         case $cf_add_cflags in
17737         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
17738                 case $cf_add_cflags in
17739                 (-D*)
17740                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
17741
17742                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17743                                 && test -z "${cf_tst_cflags}" \
17744                                 && cf_fix_cppflags=yes
17745
17746                         if test $cf_fix_cppflags = yes ; then
17747                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
17748                                 continue
17749                         elif test "${cf_tst_cflags}" = "\"'" ; then
17750                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
17751                                 continue
17752                         fi
17753                         ;;
17754                 esac
17755                 case "$CPPFLAGS" in
17756                 (*$cf_add_cflags)
17757                         ;;
17758                 (*)
17759                         case $cf_add_cflags in
17760                         (-D*)
17761                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
17762
17763 CPPFLAGS=`echo "$CPPFLAGS" | \
17764         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
17765                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
17766
17767                                 ;;
17768                         esac
17769                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
17770                         ;;
17771                 esac
17772                 ;;
17773         (*)
17774                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
17775                 ;;
17776         esac
17777         ;;
17778 (yes)
17779         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
17780
17781         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
17782
17783         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17784                 && test -z "${cf_tst_cflags}" \
17785                 && cf_fix_cppflags=no
17786         ;;
17787 esac
17788 done
17789
17790 if test -n "$cf_new_cflags" ; then
17791
17792         CFLAGS="$CFLAGS $cf_new_cflags"
17793 fi
17794
17795 if test -n "$cf_new_cppflags" ; then
17796
17797         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
17798 fi
17799
17800 if test -n "$cf_new_extra_cppflags" ; then
17801
17802         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
17803 fi
17804
17805                 ;;
17806         esac
17807         ;;
17808 esac
17809
17810 echo "$as_me:17810: checking if you want to perform memory-leak testing" >&5
17811 echo $ECHO_N "checking if you want to perform memory-leak testing... $ECHO_C" >&6
17812
17813 # Check whether --enable-leaks or --disable-leaks was given.
17814 if test "${enable_leaks+set}" = set; then
17815   enableval="$enable_leaks"
17816   if test "x$enableval" = xno; then with_no_leaks=yes; else with_no_leaks=no; fi
17817 else
17818   : ${with_no_leaks:=no}
17819 fi;
17820 echo "$as_me:17820: result: $with_no_leaks" >&5
17821 echo "${ECHO_T}$with_no_leaks" >&6
17822
17823 if test "$with_no_leaks" = yes ; then
17824
17825 cat >>confdefs.h <<\EOF
17826 #define NO_LEAKS 1
17827 EOF
17828
17829 cat >>confdefs.h <<\EOF
17830 #define YY_NO_LEAKS 1
17831 EOF
17832
17833 fi
17834
17835 LD_RPATH_OPT=
17836 echo "$as_me:17836: checking for an rpath option" >&5
17837 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
17838 case $cf_cv_system_name in
17839 (irix*)
17840         if test "$GCC" = yes; then
17841                 LD_RPATH_OPT="-Wl,-rpath,"
17842         else
17843                 LD_RPATH_OPT="-rpath "
17844         fi
17845         ;;
17846 (linux*|gnu*|k*bsd*-gnu|freebsd*)
17847         LD_RPATH_OPT="-Wl,-rpath,"
17848         ;;
17849 (openbsd[2-9].*|mirbsd*)
17850         LD_RPATH_OPT="-Wl,-rpath,"
17851         ;;
17852 (dragonfly*)
17853         LD_RPATH_OPT="-rpath "
17854         ;;
17855 (netbsd*)
17856         LD_RPATH_OPT="-Wl,-rpath,"
17857         ;;
17858 (osf*|mls+*)
17859         LD_RPATH_OPT="-rpath "
17860         ;;
17861 (solaris2*)
17862         LD_RPATH_OPT="-R"
17863         ;;
17864 (*)
17865         ;;
17866 esac
17867 echo "$as_me:17867: result: $LD_RPATH_OPT" >&5
17868 echo "${ECHO_T}$LD_RPATH_OPT" >&6
17869
17870 case "x$LD_RPATH_OPT" in
17871 (x-R*)
17872         echo "$as_me:17872: checking if we need a space after rpath option" >&5
17873 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
17874         cf_save_LIBS="$LIBS"
17875
17876 cf_add_libs="${LD_RPATH_OPT}$libdir"
17877 # Filter out duplicates - this happens with badly-designed ".pc" files...
17878 for cf_add_1lib in $LIBS
17879 do
17880         for cf_add_2lib in $cf_add_libs
17881         do
17882                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
17883                 then
17884                         cf_add_1lib=
17885                         break
17886                 fi
17887         done
17888         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
17889 done
17890 LIBS="$cf_add_libs"
17891
17892         cat >conftest.$ac_ext <<_ACEOF
17893 #line 17893 "configure"
17894 #include "confdefs.h"
17895
17896 int
17897 main ()
17898 {
17899
17900   ;
17901   return 0;
17902 }
17903 _ACEOF
17904 rm -f conftest.$ac_objext conftest$ac_exeext
17905 if { (eval echo "$as_me:17905: \"$ac_link\"") >&5
17906   (eval $ac_link) 2>&5
17907   ac_status=$?
17908   echo "$as_me:17908: \$? = $ac_status" >&5
17909   (exit $ac_status); } &&
17910          { ac_try='test -s conftest$ac_exeext'
17911   { (eval echo "$as_me:17911: \"$ac_try\"") >&5
17912   (eval $ac_try) 2>&5
17913   ac_status=$?
17914   echo "$as_me:17914: \$? = $ac_status" >&5
17915   (exit $ac_status); }; }; then
17916   cf_rpath_space=no
17917 else
17918   echo "$as_me: failed program was:" >&5
17919 cat conftest.$ac_ext >&5
17920 cf_rpath_space=yes
17921 fi
17922 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17923         LIBS="$cf_save_LIBS"
17924         echo "$as_me:17924: result: $cf_rpath_space" >&5
17925 echo "${ECHO_T}$cf_rpath_space" >&6
17926         test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
17927         ;;
17928 esac
17929
17930 echo "$as_me:17930: checking if rpath-hack should be disabled" >&5
17931 echo $ECHO_N "checking if rpath-hack should be disabled... $ECHO_C" >&6
17932
17933 # Check whether --enable-rpath-hack or --disable-rpath-hack was given.
17934 if test "${enable_rpath_hack+set}" = set; then
17935   enableval="$enable_rpath_hack"
17936   test "$enableval" != no && enableval=yes
17937         if test "$enableval" != "yes" ; then
17938     cf_disable_rpath_hack=yes
17939         else
17940                 cf_disable_rpath_hack=no
17941         fi
17942 else
17943   enableval=yes
17944         cf_disable_rpath_hack=no
17945
17946 fi;
17947 echo "$as_me:17947: result: $cf_disable_rpath_hack" >&5
17948 echo "${ECHO_T}$cf_disable_rpath_hack" >&6
17949 if test "$cf_disable_rpath_hack" = no ; then
17950
17951 echo "$as_me:17951: checking for updated LDFLAGS" >&5
17952 echo $ECHO_N "checking for updated LDFLAGS... $ECHO_C" >&6
17953 if test -n "$LD_RPATH_OPT" ; then
17954         echo "$as_me:17954: result: maybe" >&5
17955 echo "${ECHO_T}maybe" >&6
17956
17957         for ac_prog in ldd
17958 do
17959   # Extract the first word of "$ac_prog", so it can be a program name with args.
17960 set dummy $ac_prog; ac_word=$2
17961 echo "$as_me:17961: checking for $ac_word" >&5
17962 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
17963 if test "${ac_cv_prog_cf_ldd_prog+set}" = set; then
17964   echo $ECHO_N "(cached) $ECHO_C" >&6
17965 else
17966   if test -n "$cf_ldd_prog"; then
17967   ac_cv_prog_cf_ldd_prog="$cf_ldd_prog" # Let the user override the test.
17968 else
17969   ac_save_IFS=$IFS; IFS=$ac_path_separator
17970 ac_dummy="$PATH"
17971 for ac_dir in $ac_dummy; do
17972   IFS=$ac_save_IFS
17973   test -z "$ac_dir" && ac_dir=.
17974   $as_executable_p "$ac_dir/$ac_word" || continue
17975 ac_cv_prog_cf_ldd_prog="$ac_prog"
17976 echo "$as_me:17976: found $ac_dir/$ac_word" >&5
17977 break
17978 done
17979
17980 fi
17981 fi
17982 cf_ldd_prog=$ac_cv_prog_cf_ldd_prog
17983 if test -n "$cf_ldd_prog"; then
17984   echo "$as_me:17984: result: $cf_ldd_prog" >&5
17985 echo "${ECHO_T}$cf_ldd_prog" >&6
17986 else
17987   echo "$as_me:17987: result: no" >&5
17988 echo "${ECHO_T}no" >&6
17989 fi
17990
17991   test -n "$cf_ldd_prog" && break
17992 done
17993 test -n "$cf_ldd_prog" || cf_ldd_prog="no"
17994
17995         cf_rpath_list="/usr/lib /lib"
17996         if test "$cf_ldd_prog" != no
17997         then
17998                 cf_rpath_oops=
17999
18000 cat >conftest.$ac_ext <<_ACEOF
18001 #line 18001 "configure"
18002 #include "confdefs.h"
18003 #include <stdio.h>
18004 int
18005 main ()
18006 {
18007 printf("Hello");
18008   ;
18009   return 0;
18010 }
18011 _ACEOF
18012 rm -f conftest.$ac_objext conftest$ac_exeext
18013 if { (eval echo "$as_me:18013: \"$ac_link\"") >&5
18014   (eval $ac_link) 2>&5
18015   ac_status=$?
18016   echo "$as_me:18016: \$? = $ac_status" >&5
18017   (exit $ac_status); } &&
18018          { ac_try='test -s conftest$ac_exeext'
18019   { (eval echo "$as_me:18019: \"$ac_try\"") >&5
18020   (eval $ac_try) 2>&5
18021   ac_status=$?
18022   echo "$as_me:18022: \$? = $ac_status" >&5
18023   (exit $ac_status); }; }; then
18024   cf_rpath_oops=`$cf_ldd_prog conftest$ac_exeext | fgrep ' not found' | sed -e 's% =>.*$%%' |sort | uniq`
18025                  cf_rpath_list=`$cf_ldd_prog conftest$ac_exeext | fgrep / | sed -e 's%^.*[      ]/%/%' -e 's%/[^/][^/]*$%%' |sort | uniq`
18026 else
18027   echo "$as_me: failed program was:" >&5
18028 cat conftest.$ac_ext >&5
18029 fi
18030 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18031
18032                 # If we passed the link-test, but get a "not found" on a given library,
18033                 # this could be due to inept reconfiguration of gcc to make it only
18034                 # partly honor /usr/local/lib (or whatever).  Sometimes this behavior
18035                 # is intentional, e.g., installing gcc in /usr/bin and suppressing the
18036                 # /usr/local libraries.
18037                 if test -n "$cf_rpath_oops"
18038                 then
18039                         for cf_rpath_src in $cf_rpath_oops
18040                         do
18041                                 for cf_rpath_dir in \
18042                                         /usr/local \
18043                                         /usr/pkg \
18044                                         /opt/sfw
18045                                 do
18046                                         if test -f $cf_rpath_dir/lib/$cf_rpath_src
18047                                         then
18048                                                 test -n "$verbose" && echo "    ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src" 1>&6
18049
18050 echo "${as_me:-configure}:18050: testing ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src ..." 1>&5
18051
18052                                                 LDFLAGS="$LDFLAGS -L$cf_rpath_dir/lib"
18053                                                 break
18054                                         fi
18055                                 done
18056                         done
18057                 fi
18058         fi
18059
18060         test -n "$verbose" && echo "    ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
18061
18062 echo "${as_me:-configure}:18062: testing ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
18063
18064 test -n "$verbose" && echo "    ...checking LDFLAGS $LDFLAGS" 1>&6
18065
18066 echo "${as_me:-configure}:18066: testing ...checking LDFLAGS $LDFLAGS ..." 1>&5
18067
18068 cf_rpath_dst=
18069 for cf_rpath_src in $LDFLAGS
18070 do
18071         case $cf_rpath_src in
18072         (-L*)
18073
18074                 # check if this refers to a directory which we will ignore
18075                 cf_rpath_skip=no
18076                 if test -n "$cf_rpath_list"
18077                 then
18078                         for cf_rpath_item in $cf_rpath_list
18079                         do
18080                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
18081                                 then
18082                                         cf_rpath_skip=yes
18083                                         break
18084                                 fi
18085                         done
18086                 fi
18087
18088                 if test "$cf_rpath_skip" = no
18089                 then
18090                         # transform the option
18091                         if test "$LD_RPATH_OPT" = "-R " ; then
18092                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
18093                         else
18094                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
18095                         fi
18096
18097                         # if we have not already added this, add it now
18098                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
18099                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
18100                         then
18101                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
18102
18103 echo "${as_me:-configure}:18103: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
18104
18105                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
18106                         fi
18107                 fi
18108                 ;;
18109         esac
18110         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
18111 done
18112 LDFLAGS=$cf_rpath_dst
18113
18114 test -n "$verbose" && echo "    ...checked LDFLAGS $LDFLAGS" 1>&6
18115
18116 echo "${as_me:-configure}:18116: testing ...checked LDFLAGS $LDFLAGS ..." 1>&5
18117
18118 test -n "$verbose" && echo "    ...checking LIBS $LIBS" 1>&6
18119
18120 echo "${as_me:-configure}:18120: testing ...checking LIBS $LIBS ..." 1>&5
18121
18122 cf_rpath_dst=
18123 for cf_rpath_src in $LIBS
18124 do
18125         case $cf_rpath_src in
18126         (-L*)
18127
18128                 # check if this refers to a directory which we will ignore
18129                 cf_rpath_skip=no
18130                 if test -n "$cf_rpath_list"
18131                 then
18132                         for cf_rpath_item in $cf_rpath_list
18133                         do
18134                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
18135                                 then
18136                                         cf_rpath_skip=yes
18137                                         break
18138                                 fi
18139                         done
18140                 fi
18141
18142                 if test "$cf_rpath_skip" = no
18143                 then
18144                         # transform the option
18145                         if test "$LD_RPATH_OPT" = "-R " ; then
18146                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
18147                         else
18148                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
18149                         fi
18150
18151                         # if we have not already added this, add it now
18152                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
18153                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
18154                         then
18155                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
18156
18157 echo "${as_me:-configure}:18157: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
18158
18159                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
18160                         fi
18161                 fi
18162                 ;;
18163         esac
18164         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
18165 done
18166 LIBS=$cf_rpath_dst
18167
18168 test -n "$verbose" && echo "    ...checked LIBS $LIBS" 1>&6
18169
18170 echo "${as_me:-configure}:18170: testing ...checked LIBS $LIBS ..." 1>&5
18171
18172         test -n "$verbose" && echo "    ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
18173
18174 echo "${as_me:-configure}:18174: testing ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
18175
18176 else
18177         echo "$as_me:18177: result: no" >&5
18178 echo "${ECHO_T}no" >&6
18179 fi
18180
18181 fi
18182
18183 TEST_ARGS="$LIBS"
18184 LIBS=
18185
18186 ac_config_files="$ac_config_files Makefile"
18187 ac_config_commands="$ac_config_commands default"
18188 cat >confcache <<\_ACEOF
18189 # This file is a shell script that caches the results of configure
18190 # tests run on this system so they can be shared between configure
18191 # scripts and configure runs, see configure's option --config-cache.
18192 # It is not useful on other systems.  If it contains results you don't
18193 # want to keep, you may remove or edit it.
18194 #
18195 # config.status only pays attention to the cache file if you give it
18196 # the --recheck option to rerun configure.
18197 #
18198 # `ac_cv_env_foo' variables (set or unset) will be overriden when
18199 # loading this file, other *unset* `ac_cv_foo' will be assigned the
18200 # following values.
18201
18202 _ACEOF
18203
18204 # The following way of writing the cache mishandles newlines in values,
18205 # but we know of no workaround that is simple, portable, and efficient.
18206 # So, don't put newlines in cache variables' values.
18207 # Ultrix sh set writes to stderr and can't be redirected directly,
18208 # and sets the high bit in the cache file unless we assign to the vars.
18209 {
18210   (set) 2>&1 |
18211     case `(ac_space=' '; set | grep ac_space) 2>&1` in
18212     *ac_space=\ *)
18213       # `set' does not quote correctly, so add quotes (double-quote
18214       # substitution turns \\\\ into \\, and sed turns \\ into \).
18215       sed -n \
18216         "s/'/'\\\\''/g;
18217           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
18218       ;;
18219     *)
18220       # `set' quotes correctly as required by POSIX, so do not add quotes.
18221       sed -n \
18222         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
18223       ;;
18224     esac;
18225 } |
18226   sed '
18227      t clear
18228      : clear
18229      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
18230      t end
18231      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
18232      : end' >>confcache
18233 if cmp -s $cache_file confcache; then :; else
18234   if test -w $cache_file; then
18235     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
18236     cat confcache >$cache_file
18237   else
18238     echo "not updating unwritable cache $cache_file"
18239   fi
18240 fi
18241 rm -f confcache
18242
18243 test "x$prefix" = xNONE && prefix=$ac_default_prefix
18244 # Let make expand exec_prefix.
18245 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
18246
18247 # VPATH may cause trouble with some makes, so we remove $(srcdir),
18248 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
18249 # trailing colons and then remove the whole line if VPATH becomes empty
18250 # (actually we leave an empty line to preserve line numbers).
18251 if test "x$srcdir" = x.; then
18252   ac_vpsub='/^[         ]*VPATH[        ]*=/{
18253 s/:*\$(srcdir):*/:/;
18254 s/:*\${srcdir}:*/:/;
18255 s/:*@srcdir@:*/:/;
18256 s/^\([^=]*=[    ]*\):*/\1/;
18257 s/:*$//;
18258 s/^[^=]*=[      ]*$//;
18259 }'
18260 fi
18261
18262 DEFS=-DHAVE_CONFIG_H
18263
18264 : ${CONFIG_STATUS=./config.status}
18265 ac_clean_files_save=$ac_clean_files
18266 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
18267 { echo "$as_me:18267: creating $CONFIG_STATUS" >&5
18268 echo "$as_me: creating $CONFIG_STATUS" >&6;}
18269 cat >$CONFIG_STATUS <<_ACEOF
18270 #! $SHELL
18271 # Generated automatically by configure.
18272 # Run this file to recreate the current configuration.
18273 # Compiler output produced by configure, useful for debugging
18274 # configure, is in config.log if it exists.
18275
18276 debug=false
18277 SHELL=\${CONFIG_SHELL-$SHELL}
18278 ac_cs_invocation="\$0 \$@"
18279
18280 _ACEOF
18281
18282 cat >>$CONFIG_STATUS <<\_ACEOF
18283 # Be Bourne compatible
18284 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
18285   emulate sh
18286   NULLCMD=:
18287 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
18288   set -o posix
18289 fi
18290
18291 # Name of the executable.
18292 as_me=`echo "$0" |sed 's,.*[\\/],,'`
18293
18294 if expr a : '\(a\)' >/dev/null 2>&1; then
18295   as_expr=expr
18296 else
18297   as_expr=false
18298 fi
18299
18300 rm -f conf$$ conf$$.exe conf$$.file
18301 echo >conf$$.file
18302 if ln -s conf$$.file conf$$ 2>/dev/null; then
18303   # We could just check for DJGPP; but this test a) works b) is more generic
18304   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
18305   if test -f conf$$.exe; then
18306     # Don't use ln at all; we don't have any links
18307     as_ln_s='cp -p'
18308   else
18309     as_ln_s='ln -s'
18310   fi
18311 elif ln conf$$.file conf$$ 2>/dev/null; then
18312   as_ln_s=ln
18313 else
18314   as_ln_s='cp -p'
18315 fi
18316 rm -f conf$$ conf$$.exe conf$$.file
18317
18318 as_executable_p="test -f"
18319
18320 # Support unset when possible.
18321 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
18322   as_unset=unset
18323 else
18324   as_unset=false
18325 fi
18326
18327 # NLS nuisances.
18328 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
18329 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
18330 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
18331 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
18332 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
18333 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
18334 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
18335 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
18336
18337 # IFS
18338 # We need space, tab and new line, in precisely that order.
18339 as_nl='
18340 '
18341 IFS="   $as_nl"
18342
18343 # CDPATH.
18344 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
18345
18346 exec 6>&1
18347
18348 _ACEOF
18349
18350 # Files that config.status was made for.
18351 if test -n "$ac_config_files"; then
18352   echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
18353 fi
18354
18355 if test -n "$ac_config_headers"; then
18356   echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
18357 fi
18358
18359 if test -n "$ac_config_links"; then
18360   echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
18361 fi
18362
18363 if test -n "$ac_config_commands"; then
18364   echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
18365 fi
18366
18367 cat >>$CONFIG_STATUS <<\EOF
18368
18369 ac_cs_usage="\
18370 \`$as_me' instantiates files from templates according to the
18371 current configuration.
18372
18373 Usage: $0 [OPTIONS] [FILE]...
18374
18375   -h, --help       print this help, then exit
18376   -V, --version    print version number, then exit
18377   -d, --debug      don't remove temporary files
18378       --recheck    update $as_me by reconfiguring in the same conditions
18379   --file=FILE[:TEMPLATE]
18380                    instantiate the configuration file FILE
18381   --header=FILE[:TEMPLATE]
18382                    instantiate the configuration header FILE
18383
18384 Configuration files:
18385 $config_files
18386
18387 Configuration headers:
18388 $config_headers
18389
18390 Configuration commands:
18391 $config_commands
18392
18393 Report bugs to <dickey@invisible-island.net>."
18394 EOF
18395
18396 cat >>$CONFIG_STATUS <<EOF
18397 ac_cs_version="\\
18398 config.status
18399 configured by $0, generated by GNU Autoconf 2.52.20150926,
18400   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
18401
18402 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
18403 Free Software Foundation, Inc.
18404 This config.status script is free software; the Free Software Foundation
18405 gives unlimited permission to copy, distribute and modify it."
18406 srcdir=$srcdir
18407 INSTALL="$INSTALL"
18408 EOF
18409
18410 cat >>$CONFIG_STATUS <<\EOF
18411 # If no file are specified by the user, then we need to provide default
18412 # value.  By we need to know if files were specified by the user.
18413 ac_need_defaults=:
18414 while test $# != 0
18415 do
18416   case $1 in
18417   --*=*)
18418     ac_option=`expr "x$1" : 'x\([^=]*\)='`
18419     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
18420     shift
18421     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
18422     shift
18423     ;;
18424   -*);;
18425   *) # This is not an option, so the user has probably given explicit
18426      # arguments.
18427      ac_need_defaults=false;;
18428   esac
18429
18430   case $1 in
18431   # Handling of the options.
18432 EOF
18433 cat >>$CONFIG_STATUS <<EOF
18434   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
18435     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
18436     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
18437 EOF
18438 cat >>$CONFIG_STATUS <<\EOF
18439   --version | --vers* | -V )
18440     echo "$ac_cs_version"; exit 0 ;;
18441   --he | --h)
18442     # Conflict between --help and --header
18443     { { echo "$as_me:18443: error: ambiguous option: $1
18444 Try \`$0 --help' for more information." >&5
18445 echo "$as_me: error: ambiguous option: $1
18446 Try \`$0 --help' for more information." >&2;}
18447    { (exit 1); exit 1; }; };;
18448   --help | --hel | -h )
18449     echo "$ac_cs_usage"; exit 0 ;;
18450   --debug | --d* | -d )
18451     debug=: ;;
18452   --file | --fil | --fi | --f )
18453     shift
18454     CONFIG_FILES="$CONFIG_FILES $1"
18455     ac_need_defaults=false;;
18456   --header | --heade | --head | --hea )
18457     shift
18458     CONFIG_HEADERS="$CONFIG_HEADERS $1"
18459     ac_need_defaults=false;;
18460
18461   # This is an error.
18462   -*) { { echo "$as_me:18462: error: unrecognized option: $1
18463 Try \`$0 --help' for more information." >&5
18464 echo "$as_me: error: unrecognized option: $1
18465 Try \`$0 --help' for more information." >&2;}
18466    { (exit 1); exit 1; }; } ;;
18467
18468   *) ac_config_targets="$ac_config_targets $1" ;;
18469
18470   esac
18471   shift
18472 done
18473
18474 exec 5>>config.log
18475 cat >&5 << _ACEOF
18476
18477 ## ----------------------- ##
18478 ## Running config.status.  ##
18479 ## ----------------------- ##
18480
18481 This file was extended by $as_me 2.52.20150926, executed with
18482   CONFIG_FILES    = $CONFIG_FILES
18483   CONFIG_HEADERS  = $CONFIG_HEADERS
18484   CONFIG_LINKS    = $CONFIG_LINKS
18485   CONFIG_COMMANDS = $CONFIG_COMMANDS
18486   > $ac_cs_invocation
18487 on `(hostname || uname -n) 2>/dev/null | sed 1q`
18488
18489 _ACEOF
18490 EOF
18491
18492 cat >>$CONFIG_STATUS <<EOF
18493 #
18494 # INIT-COMMANDS section.
18495 #
18496
18497 AWK="$AWK"
18498 ECHO_CC="$ECHO_CC"
18499 ECHO_LD="$ECHO_LD"
18500 SHOW_CC="$SHOW_LD"
18501
18502 EOF
18503
18504 cat >>$CONFIG_STATUS <<\EOF
18505 for ac_config_target in $ac_config_targets
18506 do
18507   case "$ac_config_target" in
18508   # Handling of arguments.
18509   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
18510   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
18511   "ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS ncurses_cfg.h:ncurses_tst.hin" ;;
18512   *) { { echo "$as_me:18512: error: invalid argument: $ac_config_target" >&5
18513 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
18514    { (exit 1); exit 1; }; };;
18515   esac
18516 done
18517
18518 # If the user did not use the arguments to specify the items to instantiate,
18519 # then the envvar interface is used.  Set only those that are not.
18520 # We use the long form for the default assignment because of an extremely
18521 # bizarre bug on SunOS 4.1.3.
18522 if $ac_need_defaults; then
18523   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
18524   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
18525   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
18526 fi
18527
18528 # Create a temporary directory, and hook for its removal unless debugging.
18529 $debug ||
18530 {
18531   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
18532   trap '{ (exit 1); exit 1; }' 1 2 13 15
18533 }
18534
18535 # Create a (secure) tmp directory for tmp files.
18536 : ${TMPDIR=/tmp}
18537 {
18538   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
18539   test -n "$tmp" && test -d "$tmp"
18540 }  ||
18541 {
18542   tmp=$TMPDIR/cs$$-$RANDOM
18543   (umask 077 && mkdir $tmp)
18544 } ||
18545 {
18546    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
18547    { (exit 1); exit 1; }
18548 }
18549
18550 EOF
18551
18552 cat >>$CONFIG_STATUS <<EOF
18553
18554 #
18555 # CONFIG_FILES section.
18556 #
18557
18558 # No need to generate the scripts if there are no CONFIG_FILES.
18559 # This happens for instance when ./config.status config.h
18560 if test -n "\$CONFIG_FILES"; then
18561   # Protect against being on the right side of a sed subst in config.status.
18562   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
18563    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
18564 s,@SHELL@,$SHELL,;t t
18565 s,@exec_prefix@,$exec_prefix,;t t
18566 s,@prefix@,$prefix,;t t
18567 s,@program_transform_name@,$program_transform_name,;t t
18568 s,@bindir@,$bindir,;t t
18569 s,@sbindir@,$sbindir,;t t
18570 s,@libexecdir@,$libexecdir,;t t
18571 s,@datarootdir@,$datarootdir,;t t
18572 s,@datadir@,$datadir,;t t
18573 s,@sysconfdir@,$sysconfdir,;t t
18574 s,@sharedstatedir@,$sharedstatedir,;t t
18575 s,@localstatedir@,$localstatedir,;t t
18576 s,@libdir@,$libdir,;t t
18577 s,@includedir@,$includedir,;t t
18578 s,@oldincludedir@,$oldincludedir,;t t
18579 s,@infodir@,$infodir,;t t
18580 s,@mandir@,$mandir,;t t
18581 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
18582 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
18583 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
18584 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
18585 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
18586 s,@build_alias@,$build_alias,;t t
18587 s,@host_alias@,$host_alias,;t t
18588 s,@target_alias@,$target_alias,;t t
18589 s,@ECHO_C@,$ECHO_C,;t t
18590 s,@ECHO_N@,$ECHO_N,;t t
18591 s,@ECHO_T@,$ECHO_T,;t t
18592 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
18593 s,@DEFS@,$DEFS,;t t
18594 s,@LIBS@,$LIBS,;t t
18595 s,@build@,$build,;t t
18596 s,@build_cpu@,$build_cpu,;t t
18597 s,@build_vendor@,$build_vendor,;t t
18598 s,@build_os@,$build_os,;t t
18599 s,@host@,$host,;t t
18600 s,@host_cpu@,$host_cpu,;t t
18601 s,@host_vendor@,$host_vendor,;t t
18602 s,@host_os@,$host_os,;t t
18603 s,@SET_MAKE@,$SET_MAKE,;t t
18604 s,@CC@,$CC,;t t
18605 s,@CFLAGS@,$CFLAGS,;t t
18606 s,@LDFLAGS@,$LDFLAGS,;t t
18607 s,@CPPFLAGS@,$CPPFLAGS,;t t
18608 s,@ac_ct_CC@,$ac_ct_CC,;t t
18609 s,@EXEEXT@,$EXEEXT,;t t
18610 s,@OBJEXT@,$OBJEXT,;t t
18611 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
18612 s,@CPP@,$CPP,;t t
18613 s,@AWK@,$AWK,;t t
18614 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
18615 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
18616 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
18617 s,@LINT@,$LINT,;t t
18618 s,@LINT_OPTS@,$LINT_OPTS,;t t
18619 s,@CTAGS@,$CTAGS,;t t
18620 s,@ETAGS@,$ETAGS,;t t
18621 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
18622 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
18623 s,@MATH_LIB@,$MATH_LIB,;t t
18624 s,@top_builddir@,$top_builddir,;t t
18625 s,@CC_G_OPT@,$CC_G_OPT,;t t
18626 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
18627 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
18628 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
18629 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
18630 s,@LD@,$LD,;t t
18631 s,@LDFLAGS_SHARED@,$LDFLAGS_SHARED,;t t
18632 s,@LDFLAGS_STATIC@,$LDFLAGS_STATIC,;t t
18633 s,@LD_MODEL@,$LD_MODEL,;t t
18634 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
18635 s,@LIBTOOL@,$LIBTOOL,;t t
18636 s,@LIBTOOL_OPTS@,$LIBTOOL_OPTS,;t t
18637 s,@LIB_CLEAN@,$LIB_CLEAN,;t t
18638 s,@LIB_COMPILE@,$LIB_COMPILE,;t t
18639 s,@LIB_LINK@,$LIB_LINK,;t t
18640 s,@LINK_TESTS@,$LINK_TESTS,;t t
18641 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
18642 s,@PACKAGE@,$PACKAGE,;t t
18643 s,@PTHREAD@,$PTHREAD,;t t
18644 s,@TEST_ARGS@,$TEST_ARGS,;t t
18645 s,@TEST_DEPS@,$TEST_DEPS,;t t
18646 s,@TEST_LIBS@,$TEST_LIBS,;t t
18647 s,@TINFO_LDFLAGS@,$TINFO_LDFLAGS,;t t
18648 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
18649 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
18650 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
18651 s,@includesubdir@,$includesubdir,;t t
18652 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
18653 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
18654 s,@ECHO_LT@,$ECHO_LT,;t t
18655 s,@ECHO_LD@,$ECHO_LD,;t t
18656 s,@RULE_CC@,$RULE_CC,;t t
18657 s,@SHOW_CC@,$SHOW_CC,;t t
18658 s,@ECHO_CC@,$ECHO_CC,;t t
18659 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
18660 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
18661 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
18662 s,@X_CFLAGS@,$X_CFLAGS,;t t
18663 s,@X_PRE_LIBS@,$X_PRE_LIBS,;t t
18664 s,@X_LIBS@,$X_LIBS,;t t
18665 s,@X_EXTRA_LIBS@,$X_EXTRA_LIBS,;t t
18666 s,@XCURSES_CONFIG@,$XCURSES_CONFIG,;t t
18667 s,@ac_ct_XCURSES_CONFIG@,$ac_ct_XCURSES_CONFIG,;t t
18668 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
18669 s,@cf_ldd_prog@,$cf_ldd_prog,;t t
18670 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
18671 CEOF
18672
18673 EOF
18674
18675   cat >>$CONFIG_STATUS <<\EOF
18676   # Split the substitutions into bite-sized pieces for seds with
18677   # small command number limits, like on Digital OSF/1 and HP-UX.
18678   ac_max_sed_lines=48
18679   ac_sed_frag=1 # Number of current file.
18680   ac_beg=1 # First line for current file.
18681   ac_end=$ac_max_sed_lines # Line after last line for current file.
18682   ac_more_lines=:
18683   ac_sed_cmds=
18684   while $ac_more_lines; do
18685     if test $ac_beg -gt 1; then
18686       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
18687     else
18688       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
18689     fi
18690     if test ! -s $tmp/subs.frag; then
18691       ac_more_lines=false
18692     else
18693       # The purpose of the label and of the branching condition is to
18694       # speed up the sed processing (if there are no `@' at all, there
18695       # is no need to browse any of the substitutions).
18696       # These are the two extra sed commands mentioned above.
18697       (echo ':t
18698   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
18699       # It is possible to make a multiline substitution using escaped newlines.
18700       # Ensure that we do not split the substitution between script fragments.
18701       ac_BEG=$ac_end
18702       ac_END=`expr $ac_end + $ac_max_sed_lines`
18703       sed "1,${ac_BEG}d; ${ac_END}p; q" $tmp/subs.sed >$tmp/subs.next
18704       if test -s $tmp/subs.next; then
18705         grep '^s,@[^@,][^@,]*@,.*\\$' $tmp/subs.next >$tmp/subs.edit
18706         if test ! -s $tmp/subs.edit; then
18707           grep "^s,@[^@,][^@,]*@,.*,;t t$" $tmp/subs.next >$tmp/subs.edit
18708           if test ! -s $tmp/subs.edit; then
18709             if test $ac_beg -gt 1; then
18710               ac_end=`expr $ac_end - 1`
18711               continue
18712             fi
18713           fi
18714         fi
18715       fi
18716
18717       if test -z "$ac_sed_cmds"; then
18718         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
18719       else
18720         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
18721       fi
18722       ac_sed_frag=`expr $ac_sed_frag + 1`
18723       ac_beg=$ac_end
18724       ac_end=`expr $ac_end + $ac_max_sed_lines`
18725     fi
18726   done
18727   if test -z "$ac_sed_cmds"; then
18728     ac_sed_cmds=cat
18729   fi
18730 fi # test -n "$CONFIG_FILES"
18731
18732 EOF
18733 cat >>$CONFIG_STATUS <<\EOF
18734 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
18735   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
18736   case $ac_file in
18737   - | *:- | *:-:* ) # input from stdin
18738         cat >$tmp/stdin
18739         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
18740         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
18741   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
18742         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
18743   * )   ac_file_in=$ac_file.in ;;
18744   esac
18745
18746   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
18747   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
18748          X"$ac_file" : 'X\(//\)[^/]' \| \
18749          X"$ac_file" : 'X\(//\)$' \| \
18750          X"$ac_file" : 'X\(/\)' \| \
18751          .     : '\(.\)' 2>/dev/null ||
18752 echo X"$ac_file" |
18753     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
18754           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
18755           /^X\(\/\/\)$/{ s//\1/; q; }
18756           /^X\(\/\).*/{ s//\1/; q; }
18757           s/.*/./; q'`
18758   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
18759     { case "$ac_dir" in
18760   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
18761   *)                      as_incr_dir=.;;
18762 esac
18763 as_dummy="$ac_dir"
18764 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
18765   case $as_mkdir_dir in
18766     # Skip DOS drivespec
18767     ?:) as_incr_dir=$as_mkdir_dir ;;
18768     *)
18769       as_incr_dir=$as_incr_dir/$as_mkdir_dir
18770       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
18771     ;;
18772   esac
18773 done; }
18774
18775     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
18776     # A "../" for each directory in $ac_dir_suffix.
18777     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
18778   else
18779     ac_dir_suffix= ac_dots=
18780   fi
18781
18782   case $srcdir in
18783   .)  ac_srcdir=.
18784       if test -z "$ac_dots"; then
18785          ac_top_srcdir=.
18786       else
18787          ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'`
18788       fi ;;
18789   [\\/]* | ?:[\\/]* )
18790       ac_srcdir=$srcdir$ac_dir_suffix;
18791       ac_top_srcdir=$srcdir ;;
18792   *) # Relative path.
18793     ac_srcdir=$ac_dots$srcdir$ac_dir_suffix
18794     ac_top_srcdir=$ac_dots$srcdir ;;
18795   esac
18796
18797   case $INSTALL in
18798   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
18799   *) ac_INSTALL=$ac_dots$INSTALL ;;
18800   esac
18801
18802   if test x"$ac_file" != x-; then
18803     { echo "$as_me:18803: creating $ac_file" >&5
18804 echo "$as_me: creating $ac_file" >&6;}
18805     rm -f "$ac_file"
18806   fi
18807   # Let's still pretend it is `configure' which instantiates (i.e., don't
18808   # use $as_me), people would be surprised to read:
18809   #    /* config.h.  Generated automatically by config.status.  */
18810   configure_input="Generated automatically from `echo $ac_file_in |
18811                                                  sed 's,.*/,,'` by configure."
18812
18813   # First look for the input files in the build tree, otherwise in the
18814   # src tree.
18815   ac_file_inputs=`IFS=:
18816     for f in $ac_file_in; do
18817       case $f in
18818       -) echo $tmp/stdin ;;
18819       [\\/$]*)
18820          # Absolute (can't be DOS-style, as IFS=:)
18821          test -f "$f" || { { echo "$as_me:18821: error: cannot find input file: $f" >&5
18822 echo "$as_me: error: cannot find input file: $f" >&2;}
18823    { (exit 1); exit 1; }; }
18824          echo $f;;
18825       *) # Relative
18826          if test -f "$f"; then
18827            # Build tree
18828            echo $f
18829          elif test -f "$srcdir/$f"; then
18830            # Source tree
18831            echo $srcdir/$f
18832          else
18833            # /dev/null tree
18834            { { echo "$as_me:18834: error: cannot find input file: $f" >&5
18835 echo "$as_me: error: cannot find input file: $f" >&2;}
18836    { (exit 1); exit 1; }; }
18837          fi;;
18838       esac
18839     done` || { (exit 1); exit 1; }
18840 EOF
18841 cat >>$CONFIG_STATUS <<\EOF
18842   ac_warn_datarootdir=no
18843   if test x"$ac_file" != x-; then
18844     for ac_item in $ac_file_inputs
18845     do
18846       ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' $ac_item`
18847       if test -n "$ac_seen"; then
18848         ac_used=`grep '@datarootdir@' $ac_item`
18849         if test -z "$ac_used"; then
18850           { echo "$as_me:18850: WARNING: datarootdir was used implicitly but not set:
18851 $ac_seen" >&5
18852 echo "$as_me: WARNING: datarootdir was used implicitly but not set:
18853 $ac_seen" >&2;}
18854           ac_warn_datarootdir=yes
18855         fi
18856       fi
18857       ac_seen=`grep '${datarootdir}' $ac_item`
18858       if test -n "$ac_seen"; then
18859         { echo "$as_me:18859: WARNING: datarootdir was used explicitly but not set:
18860 $ac_seen" >&5
18861 echo "$as_me: WARNING: datarootdir was used explicitly but not set:
18862 $ac_seen" >&2;}
18863         ac_warn_datarootdir=yes
18864       fi
18865     done
18866   fi
18867
18868 if test "x$ac_warn_datarootdir" = xyes; then
18869   ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
18870 fi
18871
18872 EOF
18873 cat >>$CONFIG_STATUS <<EOF
18874   sed "$ac_vpsub
18875 $extrasub
18876 EOF
18877 cat >>$CONFIG_STATUS <<\EOF
18878 :t
18879 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
18880 s,@configure_input@,$configure_input,;t t
18881 s,@srcdir@,$ac_srcdir,;t t
18882 s,@top_srcdir@,$ac_top_srcdir,;t t
18883 s,@INSTALL@,$ac_INSTALL,;t t
18884 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
18885   rm -f $tmp/stdin
18886   if test x"$ac_file" != x-; then
18887     cp $tmp/out $ac_file
18888
18889     for ac_name in prefix exec_prefix datarootdir
18890     do
18891         ac_seen=`fgrep -n '${'$ac_name'[:=].*}' $ac_file`
18892         if test -n "$ac_seen"; then
18893             ac_init=`egrep '[   ]*'$ac_name'[   ]*=' $ac_file`
18894             if test -z "$ac_init"; then
18895               ac_seen=`echo "$ac_seen" |sed -e 's,^,'$ac_file':,'`
18896               { echo "$as_me:18896: WARNING: Variable $ac_name is used but was not set:
18897 $ac_seen" >&5
18898 echo "$as_me: WARNING: Variable $ac_name is used but was not set:
18899 $ac_seen" >&2;}
18900             fi
18901         fi
18902     done
18903     egrep -n '@[a-z_][a-z_0-9]+@' $ac_file >$tmp/out
18904     egrep -n '@[A-Z_][A-Z_0-9]+@' $ac_file >>$tmp/out
18905     if test -s $tmp/out; then
18906       ac_seen=`sed -e 's,^,'$ac_file':,' < $tmp/out`
18907       { echo "$as_me:18907: WARNING: Some variables may not be substituted:
18908 $ac_seen" >&5
18909 echo "$as_me: WARNING: Some variables may not be substituted:
18910 $ac_seen" >&2;}
18911     fi
18912   else
18913     cat $tmp/out
18914   fi
18915   rm -f $tmp/out
18916
18917 done
18918 EOF
18919 cat >>$CONFIG_STATUS <<\EOF
18920
18921 #
18922 # CONFIG_HEADER section.
18923 #
18924
18925 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
18926 # NAME is the cpp macro being defined and VALUE is the value it is being given.
18927 #
18928 # ac_d sets the value in "#define NAME VALUE" lines.
18929 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
18930 ac_dB='[        ].*$,\1#\2'
18931 ac_dC=' '
18932 ac_dD=',;t'
18933 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
18934 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
18935 ac_iB='\([      ]\),\1#\2define\3'
18936 ac_iC=' '
18937 ac_iD='\4,;t'
18938 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
18939 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
18940 ac_uB='$,\1#\2define\3'
18941 ac_uC=' '
18942 ac_uD=',;t'
18943
18944 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
18945   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
18946   case $ac_file in
18947   - | *:- | *:-:* ) # input from stdin
18948         cat >$tmp/stdin
18949         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
18950         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
18951   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
18952         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
18953   * )   ac_file_in=$ac_file.in ;;
18954   esac
18955
18956   test x"$ac_file" != x- && { echo "$as_me:18956: creating $ac_file" >&5
18957 echo "$as_me: creating $ac_file" >&6;}
18958
18959   # First look for the input files in the build tree, otherwise in the
18960   # src tree.
18961   ac_file_inputs=`IFS=:
18962     for f in $ac_file_in; do
18963       case $f in
18964       -) echo $tmp/stdin ;;
18965       [\\/$]*)
18966          # Absolute (can't be DOS-style, as IFS=:)
18967          test -f "$f" || { { echo "$as_me:18967: error: cannot find input file: $f" >&5
18968 echo "$as_me: error: cannot find input file: $f" >&2;}
18969    { (exit 1); exit 1; }; }
18970          echo $f;;
18971       *) # Relative
18972          if test -f "$f"; then
18973            # Build tree
18974            echo $f
18975          elif test -f "$srcdir/$f"; then
18976            # Source tree
18977            echo $srcdir/$f
18978          else
18979            # /dev/null tree
18980            { { echo "$as_me:18980: error: cannot find input file: $f" >&5
18981 echo "$as_me: error: cannot find input file: $f" >&2;}
18982    { (exit 1); exit 1; }; }
18983          fi;;
18984       esac
18985     done` || { (exit 1); exit 1; }
18986   # Remove the trailing spaces.
18987   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
18988
18989 EOF
18990
18991 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
18992 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
18993 # be either 'cat' or 'sort'.
18994 cat confdefs.h | uniq >conftest.vals
18995
18996 # Break up conftest.vals because some shells have a limit on
18997 # the size of here documents, and old seds have small limits too.
18998
18999 rm -f conftest.tail
19000 echo '  rm -f conftest.frag' >> $CONFIG_STATUS
19001 while grep . conftest.vals >/dev/null
19002 do
19003   # Write chunks of a limited-size here document to conftest.frag.
19004   echo '  cat >> conftest.frag <<CEOF' >> $CONFIG_STATUS
19005   sed ${ac_max_here_lines}q conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> $CONFIG_STATUS
19006   echo 'CEOF' >> $CONFIG_STATUS
19007   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
19008   rm -f conftest.vals
19009   mv conftest.tail conftest.vals
19010 done
19011 rm -f conftest.vals
19012
19013 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
19014 # marker @DEFS@.
19015 echo '  cat >> conftest.edit <<CEOF
19016 /@DEFS@/r conftest.frag
19017 /@DEFS@/d
19018 CEOF
19019 sed -f conftest.edit $tmp/in > $tmp/out
19020 rm -f $tmp/in
19021 mv $tmp/out $tmp/in
19022 rm -f conftest.edit conftest.frag
19023 ' >> $CONFIG_STATUS
19024
19025 cat >>$CONFIG_STATUS <<\EOF
19026   # Let's still pretend it is `configure' which instantiates (i.e., don't
19027   # use $as_me), people would be surprised to read:
19028   #    /* config.h.  Generated automatically by config.status.  */
19029   if test x"$ac_file" = x-; then
19030     echo "/* Generated automatically by configure.  */" >$tmp/config.h
19031   else
19032     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
19033   fi
19034   cat $tmp/in >>$tmp/config.h
19035   rm -f $tmp/in
19036   if test x"$ac_file" != x-; then
19037     if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
19038       { echo "$as_me:19038: $ac_file is unchanged" >&5
19039 echo "$as_me: $ac_file is unchanged" >&6;}
19040     else
19041       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
19042          X"$ac_file" : 'X\(//\)[^/]' \| \
19043          X"$ac_file" : 'X\(//\)$' \| \
19044          X"$ac_file" : 'X\(/\)' \| \
19045          .     : '\(.\)' 2>/dev/null ||
19046 echo X"$ac_file" |
19047     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
19048           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
19049           /^X\(\/\/\)$/{ s//\1/; q; }
19050           /^X\(\/\).*/{ s//\1/; q; }
19051           s/.*/./; q'`
19052       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
19053         { case "$ac_dir" in
19054   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
19055   *)                      as_incr_dir=.;;
19056 esac
19057 as_dummy="$ac_dir"
19058 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
19059   case $as_mkdir_dir in
19060     # Skip DOS drivespec
19061     ?:) as_incr_dir=$as_mkdir_dir ;;
19062     *)
19063       as_incr_dir=$as_incr_dir/$as_mkdir_dir
19064       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
19065     ;;
19066   esac
19067 done; }
19068
19069       fi
19070       rm -f $ac_file
19071       mv $tmp/config.h $ac_file
19072     fi
19073   else
19074     cat $tmp/config.h
19075     rm -f $tmp/config.h
19076   fi
19077 done
19078 EOF
19079 cat >>$CONFIG_STATUS <<\EOF
19080 #
19081 # CONFIG_COMMANDS section.
19082 #
19083 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
19084   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
19085   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
19086
19087   case $ac_dest in
19088     default )
19089
19090 for cf_dir in .
19091 do
19092         if test ! -d $srcdir/$cf_dir; then
19093                 continue
19094         elif test -f $srcdir/$cf_dir/programs; then
19095                 $AWK -f $srcdir/mk-test.awk INSTALL=yes ECHO_LINK="$ECHO_LD" $srcdir/$cf_dir/programs >>$cf_dir/Makefile
19096         fi
19097 done
19098
19099         cat >>Makefile <<TEST_EOF
19100
19101 # These rules are generated so we do not rely on suffix rules, which do not
19102 # work consistently for different make-programs (the '\$(MODEL)/' confuses
19103 # some, and the '\$x' confuses others).
19104 TEST_EOF
19105
19106 LIST=`sed -e 's/[       ].*//' -e '/^[#@]/d' $srcdir/modules`
19107 for N in $LIST
19108 do
19109         cat >>Makefile <<TEST_EOF
19110
19111 \$(MODEL)/$N.o : \$(srcdir)/$N.c \\
19112         \$(srcdir)/test.priv.h \\
19113         ncurses_cfg.h
19114         $SHOW_CC
19115         $ECHO_CC\$(CC) -c \$(CFLAGS_DEFAULT) \$(srcdir)/$N.c
19116 TEST_EOF
19117 done
19118
19119 if test -f ../config.guess && test -f ../config.sub
19120 then
19121         cat >>Makefile <<TEST_EOF
19122
19123 # if we used CF_INHERIT for getting these files, we can remove them
19124 distclean::
19125         rm -f config.guess config.sub
19126 TEST_EOF
19127 fi
19128  ;;
19129   esac
19130 done
19131 EOF
19132
19133 cat >>$CONFIG_STATUS <<\EOF
19134
19135 { (exit 0); exit 0; }
19136 EOF
19137 chmod +x $CONFIG_STATUS
19138 ac_clean_files=$ac_clean_files_save
19139
19140 # configure is writing to config.log, and then calls config.status.
19141 # config.status does its own redirection, appending to config.log.
19142 # Unfortunately, on DOS this fails, as config.log is still kept open
19143 # by configure, so config.status won't be able to write to it; its
19144 # output is simply discarded.  So we exec the FD to /dev/null,
19145 # effectively closing config.log, so it can be properly (re)opened and
19146 # appended to by config.status.  When coming back to configure, we
19147 # need to make the FD available again.
19148 if test "$no_create" != yes; then
19149   ac_cs_success=:
19150   exec 5>/dev/null
19151   $SHELL $CONFIG_STATUS || ac_cs_success=false
19152   exec 5>>config.log
19153   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
19154   # would make configure fail if this is the last instruction.
19155   $ac_cs_success || { (exit 1); exit 1; }
19156 fi
19157